Questions tagged [suid]
78 questions
0
votes
1 answer
Check SUID attribute for open file within a kernel module
I'm writing a kernel module which needs to check the attribute suid of a given file descriptor.
I checked through the various kernel structure, but I couldn't find any clue on the topic.
I expected somehow to find a field containing a bitwise…

Alessandro
- 598
- 1
- 7
- 18
0
votes
0 answers
Is it possible to perform atomic file replacement in root-owned directory (SUID program security concerns?)
To ensure consistency on power outage, files can be updated as follows (pseudocode):
echo original_contents > file
echo new_contents > /tmp_dir_in_same_fs/file.tmp
mv /tmp_dir_in_same_fs/file.tmp file
Now the thing is, if the files are in a folder…

cJ Zougloub
- 1,484
- 10
- 19
0
votes
1 answer
Set-id bits on an ISO
I'm creating an ISO of a Debian system with:
mkisofs -V "Debian ISO" -cache-inodes -J -l -o file.iso debian-system/
The problem is: when I mount the ISO (mount -o loop) ping and sudo don't work because their suid bits have not been set.
I know that…

Eric
- 1,138
- 11
- 24
0
votes
1 answer
What is SUID bit used for
From what I read "SUID bit gives other users the ability to run a file with the permissions of the file owner"
So I did this
2 users : user1 & user2
User 1 creates a script
#/bin/bash
touch /home/user1/file1
User 1 does a chmod 4777 on the script…

searcot jabali
- 438
- 6
- 16
0
votes
1 answer
Ruby gem executable with SUID not working as it should
As you may see by the image below, I changed the ownership of my emerald_setupscript to root:root and also set the SUID.
It happens that when I install the gem and check this script, it belongs to edvaldo:edvaldo (my user name) and has no SUID at…

Ed de Almeida
- 3,675
- 4
- 25
- 57
0
votes
1 answer
-SUID- Can't run a "-rwsr-xr-x" file as root
I am using Ubuntu 16.10.
I was following along a book, doing something like this:
#include
int main() {
printf("Real UID:\t%d\n", getuid());
printf("Effective UID:\t%d\n", geteuid());
}
And to run this file as sudo without using…

coffeeFlow
- 179
- 1
- 6
0
votes
2 answers
Executable file set root suid, but access(path, W_OK) still return -1?
Why executable file set root suid, but access(path, W_OK) still return -1?
Code:
#include
#include
int main()
{
printf("privilege => %d\n", access("/usr/local/etc/t.conf", W_OK));
return 0;
}
Test run:
[www@mypy…

Rito Yan
- 13
- 3
0
votes
1 answer
SUID doesn't work in Bash
I wrote a simple bash script that makes a backup of the home directory, e puts it into /var/backups.
Since that directory is protected, I wrote the script as root, and then set the SUID.
armando@ubuntu:~/scripts/bash $ ll
-rwsr-xr-x 1 root root …

Alex Gay
- 3
- 1
- 2
0
votes
1 answer
Setuid on scripts with C wrapper
i've just want to use a php script with root permission with a C wrapper like this tutorial.
ls -l :
-rwsr-xr-x. 1 root root 6466 Aug 15 03:07 createConfig
-rwxrwxrwx. 1 root root 102 Aug 15 04:23 test.php
-rw-r--r--. 1 root root 822 Aug 14 21:35…

mahia MooshooL
- 25
- 6
0
votes
1 answer
shell script to set the suid bit as root user
I need a Shell script, this shell script should :
1. create another shell script
2. set the suid bit for new script as a root user
3. run this new script as current user
Can we do this?
anyone can give any idea or some code snippets?

user1731553
- 1,887
- 5
- 22
- 33
0
votes
1 answer
Why my own suid-ed program still holds the original uid?
I'm using the following program, and I've suid-ed it (by running chown root XXX; chmod 4755 XXX as root), but the output is still ruid 1000, euid 1000, suid 1000, shouldn't effect uid be zero here?
#define _GNU_SOURCE
#include
#include…

daisy
- 22,498
- 29
- 129
- 265
0
votes
2 answers
suid bit script perl
I'm making a perl script to change the brightness.
I must write in the file 'brightness' which is set to read only.
I want to use the SUID bit so I did.
$> sudo chown root:root brightness
$> sudo chmod 4755 brightness
$> ls -l brightness
-rwsr-xr-x…

nsvir
- 8,781
- 10
- 32
- 47
0
votes
1 answer
Insert serialVersionUID with ANT
Is it possible to use an ANT task to insert the serialVersionUID property into all classes that implement Serializable?
I would like to be able to keep a list of classes vs SUIDs and use that to insert values.
Currently the source code does not have…

nerd
- 45
- 1
- 5
0
votes
2 answers
compile shell script so can use suid
I need to suid a script so that it can be executed by users with less permissions. Since you can't suid a script and can only suid an executable I wanted to use the generic script compiler "shc" to create an executable and then set that…

john ryan
- 315
- 5
- 8
-1
votes
1 answer
how to create an Autocomplete element?
I'm looking for the Autocomplete element of Material UI and React for SolidJS. Many of the elements are available in Solid through https://suid.io/, but https://mui.com/material-ui/react-autocomplete/ seems to be missing.
Is there any library…

vjalle
- 549
- 4
- 13