From: Stefan Schantl Date: Tue, 11 Apr 2023 14:28:40 +0000 (+0200) Subject: nfs-utils: Switch to systemd sysusers mechanism for user/group creation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fswitch-to-sysusers;p=people%2Fstevee%2Fipfire-3.x.git nfs-utils: Switch to systemd sysusers mechanism for user/group creation Signed-off-by: Stefan Schantl --- diff --git a/nfs-utils/nfs-utils.nm b/nfs-utils/nfs-utils.nm index 9cc6740bb..508aa95a9 100644 --- a/nfs-utils/nfs-utils.nm +++ b/nfs-utils/nfs-utils.nm @@ -5,7 +5,7 @@ name = nfs-utils version = 2.6.2 -release = 5 +release = 6 groups = Networking/Tools url = http://nfs.sourceforge.net/ @@ -40,9 +40,9 @@ build libtirpc-devel >= 1.3.3-3 libtool rpcsvc-proto - shadow-utils sqlite-devel systemd-devel + systemd-sysusers end configure_options += \ @@ -62,8 +62,6 @@ build sed -i "s|sbindir = /sbin|sbindir = /usr/bin|g" utils/*/Makefile.am sh autogen.sh - - %{create_user} end install_cmds @@ -90,12 +88,6 @@ build end end -create_user - getent passwd rpcuser >/dev/null || useradd -l -c "RPC Service User" -r \ - -s /sbin/nologin -u 29 -d /var/lib/nfs rpcuser - getent group rpcuser >/dev/null || groupadd -g 29 rpcuser 2>/dev/null -end - packages package %{name} provides @@ -113,17 +105,6 @@ packages util-linux end - nfsnobody_uid = 65534 - - script prein - %{create_user} - - getent group nfsnobody >/dev/null || groupadd -g %{nfsnobody_uid} nfsnobody - getent passwd nfsnobody >/dev/null || useradd -l -c "Anonymous NFS User" -r \ - -s /sbin/nologin -u %{nfsnobody_uid} -g %{nfsnobody_uid} \ - -d /var/lib/nfs nfsnobody - end - script postin systemctl daemon-reload >/dev/null 2>&1 || : end diff --git a/nfs-utils/nfs-utils.sysusers b/nfs-utils/nfs-utils.sysusers new file mode 100644 index 000000000..c4a18fde7 --- /dev/null +++ b/nfs-utils/nfs-utils.sysusers @@ -0,0 +1,8 @@ +# rpcuser user +u rpcuser - "RPC service user" /var/lib/nfs /usr/sbin/nologin + +# Group for anonymous NFS user. +g nfsnobody 65534 + +# Anonymous NFS user. +u nfsnobody 65534:65534 "Anonymous NFS User" /var/lib/nfs /usr/sbin/nologin