Questions tagged [setuid]

`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.

254 questions
1
vote
0 answers

Use adjtime() as non priviledged user

I am running CentOS 5.4 and was wondering if there is any way of using the "adjtime()" system call as a non-root user. Thanks in advance, really appreciate it
GKK
  • 43
  • 1
  • 5
1
vote
0 answers

Setting/Saving UISwitch State using NSUserDefaults Proofread

Developing for a jailbroken device. I've looked here for a soultion to my problem. Using NSUserDefaults for storing UISwitch state but people say alot of the codes don't work. I'm using a UISwitch to load/unload a launch daemon for iOS. I've gotten…
CokePokes
  • 941
  • 3
  • 12
  • 25
0
votes
1 answer

How to set the setuid bit in a program of a non-root user?

I am trying to make a python script executable with the setuid bit set. The program, belonging to user 'bgmc', must create some files in the directory '/home/bgmc', but is called by another user, 'client'. Indeed, I don't want user 'client' to…
sarah vb
  • 149
  • 2
  • 12
0
votes
1 answer

popen fails when called after seteuid(0)

My C code does a seteuid (euid); popen("/root/bin/iptables ....", "r"); and it fails even if I call with seteuid(0). (The executables has setuid on). It seems that seteuid and popen do not work together. When popen called it prints in stderr the…
cateof
  • 6,608
  • 25
  • 79
  • 153
0
votes
2 answers

Setting a dedicated user/password for csh scripts using "db2 connect to table" on Linux 2.6 / IBM DB2 v9.7

We have many legacy csh scripts that connect to our db2 database using "db2 connect to " command. They do NOT use "db2 connect to
user using " explicitly, so the connection defaults to the user running the script. We…
Richard
  • 184
  • 2
  • 7
0
votes
1 answer

Executing a setuid perl script within a perl script

I have two perl scripts: getPwd.pl - setuid perl script that returns a password sub getOraPwd{ ... return getOraPwd; } getOraPwd(); testDBConn.pl I want to call getPwd.pl in the testDBConn.pl script and assign the result of the getPwd script to…
user621092
  • 51
  • 1
  • 6
0
votes
1 answer

How can I elevate the privileges of an executable using setuid on Mac?

I want to create a simple script to restart the Mac. The command requires root privileges, so I decided to create an executable with the setuid bit set and the owner being root. For testing the setuid behaviour, the C…
scipsycho
  • 527
  • 2
  • 4
  • 13
0
votes
2 answers

setgid/setuid has no effect on compiled golang code 1.19

➜ go version go version go1.19.6 linux/amd64 ➜ uname -a Linux dmitry-desktop 6.1.18-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 11 16:09:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux I am unable to run compiled golang app using…
DmitrySemenov
  • 9,204
  • 15
  • 76
  • 121
0
votes
1 answer

How do I use setuid in Python?

I read this but I couldn't solve my problem. I don't know how do I use setuid I have a small python app that runs python commands and bash command in linux machine. I want only this part below to run as normal user. App run with sudo python3 app.py…
user19127009
0
votes
1 answer

Not understanding setuid

I created a VERY simple script: //#escalate.c - a setuid utility so that we can call shutdown //# and other things safely without needing root access. We //# do need to: //# gcc escalate.c -o escalate.out //# sudo chown root:root…
jpmh
  • 11
  • 2
0
votes
1 answer

How to jump between users, including root, in a perlscript?

This question has been asked here in multiple forms. I am asking it again because all these questions had too many details. Hence the answers all boiled down to how to solve those specific problems without jumping between users.This I why am posting…
Garo
  • 1,339
  • 12
  • 21
0
votes
2 answers

Run script as another user without sudo/su privileges

I'm trying to write a script so that it can be called by one user and is executed as another user. I thought that setuid might be able to do this so I enabled setuid using chmod u+s with the owner of the script being user1. I call the script (which…
Paul
  • 13
  • 3
0
votes
1 answer

Launch child process as root (python, setuid, MacOS)

How can I launch a child process that has root privileges? I have a python program in MacOS that can do most of its operations as a normal user. But occasionally, triggered by some user interaction, it will need root permissions to preform a…
Michael Altfield
  • 2,083
  • 23
  • 39
0
votes
1 answer

C cannot endors another user permissions using setresuid

I wrote the following code expecting to spawn a /bin/sh from another user. #define _GNU_SOURCE #include #include #include int main(int argc, char **argv, char **envp) { setresgid(getegid(), getegid(),…
0
votes
5 answers

how to run cmd as root from apache (centOS)?

I'm trying to run the "useradd" command in CENTOS but I can't because I need root permissions. In my php_info(); I have '--disable-posix'. I have tried to re-install my PHP, and tried to enable the posix with yum and more options, but no luck. Can…
user692601
  • 107
  • 1
  • 3
  • 12