LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   symbolic links directories access and permissions (http://www.linuxquestions.org/questions/linux-security-4/symbolic-links-directories-access-and-permissions-724380/)

goncalopp 05-07-2009 07:39 AM

symbolic links directories access and permissions
 
is there anyway a user can access (assuming correct permissions) the parent directory of a directory he accesses through a symlink?

... ok, that sounds strange :(
What I mean is, imagine the following directories:

./dir1 user1 700
./dir1/a user1 777
./dir1/a/b user1 777
./dir2 user2 700

Now, if the superuser creates a symlink to ./dir1/a/b in the dir2 directory, is there any way user2 can access ./dir1/a ?
(assuming he does not somehow know the absolute path)


I'm thinking of using this to let users have their homepages, i.e. create a link from /home/userX/www to var/www/userX (the ftp is chroot-ed).
Is this a bad idea?

pixellany 05-07-2009 07:45 AM

Any user can do "ls -l" and see what the path is for any links that are visible to hime/her. I don't know if there's a way to get there with a single command

ntubski 05-07-2009 12:28 PM

Quote:

Originally Posted by goncalopp
I'm thinking of using this to let users have their homepages,

Are you using apache? See Per-user web directories

Quote:

Originally Posted by pixellany
Any user can do "ls -l" and see what the path is for any links that are visible to hime/her. I don't know if there's a way to get there with a single command

readlink gives the location in a single command, cd $(dirname $(readlink link)) is short enough that a dedicated command seems redundant...


All times are GMT -5. The time now is 02:51 PM.