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
0
votes
1 answer

Set uid on directories

I used chmod 4755 for a directory. Then, when I executed "ls", it showed drwsr-xr-x. I, however, reset its permission to 0755 and it kept showing drwsr-xr-x. I do not think "s" affects anything, but it is really weird. How can I get rid of "s"? Or…
hung_tig
  • 3
  • 4
0
votes
2 answers

Set another userid to current process

I want to set current process's effective uid to other user's uid (or a arbitrary value). struct passwd* pwHost = getpwnam(hostName);//hostName is another user's name struct passwd* pwGuest = getpwnam(guestName);//guestName is the current log-in…
TonyLic
  • 647
  • 1
  • 13
  • 26
0
votes
1 answer

How to find a setuid file by using the time which it was created

I'm a newbie to OpenSUSE and playing around with the terminal commands. What i have already done is to create a .txt file and set a setuid for it and hidden it. What i wanted to know is, how can i find that particular file using the time which it…
Kulasangar
  • 9,046
  • 5
  • 51
  • 82
0
votes
0 answers

How to call CMake in a setuid program?

I wanna call CMake from a setuid executable on Linux. The code for the callcmake.cpp is: #include #include #include int main(int argc, char *argv[]) { setuid(geteuid()); system("cmake .."); } and then I…
Raymond
  • 41
  • 4
0
votes
2 answers

How find out who is the owner of a program?

I'm studing Set-UID Privileged Programs, and it seems that a program executes with a its own owner privilegies. Example: passwd can read/write the shadow file because it belongs to a root user. How can i find this kind of information for other…
0
votes
1 answer

Secure ways to impersonate a user on UNIX

I have a web application running on Apache httpd server and on UNIX. Currently it uses Perl CGI-bin executable owned by root user and with 'setuid' bit set. This root/setuid is set to run a command on behalf of remote-user of UI. Are there any…
user1360733
  • 85
  • 4
  • 6
0
votes
1 answer

Got fatal error during xfer (setuid failed) - Backuppc cygwin rsyncd

I am trying to implement rsyncd (through BackupPc) on a Windows 2002R2 server which already has cygwin on it (for accessing mail logs). I normally use a lighter installation with just the cygwin1.dll and rsyncd.exe plus the config files…
0
votes
0 answers

Cocoa Application setuid

I launch my application with an apple droplet asking for privileges to make the application work as root. Also I need it to read/write settings, so I use NSUserDefaults. I call setuid (because NSUserDefaults initWithUser doesn't work) to set the…
amplifier
  • 1,793
  • 1
  • 21
  • 55
0
votes
3 answers

windows service: get each users' %APPDATA% variable

My application runs as service and at some point it needs to loop through all existing user accounts on the system(I figured this can be done with NetUserEnum()) and try accessing a certain file under each of found users' %APPDATA% path. Problem is…
einclude
  • 1,026
  • 1
  • 9
  • 14
0
votes
1 answer

setuid bit on, yet program can't open a superuser file

I have a file superuser.cpp created by the superuser with access permissions 770. Now, the superuser creates a file setuidDemonstration.cpp in which superuser.cpp is opened using open("superuser.cpp", O_RDONLY). The .cpp and the object file of…
AvinashK
  • 3,309
  • 8
  • 43
  • 94
0
votes
1 answer

access setuid program from web page

I have a setuid page used by students to check in their programming assignments and to view their grades. The typical usage is:
   ~csXXX/bin/checkin key fileName

   ~csXXX/bin/grade key
The users must have an account on the…
0
votes
3 answers

linux id no_squash_root

The linux 'id' command reports on groups= that process belongs to. When and how does this get filled in? I'm writing an suid/sgid program and it seems that the groups never get filled in for my process and perhaps just coincidentially, but the…
Langley
  • 499
  • 6
  • 12
0
votes
3 answers

linux id and setuid/setgid

Is there a simple way to see the real,effective and saved UID and GID for a running process?
Langley
  • 499
  • 6
  • 12
0
votes
2 answers

setuid doesn't take effect

let's say there are to users A and B, belong to different group. and bot of them are not root first, as user A. 1) touch a.txt; echo "hello word" > a.txt 2)chmod 600 3) touch b 4) echo "cat a.txt" > b 5) chmod 4755 b and then switch to user B, my…
Haiyuan Zhang
  • 40,802
  • 41
  • 107
  • 134
0
votes
1 answer

How does Set-user-id bit work on Linux?

I have the following "root-file" with the following contents: $ cat root-file #!/bin/bash echo $EUID id Following are the permissions for this file: $ ls -l root-file -rwsr-sr-x 1 root root 15 Nov 18 02:20 root-file Since the set-user-id bit…
gjain
  • 4,468
  • 5
  • 39
  • 47
1 2 3
16
17