X-Git-Url: http://git.onelab.eu/?p=pl_sshd.git;a=blobdiff_plain;f=pl_sshd.spec;h=b7408f195724065b8f24c06819ed7f59e9f80f13;hp=8504e9b9918587a96ed326cc269fe130a31588b8;hb=HEAD;hpb=e430bc02b6d18a96f4f892ccb20fbc15f50e1f7f diff --git a/pl_sshd.spec b/pl_sshd.spec index 8504e9b..b7408f1 100644 --- a/pl_sshd.spec +++ b/pl_sshd.spec @@ -1,17 +1,24 @@ +# +# $Id$ +# +%define url $URL$ + %define name pl_sshd %define version 1.0 -%define release 5.planetlab%{?date:.%{date}} +%define taglevel 11 + +%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} Vendor: PlanetLab Packager: PlanetLab Central -Distribution: PlanetLab 3.0 -URL: http://cvs.planet-lab.org/cvs/pl_sshd +Distribution: PlanetLab %{plrelease} +URL: %(echo %{url} | cut -d ' ' -f 2) Summary: SSH server config for PlanetLab Name: %{name} Version: %{version} Release: %{release} -Requires: autofs, openssh-server +Requires: openssh-server License: GPL Group: System Environment/Base BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot @@ -31,9 +38,8 @@ directory. %install mkdir -p $RPM_BUILD_ROOT/var/pl_sshd/keys -install -D -m 0755 pl_sshd.sh $RPM_BUILD_ROOT/usr/local/sbin/pl_sshd.sh +install -D -m 0755 pl_sshd.sh $RPM_BUILD_ROOT/usr/local/sbin/pl_sshd install -D -m 0755 pl_sshd $RPM_BUILD_ROOT/etc/init.d/pl_sshd -install -D -m 0755 auto.pl_sshd $RPM_BUILD_ROOT/etc/auto.pl_sshd %clean rm -rf $RPM_BUILD_ROOT @@ -41,44 +47,44 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %dir /var/pl_sshd/keys -%attr(0755,root,root) /usr/local/sbin/pl_sshd.sh +%attr(0755,root,root) /usr/local/sbin/pl_sshd %attr(0755,root,root) /etc/init.d/pl_sshd -%attr(0755,root,root) /etc/auto.pl_sshd %pre %post -RUNLEVEL=`/sbin/runlevel` - # 1 = install, 2 = upgrade/reinstall if [ $1 -ge 1 ]; then - # create the magic directory for automount - keydir=/var/pl_sshd/keys - - # add appropriate entry to auto.master - auto_master=/etc/auto.master - auto_master_entry="$keydir /etc/auto.pl_sshd" - grep -qF "$auto_master_entry" $auto_master || \ - echo $auto_master_entry >>$auto_master - - # - # use the sysconfig file to tell our system sshd to look in the - # magic location for authorized_keys files - # - sysconfig_sshd=/etc/sysconfig/sshd - [ -r $sysconfig_sshd ] && \ - mv $sysconfig_sshd $sysconfig_sshd.pl_sshd - echo "OPTIONS='-o \"AuthorizedKeysFile $keydir/%u/authorized_keys\"'" \ - >$sysconfig_sshd - # link sshd pam config to pl_sshd so that we can actually login pam_pl_sshd=/etc/pam.d/pl_sshd [ -r $pam_pl_sshd ] || ln -s sshd $pam_pl_sshd chkconfig --add pl_sshd - if [[ "$RUNLEVEL" != "unknown" ]]; then + if [ "$1" -gt "1" ]; then # upgrading + # + # remove funky config options for sshd (so that when we restart + # things will operate normally i.e., without automount magic) + # + rm -f /etc/sysconfig/sshd + + # + # stop automounter, remove entry from auto.master, restart if + # necessary + # + [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs stop + auto_master=/etc/auto.master + orig=$auto_master + backup=$auto_master.pl_sshd.post + mv $orig $backup + sed -e '\,^/var/pl_sshd/keys,d' $backup > $orig && rm $backup || \ + mv $backup $orig + + [ "$PL_BOOTCD" != "1" ] && /etc/init.d/autofs start + fi + + if [[ "$PL_BOOTCD" != "1" ]]; then # # don't try to start/restart various things automatically, # it's too ugly (particularly if we're upgrading while @@ -94,42 +100,15 @@ if [ $1 -ge 1 ]; then fi %preun -RUNLEVEL=`/sbin/runlevel` - # 0 = erase, 1 = upgrade if [ $1 -eq 0 ]; then # # stop pl_sshd, remove it from rcX.d init dirs, remove link # to sshd's pam config # - [ "$RUNLEVEL" = "unknown" ] || /etc/init.d/pl_sshd stop || : + [ "$PL_BOOTCD" = "1" ] || /etc/init.d/pl_sshd stop || : chkconfig --del pl_sshd rm -f /etc/pam.d/pl_sshd - - # - # remove funky config options for sshd (so that when we restart - # things will operate normally i.e., without automount magic) - # - rm /etc/sysconfig/sshd - if [ "$RUNLEVEL" != "unknown" ]; then - echo - echo "You need to manually restart sshd." - echo "Make sure you know what you're doing, particularly" - echo "if you're making this change over an ssh connection." - echo - fi - - # - # stop automounter, remove entry from auto.master, restart if - # necessary - # - [ "$RUNLEVEL" != "unknown" ] && /etc/init.d/autofs stop - auto_master=/etc/auto.master - mv $auto_master $auto_master.pl_sshd.preun - sed -e '\,^/var/pl_sshd/keys,d' $auto_master.pl_sshd.preun \ - >$auto_master - - [ "$RUNLEVEL" != "unknown" ] && /etc/init.d/autofs start fi @@ -137,6 +116,19 @@ fi %changelog +* Fri May 09 2008 Stephen Soltesz - pl_sshd-1.0-11 +- + +* Wed Nov 2 2005 Steve Muir +- don't fanny around using the automounter to access ssh keys in vservers, + pl_conf now writes them into the normal locations + +* Wed Oct 12 2005 Steve Muir +- fix pl_sshd script name and argv[0] to satisfy re-exec requirements + +* Thu Apr 7 2005 Steve Muir +- convert auto.pl_sshd to a python script (simpler and less error-prone) + * Mon Dec 1 2003 Steve Muir - initial creation from files in sidewinder repository