Fix CIFS mount error(79) caused by missing keyutils package

Errno 79 is ELIBACC ("Can not access a needed shared library"), not
ENOKEY as previously assumed — mount.cifs prints glibc's literal
strerror() text for it. It recurred with valid, correctly-captured
credentials because the real cause was never authentication: cifs-utils
hard-depends on the libkeyutils1 library but only Recommends the
keyutils package itself, which ships /sbin/request-key and the
/etc/request-key.d/*.conf handlers the kernel's upcall path invokes.
Minimal cloud VPS images commonly disable install-recommends, so
`apt-get install cifs-utils` alone silently skips it and every mount —
guest or fully credentialed — fails identically.

Install keyutils explicitly wherever cifs-utils is installed:
services/base.sh's unconditional package list, vpn-data-mount.sh's
lazy install-on-mount path, and tools/mount-network-drive.sh's SMB
branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H4k6J1qXXyYxhGEgnJaMvn
This commit is contained in:
Claude
2026-08-10 20:00:24 +00:00
parent 1c1fa32b6f
commit 2d9501a56c
3 changed files with 39 additions and 10 deletions
+8 -1
View File
@@ -29,7 +29,14 @@ ACTUAL_GID="$(id -g "$ACTUAL_USER")"
ensure_packages() {
local pkgs=()
case "$1" in
smb) command -v mount.cifs &>/dev/null || pkgs+=(cifs-utils) ;;
smb)
command -v mount.cifs &>/dev/null || pkgs+=(cifs-utils)
# keyutils explicitly, not left to cifs-utils' Recommends — on
# images with install-recommends disabled, missing keyutils
# makes every mount.cifs call fail with "mount error(79): Can
# not access a needed shared library" regardless of credentials.
dpkg -s keyutils &>/dev/null || pkgs+=(keyutils)
;;
nfs) command -v mount.nfs &>/dev/null || pkgs+=(nfs-common) ;;
esac
if [[ ${#pkgs[@]} -gt 0 ]]; then