POSIX.2c getpcap utility

Thomas Moestl tmoestl at gmx.net
Tue Mar 6 00:42:36 GMT 2001


Hello,

I'm currently in the process of writing the POSIX.2c set of capability
utilities. The specification for getpcap, however, seems rather broken 
to me. Draft 17 states in section 9.2.2:

  The getpcap utility writes the capability state of the invoking 
  process to standard output.

And again in 9.2.6:

  The getpcap utility writes to standard output the textual 
  representation of the capability state of the invoking process
  in the text form specified in 9.1.

This cannot be implemented, because each process only knows its
own capability state (using the POSIX.1e cap_get_proc()) and anyway,
the capability state of the invoking process is lost on exec().
So, getpcap will only be able to print the capabilities it inherited
from the invoking process. The only way I could imagine the draft 
behaviour to be achieved is as using shell builtin (so that at least 
shell users get the right results).

If invoking was meant to be a fork()/exec() sequence, then at least
another interface would be needed to get the capability state for
an arbitrary pid.

I would be very much interested how this is handled in other 
implementations.

Thanks,
	- thomas

To Unsubscribe: send mail to majordomo at cyrus.watson.org
with "unsubscribe posix1e" in the body of the message



More information about the posix1e mailing list