Commit 0e2b8eb7 authored by Jamie Walch's avatar Jamie Walch Committed by Commit Bot

Prepend "user:" to chmod command

macOS's extended chmod syntax can be used for either users or groups,
and supports "user:<user>" and "group:<group>" to resolve ambiguities.
This causes problems if the username is "user", as chmod can't parse
the ACL in this case. This CL prepends "user:" to all ACLs to avoid
this problem.

Change-Id: I15c143b94a2c3113f518ed2b558f007ad769d0c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088397
Auto-Submit: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: default avatarGary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748771}
parent c7b9fb0b
......@@ -280,7 +280,7 @@ bool HostService::Enable() {
// uses the chmod binary to do so.
base::CommandLine chmod_cmd(base::FilePath("/bin/chmod"));
chmod_cmd.AppendArg("+a");
chmod_cmd.AppendArg(GetUsername() + ":allow:read");
chmod_cmd.AppendArg("user:" + GetUsername() + ":allow:read");
chmod_cmd.AppendArgPath(config_file_);
std::string output;
if (!base::GetAppOutputAndError(chmod_cmd, &output)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment