Repository navigation
Conversation
MakeParentDirectoryPerms() rejects relative paths, so creating subdirectories failed. Bug already present on master. Signed-off-by: Victor Moene <victor.moene@northern.tech>
It was only created as a side effect of downloading a subdirectory, so files in the remote directory failed. Bug already present on master. Signed-off-by: Victor Moene <victor.moene@northern.tech>
Files are created 0600 and directories 0700 unless -p/--preserve-perms is given, so a server can no longer set setuid/setgid bits locally. Changelog: Title Ticket: ENT-14982 Signed-off-by: Victor Moene <victor.moene@northern.tech>
victormlg
force-pushed
the
cf-net-harder-sec
branch
from
November 19, 2026 11:49
e207fd6 to
4a6df55
Compare
larsewi
requested changes
Nov 20, 2026
larsewi
left a comment
Contributor
There was a problem hiding this comment.
LGTM 🚀 please improve / add change log entries
Comment on lines
+1246
to
+1247
| /* MakeParentDirectoryPerms() only accepts absolute paths, so a relative | ||
| * output path is resolved against the current working directory */ |
Contributor
There was a problem hiding this comment.
/* MakeParentDirectoryPerms() rejects relative paths.
* Make a relative -o path absolute by prefixing the cwd. */I was a bit confused by that comment, maybe this reads better?
This commit deserves a change log entry.
Bug already present on master.
It goes without saying.
|
|
||
| tmp = local_dir; | ||
| local_dir = StringFormat("%s/%s/", (specified_path ? local_dir : cwd), base); | ||
| if (!specified_path) |
Contributor
There was a problem hiding this comment.
If you treat "no -o as -o ., then maybe this logic could be simpler. IDK
| /* Subdirectories are created as they are found, but files directly in | ||
| * remote_dir need the top-level local directory to exist already */ | ||
| bool force = false; | ||
| if (!MakeParentDirectoryPerms(local_dir, force, NULL, sb.st_mode)) |
Contributor
There was a problem hiding this comment.
This one also deserves a change log entry
| @@ -102,7 +102,7 @@ static const Description COMMANDS[] = | |||
| {"opendir", "List files and folders in a directory", | |||
| "cf-net opendir masterfiles"}, | |||
| {"getdir", "Recursively downloads files and folders in a directory", | |||
Contributor
There was a problem hiding this comment.
How about
Changelog: Files and directories copied by `cf-net getdir` are now created with permissions `0600` / `0700` receptively. Use the `-p` / `--preserve-perms` option to preserve the remote permissions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.