-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--create-dirs permissions different than files: 750 mode vs. 644 mode #4766
Comments
I don't see how it's odd and I think it's unnecessary to add that. However I will leave this open for a bit to see what others think. |
What Unix umask could come up with that combination? |
I don't see any harm in documenting the mode (0750) it uses to create dirs with this option. |
Also, there definitely needs to be a way offered for the user to change it. One might expect the user to simply use a different umask. However that would also change the modes of the files being downloaded, in addition to the directories being created. |
Private directories and non private files, are just the same valid choice as non-private directories and private files. So the program should offer the user more flexibility. |
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. |
Fine.
At least warn on the man page about --create-dirs' permissions.
Else people moving websites won't realize the new site might be inaccessible.
|
I'd call it inform rather than warn, but sure - feel free to propose a text for the man page! We can of course also consider changing the mode we use. |
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.)
|
We didn't "inject" any "funny" umask. We use a mode. You can't use mkdir() without one. I'm trying to work and be constructive here. It would be nice if your snark and attitude could be taken somewhere else. |
OK, it seems it would be best to do as in tests/testcurl.pl:
|
On the man page --create-dirs should mention that it uses odd
drwxr-x--- vs. -rw-r--r-- permissions for files downloaded.
One would think they would be
drwxr-xr-x and -rw-r--r--, or
drwxr-x--- and -rw-r-----
Also mention how to change it. curl 7.67.0, Debian.
The text was updated successfully, but these errors were encountered: