setuid Questions

3

Solved

I want to make a custom webserver via golang. It needs root to bind to port 80. However I want to drop root as soon as possible. syscall.SetUid() returns "Not supported" as per ticket #1435. I co...
Hickie asked 20/12, 2016 at 18:20

3

I made a perl script to change owner of a file owned by some other user. Script is complete. My administrator save that in /sbin directory and set uid for it using chmod u+s name_of_script. But whe...
Implode asked 6/2, 2014 at 8:9

3

What is the difference between setuid and seteuid function. In man page both of the function have similar description. setuid: DESCRIPTION setuid() sets the effective user ID of the calling pro...
Krill asked 12/10, 2015 at 8:31

4

Solved

I've got a long running, daemonized Python process that uses subprocess to spawn new child processes when certain events occur. The long running process is started by a user with super user privile...
Junie asked 20/11, 2009 at 12:39

4

Solved

I am running this small python script on both linux and Solaris as a not privileged user : #!/usr/bin/python import os print 'uid,euid =',os.getuid(),os.geteuid() Before running, the setuid bit ...
Unbridled asked 29/11, 2011 at 16:13

5

I am trying to use LD_PRELOAD to preload a library with an application that has setuid permissions. Tried LD_PRELOAD at first, and it seemed like it was being ignored with the setuid binary, though...
Christen asked 10/2, 2012 at 18:32

4

Solved

This is a set-root-uid program $ls -l -rwsr-sr-x 1 root root 7406 2011-12-13 22:37 ./x* The source code: int main(void) { printf( " UID GID \n" "Real %d Real %d \n" "Effective %d Effective ...
Blowhard asked 14/12, 2011 at 3:53

1

Solved

i'm currently doing the bandit wargames from overthewire.org (for those of you who don't know it's a website with different tasks that you get to do in order to improve your hacking skills). i did ...
Wamsley asked 9/8, 2018 at 20:23

1

Solved

I have a librandom.so library and a main exectuable which was compiled as follows: $ clang++ -o main main.o -lrandom -L. -Wl,-rpath,"\$ORIGIN" They are both in the same directory. Since main has...
Panicstricken asked 14/9, 2016 at 9:23

1

Solved

I'm trying to figure out a way to set permissions recursively 700 for dirs and subdirs on a specific path and 600 for files. I would use these commands: find /path -type d -print0 | xargs -0 chmod ...
Sielen asked 11/4, 2016 at 16:1

1

I created this simple script to allow the user to remove files created by the web server in his home directory without giving him "su". Both scripts are set with "chmod 4750". The craziest thing i...
Talamantes asked 6/11, 2015 at 11:24

1

Solved

I've written a simple go program using YAML and the MySQL drivers with the intention of providing a simple utility to update a database without exposing the username and password credentials to the...
Gryphon asked 31/5, 2015 at 0:50

3

Both system() and execve() can be used to execute another command inside a program. Why in set-UID programs, system() is dangerous, while execve() is safe ?
Brassbound asked 12/12, 2014 at 10:25

2

Solved

Is there a way to change UID/GID only of one thread in a multithreaded process? The reason for this is writing a file-serving application - the ACL's and quota are not enforced unless the uid/gid ...
Kyd asked 3/8, 2009 at 17:36

5

Solved

I'm trying to build a platform to launch some scripts. This scripts are placed in home folder of each user. Every launch should be done with each user id so, I'm doing, for each user, this: user_i...
Imagine asked 23/9, 2011 at 12:53

1

Solved

I'm writing a module for Linux PAM, which uses setuid() to drop privileges to the user being authenticated. Of course, this will only work if the EUID is root. So, is the PAM stack always run as ro...
Pirbhai asked 10/6, 2014 at 21:59

5

Solved

I am running valgrind as follows:- /usr/local/bin/valgrind "process_name" After excecution its giving me following error ==21731== ==21731== Warning: Can't execute setuid/setgid executable: ==...
Remex asked 9/11, 2009 at 15:29

1

Solved

I have a problem with my Linux daemon program. It starts with root privileges, does some configuration, then permanently drops privileges by switching to some user and group and continues working. ...
Talyah asked 24/1, 2014 at 16:43

3

Solved

I wrote a small C utility called killSPR to kill the following processes on my RHEL box. The idea is for anyone who logs into this linux box to be able to use this utility to kill the below mention...
Formfitting asked 17/12, 2013 at 7:31

2

Solved

I'm trying to run sudo, and it's failing: gregd@david $ sudo ls sudo: must be setuid root gregd@david $ which sudo /usr/bin/sudo gregd@david $ ll /usr/bin/sudo -rwxr-xr-x 1 root root 165K 20...
Finedraw asked 22/5, 2013 at 1:58

3

Solved

I have an program which I run as root. I would like the program to execute another application as a normal user. I tried setgid() and it works, but I can't then go back to root or another user. The...
Juba asked 27/9, 2013 at 10:2

2

Solved

I am reading output from another process which generates output (slow and infinite). Because I want to read this data in real-time I use "stdbuf -oL" (line-buffered, data is text). I do not have co...
Leavenworth asked 30/11, 2012 at 11:7

2

Solved

Does Linux have some C interface similar to setuid, which allows a program to switch to a different user using e.g. the username/password? The problem with setuid is that it can only be used by sup...
Canonicate asked 23/10, 2012 at 23:2

2

Solved

I'm trying to set up a git post-receive hook such that when a commit is received, another clone of the repository on the machine gets updated (i.e. does a git pull origin master). I'm using gitosis...
Relativity asked 23/12, 2009 at 7:6

1

Solved

I created a setuid program in C. The executable looks like this: -r-s-r-s--- 1 root users 13073 Jun 15 21:56 server I execute the program as userA/users and try to set the uid/gid to userB/other...
Malisamalison asked 16/6, 2012 at 5:12

© 2022 - 2024 — McMap. All rights reserved.