suid

NSTask, command line tools and root

半世苍凉 提交于 2019-12-04 06:04:31
I'm working on an app that needs to use dd (I do this with a shell script in the app bundle, that collects parameters from the app itself, makes some checks and then launches dd). To make this operation I need to call dd with root, and I already looked at several solutions on StackOverflow. The simplest to implements seemed to me this one http://www.sveinbjorn.org/STPrivilegedTask Problem is that my NSTask makes some complex read/write operations (not present in STPrivilegedTask) and does not need to be all privileged. So I wrote a small helper tool in c that calls my script with correct

Security concerns with a Python PAM module?

霸气de小男生 提交于 2019-12-03 11:40:48
I'm interested in writing a PAM module that would make use of a popular authentication mechanism for Unix logins. Most of my past programming experience has been in Python, and the system I'm interacting with already has a Python API. I googled around and found pam_python , which allows PAM modules to invoke the python intrepreter, therefore allowing PAM modules to be written essentially in Python. However, I've read that there are security risks when allowing a user to invoke Python code that runs with a higher access level than the user itself, such as SUID Python scripts. Are these concerns

How to restart Linux from inside a C++ program?

我是研究僧i 提交于 2019-12-03 05:37:57
I have a Qt 4 GUI where I need to have a option in a drop-down menu that allows the user to choose to restart the computer. I realize this might seem redunant with the ability to restart the computer in other ways, but the choice needs to stay there. I've tried using system() to call the following: a suid-root shell script a non-suid shell script a suid-root binary program and all of them just cause reboot: must be superuser to be printed. Using system() to call reboot directly does the same thing. I'm not especially attached to using system() to do this, but it seemed like the most direct

SUID not working with shell script

若如初见. 提交于 2019-11-27 09:16:43
I have created a small shell script with the following content: cat /usr/bin/checksuid.sh !/bin/bash echo "Hello" > /etc/myfile.cnf ls -l /usr/bin/checksuid.sh -rwsr-xr-x 1 root root 56 Sep 9 12:56 /usr/bin/checksuid.sh I have also created a file /etc/myfile.cnf with root account and set permissions as below: -rw-r--r-- 1 root root 6 Sep 9 12:26 /etc/myfile.cnf When I execute /usr/bin/checksuid.sh from a non-root account, I get the following error: /usr/bin/checksuid.sh: line 3: /etc/myfile.cnf: Permission denied Can some one help you that why SUID is not working? Shell scripts can't be SUID.

SUID not working with shell script

大憨熊 提交于 2019-11-26 14:37:36
问题 I have created a small shell script with the following content: cat /usr/bin/checksuid.sh !/bin/bash echo "Hello" > /etc/myfile.cnf ls -l /usr/bin/checksuid.sh -rwsr-xr-x 1 root root 56 Sep 9 12:56 /usr/bin/checksuid.sh I have also created a file /etc/myfile.cnf with root account and set permissions as below: -rw-r--r-- 1 root root 6 Sep 9 12:26 /etc/myfile.cnf When I execute /usr/bin/checksuid.sh from a non-root account, I get the following error: /usr/bin/checksuid.sh: line 3: /etc/myfile