[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0705300813150.13465@localhost.localdomain>
Date: Wed, 30 May 2007 08:17:13 -0400 (EDT)
From: "Robert P. J. Day" <rpjday@...dspring.com>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: should "create_proc_read_entry" enforce read-only semantics?
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists