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]

Possible chmod problem with a path


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)

* 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@@

--
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]