- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Why only root can set "sticky bit" on a file?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:12 AM
04-20-2006 01:12 AM
I noticed that I couldn't successfully set "sticky bit" on a file with normal user, except root.
When I login as root:
# ll abc
-rwxrwx--- 1 root sys 0 Apr 20 08:59 abc
# chmod o+t abc
# ll abc
-rwxrwx--T 1 root sys 0 Apr 20 08:59 abc
But if I login as non-root user, it didn't add "T" to the mode.
Is that normal?
( NOTE: I just need to set such mode to mark a "flag" on the file, not to use as the purpose of sticky bit. )
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:20 AM
04-20-2006 01:20 AM
Re: Why only root can set "sticky bit" on a file?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:21 AM
04-20-2006 01:21 AM
Re: Why only root can set "sticky bit" on a file?
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:22 AM
04-20-2006 01:22 AM
SolutionCheck this HP-UX FAQ,
http://www.faqs.org/faqs/hp/hpux-faq/section-70.html
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:27 AM
04-20-2006 01:27 AM
Re: Why only root can set "sticky bit" on a file?
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:27 AM
04-20-2006 01:27 AM
Re: Why only root can set "sticky bit" on a file?
One would expect this behavior. After all, the sticky bit causes the swap image of the program text (code) to be saved when the last user of the file terminates execution. This means that the *next* instantiation of the process is slightly faster than for a file without the saved image.
Thus, why would one want any user to be able to arm this behavior?!
By the way, "T" is shown when there is no execute bit set on the world permissions but the sticky bit is on. A lowercase ("t") denotes a stick bit on along with execute permissions for everyone.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:36 AM
04-20-2006 01:36 AM
Re: Why only root can set "sticky bit" on a file?
The purpose I am doing this is to mark a "status flag" on that file for script usage.
Now, since I can't use "sticky bit" for this, I would like to use "x" in "world", like this:
$ chmod o+x
But how can I "test" whether "x" bit is set in "world" permission after that?
I think I can't use "test -x
What's the easiest way to "test" this?
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:41 AM
04-20-2006 01:41 AM
Re: Why only root can set "sticky bit" on a file?
I was reading sticky bit but thinking suid bit. I even tested it to make sure and it works just fine for the suid bit.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 01:56 AM
04-20-2006 01:56 AM
Re: Why only root can set "sticky bit" on a file?
One way to test the state of the execute bit for the "world" is to examine the output of a simple 'ls -l' thusly:
# ls -l myfile|perl -lne 'print "1" if /^-.{8}x/'
If world-execute permissions exist, a one (1) is printed, otherwise nothing is returned.
You can capture this in a variable of your choice and test it as necessary.
Regards!
...JRF...