0

I had a whole bunch of configuration files stored in a zip file, spanning both my Windows 7 user file tree and my cygwin user file tree.

For example

drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users
drwx------+ 1 MyUserName Domain Users     0 Nov 24 16:12 c/Users/MyUserName
drwx------+ 1 MyUserName Domain Users     0 Nov 24 16:34 c/Users/MyUserName/Documents
-rwxrwx---  1 MyUserName Domain Users 32464 Jul 28 17:41 c/Users/MyUserName/Documents/_viminfo
-rwxrwx---  1 MyUserName Domain Users 15092 Jul 27 13:42 c/Users/MyUserName/Documents/_vimrc
drwx------+ 1 MyUserName Domain Users     0 Nov 24 16:11 c/Users/MyUserName/Documents/vimfiles
-rwxrwx---  1 MyUserName Domain Users   315 Oct 15  2016 c/Users/MyUserName/Documents/vimfiles/.netrwhist
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/after
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/after/ftplugin
-rwxrwxr-x  1 MyUserName Domain Users    39 Feb  9  2016 c/Users/MyUserName/Documents/vimfiles/after/ftplugin/netrw.vim
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/after/syntax
-rwxrwxr-x  1 MyUserName Domain Users    28 Jun 19  2013 c/Users/MyUserName/Documents/vimfiles/after/syntax/tex.vim
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/colors
-rwxrwx---  1 MyUserName Domain Users  5006 May 27  2016 c/Users/MyUserName/Documents/vimfiles/colors/mine.vim
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/plugin
-rwxrwxr-x  1 MyUserName Domain Users 26547 Sep 17  2014 c/Users/MyUserName/Documents/vimfiles/plugin/bufexplorer.vim
-rw-------  1 MyUserName Domain Users  3024 Jan 26  2015 c/Users/MyUserName/Documents/vimfiles/plugin/ChristiansHi20150126.vim
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/spell
-rwxrwxr-x  1 MyUserName Domain Users   963 Sep  8  2014 c/Users/MyUserName/Documents/vimfiles/spell/en.latin1.add
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 c/Users/MyUserName/Documents/vimfiles/syntax
-rw-r--r--  1 MyUserName Domain Users  8870 Feb 13  2015 c/Users/MyUserName/Documents/vimfiles/syntax/asy.vim
-rwxrwxr-x  1 MyUserName Domain Users  2749 Jul 30  2013 c/Users/MyUserName/Documents/vimfiles/syntax/texmf.vim
-rwxrwxr-x  1 MyUserName Domain Users 33322 Jun  8  2011 c/Users/MyUserName/Documents/vimfiles/syntax/vbnet.vim
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 etc
-rwxrwx---  1 MyUserName Domain Users   518 Dec  4  2014 etc/fstab
-rw-r--r--  1 MyUserName Domain Users   192 Aug 19  2014 etc/fstab.cygwin64default
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 etc/fstab.d
-rwxrwx---  1 MyUserName Domain Users     0 Aug  4  2011 etc/fstab.d/SomeUserName
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 home
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 home/MyUserName
-rwx------  1 MyUserName Domain Users  1852 Aug 21 14:21 home/MyUserName/.alias.bash
-rwx------  1 MyUserName Domain Users  1503 Aug 19  2014 home/MyUserName/.alias.csh
lrwxrwxrwx  1 MyUserName Domain Users     7 Nov 24 15:21 home/MyUserName/.bash_login -> .bashrc
-rwxr-xr-x  1 MyUserName Domain Users  1150 Aug 19  2014 home/MyUserName/.bash_profile
-rwxr-xr-x  1 MyUserName Domain Users  2499 Jun 15  2015 home/MyUserName/.bashrc
-rwx------  1 MyUserName Domain Users  1904 Aug 19  2014 home/MyUserName/.cshrc
-rwxr-xr-x  1 MyUserName Domain Users    41 Aug 19  2014 home/MyUserName/.inputrc
-rw-r--r--  1 MyUserName Domain Users   101 Aug 19  2014 home/MyUserName/.minttyrc
-rwx------  1 MyUserName Domain Users   102 Jan 27  2015 home/MyUserName/.octaverc
-rwxr-xr-x  1 MyUserName Domain Users    65 Dec  2  2014 home/MyUserName/.pdfjam.conf
-rwxr-xr-x  1 MyUserName Domain Users   792 Aug 19  2014 home/MyUserName/.profile
-rw-------  1 MyUserName Domain Users    51 Jun 14  2015 home/MyUserName/.Renviron
-rw-------  1 MyUserName Domain Users   706 Apr 20  2015 home/MyUserName/.Rprofile
-rwx------  1 MyUserName Domain Users    58 Jun 16  2015 home/MyUserName/.startxwinrc
-rwx------  1 MyUserName Domain Users  9521 Aug 19  2014 home/MyUserName/.twmrc
-rwx------  1 MyUserName Domain Users  9306 Aug 19  2014 home/MyUserName/.twmrc.alt
-rwx------  1 MyUserName Domain Users  1803 May  1  2015 home/MyUserName/.Xresources
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 home/MyUserName/bin
-rwxrwx---  1 MyUserName Domain Users   138 May 14  2012 home/MyUserName/bin/a2pdf.bash
-rwxrwx---  1 MyUserName Domain Users     8 Jan 25  2014 home/MyUserName/bin/bc.rc
-rwxrwx---  1 MyUserName Domain Users    29 Jan 25  2014 home/MyUserName/bin/dosbc
-rw-------  1 MyUserName Domain Users  1557 Nov  8  2013 home/MyUserName/bin/dvi2pdfa
-rwxrwx---  1 MyUserName Domain Users   349 Aug  2  2013 home/MyUserName/bin/pcvim
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 usr
drwx------+ 1 MyUserName Domain Users     0 Nov 24 15:21 usr/share
drwx------+ 1 MyUserName Domain Users     0 Nov 24 16:11 usr/share/vim
lrwxrwxrwx  1 MyUserName Domain Users    35 Nov 24 15:21 usr/share/vim/vimfiles -> /c/Users/MyUserName/Documents/vimfiles
lrwxrwxrwx  1 MyUserName Domain Users    33 Nov 24 15:21 usr/share/vim/vimrc -> /c/Users/MyUserName/Documents/_vimrc

