Messages in this thread | | | Date | Tue, 6 May 2003 14:01:04 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] Process Attribute API for Security Modules 2.5.69 |
| |
Stephen Smalley <sds@epoch.ncsc.mil> wrote: > > This patch against 2.5.69 implements a process attribute API for > security modules via a set of nodes in a /proc/pid/attr directory.
Just a few triviata:
> +static int proc_attr_readdir(struct file * filp,
Can all this be inside CONFIG_SOMETHING? It's quite a lot of code.
> + switch (i) { > + case 0:
We often line the `case' up with the `switch' to save a tabstop.
> + if (i>=sizeof(attr_stuff)/sizeof(attr_stuff[0])) {
The ARRAY_SIZE macro does this.
> +static ssize_t proc_pid_attr_read(struct file * file, char * buf, > + size_t count, loff_t *ppos) > +{ > ... > + copy_to_user(buf, (char *) page + *ppos, count);
Need to check the return value here, return a short read if something was copied, else -EFAULT. Or just EFAULT.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |