This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problems with Cygwin symlinks on a TrueCrypt volume


Greetings,

I just happened to stumble over the problem described below.

Additional information:

  - Windows Vista, patched this week.

  - Cygwin updated this week.

  - TrueCrypt downloaded and installed this week.

First the normal case using the "C:" partition, where everything runs as
expected:

$ echo $CYGWIN
glob:noignorecase proc_retry:10 nodosfilewarning winsymlinks
$ pwd
/home/Rainer
$ ln -s . xx
$ ls -nl xx
lrwxrwxrwx 1 1002 513 1 2013-12-06 11:36 xx -> .
$ rm xx
$ ls -nl xx*
ls: cannot access xx*: No such file or directory
$

Now the weird behaviour on a TrueCrypt volume  mounted as "G:" (or "/g/"
under Cygwin):

$ cd /g
$ ln -s . xx
$ ls -nl xx
lrwxrwxrwx 1 1002 513 1 2013-12-06 11:38 xx -> .
$ rm xx*
rm: cannot remove `xx': Permission denied
$ rm -f xx*
rm: cannot remove `xx': Permission denied
$ ls -nl xx*
lrwxrwxrwx 1 1002 513 1 2013-12-06 11:38 xx -> .
$ id
uid=1002(Rainer) gid=513(none) groups=513(none),545(user)
$

After some  pondering I remembered that  Cygwin symlinks  internally use
the DOS ReadOnly attribute -- and sure enough:

$ where attrib
/c/WINDOWS/system32/attrib
$ attrib -r 'g:\xx.lnk'
$ rm xx.lnk
$ ls -nl xx*
ls: cannot access xx*: No such file or directory
$ 

Horray, the symlink is gone.

And ordinary files are just the same on TrueCrypt volumes:

$ pwd
/g
$ touch xx
$ attrib +r 'g:\xx'
$ ls -nl xx
-r--------+ 1 1002 513 0 2013-12-06 11:40 xx
$ rm xx
rm: remove write-protected regular empty file `xx'? y
rm: cannot remove `xx': Permission denied
$ ls -nl xx
-r--------+ 1 1002 513 0 2013-12-06 11:40 xx
$ attrib -r 'g:\xx'
$ rm xx
$ ls -nl xx
ls: cannot access xx: No such file or directory
$

I really dont't know whether Windows  or TrueCrypt is incorrectly inter-
preting  the DOS ReadOnly attribute,  and thus  whose  fault this is.  I
would simply  suggest to change the code  of the  "rm" command so it ex-
plicitly removes  the DOS ReadOnly  attribute  before it unlinks any ob-
ject.

Not knowing much about  the internals of  Cygwin I'm completely  unaware
whether or not  this suggestion would break  anything  else, but perhaps
someone having the necessary insight could shed some light on this.

Sincerely
 Rainer

 ----------------------------------------------------------------------
| Rainer M Woitok                | Phone : (+49 60 93) 487 95 95       |
| Kolpingstraße 3                | Mobile: (+49 172) 813 6 831         |
| D-63846 Laufach                | Mail  : Rainer.Woitok@Gmail.Com     |
| Germany                        |                                     |
 ----------------------------------------------------------------------

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]