From 3658a387cd42652edabf87f3700eb8a05f1af4ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 2 May 2026 19:21:16 +0000 Subject: [PATCH 1/2] Initial plan From 7b17364ea51ff36855fdd892c075e9b2fdffd2b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 2 May 2026 19:33:11 +0000 Subject: [PATCH 2/2] Fix sudo lockout on Kubuntu 25.10: add NOPASSWD and improve admin group detection Agent-Logs-Url: https://github.com/miheerdew/delayed-admin/sessions/4d9bcbef-acee-4096-bb43-7d87900b3e87 Co-authored-by: miheerdew <3489337+miheerdew@users.noreply.github.com> --- delayed-admin.sudoers | 2 +- lib/linux.sh | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/delayed-admin.sudoers b/delayed-admin.sudoers index 3dea715..fe4ecac 100644 --- a/delayed-admin.sudoers +++ b/delayed-admin.sudoers @@ -1 +1 @@ -%delayed-admin ALL = /usr/local/bin/delayed +%delayed-admin ALL = NOPASSWD: /usr/local/bin/delayed diff --git a/lib/linux.sh b/lib/linux.sh index 507a09e..5b512d8 100644 --- a/lib/linux.sh +++ b/lib/linux.sh @@ -8,16 +8,43 @@ function distro_id() { echo $ID } function admin_group() { - case $(distro_id) in - ubuntu|debian) + local id + id=$(distro_id) + case $id in + ubuntu|kubuntu|debian|linuxmint|pop|neon|elementary|zorin) echo "sudo" ;; - centos|fedora|rhel|arch|manjaro|endeavouros) + centos|fedora|rhel|arch|manjaro|endeavouros|opensuse*|sles) echo "wheel" ;; + *) + # Fallback: use ID_LIKE from /etc/os-release + local id_like + id_like=$(grep '^ID_LIKE=' /etc/os-release 2>/dev/null | cut -d= -f2- | tr -d '"') + case "$id_like" in + *ubuntu*|*debian*) + echo "sudo" + ;; + *rhel*|*fedora*|*centos*|*suse*) + echo "wheel" + ;; + *) + # Last resort: check which admin group actually exists on this system. + # If neither exists, admin_group() returns empty and the check below will abort. + if getent group sudo > /dev/null 2>&1; then + echo "sudo" + elif getent group wheel > /dev/null 2>&1; then + echo "wheel" + fi + ;; + esac + ;; esac } readonly ADMIN_GROUP=$(admin_group) +if [ -z "$ADMIN_GROUP" ]; then + die "Could not determine the admin group for this OS (ID=$(distro_id)). Please file a bug report." +fi #TODO Implement these function check_atd_is_running { true; } function start_atd { true; }