1.5.21: Unable to copy/move autorun.inf on mapped drives

Dave Korn dave.korn@artimi.com
Tue Sep 12 13:58:00 GMT 2006

On 12 September 2006 14:33, Brian Davidson wrote:

> I have been using Cygwin for years to automatically produce
> InstallShield installations for our company.  After formatting my PC and
> installing the latest available Cygwin release, I believe I have found a
> very obscure bug which only seems to impact autorun.inf and only on
> mapped drives.  I could not reproduce this issue on a local drive with
> the same or different autorun.inf file.  Being in software QA, I have
> tried as many scenarios as I could think of, but being human, I'm
> willing to admit I may have missed something.

  The fact that cygwin and windows have different permissions schemes, most

> To reproduce:
> 1.  Create a folder on any drive
> 2.  Share that folder
> 3.  Map that folder to any available drive letter (i.e. net use X:
> \\machinename\share)
> 4.  Using Windows Explorer, copy an autorun.inf file into this
> directory.

  Is it the name of this file that matters, or the contents?

  Or is it the permissions?

  Or is it where I get it from?  Does it matter whether the autorun.inf came
from a CD or was somewhere on your HD already?  Where did you get yours from.

> 5.  Open a Windows Command Prompt and cd to the mapped drive where the
> file was placed.
> 6.  Type "ren autorun.inf test.txt"
> TEST 1: Proving the process works outside of Cygwin:
> 7.  Type "copy test.txt autorun.inf".  This should succeed and you wind
> up with 2 identical files.

  Identical in all respects except perms, I'd bet.  copy doesn't preserve the
ACLs, it creates a new file using your user id's default ACL.  You need to use
xcopy with the `-O' option.

> 8.  Type "del autorun.inf" to revert the environment for the next test.
> TEST 2: Proving the process does not work in Cygwin:
> 9.  Open Cygwin BASH shell
> 10.  cd to the mapped drive (/cygdrive/x for example)
> 11.  Type "cp test.txt autorun.inf".  You should get a "Permission
> denied" error.

  Nope, worked fine for me.  Then again I created an empty .inf file by using
cygwin's touch command.

> As I said, I have used this process for years without incident.  To work
> around this, I chose to use subst and endure the consequences on
> Windows, but this is a problem nonetheless.
> I would like to know if anyone else can (or has) reproduced this issue,
> as I have not found anything specific on this in the newsgroups or
> FAQ's.

  If you copied the .inf file from a CD, it will have ended up with the
readonly attribute set.  Check if that's making a difference.

Can't think of a witty .sigline today....

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

More information about the Cygwin mailing list