lkml.org 
[lkml]   [2014]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] afs: proc cells and rootcell are writeable
Date
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


\
 
 \ /
  Last update: 2014-01-28 22:41    [W:0.081 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site