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]

Re: Possible chmod problem with a path


Greetings, Phil Smith!

> The short description is that chmod *with a path* says it works, but
> doesn't. If I cd to the directory and do it from there, it works. 

> This behavior *seems* to have started recently, after I installed gawk (and
> in the process updated some other Cygwin bits). Our scaffolding for some
> cross-platform builds uses Cygwin (and CMake), and I started having
> permissions problems with the build artifacts on my machine.

> I've tried with both forward and backslashes. In the examples below, the
> path is longish, but I can reproduce it to C:\temp as well. A colleague with
> an older Cygwin cannot reproduce it. Of course it's possible this is Windows
> somehow having become confused, but it's hard to see how (but then, it's Windows...OK, I'm looping).

> I've read the FAQ and searched the archives as best I can -- there are lots
> of hits for "chmod" and "path", of course.

> Any suggestions (besides "reformat and reinstall Windows") welcome.

> Environment:
> Windows 7 Professional, fully patched, 64-bit, Genuine Intel.

> uname -r 1.7.35(0.287/5/3)

> Asterisked lines are my comments:

> * OK, I'm in C:\SVN\zFPE610:
> C:\SVN\zFPE610>cat ZFP-BUILD-2015-03-27-001\Updated\VSHPCRT1
> cat: ZFP-BUILD-2015-03-27-001\Updated\VSHPCRT1: Permission denied

> * Let's chmod:
> C:\SVN\zFPE610>chmod -v 777 C:/SVN/zFPE610/ZFP-BUILD-2015-03-27-001/Updated/*
> mode of 'C:/SVN/zFPE610/ZFP-BUILD-2015-03-27-001/Updated/VSHPCRT1' changed
> from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)

Please use Cygwin paths with Cygwin tools.
Windows paths are not guaranteed to work with every Cygwin tool.

> * Nope:
> C:\SVN\zFPE610>cat ZFP-BUILD-2015-03-27-001\Updated\VSHPCRT1
> cat: ZFP-BUILD-2015-03-27-001\Updated\VSHPCRT1: Permission denied

> * Let's look:
> C:\SVN\zFPE610>ls -l ZFP-BUILD-2015-03-27-001/Updated/*
> ----rwx---+ 1 phsiii None 6800 Mar 27 15:24
> ZFP-BUILD-2015-03-27-001/Updated/VSHPCRT1

> * That sneaky chmod lied!

> * Let's go to the directory:
> C:\SVN\zFPE610>cd C:/SVN/zFPE610/ZFP-BUILD-2015-03-27-001/Updated/

> * Nope, as expected:
> C:\SVN\zFPE610\ZFP-BUILD-2015-03-27-001\Updated>cat VSHPCRT1
> cat: VSHPCRT1: Permission denied

> * Now let's chmod again from there:
> C:\SVN\zFPE610\ZFP-BUILD-2015-03-27-001\Updated>chmod 777 *

> * Hey, it works!
> C:\SVN\zFPE610\ZFP-BUILD-2015-03-27-001\Updated>cat VSHPCRT1
> ¦Q¦@@X¦¦^G¦¦b¦¦¦¦¦¦¦¦¦¦a¦¦a¦¦¦¦K¦¦@@@Ö¦¦¦¦¦¦¦@¦¦¦¦`¦¦¦¦¦¦¦¦¦¦¦¦¦¦@@¦8@@¦8@@

What you are doing may or may not work, depends, if you are using Cygwin or
native Subversion client.
In either case, it isn't very bright idea to enforce POSIX access mask outside
Cygwin tree, unless you know what you are doing and absolutely need it.
From your description, you don't need it at all.


-- 
With best regards,
Andrey Repin
Monday, March 30, 2015 17:16:28

Sorry for my terrible english...

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