Skip to content

Commit

Permalink
Skip preflight update check in sparkle-cli if user is root (#2645)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo authored Oct 12, 2024
1 parent 544c642 commit f3dc125
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sparkle-cli/SPUCommandLineDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,17 @@ - (BOOL)updater:(SPUUpdater *)updater mayPerformUpdateCheck:(SPUUpdateCheck)upda
switch (updateCheck) {
case SPUUpdateCheckUpdates:
case SPUUpdateCheckUpdatesInBackground:
if (_interactive || !SPUSystemNeedsAuthorizationAccessForBundlePath(_updater.hostBundle.bundlePath)) {
{
if (_interactive) {
return YES;
}

BOOL rootUser = (geteuid() == 0);
if (rootUser) {
return YES;
}

if (!SPUSystemNeedsAuthorizationAccessForBundlePath(_updater.hostBundle.bundlePath)) {
return YES;
}

Expand All @@ -148,6 +158,7 @@ - (BOOL)updater:(SPUUpdater *)updater mayPerformUpdateCheck:(SPUUpdateCheck)upda
}

return NO;
}
case SPUUpdateCheckUpdateInformation:
return YES;
}
Expand Down

0 comments on commit f3dc125

Please sign in to comment.