Debian Bug report logs - #1005942
adduser: spews error when ^Ding out of binary question, proceeds anyway

version graph

Package: adduser; Maintainer for adduser is Debian Adduser Developers <[email protected]>; Source for adduser is src:adduser (PTS, buildd, popcon).

Reported by: наб <[email protected]>

Date: Thu, 17 Feb 2022 15:54:01 UTC

Severity: normal

Found in version adduser/3.118

Fix blocked by 1014444: need rollback mechanism in case of aborts

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian Adduser Developers <[email protected]>:
Bug#1005942; Package adduser. (Thu, 17 Feb 2022 15:54:03 GMT) (full text, mbox, link).


Acknowledgement sent to наб <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian Adduser Developers <[email protected]>. (Thu, 17 Feb 2022 15:54:03 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: наб <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: adduser: spews error when ^Ding out of binary question, proceeds anyway
Date: Thu, 17 Feb 2022 16:50:23 +0100
[Message part 1 (text/plain, inline)]
Package: adduser
Version: 3.118
Severity: normal
Tags: patch

Dear Maintainer,

adduser asks two binary questions: about retrying passwd and about
retrying chfn.

If you ^D out of them, currently, you get this:
-- >8 --
nabijaczleweli@tarta:~$ sudo adduser dupsko12
Adding user `dupsko12' ...
Adding new group `dupsko12' (1019) ...
Adding new user `dupsko12' (1022) with group `dupsko12' ...
Creating home directory `/home/dupsko12' ...
Copying files from `/etc/skel' ...
New password: ^D
Password change has been aborted.
passwd: Authentication token manipulation error
passwd: password unchanged
Try again? [y/N] ^D Use of uninitialized value $answer in chop at /usr/sbin/adduser line 556.
Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 557.
Changing the user information for dupsko12
Enter the new value, or press ENTER for the default
        Full Name []: ^D   Room Number []:         Work Phone []:  Home Phone []:  Other []: Is the information correct? [Y/n] ^D Use of uninitialized value $answer in chop at /usr/sbin/adduser line 582.
Use of uninitialized value $answer in pattern match (m//) at /usr/sbin/adduser line 583.

nabijaczleweli@tarta:~$ grep dupsko12 /etc/passwd
dupsko12:x:1022:1019:,,,:/home/dupsko12:/bin/bash
-- >8 --

Proceeding through an error spew is suboptimal,
but keeping the current behaviour would be nice.

Please consider the patch below
(based on current Salsa, i.e. a7c40dcd86aefe6b4d6fa926a8101222dc1bad01),
which falls through to the default answer (as already happens)
without the error spew:
-- >8 --
nabijaczleweli@tarta:~/uwu/adduser$ sudo ./adduser dupsko10
Adding user `dupsko10' ...
Adding new group `dupsko10' (1017) ...
Adding new user `dupsko10' (1020) with group `dupsko10' ...
Creating home directory `/home/dupsko10' ...
Copying files from `/etc/skel' ...
New password: ^D
Password change has been aborted.
passwd: Authentication token manipulation error
passwd: password unchanged
Try again? [y/N] ^D Changing the user information for dupsko10
Enter the new value, or press ENTER for the default
        Full Name []: ^D   Room Number []:         Work Phone []:  Home Phone []:  Other []: Is the information correct? [Y/n] ^D nabijaczleweli@tarta:~/uwu/adduser$

nabijaczleweli@tarta:~/uwu/adduser$ grep dupsko10 /etc/passwd
dupsko10:x:1020:1017:,,,:/home/dupsko10:/bin/bash
-- >8 --

Best,
наб

-- System Information:
Debian Release: 11.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-11-amd64 (SMP w/24 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages adduser depends on:
ii  debconf [debconf-2.0]  1.5.77
ii  passwd                 1:4.8.1-1

adduser recommends no packages.

Versions of packages adduser suggests:
ii  liblocale-gettext-perl  1.07-4+b1
ii  perl                    5.32.1-4+deb11u2

-- debconf information:
  adduser/title:
  adduser/homedir-permission: true
[Message part 2 (text/x-diff, inline)]
From f30cdc4697001a2069a4f700fe7fed6583950a35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <[email protected]>
Date: Thu, 17 Feb 2022 16:41:55 +0100
Subject: [PATCH] adduser: default to default binary action when ^D out of
 prompts instead of spewing an error but proceeding
X-Mutt-PGP: OS

---
 adduser | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/adduser b/adduser
index 2fb54ec..411c203 100755
--- a/adduser
+++ b/adduser
@@ -537,7 +537,8 @@ if ($action eq "adduser") {
 	    # locale.  You can see by running "locale noexpr" which regular
 	    # expression will be checked to find positive answer.
 	    print (gtx("Try again? [y/N] "));
-	    chop ($answer=<STDIN>);
+	    defined ($answer=<STDIN>) or $answer = "";
+	    chop ($answer);
 	    last if ($answer !~ m/$yesexpr/o);
 	  }
 	  else {
@@ -563,7 +564,9 @@ if ($action eq "adduser") {
 	    # locale.  You can see by running "locale yesexpr" which regular
 	    # expression will be checked to find positive answer.
 	    print (gtx("Is the information correct? [Y/n] "));
-	    chop (my $answer=<STDIN>);
+	    my $answer=<STDIN>;
+	    defined ($answer) or $answer = "";
+	    chop ($answer);
 	    last if ($answer !~ m/$noexpr/o);
 	}
     }
-- 
2.30.2

[signature.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Debian Adduser Developers <[email protected]>:
Bug#1005942; Package adduser. (Thu, 17 Feb 2022 18:33:01 GMT) (full text, mbox, link).


Acknowledgement sent to Marc Haber <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Adduser Developers <[email protected]>. (Thu, 17 Feb 2022 18:33:01 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Marc Haber <[email protected]>
To: наб <[email protected]>, [email protected]
Subject: Re: Bug#1005942: adduser: spews error when ^Ding out of binary question, proceeds anyway
Date: Thu, 17 Feb 2022 19:29:50 +0100
On Thu, Feb 17, 2022 at 04:50:23PM +0100, наб wrote:
> Please consider the patch below
> (based on current Salsa, i.e. a7c40dcd86aefe6b4d6fa926a8101222dc1bad01),
> which falls through to the default answer (as already happens)

I'd rather have adduser abort and roll back  when the user has indicated
that they are not willing to interact with adduser any more.

I am not sure whether we should be asking those questions at all but
instead directly abort.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Removed tag(s) patch. Request was from Marc Haber <[email protected]> to [email protected]. (Mon, 07 Mar 2022 21:21:06 GMT) (full text, mbox, link).


Added blocking bug(s) of 1005942: 1014444 Request was from Marc Haber <[email protected]> to [email protected]. (Tue, 29 Oct 2024 11:18:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 08:59:36 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.