- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to create symbolic link permission of lr--...
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
09-11-2003 06:00 AM
09-11-2003 06:00 AM
lr--r--r-T 1 root sys 22 May 27 16:37 termcap -> /usr/share/lib/termcap
The last character 'T' is what I'm unsure of how to do it with the umask command.
I know umask 222 will give me lr--r--r-- when I create the link. What do I do for the T?
jack
Solved! Go to Solution.
- Tags:
- symlink
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:07 AM
09-11-2003 06:07 AM
Re: How to create symbolic link permission of lr--r--r-T
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:09 AM
09-11-2003 06:09 AM
Re: How to create symbolic link permission of lr--r--r-T
I don't know how to do a "T".
I can do a "t". that's something!
1. If you do an ll and you see:
-rwsr-sr-t 1 abramss adm 629 Jul 7 11:32 hpux_11.new_features
^ ^ ^
| | |____ Sticky bit
| |
| |_______ SGID bit
|
|__________ SUID bit
2. Here's how you set them:
chmod 1777 /tmp # Set sticky bit
chmod 2555 filename # Set SGID bit
chmod 4555 filename # Set SUID bit
3. Here's what they mean:
a. Program File:
SUID: When a user executes this program, his effective UID set to the
UID of the owner of the file. (mostly used with root owner.)
SGID: When a user executes this program, his effective GID becomes
the GID of the program GID.
Files created by this program, have their primary GID set to the
GID of the program.
Sticky: A program that has it's sticky bit set will not be removed from
swap space after the program has terminated. This means the
next guy can execute the same binary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:09 AM
09-11-2003 06:09 AM
Re: How to create symbolic link permission of lr--r--r-T
The 'T' (Sticky Text Bit) is set using the 1000 octal value. e.g. chmod 1222 myfile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:21 AM
09-11-2003 06:21 AM
Re: How to create symbolic link permission of lr--r--r-T
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:32 AM
09-11-2003 06:32 AM
Re: How to create symbolic link permission of lr--r--r-T
riops002:/tmp/massimo/test/test> umask
022
riops002:/tmp/massimo/test/test> rm test
riops002:/tmp/massimo/test/test> touch test
riops002:/tmp/massimo/test/test> ll test
-rw-r--r-- 1 root sys 0 Sep 11 16:29 test
riops002:/tmp/massimo/test/test> chmod a+t test
riops002:/tmp/massimo/test/test> ll test
-rw-r--r-T 1 root sys 0 Sep 11 16:29 test
riops002:/tmp/massimo/test/test> chmod 755 test
riops002:/tmp/massimo/test/test> ll test
-rwxr-xr-x 1 root sys 0 Sep 11 16:29 test
riops002:/tmp/massimo/test/test> chmod a+t test
riops002:/tmp/massimo/test/test> ll test
-rwxr-xr-t 1 root sys 0 Sep 11 16:29 test
riops002:/tmp/massimo/test/test>
Don't know regarding the link, T or t ...
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:35 AM
09-11-2003 06:35 AM
Re: How to create symbolic link permission of lr--r--r-T
Looks like I got some folks stumped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:40 AM
09-11-2003 06:40 AM
Re: How to create symbolic link permission of lr--r--r-T
As was mentioned before, the permissions on the link itself have no relevance. And one would think you would want a "chmod 774 termcap" to be applied to the actual file.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:44 AM
09-11-2003 06:44 AM
Re: How to create symbolic link permission of lr--r--r-T
jack
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:44 AM
09-11-2003 06:44 AM
Re: How to create symbolic link permission of lr--r--r-T
The only way you can change the permissions on a symbolic link are to change your umask before you create it.
Nice problem though
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:48 AM
09-11-2003 06:48 AM
Re: How to create symbolic link permission of lr--r--r-T
jack...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:53 AM
09-11-2003 06:53 AM
Re: How to create symbolic link permission of lr--r--r-T
Sorry, didn't mean to imply anybody was really being ignored, it's just my perculiar type of English I guess :)
Still, I really would be surprised if these permissions can be achieved on the link without a little bit of C and some inode mangling magic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:54 AM
09-11-2003 06:54 AM
Solution# rm /etc/termcap
# tlinstall
NOTE: tlinstall is searching filesystem - please be patient
NOTE: Successfully completed
# ll /etc/termcap
lr--r--r-T 1 root sys 22 Sep 11 15:46 /etc/termcap -> /usr/share/lib/termcap
See man tlinstall for more info.
A "tusc" of the tlinstall command reveals it uses the lchmod() system call to set the mode:
lchmod("/etc/termcap", 0101444) ............................... = 0
This system call is undocumented (ie no man page), but its easy to write a C program that can use it.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:55 AM
09-11-2003 06:55 AM
Re: How to create symbolic link permission of lr--r--r-T
The permission "T" (sticky bit set without "execute" permission for "others") can be set only with chmod command. Since you cannot set it on symbolic links, the best way is to tar and untar the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 06:58 AM
09-11-2003 06:58 AM
Re: How to create symbolic link permission of lr--r--r-T
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 07:00 AM
09-11-2003 07:00 AM
Re: How to create symbolic link permission of lr--r--r-T
I dont believe you can do it. Certainly not easily anyway. Umask wont allow it, chmod wont allow it (binary or C call). Ive tried all sorts of C calls to create, modify, open, write files and none will do it. C ignores the symlink also - goes straight to its destination.
I think youre going to have to bite the bullet and do it the hard way and tar it over from another server.
Now, if I had assembler for HP-UX and I could recall how to do it I think it would be possible!
It would certainly be interesting though to find out how HP created it in the first place.
/etc/termcap is not listed under swlist -l file which means its not on the source, but its created at some point by some program. Any ideas anyone which program it is ? I think it must exist on a server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 07:09 AM
09-11-2003 07:09 AM
Re: How to create symbolic link permission of lr--r--r-T
The /etc/termcap link to /usr/share/lib/termcap is a 9.X to 10.X transition link.
If you execute the command:
# /opt/upgrade/bin/tllist
It will show a list of all transition links that have been installed on your system. You will notice that /etc/termcap is one of those.
If you really want to re-establish the link the way it should be you can probably use the tlinstall command.
To preview what tlinstall will do:
# /opt/upgrade/bin/tlinstall -p -v
To actually have tlinstall recreate the transition link (I believe it will only recreate what is not there):
# /opt/upgrade/bin/tlinstall -v -l
Note: As far as I know this is the ONLY way to (re)create /etc/termcap with the permissions that it should have. It can not be done with the regular chmod command. /etc/termcap is a special case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 07:14 AM
09-11-2003 07:14 AM
Re: How to create symbolic link permission of lr--r--r-T
Thanks to all for your help. Ran tlinstall and the link got recreated.
Nothing like a challenge to keep the minds going. :)
Jack...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 07:47 AM
09-11-2003 07:47 AM
Re: How to create symbolic link permission of lr--r--r-T
The attached code illutrates its use. I intentionally did this in K&R C so that even the bundled C compiler can handle it. Compile like this:
cc lchmod.c -o lchmod
Use it like this on an EXISTING symbolic link.
lchmod 1664 mysymlink1
NOTE: This guy only understands OCTAL permissions but you are free to make it smarter if you like.
Regards,
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 11:44 AM
09-11-2003 11:44 AM
Re: How to create symbolic link permission of lr--r--r-T
I have been following this thread all day because it was so interesting and challenging. After reading Stefan's comments and repeating some of his attempts in C, I too was completely baffled. Then I saw our Clay's last answer and was amazed. I tried it and it worked! So Clay, how did you know about this secret and undocumented lchmod function? You must be using some inside HP connections to come up with that answer.
PS Jack, you need to give Clay 50 points for that answer because he really solved a mystery.
I love this place,
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2003 03:11 PM
09-11-2003 03:11 PM
Re: How to create symbolic link permission of lr--r--r-T
I then wrote a dummy program:
int main()
{
lchmod("dummy",0)
return(0);
}
It compiled and linked so the mystery system call had to exist.
-------------------------------------------
The other answer is that I am actually one of those whacko's who reads the man 2 pages (the system calls) and I may have seen lchmod() somewhere in another UNIX, far, far away ...
---- although I don't consciously remember it.
On the other hand, if them HP spies (or aliens) was good, maybe they implanted that bit of knowledge without me knowing nothing about it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2003 04:33 AM
09-12-2003 04:33 AM
Re: How to create symbolic link permission of lr--r--r-T
Thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2003 07:49 AM
09-12-2003 07:49 AM
Re: How to create symbolic link permission of lr--r--r-T
Thanks for taking the time to answer my question. I just got in this morning and laughed when I read your answer.
I had to use Google to find out what "a priori" means. After I found out that it is a Latin phrase, I'm beginning to think that your use of terrible English grammar might be intentional. In any event, nobody doubts your knowledge of unix.
Jack, thanks for giving Clay the points. He earned them and made me laugh at the same time.
Regards,
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2003 01:29 PM
09-12-2003 01:29 PM
Re: How to create symbolic link permission of lr--r--r-T
I just saw your last post and I assure you that I didn't go to say nothing terrible about your English grandma. I don't even know her.
At my 10th high school reunion (while I was teaching at a university; not, thankfully, English), I did make a special point to thank my English teacher for learning me to talk and write so good (that's nearly verbatim). I also pointed out that I used sentence diagramming and poetry analysis at least once per decade and thanked her for learning me them valuable skills too.