Topic "Directory inaccessible if parent directory is inaccessible"

Author Message
Rakushun
[View user's profile]

Joined: 2010-11-09
Posts: 8
Dear WinSCP team,

there seems to be a problem in WinSCP concerning entering directories. This is a rather old bug, I have always had it in all the WinSCP versions (up to and including 5.1.1), but now I want to pass it to you in hope it is fixed.

In our university, we have the situation that some parent directories are inaccessible while the subdirectories can be accessed. So everybody, who looks into the home directory of a user (e.g. /home/user/myboss) is not able to read the directory. However, if you 'know' the path (e.g., /home/user/myboss/ourcommonpaper), I can enter the directory with a "cd" command using putty, list the directory with "ls" and copy the data to my home directory using "cp". However, I cannot enter the directory with WinSCP. If I enter a path like "/home/user/myboss/ourcommonpaper" in the address bar on top of WinSCP, I get the error message

---
Command 'pwd'
failed with return code 1 and error message
pwd: cannot open directory `..': Permission denied.
---

It seems that WinSCP requires the parent directory to be accessible to access subdirectories, which is not the case here. This is a rather annoying situation as it requires me to copy all the data to my home directory before I can copy it to my Windows machine with WinSCP. The parent directory "/home/user/myboss" has permissions "0710", the subdirectory "/home/user/myboss/ourcommonpaper" and all its subfolders "0755".

Can you help?

Regards,

Michael


P.S.: The connection options are:

Remote system = SunOS jerusalem 5.10 Generic_138888-03 sun4u sparc SUNW,Sun-Fire-V440 Solaris
Session protocol = SSH-2
SSH implementation = OpenSSH_4.6
Encryption algorithm = aes
Compression = ZLib
File transfer protocol = SCP
------------------------------------------------------------
Server host key fingerprint
ssh-rsa 2048 1f:ed:e6:f9:ad:4b:49:17:87:e7:e6:b4:ce:e5:dc:d9
------------------------------------------------------------
Can change permissions = Yes
Can change owner/group = Yes
Can execute arbitrary command = Yes
Can create symlink/hardlink = Yes/Yes
Can lookup user groups = Yes
Can duplicate remote files = Yes
Can check available space = No
Can calculate file checksum = No
Native text (ASCII) mode transfers = No
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please attach a full log file showing the problem.

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
WinSCP needs to use pwd command to determine the current working directory. But with your serup the pwd command does not work. Actually I was not able to reproduce your setup. What group owns the myboss? Are you member of that group?
Rakushun
[View user's profile]

Joined: 2010-11-09
Posts: 8
Hello Martin,

prikryl wrote:
WinSCP needs to use pwd command to determine the current working directory. But with your serup the pwd command does not work. Actually I was not able to reproduce your setup. What group owns the myboss? Are you member of that group?


myboss and me, we are both in the same group. If I use a standard Putty session, there is also no problem entering "pwd" in "/home/user/myboss" or "/home/user/myboss/ourcommonpaper", it works quite well.

Another thing I just recognised: The problem only appears if I use the SCP protocol to connect to the server. If I connect via SFTP, there is no problem entering "/home/user/myboss/ourcommonpaper" and viewing the content.

Regards,

Michael
Rakushun
[View user's profile]

Joined: 2010-11-09
Posts: 8
Rakushun wrote:
Hello Martin,
Another thing I just recognised: The problem only appears if I use the SCP protocol to connect to the server. If I connect via SFTP, there is no problem entering "/home/user/myboss/ourcommonpaper" and viewing the content.


However, if I use Putty, I get an error using the following commands:

server: /home/user/thisisme[213]>cd /home/user/myboss/ourcommonpaper
server: /home/user/myboss/ourcommonpaper[214]>pwd ..
pwd: ignoring non-option arguments
pwd: cannot open directory `..': Permission denied
server: /home/user/myboss/ourcommonpaper[215]>

Regards,

Michael
Rakushun
[View user's profile]

Joined: 2010-11-09
Posts: 8
Another thing to note:

The machine I connect to is not a Linux machine. It is a SunOS 5.10 machine.
If I connect to a Linux machine which has also access to the same home directories, it seems to work.

Regards,

Michael
Rakushun
[View user's profile]

Joined: 2010-11-09
Posts: 8
Ok, some deeper analysis:

Here the shell output if I connect to a linux machine:

linuxserver: /home/user/thisisme[248]>cd /home/user/myboss/ourcommonpaper
linuxserver: /home/user/myboss/ourcommonpaper[249]>pwd
/home/user/myboss/ourcommonpaper
linuxserver: /home/user/myboss/ourcommonpaper[250]>unalias pwd
linuxserver: /home/user/myboss/ourcommonpaper[251]>pwd
/home/user/ture/tex
linuxserver: /home/user/myboss/ourcommonpaper[252]>

And here a bit of shell output if I connect to the sun machine:

server: /home/user/thisisme[256]>cd /home/user/myboss/ourcommonpaper
server: /home/user/myboss/ourcommonpaper[257]>pwd
/home/user/myboss/ourcommonpaper
server: /home/user/myboss/ourcommonpaper[258]>alias
...
pwd echo $cwd
...
server: /home/user/myboss/ourcommonpaper[259]>unalias pwd
server: /home/user/myboss/ourcommonpaper[260]>pwd
pwd: cannot open directory `..': Permission denied
server: /home/user/myboss/ourcommonpaper[261]>

Regards,

Michael
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Try turning off Clear aliases:
https://winscp.net/eng/docs/ui_login_scp
Rakushun
[View user's profile]

Joined: 2010-11-09
Posts: 8
prikryl wrote:
Try turning off Clear aliases:
https://winscp.net/eng/docs/ui_login_scp


Yep, that seems to work Smile

Thnx,

Michael
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License