Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #651

How does one use capabilities

Newsgroups comp.os.linux.development.apps
Date 2014-02-11 17:00 -0800
Message-ID <5d3aec9e-51c1-4a9a-801c-6281a8e62648@googlegroups.com> (permalink)
Subject How does one use capabilities
From Andrew Falanga <af300wsm@gmail.com>

Show all headers | View raw


Hi,

I'm learning about something that I didn't even know was in Linux for quite some time now: capabilities.  How do they actually get set?

I did something like this:

#include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <sys/capabilities.h>

int main() {
    cap_t caps = cap_get_pid(getpid());

    std::cout << "capabilities: " << cap_to_text(caps) << std::endl;
    return 0;
}

Which returns "=".  It seems unlikely that the process has no capabilities.  Plus, every code example I've found thus far (which isn't many) shows that one first allocates a cap_t struct with cap_init() and then sets the values he wishes and then calls cap_set_pid() or similar.  Is this how it's supposed to be used?

I have no idea if it makes any difference but I'm using CentOS 6.2.

Thanks,
Andy

Back to comp.os.linux.development.apps | Previous | NextNext in thread | Find similar


Thread

How does one use capabilities Andrew Falanga <af300wsm@gmail.com> - 2014-02-11 17:00 -0800
  Re: How does one use capabilities Jasen Betts <jasen@xnet.co.nz> - 2014-02-12 09:41 +0000
    Re: How does one use capabilities Andrew Falanga <af300wsm@gmail.com> - 2014-02-12 13:59 -0800
      Re: How does one use capabilities Jasen Betts <jasen@xnet.co.nz> - 2014-02-13 11:47 +0000
        Re: How does one use capabilities Joe Beanfish <joebeanfish@nospam.duh> - 2014-02-13 14:12 +0000

csiph-web