Sponsored Content
Full Discussion: setuid & sticky bit
Top Forums UNIX for Dummies Questions & Answers setuid & sticky bit Post 302577869 by methyl on Wednesday 30th of November 2011 06:25:27 AM
Old 11-30-2011
Really need to know what Operating System and version you are running because the meaning of what used to be known as the "sticky bit" has changed in modern O/S.
There is no unix command called "setuid" - it is a system call in the "C" programming language. There is however an explanation of the sticky bit in "man chmod".
There are unix command called "chmod" and "chown" and there are also system calls called "chmod" and "chown" in the "C" programming language.
Not sure whether you are looking from the point of view of a writing "C" programs or some other angle.

See:
Code:
# For "C" programming language
man 2 chmod
man 2 setuid
man 2 chown

# For unix commands
man chmod
man chown

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sticky bit

I have a questions, whose answer may be very obvious: Of what use is the sticky-bit permission on a Unix system? I have looked at the chmod(1) man page on our HP-UX playground system, and haven't been given much explanation: Add or delete the save-text-image-on-file- execution (sticky... (3 Replies)
Discussion started by: LivinFree
3 Replies

2. UNIX for Dummies Questions & Answers

sticky bit??

I have a script that I want to be able to let user 'wcs1234' execute it, but when it runs, it will do so under the higher authority of 'cdunix'. It is my understanding that I accomplish this with a sticky bit. I have tried every variation of this but am unable to get this to work. my script is... (2 Replies)
Discussion started by: hedrict
2 Replies

3. UNIX for Advanced & Expert Users

setuid sticky bit

I have a binary. It is having the following permissions rws rws rwx mqm:mqm runmqtrm The same program on another machine is rws rws rwx root: mqm runmqtrm This program is a setuid program. This is what my understanding is. Whatever user the program is started under, it will finally be... (0 Replies)
Discussion started by: bandaru
0 Replies

4. UNIX for Dummies Questions & Answers

Sticky Bit

I have the sticky bit set on my /tmp directory, but users are still able to remove files that are not owned by them. Does the /etc/group file get invloved in securing these files ?? (1 Reply)
Discussion started by: rob11g
1 Replies

5. Shell Programming and Scripting

sticky bit

Hi frns, What is command to list out all dir's for which sticky bit has been set. Regards, Manu (2 Replies)
Discussion started by: manu.vmr
2 Replies

6. UNIX for Dummies Questions & Answers

Question regarding permision and seguid bit (sticky bit)

Hi , I am having file permision as drwxrwsr_x I kwo for deleting a file in the diretory i need w permsion as well .. Say if i am having the permsion as drwxrwsrwx - wil any one can delete the files in the directory .. And one more question what is the s doing there ..... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

7. UNIX for Dummies Questions & Answers

Sticky Bit????

HI What is sticky bit? how can be see if the sticky bit for file is set? WHat is meaning of sticky bit set on Directory? What is the syntax to set the sticky bit? With example Thanks (10 Replies)
Discussion started by: skyineyes
10 Replies

8. Shell Programming and Scripting

Sticky Bit

I want a file I create to not be deletable by other users so I created a sticky bit by chmod 1644 on the file. chown'd it to root and then tried to delete (via GUI drag to trash and empty) as a non root user and it let me. is sticky bit only good for terminal deletes or something? (4 Replies)
Discussion started by: glev2005
4 Replies

9. AIX

sticky bit

as far as i understand, if sticky bit is set on a directory, the files created under tht directory cannot be deleted by ordinary user... but we can do ths by permission itself,,, tht's assign only read permission to tht dirrectory wht 's the difference? (1 Reply)
Discussion started by: udtyuvaraj
1 Replies

10. UNIX for Beginners Questions & Answers

What keeps me from abusing setuid(0) and programs with setuid bit set?

Just learning about the privilege escalation method provided by setuid. Correct me if I am wrong but what it does is change the uid of the current process to whatever uid I set. Right ? So what stops me from writing my own C program and calling setuid(0) within it and gaining root privileges ? ... (2 Replies)
Discussion started by: sreyan32
2 Replies
STICKY(8)						      System Manager's Manual							 STICKY(8)

NAME
sticky - persistent text and append-only directories DESCRIPTION
The sticky bit (file mode bit 01000, see chmod(2)) is used to indicate special treatment for certain executable files and directories. STICKY TEXT EXECUTABLE FILES
While the `sticky bit' is set on a sharable executable file, the text of that file will not be removed from the system swap area. Thus the file does not have to be fetched from the file system upon each execution. Shareable text segments are normally placed in a least-fre- quently-used cache after use, and thus the `sticky bit' has little effect on commonly-used text images. Sharable executable files are made by the -n and -z options of ld(1). Only the super-user can set the sticky bit on a sharable executable file. STICKY DIRECTORIES
A directory whose `sticky bit' is set becomes an append-only directory, or, more accurately, a directory in which the deletion of files is restricted. A file in a sticky directory may only be removed or renamed by a user if the user has write permission for the directory and the user is the owner of the file, the owner of the directory, or the super-user. This feature is usefully applied to directories such as /tmp which must be publicly writable but should deny users the license to arbitrarily delete or rename each others' files. Any user may create a sticky directory. See chmod(1) for details about modifying file modes. BUGS
Since the text areas of sticky text executables are stashed in the swap area, abuse of the feature can cause a system to run out of swap. Neither open(2) nor mkdir(2) will create a file with the sticky bit set. 4th Berkeley Distribution May 26, 1986 STICKY(8)
All times are GMT -4. The time now is 01:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy