[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3627
  • Last Modified:

Solaris : Permission Issue : Warning: cannot determine current directory

Hi,

My solaris system has following issues :
$ pwd
cannot determine current directory
$ which java
Warning: cannot determine current directory
/usr/bin/java
$ cd ..
$ cd ..
$ cd ..
..: permission denied

The last pwd would go to /  but cd .. gives permission denied

However:
cd / is possible
$ ls -las
total 1096
   2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 .
   2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ..

I have been comparing permissions on directories and can't find on first sight what might cause the "cannot determine" error.

Thanks,
Tim
0
thimerion
Asked:
thimerion
  • 12
  • 11
  • 5
  • +1
3 Solutions
 
omarfaridCommented:
what is user id? run

id

can you run

df -k
0
 
thimerionAuthor Commented:
$ id
uid=2515(timvds) gid=25000(customer)
$ df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d4       18590017 3430485 14973632    19%    /
/proc                      0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
fd                         0       0       0     0%    /dev/fd
swap                 9430112      24 9430088     1%    /var/run
swap                 9435320    5232 9430088     1%    /tmp
/dev/md/dsk/d7       45656321  509102 44690656     2%    /cust
0
 
omarfaridCommented:
have you tried to see what are the permissions of the current dir?

ls -la

Try to login as root and see what are the permissions on the dir you are in now since it could be that you changed the perms and removed the read and execute ( r & x) from this dir
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thimerionAuthor Commented:
$ pwd
cannot determine current directory
$ which java
Warning: cannot determine current directory
/usr/bin/java
$ ls -la
total 34
drwx--x---   2 mzlbzl   customer     512 Apr 15 13:50 .
drwxr-xr-x  13 root     root         512 Apr 14 13:48 ..
-rw-------   1 mzlbzl   customer      50 Apr 15 13:50 .Xauthority
-rw-------   1 root     other        101 Apr  6 16:09 .bash_history
-rw-r--r--   1 root     other         11 Apr  6 16:08 .profile
-rw-------   1 mzlbzl   customer   10532 Apr 15 13:50 .sh_history
-rwxr-xr-x   1 mzlbzl   customer      11 Apr 15 13:20 testscript.sh
$ pwd
cannot determine current directory
$
$ cd ..
$ ls -la
total 26
drwxr-xr-x  13 root     root         512 Apr 14 13:48 .
drwxr-xr-x   8 root     root         512 Apr 14 13:40 ..
$ ls -la
./..: Permission denied
total 28
drwxr-xr-x   8 root     root         512 Apr 14 13:40 .
drwxr-xr-x  13 root     root         512 Apr 14 13:48 home
$ cd /
$ ls -la
total 1096
drwxr-xr-x  24 root     root        1024 Mar 11 19:50 .
drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ..

The directory I was in was /cust/home/timvds
0
 
omarfaridCommented:
your user is timvds and group is customer

drwx--x---   2 mzlbzl   customer     512 Apr 15 13:50 .

the dir you are in is owned by user mzlbzl and wner group is customer

the group has search but no read on the dir and others no perms.

can you login as root and see what are perms on / dir
0
 
thimerionAuthor Commented:
# cd /
# ls -la
total 1096
drwxr-xr-x  24 root     root        1024 Mar 11 19:50 .
drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ..

changed to user mzlbzl, got same issue there ...
0
 
omarfaridCommented:
Can you restate the problem? I got confused :)
0
 
thimerionAuthor Commented:
$  cd / ; /usr/bin/pwd
/
$  cd /cust ; /usr/bin/pwd
pwd: cannot determine current directory!
$ cd /cust/home  ; /usr/bin/pwd
pwd: cannot determine current directory!
$ cd /cust/home/mzlbzl  ; /usr/bin/pwd
pwd: cannot determine current directory!
$ ls -ld /                                  
drwxr-xr-x  24 root     root        1024 Mar 11 19:50 /
$ ls -ld /cust
drwxr-xr-x   8 root     root         512 Apr 14 13:40 /cust
$ ls -ld /cust/home
drwxr-xr-x  13 root     root         512 Apr 14 13:48 /cust/home
$ ls -ld /cust/home/mzlbzl
drwx--x---   2 mzlbzl   customer     512 Apr 15 13:50 /cust/home/mzlbzl
$

Found on a techical forum that it could be the permissions of the mountpoint ...

Possible solution:
cd /
umount <mountpoint>
chmod 755 <mountpoint>
mount <mountpoint>
0
 
omarfaridCommented:
what is your shell? can you run commands

set
env
alias
0
 
Brian UtterbackPrinciple Software EngineerCommented:
The "cannot determine" means that some directory in the path to the current directory cannot be read by the user, that is
does not have read permissions. Try this:

ls -ld .
ls -ld ..
ls -ld ../..
ls -ld ../../
ls -ld ../../..
ls -ld ../../../..

