diff --git a/debian/patches/series b/debian/patches/series index 3cb3a902..7b6ea09b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,3 +10,4 @@ debian/Adapt-login.defs-for-Debian.patch debian/Define-LOGIN_NAME_MAX-on-HURD.patch debian/Stop-building-programs-we-do-not-install.patch upstream/lib-user_busy.c-Include-utmpx.h.patch +upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch diff --git a/debian/patches/upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch b/debian/patches/upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch new file mode 100644 index 00000000..cd718538 --- /dev/null +++ b/debian/patches/upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch @@ -0,0 +1,39 @@ +From a015e919834c90b99947829c6c823f7fe93a8097 Mon Sep 17 00:00:00 2001 +From: Alejandro Colomar +Date: Thu, 5 Dec 2024 17:38:54 +0100 +Subject: [PATCH] src/useradd.c: E_BAD_NAME: Use a different error code for bad + login names + +Wrappers like adduser(8) want to do their own stuff if the login name is +bad. For that, they need to be able to differentiate such an error. + +Closes: +Suggested-by: Chris Hofstaedtler +Cc: Marc 'Zugschlus' Haber +Signed-off-by: Alejandro Colomar +Bug-Debian: 1074306 +--- + src/useradd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/useradd.c b/src/useradd.c +index 891fd1420..d8429eecb 100644 +--- a/src/useradd.c ++++ b/src/useradd.c +@@ -201,6 +201,7 @@ static bool home_added = false; + #define E_SUB_UID_UPDATE 16 /* can't update the subordinate uid file */ + #define E_SUB_GID_UPDATE 18 /* can't update the subordinate gid file */ + #endif /* ENABLE_SUBIDS */ ++#define E_BAD_NAME 19 /* Bad login name */ + + #define DGROUP "GROUP" + #define DGROUPS "GROUPS" +@@ -1549,7 +1550,7 @@ static void process_flags (int argc, char **argv) + user_name, AUDIT_NO_ID, + SHADOW_AUDIT_FAILURE); + #endif +- exit (E_BAD_ARG); ++ exit (E_BAD_NAME); + } + if (!dflg) { + char *uh;