0

I am calling cmd.exe /c mklink /d C:\LOCAL\PATH \\REMOTE\PATH from cygwin as Admin and the drive can be accessed from multiple Admin's sessions as expected. However, my point is to use it by unprivileged local users as well.

I have changed the owner of the symlink to the user chown USER /LOCAL/PATH but I still can not access the drive:

USER@DESKTOP-P014S4E ~
$ stat /LOCAL/PATH
  File: ‘/LOCAL/PATH’ -> ‘//REMOTE/PATH’
  Size: 55          Blocks: 0          IO Block: 65536  symbolic link
Device: cccc11d4h/3435925972d Inode: 2814749767198837  Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (197619/  USER)   Gid: (197121/    None)
Access: 2016-01-13 12:41:49.035500500 -0800
Modify: 2016-01-13 12:41:49.035500500 -0800
Change: 2016-01-14 09:08:54.416498800 -0800
 Birth: 2016-01-13 12:41:49.035500500 -0800

USER@DESKTOP-P014S4E ~
$ ls -l /LOCAL/PATH
lrwxrwxrwx 1 USER None 55 Jan 13 12:41 /LOCAL/PATH -> //REMOTE/PATH

USER@DESKTOP-P014S4E ~
$ stat /LOCAL/PATH/
  File: ‘/LOCAL/PATH/’
  Size: 0           Blocks: 0          IO Block: 65536  directory
Device: c3h/195d  Inode: 2351152405898294425  Links: 1
Access: (0755/drwxr-xr-x)  Uid: (197619/  USER)   Gid: (197121/    None)
Access: 2016-01-13 12:41:49.035500500 -0800
Modify: 2016-01-13 12:41:49.035500500 -0800
Change: 2016-01-14 09:08:54.416498800 -0800
 Birth: 2016-01-13 12:41:49.035500500 -0800

USER@DESKTOP-P014S4E ~
$ ls -l /LOCAL/PATH/
ls: cannot open directory /LOCAL/PATH/: Permission denied

USER@DESKTOP-P014S4E ~
$ cd /LOCAL/PATH
-bash: cd: /LOCAL/PATH: Permission denied

USER@DESKTOP-P014S4E ~
$ cd /LOCAL/PATH/
-bash: cd: /LOCAL/PATH/: Permission denied

Note that stat /LOCAL/PATH/ reports something completely different for Admin:

Admin@DESKTOP-P014S4E ~
$ stat /LOCAL/PATH
  File: ‘/LOCAL/PATH’
  Size: 1024        Blocks: 8          IO Block: 65536  directory
Device: 38h/56d Inode: 2           Links: 25
Access: (0755/drwxr-xr-x)  Uid: (4278190080/Unix_User+0)   Gid: (4278190080/Unix_Group+0)
Access: 2016-01-14 01:12:12.000000000 -0800
Modify: 2015-11-19 02:34:42.000226000 -0800
Change: 2015-11-19 02:34:42.000226000 -0800
 Birth: -

Admin@DESKTOP-P014S4E ~
$ powershell -Command "Get-Acl C:\PATH"


    Directory: C:\


Path  Owner                  Access                                                                                    
----  -----                  ------                                                                                    
PATH DESKTOP-P014S4E\USER Everyone Allow  Read, Synchronize...

Thanks for any pointers.

Oliver Gondža
  • 3,386
  • 4
  • 29
  • 49
  • The problem might not be the symlink; can the users in question access \\REMOTE\PATH directly? – Harry Johnston Jan 15 '16 at 01:11
  • I have flipped the slashes when obfuscating paths names (edited). I presume that is not the problem as the symlink works for admin. What do you mean by *access the path directly*? When the user mount that NFS drive via `net use`, it can be accessed. – Oliver Gondža Jan 15 '16 at 08:33
  • 1
    Can they access it via a UNC path, e.g., `cmd /c dir \\REMOTE\PATH` ? – Harry Johnston Jan 15 '16 at 09:35
  • They can not (Access is denied), while Admin can. When I mount it using cygwin's mount `mount //REMOTE/PATH /mnt/drive`, the unpriviledged user can not access it either (Permission denied on `cd`). – Oliver Gondža Jan 15 '16 at 10:00
  • Looks to me like there's something odd in the way the NFS client works. I'm not familiar enough with it to be sure what's going on. Unfortunately it isn't widely used so finding someone who understands it may prove challenging. Good luck! – Harry Johnston Jan 15 '16 at 10:10

0 Answers0