should "create_proc_read_entry" enforce read-only semantics?

From: Robert P. J. Day
Date: Wed May 30 2007 - 08:18:39 EST



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/