`setuid` is a file permission flag under Unix-like systems that will run an executable with the file owner's permissions rather than the invoking user's. On some systems (FreeBSD), it further works identically to the related `setgid` flag on directories, causing new files to inherit the directory's permissions rather than the current user's.
Questions tagged [setuid]
254 questions
1
vote
1 answer
setuid bash script and binfmt_misc credentials flag
In asking this question, I'm not looking to be told that I shouldn't be doing this or that it's insecure. Those matters beyond the scope of this question.
Linux respects the setuid andsetgid bits on scripts when they are registered in the…

Melab
- 2,594
- 7
- 30
- 51
1
vote
2 answers
set-UID privieged programs
I have 2 question:
Consider the situation where Alice runs a owned Set-UID program
by Bob. The program wants to read the file contained in / etc / data, readable by
Alice, but by no one else. Can this program access the file?
Consider the…

Matteo Dal Grande
- 95
- 1
- 2
- 7
1
vote
0 answers
How to use a setuid bit on a Python script?
I want to check if the setuid bit is correct for my Python script, so I'm trying to add some code to print the user that's running it.
I tried getpass.getuser() but I believe that looks at environment variables to determine the user. I don't think…

Bee
- 195
- 1
- 3
- 12
1
vote
1 answer
What can a process with UID 0 do that a process with EUID 0 can't?
I realised I've missed a subtlety with user IDs (UID) and effective user IDs (EUID) and need some clarification. N.B. I'm working on macOS, although I suspect everything makes sense in a Linux world as well.
I've created a binary and set the setuid…

Andrew Parker
- 1,425
- 2
- 20
- 28
1
vote
1 answer
LD_LIBRARY_PATH in envp arg of execve() gets removed even if the calling setuid parent prog dropped its privileged
Background:
I understood that a parent program with setuid cannot keep the LD_LIBRARY_PATH as part of the env for security reasons, hence any child process will also not "see" the LD_LIBRARY_PATH.
Context :
My parent program (see…

GuiHome
- 21
- 7
1
vote
0 answers
Permission problems in setuid-root program
I have written a program, compiled it, copied it to /usr/local/bin/ and gave it setuid-root file permission.
Unfortunately, I cannot get the program to run as desired because of permission problems - that is, it runs well when I call it as a…

Christoph
- 11
- 1
1
vote
0 answers
opentpty() with setuid in CentOS 7
Running executable with set uid that calls openpty() fails under CentOS 7, but works under CentOS 6. The issue appears to be with opentpty() trying to chown /dev/pts/* from effective uid to real uid. Both 6 and 7 do it. It fails in both 6 and 7. …

Peter Klimczak
- 11
- 1
1
vote
1 answer
trying to understand LD_PRELOAD and SUID/SGID with checkinstall or porg
I want to use porg in my LFS distro. It's similar to checkinstall, it uses LD_PRELOAD.
1. If you read the README:
CheckInstall currently is unable to track any file system changes made
by statically linked programs
I think it refers to the…

Giorgio Napolitano
- 375
- 3
- 11
1
vote
1 answer
Fail to seteuid in java by calling JNI
My app need to run as none-root user but need to switch to other user to execute some commands.
I tried to:
write a JNI,
JNIEXPORT void JNICALL Java_SetUIDJNI_setuid(JNIEnv *env, jobject thisObj,jstring uname) {
const char *name =…

Jin Guo
- 110
- 4
1
vote
1 answer
Executable with setuid does not find shared library
guys.
Here's my problem :
I have an executable which needs to create a folder in a particular emplacement in the system.
I'd like it to be able to do so no matter who execute it.
My idea was to give the parent folder (the one the executable needs to…

Pouf
- 61
- 4
1
vote
1 answer
Clearcase: How to control whether SUID programs work in a view or not?
We have two machines (under discussion) running ClearCase - different versions of ClearCase. Otherwise, they are about as identical in setup as can be - same Linux x86/64 kernel etc.
On one machine, SUID root programs in the view work as SUID root…

Jonathan Leffler
- 730,956
- 141
- 904
- 1,278
1
vote
1 answer
Confused: File ownership changed with setuid special permission flag
File Permission with setuid enabled(rws).
File Owner: vaisakh
vaisakh@computer:~/me$ ls -l
total 4
-rwsr-xr-x 1 vaisakh vaisakh 60 May 3 17:05 vaisakh.sh
Switch to an another user var23
vaisakh@computer:~/me$ su var23
Password:
Rechecking the…

Vaisakh Rajagopal
- 1,189
- 1
- 14
- 23
1
vote
1 answer
subprocess.check_output ignoring euid
I have the following bash script:
echo "$(id -u)"
mkdir test
My own user id is 1000. Now, when I run python3.5 without root rights and invoke the script via subprocess.check_output the script works as expected and creates a folder which is owned by…

Sleik
- 341
- 4
- 11
1
vote
1 answer
Root daemon->impersonate as lesser user->fork a child. Is child process user or has some root privileges?
If I make a root privileged process impersonate some lesser user, and fork a child, is it safe to assume that the child has the user privileges, and nothing to do with the root? I'm using default custom made methods to imperosnate as the user and…

Raksh
- 51
- 3
1
vote
0 answers
Python: using SQLite after setuid
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
Type "copyright", "credits" or "license" for more information.
IPython 2.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick…

gvolt
- 21
- 2