Correctly search for the existence of nfsnobody (bz 816149)

Correctly change the default group id for nfsnobody (bz 816149)

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2012-05-25 10:47:10 -04:00
parent 164610b8a7
commit 40c2a71d43

View File

@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
Name: nfs-utils
URL: http://sourceforge.net/projects/nfs
Version: 1.2.6
Release: 0%{?dist}
Release: 1%{?dist}
Epoch: 1
# group all 32bit related archs
@ -179,7 +179,7 @@ done
%define nfsnobody_uid 65534
# Create nfsnobody gid as long as it does not already exist
cat /etc/group | cut -d':' -f 3 | grep --quiet %{nfsnobody_uid} 2>/dev/null
cat /etc/group | cut -d':' -f 3 | grep --quiet nfsnobody 2>/dev/null
if [ "$?" -eq 1 ]; then
/usr/sbin/groupadd -g %{nfsnobody_uid} nfsnobody 2>/dev/null || :
else
@ -187,13 +187,13 @@ else
fi
# Create nfsnobody uid as long as it does not already exist.
cat /etc/passwd | cut -d':' -f 3 | grep --quiet %{nfsnobody_uid} 2>/dev/null
cat /etc/passwd | cut -d':' -f 3 | grep --quiet nfsnobody 2>/dev/null
if [ "$?" -eq 1 ]; then
/usr/sbin/useradd -l -c "Anonymous NFS User" -r -g %{nfsnobody_uid} \
-s /sbin/nologin -u %{nfsnobody_uid} -d /var/lib/nfs nfsnobody 2>/dev/null || :
else
/usr/sbin/usermod -u %{nfsnobody_uid} nfsnobody 2>/dev/null || :
/usr/sbin/usermod -u %{nfsnobody_uid} -g %{nfsnobody_uid} nfsnobody 2>/dev/null || :
fi
%post
@ -293,6 +293,10 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4
%changelog
* Fri May 25 2012 Steve Dickson <steved@redhat.com> 1.2.6-1
- Correctly search for the existence of nfsnobody (bz 816149)
- Correctly change the default group id for nfsnobody (bz 816149)
* Tue May 15 2012 Steve Dickson <steved@redhat.com> 1.2.6-0
- Update to the latest upstream release: nfs-utils-1.2.6 (bz 821673)
- Split out NFS server daemons into individual service files (bz 769879)