diff options
author | Dirk von Suchodoletz | 2006-03-21 21:30:47 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-03-21 21:30:47 +0100 |
commit | 2e328710ccf770caa967625d034ce1ebb4e65452 (patch) | |
tree | 677711078e3ea232799ccf885603a9e1f0b06562 /initrd/initrd-stuff/etc/functions | |
parent | Fix: dhclientuser für Ubuntu (diff) | |
download | core-2e328710ccf770caa967625d034ce1ebb4e65452.tar.gz core-2e328710ccf770caa967625d034ce1ebb4e65452.tar.xz core-2e328710ccf770caa967625d034ce1ebb4e65452.zip |
extended passwd function, some cleanups ...
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@110 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff/etc/functions')
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index 825eff17..ea7243b4 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -2,8 +2,8 @@ # linux diskless clients (included by init, hwautocfg, # servconfig, ... within initial ramdisk) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 07-03-2006 -# Blabla +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 21-03-2006 +# Felix Endres, 21-03-2006 # Blub # # Copyright: (c) 2006 - RZ Universitaet Freiburg @@ -365,15 +365,17 @@ echo "not implemented" > /tmp/ldap-done # base passwd/shadow, the standard user present in every system. All # other system users should be generated within the service function basepasswd () { -# strip every line with userid between 500 and 99999 from the passwd-file -# FIXME: "nobody" will be deleted too -cat /mnt/etc/passwd | sed '/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[1-9][0-9]\{3,4\}:/d;/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[5-9][0-9]\{2\}:/d' > /mnt/etc/newpasswd -mv /mnt/etc/newpasswd /mnt/etc/passwd - - -#echo -e "root:x:0:0:System Administrator:/root:/bin/bash" \ -# > /mnt/etc/passwd +# strip every line with userid between 500 and 99999 from the passwd +# file +sed '/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[1-9][0-9]\{3,4\}:/d;/^+:*/d;/^+$/d; + /^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[5-9][0-9]\{2\}:/d' /mnt/etc/passwd \ + > /tmp/newpasswd +# and add user nobody again (is there a more elegant way?) +sed -n -e '/nobody/p' /mnt/etc/passwd >> /tmp/newpasswd +cp /tmp/newpasswd /mnt/etc/passwd +# create the shadow from passwd file echo -e "root:"$root_pw":12958:0:10000::::" > /mnt/etc/shadow +sed 's/:.*/:!:13078:0:99999:7:::/' /tmp/newpasswd >> /mnt/etc/shadow } ####################################################################### |