The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sticky Bit???? skyineyes UNIX for Dummies Questions & Answers 10 05-29-2008 10:15 AM
Sticky Bit teenu18 UNIX for Dummies Questions & Answers 3 12-17-2007 11:08 AM
sticky bit manu.vmr Shell Programming and Scripting 2 02-02-2007 03:43 AM
Sticky Bit rob11g UNIX for Dummies Questions & Answers 1 03-14-2005 12:51 PM
sticky bit?? hedrict UNIX for Dummies Questions & Answers 2 02-05-2002 05:04 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-20-2001
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Stumble this Post!
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 bit) permission. Useful
only if u is expressed or implied in who.
See chmod(2).


Here is the pertinent information from chmod(2):

If the mode bit S_ISVTX (sticky bit) is set on a directory, files
inside the directory may be renamed or removed only by the
owner of the file, the owner of the directory, or the superuser
(even if the modes of the directory would otherwise allow such
an operation).


These don't seem to be the same thing... Also, why would you
save a text image of a file you are executing? Binary != ascii, right,
so what good would that do?

Please enlighten me, as I am perplexed...

Thank you for your time

Forum Sponsor
  #2 (permalink)  
Old 07-20-2001
Registered User
 

Join Date: Jul 2001
Location: New York
Posts: 11
Stumble this Post!
From what I understand, the "sticky" bit is only allowed to be set by a superuser via the chmod command. If set the "ls" format will show a "t" in the last position of the permissions.

The sticky bits purpose is to prevent a program from swapping out of of memory when not being used. Thus, the executable image of the program (file) stays in the "swap space" even when the program is NOT being executed. In effect, it would make the program run faster (no swapping to virtual memory involved).

Since the program gets "stuck" (in the swap space) it's called "sticky mode" (controlled by the "sticky bit". Since swap space is usually at a premium (on most systems) you wouldn't want too many programs running in "sticky mode".

I'm certainly not an expert, but the above is what I gathered through reading. Hope it helps. LY18

  #3 (permalink)  
Old 07-20-2001
Registered User
 

Join Date: Jul 2001
Posts: 8
Stumble this Post!
I use HP-UX here at work and we use sticky bits to keep users from deleting other people's files in public directories. Like the /tmp directory for example . . . anybody can write to or delete from that folder . . . by adding a sticky bit to the folder's permsisions, we make sure no one can delete someone else's work.
  #4 (permalink)  
Old 07-20-2001
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Stumble this Post!
Ok, this clears up the two different things I have read about this, but I was still wondering, does it serve a dual purpose? If set on an executable, it keeps the swapped information from being removed - If set on a text/data file, it keeps another user from removing the information...

I think I get it now. Thanks for the help, folks!

Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0