Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
--create-dirs permissions different than files: 750 mode vs. 644 mode #4766
This option has existed in curl since December 2002 without that ability. I'm not sure saying it needs to be offered is correct; clearly people have managed without it.
You can easily change the mode after curl is completed if you want something different and changing the umask isn't enough. Is it really that important that curl does it by itself?
Well let's put things in perspective. It is curl that is changing
The user has set a umask, and curl has overridden it, and only in
So the user needs to make odd scripts like
to "repair the damage."
Anyway, curl can go on making directories 0750, but the man page should
Also document the severity of the override: Does it combine 0750 with
No it hasn't. The user's umask still masks off bits accordingly, as that's done by the
... where mode is 0750 in this case.
I can't propose any text other than "for some unknown reason the previous authors decided to inject add a wacky umask, and only for directories too..." So it would be best just to clear the quirk out of the code, then no explaining would be needed. Except maybe some mention for the few users who somehow have grown to depend on this behaviour to keep their directories "safe". But then it is their own fault for depending on undocumented behaviours. Thus we see you have a green light for simply removing the mode meddling code. (The modes, (if anything,) should be the same as they were on the server, if that is even known! But that would lead to surprises sometimes too. So maybe just do the open()'s etc. without thinking any more about it.)