LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Permission bit (https://www.linuxquestions.org/questions/linux-newbie-8/permission-bit-918019/)

divyashree 12-10-2011 04:31 AM

Permission bit
 
Can anyone tell me what is this L bit in groups last bit ??
I got this line in one of my directory..


Code:

-rwxrwLr-x    1 tmmlprod user      956900 Dec 10 15:32 409001000114.pdf

colucix 12-10-2011 05:08 AM

Some implementations of the ls command use L to denote the set-group-id bit, whereas you usually see a S. The uppercase L means that the execution bit is not set, otherwise you would see a lowercase l. The same applies when ls shows it as S or s.

An example of an executable with the setgid bit set is the command wall. In this case the l should be lowercase, since the execution bit is set. Check it on your system to verify:
Code:

ls -l `which wall`
At this point I'm curious... which system are you running on and what implementation of the ls command is this?

Lastly, you can find some information about the L permission bit here.

divyashree 12-10-2011 05:25 AM

Quote:

Originally Posted by colucix (Post 4546458)
Some implementations of the ls command use L to denote the set-group-id bit, whereas you usually see a S. The uppercase L means that the execution bit is not set, otherwise you would see a lowercase l. The same applies when ls shows it as S or s.

An example of an executable with the setgid bit set is the command wall. In this case the l should be lowercase, since the execution bit is set. Check it on your system to verify:
Code:

ls -l `which wall`
At this point I'm curious... which system are you running on and what implementation of the ls command is this?

Lastly, you can find some information about the L permission bit here.

I got this :

Code:

-rwxr-xr-x    1 root    sys        19332 Sep  2 18:54 /sbin/wall


Thanks for the info. But if executable bit is not set, then it should remain blank.

colucix 12-10-2011 06:50 AM

Quote:

Originally Posted by divyashree (Post 4546463)
I got this: -rwxr-xr-x 1 root sys 19332 Sep 2 18:54 /sbin/wall

Ok, there are differences from system to system on how permissions are set. On which system do you see the L behaviour anyway?
Quote:

Thanks for the info. But if executable bit is not set, then it should remain blank.
Good point! Indeed the setgid bit has a different meaning if applied to executables, not-executables or directories:

1. on executables: the user who executes the program gains privileges of the group to which the file is assigned.
2. on not-executables: processes are granted to use the mandatory locking on these files. See this document for details: http://kernel.org/doc/Documentation/...ry-locking.txt
3. on directories: this causes new files created inside the directory to inherit its group ID.

divyashree 12-19-2011 09:56 PM

Quote:

Originally Posted by colucix (Post 4546499)
Ok, there are differences from system to system on how permissions are set. On which system do you see the L behaviour anyway?

Good point! Indeed the setgid bit has a different meaning if applied to executables, not-executables or directories:

1. on executables: the user who executes the program gains privileges of the group to which the file is assigned.
2. on not-executables: processes are granted to use the mandatory locking on these files. See this document for details: http://kernel.org/doc/Documentation/...ry-locking.txt
3. on directories: this causes new files created inside the directory to inherit its group ID.

Thanks colucix for the nice info.

Actually I got it on an very old Unix System ( IRIX 6.5 ).


All times are GMT -5. The time now is 08:58 PM.