Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH] afs: proc cells and rootcell are writeable | Date | Tue, 28 Jan 2014 20:56:44 +0000 |
| |
Al Viro <viro@ZenIV.linux.org.uk> wrote:
> > ... and then making proc_create() only permit regular files (and complain > > if the S_IFMT field is not zero)? > > We already do: in proc_create_data() we have > struct proc_dir_entry *pde; > if ((mode & S_IFMT) == 0) > mode |= S_IFREG; > > if (!S_ISREG(mode)) { > WARN_ON(1); /* use proc_mkdir() */ > return NULL; > } > > proc_mkdir{,_data,_mode} are there for purpose. Nobody had been insane > enough to put FIFOs or sockets in procfs and anything else would need > additional data anyway. proc_symlink() is there, proc_mknod() isn't and > nobody has complained yet. Let's keep it that way, plese...
Should we then change the proc_create_data() to do:
struct proc_dir_entry *pde;
if (mode & S_IFMT) { WARN_ON(1); /* use proc_mkdir() */ return NULL; } mode |= S_IFREG;
and stop passing S_IFREG into it?
David
| |