/proc/net/ pseudo-files, registering and using writable proc files?

Erik A Schorr (lists@demon.cwnet.com)
Fri, 28 May 1999 07:48:23 -0700 (PDT)


I'm currently getting some ideas together for an implentation of group-id based
inet_socket() and inet_bind() (the actual kernel calls, mind you). My goal is
to provide a way for the superuser or a userland daemon to pass lists of
interface addresses, ports, and group-id mappings via writable "files" under
the /proc/net tree. This will be used to give specific socket() and bind()
permissions to other users and/or daemons, not only to not require root privs
for privileged sockets (for named or syslogd, for example), but to deny o
permit certain users access to binding to specific addresses, or creating
listen()ing sockets.

Registering these files and getting data through them when they're read is no
problem; the source in linux/fs/proc/net.c and linux/net/ipv4/ explains much of
that (well, by example). BUT, even though I notice that /proc/net/ip_acct,
ip_input, ip_output, and friends in /proc/sys/net/ipv4/, are writable for the
actual changes to their respective parameters to be made, it's not obvious where
and how the kernel gets and stores the values sent to it via these "files"

Is there a definitive document that details registration, parsing of input,
and allocating/storing the data within kernel memory, with the proc filesystem?
Perhaps an example that shows these operations from start to finish, with
accompanying source to be included in the kernel...

- Erik Schorr
- If you wish to email me, please don't | erik
- "reply" to the email address in the headers. | @
- Use the one to the right instead - Thanks. | arpa.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/