and so on. Eventually you will find one that will not have read permissions set. After that one, further "ls -ld"'s at higher
levels will fail as well. Keep in mind that if the directory is on NFS or kerberized, the user may need the directory to
be world readable even if he is the owner, if his creds over the network are not correct. There also may be ACL's in
play here.
0
 
thimerionAuthor Commented:
Logged on as mzlbzl, started in directory /cust/home/mzlbzl

$ ls -ld .
drwx--x---   2 mzlbzl   customer     512 Apr 16 08:21 .
$ ls -ld ..
drwxr-xr-x  15 root     root         512 Apr 15 16:11 ..
$ ls -ld ../..
drwxrwxr-x   9 root     root         512 Apr 15 16:49 ../..
$ ls -ld ../../
drwxrwxr-x   9 root     root         512 Apr 15 16:49 ../../
$ ls -ld ../../..
../../..: Permission denied
$ ls -ld ../../../..
../../../..: Permission denied

Logged on as root
# cd /cust/home/mzlbzl
# ls -ld ../../..
drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ../../..
#

It doesn't make sense!

Tim
0
 
omarfaridCommented:
root has full priv. can you tell if you use ls in /usr/bin or some other ls

can you do

which ls

0
 
thimerionAuthor Commented:
$ which ls
Warning: cannot determine current directory
/usr/bin/ls
0
 
omarfaridCommented:
I think it could be related to your shell prompt setting

can you check if you are setting your shell prompt some how? What sell are you using?
0
 
thimerionAuthor Commented:
shell is /bin/sh , changing that to /bin/ksh did not help
not setting my prompt  (even have nothing in the .profile)

Looking again at mount point permissions.

Tim
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Okay, as root, do this:

cd /cust/home/mzlbzl
cd ../..
ls -lFai
df .
cd ..
ls -lFai
df .
cd /
ls -lFai
df .

Then do the same thing as the user, and post the output to both. Also, if the user fails when you do the cd ..,
do this as the user as well:

truss -ae -vall cd ..

and post the output.
0
 
thimerionAuthor Commented:
As root :
# cd /cust/home/mzlbzl
# cd ../..
# ls -lFai
total 32
         2 drwxrwxr-x   9 root     root         512 Apr 15 16:49 ./
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ../
        28 drwx------   2 bea      bea          512 Apr 14 13:40 bea/
        29 drwx------   2 bea      bea          512 Apr 14 13:40 beaapp/
         5 drwxr-xr-x  15 root     root         512 Apr 15 16:11 home/
        23 drwxrwxrwx   2 root     other        512 Apr 16 07:32 installFiles/
         3 drwx------   2 root     root        8192 Apr 28  2008 lost+found/
         4 drwx--x---   2 oracle   5000         512 Apr 28  2008 oracle/
        47 drwxr-xr-x   2 prueba3  customer     512 Apr 15 16:49 prueba3/
# df .
/cust              (/dev/md/dsk/d7    ):90294392 blocks  5486537 files
# cd ..
# ls -lFai
total 1096
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ./
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ../
     90633 -rw-r--r--   1 root     other        693 Jul 16  2008 .cshrc
     90634 -rw-r--r--   1 root     other          0 Jul 16  2008 .cshrc.JASS.20080716122831
     88284 -rw-r--r--   1 root     other        489 Sep  5  2008 .g
     90635 -rw-r--r--   1 root     other        376 Jul 16  2008 .profile
     90636 -rw-r--r--   1 root     other          0 Jul 16  2008 .profile.JASS.20080716122831
     88280 -rw-------   1 root     other        764 Apr 24  2008 .sh_history
      2263 lrwxrwxrwx   1 root     root           9 Apr 24  2008 bin -> ./usr/bin/
    137452 drwxrwxr-x   9 root     root         512 Apr 15 16:49 cust/
...
# df .
/                  (/dev/md/dsk/d4    ):30318988 blocks  2094358 files
# cd /
# ls -lFai
total 1096
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ./
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ../
     90633 -rw-r--r--   1 root     other        693 Jul 16  2008 .cshrc
     90634 -rw-r--r--   1 root     other          0 Jul 16  2008 .cshrc.JASS.20080716122831
     88284 -rw-r--r--   1 root     other        489 Sep  5  2008 .g
     90635 -rw-r--r--   1 root     other        376 Jul 16  2008 .profile
     90636 -rw-r--r--   1 root     other          0 Jul 16  2008 .profile.JASS.20080716122831
     88280 -rw-------   1 root     other        764 Apr 24  2008 .sh_history
      2263 lrwxrwxrwx   1 root     root           9 Apr 24  2008 bin -> ./usr/bin/
    137452 drwxrwxr-x   9 root     root         512 Apr 15 16:49 cust/
# df .
/                  (/dev/md/dsk/d4    ):30318988 blocks  2094358 files
0
 
