[lkml]   [1999]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: capabilities in elf headers, (my) final (and shortest) iteration
In message <>, Riley 
Williams writes:
| > Just where do you think the perl interpreter is going to look to
| > decide what capabilities to enable? suidperl just stats the
| > script and looks at the setuid bits to decide what to do. If the
| > capability bits are not in the fs, where will suidcapperl find
| > them? There ain't no ELF header in a script.
| > Not that I really care one way or the other about capabilities,
| > just wondering if anyone has really thought this through before
| > posting "it's up to the interpreter"
| {Shrug} Perhaps somebody can suggest some way that capabilities can
| have meaning for a script, any script if it comes to that?

My inclination is that if a script needs capabilities, you should use a
wrapper executable. I don't like setuid scripts, I don't like set-capability
scripts for the same reason.

OTOH, it occurs to me that both the question of scripts with capabilities and
the problem of capabilitied executables on pre-capabilities kernels could be
solved by placing capability information in a header at the start of the
file. This header would be a multiple of a page size. exec()ing such a file
would validate the capabilities header, grant/revoke capabilities as needed,
then skip the header and fall through to the normal exec() mechanism.

This also solves the issue of capabilities being tied to the ELF file format,
for the Stone Age folk who are still running PDP-11 format executables :-)

This means you can't (easily) edit the script after attaching
capabilities... but that is in fact the correct behavior, editing the script
*should* invalidate the capabilities and *shouldn't* be done unless there's a
really good reason.

(Note that I am *not* advocating this; please reread the first paragraph.
I'm tossing it out as an option, in case it's decided that we for some reason
really want to enable set-capability scripts.)


brandon s. allbery [os/2][linux][solaris][japh]
system administrator [WAY too many hats]
carnegie mellon / electrical and computer engineering KF8NH
We are Linux. Resistance is an indication that you missed the point.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [W:0.097 / U:2.500 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site