Skip to content

Commit

Permalink
Skip preflight update check in sparkle-cli if user is root
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo committed Oct 12, 2024
1 parent ef9bc6e commit 1ab79ef
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 1ab79ef

Please sign in to comment.