public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: File permissions different inside and outside cygwin root
@ 2015-05-24 16:30 Duane Ellis
  2015-06-01 18:44 ` Buchbinder, Barry (NIH/NIAID) [E]
  0 siblings, 1 reply; 9+ messages in thread
From: Duane Ellis @ 2015-05-24 16:30 UTC (permalink / raw)
  To: cygwin

(Sorry I cannot reply directly to the previous email I just subscribed to the list, I am quoting from the list archive)

>> (from the archive - permissions inside and outside of /cygwin get messed up)

I think this is *THE* cause of my problems.

My question is how do I turn this of 100% totally - and completely?

How it is effecting me:

In my case, I *OFTEN* edit source code using ‘emacs-w32’ under cygwin.

and often refer to files via  a filename like this /cygdrive/c/some/path/foo.c

Sadly what happens in the end is, the ACL gets set to the point where I cannot edit source files.

Another common example is this:

Step 1:  On Linux  - create a “tar.gz” of a source directory.

	tar cfz  foo.tar.gz  somedirectory

(In my case, it is an open source package that *must* build under both cygwin and linux)
I need to move the code back and forth - to make sure my changes don’t break things

Step 2:  Pull that tar file over to Cygwin (I use cygwin64)

Step 3: Unpack the tar.gz file using CYGWIN

	tar xfz foo.bar.tz

Step 4:	
	I specifically use “emacs-w32” - to edit the source code.
	It seems that *randomly* the ACL gets totally bunkered

	Maybe there is a method to this madness, but I can’t figure out the exact sequence

I am *NOT* building or doing this under  any Cygwin mount
I should not need to, and I should not be required to

I specifically use:  /cygdrive/c/some/path/

**NOTE**

   This does not *require* the ‘tar-copy’ method 
   Using CYGWIN - I “git clone” some repository and edit the files in the standard way
   It seems to be more predominant when I copy via TAR across systems.


Result:
	I can no longer edit my source code.
	I would end up having to “right click” permissions and fix things using windows tools

       It seems the ACLs are totally messed up

Bottom line, my expected behavior

	I should be able to use a simple editor - i.e.: Emacs-w32
	I should be able to edit a source code file
	When I save the source code file - the permissions *before* and *after* should be identical

	They are not, permissions are totally messed up.

	What ever I am seeing, it is fundamentally broken.

-Duane.



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: File permissions different inside and outside cygwin root
  2015-05-24 16:30 File permissions different inside and outside cygwin root Duane Ellis
@ 2015-06-01 18:44 ` Buchbinder, Barry (NIH/NIAID) [E]
  2015-06-02  0:01   ` Steven Penny
  0 siblings, 1 reply; 9+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) [E] @ 2015-06-01 18:44 UTC (permalink / raw)
  To: cygwin; +Cc: 'Duane Ellis'

Duane Ellis sent the following at Sunday, May 24, 2015 11:03 AM
>(Sorry I cannot reply directly to the previous email I just subscribed
>to the list, I am quoting from the list archive)
>>> (from the archive - permissions inside and outside of /cygwin get messed up)
>
>I think this is *THE* cause of my problems.
>
>My question is how do I turn this of 100% totally - and completely?
>
>How it is effecting me:
>
>In my case, I *OFTEN* edit source code using 'emacs-w32' under cygwin.
>
>and often refer to files via a filename like this
>/cygdrive/c/some/path/foo.c
>
>Sadly what happens in the end is, the ACL gets set to the point where I
>cannot edit source files.
>
>Another common example is this:
>
>Step 1: On Linux - create a "tar.gz" of a source directory.
>	tar cfz  foo.tar.gz  somedirectory
>
>(In my case, it is an open source package that *must* build under both
>cygwin and linux) I need to move the code back and forth - to make sure
>my changes don't break things
>
>Step 2: Pull that tar file over to Cygwin (I use cygwin64)
>
>Step 3: Unpack the tar.gz file using CYGWIN
>	tar xfz foo.bar.tz
>
>	I specifically use "emacs-w32" - to edit the source code.
>	It seems that *randomly* the ACL gets totally bunkered
>
>Step 4:
>	Maybe there is a method to this madness, but I can't figure out the exact sequence
>
>I am *NOT* building or doing this under any Cygwin mount I should not
>need to, and I should not be required to
>
>I specifically use: /cygdrive/c/some/path/
>
>**NOTE**
>   This does not *require* the 'tar-copy' method
>   Using CYGWIN - I "git clone" some repository and edit the files in the standard way
>   It seems to be more predominant when I copy via TAR across systems.
>
>	I can no longer edit my source code.
>	I would end up having to "right click" permissions and fix things using windows tools
>
>Result:
>       It seems the ACLs are totally messed up
>
>Bottom line, my expected behavior
>	I should be able to use a simple editor - i.e.: Emacs-w32
>	I should be able to edit a source code file
>	When I save the source code file - the permissions *before* and *after* should be identical
>
>	They are not, permissions are totally messed up.
>
>	Whatever I am seeing, it is fundamentally broken.

The following is totally a guess.  You try it at your own risk.

It is possible that the solution is in windows, not cygwin.

Windows can have security settings that propagate down a directory tree.
And when Windows and Cygwin argue, Windows wins.

- Go into Windows Explorer for C:\some or C:\some\path.
        (I advise NOT trying this on C:\.  If you do and it results
           in disaster, it is on your head.)
- Right click and select "Properties".
- Go to the "Security" tab.
- "Advanced".
- Select the account under which you use cygwin.
- "Change permissions".
- You might need to experiment on whether to check or uncheck "Include
    inheritable permissions from this object's parent".
- Check "Replace all child permissions with inheritable permissions
    from this object".
- Select the account under which you use cygwin.
- "Edit".
- "Full control".
- "OK", etc.

Or something like that.

Again, you play with the Security tab at your own risk.

Good luck,

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: File permissions different inside and outside cygwin root
  2015-06-01 18:44 ` Buchbinder, Barry (NIH/NIAID) [E]
@ 2015-06-02  0:01   ` Steven Penny
  2015-06-02  7:00     ` Yaakov Selkowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Steven Penny @ 2015-06-02  0:01 UTC (permalink / raw)
  To: cygwin

On Mon, Jun 1, 2015 at 1:38 PM, Buchbinder, Barry (NIH/NIAID) [E] wrote:
> - Right click and select "Properties".
> - Go to the "Security" tab.
> - "Advanced".

For goodness sake, do not do this. Do not break your computer because Cygwin
sucks at permissions. Just read my post on noacl and live with the compromise
until they fix it:

http://cygwin.com/ml/cygwin/2015-05/msg00297.html

Do NOT listen to Barry, you can break your computer following his advice:

http://cygwin.com/ml/cygwin/2015-04/msg00103.html

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: File permissions different inside and outside cygwin root
  2015-06-02  0:01   ` Steven Penny
@ 2015-06-02  7:00     ` Yaakov Selkowitz
  2015-06-02 12:58       ` Buchbinder, Barry (NIH/NIAID) [E]
  0 siblings, 1 reply; 9+ messages in thread
From: Yaakov Selkowitz @ 2015-06-02  7:00 UTC (permalink / raw)
  To: cygwin

On Mon, 2015-06-01 at 19:01 -0500, Steven Penny wrote:
> On Mon, Jun 1, 2015 at 1:38 PM, Buchbinder, Barry (NIH/NIAID) [E] wrote:
> > - Right click and select "Properties".
> > - Go to the "Security" tab.
> > - "Advanced".
> 
> For goodness sake, do not do this. Do not break your computer because Cygwin
> sucks at permissions. Just read my post on noacl and live with the compromise
> until they fix it:
> 
> http://cygwin.com/ml/cygwin/2015-05/msg00297.html
> 
> Do NOT listen to Barry, you can break your computer following his advice:

While you are welcome to disagree with someone's opinion, you need to do
so without personal attacks.  Please be sure to be more considerate in
your future interactions.

--
Yaakov



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: File permissions different inside and outside cygwin root
  2015-06-02  7:00     ` Yaakov Selkowitz
@ 2015-06-02 12:58       ` Buchbinder, Barry (NIH/NIAID) [E]
  2015-06-02 14:53         ` Duane Ellis
  0 siblings, 1 reply; 9+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) [E] @ 2015-06-02 12:58 UTC (permalink / raw)
  To: cygwin

Yaakov Selkowitz sent the following at Tuesday, June 02, 2015 3:01 AM
>On Mon, 2015-06-01 at 19:01 -0500, Steven Penny wrote:
>> On Mon, Jun 1, 2015 at 1:38 PM, Buchbinder, Barry (NIH/NIAID) [E] wrote:
>> For goodness sake, do not do this. Do not break your computer because Cygwin
>> sucks at permissions. Just read my post on noacl and live with the compromise
>> until they fix it:
>>
>> http://cygwin.com/ml/cygwin/2015-05/msg00297.html
>>
>> Do NOT listen to Barry, you can break your computer following his advice:
>
>While you are welcome to disagree with someone's opinion, you need to do
>so without personal attacks. Please be sure to be more considerate in
>your future interactions.

For the record, I did not take Steve's comments as a personal attack.
Any harshness of tone was directed at my suggestion and not at me.

The harshness did sting, but that's my problem.  I think Steve was trying to
emphasize to the OP that he thought my suggestion was a VERY bad idea.

But I also appreciate your post, Yaakov.

Best wishes to you both, to the OP, and to everyone else,

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: File permissions different inside and outside cygwin root
  2015-06-02 12:58       ` Buchbinder, Barry (NIH/NIAID) [E]
@ 2015-06-02 14:53         ` Duane Ellis
  2015-06-05  3:53           ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 9+ messages in thread
From: Duane Ellis @ 2015-06-02 14:53 UTC (permalink / raw)
  To: cygwin; +Cc: Buchbinder, Barry (NIH/NIAID) [E]

[paraphrased, and edited]

(Duane) describing the problem

(Barry)  .. click click click right click .. click click to undo this crazyness
(steve)  DO not do this .. you can break things in really bad ways

I would agree, I did not have time to reply yet.

My comment would be this:
	This is not an appropriate solution - is very HUMAN ERROR prone
	It does not scale well to others not familiar with the process.

	Cygwin should just work, or the feature that causes this should be disabled

assuming that it is the ACLs,  my questions are 

1)  How do I disable the ACL feature completely?

2) How can I determine if the ACL feature is enabled?
	I need to put this test in a few build scripts
	I need to prevent execution if the situation exists
        if  `SOMETEST`
        then
              echo “FIX THIS BUILD FAIL”
              exit 1
         fi





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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: File permissions different inside and outside cygwin root
  2015-06-02 14:53         ` Duane Ellis
@ 2015-06-05  3:53           ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 9+ messages in thread
From: Larry Hall (Cygwin) @ 2015-06-05  3:53 UTC (permalink / raw)
  To: cygwin

On 06/02/2015 10:53 AM, Duane Ellis wrote:
> [paraphrased, and edited]
>
> (Duane) describing the problem
>
> (Barry)  .. click click click right click .. click click to undo this crazyness
> (steve)  DO not do this .. you can break things in really bad ways
>
> I would agree, I did not have time to reply yet.
>
> My comment would be this:
> 	This is not an appropriate solution - is very HUMAN ERROR prone
> 	It does not scale well to others not familiar with the process.
>
> 	Cygwin should just work, or the feature that causes this should be disabled
>
> assuming that it is the ACLs,  my questions are
>
> 1)  How do I disable the ACL feature completely?
>
> 2) How can I determine if the ACL feature is enabled?
> 	I need to put this test in a few build scripts
> 	I need to prevent execution if the situation exists
>          if  `SOMETEST`
>          then
>                echo “FIX THIS BUILD FAIL”
>                exit 1
>           fi

As others have pointed out already, you can use the "noacl" option to mount
paths and drives to use Windows ACL semantics instead.  You can even mount
'cygdrive' with "noacl" so that all references to drives through "/cygdrive"
will follow the Windows semantics.  If you're looking for the finer details
and caveats about how POSIX ACLs are used and not, see the section on "The
Cygwin Mount Table" in the User's Guide:

<https://cygwin.com/cygwin-ug-net/using.html#mount-table>


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: File permissions different inside and outside cygwin root
  2015-05-21 13:05 DeTracey, Brendan
@ 2015-05-22  1:32 ` Steven Penny
  0 siblings, 0 replies; 9+ messages in thread
From: Steven Penny @ 2015-05-22  1:32 UTC (permalink / raw)
  To: cygwin

On Thu, May 21, 2015 at 7:33 AM, DeTracey, Brendan wrote:
> $ touch /cygdrive/c/Temp/testfile
> $ ll /cygdrive/c/Temp/testfile
> -rw-rwxr--+ 1 detraceyb Domain Users 0 May 21 09:23 /cygdrive/c/Temp/testfile*

What you are seeing is the current behavior, some discussion is being had about
what is right to do in this situation:

http://cygwin.com/ml/cygwin/2015-05/msg00194.html
http://cygwin.com/ml/cygwin/2015-04/msg00171.html

I am of the opinion that if you "touch" a file, it should not be executable
under Cygwin unless you explicitly grant that permission via "chmod", "install",
etc. However some are not agreeing with this and we are left with the current
state. My current workaround for this is using "noacl" mounts when needed:

http://github.com/svnpenn/dotfiles/blob/b8ace36/fstab

This does have some drawbacks. noacl mounts will ignore any programs such as
"chmod" and "install" that modify permissions. Instead files are checked for a
shebang:

- "#!" in the case of Bash scripts
- ":" in the case of batch files

Even though it is already a good idea to use a shebang,

http://stackoverflow.com/q/25165808

using "noacl" forces the matter. Also using "noacl" I believe gives you less
control over permissions, as I am not sure how you would even do something like
setting read or write permissions.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* File permissions different inside and outside cygwin root
@ 2015-05-21 13:05 DeTracey, Brendan
  2015-05-22  1:32 ` Steven Penny
  0 siblings, 1 reply; 9+ messages in thread
From: DeTracey, Brendan @ 2015-05-21 13:05 UTC (permalink / raw)
  To: cygwin

Is the normal Cygwin behaviour to assign different file permissions outside of the Cygwin root directory?
e.g.
$ touch /home/detraceyb/testfile
$ ll /home/detraceyb/testfile
-rw-r--r-- 1 detraceyb Domain Users 0 May 21 09:20 /home/detraceyb/testfile
$ getfacl /home/detraceyb/testfile
# file: /home/detraceyb/testfile
# owner: detraceyb
# group: Domain Users
user::rw-
group::r--
other:r--

$ touch /cygdrive/c/Temp/testfile
$ ll /cygdrive/c/Temp/testfile
-rw-rwxr--+ 1 detraceyb Domain Users 0 May 21 09:23 /cygdrive/c/Temp/testfile*
$ getfacl /cygdrive/c/Temp/testfile
# file: /cygdrive/c/Temp/testfile
# owner: detraceyb
# group: Domain Users
user::rw-
group::r--
group:root:rwx
group:Authenticated Users:rwx
group:SYSTEM:rwx
group:Users:r-x
mask:rwx
other:r--

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-06-05  3:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 16:30 File permissions different inside and outside cygwin root Duane Ellis
2015-06-01 18:44 ` Buchbinder, Barry (NIH/NIAID) [E]
2015-06-02  0:01   ` Steven Penny
2015-06-02  7:00     ` Yaakov Selkowitz
2015-06-02 12:58       ` Buchbinder, Barry (NIH/NIAID) [E]
2015-06-02 14:53         ` Duane Ellis
2015-06-05  3:53           ` Larry Hall (Cygwin)
  -- strict thread matches above, loose matches on Subject: below --
2015-05-21 13:05 DeTracey, Brendan
2015-05-22  1:32 ` Steven Penny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).