]> git.pld-linux.org Git - packages/openssh.git/commitdiff
- fixed pre server, added postun server; TODO: fix pam_limits usage!
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 25 Jun 2002 08:17:03 +0000 (08:17 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    openssh.spec -> 1.123

openssh.spec

index eaca015487433b34afc6760a6823ef01971177cf..01b01f2191b0f3aac156352b5ab05c6c73c9ce3f 100644 (file)
@@ -192,8 +192,11 @@ Summary(uk):       OpenSSH - 
 Group:         Networking/Daemons
 PreReq:                %{name} = %{version}
 PreReq:                rc-scripts
+Requires(pre): /bin/id
+Requires(pre): /usr/sbin/useradd
 Requires(post):        /sbin/chkconfig
 Requires(post):        chkconfig >= 0.9
+Requires(postun):      /usr/sbin/userdel
 Requires:      /bin/login
 Requires:      util-linux
 Obsoletes:     ssh-server
@@ -358,9 +361,14 @@ touch $RPM_BUILD_ROOT/etc/security/blacklist.sshd
 rm -rf $RPM_BUILD_ROOT
 
 %pre server
-%{_sbindir}/groupadd -r -g %{sshd_gid} sshd 2>/dev/null || :
-%{_sbindir}/useradd -d %{_privsepdir} -s /bin/false -u %{sshd_uid} \
-        -g sshd -M -r sshd 2>/dev/null || :
+if [ -n "`id -u sshd 2>/dev/null`" ]; then
+       if [ "`id -u sshd`" != "40" ]; then
+               echo "Error: user sshd doesn't have uid=40. Correct this before installing ssh server." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 40 -d %{_privsepdir} -s /bin/false -M -r -c "OpenSSH PrivSep User" -g nobody sshd 1>&2
+fi
        
 %post server
 /sbin/chkconfig --add sshd
@@ -381,6 +389,11 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del sshd
 fi
 
+%postun server
+if [ "$1" = "0" ]; then
+       /usr/sbin/userdel sshd
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc *.RNG TODO README OVERVIEW CREDITS Change*
This page took 0.03351 seconds and 4 git commands to generate.