Question

Solaris : Permission Issue : Warning: cannot determine current directory

Asked by: thimerion

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

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-04-15 at 06:18:18ID24324027
Topic

Sun Solaris

Participating Experts
3
Points
50
Comments
29

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. ls *
    "ls *" or any shell command with '*' gives me an error output when executed in a directory where I have over 2000 files, because the resulting parameter list is too long. How can I change the maximum value of this in my shell?
  2. DOS exchange file with Solaris using floppy disk
    How can I copy DOS files to Solaris using floppy disk. How can I mount floppy disk on Solaris. Is there any differece between Intel Solaris and SPARC Solaris on this operation. not AIX or other stuff. Thanks
  3. Solaris command
    Anyone can write down all basic Solaris command for hardware installation, software installation, administration ? (not UNIX)
  4. Solaris 9 x86 Solaris Managment Console
    Solaris 9 x86 Solaris Managment Console This has to deal with Solaris Managment Console Disk Managment I click on ANY disk and get the error message Warning No Solaris Fdosk Partition, I know there is one their, I put it their after I used a third party utility to low level...
  5. Solaris user environment profile
    Hi, In one of our Solaris boxes, all the users except root has the error message for most of the commands. $ which cd Warning: cannot determine current directory /bin/cd $ which ls Warning: cannot determine current directory /bin/ls But if I cd to bin directory, then it ...
  6. ls command in SOLARIS 5.8
    Hi all, wuld appreciate help pls.. i am new to unix.. so pls be patient.. this is what i am trying to do.. i want to run a ls command which can bring listings of files as below 1) it sud bring listing of files with absolute paths .. 2). sorted in desc order 3). no directo...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: omarfaridPosted on 2009-04-15 at 06:43:23ID: 24147838

what is user id? run

id

can you run

df -k

 

by: thimerionPosted on 2009-04-15 at 06:48:33ID: 24147891

$ 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

 

by: omarfaridPosted on 2009-04-15 at 06:53:09ID: 24147935

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

 

by: thimerionPosted on 2009-04-15 at 07:00:18ID: 24148016

$ 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

 

by: omarfaridPosted on 2009-04-15 at 07:06:05ID: 24148086

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

 

by: thimerionPosted on 2009-04-15 at 07:11:26ID: 24148155

# 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 ...

 

by: omarfaridPosted on 2009-04-15 at 07:57:57ID: 24148736

Can you restate the problem? I got confused :)

 

by: thimerionPosted on 2009-04-15 at 08:03:48ID: 24148807

$  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>

 

by: omarfaridPosted on 2009-04-15 at 08:06:06ID: 24148836

what is your shell? can you run commands

set
env
alias

 

by: bluPosted on 2009-04-15 at 09:28:51ID: 24149930

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.

 

by: thimerionPosted on 2009-04-16 at 01:55:39ID: 24155596

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

 

by: omarfaridPosted on 2009-04-16 at 02:04:00ID: 24155640

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

can you do

which ls

 

by: thimerionPosted on 2009-04-16 at 02:13:43ID: 24155679

$ which ls
Warning: cannot determine current directory
/usr/bin/ls

 

by: omarfaridPosted on 2009-04-16 at 03:20:08ID: 24156056

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?

 

by: thimerionPosted on 2009-04-16 at 03:53:05ID: 24156231

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

 

by: bluPosted on 2009-04-16 at 05:07:07ID: 24156679

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.

 

by: thimerionPosted on 2009-04-16 at 05:34:51ID: 24156894

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

 

by: thimerionPosted on 2009-04-16 at 05:40:30ID: 24156939

$ 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

 

by: omarfaridPosted on 2009-04-16 at 05:53:37ID: 24157047

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.

 

by: thimerionPosted on 2009-04-16 at 06:00:12ID: 24157113

truss

 

by: omarfaridPosted on 2009-04-16 at 06:00:27ID: 24157114

can you tell us what you have in /etc/profile and user .profile files?

 

by: omarfaridPosted on 2009-04-16 at 06:04:37ID: 24157157

the file shows that it is running ksh !

 

by: bluPosted on 2009-04-16 at 06:07:29ID: 24157193

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.

 

by: thimerionPosted on 2009-04-16 at 06:12:10ID: 24157236

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

 

by: bluPosted on 2009-04-16 at 06:12:13ID: 24157238

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.

 

by: omarfaridPosted on 2009-04-16 at 06:16:15ID: 24157286

but I think the mount dir take the perms of the root dir of the file system when mounted !

 

by: bluPosted on 2009-04-16 at 06:26:09ID: 24157402

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.

 

by: z670193Posted on 2009-04-20 at 10:25:07ID: 24186661

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.

 

by: thimerionPosted on 2009-04-21 at 03:29:36ID: 24192688

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

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...