]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/commitdiff
nfs-utils: Switch to systemd sysusers mechanism for user/group creation switch-to-sysusers
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Apr 2023 14:28:40 +0000 (16:28 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Apr 2023 14:28:40 +0000 (16:28 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
nfs-utils/nfs-utils.nm
nfs-utils/nfs-utils.sysusers [new file with mode: 0644]

index 9cc6740bb200ed65f9d469fc461f2685910c47f8..508aa95a924b95cf92ae4fc45a3a07015d918569 100644 (file)
@@ -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 (file)
index 0000000..c4a18fd
--- /dev/null
@@ -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