diff --git a/Manual.md b/Manual.md index e85cfb57d284be..f89f848fdaf9b7 100644 --- a/Manual.md +++ b/Manual.md @@ -1404,6 +1404,7 @@ Additional variables for the **system accounts** can be specified to change its - `_descr` the description for the new user. If unset defaults to ` unprivileged user`. - `_groups` additional groups to be added to for the new user. - `_pgroup` to set the primary group, by default primary group is set to ``. + - `_uname` to specify the account user name, by default the user name is set to ``. The **system user** is created by using a dynamically allocated **uid/gid** in your system and it's created as a `system account`, unless the **uid** is set. A new group will be created for the diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh index cf7868b1067360..5b67e7ba208685 100644 --- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh +++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh @@ -86,11 +86,15 @@ _EOF local _uname="${f%:*}" local _uid="${f#*:}" + eval user_name="\$${_uname}_uname" eval homedir="\$${_uname}_homedir" eval shell="\$${_uname}_shell" eval descr="\$${_uname}_descr" eval groups="\$${_uname}_groups" eval pgroup="\$${_uname}_pgroup" + if [ -n "$user_name" ]; then + echo "export ${_uname}_uname=\"$user_name\"" >> $tmpf + fi if [ -n "$homedir" ]; then echo "export ${_uname}_homedir=\"$homedir\"" >> $tmpf fi diff --git a/srcpkgs/xbps-triggers/files/system-accounts b/srcpkgs/xbps-triggers/files/system-accounts index 1564d37b05cc02..8472d80d7fb361 100755 --- a/srcpkgs/xbps-triggers/files/system-accounts +++ b/srcpkgs/xbps-triggers/files/system-accounts @@ -86,12 +86,14 @@ run) [ "${_uname}" = "${_uid}" ] && _uid= + eval user_name="\$${_uname}_uname" eval homedir="\$${_uname}_homedir" eval shell="\$${_uname}_shell" eval descr="\$${_uname}_descr" eval groups="\$${_uname}_groups" eval pgroup="\$${_uname}_pgroup" + [ -n "$user_name" ] && _uname="${user_name}" [ -z "$homedir" ] && homedir="/var/empty" [ -z "$shell" ] && shell="/sbin/nologin" [ -z "$descr" ] && descr="${_uname} unprivileged user" @@ -152,6 +154,10 @@ run) for acct in ${system_accounts}; do _uname="${acct%:*}" + eval user_name="\$${_uname}_uname" + + [ -n "$user_name" ] && _uname="${user_name}" + comment="$( (getent passwd "${_uname}" | cut -d: -f5 | head -n1) 2>/dev/null )" comment="${comment:-unprivileged user} - for uninstalled package ${PKGNAME}" diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index f46503b994d7a1..187fab65d69eaf 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -1,6 +1,6 @@ # Template file for 'xbps-triggers' pkgname=xbps-triggers -version=0.131 +version=0.132 revision=1 bootstrap=yes short_desc="XBPS triggers for Void Linux"