should "create_proc_read_entry" enforce read-only semantics?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  admittedly more nitpickery, but it strikes me as a bit confusing
that you can use create_proc_read_entry() to create writable proc
files, since that routine is simply a wrapper for create_proc_entry
that passes the mode untouched and unexamined.

  that's why you can get stuff like this from drivers/scsi/scsi_proc.c

...
        p = create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
                        sht->proc_dir, proc_scsi_read, shost);
        if (!p) {
                printk(KERN_ERR "%s: Failed to register host %d in"
                       "%s\n", __FUNCTION__, shost->host_no,
                       sht->proc_name);
                return;
        }

        p->write_proc = proc_scsi_write_proc;
...

  it just seems to abuse the semantics to use a routine called
"create_proc_read_entry" to create a writable file.  but that's just
me.

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux