wget seemingly modifies file access permissions on XP

Herbert Stocker hersto@gmx.de
Thu Mar 31 17:51:00 GMT 2016

Hi mihau,

On 30.03.2016 16:39, mihau wrote:
 > hello,
 > (my setup is latest cygwin 32bit on Win XP SP3, logged in as
 > Administrator)
 > I have just updated my cygwin installation after a year or so and
 > stumbled upon weird behavior with its wget build. it seems to
 > screw file access permissions on downloaded files, rendering e.g.
 > downloaded exe files unusable (because even the administrator
 > doesnt have the rights to execute them).
 > this hasn't happened before today, but unfortunately I cannot tell
 > a. whether wget was updated today at all and if it was, b. which
 > version I had installed before.

And on 30.03.2016 19:55, mihau wrote:
 > any idea why wget cygwin interferes with those things though?
 > in my understanding it should just copy/save a file from a remote
 > server to a local computer, without even touching file permissions or
 > such. several windows batch files which I use now, either have to be
 > edited and "chmod +x" added in all of them - or I'll just stick with
 > wget mingw.

i just tried wget on a Linux box, and it also does not add x flags to
an .exe downloaded.

What wget does is downloading a file from an HTTP server and storing it
with default permissions. These seam to be 666 (rw-rw-rw-) with some of
the bits removed by your umask setting. (There is no x flag in (rw-rw-rw-).

We are talking about 666 or rwxrwxrwx style permissions because that's
the POSIX way of expressing permissions (untless ACLs are used).

And wget for Cygwin is a POSIX program and Cygwin translates the POSIX
system calls from wget (which are create file, write data to file,
close file, etc) to Win32 system calls that Windows can process. It
tries hard to provide a perfect POSIX environment to its applications.

On HTTP a file is just a bunch of bytes with a last modified time stamp
and a content type. HTTP does not transfer permission bits.
So if you say
 > it should just copy/save a file from a remote server
 > to a local computer, without even touching file permissions or such.
then this is what wget does. It downloads the file and stores it with 
default permissions.

i also find it a bit inconvenient to use chmod +x but that's correct
behaviour for wget.

And i just found out that a chmod +x is also necessary when extracting
ZIP files with unzip.


Herbert Stocker

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

More information about the Cygwin mailing list