From 4980bd05b115261cb5dfbab69af9fdd3f5832493 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sun, 1 Mar 2026 12:47:32 +0800 Subject: [PATCH 1/2] fix: check error with -ENOMEDIUM not ENOMEDIUM Signed-off-by: Weixie Cui --- src/import/pull-raw.c | 2 +- src/import/pull-tar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index fc681fbb59dcc..31a08eb24ae6d 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -512,7 +512,7 @@ static void raw_pull_job_on_finished(PullJob *j) { * checksum file. */ if (j == p->raw_job) { - if (j->error == ENOMEDIUM) /* HTTP 404 */ + if (j->error == -ENOMEDIUM) /* HTTP 404 */ r = log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)"); else r = log_error_errno(j->error, "Failed to retrieve image file."); diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index ae763879b78b2..bfc218b6bcbd0 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -430,7 +430,7 @@ static void tar_pull_job_on_finished(PullJob *j) { clear_progress_bar(/* prefix= */ NULL); if (j == p->tar_job) { - if (j->error == ENOMEDIUM) /* HTTP 404 */ + if (j->error == -ENOMEDIUM) /* HTTP 404 */ r = log_error_errno(j->error, "Failed to retrieve image file. (Wrong URL?)"); else r = log_error_errno(j->error, "Failed to retrieve image file."); From ac4a7a66bd0bfd938b693c35fc482fdc411ca91a Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Sun, 1 Mar 2026 01:33:49 -0700 Subject: [PATCH 2/2] zsh: add userdbctl completion --- shell-completion/zsh/_userdbctl | 86 ++++++++++++++++++++++++++++++++ shell-completion/zsh/meson.build | 1 + 2 files changed, 87 insertions(+) create mode 100644 shell-completion/zsh/_userdbctl diff --git a/shell-completion/zsh/_userdbctl b/shell-completion/zsh/_userdbctl new file mode 100644 index 0000000000000..b3122fa908bfa --- /dev/null +++ b/shell-completion/zsh/_userdbctl @@ -0,0 +1,86 @@ +#compdef userdbctl + +local context state state_descr line +typeset -A opt_args +local expl +local -a opt_common=( + {-h,--help}'[Show a help message and exit]' + '--version[Show the package version and exit]' + '--no-pager[Do not pipe output into a pager]' + '--no-legend[Do not show the headers and footers]' + '(-j)--output=[Select output mode]:mode:(classic table friendly json)' + '(--output)-j[Equivalent to --output=json]' + {-s+,--service=}'[Query the specified service]' + '(-N)--with-nss=[Control whether to include glibc NSS data]:bool:(yes no)' + '--with-dropin=[Control whether to include drop-in records]:bool:(yes no)' + '--with-varlink=[Control whether to talk to services at all]:bool:(yes no)' + '(-N)--synthesize=[Synthesize root/nobody user]:bool:(yes no)' + '(--with-nss --synthesize)-N[Do not synthesize or include glibc NSS data]' + '--multiplexer=[Control whether to use the multiplexer]:bool:(yes no)' + '--json=[JSON output mode]:json-mode:(short pretty)' +) +local -a opt_user_group=( + {-z,--fuzzy}'[Do a fuzzy name search]' + '*--disposition=[Filter by disposition]:disposition:(intrinsic system regular dynamic container)' + '-I[Equivalent to --disposition=intrinsic]' + '-S[Equivalent to --disposition=system]' + '-R[Equivalent to --disposition=regular]' + '--uid-min=[Filter by minimum UID/GID]:uid:_numbers -t uids uid -d 0' + '--uid-max=[Filter by maximum UID/GID]:gid:_numbers -t gids gid -d 4294967294' + '--uuid=[Filter by UUID]:uuid' + '(-B)--boundaries=[Show/hide UID/GID range boundaries in output]:bool:(yes no)' + '(--boundaries)-B[Equivalent to --boundaries=no]' + {-F+,--from-file=}'[Read JSON record from file]:file:_files' +) + +local -a userdbctl_commands=( + 'user:Inspect user' + 'group:Inspect group' + 'users-in-group:Show users that are members of specified groups' + 'groups-of-user:Show groups the specified users are members of' + 'services:Show enabled database services' + 'ssh-authorized-keys:Show SSH authorized keys for user' + 'load-credentials:Write static user/group records from credentials' +) + +local ret=1 +_arguments -s \ + "$opt_common[@]" \ + ':userdbctl command:->command' \ + '*:: :->option-or-argument' && ret=0 + +case $state in + command) + _describe -t command 'userdbctl command' userdbctl_commands && ret=0 + ;; + option-or-argument) + local curcontext=${curcontext%:*:*}:userdbctl-$words[1]: + case $words[1] in + user) + _arguments -s "$opt_common[@]" "$opt_user_group[@]" '*:users:_users' && ret=0 + ;; + groups-of-user) + _arguments -s "$opt_common[@]" '*:users:_users' && ret=0 + ;; + group) + _arguments -s "$opt_common[@]" "$opt_user_group[@]" '*:groups:_groups' && ret=0 + ;; + users-in-group) + _arguments -s "$opt_common[@]" '*:groups:_groups' && ret=0 + ;; + ssh-authorized-keys) + _arguments -s "$opt_common[@]" ':users:_users' \ + '(-):chain:((--chain:"Chain another command"))' \ + ':command:_absolute_command_paths' \ + '*: :->chain' && ret=0 + if [[ $state == chain ]] && compset -N --chain; then + _normal && ret=0 + fi + ;; + services|load-credentials) + _message "no more arguments" + ;; + esac + ;; +esac +return ret diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build index 221c30627f722..bcd7899a15386 100644 --- a/shell-completion/zsh/meson.build +++ b/shell-completion/zsh/meson.build @@ -43,6 +43,7 @@ foreach item : [ ['_systemd-tmpfiles', 'ENABLE_TMPFILES'], ['_timedatectl', 'ENABLE_TIMEDATED'], ['_udevadm', ''], + ['_userdbctl', ''], ['_varlinkctl', ''], ]