The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 01:15 PM
Sticky Bit teenu18 UNIX for Dummies Questions & Answers 3 12-17-2007 03:08 PM
sticky bit manu.vmr Shell Programming and Scripting 2 02-02-2007 07:43 AM
Sticky Bit rob11g UNIX for Dummies Questions & Answers 1 03-14-2005 04:51 PM
sticky bit?? hedrict UNIX for Dummies Questions & Answers 2 02-05-2002 09:04 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-20-2001
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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

  #2 (permalink)  
Old 07-20-2001
liteyear18 liteyear18 is offline
Registered User
  
 

Join Date: Jul 2001
Location: New York
Posts: 11
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
Randy Randy is offline
Registered User
  
 

Join Date: Jul 2001
Posts: 8
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
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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!

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0