11-04-2019 04:16 PM
Hi, I'm trying to follow these instructions for 2019:
First I getcap lvrt:
getcap lvrt lvrt = cap_net_bind_service,cap_net_admin,cap_ipc_lock,cap_sys_rawio,cap_sys_boot,cap_sys_nice,cap_sys_time+ep
then I setcap
setcap cap_net_bind_service,cap_net_admin,cap_ipc_lock,cap_sys_rawio,cap_sys_boot,cap_sys_nice,cap_sys_time+ep,cap_net_raw+eip lvrt
and I get back
fatal error: Invalid argument usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ] Note <filename> must be a regular (non-symlink) file.
If I don't include cap_net_raw (or cap_net_raw+ep or +eip) setcap works fine. Did cap_net_raw get renamed? or does it need special permissions to set?
Solved! Go to Solution.
11-04-2019 04:30 PM
I think your capability string is malformed. See https://linux.die.net/man/3/cap_from_text for formatting info:
"A textual representation of capability sets consists of one or more whitespace-separated clauses."
"Each clause consists of a list of comma-separated capability names (or the word 'all'), followed by an action-list."
"An action-list consists of a sequence of operator flag pairs. Legal operators are: '=', '+', and '-'. Legal flags are: 'e', 'i', and 'p'."
Something like this might work: setcap "aaa,ccc+ep ccc+eip" /path/to/bin
11-04-2019 04:36 PM
Thanks for checking that. Based on your message I figured I might try just using "all" and seeing if that worked...but unfortunately, I get the same error.
11-05-2019 08:55 AM
just reformatted and reinstalled, same issue
11-05-2019 10:05 AM
I successfully ran the following on my controller with LabVIEW 2019, logged in as admin via ssh:
> setcap "cap_net_bind_service,cap_net_admin,cap_ipc_lock,cap_sys_rawio,cap_sys_boot,cap_sys_nice,cap_sys_time+ep cap_net_raw+eip" /usr/local/natinst/labview/lvrt
> getcap /usr/local/natinst/labview/lvrt
/usr/local/natinst/labview/lvrt = cap_net_raw+eip cap_net_bind_service,cap_net_admin,cap_ipc_lock,cap_sys_rawio,cap_sys_boot,cap_sys_nice,cap_sys_time+ep
11-05-2019 10:20 AM
Ok, hrm, I thought I had tried almost exactly that after your post (in addition to the all), but I guess not.
Thank you for your help, that worked perfectly.