Skip to content

Commit 8c50d09

Browse files
committed
Merge remote-tracking branch 'ArrayBolt3/arraybolt3/privleap'
2 parents 00a1014 + 29c3804 commit 8c50d09

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[apt-get-update-plus-dist-upgrade]
2+
Command=apt-get-update-plus dist-upgrade
3+
AuthorizedUser=sysmaint

etc/sudoers.d/upgrade-passwordless

Lines changed: 0 additions & 4 deletions
This file was deleted.

usr/bin/apt-get-update-plus

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set -e
88
[ -n "$apt_get_update_wrapper" ] || apt_get_update_wrapper="apt-get update"
99
[ -n "$apt_bin" ] || apt_bin=apt-get
1010

11+
export DEBIAN_FRONTEND='noninteractive'
1112
$apt_get_wrapper_pre $apt_get_update_wrapper $apt_get_wrapper_post
1213

1314
$apt_get_pre $apt_bin $apt_get_post "$@"

usr/bin/upgrade-nonroot

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,19 @@
55

66
set -e
77

8-
sudo /usr/bin/apt-get-update-plus dist-upgrade
8+
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/as_root.sh
9+
source /usr/libexec/helper-scripts/as-root.sh
10+
11+
leaprun_exe="$(which leaprun)"
12+
# If privleap is installed and usable by the current user, use that, otherwise
13+
# try to run the script directly. This allows upgrade-nonroot to work even if
14+
# privleapd isn't running or the root user has no privleap socket.
15+
if [ -n "${leaprun_exe}" ] \
16+
&& [ -f "/etc/privleapd/pid" ] \
17+
&& [ -d "/proc/$(cat /etc/privleapd/pid)" ] \
18+
&& [ -e "/etc/privleapd/comm/$(id -nu)" ]; then
19+
"${leaprun_exe}" apt-get-update-plus-dist-upgrade
20+
else
21+
as_root
22+
/usr/bin/apt-get-update-plus dist-upgrade
23+
fi

0 commit comments

Comments
 (0)