Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/usr/bin/pwd fails when current dir mountpoint was 700

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
please follow below steps and explain me why /usr/bin/pwd fails...

Is it a bug or feature?

root@box01# df /NX_test
Filesystem 512-blocks Free %Used Iused %Iused Mounted on
/dev/lv00 1048576 547360 48% 14010 11% /NX_test
root@box01# ls -ld /NX_test
drwxr-sr-x 7 sys sys 512 Apr 26 10:10 /NX_test
root@box01# su - ldap
$ cd /NX_test
$ pwd
/NX_test
$ /usr/bin/pwd
/NX_test
$ exit
root@box01# umount /NX_test
root@box01# ls -ld /NX_test
drwxr-xr-x 2 root system 256 Apr 26 09:24 /NX_test
root@box01# chmod 700 /NX_test
root@box01# ls -ld /NX_test
drwx------ 2 root system 256 Apr 26 09:24 /NX_test
root@box01# mount /NX_test
root@box01# ls -ld /NX_test
drwxr-sr-x 7 sys sys 512 Apr 26 10:10 /NX_test
root@box01# su - ldap
$ cd /NX_test
$ ls -ld .
drwxr-sr-x 7 sys sys 512 Apr 26 10:10 .
$ /usr/bin/pwd
pwd: The file access permissions do not allow the specified action.
$ /usr/bin/who
root pts/1 May 13 07:09 (gdnnb36.off.lsy.pl)
$ /usr/bin/ls
freenx_0.3.0.orig.tar.gz
$
 
btw. shell built-in "pwd" doesn't fail - only /usr/bin/pwd fails when filesystem was mounted to the directory-mountpoint with 700 rights.
 
BTW - you'll also find that find fails. The closest I can get is that the C library call 'getpwd()' is looking at the underlying mount point - not the mounted file system. The only solution I can find is to unmount it, chmod 777 the mount point and remount (and put it in the list of things to check next time!)

If anyone can come up with a deeper explanation then I would also be interested

Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top