1748065 Members
5250 Online
108758 Solutions
New Discussion юеВ

question about chmod

 
SOLVED
Go to solution
'chris'
Super Advisor

question about chmod

hi everyone

is there any difference between:

# chmod 01777 /var/mail

and

# chmod 1777 /var/mail


4 REPLIES 4
TY 007
Honored Contributor
Solution

Re: question about chmod

Hi Chris,

No difference.

# man chmod
/usr/bin/chmod [-A] [-R] numeric_mode file ...

Absolute permissions can be set by specifying a numeric_mode, an octal number ...

Thanks
Ivan Krastev
Honored Contributor

Re: question about chmod

No difference.
For chmod 01777 is exact as 1777.



regards,
ivan
Ivan Ferreira
Honored Contributor

Re: question about chmod

According to "man 2 chmod", only four digits are used in the command. In that case, either command will do the same.

According to this page:

http://www.security-express.com/archives/php/2007-08/0003.html

The 5 digit should cause problems in php "chmod" funcion.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
James R. Ferguson
Acclaimed Contributor

Re: question about chmod

Hi:

Use the 4-digits only. The idea behind prepending a zero is to underscore the fact that the argument is an octal number. However, that is assumed by 'chmod'.

Regards!

...JRF...