diff -ruN null/update-passwd.in passwd/update-passwd.in --- null/README 1969-12-31 16:00:00.000000000 -0800 +++ passwd/README 2009-09-22 11:45:00.000000000 -0700 @@ -0,0 +1,9 @@ +Passwd-core package for the Fink Project +http://www.finkproject.org/ + +The package passwd-core and it's associated splitoffs +are in the Public Domain. + +This package adds several administrative user and group entries to +your user database. These are needed to protect the data of several +daemons (e.g. news server, database server). diff -ruN null/group-fink passwd/group-fink --- null/group-fink 1969-12-31 16:00:00.000000000 -0800 +++ passwd/group-fink 2007-08-11 16:15:25.000000000 -0700 @@ -0,0 +1,36 @@ +# +# Fink group additions +# +# IDs are in the range 250..299 +# +# commented out entries are provided by the system and assumed by fink +# +#lp:*:26: +#postfix:*:27: +#postdrop:*:28: +#qtss:*:76: +#mailman:*:78: +#clamav:*:82: +#jabber:*:84: + +news:*:250:news +postgres:*:252:postgres +games:*:253:games +canna:*:254:canna +maildrop:*:256:maildrop +tomcat:*:257:tomcat +opennms:*:259:opennms +distcc:*:262:distcc,root +messagebus:*:263:messagebus +icecast:*:264:icecast +gdm:*:265:gdm +#fink-bld:*:266:fink-bld +ossec:*:267:ossec,ossecm,ossece,ossecr +rt:*:271:rt +dovecot:*:272:dovecot +haldaemon:*:273:haldaemon +avahi:*:274:avahi +# nagios used by nagios or icinga +nagios:*:275:nagios +# amqp used by rabbitmq-server +amqp:*:276:amqp diff -ruN null/passwd-fink.in passwd/passwd-fink.in --- null/passwd-fink.in 1969-12-31 16:00:00.000000000 -0800 +++ passwd/passwd-fink.in 2007-08-11 16:14:44.000000000 -0700 @@ -0,0 +1,40 @@ +# +# Fink passwd additions +# +# IDs are in the range 250..299 +# +# commented out entries are provided by the system and assumed by fink +# +# note that the cyrusimap user was previously called cyrus by fink +# +#lp:*:26:26::0:0:Printing Services:/var/spool/cups:/dev/null +#postfix:*:27:27::0:0:postfix:/var/spool/postfix:/bin/false +#eppc:*:71:71::0:0:Apple Events User:/var/empty:/usr/bin/false +#qtss:*:76:76::0:0:QuickTime Streaming Server:/var/empty:/usr/bin/false +#cyrusimap:*:77:6::0:0:Cyrus User:/var/imap:/usr/bin/false +#mailman:*:78:78::0:0:Mailman user:/var/empty:/usr/bin/false +#appserver:*:79:79::0:0:Application Server:/var/empty:/usr/bin/false +#clamav:*:82:82::0:0:Clamav User:/var/virusmails:/bin/tcsh +#jabber:*:84:84::0:0:Jabber User:/var/empty:/usr/bin/false + +news:*:250:250::0:0:News Server:/dev/null:/dev/null +postgres:*:252:252::0:0:PostgreSQL Database Server:/var/empty:/dev/null +games:*:253:253::0:0:Game Files Owner:/dev/null:/dev/null +canna:*:254:254::0:0:Canna Japanese Input Server:/dev/null:/dev/null +tomcat:*:257:257::0:0:Tomcat Servlet Engine:@PREFIX@/var/empty:/usr/bin/false +opennms:*:259:259::0:0:OpenNMS Network Management:@PREFIX@/var/opennms:/dev/null +distcc:*:262:262::0:0:distcc daemon,,,:@PREFIX@/var/spool/distcc:/dev/null +messagebus:*:263:263::0:0:messagebus (dbus) daemon,,,:@PREFIX@/var/run/dbus:/dev/null +icecast:*:264:264::0:0:Icecast Server:/var/empty:/usr/bin/false +gdm:*:265:265::0:0:gdm Login GUI priv-sep:/var/empty:/usr/bin/false +#fink-bld:*:266:266::0:0:Fink Build System:/var/empty:/usr/bin/false +ossec:*:267:267::0:0:OSSec HIDS Monitor Daemon:@PREFIX@/var/ossec:/usr/bin/false +ossecm:*:268:267::0:0:OSSec HIDS Mail Daemon:@PREFIX@/var/ossec:/usr/bin/false +ossece:*:269:267::0:0:OSSec HIDS Daemon:@PREFIX@/var/ossec:/usr/bin/false +ossecr:*:270:267::0:0:OSSec HIDS Remote Daemon:@PREFIX@/var/ossec:/usr/bin/false +rt:*:271:271::0:0:Request Tracker:/dev/null:/dev/null +dovecot:*:272:272::0:0:Dovecot IMAP Server Daemon:/dev/null:/dev/null +haldaemon:*:273:273::0:0:Hardware Abstraction Layer Daemon:/dev/null:/dev/null +avahi:*:274:274::0:0:Service Discovery Daemon:/dev/null:/dev/null +nagios:*:275:275::0:0:Nagios and Icinga Monitoring Daemon:/dev/null:/dev/null +amqp:*:276:276::0:0:AMQP Messaging Daemon:/dev/null:/dev/null diff -ruN null/update-passwd.in passwd/update-passwd.in --- null/update-passwd.in 1969-12-31 16:00:00.000000000 -0800 +++ passwd/update-passwd.in 2007-08-11 09:48:16.000000000 -0700 @@ -0,0 +1,121 @@ +#!/bin/sh +# +# Merge Fink's passwd and group additions into NetInfo +# + +if [ `id -u` -ne 0 ]; then + echo "You must be root to run update-passwd." + exit 1 +fi + +PREFIX=@PREFIX@ + +merge_user_info() { + FILE="$1" + FINK_PASSWD_USER="$2" + case `uname -r` in + 8*) + niload passwd . <$FILE + ;; + *) + OIFS=$IFS + IFS=: + cat $FILE | grep $FINK_PASSWD_USER | while read name passwd uid gid junk1 junk2 junk3 info home shell; do + dscl . create /users/$name + dscl . create /users/$name name $name + dscl . create /users/$name passwd '*' + dscl . create /users/$name hint "" + dscl . create /users/$name uid $uid + dscl . create /users/$name gid $gid + dscl . create /users/$name home "$home" + dscl . create /users/$name shell "$shell" + dscl . create /users/$name realname "$info" + dscl . delete /users/$name AuthenticationAuthority + done + IFS=$OIFS + ;; + esac +} + +merge_group_info() { + FILE="$1" + GROUP="$2" + case `uname -r` in + 8*) + niload group . <$FILE + ;; + *) + OIFS=$IFS + IFS=: + cat $FILE | grep $GROUP | while read name passwd gid GroupMembership; do + dscl . create /groups/$name + dscl . create /groups/$name name $name + dscl . create /groups/$name passwd '*' + dscl . create /groups/$name gid $gid + dscl . create /groups/$name GroupMembership $GroupMembership + done + IFS=$OIFS + ;; + esac +} + +if [ ! $2 ]; then + echo "No user was specified to be added." + echo "update-passwd needs to know which user will be added to the system." + exit 1 +fi + +if [ ! -f "$PREFIX/etc/passwd-fink" ]; then + echo "The file $PREFIX/etc/passwd-fink is missing." + echo "update-passwd can not continue without this file." + exit 1 +fi + +if [ ! -f "$PREFIX/etc/group-fink" ]; then + echo "The file $PREFIX/etc/group-fink is missing." + echo "update-passwd can not continue without this file." + exit 1 +fi + +echo +echo "The following user entry will be added to your NetInfo database:" +grep `echo $2 | /usr/bin/sed "s/^passwd-//"` $PREFIX/etc/passwd-fink + +echo +echo "The following group entry will be added to your NetInfo database:" +grep `echo $2 | /usr/bin/sed "s/^passwd-//"` $PREFIX/etc/group-fink + +echo +if [ "x$1" = "xpostinst" ]; then + echo "Existing entries with these names or numbers will be overwritten or" + echo "otherwise affected by this. On the other hand, some Fink packages will" + echo "not work unless these entries are in the NetInfo database. You can make" + echo "adjustments to the files $PREFIX/etc/passwd-fink and" + echo "$PREFIX/etc/group-fink now (from another window), then say yes here. Or" + echo "you can say no here and add the users and groups manually (e.g. on your" + echo "central NetInfo server). If you don't know what all of this is about," + echo "just say yes." +else + echo "Existing entries with these names or numbers will be overwritten or" + echo "otherwise affected by this." +fi +/bin/echo "Do you want to continue? [Y/n] \c" +read answer + +answer=`echo $answer | sed 's/^[yY].*$/y/'` + + +if [ -z "$answer" -o "x$answer" = "xy" ]; then + echo + echo "Merging user info..." + merge_user_info "$PREFIX/etc/passwd-fink" `echo $2 | /usr/bin/sed "s/^passwd-//"` + + echo "Merging group info..." + merge_group_info "$PREFIX/etc/group-fink" `echo $2 | /usr/bin/sed "s/^passwd-//"` + echo "Done." +else + echo "Okay, not adding the entries." +fi +echo + +exit 0