summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvangelos Foutras <evangelos@foutrelis.com>2018-05-12 11:52:18 +0300
committerEvangelos Foutras <evangelos@foutrelis.com>2018-05-12 11:52:18 +0300
commit5713cd629c97c7a12a600a1dd73ad81d87374eb1 (patch)
treeea946308aae59b160ef0cc7c91a4d6085a79ead3
parent40f0179a5e74d6d3babbefdeae21fd374be0e090 (diff)
downloaddevtools-5713cd629c97c7a12a600a1dd73ad81d87374eb1.tar.xz
makechrootpkg: add /etc/shadow entry for builduser
Without it, sudo 1.8.23 will return an error: sudo: PAM account management error: Authentication service cannot retrieve authentication info
-rw-r--r--makechrootpkg.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 8e33499..57231d5 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -176,9 +176,10 @@ prepare_chroot() {
# We can't use useradd without chrooting, otherwise it invokes PAM modules
# which we might not be able to load (i.e. when building i686 packages on
# an x86_64 host).
- sed -e '/^builduser:/d' -i "$copydir"/etc/{passwd,group}
+ sed -e '/^builduser:/d' -i "$copydir"/etc/{passwd,shadow,group}
printf >>"$copydir/etc/group" 'builduser:x:%d:\n' "$builduser_gid"
printf >>"$copydir/etc/passwd" 'builduser:x:%d:%d:builduser:/build:/bin/bash\n' "$builduser_uid" "$builduser_gid"
+ printf >>"$copydir/etc/shadow" 'builduser:!!:%d::::::\n' "$(( $(date -u +%s) / 86400 ))"
$install -d "$copydir"/{build,build/.gnupg,startdir,{pkg,srcpkg,src,log}dest}