I unpacked everything into a temp folder, and copied them into their proper place issuing the following from the temp directory:

tar cf - * | ( cd / ; tar xf - )

I think I created a big problem. I suspect that all the unpacked directories overwrite the existing directories, and the ownership of the directories changed to SYSTEM, including c:\Users\MyUserName. Now I can't even browse to my own Windows home folder using Windows Explorer. That is, I can't start from c:\ and click my way down. I get a permission denied at c:\Users\MyUserName, apparently because the ownership changed:

$ls -ld /c/Users/MyUserName
drwx------+ 1 SYSTEM SYSTEM 0 2017-11-24 16:56 /c/Users/MyUserName

In contrast to the above, issuing cygstart MyUserName from /c/Users opens up the Windows home directory just fine, but it looks like the home directory of a virgin account, containing none of the things that I know should be there. Perhaps it is a sandbox version from the c:\users\MyUserName\Appdata\local\VirtualStore file tree.

Another possibility is that the permissions are messed up by the way that file systems are mounted via fstab:

# For a description of the file format, see the Users Guide
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
c: /c ntfs binary,posix=0,user,auto
d: /d ntfs binary,posix=0,user,auto
e: /e ntfs binary,posix=0,user,auto
f: /f ntfs binary,posix=0,user,auto
g: /g ntfs binary,posix=0,user,auto
i: /i ntfs binary,posix=0,user,auto
o: /o ntfs binary,posix=0,user,auto
r: /r ntfs binary,posix=0,user,auto
s: /s ntfs binary,posix=0,user,auto

I'm not very familiar with the fine points of mounting file systems, so I'm not sure whether the above shows anything. My check is to circumvent /c using cygdrive, which still exhibits the same problem:

$ls /cygdrive/c/Users/MyUserName/
ls: cannot open directory /cygdrive/c/Users/MyUserName/: Permission denied

If I go to my IT folks with this weird permissions/security problem, they will probably chop off all my appendages, get me fired, and never again let me mess around with anything but Microsoft Office.

As a non-administrator, is there anything I can do to recover my normal access the c:\Users\MyUserName?

I'm not entirely sure that the problem is due to untarring to c:\Users\MyUserName, but its my only suspect right now. Due to long debilitating approval processes, I have a 2015 version of cygwin installed.

  • 1
    "As a non-administrator, is there anything I can do to recover my normal access the c:\Users\MyUserName?" Probably not. you will to bow down and grovel to your IT department and admit you have made a big mistake. – DavidPostill Nov 24 '17 at 22:29
  • Just to clarify the situation, I don't have an issue with admitting fault. Given the emphasis on security, however, my fear is that such "advanced" means of computation (i.e. non-Microsoft) is considered way out in left field, and will be crushed out of existence. That doesn't bode well for one's personal capabilities, ability to deliver, or satisfaction with a job well done. – user36800 Nov 25 '17 at 1:12
  • BTW, I said above that I'm not entirely sure that untarring is responsible for changing the ownership of my home directory. I installed cygwin as a non-administrator, so I'm not sure how any cygwin process can change ownership a Windows home folder to SYSTEM. – user36800 Nov 25 '17 at 2:58
0

As DavidPostill suggested, there was no way that I could find, as a non-administrator, to recover access to my Windows home directory. An administrator had to do it, and in fact, his attempts to set permissions was initially denied. I'm not sure what he did, but I believe he took ownership of the folder tree, then assigned permissions to my user account.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.