Page 1 of 1

Permission Issues

Posted: Thu Jun 22, 2006 3:45 pm
by Bigun
Ok, I create a directory and it looks like this:

Code: Select all

dr----x--t  2 nobody   nobody   4096 Jun 22 13:42 b-6/
And I need full access in order for my users to post stuff.

Here's the code I'm using:

Code: Select all

mkdir ("./users/pics/".$uid);
chmod("./users/pics/".$uid, 777);
What can I do?

Posted: Thu Jun 22, 2006 3:47 pm
by feyd
0777 for starters. ;)

Posted: Thu Jun 22, 2006 3:51 pm
by Bigun
I never understood what that extra 0 does. A simple "chmod 777 *filename*" works in Linux just fine.

I always thought octal binary only had 3 binary digits.

(It worked BTW)

Posted: Thu Jun 22, 2006 3:54 pm
by feyd
A leading zero in C based languages is the marker for octal numbers and 0x for hexidecimal. Standard integers and decimals get nothing special.

Posted: Thu Jun 22, 2006 4:47 pm
by bdlang
Bigun wrote:I never understood what that extra 0 does. A simple "chmod 777 *filename*" works in Linux just fine.
This is true; however, the initial bit is a switch. '4' is the setuid bit, '2' is the setgid bit, '1' makes the file 'sticky' and '0' clears all. Unless you do alot of linux sysadmin, you may not have a use for any of these.

linuxbox> $ man chmod