thimerionAuthor Commented:
$ cd /cust/home/mzlbzl
$ cd ../..
$ ls -lFai
./..: Permission denied
total 30
         2 drwxrwxr-x   9 root     root         512 Apr 15 16:49 ./
        28 drwx------   2 bea      bea          512 Apr 14 13:40 bea/
        29 drwx------   2 bea      bea          512 Apr 14 13:40 beaapp/
         5 drwxr-xr-x  15 root     root         512 Apr 15 16:11 home/
        23 drwxrwxrwx   2 root     other        512 Apr 16 07:32 installFiles/
         3 drwx------   2 root     root        8192 Apr 28  2008 lost+found/
         4 drwx--x---   2 oracle   5000         512 Apr 28  2008 oracle/
        47 drwxr-xr-x   2 prueba3  customer     512 Apr 15 16:49 prueba3/
$ df .
df: cannot canonicalize .: Permission denied
$

$ cd ..
..: permission denied
$ ls -lFai
./..: Permission denied
total 30
         2 drwxrwxr-x   9 root     root         512 Apr 15 16:49 ./
        28 drwx------   2 bea      bea          512 Apr 14 13:40 bea/
        29 drwx------   2 bea      bea          512 Apr 14 13:40 beaapp/
         5 drwxr-xr-x  15 root     root         512 Apr 15 16:11 home/
        23 drwxrwxrwx   2 root     other        512 Apr 16 07:32 installFiles/
         3 drwx------   2 root     root        8192 Apr 28  2008 lost+found/
         4 drwx--x---   2 oracle   5000         512 Apr 28  2008 oracle/
        47 drwxr-xr-x   2 prueba3  customer     512 Apr 15 16:49 prueba3/
$ df .
df: cannot canonicalize .: Permission denied
$ cd /

$ cd /
$ ls -lFai
total 1096
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ./
         2 drwxr-xr-x  24 root     root        1024 Mar 11 19:50 ../
     90633 -rw-r--r--   1 root     other        693 Jul 16  2008 .cshrc
     90634 -rw-r--r--   1 root     other          0 Jul 16  2008 .cshrc.JASS.20080716122831
     88284 -rw-r--r--   1 root     other        489 Sep  5  2008 .g
     90635 -rw-r--r--   1 root     other        376 Jul 16  2008 .profile
     90636 -rw-r--r--   1 root     other          0 Jul 16  2008 .profile.JASS.20080716122831
     88280 -rw-------   1 root     other        764 Apr 24  2008 .sh_history
      2263 lrwxrwxrwx   1 root     root           9 Apr 24  2008 bin -> ./usr/bin/
    137452 drwxrwxr-x   9 root     root         512 Apr 15 16:49 cust/
...
$ df .
/                  (/dev/md/dsk/d4    ):30318988 blocks  2094358 files

0
 
omarfaridCommented:
there is a common problem among all these commands, although it is showing perm denied, it is showing results ! and this is the case regardless of the command.
0
 
thimerionAuthor Commented:
truss
outputR.txt
0
 
omarfaridCommented:
can you tell us what you have in /etc/profile and user .profile files?
0
 
omarfaridCommented:
the file shows that it is running ksh !
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Well. the problem seems to be specifically in the ".." (dotdot) entry of the directory at /cust.

Since this is a mount point, the .. entry has a certain amount of kernel magic in it. Check the /var/adm/messages file
for any indication of some kind of error when you try to access the .. link.

Also, do this. Both as root and as the user, cd into /cust and execute this command:
truss -vall ls -ld ..

Post the output to both.
0
 
thimerionAuthor Commented:
But what do you think of my thought that it are the permissions of the mounting point directory when it is not mounted.

I read everywhere they have to be 775 and you can't see them if the filesys is mounted.

I only do not know how to unmount the system and mount it again.  That I have to ask the sysadmin I guess.

Regards,
Tim
0
 
Brian UtterbackPrinciple Software EngineerCommented:
Sorry, I didn't see the truss you already posted. I think that your supposition above is correct. The directory underneath the mountpoint had too restrictive permissions. You should do what you said above, umount,chmod,mount.
0
 
omarfaridCommented:
but I think the mount dir take the perms of the root dir of the file system when mounted !
0
 
Brian UtterbackPrinciple Software EngineerCommented:
If course, it should, but that is a known issue with Solaris.

Yes, if you do not know how to unmount and remount the directory, then by all means get the admin to do it.
0
 
z670193Commented:
try your own suggestion of unmounting and mounting to see if it helps as below:
#cd /
#umount /cust
#chmod 777 cust
#mount /cust

now try your stuffs.
0
 
thimerionAuthor Commented:
I have raised a case with the system engineer ...

I don't know with what parms the /cust is mounted so I might break it if I do that ...

Tim
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 12
  • 11
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now