wifi
wifi copied to clipboard
Add sudo argument to Cell.all
A user must have root access to list interfaces, but we don't
want to run python as root, which would be a big security issue.
So this PR allows to only give sudo access to iwlist
to the user
running python.
I haven't see any unittests on Cell.all
so I haven't added any. If I missed
something, please point me to it :)
cc @ametaireau
Hi @yohanboniface,
I think this is good.
Don't you need the sudo arg on other calls?
-rocky 2015年5月7日 上午9:44于 "Yohan Boniface" [email protected]写道:
A user must have root access to list interfaces, but we don't want to run python as root, which would be a big security issue. So this PR allows to only give sudo access to iwlist to the user running python.
I haven't see any unittests on Cell.all so I haven't added any. If I missed something, please point me to it :)
cc @ametaireau https://github.com/ametaireau
You can view, comment on, or merge this pull request online at:
https://github.com/rockymeza/wifi/pull/66 Commit Summary
- Add sudo argument to Cell.all
File Changes
- M wifi/scan.py https://github.com/rockymeza/wifi/pull/66/files#diff-0 (7)
Patch Links:
- https://github.com/rockymeza/wifi/pull/66.patch
- https://github.com/rockymeza/wifi/pull/66.diff
— Reply to this email directly or view it on GitHub https://github.com/rockymeza/wifi/pull/66.
Good question? :)
Answer is not yet, but certainly in the near future ;)
@splite07, I guess we'll also need sudo to activate a given cell?
Yes you are right! We will need to have sudo args on save() call, activate() call and probably delete() call
OK, I'll update my PR this way. :)
@rockymeza adding sudo
kwarg to all those method sounds ok for you?
@yohanboniface, I think it's ok. I don't know what else we would do. I would love to have some unit tests that mock subprocess just to make sure that this is working. (I know it didn't have any before, sorry!)