[pkg-go] Bug#1006823: patch to prevent debos example adduser waits for password

Geert Stappers stappers at stappers.nl
Sat Mar 5 21:08:28 GMT 2022


Control: tag -1 patch


The hang is caused by `adduser` waiting for password (and password
confirmation)

Providing two password strings can be done with a bash subshell.
Creating the subshell is done by wrapping in parentheses.

So the 

    adduser --gecos User user

should be

    (echo user ; echo user ) | adduser --gecos User user



The complete patch:

--- a/doc/examples/setup-user.sh
+++ b/doc/examples/setup-user.sh
@@ -1,10 +1,8 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 
 echo "I: create user"
-adduser --gecos User user
+(echo user ; echo user ) | adduser --gecos User user
 
-echo "I: set user password"
-echo "user:user" | chpasswd
 adduser user sudo




Groeten
Geert Stappers
-- 
Silence is hard to parse



More information about the Pkg-go-maintainers mailing list