Sticky bit on files?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sticky bit on files?
# 1  
Old 03-24-2011
Sticky bit on files?

I am a new Linux user, just successfully passed another exam on unixacademy.com (congratulate me Smilie but there was a question I'm uncomfortable with. I mean, I'm not sure how it works and have no idea how to verify it.
What effect sticky bit has on files? I know how it works on directories, but its effect on files is unclear to me. I tried searching web, but I found different, contradicting posts for various Linux/Unix clones. Some posts say it is not used, ignored some say it has an effect... Thanks
# 2  
Old 03-24-2011
If it does anything at all, it's certainly not officially documented. (grepped every file in /usr/src/linux/Documentation for "sticky") So I'd be inclined to say it doesn't.
# 3  
Old 03-24-2011
From the chmod man page:
Quote:
STICKY FILES
On older Unix systems, the sticky bit caused executable files to be hoarded in swap space. This feature is not useful on modern VM systems, and the Linux kernel ignores the sticky bit on files. Other kernels may use the sticky bit on files for system-defined purposes. On some systems, only the superuser can set the sticky bit on files.
# 4  
Old 03-30-2011
Is there a simple way to find, where this "sticky bit" functionality is located within kernel sources? Linux is famous to be "open source" so in a case I want to investigate this issue first hand, how can I find a particular piece of kernel (module, library?) that deals with this functionality. I do know C language well enough to read and compile simple programs.
# 5  
Old 03-31-2011
I learned the sticky bit is set so that only a file could not be deleted. I believe you would set it on a file like
Code:
 sudo chmod 1755 filename

With the 1 being the sticky bit.
# 6  
Old 03-31-2011
Quote:
Originally Posted by newlinuxuser1
Is there a simple way to find, where this "sticky bit" functionality is located within kernel sources? Linux is famous to be "open source" so in a case I want to investigate this issue first hand, how can I find a particular piece of kernel (module, library?) that deals with this functionality.
Download a kernel tarball from kernel.org , extract it somewhere, and start grepping. I did enough looking to figure out that it's not called "sticky" inside the kernel.
# 7  
Old 03-31-2011
See my article on file permissions here.
Quote:
The constant in the C header files for this bit is S_ISVTX. The svtx stands for save text and this reveals the original purpose of the bit.
This User Gave Thanks to Perderabo For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Sticky Bit

What is sticky bit ...and where we aill use this.. how to set this bit in files and directories (1 Reply)
Discussion started by: udtyuvaraj
1 Replies

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

3. UNIX for Advanced & Expert Users

sticky bit

Hi, I understand the purpose of sticky bit on directories. But I am not very clear about what the sticky bit do on a file. Can any one explain me in detail and with example please. Thanks in advance. (1 Reply)
Discussion started by: praveen_b744
1 Replies

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

5. Shell Programming and Scripting

How to find sticky bit dir/files

I need to find all sticky bit dir/files on my system and clean them up if necessary. How to I write a script to do this? Thanks. (2 Replies)
Discussion started by: pdtak
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, could anyone please send me a link to learn/ know more about sticky bits? I am still not clear on the application of using a sticky bits. Thanks for your help. Regards, UP (3 Replies)
Discussion started by: teenu18
3 Replies

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

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

10. 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
Login or Register to Ask a Question