4

I have a libpcap based application. Now, to allow non-root users to use my app, during installation , i use setcap

setcap cap_net_raw=ep /bin/myapp

But, in case the Linux Distro on which i install my app does not support Linux Capabilities, i want to use setuid(). Now, is their any way by which we can figure out whether Linux Capabilities and setuid() are supported for current Linux Distro or not. Besides, is there any link, where all Linux Distros having Linux Capabilities support are displayed.

4
  • I thought capabilities was a thing of Linux(?)
    – WikiWitz
    Commented Jan 22, 2013 at 13:26
  • @WikiWitz It is a thing of Linux, but some custom kernels don't come with Linux Capabilities support. Commented Jan 22, 2013 at 13:46
  • @WikiWitz Some older filesystems don't have a place to store capabilities, too. Commented Jan 22, 2013 at 14:26
  • Do we have an answer to the actual question, ie : "how to check either linux has a given capability " ? Commented Dec 24, 2015 at 14:37

1 Answer 1

1

You can check the current used kernel config

# cat /proc/config.gz | gunzip | grep CAPABILITY                                                                   
CONFIG_CCSECURITY_CAPABILITY=y

This indicate that CONFIG_CCSECURITY_CAPABILITY is used and thus capabilities are enabled.

Also if libcap-utils are installed /sbin/capsh --print can be used to check the availability of the capability.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .