public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Permissions not set for 'other' when copying from Windows
@ 2018-12-17 12:06 john doe
  2018-12-17 12:16 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: john doe @ 2018-12-17 12:06 UTC (permalink / raw)
  To: cygwin

Hi,

I'm trying to understand why a copied file from 'C:\' into
/home/user/try doesn't have the permissions set for 'other' (see below).

The following will create a file named 'try.txt':

PS C:\> new-item try.txt -itemtype file


    Directory: C:\


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        12/17/2018  04:10 PM          0 try.txt


PS C:\>


Now copying the newly created file using the cp command on Cygwin:

user@hostname ~/try
$ cp /cygdrive/c/try.txt $PWD/


Now, the touch utility is used to create a file named 'touch.txt':

user@hostname ~/try
$ touch touch.txt

The ls command shows:

user@hostname ~/try
$ ls -l
total 0
-rw-r--r-- 1 user None 0 Dec 17 04:12 touch.txt
-rwxr-x--- 1 user None 0 Dec 17 04:12 try.txt


When the file is created with the touch utility, the permissions are
properly set for 'user', 'group', and 'other' but when the file is
copied from outsite of Cygwin only the 'user' and 'group' permissions
are set.
Obviously, 'other' is not used on Cygwin, everytime the file is SCPed on
a linux server the permissions need to be change for 'other' to match
the permissions on that server.
Why is that so and is there a better way around this?


-- 
John Doe

--
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] 4+ messages in thread

* Re: Permissions not set for 'other' when copying from Windows
  2018-12-17 12:06 Permissions not set for 'other' when copying from Windows john doe
@ 2018-12-17 12:16 ` Corinna Vinschen
  2018-12-17 15:21   ` john doe
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2018-12-17 12:16 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

On Dec 17 13:06, john doe wrote:
> Hi,
> 
> I'm trying to understand why a copied file from 'C:\' into
> /home/user/try doesn't have the permissions set for 'other' (see below).

POSIX "other" == Windows "Everyone".  Windows default permissions
typically don't give permissions to "Everyone".  Thus POSIX "other"
has no permissions by default after copying such a file.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Permissions not set for 'other' when copying from Windows
  2018-12-17 12:16 ` Corinna Vinschen
@ 2018-12-17 15:21   ` john doe
  2018-12-17 15:46     ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: john doe @ 2018-12-17 15:21 UTC (permalink / raw)
  To: cygwin

On 12/17/2018 1:15 PM, Corinna Vinschen wrote:
> On Dec 17 13:06, john doe wrote:
>> Hi,
>>
>> I'm trying to understand why a copied file from 'C:\' into
>> /home/user/try doesn't have the permissions set for 'other' (see below).
> 
> POSIX "other" == Windows "Everyone".  Windows default permissions
> typically don't give permissions to "Everyone".  Thus POSIX "other"
> has no permissions by default after copying such a file.
> 

Thank you, it works:

PS C:\> & icacls try.txt /grant "*S-1-1-0:(GA)"


The powershell way (set-acl) might be easier if you don't want to fiddle
with quoting and the call operator or simply use the command in cmd.exe
(no '&' and no quotes).

-- 
John Doe

--
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] 4+ messages in thread

* Re: Permissions not set for 'other' when copying from Windows
  2018-12-17 15:21   ` john doe
@ 2018-12-17 15:46     ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2018-12-17 15:46 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 809 bytes --]

On Dec 17 16:21, john doe wrote:
> On 12/17/2018 1:15 PM, Corinna Vinschen wrote:
> > On Dec 17 13:06, john doe wrote:
> >> Hi,
> >>
> >> I'm trying to understand why a copied file from 'C:\' into
> >> /home/user/try doesn't have the permissions set for 'other' (see below).
> > 
> > POSIX "other" == Windows "Everyone".  Windows default permissions
> > typically don't give permissions to "Everyone".  Thus POSIX "other"
> > has no permissions by default after copying such a file.
> > 
> 
> Thank you, it works:
> 
> PS C:\> & icacls try.txt /grant "*S-1-1-0:(GA)"

Just FTR: You can do this in Cygwin the POSIX way:

  chmod o+r try.txt

combined with -R for recursive tasks and with find(1) loops for more
complex scenarios.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2018-12-17 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 12:06 Permissions not set for 'other' when copying from Windows john doe
2018-12-17 12:16 ` Corinna Vinschen
2018-12-17 15:21   ` john doe
2018-12-17 15:46     ` Corinna Vinschen

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