
#######################       NON FINI      NON TESTE			################################"

# Script de MAJ de OpenBSD 3.1 vers OpenBSD 3.2

# phil@openbsd-edu.net le 4/12/2002

# Attention, lancé sous l'identité root je risque de casser pas mal de choses si je bug un poil, méfiance, méfiance, 
# je suis innocent en cas de plantage de votre bécane..
# Je vous conseille de lancer ceci en redirigeant la sortie standard vers un fichier >/tmp/alors_planté

#http://www.openbsd.org/faq/upgrade-minifaq.html#3.1.1 pour la VO
#Script GPL, of course.

# 3.1.1: New users/groups 
# 3.1.2: New group for crontab(1) and at(1) qui sont setgid crontab et plus setuid root, COOL!

cp /etc/master.passwd /etc/master.passwd.copie
# Cette méthode est sale au possible et dangereuse en plus... >> TODO.list
echo "sshd:*:27:27::0:0:sshd privsep:/var/empty:/sbin/nologin" >> master.passwd
echo "_portmap:*:28:28::0:0:portmap:/var/empty:/sbin/nologin" >> master.passwd
echo "_identd:*:29:29::0:0:identd:/var/empty:/sbin/nologin" >> master.passwd
echo "_rstatd:*:30:30::0:0:rpc.rstatd:/var/empty:/sbin/nologin" >> master.passwd
echo "_rusersd:*:32:32::0:0:rpc.rusersd:/var/empty:/sbin/nologin" >> master.passwd
echo "_fingerd:*:33:33::0:0:fingerd:/var/empty:/sbin/nologin" >> master.passwd
echo "_x11:*:35:35::0:0:X server:/var/empty:/sbin/nologin" >> master.passwd

cp /etc/group /etc/group.copie
groupadd -g 27 sshd
groupadd -g 28 _portmap
groupadd -g 29 _identd
groupadd -g 30 _rstatd
groupadd -g 32 _rusersd
groupadd -g 33 _fingerd
groupadd -g 34 _sshagnt
groupadd -g 35 _x11
groupadd -g 72 authpf
groupadd -g 66 crontab

# 3.1.2: La fin, après le make build, on finit les modifs.(assumes /bin/csh): 

make build
chgrp crontab /var/at/at.{allow,deny} /var/cron/{allow,deny}
chmod 0640 /var/at/at.{allow,deny} /var/cron/{allow,deny}
foreach f ( /var/cron/tabs/* )
	  set u=`basename $f`
 	  chown $u.crontab $f
    end

#Note that you probably will not have all of the allow/deny files; this is not a problem. 

#3.1.3: New Binutils 

cd /usr/src/gnu/egcs/libiberty
make -f Makefile.bsd-wrapper cleandir
make -f Makefile.bsd-wrapper obj
make -f Makefile.bsd-wrapper depend
make -f Makefile.bsd-wrapper
make -f Makefile.bsd-wrapper install

#3.1.4: New S/Key configuration 
#Le petit fichier /etc/skeys a grandi, c'est un répertoire /etc/skeys avec un fichier par user. On convertit :
#Vous devrez , après ,recompiler tout soft utilisant S/Key

skeyinit -C
mv /etc/skeykeys /etc/skeykeys.OLD


#3.1.5: New permissions for lp* 
# Le répertoire de spool doit être RW par le groupe daemon. En plus le proprio doit être daemon.daemon
#####################les lignes étaient splittées à voir....
find /var/spool/output /var/spool/lpd -type d \ 	-execdir chgrp daemon {} \; -execdir chmod g+rwx {} \;
find /var/spool/output /var/spool/lpd -type f \	-execdir chown daemon:daemon {} \;

#3.1.6: atrun(8) disparait , incorporé dans cron
You should remove the /usr/libexec/atrun job from root's crontab by running the following as root: 

cp /var/cron/tabs/root /var/cron/tabs/root.copie 
cat /var/cron/tabs/root  |grep -v  atrun > /tmp/root
mv /tmp/root /var/cron/tabs/root
chmod 600 /var/cron/tabs/root
rm -rf /usr/libexec/atrun
rm -rf /usr/share/man/cat8/atrun.0 
rm -rf /var/at/spool

#3.1.7: nat.conf intégré dans pf.conf 
# Si votre fichier est complexe et/ou comporte des expansions de variables, vous allez devoir le retoucher à la mimine.
cp /etc/pf.conf /etc/pf.conf.copie
cat /etc/pf.conf |grep -v scrub > /tmp/pf.conf
cat /etc/nat.conf >> /tmp/pf.conf
cat /etc/pf.conf |grep scrub >> /tmp/pf.conf
mv /tmp/pf.conf /etc/pf.conf
chmod 644 /etc/pf.conf
# Attention, les options -f et -R de pfctl ont changé de fonction.: a la mano..

#3.1.8: New fbtab entry needed for xdm 
#login(1) needs to chown /dev/wsmouse to the new _x11 user that is used by xdm for privilege
# revocation purposes on many architectures. The change to /etc/fbtab needed is architecture dependent. 
#The file is created via this process (assuming sources in /usr/src): 

# Si vous aviez des chagements apportés à /etc/fbtab , vous devrez les recommencer  

cat /usr/src/etc/fbtab.head > /etc/fbtab
cat /usr/src/etc/etc.`uname -m`/fbtab >> /etc/fbtab
cat /usr/src/etc/fbtab.tail >> /etc/fbtab

#3.1.9: Use __attribute__((sentinel)) on certain functions !!!!
# Ca c'est plus clair :
#You will need to rebuild gcc according to section 1.8 of the Mini-FAQ before proceeding with make build. 
#1.8: I'm upgrading to a newer version of the compiler (gcc). Is there a standard way of bootstrapping it?
#En gros c'est un partie assez sensible....
rm -r /usr/obj/gnu/egcs/gcc/*
cd /usr/src/gnu/egcs/gcc
make -f Makefile.bsd-wrapper clean
make -f Makefile.bsd-wrapper obj
make -f Makefile.bsd-wrapper depend
make -f Makefile.bsd-wrapper 
make -f Makefile.bsd-wrapper install
make -f Makefile.bsd-wrapper clean
make -f Makefile.bsd-wrapper depend
make -f Makefile.bsd-wrapper 
make -f Makefile.bsd-wrapper install
make build


# Si ca a marché jusqu'ici, j'ai bon espoir pour la suite......

