Skip to content

Commit

Permalink
Update: use lstat and check that the file is regular before setuid appl.
Browse files Browse the repository at this point in the history
Bug: 1339108
Change-Id: I2ad5a165ca237085eabd5a147e8860a8773bd103
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4193365
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Auto-Submit: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096919}
  • Loading branch information
Joshua Pawlicki authored and Chromium LUCI CQ committed Jan 25, 2023
1 parent 81707cc commit 859584c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chrome/updater/mac/setup/setup.mm
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ int PromoteCandidate(UpdaterScope scope) {
base::FilePath path =
bundle_path->Append("Contents").Append("Helpers").Append("launcher");
struct stat info;
if (stat(path.value().c_str(), &info) || info.st_uid ||
if (lstat(path.value().c_str(), &info) || info.st_uid ||
!(S_IFREG & info.st_mode) ||
lchmod(path.value().c_str(),
S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH | S_ISUID)) {
VPLOG(1) << "Launcher lchmod failed. Cross-user on-demand will not work";
Expand Down

0 comments on commit 859584c

Please sign in to comment.