teampizza / backpack

_you_ got your back
GNU Affero General Public License v3.0
5 stars 1 forks source link

Pcap permission is not available to user #32

Open ghost opened 9 years ago

ghost commented 9 years ago
➤ gulp parser
[16:24:15] Using gulpfile ~/backpack/gulpfile.js
[16:24:15] Starting 'parser'...
[16:24:15] Finished 'parser' after 1.48 ms
[gulp] [nodemon] v1.3.7
[gulp] [nodemon] to restart at any time, enter `rs`
[gulp] [nodemon] watching: *.*
[gulp] [nodemon] starting `node backend/parser/pcap_parser.js`

/home/sobakasu/unisync/projects/privacy/backpack/node_modules/pcap/pcap.js:47
        me.link_type = me.session.open_live(me.device_name, filter || "", me.b
                                  ^
Error: socket: Operation not permitted
    at Pcap.open (/home/sobakasu/unisync/projects/privacy/backpack/node_modules/pcap/pcap.js:47:35)
    at Object.exports.createSession (/home/sobakasu/unisync/projects/privacy/backpack/node_modules/pcap/pcap.js:99:13)
    at start_capsession (/home/sobakasu/unisync/projects/privacy/backpack/backend/parser/pcap_parser.js:50:8)
    at Object.<anonymous> (/home/sobakasu/unisync/projects/privacy/backpack/backend/parser/pcap_parser.js:21:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

Additionally, running gulp setcap, which runs a script that is supposed to make this operation permissible to the current user, does not work.

ghost commented 9 years ago

See https://github.com/teampizza/backpack/blob/devel/backend/parser/cap_permission.sh for the script used.

ghost commented 9 years ago

Note that if nvm is running in a different shell than the one you have configured, the permissions setting will not be able to find that executable since the environment vars are different ($NVM_BIN will not exist, for example). This happens if you run fish and is something I need to figure out.