dpsyco-1.0.36/0000775000175000017500000000000011047072017011213 5ustar olaoladpsyco-1.0.36/skel/0000775000175000017500000000000011047072017012151 5ustar olaoladpsyco-1.0.36/skel/man/0000775000175000017500000000000011047072017012724 5ustar olaoladpsyco-1.0.36/skel/man/update-dpsyco-users-skel.pod0000664000175000017500000000047310366754013020316 0ustar olaola=head1 NAME update-dpsyco-users-skel =head1 USAGE update-dpsyco-users-skel =head1 DESCRIPTION Syncronizes the information in /usr/share/dpsyco/usersskel to the home direcory of each user using dpsyco-skel. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) dpsyco-skel(1) =cut dpsyco-1.0.36/skel/man/update-dpsyco-skel.pod0000664000175000017500000000045710366754013017161 0ustar olaola=head1 NAME update-dpsyco-skel =head1 USAGE update-dpsyco-skel =head1 DESCRIPTION Syncronizes the information in /usr/share/dpsyco/skel to the root (/) direcory of the system using dpsyco-skel. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) dpsyco-skel(1) =cut dpsyco-1.0.36/skel/src/0000775000175000017500000000000011047072017012740 5ustar olaoladpsyco-1.0.36/skel/src/update-dpsyco-users-skel0000775000175000017500000000410610457471652017557 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users-skel 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Updates the dpsyco base users skeleton, and patch if needed. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/change.func . /usr/share/dpsyco/owner.func TESTNFS="/ $DHOME /etc" . /usr/share/dpsyco/checknfs.test # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;") for U in $EUSERS ; do . $USERSC if [ -f $USERSRC/$U ] ; then . $USERSRC/$U fi if [ -d "$DHOME/$U" ] ; then if [ -d "$USERSKELSRC" ] ; then rsync -rlptD -I "$USERSKELSRC/" /etc/skel dpsyco-skel "$USERSKELSRC/" "$DHOME/$U" fi changeowner $U $U "$DHOME/$U" if [ ! -z "$EMAIL" ] ; then PROFILE="$DHOME/$U/.bash_profile" if grep "^EMAIL=" /dev/null 2>&1 ; then changefile "s|\(EMAIL=.*\)|export \1|;" $PROFILE fi if grep "export[[:space:]][[:space:]]*EMAIL=" $PROFILE > /dev/null 2>&1 ; then if ! grep grep "export[[:space:]][[:space:]]*EMAIL='$EMAIL'" $PROFILE > /dev/null 2>&1 ; then changefile "s|export[[:space:]][[:space:]]*EMAIL=.*|export EMAIL='$EMAIL'|;" $PROFILE fi else echo "export EMAIL='$EMAIL'" >> $PROFILE fi fi fi done dpsyco-1.0.36/skel/src/update-dpsyco-skel0000775000175000017500000000217310457471652016422 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-skel 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Rsync the system (/). # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf TESTNFS="/ /etc" . /usr/share/dpsyco/checknfs.test if [ -d $SKELSRC ] ; then dpsyco-skel "$SKELSRC/" "/" fi dpsyco-1.0.36/patch/0000775000175000017500000000000011047072017012312 5ustar olaoladpsyco-1.0.36/patch/man/0000775000175000017500000000000011047072017013065 5ustar olaoladpsyco-1.0.36/patch/man/update-dpsyco-users-patch.pod0000664000175000017500000000052410366754013020615 0ustar olaola=head1 NAME update-dpsyco-users-patch =head1 USAGE update-dpsyco-users-patch =head1 DESCRIPTION This tool applies patches that it can find in /usr/share/dpsyco/users on the apropriate users home directory. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) update-dpsyco-patch(1) patch(1) diff(1) =cut dpsyco-1.0.36/patch/man/update-dpsyco-patch.pod0000664000175000017500000000047010366754013017456 0ustar olaola=head1 NAME update-dpsyco-patch =head1 USAGE update-dpsyco-patch =head1 DESCRIPTION This tool applies patches that it can find in /usr/share/dpsyco/patches on the root(1). =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) update-dpsyco-users-patch(1) patch(1) diff(1) =cut dpsyco-1.0.36/patch/src/0000775000175000017500000000000011047072017013101 5ustar olaoladpsyco-1.0.36/patch/src/update-dpsyco-patch0000775000175000017500000000267311047071763016724 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-patch 2594 2008-08-08 16:27:28Z ola $ # Author: $Author: ola $ # Date: $Date: 2008-08-08 18:27:28 +0200 (fre, 08 aug 2008) $ # Summary: # Patch the system (/). # # Copyright (C) 2001-2004 Ola Lundqvist # Copyright (C) 2003 Otavio Salvador # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf TESTNFS="/ /etc" . /usr/share/dpsyco/checknfs.test # Old option. if [ -n "$PATCHSRC" ] ; then if [ -d $PATCHSRC ] ; then dpsyco-patch "$PATCHSRC" / "$SKELSRC" "-printf %p@%c" fi fi # New option. if [ -n "$PATCHSRCS" ] ; then for PATCHSRC in $PATCHSRCS ; do if [ -d $PATCHSRC ] ; then dpsyco-patch "$PATCHSRC" / "$SKELSRC" "-printf %p@%c" fi done fi dpsyco-1.0.36/patch/src/update-dpsyco-users-patch0000775000175000017500000000402210457471652020056 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users-patch 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Updates the dpsyco base users skeleton, and patch if needed. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf TESTNFS="/ $DHOME /etc" . /usr/share/dpsyco/checknfs.test # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;") for U in $EUSERS ; do if [ -d "$DHOME/$U" ] ; then # Old option if [ -n "$USERPATCHSRC" ] ; then if [ -d "$USERPATCHSRC" ] ; then # dpsyco-patch $USERPATCHSRC $DHOME/$U "$USERSKELSRC" "" alluser. dpsyco-patch $USERPATCHSRC $DHOME/$U "$USERSKELSRC" "" fi fi # New option. if [ -n "$USERPATCHSRCS" ] ; then for USERPATCHSRC in $USERPATCHSRCS ; do if [ -d "$USERPATCHSRC" ] ; then # dpsyco-patch $USERPATCHSRC $DHOME/$U "$USERSKELSRC" "" alluser. dpsyco-patch $USERPATCHSRC $DHOME/$U "$USERSKELSRC" "" fi done fi # Patches in the skel directory. if [ -d "$USERSKELSRC" ] ; then # dpsyco-patch $USERSKELSRC $DHOME/$U "$USERSKELSRC" "-path '$USERSKELSRC/*/$U/*'" user. dpsyco-patch $USERSKELSRC $DHOME/$U "$USERSKELSRC" "-path '$USERSKELSRC/*/$U/*'" fi fi done dpsyco-1.0.36/sudo/0000775000175000017500000000000011047072017012165 5ustar olaoladpsyco-1.0.36/sudo/man/0000775000175000017500000000000011047072017012740 5ustar olaoladpsyco-1.0.36/sudo/man/update-dpsyco-users-sudoers.pod0000664000175000017500000000104610366754016021060 0ustar olaola=head1 NAME update-dpsyco-users-sudoers =head1 USAGE update-dpsyco-users-sudoers =head1 DESCRIPTION Searches for 'sudo' files in /usr/share/dpsyco/users. Each sudo file contains a line with information about what that user can do. A line can look like this: ALL=(ALL) ALL And the generated line (that will be applied to /etc/sudoers) will look like $USERNAME ALL=(ALL) ALL The $USERNAME is the name of the apropriate user. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) sudo(1) /etc/dpsyco/sudoers =cut dpsyco-1.0.36/sudo/src/0000775000175000017500000000000011047072017012754 5ustar olaoladpsyco-1.0.36/sudo/src/update-dpsyco-users-sudoers0000775000175000017500000000420110457471652020315 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users-sudoers 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Updates the dpsyco base administrators (sudoers). # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # SUDOERSF=/etc/sudoers SUDOSRC=/etc/dpsyco/sudoers # Read the dpsyco default config. . /etc/dpsyco/defaults.conf TESTNFS="/ /etc" . /usr/share/dpsyco/checknfs.test cd $USERSRC if [ ! -e $SUDOSRC ] ; then echo "root ALL=(ALL) ALL" >> $SUDOSRC fi echo "# This file is generated by dpsyco-sudo. Source is taken from $SUDOSRC" > $SUDOERSF echo "# and from files in /usr/share/dpsyco/users." >> $SUDOERSF echo "# Do not edit $SUDOERSF directly because that file will be" >> $SUDOERSF echo "# overwritten each time update-dpsyco or update-dpsyco-users-sudoders" >> $SUDOERSF echo "# is runned. This will happen when you install or update a package using apt." >> $SUDOERSF cat $SUDOSRC >> $SUDOERSF chmod 0440 $SUDOERSF for P in * ; do if [ -d $P -a "$P" != "." -a "$P" != ".." -a "$P" != "CVS" ] ; then cd $P for U in * ; do if [ -d $U -a "$U" != "." -a "$U" != ".." -a "$P" != "CVS" ] ; then if [ -f $U/sudo ] ; then cat $U/sudo | sed -e "s/#.*//" | grep -v "^$" | { while read SL ; do if ! grep "$U $SL" $SUDOERSF > /dev/null 2>&1 ; then echo "$U $SL" >> $SUDOERSF fi done } fi fi done cd .. fi done dpsyco-1.0.36/samba/0000775000175000017500000000000011047072017012276 5ustar olaoladpsyco-1.0.36/samba/man/0000775000175000017500000000000011047072017013051 5ustar olaoladpsyco-1.0.36/samba/man/dpsyco-delsmbprofile.pod0000664000175000017500000000103710366754012017711 0ustar olaola=head1 NAME dpsyco-delsmbprofile =head1 USAGE dpsyco-delsmbprofile =head1 DESCRIPTION Disables a user samba profile directory with the method specified in /etc/dpsyco/defaults.conf. ONREMOVE=tar : It tars down the archive and then removes it. ONREMOVE=rm : It just removes the user home directory. ONREMOVE=mv : (default) It moves the home directory to username.disabled. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco-users(1) dpsyco-restorehome(1) dpsyco-delhome(1) dpsyco-restoresmbprofile(1) =cut dpsyco-1.0.36/samba/man/dpsyco-restoresmbprofile.pod0000664000175000017500000000055710366754012020636 0ustar olaola=head1 NAME dpsyco-restoresmbprofile =head1 USAGE dpsyco-restoresmbprofile =head1 DESCRIPTION Restore a previously disabled user profile directory with the method specified in /etc/dpsyco/defaults.conf. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco-users(1) dpsyco-delsmbprofile(1) dpsyco-restorehome(1) dpsyco-delhome(1) =cut dpsyco-1.0.36/samba/man/update-dpsyco-users-samba.pod0000664000175000017500000000047610366754012020572 0ustar olaola=head1 NAME update-dpsyco-users-samba =head1 USAGE update-dpsyco-users-samba =head1 DESCRIPTION This tool users the information in /usr/share/dpsyco/users; parse it, and gives the users that should have it, access to samba. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) =cut dpsyco-1.0.36/samba/src/0000775000175000017500000000000011047072017013065 5ustar olaoladpsyco-1.0.36/samba/src/dpsyco-restoresmbprofile0000775000175000017500000000273210457471652020100 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-restoresmbprofile 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Restores the user samba profile directory. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ -z "$1" ] ; then echo "No user specified, exiting." exit 0 fi . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/delrestoredir.func cat /etc/samba/smb.conf | grep -A 20 "^[[:space:]]*\[profiles\]" | grep -B 20 "^[[:space:]]*\[[^p]" | grep "^[[:space:]]*path[[:space:]]*=[[:space:]]*" | sed -e "s|^[[:space:]]*path[[:space:]]*=[[:space:]]*||;" | { read PROFPATH if [ -z "$PROFPATH" ] ; then echo "No profile path to disable." exit 0 fi cd $PROFPATH restoredir $1 } dpsyco-1.0.36/samba/src/dpsyco-delsmbprofile0000775000175000017500000000272110457471652017157 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-delsmbprofile 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Deletes the user samba profile directory. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ -z "$1" ] ; then echo "No user specified, exiting." exit 0 fi . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/delrestoredir.func cat /etc/samba/smb.conf | grep -A 20 "^[[:space:]]*\[profiles\]" | grep -B 20 "^[[:space:]]*\[[^p]" | grep "^[[:space:]]*path[[:space:]]*=[[:space:]]*" | sed -e "s|^[[:space:]]*path[[:space:]]*=[[:space:]]*||;" | { read PROFPATH if [ -z "$PROFPATH" ] ; then echo "No profile path to disable." exit 0 fi cd $PROFPATH deldir $1 } dpsyco-1.0.36/samba/src/update-dpsyco-users-samba0000775000175000017500000001026110457471652020030 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users-samba 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Updates the shell accounts. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/change.func . /usr/share/dpsyco/owner.func removesmbuser() { smbpasswd -x $1 dpsyco-delsmbprofile $1 } restoresmbuser() { dpsyco-restoresmbprofile $1 } TESTNFS="/ $DHOME /etc" . /usr/share/dpsyco/checknfs.test # Users that should have shell access. FUSERS=$(find $USERSRC -maxdepth 3 -path "$USERSRC/*/*" -type f -name "samba" | sed -e "s|/samba||;" | sed -e "s|.*/||;" | sort -u) if [ ! -e $SMBF ] ; then if [ ! -z "$FUSERS" ] ; then echo "# SMB password file, generated by update-dpsyco-users-samba." > $SMBF chown 600 $SMBF else echo "No samba users to configure, skipping." exit 0 fi fi # Users that exist in smbpassword file. # NOTE! This line has to be after FUSERS= and the $SMBF checking routine. EUSERS=$(grep "^[^:]*:$UID_MATCH:" $SMBF | sed -e "s|:.*||g;") # When removing a user do the following: # smbpasswd -x $USER for RU in $EUSERS ; do UPID=$(grep "^$RU:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if [ -z "$UPID" ] ; then echo "Del user $RU from samba, removed form passwd file." removesmbuser $RU elif [ $UPID -gt $LAST_UID ] ; then echo "User $RU is a ordinary user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif [ $UPID -lt $FIRST_UID ] ; then echo "User $RU is a system user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then echo "Del user $RU from samba." removesmbuser $RU fi done # Users that exist in smbpassword file. EUSERS=$(grep "^[^:]*:[^:]*:$UID_MATCH:" $SMBF | sed -e "s|:.*||g;") # Modify the user information for all users that should and do exist. for U in $FUSERS ; do . $USERSC if [ -f $USERSRC/$U ] ; then . $USERSRC/$U fi if [ ! -z "$SMBCRYPT" ] ; then SMBCRT=$(echo "$SMBCRYPT" | sed -e "s|:.*||;") # User should have samba access. UPID=$(grep "^$U:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if ! grep "^$U:" $SMBF > /dev/null 2>&1 ; then echo "Adding user $U to smbpasswd." echo "$U:$UPID:$SMBCRYPT" >> $SMBF restoresmbuser $U elif ! grep "^$U:$UPID:$SMBCRT" $SMBF > /dev/null 2>&1 ; then echo "Updating password and/or UID for user $U." SMBCR=$(echo "$SMBCRYPT" | sed -e "s/|/\\|/g;") changefile "s|^\($U\):[0-9]*:.*|\1:$UPID:$SMBCR|;" $SMBF else # User should not have samba access. if ! grep "^$U:" $SMBF > /dev/null 2>&1 ; then echo "Samba not enabled for $U, removing user from smbpasswd." removesmbuser $U fi fi if [ -e /etc/samba/smb.conf ] ; then if grep "^$U:" $SMBF > /dev/null 2>&1 ; then # User should exist and cat /etc/samba/smb.conf | grep -A 20 "^[[:space:]]*\[profiles\]" | grep -B 20 "^[[:space:]]*\[[^p]" | grep "^[[:space:]]*path[[:space:]]*=[[:space:]]*" | sed -e "s|^[[:space:]]*path[[:space:]]*=[[:space:]]*||;" | { read PROFPATH if [ ! -z "$PROFPATH" ] ; then changeowner $U $U $PROFPATH/$U fi } fi fi else # User should not have samba access. if grep "^$U:" $SMBF > /dev/null 2>&1 ; then echo "No SMBCRYPT info for $U, removing user from smbpasswd." removesmbuser $U fi fi done dpsyco-1.0.36/lib/0000775000175000017500000000000011047072016011760 5ustar olaoladpsyco-1.0.36/lib/src/0000775000175000017500000000000011047072017012550 5ustar olaoladpsyco-1.0.36/lib/src/delrestoredir.func0000664000175000017500000000516110457471652016313 0ustar olaola# DocumentId: $Id: delrestoredir.func 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Delete and restore a user directory. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################### # Name: restoredir # Description: Restore a user in the directory where you are (chdir:ed to). # Arguments: The user to restore. ############################################################################### restoredir() { if [ -e $1.tar.gz ] ; then tar xzf $1.tar.gz > /dev/null 2>&1 rm -f $1.tar.gz fi if [ -d $1.disabled ] ; then if [ -d $1 ] ; then echo "ERROR: Can not restore the home directory for $1. The home directory does" echo "already exist. You have to manually move the files from" echo "$1.disabled to $1." fi mv $1.disabled $1 fi } ############################################################################### # Name: deldir # Description: Disable a user in the directory where you are (chdir:ed to). # ENV: $ONREMOVE (from defaults.conf). # Arguments: The user to disable. ############################################################################### deldir() { if [ -d "$1" ] ; then if [ "$ONREMOVE" = "mv" ] ; then if [ -e $1.disabled ] ; then echo "ERROR: Can not disable the user home directory $1." echo "The directory $1.disabled does already exist." else mv $1 $1.disabled fi elif [ "$ONREMOVE" = "tar" ] ; then if [ -e $1.tar.gz ] ; then echo "ERROR: Can not disable the user home directory $1." echo "The file $1.tar.gz does already exist." else tar czf $1.tar.gz $1 > /dev/null 2>&1 rm -Rf $1 fi elif [ "$ONREMOVE" = "rm" ] ; then if [ -d "$1" ] ; then rm -Rf $1 fi else echo "ERROR! UNKNOWN remove user option (ONREMOVE=$ONREMOVE) in /etc/dpsyco/adduser.conf." fi fi } dpsyco-1.0.36/lib/src/checknfs.test0000664000175000017500000000277610457471652015265 0ustar olaola# DocumentId: $Id: checknfs.test 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Variables: CHECKNFS=yes then it checks for nfs mounted partitions. # TESTNFS=list for what partitions to check for. # Summary: # Tests if the apropriate filesystem is NFS mounted. If testing is # enabled and it is mounted it exits. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ "$CHECKNFS" = "yes" -o "$CHECKNFS" = "" -o "$CHECKNFS" = "1" -o "$CHECKNFS" = "y" -o "$CHECKNFS" = "Y" -o "$CHECKNFS" = "YES" ] ; then for TEST in $TESTNFS ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Do not run $0 when $TEST is nfsmounted." exit 0 fi done fi dpsyco-1.0.36/lib/src/dpsyco-patch0000775000175000017500000000606710600175575015114 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-patch 2410 2007-03-21 12:17:27Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Date: $Date: 2007-03-21 13:17:27 +0100 (Wed, 21 Mar 2007) $ # Arguments: $1 Source # $2 Destination # Summary: # Patches a file structure. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # SOURCE="$1" DEST="$2" SKELSRC="$3" FINDOPT="$4" #LISTPRE="$5" if [ -z "$LISTPRE" ] ; then LISTPRE=$(echo "$SOURCE" | sed -e "s|/|_|g;")"-" fi if [ ! -d "$SOURCE" ] ; then echo "Source $SOURCE is not a directory, exiting." exit 0 fi if [ ! -d "$DEST" ] ; then echo "Destination $DEST is not a directory, exiting." exit 0 fi DESTAPP=$(echo "$DEST" | sed -e "s|^//*||;") CDIR=/var/lib/dpsyco-patch/$DESTAPP mkdir -p $CDIR OLDLISTF=$CDIR/${LISTPRE}patch.list LISTF=$CDIR/${LISTPRE}tmppatch.list NOWAPPLIEDF=$CDIR/${LISTPRE}tmppatch.nowapplied BDIR=$CDIR/${LISTPRE}patches touch $OLDLISTF find $SOURCE -type f $FINDOPT | sed -e "s|^$SOURCE||;" | sed -e "s|^/||;" | grep -v "^$" | sort > $LISTF SEPREM="< " SEPADD="> " # Compare the two patch-skel files and see what files that have been removed. diff $OLDLISTF $LISTF | grep "$SEPREM" | sed -e "s|^$SEPREM||;" | cut -d '@' -f 1 | { while read FILE ; do # Reverse apply the removed patches. if [ -n "$SKELSRC" -a -e "$SKELSRC/$F" ] ; then # No idea to reverse apply things that exist in skel... true else dpsyco-applypatch "$BDIR/$FILE" $DEST "-R" fi done } if [ -e $NOWAPPLIEDF ] ; then rm -f $NOWAPPLIEDF fi touch $NOWAPPLIEDF # Compare the two patch-skel files and see what files that have been added. diff $OLDLISTF $LISTF | grep "$SEPADD" | sed -e "s|^$SEPADD||;" | cut -d '@' -f 1 | { while read FILE ; do dpsyco-applypatch "$SOURCE/$FILE" $DEST "-N" echo $FILE >> $NOWAPPLIEDF done } # Compare the already applied files with the new ones. diff $NOWAPPLIEDF $LISTF | grep "$SEPADD" | sed -e "s|^$SEPADD||;" | cut -d '@' -f 1 | { while read FILE ; do FILES=$(grep "^+++ " "$SOURCE/$FILE" | sed -e "s|^+++ ||" | sed "s|[[:space:]].*||") EXISTINSKEL= for F in $FILES ; do if [ -e $SKELSRC/$F ] ; then EXISTINSKEL=yes fi done if [ -n "$EXISTINSKEL" ] ; then dpsyco-applypatch "$SOURCE/$FILE" $DEST "-N" fi done } rsync -rlptD -I --delete "$SOURCE/" "$BDIR" # Store the new skel as the old one. mv $LISTF $OLDLISTF rm -f $NOWAPPLIEDF dpsyco-1.0.36/lib/src/change.func0000664000175000017500000000337410457471652014675 0ustar olaola# DocumentId: $Id: change.func 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # A change function to update a file using sed. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################### # Name: changefile # Description: Change a file using sed. # Arguments: The sed script to use. # File to change. ############################################################################### changefile() { TMPSEDSC="$1" TMPFILE="$2" if [ -f "$TMPFILE" ] ; then cp -a $TMPFILE "$TMPFILE.tmp" cat "$TMPFILE.tmp" | sed -e "$TMPSEDSC" > $TMPFILE if [ -s $TMPFILE ] ; then rm -f "$TMPFILE.tmp" else if [ ! -s $TMPFILE.tmp ] ; then echo "The file $TMPFILE was cleared probably because of a error in the" echo "sed script. Restoring from backup." mv "$TMPFILE.tmp" $TMPFILE fi fi else echo "File $TMPFILE not found. So it is not possible to change it." fi } dpsyco-1.0.36/lib/src/owner.func0000664000175000017500000000273710457471652014604 0ustar olaola# DocumentId: $Id: owner.func 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Change the ownership of a file or dir. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################### # Name: changeowner # Description: Change the owner of a directory or file. # Arguments: The user. # The group. # File or dir to change. ############################################################################### changeowner() { TMPU="$1" TMPG="$2" DEST="$3" if [ -e "$DEST" ] ; then if [ "$TMPU.$TMPG" != $(find $DEST -prune -printf '%u.%g') ] ; then chown $TMPU.$TMPG $DEST chown -Rf $TMPU.$TMPG $DEST & fi fi } dpsyco-1.0.36/lib/src/dpsyco-skel0000775000175000017500000001024510457471652014751 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-skel 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Handle the syncronization of the skels. # Arguments: $1 Source. # $2 Destination. # (optional) $3 Rsync options. # # # Copyright (C) 2001-2006 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # SOURCE="$1" DESTR="$2" RSYNCOPT="$3" if [ ! -d "$SOURCE" ] ; then echo "Source $SOURCE is not a directory, exiting." exit 0 fi if [ ! -d "$DESTR" ] ; then echo "Destination $DEST is not a directory, exiting." exit 0 fi DESTAPP=$(echo "$DESTR" | sed -e "s|^/||;") DEST=$(echo "$DESTR" | sed -e "s|/$||;") SKELBDB="/var/lib/dpsyco-skel/skel" SKELTBDFORMAT= #SKELTBDFORMAT="%Y-%m-%d" if [ -r /etc/dpsyco/defaults.conf ] ; then . /etc/dpsyco/defaults.conf fi CDIR=$(echo "$SKELBDB/$DESTAPP" | sed -e "s|/$||;") mkdir -p $CDIR OLDLISTF=$CDIR/skel.list LISTF=$CDIR/tmpskel.list BDIR=$CDIR/skel TBDIR=$CDIR/back if [ -n "$SKELTBDFORMAT" ] ; then TBDIR=$CDIR/back-$(date +"$SKELTBDFORMAT") fi touch $OLDLISTF find $SOURCE -depth | sed -e "s|^$SOURCE||;" | sed -e "s|^/||;" | grep -v "^$" | sort > $LISTF SEPREM="< " SEPADD="> " # Compare the two skeleton files and see what files that have been removed. diff $OLDLISTF $LISTF | grep "$SEPREM" | sed -e "s|^$SEPREM||;" | { while read FILE ; do if [ -e "$DEST/$FILE" -a ! -d "$DEST/$FILE" -a ! -L "$DEST/$FILE" ] ; then # Should it be restored or should it be deleted? if [ -e "$BDIR/$FILE" ] ; then echo "Restore $DEST/$FILE from backup." mv "$BDIR/$FILE" "$DEST/$FILE" else if [ -e "$DEST/$FILE" ] ; then echo "Searching for $DEST/$FILE in the installed packages." if dpkg -S "$DEST/$FILE" > /dev/null 2>&1 ; then echo "$DEST/$FILE found, not removed. Nothing to restore from though." else echo "Remove $DEST/$FILE. Removed from dpsyco skel and nothing to restore." rm -f "$DEST/$FILE" fi else echo "File $DEST/$FILE removed from skel and but was already deleted." fi fi elif [ -d "$DEST/$FILE" ] ; then if rmdir "$DEST/$FILE" > /dev/null 2>&1 ; then echo "Directory $DEST/$FILE successfully removed." fi fi done } # Compare the two skeleton files and see what directories that have been # removed. diff $OLDLISTF $LISTF | grep "$SEPREM" | sed -e "s|^$SEPREM||;" | { while read FILE ; do if [ -d "$DEST/$FILE" ] ; then if rmdir "$DEST/$FILE" > /dev/null 2>&1 ; then echo "Directory $DEST/$FILE successfully removed." fi fi done } # Sync in a new version. mkdir -p $TBDIR rsync -rltD -b --backup-dir=$TBDIR -I $RSYNCOPT "$SOURCE/" "$DESTR" find $TBDIR -type f | sed -e "s|^$TBDIR||;" | { while read FILE ; do #echo diff -q "$TBDIR$FILE" "$SOURCE$FILE" if ! diff -q "$TBDIR$FILE" "$SOURCE$FILE" > /dev/null ; then # If they differ back it up. if [ ! -e "$TBDIR$FILE" ] ; then echo "Backing up $DEST$FILE." else echo "Backing (destroy old backup) up $DEST$FILE (was modified)." fi TMPC=$(echo "$BDIR$FILE" | sed -e "s|/[^/]*$||;") mkdir -p $TMPC #echo "Copy $TBDIR$FILE to $BDIR$FILE" cp -a "$TBDIR$FILE" "$BDIR$FILE" else #echo "No need to back up $DEST$FILE (rm $TBDIR$FILE)." rm "$TBDIR$FILE" fi done } if [ -z "$SKELTBDFORMAT" ] ; then #echo "Clean $TBDIR." rm -Rf $TBDIR else #echo "rmdir $TBDIR recursively" find $TBDIR -type d -depth | xargs rmdir > /dev/null 2>&1 fi # Store the new skel as the old one. mv $LISTF $OLDLISTF dpsyco-1.0.36/lib/src/dpsyco-applypatch0000775000175000017500000000342410600175575016154 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-applypatch 2410 2007-03-21 12:17:27Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Date: $Date: 2007-03-21 13:17:27 +0100 (Wed, 21 Mar 2007) $ # Arguments: $1 Patch file. # $2 Destination. # (optional) $3 Extra patch options. # Summary: # Patches a file structure. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # PF="$1" DESTR="$2" PATCHOPT="$3" if [ -z "$PF" ] ; then echo "No patch file specified, exiting." exit 0 fi if [ -z "$DESTR" ] ; then echo "No destination specified, exiting." exit 0 fi DEST=$(echo "$DESTR" | sed -e "s|/$||;") TF=/var/lib/dpsyco-patch/tmp if [ ! -f $PF ] ; then echo "Can not find patch file $PF." else FILES=$(grep "^+++ " $PF | sed -e "s|^+++ ||" | sed "s|[[:space:]].*||") if [ -e $TF ] ; then rm -f $TF fi echo "#\!/bin/sh" > $TF for FILE in $FILES ; do find "$DEST/$FILE" -prune -printf "chown %u.%g %p\nchmod %m %p\n" >> $TF done patch -d $DESTR $PATCHOPT -s -f -T -p0 < $PF if [ -e $TF ] ; then chmod +x $TF $TF rm -f $TF fi fi dpsyco-1.0.36/lib/conf/0000775000175000017500000000000011047072017012706 5ustar olaoladpsyco-1.0.36/lib/conf/defaults.conf0000664000175000017500000000264510366754015015403 0ustar olaola# DocumentId: $Id: defaults.conf 1864 2004-08-29 16:40:40Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Date: $Date: 2004-08-29 18:40:40 +0200 (sön, 29 aug 2004) $ # Summary: # Default configuration for all dpsyco scripts. # The base directory. BASEDIR=/usr/share/dpsyco ETCDIR=/etc/dpsyco # Users config. USERSC=$ETCDIR/users.conf # Groups config. GROUPSC=$ETCDIR/users.conf # User source configuration directory. USERSRC=$BASEDIR/users # Group source configuration directory. GROUPSRC=$BASEDIR/groups # Skel source directory. SKELSRC=$BASEDIR/skel # Patch source directory. PATCHSRCS="$BASEDIR/patch /etc/dpsyco/patch" # Cfengine source directory. CFENGINESRC=$BASEDIR/cfengine # User skel source directory. USERSKELSRC=$BASEDIR/userskel # User patch skel source directory. USERPATCHSRCS="$BASEDIR/userpatch /etc/dpsyco/userpatch" # First user id that should be autocreated. BASE_UID=500 # Password file. PWDF=/etc/passwd GRPF=/etc/group SHDF=/etc/shadow SMBF=/etc/samba/smbpasswd # Read adduser config to know where /home is located. $DHOME ADDUSERCFG=/etc/adduser.conf . $ADDUSERCFG DPADDUSERCFG=$ETCDIR/adduser.conf if [ -f $DPADDUSERCFG ] ; then # This one will also read $ADDUSERCFG so the above is not # really needed. . $DPADDUSERCFG fi ONREMOVE=mv # Sudoer files. SUDOERSF=/etc/sudoers SUDOSRC=/etc/dpsyco/sudoers # To check if nfs-mounted? (default = yes). CHECKNFS=yes # CHECKNFS=no dpsyco-1.0.36/lib/man/0000775000175000017500000000000011047072017012534 5ustar olaoladpsyco-1.0.36/lib/man/dpsyco-patch.pod0000664000175000017500000000113010366754016015642 0ustar olaola=head1 NAME dpsyco-patch =head1 USAGE dpsyco-patch source destination extra_find_options Note! The patchfile have to be in uniform (-u) format and the filenames in the patchfile must be relative to the destination directory. =head1 DESCRIPTION This tool is a "safe" way to patch a directory. It applies a number of patchfiles in a automated way. Removed patches will be reverse applied to remove themself. The patch file handing is done in a similar way that the skel handling is done. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-applypatch(1) dpsyco-skel(1) =cut dpsyco-1.0.36/lib/man/dpsyco-skel.pod0000664000175000017500000000200110366754016015477 0ustar olaola=head1 NAME dpsyco-skel - Dpsyco tool to handle skeleton syncronization. =head1 USAGE dpsyco-skel source-skel-dir dest-dir [ rsync options ] =head1 DESCRIPTION This is a quite advanced tool to handle skeleton syncronization, but is quite simple to describe. First of all it remembers what have been in the skeleton the last time this script was invoked. All files that was removed from the source-skel directory will be removed, restored from backup or ignored. =over 4 * It will be restored if it exists in the backup directory of dpsyco-skel (/var/lib/dpsyco-skel/dest-dir). * It will be ignored if it can not be restored but belongs to a installed debian package. It seaches for the file with dpkg -S filename. * It will be removed it can not be restored and does not belong to a debian package. =back Files that are new in the skel will be installed to the destination directory. And if there are no backup file it will be created. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO =cut dpsyco-1.0.36/lib/man/dpsyco-applypatch.pod0000664000175000017500000000104310366754016016713 0ustar olaola=head1 NAME dpsyco-applypatch =head1 USAGE dpsyco-applypatch patchfile destination extra_patch_options Note! The patchfile have to be in uniform (-u) format and the filenames in the patchfile must be relative to the destination directory. =head1 DESCRIPTION This tool is a "safe" way to patch a directory. It applies a number of patchfiles in a automated way. It preserves permissions as they was before the patch was applied (that is what safe means). =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-patch(1) =cut dpsyco-1.0.36/base/0000775000175000017500000000000011047072017012125 5ustar olaoladpsyco-1.0.36/base/man/0000775000175000017500000000000011047072017012700 5ustar olaoladpsyco-1.0.36/base/man/update-dpsyco-users-shell.pod0000664000175000017500000000065710366754016020452 0ustar olaola=head1 NAME update-dpsyco-users-shell - tool to give people shell access. =head1 USAGE update-dpsyco-users-shell =head1 DESCRIPTION This tool takes the information in /usr/share/dpsyco/users; parse it, gives shell access to the users that should have it and remove shell access from those that should not have it. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) update-dpsyco-users(1) =cut dpsyco-1.0.36/base/man/update-dpsyco.pod0000664000175000017500000000052110366754016016174 0ustar olaola=head1 NAME update-dpsyco =head1 USAGE update-dpsyco =head1 DESCRIPTION This is a tool to run all other dpsyco update scripts in the right order. You can find them at /etc/dpsyco/cmd. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco-users(1) update-dpsyco-users-shell(1) update-dpsyco-groups(1) =cut dpsyco-1.0.36/base/man/dpsyco-restorehome.pod0000664000175000017500000000043210366754016017247 0ustar olaola=head1 NAME dpsyco-restorehome - Dpsyco tool for restoring the home directory. =head1 USAGE dpsyco-restorehome username =head1 DESCRIPTION Restores the home directory of a disabled user. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-delhome(1) =cut dpsyco-1.0.36/base/man/dpsyco-delhome.pod0000664000175000017500000000103210366754016016325 0ustar olaola=head1 NAME dpsyco-delhome - Dpsyco tool for deleting the home directory for a user. =head1 USAGE dpsyco-delhome username =head1 DESCRIPTION Removes a user home directory. What it does depends on the ONREMOVE setting in /etc/dpsyco/adduser.conf. ONREMOVE=tar : It tars down the archive and then removes it. ONREMOVE=rm : It just removes the user home directory. ONREMOVE=mv : (default) It moves the home directory to username.disabled. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-restorehome(1) =cut dpsyco-1.0.36/base/man/update-dpsyco-users.pod0000664000175000017500000000104210366754016017332 0ustar olaola=head1 NAME update-dpsyco-users - tool to administrate the existance of users automaticly. =head1 USAGE update-dpsyco-users =head1 DESCRIPTION This tool takes the information in /usr/share/dpsyco/users; parses it and handle the existance of users with (by default) UID between 500 and 999. This can be changed in /etc/dpsyco/adduser.conf, but make sure that you change /etc/adduser.conf acordingly. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) update-dpsyco-users-shell(1) update-dpsyco-groups(1) =cut dpsyco-1.0.36/base/man/update-dpsyco-groups.pod0000664000175000017500000000075110366754016017516 0ustar olaola=head1 NAME update-dpsyco-groups =head1 USAGE update-dpsyco-groups =head1 DESCRIPTION This tool takes the information in /usr/share/dpsyco/groups; parses it and handle the existance of users with (by default) GID between 300 and 499. This can be changed in /etc/dpsyco/adduser.conf, but make sure that you change /etc/adduser.conf acordingly. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) update-dpsyco-users(1) update-dpsyco-users-shell(1) =cut dpsyco-1.0.36/base/logcheck/0000775000175000017500000000000011047072017013704 5ustar olaoladpsyco-1.0.36/base/logcheck/workstation0000664000175000017500000000013110366754016016217 0ustar olaola# Dpsyco specific. sudo: *root : TTY=.* ; PWD=.* ; USER=[^ ]* ; COMMAND=/usr/bin/test -w dpsyco-1.0.36/base/logcheck/server0000664000175000017500000000013110366754016015141 0ustar olaola# Dpsyco specific. sudo: *root : TTY=.* ; PWD=.* ; USER=[^ ]* ; COMMAND=/usr/bin/test -w dpsyco-1.0.36/base/src/0000775000175000017500000000000011047072017012714 5ustar olaoladpsyco-1.0.36/base/src/update-dpsyco-users0000775000175000017500000001306210776476563016612 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users 2576 2008-04-07 20:00:51Z ola $ # Author: $Author: ola $ # Date: $Date: 2008-04-07 22:00:51 +0200 (mÃ¥n, 07 apr 2008) $ # Summary: # Updates the dpsyco base users. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # When adding a user, just do adduser --disabled-password $USER # With name from $USERSRC/$USER if that file exist. # If not the name is the same as the login. # Read the default dpsyco config. . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/change.func . /usr/share/dpsyco/owner.func TESTNFS="/ $DHOME /var /var/mail /var/spool/mail /etc" . /usr/share/dpsyco/checknfs.test # Users that exist in password file. EUSERS=$(grep "^[^:+]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;") # Users that should exist. FUSERS=$(find $USERSRC -maxdepth 2 -path "$USERSRC/*/*" -type d | sed -e "s|/CVS||;" | sed -e "s|.*/||;" | sort -u) # When removing a user do the following: # * Sparka ut användaren, ps & kill. # * Ta bort (flytta?) $DHOME/$USER/.ssh/authorized_keys # * userdel $USER # * Tarra ner $DHOME/$USER till $DHOME/user.tar.gz. # * Ta bort $DHOME/$USER for RU in $EUSERS ; do UPID=$(grep "^$RU:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if [ $(echo "$UPID" | wc -l) -gt 1 ] ; then echo "User $RU has multiple UIDS in /etc/passwd, skipping." elif [ $UPID -gt $LAST_UID ] ; then echo "User $RU is a ordinary user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif [ $UPID -lt $FIRST_UID ] ; then echo "User $RU is a system user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then echo "dpsyco is deleting user $RU (moving $RU to $RU.disabled)" if [ "$SUDO_USER" = "$RU" -o "$USER" = "$RU" ] ; then echo "The script does not kick out any process that the admin runs." echo "FIX THIS MANUALLY:" echo "Log out the user and kill all its processes." echo "Run the following commands (as root, using an other admin account):" echo " userdel $RU" if [ -d $DHOME/$RU ] ; then echo " dpsyco-delhome $RU" fi if [ -e /var/mail/$RU ] ; then echo " mv /var/mail/$RU $DHOME/$RU.mail" fi if [ -e /var/spool/mail/$RU ] ; then echo " mv /var/spool/mail/$RU $DHOME/$RU.mailspool" fi else # First kill all root processes. ps --user $RU -H | grep -v "^[[:space:]]*PID" | grep "[[:space:]]*[0-9][0-9]*[[:space:]][^[:space:]][^[:space:]]*[[:space:]][[:space:]]*[0-9][0-9]:[0-9][0-9]:[0-9][0-9][[:space:]][^[:space:]]" | sed -e "s|[[:space:]]*\([0-9][0-9]*\).*|\1|;" | { while read PL ; do kill $PL done } sleep 1 # Then kill all processes that did not want to be killed. ps --user $RU | grep -v "^[[:space:]]*PID" | sed -e "s|^[[:space:]]*\([0-9][0-9]*\).*|\1|;" | { while read PL ; do kill -9 $PL done } userdel $RU if [ -d $DHOME/$RU ] ; then dpsyco-delhome $RU fi if [ -e /var/mail/$RU ] ; then mv /var/mail/$RU $DHOME/$RU.mail fi if [ -e /var/spool/mail/$RU ] ; then mv /var/spool/mail/$RU $DHOME/$RU.mailspool fi fi fi done # Users that exist in password file. EUSERS=$(grep "^[^:+]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;") # Who should be added to or modified in the passwd file. for AU in $FUSERS ; do . $USERSC if [ -f $USERSRC/$AU ] ; then . $USERSRC/$AU fi UPID=$(grep "^$AU:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if ! echo "$EUSERS" | grep "^$AU$" > /dev/null 2>&1 ; then # If the user is not in the passwd file. if grep "^$AU:" $PWDF > /dev/null 2>&1 ; then if [ $UPID -ge $FIRST_SYSTEM_UID ] ; then echo "User $AU ($UPID) does already exist, FIX THIS MANUALLY!!!" fi else # CREATING USER. dpsyco-restorehome $AU adduser --conf $DPADDUSERCFG --gecos "$NAME" --disabled-password $AU changeowner $AU $AU "$DHOME/$AU" if [ -f $DHOME/$AU.mail ] ; then echo "Restore user $AU incoming mail." if [ -e /var/mail/$AU ] ; then cat $DHOME/$AU.mail >> /var/mail/$AU rm $DHOME/$AU.mail else mv $DHOME/$AU.mail /var/mail/$AU fi changeowner $AU mail "/var/mail/$AU" fi if [ -f $DHOME/$AU.mailspool ] ; then echo "Restore user $AU incoming mailspool." if [ -e /var/spool/mail/$AU ] ; then cat $DHOME/$AU.mailspool >> /var/spool/mail/$AU rm $DHOME/$AU.mailspool else mv $DHOME/$AU.mailspool /var/spool/mail/$AU fi changeowner $AU mail "/var/spool/mail/$AU" fi fi else changeowner $AU mail "/var/spool/mail/$AU" changeowner $AU mail "/var/mail/$AU" if ! grep "^$AU:[^:]*:[^:]*:[^:]*:$NAME" $PWDF > /dev/null 2>&1 ; then if [ $UPID -gt $LAST_UID ] ; then echo "User $AU is a ordinary user and should not be changed." else echo "Changing information for user $AU." usermod -c "$NAME" $AU fi fi fi done dpsyco-1.0.36/base/src/dpsyco-restorehome0000775000175000017500000000217710457471652016520 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-restorehome 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Restores the user home directory. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ -z "$1" ] ; then echo "No user specified, exiting." exit 0 fi . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/delrestoredir.func cd $DHOME restoredir $1 dpsyco-1.0.36/base/src/update-dpsyco0000775000175000017500000000226410457471652015443 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Updates the dpsyco base. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # echo "Updating Debian Packages of System Configurations (dpsyco)." export PATH=$PATH:/sbin:/usr/sbin find /etc/dpsyco/cmd | sort | { while read TMPCMD ; do if [ -x "$TMPCMD" -a ! -d "$TMPCMD" ] ; then $TMPCMD fi done } dpsyco-1.0.36/base/src/dpsyco-delhome0000775000175000017500000000216610457471652015577 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-delhome 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Deletes the user home directory. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ -z "$1" ] ; then echo "No user specified, exiting." exit 0 fi . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/delrestoredir.func cd $DHOME deldir $1 dpsyco-1.0.36/base/src/update-dpsyco-groups0000775000175000017500000000555510457471652016766 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-groups 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Updates the groups. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf . /usr/share/dpsyco/change.func TESTNFS="/ /etc" . /usr/share/dpsyco/checknfs.test # Groups that exist in password file. EGROUPS=$(grep "^[^:]*:[^:]*:$GID_MATCH:" $GRPF | sed -e "s|:.*||g;") # Groups that should exist. FGROUPS=$(find $GROUPSRC -maxdepth 3 -path "$GROUPSRC/*/*/exist" -type f | sed -e "s|/CVS||;" | sed -e "s|/exist||;" | sed -e "s|.*/||;" | sort -u) # Who should be added or changed. for AG in $FGROUPS ; do . $GROUPSC if [ -f $GROUPSRC/$AG ] ; then . $GROUPSRC/$AG fi if ! echo "$EGROUPS" | grep "^$AG$" > /dev/null 2>&1 ; then if grep "^$AG:" $GRPF > /dev/null 2>&1 ; then GPID=$(grep "^$AG:" $GRPF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|") if [ $GPID -gt $LAST_UID ] ; then echo "Group $AG ($GPID) does already exist, FIX THIS MANUALLY!!!" fi else SEGID=$FIRST_GID while [ -z "$FOUND" ] ; do if ! grep "^[^:]*:[^:]:$SEGID:" $GRPF > /dev/null 2>&1 ; then groupadd -g $SEGID $AG FOUND=yes fi SEGID=$(($SEGID+1)) done fi fi changefile "s|^\($AG:[^:]*:[0-9]*:\).*|\1|;" $GRPF find $GROUPSRC -maxdepth 3 -path "$GROUPSRC/*/$AG/members" -type f -exec cat {} \; | sort -u | { while read U ; do if [ ! -z "$U" ] ; then adduser --quiet $U $AG fi done } done # When removing a group do the following: # * groupdel $GROUP for RG in $EGROUPS ; do GPID=$(grep "^$RG:" $GRPF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|") if [ $GPID -ge $FIRST_UID ] ; then echo "Group $RG is a ordinary group and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif [ $GPID -lt $FIRST_GID ] ; then echo "Group $RG is a system group and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FGROUPS" | grep "^$RG$" > /dev/null 2>&1 ; then echo "dpsyco is deleting group $RG" groupdel $RG fi done dpsyco-1.0.36/base/src/update-dpsyco-users-shell0000775000175000017500000000532110776476563017716 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users-shell 2576 2008-04-07 20:00:51Z ola $ # Author: $Author: ola $ # Date: $Date: 2008-04-07 22:00:51 +0200 (mÃ¥n, 07 apr 2008) $ # Summary: # Updates the shell accounts. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf TESTNFS="/ $DHOME /etc" . /usr/share/dpsyco/checknfs.test # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;") # Users that should have shell access. FUSERS=$(find $USERSRC -maxdepth 3 -path "$USERSRC/*/*" -type f -name "shell" | sed -e "s|/shell||;" | sed -e "s|.*/||;" | sort -u) for U in $EUSERS ; do # Modify the user information for all users that should exist. . $USERSC if [ -f $USERSRC/$U ] ; then . $USERSRC/$U fi if [ ! -z "$CRYPT" ] ; then if echo "$FUSERS" | grep "^$U\$" > /dev/null 2>&1 ; then # User should have shell access. if ! grep "^$U:$CRYPT:" $SHDF > /dev/null 2>&1 ; then echo "Updating password for user $U." usermod -p "$CRYPT" $U fi else # User should not have shell access. if ! grep "^$U:X:" $SHDF > /dev/null 2>&1 ; then if [ "$SUDO_USER" = "$U" -o "$USER" = "$U" ] ; then echo "Can not remove the password for the user you are logged in as." echo "So you have to do that manually by typing:" echo " usermod -p X $U" else echo "Updating password for user $U (no shell access)." usermod -p X $U fi fi fi else # User should not have shell access. if ! grep "^$U:x:" $SHDF > /dev/null 2>&1 ; then if [ "$SUDO_USER" = "$U" -o "$USER" = "$U" ] ; then echo "Can not remove the password for the user you are logged in as." echo "So you have to do that manually by typing:" echo " usermod -p x $U" else echo "Updating password for user $U (no password found)." usermod -p x $U fi fi fi if [ ! -z "$SHELL" ] ; then if ! grep ":$SHELL\$" $PWDF > /dev/null 2>&1 ; then usermod -s $SHELL $U fi fi done dpsyco-1.0.36/base/conf/0000775000175000017500000000000011047072017013052 5ustar olaoladpsyco-1.0.36/base/conf/users.conf0000664000175000017500000000052010366754016015070 0ustar olaola# DocumentId: $Id: users.conf 1864 2004-08-29 16:40:40Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Date: $Date: 2004-08-29 18:40:40 +0200 (sön, 29 aug 2004) $ # Summary: # Default configuration for all users. NAME="" EMAIL="" CRYPT="" SMBCRYPT="" if [ -f $USERSRC/default ] ; then . $USERSRC/default fi dpsyco-1.0.36/base/conf/groups.conf0000664000175000017500000000047610366754016015260 0ustar olaola# DocumentId: $Id: groups.conf 1864 2004-08-29 16:40:40Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Date: $Date: 2004-08-29 18:40:40 +0200 (sön, 29 aug 2004) $ # Summary: # Default configuration for all extra (not user) groups. if [ -f $GROUPSRC/default ] ; then . $GROUPSRC/default fi dpsyco-1.0.36/base/README0000664000175000017500000000347010366754016013022 0ustar olaolaDocumentId: $Id: README 1859 2004-08-29 15:51:41Z ola $ Author: $Author: ola $ Ola Lundqvist References: dpsyco/README Date: $Date: 2004-08-29 17:51:41 +0200 (sön, 29 aug 2004) $ Summary: Information about the (Debian Packages of System Configurations) dpsyco way of configuring your system Introduction: ============= These are the basic tools to make dpsyco work as it should. User administration: ==================== With update-dpsyco-users you can automatically create users. The created user will have a UID between FIRST_UID and LAST_UID, as set in /etc/dpsyco/adduser.conf; if you change these, make sure that you check /etc/adduser.conf at the same time. File structure: --------------- /usr/share/dpsyco/users $user(*) A file for each user with some config vars. $package/$user A directory for each user that tells what it has access too. exist - It exists samba - It has access to samba (see the dpsyco-samba package). other - Other files that might be needed, see the other dpsyco packages. * The variables you can set there are: NAME="Name of the user" EMAIL="Email address to the user" CRYPT="Crypted password" and possibly other; see the other dpsyco packages. Group administration: ===================== With update-dpsyco-users you can automatically create groups and assign users to them. The created groups will have a GID between FIRST_GID and LAST_GID, as set in /etc/dpsyco/adduser.conf; if you change these, make sure that you check /etc/adduser.conf at the same time. File structure: --------------- /usr/share/dpsyco/groups $group A file for each group with some configs vars (not needed and not used). $package/$user A directory for each group that tells what it has access too. exist - It exists members - A file with a list of member users. dpsyco-1.0.36/devel/0000775000175000017500000000000011047072017012312 5ustar olaoladpsyco-1.0.36/devel/man/0000775000175000017500000000000011047072017013065 5ustar olaoladpsyco-1.0.36/devel/man/dpsch-showfirstbinpkg.pod0000664000175000017500000000035310366754015020124 0ustar olaola=head1 NAME dpsch-showfirstbinpkg =head1 USAGE dpsch-showfirstbinpkg =head1 DESCRIPTION Show only the first line from dpsch-listbinpkgs. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-listbinpkgs(1) =cut dpsyco-1.0.36/devel/man/dpsch-installgroups.pod0000664000175000017500000000105410366754015017606 0ustar olaola=head1 NAME dpsch-installgroups =head1 USAGE dpsch-installgroups =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]groups file and uses that information to get the directory of the group information that should be installed to the corresponding package. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installskel(1) dpsch-installpatch(1) dpsch-installgroups(1) dpsch-installcfengine(1) dpsch-installuserpatch(1) debhelper(1) =cut dpsyco-1.0.36/devel/man/dpsch-installuserpatch.pod0000664000175000017500000000116410366754015020267 0ustar olaola=head1 NAME dpsch-installuserpatch =head1 USAGE dpsch-installuserpatch =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]userpatch file and uses that information to get the file names of the userpatch files that should be installed to the corresponding package. Wildcards (*?) are allowed in the filenames to list multiple files. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installskel(1) dpsch-installusers(1) dpsch-installgroups(1)d dpsch-installpatch(1) psch-installcfengine(1) debhelper(1) =cut dpsyco-1.0.36/devel/man/dpsch-cvsclean.pod0000664000175000017500000000046310366754015016501 0ustar olaola=head1 NAME dpsch-cvsclean =head1 USAGE dpsch-cvsclean =head1 DESCRIPTION Removes all cvs information from the packages that dpsch-listbinpkgs lists. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-listbinpkgs(1) debhelper(1), this is just a debhelper-look-alike program. =cut dpsyco-1.0.36/devel/man/dpsch-gencvsignore.pod0000664000175000017500000000050510366754015017371 0ustar olaola=head1 NAME dpsch-gencvsignore =head1 USAGE dpsch-gencvsignore =head1 DESCRIPTION This tiny little tool creates .cvsignore files for the root dir and the debian dir so that cvs will not complain after you have built a package. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-listbinpgks(1) =cut dpsyco-1.0.36/devel/man/dpsch-installskel.pod0000664000175000017500000000104110366754015017221 0ustar olaola=head1 NAME dpsch-installskel =head1 USAGE dpsch-installskel =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]skel file and uses that information to get the directory from where the skeleton should be installed to the corresponding package. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installpatch(1) dpsch-installusers(1) dpsch-installgroups(1) dpsch-installcfengine(1) dpsch-installuserpatch(1) debhelper(1) =cut dpsyco-1.0.36/devel/man/dpsch-listbinpkgs.pod0000664000175000017500000000056010366754015017232 0ustar olaola=head1 NAME dpsch-listbinpkgs =head1 USAGE dpsch-listbinpkgs =head1 DESCRIPTION This simply lists all binary packages that this debian source tree will generate when dpkg-buildpackage is invoked. Outputs one line for each package it can find in the debian/control file. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpkg-buildpackage(1) =cut dpsyco-1.0.36/devel/man/dpsch-installcronapt.pod0000664000175000017500000000105410366754015017735 0ustar olaola=head1 NAME dpsch-installcronapt =head1 USAGE dpsch-installcronapt To generate utomatic reinstallation of this package. =head1 DESCRIPTION Copies debian/packagename.cron-apt to the right place in the pacakge that enforces that command to run at periodic intervals using cron-apt. NOTE! The cron-apt file (without prepending package name) will not generate a proper substvar line when using dpsch-gendepends. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dh_make(1) dpkg-buildpackage(1) dch(1) cron-apt(1) dpsch-gendepends(1) =cut dpsyco-1.0.36/devel/man/dpsch-installusers.pod0000664000175000017500000000105010366754015017424 0ustar olaola=head1 NAME dpsch-installusers =head1 USAGE dpsch-installusers =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]users file and uses that information to get the directory of the user information that should be installed to the corresponding package. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installskel(1) dpsch-installpatch(1) dpsch-installgroups(1) dpsch-installcfengine(1) dpsch-installuserpatch(1) debhelper(1) =cut dpsyco-1.0.36/devel/man/dpsch-installpatch.pod0000664000175000017500000000115010366754015017363 0ustar olaola=head1 NAME dpsch-installpatch =head1 USAGE dpsch-installpatch =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]patch file and uses that information to get the file names of the patch files that should be installed to the corresponding package. Wildcards (*?) are allowed in the filenames to list multiple files. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installskel(1) dpsch-installusers(1) dpsch-installgroups(1) dpsch-installcfengine(1) dpsch-installuserpatch(1) debhelper(1) =cut dpsyco-1.0.36/devel/man/dpsch-backupclean.pod0000664000175000017500000000046010366754015017150 0ustar olaola=head1 NAME dpsch-backuplean =head1 USAGE dpsch-backuplean =head1 DESCRIPTION Removes all *~ files from the packages that dpsch-listbinpkgs lists. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-listbinpkgs(1) debhelper(1), this is just a debhelper-look-alike program. =cut dpsyco-1.0.36/devel/man/dpsch-auto-cronapt.pod0000664000175000017500000000065310366754015017320 0ustar olaola=head1 NAME dpsch-auto-cronapt =head1 USAGE dpsch-auto-cronapt To generate automatic reinstallation of this package. =head1 DESCRIPTION Generates a cron-apt file in the package that enforces automatic reinstallation at periodic intervals using cron-apt. It does this for all the generated packages. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dh_make(1) dpkg-buildpackage(1) dch(1) cron-apt(1) =cut dpsyco-1.0.36/devel/man/dpsch-installcfengine.pod0000664000175000017500000000117710366754014020052 0ustar olaola=head1 NAME dpsch-installcfengine =head1 USAGE dpsch-installcfengine =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]cfengine file and uses that information to get the file names of the cfengine configuration files that should be installed to the corresponding package. Wildcards (*?) are allowed in the filenames to list multiple files. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installskel(1) dpsch-installpatch(1) dpsch-installusers(1) dpsch-installgroups(1) dpsch-installuserpatch(1) debhelper(1) =cut dpsyco-1.0.36/devel/man/dpsch-genpkg.pod0000664000175000017500000000133010366754015016150 0ustar olaola=head1 NAME dpsch-genpkg =head1 USAGE dpsch-genpkg example To install a skeleton. dpsch-genpkg To list the example skeletons. =head1 ENVIRONMENT EMAIL The email address of the administrator. DEBEMAIL Overrides EMAIL. NAME The name of the author, else it looks in the passwd file USERNAME using USERNAME. PACKAGE The package name, default the directory name. =head1 DESCRIPTION Generates a skeleton for a administration package. It will take the information from /usr/share/dpsyco-devel/genpkg/$example. You can add your own ones there or (if you do not add it in a package) in /etc/dpsyco/genpkg/$example. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dh_make(1) dpkg-buildpackage(1) dch(1) =cut dpsyco-1.0.36/devel/man/dpsch-gendepends.pod0000664000175000017500000000061010366754015017011 0ustar olaola=head1 NAME dpsch-gendepends =head1 USAGE dpsch-gendepends To generate dpsyco (and cron-apt) dependencies. =head1 DESCRIPTION Generates a dpsyco:Depends entry in the substvars file. You can then use that in the control file by adding ${dpsyco:Depends} at the dependency line. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dh_make(1) dpkg-buildpackage(1) dch(1) =cut dpsyco-1.0.36/devel/man/dpsch-installuserskel.pod0000664000175000017500000000121510366754015020123 0ustar olaola=head1 NAME dpsch-installuserskel =head1 USAGE dpsch-installuserskel =head1 DESCRIPTION This tools helps the system administrator to create configuration packages. It takes the information in the debian/[$pkgname.]userskel file and uses that information to get the directory from where the userskeleton should be installed to the corresponding package. This skeleton is for all users. Individual skeletons have to be implemented using packages. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsch-installpatch(1) dpsch-installusers(1) dpsch-installgroups(1) dpsch-installcfengine(1) dpsch-installuserpatch(1) debhelper(1) =cut dpsyco-1.0.36/devel/example/0000775000175000017500000000000011047072017013745 5ustar olaoladpsyco-1.0.36/devel/example/debian/0000775000175000017500000000000011047072017015167 5ustar olaoladpsyco-1.0.36/devel/example/debian/postrm.ex0000664000175000017500000000155210366754014017063 0ustar olaola#! /bin/sh # postrm script for %PACKAGE% # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see /usr/share/doc/packaging-manual/ case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# dpsyco-1.0.36/devel/example/debian/groups.ex0000664000175000017500000000000710366754014017050 0ustar olaolagroups dpsyco-1.0.36/devel/example/debian/changelog0000664000175000017500000000024410366754014017050 0ustar olaola%PACKAGE% (0.0.1) unstable; urgency=low * Initial release. -- %ADMIN% <%EMAIL%> Thu, 6 Sep 2001 22:58:35 +0200 Local variables: mode: debian-changelog End: dpsyco-1.0.36/devel/example/debian/control0000664000175000017500000000052210366754014016600 0ustar olaolaSource: %PACKAGE% Section: admin Priority: optional Maintainer: %ADMIN% <%EMAIL%> Build-Depends: debhelper (>> 3.0.0), dpsyco-devel Standards-Version: 3.5.2 Package: %PACKAGE% Architecture: all Depends: ${dpsyco:Depends} Description: Configuration package for %PACKAGE%. With this package you will simplify administration of %PACKAGE%. dpsyco-1.0.36/devel/example/debian/preinst.ex0000664000175000017500000000157210366754014017225 0ustar olaola#! /bin/sh # preinst script for %PACKAGE% # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # # For details see /usr/share/doc/packaging-manual/ case "$1" in install|upgrade) # if [ "$1" = "upgrade" ] # then # start-stop-daemon --stop --quiet --oknodo \ # --pidfile /var/run/%PACKAGE%.pid \ # --exec /usr/sbin/%PACKAGE% 2>/dev/null || true # fi ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/devel/example/debian/userpatch.ex0000664000175000017500000000001210366754014017523 0ustar olaolauserpatch dpsyco-1.0.36/devel/example/debian/cfengine.ex0000664000175000017500000000002010366754014017302 0ustar olaolacfengine/*.conf dpsyco-1.0.36/devel/example/debian/patch.ex0000664000175000017500000000001610366754014016630 0ustar olaolapatch/*.patch dpsyco-1.0.36/devel/example/debian/skel.ex0000664000175000017500000000000510366754014016465 0ustar olaolaskel dpsyco-1.0.36/devel/example/debian/postinst.ex0000664000175000017500000000234010366754014017416 0ustar olaola#! /bin/sh # postinst script for %PACKAGE% # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/devel/example/debian/rules0000775000175000017500000000331510366754014016260 0ustar olaola#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatability version to use. export DH_COMPAT=2 configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: configure-stamp build-stamp build-stamp: dh_testdir # Add here commands to compile the package. touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/%PACKAGE%. dpsch-installskel dpsch-installpatch dpsch-installusers dpsch-installuserskel dpsch-installuserpatch dpsch-installgroups dpsch-installcfengine dpsch-installcronapt dpsch-cvsclean dpsch-backupclean binary-arch: # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. dh_testdir -i dh_testroot -i # dh_installdebconf -i dh_installdocs -i dh_installexamples -i # dh_installmenu -i # dh_installlogrotate -i # dh_installemacsen -i # dh_installpam -i # dh_installmime -i # dh_installinit -i # dh_installcron -i # dh_installman -i # dh_installinfo -i # dh_undocumented -i # dh_installchangelogs -i dh_link -i # dh_strip -i dh_compress -i # dh_fixperms -i # dpsch-auto-cronapt dpsch-gendepends # dh_makeshlibs -i dh_installdeb -i dh_perl -i # dh_shlibdeps -i dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure dpsyco-1.0.36/devel/example/debian/copyright0000664000175000017500000000016610366754014017134 0ustar olaolaThis package was debianized by %ADMIN% <%EMAIL%> on Thu, 6 Sep 2001 22:58:35 +0200. Copyright (C) %ADMIN% <%EMAIL%> dpsyco-1.0.36/devel/example/debian/prerm.ex0000664000175000017500000000162210366754014016662 0ustar olaola#! /bin/sh # prerm script for %PACKAGE% # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ case "$1" in remove|upgrade|deconfigure) # install-info --quiet --remove /usr/info/%PACKAGE%.info.gz ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/devel/example/debian/users.ex0000664000175000017500000000000610366754014016671 0ustar olaolausers dpsyco-1.0.36/devel/src/0000775000175000017500000000000011047072017013101 5ustar olaoladpsyco-1.0.36/devel/src/dpsch-installcfengine0000775000175000017500000000347711047071167017313 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installcfengine 2593 2008-08-08 16:21:10Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # Install cfengine configuration scripts to a package name. # # Copyright (C) 2001-2004,2008 Ola Lundqvist # Copyright (C) 2008 Eric Gerlach # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.cfengine ] ; then cat debian/$PKG.cfengine | { while read FILE ; do mkdir -p debian/$PKG$CFENGINESRC/$PKG cp $FILE debian/$PKG$CFENGINESRC/$PKG done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/cfengine ] ; then cat debian/cfengine | { while read FILE ; do mkdir -p debian/$PKG$CFENGINESRC/$PKG cp $FILE debian/$PKG$CFENGINESRC/$PKG mkdir -p debian/$PKG$CFENGINESRC/$PKG cp $FILE debian/$PKG$CFENGINESRC/$PKG done } fi done } dpsyco-1.0.36/devel/src/dpsch-auto-cronapt0000775000175000017500000000331210457471652016555 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-auto-cronapt 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install a system cron-apt file to a package. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi PREFIX=6 dpsch-listbinpkgs | ( while read PKG ; do mkdir -p debian/$PKG/etc/cron-apt/action.d touch debian/$PKG/etc/cron-apt/action.d/$PREFIX-$PKG echo "--yes --fix-missing --show-upgraded --no-remove install $PKG" \ >> debian/$PKG/etc/cron-apt/action.d/$PREFIX-$PKG umask 022 mkdir -p debian/$PKG/DEBIAN touch debian/$PKG/DEBIAN/conffiles if ! grep "/etc/cron-apt/action.d/$PREFIX-$PKG" debian/$PKG/DEBIAN/conffiles > /dev/null 2>&1 ; then echo "/etc/cron-apt/action.d/$PREFIX-$PKG" >> debian/$PKG/DEBIAN/conffiles fi done ) dpsyco-1.0.36/devel/src/dpsch-installgroups0000775000175000017500000000323110457471652017047 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installgroups 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install groups information to a package name. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.groups ] ; then cat debian/$PKG.groups | { while read DIR ; do mkdir -p debian/$PKG$GROUPSRC/$PKG cp -aRf $DIR/* debian/$PKG$GROUPSRC/$PKG done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/groups ] ; then cat debian/groups | { while read DIR ; do mkdir -p debian/$PKG$GROUPSRC/$PKG cp -aRf $DIR/* debian/$PKG$GROUPSRC/$PKG done } fi done } dpsyco-1.0.36/devel/src/dpsch-listbinpkgs0000775000175000017500000000237010457471652016475 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-listbinpkgs 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # This tool creates a file-structure for a # system configuration package. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi cat debian/control | grep "^Package:[[:space:]]" | \ sed -e "s|^Package:[[:space:]][[:space:]]*||;" dpsyco-1.0.36/devel/src/dpsch-showfirstbinpkg0000775000175000017500000000202610457471652017365 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-showfirstbinpkg 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # Print the first listed binary package in the control file to stdout. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # dpsch-listbinpkgs | { read LINE echo $LINE } dpsyco-1.0.36/devel/src/dpsch-gendepends0000775000175000017500000000503410457471652016260 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-gendepends 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # Create substvars for dpsyco automaticly. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # DABOVEQ=1.0.11 DBELOW=1.1.0 if [ ! -z "$1" ] ; then echo "USAGE: dpsch-gendepends" fi if [ ! -d debian ] ; then echo "No debian dir, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi genstr() { TMPL="" TMPD="" if [ ! -z "$1" ] ; then TMPL="${1}." TMPD="$1" fi SEP="" STR="" if [ -e "debian/${TMPL}skel" -o -e "debian/${TMPL}userskel" ] ; then STR="${STR}${SEP}dpsyco-skel (>= $DABOVEQ)" SEP=", " fi if [ -e "debian/${TMPL}groups" -o -e "debian/${TMPL}users" ] ; then STR="${STR}${SEP}dpsyco-base (>= $DABOVEQ)" SEP=", " if [ ! -z "$(find debian/$TMPD/usr/share/dpsyco/users -name '*.pub' 2> /dev/null)" ] ; then STR="${STR}${SEP}dpsyco-ssh (>= $DABOVEQ)" SEP=", " fi fi if [ -e "debian/${TMPL}patch" -o -e "debian/${TMPL}userpatch" ] ; then STR="${STR}${SEP}dpsyco-patch (>= $DABOVEQ)" SEP=", " fi if [ -e "debian/${TMPL}cfengine" ] ; then STR="${STR}${SEP}dpsyco-cfengine (>= $DABOVEQ)" SEP=", " fi if ls debian/$TMPD/etc/cron-apt/action.d/* > /dev/null 2>&1 ; then STR="${STR}${SEP}cron-apt (>= 0.0.5)" SEP=", " fi if [ ! -z "$STR" ] ; then touch "debian/${TMPL}substvars" if echo "$STR" | grep dpsyco > /dev/null 2>&1 ; then echo "dpsyco:Depends=dpsyco-lib (>= $DABOVEQ), dpsyco-lib (<= $DBELOW), $STR" >> "debian/${TMPL}substvars" else echo "dpsyco:Depends=$STR" >> "debian/${TMPL}substvars" fi fi } dpsch-listbinpkgs | { while read TMPL ; do genstr $TMPL done } genstr dpsyco-1.0.36/devel/src/dpsch-installskel0000775000175000017500000000316210457471652016471 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installskel 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install a system skel to a package name. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.skel ] ; then cat debian/$PKG.skel | { while read DIR ; do mkdir -p debian/$PKG$SKELSRC cp -aRf $DIR/* debian/$PKG$SKELSRC done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/skel ] ; then cat debian/skel | { while read DIR ; do mkdir -p debian/$PKG$SKELSRC cp -aRf $DIR/* debian/$PKG$SKELSRC done } fi done } dpsyco-1.0.36/devel/src/dpsch-installpatch0000775000175000017500000000325310457471652016633 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installpatch 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install system patches to a package name. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # PATCHSRC=/usr/share/dpsyco/userpatch . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.patch ] ; then cat debian/$PKG.patch | { while read FILE ; do mkdir -p debian/$PKG$PATCHSRC/$PKG cp $FILE debian/$PKG$PATCHSRC/$PKG done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/patch ] ; then cat debian/patch | { while read FILE ; do mkdir -p debian/$PKG$PATCHSRC/$PKG cp $FILE debian/$PKG$PATCHSRC/$PKG done } fi done } dpsyco-1.0.36/devel/src/dpsch-installcronapt0000775000175000017500000000373510457471652017207 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installcronapt 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install a system cron-apt file to a package. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf # Arguments: # package name # src file handleinstall() { PKG=$1 SRC=$2 PREFIX=$(cat $SRC) if [ "$PREFIX" eq "" ] ; then PREFIX=5 fi mkdir -p debian/$PKG/etc/cron-apt touch debian/$PKG/etc/cron-apt/action.d/$REFIX-$PKG cat $SRC >> debian/$PKG/etc/cron-apt/action.d/$PREFIX-$PKG touch debian/$PKG/DEBIAN/conffiles if ! grep "/etc/cron-apt/action.d/$PREFIX-$PKG" debian/$PKG/DEBIAN/conffiles > /dev/null 2>&1 ; then echo "/etc/cron-apt/action.d/$PREFIX-$PKG" >> debian/$PKG/DEBIAN/conffiles fi } if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.cron-apt ] ; then handleinstall $PKG debian/$PKG.cron-apt fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/cron-apt ] ; then handleinstall $PKG debian/cron-apt fi done } dpsyco-1.0.36/devel/src/dpsch-backupclean0000775000175000017500000000256210457471652016417 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-backupclean 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # Cleans all *~ from the package destinations. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi # This is only to make this package independent of itself. TMPCMD=dpsch-listbinpkgs if [ -e devel/src/$TMPCMD ] ; then TMPCMD="devel/src/$TMPCMD" fi $TMPCMD | { while read TMPL ; do find debian/$TMPL -type d -name "*~" | xargs rm -f done } dpsyco-1.0.36/devel/src/dpsch-genpkg0000775000175000017500000000532310457471652015420 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-genpkg 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # This tool creates a file-structure for a # system configuration package. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /usr/share/dpsyco/change.func SRCDIR="" if [ -z "$1" ] ; then echo "USAGE: dpsch-genpkg \$example" echo "" cd /usr/share/dpsyco-devel/genpkg ls cd /etc/dpsyco/examples ls echo "" exit 0 elif echo "$1" | grep "^/" > /dev/null 2>&1 ; then SRCDIR="$1" elif [ -d /usr/share/dpsyco-devel/genpkg/$1 ] ; then SRCDIR=/usr/share/dpsyco-devel/genpkg/$1 elif [ -d /etc/dpsyco/genpkg/$1 ] ; then SRCDIR=/usr/share/dpsyco-devel/genpkg/$1 else echo "USAGE: dpsch-genpkg example" echo "" cd /usr/share/dpsyco-devel/genpkg ls cd /etc/dpsyco/examples ls echo "" exit 0 fi FLIST="$(find $SRCDIR -type f -printf '%P ')" if [ -z "$EMAIL" ] ; then EMAIL="$USER@$(hostname -f)" fi if [ ! -z "$DEBEMAIL" ] ; then EMAIL="$DEBEMAIL" fi if [ ! -z "$NAME" ] ; then ADMIN="$NAME" elif [ ! -z "$USER" ] ; then ADMIN=$(getent passwd $USER | { OIFS="$IFS" IFS=: read U P I G ADMIN HOME MORE SHELL IFS="$OIFS" echo "$ADMIN" | sed -e "s|\,.*$||g;" }) fi if [ -z "$ADMIN" ] ; then echo "Can not find the administrators full name, so you have to type it here." read ADMIN fi if [ -z "$EMAIL" ] ; then echo "Can not find the administrators email, so you have to type it here." read EMAIL fi if [ -z "$PACKAGE" ] ; then PACKAGE=$(pwd | sed -e "s|^.*/||;") fi for FILE in $FLIST ; do if echo "$FILE" | grep "/" > /dev/null 2>&1 ; then DIR=$(echo "$FILE" | sed -e "s|/[^/]*$||;") if [ ! -d "$DIR" ] ; then mkdir -p $DIR fi fi if [ ! -e "$FILE" ] ; then cp -af $SRCDIR/$FILE $FILE changefile "s|%ADMIN%|$ADMIN|g; s|%EMAIL%|$EMAIL|g; s|%PACKAGE%|$PACKAGE|g; " $FILE else echo "$FILE does already exist, skipping." fi done dpsch-gencvsignore dpsyco-1.0.36/devel/src/dpsch-cvsclean0000775000175000017500000000257610457471652015752 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-cvsclean 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # Cleans all package trees (debian/*) from CVS information. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi # This is only to make this package independent of itself. TMPCMD=dpsch-listbinpkgs if [ -e devel/src/$TMPCMD ] ; then TMPCMD="devel/src/$TMPCMD" fi $TMPCMD | { while read TMPL ; do find debian/$TMPL -type d -name "CVS" | xargs rm -Rf done } dpsyco-1.0.36/devel/src/dpsch-installuserskel0000775000175000017500000000324410457471652017371 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installuserskel 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install a user skel (for all users) to a package name. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.userskel ] ; then cat debian/$PKG.userskel | { while read DIR ; do mkdir -p debian/$PKG$USERSKELSRC cp -aRf $DIR/* debian/$PKG$USERSKELSRC done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/userskel ] ; then cat debian/userskel | { while read DIR ; do mkdir -p debian/$PKG$USERSKELSRC cp -aRf $DIR/* debian/$PKG$USERSKELSRC done } fi done } dpsyco-1.0.36/devel/src/dpsch-gencvsignore0000775000175000017500000000307010457471652016633 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-gencvsignore 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Summary: # This tool creates .cvsignore file for normal debian build. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # if [ ! -z "$1" ] ; then echo "USAGE: dpsch-gencvsignore" fi if [ ! -d debian ] ; then echo "No debian dir, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi if [ ! -e .cvsignore ] ; then echo "*-stamp" > .cvsignore else echo ".cvsignore file already exists." fi if [ ! -e debian/.cvsignore ] ; then echo "*.debhelper" > debian/.cvsignore echo "*.substvars" >> debian/.cvsignore echo "files" >> debian/.cvsignore dpsch-listbinpkgs >> debian/.cvsignore else echo "debian/.cvsignore file already exists." fi dpsyco-1.0.36/devel/src/dpsch-installusers0000775000175000017500000000351510457471652016676 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installusers 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install users information to a package name. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi handle() { mkdir -p debian/$PKG$USERSRC/$PKG find $DIR -maxdepth 1 -mindepth 1 -type d -exec \ cp -aRf {} debian/$PKG$USERSRC/$PKG \; find $DIR -maxdepth 1 -mindepth 1 -type f -name "*.conf" |{ while read D ; do N=$(echo "$D" | sed -e "s|^.*/\([^/]*\).conf$|\1|;") cp -f $D debian/$PKG$USERSRC/$N done } } dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.users ] ; then cat debian/$PKG.users | { while read DIR ; do handle done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/users ] ; then cat debian/users | { while read DIR ; do handle done } fi done } dpsyco-1.0.36/devel/src/dpsch-installuserpatch0000775000175000017500000000326110457471652017531 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsch-installuserpatch 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # Summary: # Install patches for all users to a package name. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf if [ ! -d debian ] ; then echo "No debian directory, exiting." exit 0 fi if [ ! -e debian/control ] ; then echo "No debian control file, exiting." exit 0 fi dpsch-listbinpkgs | { while read PKG ; do if [ -e debian/$PKG.userpatch ] ; then cat debian/$PKG.userpatch | { while read FILE ; do mkdir -p debian/$PKG$USERPATCHSRC/$PKG cp $FILE debian/$PKG$USERPATCHSRC/$PKG done } fi done } dpsch-showfirstbinpkg | { while read PKG ; do if [ -e debian/userpatch ] ; then cat debian/userpatch | { while read FILE ; do mkdir -p debian/$PKG$USERPATCHSRC/$PKG cp $FILE debian/$PKG$USERPATCHSRC/$PKG done } fi done } dpsyco-1.0.36/doc/0000775000175000017500000000000011047072017011760 5ustar olaoladpsyco-1.0.36/doc/FAQ0000664000175000017500000001254410366754015012330 0ustar olaolaHere is an extract of the questions I (Michael Boman, ) had with the Dpsyco author Ola Lundqvist (mostly in Swedish, so pardon me for any bad translation). This was the start of an FAQ... Maintainer note: I did some spellchecking as Michael Boman asked me to. It has later been updated by Guy Atkinson with some additional information. -- Q: What is the purpose of dpsyco? A: It supports creating and maintaining "configuration packages", which enable you to configure other packages. You can copy these configuration packages to multiple Debian machines. See /usr/share/doc/dpsyco/README -- Q: Where is the home page of the dpsyco project? A: http://www.opal.dhs.org/programs/dpsyco/ -- Q: How stable is dpsyco? How long has it been around? A: I wrote it in summer 2001 but the concept had been around (on my systems) since something like a year before. The stability... Well it is quite stable but also a bit dangerous. I think most bugs are in the debian bug-database. -- Q: What do you mean Dpsyco is a bit dangerous? A: When user information is removed/deleted or for some other reason does not exist or dpsyco does not have (access to) it, the user will be disabled, and the user's home directory will be moved out of the way. This affects all users with UID (User ID) between FIRST_UID and LAST_UID - see the config files. If dpsyco has no user information about these users, they will be disabled. This is what I mean by dangerous. If this happens to some of your user accounts then see below, for the question "Q: Dpsyco has removed...". -- Q: Where are the config files? A: See the User administration and Group administration sections of /usr/share/doc/dpsyco-base/README -- Q: Is there any documentation that explains how dpsyco is working? A: The only documentation so far is the source code and the documentation in /usr/share/doc/dpsyco*/ . All contributions are welcome. -- Q: Can Dpsyco replace NIS? A: Yes and no; it depends on how you are going to use NIS.. Dpsyco can: * Add users * Remove users * Change name and password for users * Can configure samba to a degree * Make sure the user gets "good" permissions on his home directory (including samba profile and email) if UID/GID is changed. * The idea is to change/create Debian packages with system information and push them out to a cluster of computers Problems: * There is no check what UID/GID the user gets * Information is only updated if the package updates (if you are not using rsync or similar) Conclusion: * This works well for administration accounts or accounts where there is no need for NFS shared files (or similar) that depend on UID/GID being the same across systems * Passwords are hard to change, as you have to manually paste the encrypted password into a special file. I have not had the time/energy to write such a script yet... -- Q: If the users will be created in the same order on all servers, will they get the same UID/GID? A: If all packages (that contain user information) install in the same order on all computers they *should* get the same UID/GID. -- Q: Are there any problems rebuilding Dpsyco on a Potato (2.2 / Stable) machine [Dpsyco only exists in woody/sid at the moment]? A: No, I run Dpsyco on several Potato installations without problems. -- Q: How does the communication between machines work? A: Simple: there is none within dpsyco. User information gets packaged and then it's up to you (as the administrator) to copy the package(s) to all the machines and install them. -- Q: I have several groups of users, and I don't want to let all of them have access to all servers. Can Dpsyco do this? A: I recommend you to create several packages for this. Dpsyco can handle the same user in several packages without problems. -- Q: If this FAQ has spelling errors, who do I email? A: Well, I'd rather have an email sent to me at michael.boman@securecirt.com with a diff file please. -- Q: I read this and now my system doesn't work anymore! A: Well, sorry. Please restore from your latest backup (you do backups, right?). This FAQ is provided "AS IS" and does not offer any kind of warranty. -- Q: Dpsyco has removed one or more of my users, for example each time I run dselect or apt-get etc. How do I reverse and stop this? A: I understand that for example for compatibility with other distros on your machine, you may use UIDs starting from 500 (Debian starts from 1000). For UIDs in the range FIRST_UID to LAST_UID inclusive (see /etc/dpsyco/adduser.conf), dpsyco will move the users' home directories to e.g. userName.disabled; to fix this, log in as root; cd /home; mv userName.disabled userName If you also mkdir userName.disabled, then subsequent runs of dpsyco will not modify nor move userName . To stop this from happening again, you can either apt-get remove dpsyco* or patch /etc/dpsyco/adduser.conf (also check /etc/adduser.conf) with e.g. the following, which instructs dpsyco to leave UIDs 500 to 599 untouched, and to work only with UIDs 600 to 999 (version 1.0.25 includes this patch): 39c39 < FIRST_UID=500 --- > FIRST_UID=600 71c71 < UID_MATCH=[5-9][0-9][0-9] --- > UID_MATCH=[6-9][0-9][0-9] dpsyco-1.0.36/mysql/0000775000175000017500000000000011047072017012360 5ustar olaoladpsyco-1.0.36/mysql/man/0000775000175000017500000000000011047072017013133 5ustar olaoladpsyco-1.0.36/mysql/man/dpsyco-mysql-dbviewaccess.pod0000664000175000017500000000053510366754015020756 0ustar olaola=head1 NAME dpsyco-mysql-dbviewaccess =head1 USAGE dpsyco-mysql-dbviewaccess username host database =head1 DESCRIPTION Gives a existing user select only access to a specific database. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-mysql-dbuser(1) dpsyco-mysql-dbadmaccess(1) dpsyco-mysql-dbupdaccess(1) mysql(1) =cut dpsyco-1.0.36/mysql/man/dpsyco-mysql-dbuser.pod0000664000175000017500000000065610366754015017604 0ustar olaola=head1 NAME dpsyco-mysql-dbuser =head1 USAGE dpsyco-mysql-dbuser username host password =head1 DESCRIPTION Creates a user in the local mysql database. You have to have the administrator username and password in the configuration file for the mysql database. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-mysql-dbadmaccess(1) dpsyco-mysql-dbupdaccess(1) dpsyco-mysql-dbviewaccess(1) mysql(1) =cut dpsyco-1.0.36/mysql/man/dpsyco-mysql-dbupdaccess.pod0000664000175000017500000000055210366754015020573 0ustar olaola=head1 NAME dpsyco-mysql-dbupdaccess =head1 USAGE dpsyco-mysql-dbupdaccess username host database =head1 DESCRIPTION Gives a existing user select, update and delete access to a specific database. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-mysql-dbuser(1) dpsyco-mysql-dbadmaccess(1) dpsyco-mysql-dbviewaccess(1) mysql(1) =cut dpsyco-1.0.36/mysql/man/dpsyco-mysql-dbadmaccess.pod0000664000175000017500000000063610366754015020547 0ustar olaola=head1 NAME dpsyco-mysql-dbadmaccess =head1 USAGE dpsyco-mysql-dbadmaccess username host database =head1 DESCRIPTION Gives a existing user administrative access to a specific database. Administrative access means all rights that the user can have. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO dpsyco-mysql-dbuser(1) dpsyco-mysql-dbupdaccess(1) dpsyco-mysql-dbviewaccess(1) mysql(1) =cut dpsyco-1.0.36/mysql/src/0000775000175000017500000000000011047072017013147 5ustar olaoladpsyco-1.0.36/mysql/src/dpsyco-mysql-dbupdaccess0000775000175000017500000000472310457471652020041 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-mysql-dbupdaccess 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: username host database # Summary: # Helps to create a user for the mysql-database. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # dbserver=localhost . /usr/share/wwwconfig-common/mysql-localadmpass.get dbuser=$1 dballow=$2 dbname=$3 status=error . /usr/share/wwwconfig-common/mysql.get if [ -z "$dbuser" ] ; then echo "No database user specified. Can not create it if it does not exist." elif [ -z "$dbserver" ] ; then echo "No database server specified." elif [ -z "$dbadmin" ] ; then echo "No database administrator specified." elif [ -z "$dbadmpass" ] ; then echo "No database ($dbadmin) administrator password specified." elif [ ! -x $(which mysql) ] ; then echo "No mysql client to execute." elif ! $mysqlcmd -f mysql -e "show tables;" >/dev/null 2>&1 ; then echo "Error when trying to connect to the mysql database." echo "This error can occur if you have no database to connect to, or" echo "if the password was incorrect." echo "use: dpkg-reconfigure -plow packagename to reconfigure." else echo "Gives update access to database user ($dbuser) for $dbname on $dballow." if $mysqlcmd -f mysql -e " CONNECT mysql; REPLACE INTO db ( host, db, user, select_priv, insert_priv, update_priv, delete_priv ) VALUES ( '$dballow', '$dbname', '$dbuser', 'Y', 'Y', 'Y', 'Y' ); flush privileges; " ; then if ! $mysqlcmd -f mysql -e "select User from db;" | grep $dbuser >/dev/null 2>&1 ; then echo "Database user $dbuser NOT successfully granted. You have to do it manually." fi else echo "Unable to run the update access script." fi fi dpsyco-1.0.36/mysql/src/dpsyco-mysql-dbadmaccess0000775000175000017500000000513510457471652020010 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-mysql-dbadmaccess 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: username host database # Summary: # Helps to create a user for the mysql-database. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # dbserver=localhost . /usr/share/wwwconfig-common/mysql-localadmpass.get dbuser=$1 dballow=$2 dbname=$3 status=error . /usr/share/wwwconfig-common/mysql.get if [ -z "$dbuser" ] ; then echo "No database user specified. Can not create it if it does not exist." elif [ -z "$dbserver" ] ; then echo "No database server specified." elif [ -z "$dbadmin" ] ; then echo "No database administrator specified." elif [ -z "$dbadmpass" ] ; then echo "No database ($dbadmin) administrator password specified." elif [ ! -x $(which mysql) ] ; then echo "No mysql client to execute." elif ! $mysqlcmd -f mysql -e "show tables;" >/dev/null 2>&1 ; then echo "Error when trying to connect to the mysql database." echo "This error can occur if you have no database to connect to, or" echo "if the password was incorrect." echo "use: dpkg-reconfigure -plow packagename to reconfigure." else echo "Gives admin access to database user ($dbuser) for db $dbname on $dballow." if $mysqlcmd -f mysql -e " CONNECT mysql; REPLACE INTO db ( host, db, user, select_priv, insert_priv, update_priv, create_priv, drop_priv, grant_priv, delete_priv, references_priv, index_priv, alter_priv ) VALUES ( '$dballow', '$dbname', '$dbuser', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y' ); flush privileges; " > /dev/null 2>&1 ; then if ! $mysqlcmd -f mysql -e "select User from db;" | grep $dbuser >/dev/null 2>&1 ; then echo "Database user $dbuser NOT successfully granted. You have to do it manually." fi else echo "Unable to run the admin access script." fi fi dpsyco-1.0.36/mysql/src/dpsyco-mysql-dbviewaccess0000775000175000017500000000464010457471652020221 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-mysql-dbviewaccess 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: username host database # Summary: # Helps to create a user for the mysql-database. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # dbserver=localhost . /usr/share/wwwconfig-common/mysql-localadmpass.get dbuser=$1 dballow=$2 dbname=$3 status=error . /usr/share/wwwconfig-common/mysql.get if [ -z "$dbuser" ] ; then echo "No database user specified. Can not create it if it does not exist." elif [ -z "$dbserver" ] ; then echo "No database server specified." elif [ -z "$dbadmin" ] ; then echo "No database administrator specified." elif [ -z "$dbadmpass" ] ; then echo "No database ($dbadmin) administrator password specified." elif [ ! -x $(which mysql) ] ; then echo "No mysql client to execute." elif ! $mysqlcmd -f mysql -e "show tables;" >/dev/null 2>&1 ; then echo "Error when trying to connect to the mysql database." echo "This error can occur if you have no database to connect to, or" echo "if the password was incorrect." echo "use: dpkg-reconfigure -plow packagename to reconfigure." else echo "Gives view access to database user ($dbuser) for $dbname on $dballow." if $mysqlcmd -f mysql -e " CONNECT mysql; REPLACE INTO db ( host, db, user, select_priv) VALUES ( '$dballow', '$dbname', '$dbuser', 'Y' ); flush privileges; " > /dev/null 2>&1 ; then if ! $mysqlcmd -f mysql -e "select User from db;" | grep $dbuser >/dev/null 2>&1 ; then echo "Database user $dbuser NOT successfully granted. You have to do it manually." fi else echo "Unable to run the view access script." fi fi dpsyco-1.0.36/mysql/src/dpsyco-mysql-dbuser0000775000175000017500000000473510457471652017050 0ustar olaola#!/bin/sh # DocumentId: $Id: dpsyco-mysql-dbuser 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: username host password # Summary: # Helps to create a user for the mysql-database. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # dbserver=localhost . /usr/share/wwwconfig-common/mysql-localadmpass.get dbuser=$1 dballow=$2 dbpass=$3 status=error . /usr/share/wwwconfig-common/mysql.get if [ -z "$dbpass" ] ; then echo "Warning, no password for user $dbuser." fi if [ -z "$dbuser" ] ; then echo "No database user specified. Can not create it if it does not exist." elif [ -z "$dbserver" ] ; then echo "No database server specified." elif [ -z "$dbadmin" ] ; then echo "No database administrator specified." elif [ -z "$dbadmpass" ] ; then echo "No database ($dbadmin) administrator password specified." elif [ ! -x $(which mysql) ] ; then echo "No mysql client to execute." elif ! $mysqlcmd -f mysql -e "show tables;" >/dev/null 2>&1 ; then echo "Error when trying to connect to the mysql database." echo "This error can occur if you have no database to connect to, or" echo "if the password was incorrect." echo "use: dpkg-reconfigure -plow packagename to reconfigure." else echo "Creating or resetting database user ($dbuser) on $dballow." if $mysqlcmd -f mysql -e " CONNECT mysql; REPLACE INTO user ( host, user, password ) VALUES ( '$dballow', '$dbuser', password( '$dbpass' ) ); flush privileges; " > /dev/null 2>&1 ; then if ! $mysqlcmd -f mysql -e "select User from user;" | grep $dbuser >/dev/null 2>&1 ; then echo "Database user $dbuser NOT successfully added. You have to do it manually." fi else echo "Unable to run the create user script." fi fi dpsyco-1.0.36/patches/0000775000175000017500000000000011047072017012642 5ustar olaoladpsyco-1.0.36/patches/dpsyco-better-unpatch-and-upgrade-fix-2.diff0000664000175000017500000000107010366754012023033 0ustar olaola--- update-dpsyco-patch.orig 2003-08-07 12:20:43.000000000 -0300 +++ update-dpsyco-patch 2003-08-07 13:29:33.000000000 -0300 @@ -14,7 +14,7 @@ # Old option. if [ -n "$PATCHSRC" ] ; then if [ -d $PATCHSRC ] ; then - dpsyco-patch "$PATCHSRC" / "$SKELSRC" + dpsyco-patch "$PATCHSRC" / "$SKELSRC" "-printf %p@%c" fi fi @@ -22,7 +22,7 @@ if [ -n "$PATCHSRCS" ] ; then for PATCHSRC in $PATCHSRCS ; do if [ -d $PATCHSRC ] ; then - dpsyco-patch "$PATCHSRC" / "$SKELSRC" + dpsyco-patch "$PATCHSRC" / "$SKELSRC" "-printf %p@%c" fi done fi dpsyco-1.0.36/patches/dpsyco-better-unpatch-and-upgrade-fix-1.diff0000664000175000017500000000235110366754012023035 0ustar olaola--- dpsyco-patch.orig 2003-08-07 12:51:30.000000000 -0300 +++ dpsyco-patch 2003-08-07 13:49:26.000000000 -0300 @@ -43,7 +43,7 @@ SEPADD="> " # Compare the two patch-skel files and see what files that have been removed. -diff $OLDLISTF $LISTF | grep "$SEPREM" | sed -e "s|^$SEPREM||;" | { +diff $OLDLISTF $LISTF | grep "$SEPREM" | sed -e "s|^$SEPREM||;" | cut -d '@' -f 1 | { while read FILE ; do # Reverse apply the removed patches. if [ -n "$SKELSRC" -a -e "$SKELSRC/$F" ] ; then @@ -55,21 +55,9 @@ done } # Compare the two patch-skel files and see what files that have been added. -#diff $OLDLISTF $LISTF | grep "$SEPADD" | sed -e "s|^$SEPADD||;" | { -# No do not compare anything. Check if in skel. -cat $LISTF | { +diff $OLDLISTF $LISTF | grep "$SEPADD" | sed -e "s|^$SEPADD||;" | cut -d '@' -f 1 | { while read FILE ; do - AFILES=$(grep "^+++ " $SOURCE/$FILE | sed -e "s|^+++ ||" | sed "s|[[:space:]].*||") - APPLY="" - for F in $AFILES ; do - if [ -n "$SKELSRC" -a -e "$SKELSRC/$F" ] ; then - APPLY="yes" - fi - done - # Apply the (new) patch. - if [ "$APPLY" = "yes" -o ! -e "$BDIR/$FILE" ] ; then - dpsyco-applypatch "$SOURCE/$FILE" $DEST "-N" - fi + dpsyco-applypatch "$SOURCE/$FILE" $DEST "-N" done } dpsyco-1.0.36/patches/dpsycoPatches20040829.tar0000664000175000017500000005002310366754012017021 0ustar olaolabase_README.diff0000644000000000000000000000453410114333762013603 0ustar rootroot00000000000000--- base/README.orig 2001-10-09 15:20:36.000000000 +0100 +++ base/README 2004-08-29 12:00:37.000000000 +0100 @@ -1,10 +1,10 @@ DocumentId: $Id: dpsycoPatches20040829.tar,v 1.1 2004/08/29 15:55:48 ola Exp $ Author: $Author: ola $ - Ola Lundqvist + Ola Lundqvist References: dpsyco/README Date: $Date: 2004/08/29 15:55:48 $ Summary: Information about the (Debian Packages of System Configurations) - dpsyco way of configure your system + dpsyco way of configuring your system @@ -12,5 +12,5 @@ ============= -This is the basic tools to make dpsyco work as it should. +These are the basic tools to make dpsyco work as it should. @@ -18,8 +18,8 @@ ==================== -With update-dpsyco-users you can automaticly create users. The created -user will have a UID between 500 and 999, but you can change that in -/etc/dpsyco/adduser.conf (but make sure that you change /etc/adduser.conf -at the same time). +With update-dpsyco-users you can automatically create users. The created +user will have a UID between FIRST_UID and LAST_UID, as set in +/etc/dpsyco/adduser.conf; if you change these, make sure that you check +/etc/adduser.conf at the same time. File structure: @@ -27,5 +27,5 @@ /usr/share/dpsyco/users - $user(*) A file for each user with some configs vars. + $user(*) A file for each user with some config vars. $package/$user A directory for each user that tells what it has access too. @@ -35,18 +35,18 @@ packages. -* The varibles you can set there are: +* The variables you can set there are: NAME="Name of the user" EMAIL="Email address to the user" CRYPT="Crypted password" - and possibly other, see the other dpsyco packages. + and possibly other; see the other dpsyco packages. Group administration: ===================== -With update-dpsyco-users you can automaticly create groups and assign -users to it. The created groups will have a GID between 300 and 499, but you -can change that in /etc/dpsyco/adduser.conf (but make sure that you change -/etc/adduser.conf at the same time). +With update-dpsyco-users you can automatically create groups and assign +users to them. The created groups will have a GID between FIRST_GID and +LAST_GID, as set in /etc/dpsyco/adduser.conf; if you change these, make sure +that you check /etc/adduser.conf at the same time. File structure: dp_adduser.conf.diff0000644000000000000000000000107310114337445014707 0ustar rootroot00000000000000--- /etc/dpsyco/adduser.conf.orig 2004-07-06 22:08:51.000000000 +0100 +++ /etc/dpsyco/adduser.conf 2004-08-28 20:17:27.000000000 +0100 @@ -37,5 +37,5 @@ # FIRST_[GU]ID to LAST_[GU]ID inclusive is the range of UIDs of dynamically # allocated user accounts/groups. -FIRST_UID=500 +FIRST_UID=600 LAST_UID=999 FIRST_GID=1000 @@ -69,5 +69,5 @@ # The UID match to use. NOTE that it is only possible to # have UID ranges for whole 100 or 1000 number ranges. -UID_MATCH=[5-9][0-9][0-9] +UID_MATCH=[6-9][0-9][0-9] # The GID match to use. NOTE that it is only possible to FAQ.diff0000644000000000000000000001651110114334127012255 0ustar rootroot00000000000000--- doc/FAQ.orig 2002-04-08 19:42:12.000000000 +0100 +++ doc/FAQ 2004-08-29 11:00:41.000000000 +0100 @@ -1,6 +1,6 @@ Here is an extract of the questions I (Michael Boman, -michael.boman@securecirt.com) had with the Dpsyco author (mostly -in Swedish, so pardon me for bad translation). I would guess this is a -start of an FAQ... +) had with the Dpsyco author +Ola Lundqvist (mostly in Swedish, so pardon me for +any bad translation). This was the start of an FAQ... Maintainer note: I did some spellchecking as Michael Boman asked me to. @@ -8,8 +8,23 @@ -- -Q: How stable is dpsyco.. how long has it been around? +Q: What is the purpose of dpsyco? -A: I wrote it this summer but the concept have been around (on my systems) - since something like a year ago. +A: It supports creating and maintaining "configuration packages", which + enable you to configure other packages. You can copy these configuration + packages to multiple Debian machines. + See /usr/share/doc/dpsyco/README + +-- + +Q: Where is the home page of the dpsyco project? + +A: http://www.opal.dhs.org/programs/dpsyco/ + +-- + +Q: How stable is dpsyco? How long has it been around? + +A: I wrote it in summer 2001 but the concept had been around (on my systems) + since something like a year before. The stability... Well it is quite stable but also a bit dangerous. I @@ -21,8 +36,20 @@ A: When user information is removed/deleted or for some other reason - no longer exists the user will be disabled, and the users file will - be moved out of the way. This effects all users with UID/GID (User - ID / Group ID) between 500-999. If there is no user information about - these users they will be disabled. This is what I mean with dangerous. + does not exist or dpsyco does not have (access to) it, the user + will be disabled, and the user's home directory will be moved + out of the way. This affects all users with UID (User ID) between + FIRST_UID and LAST_UID - see the config files. + If dpsyco has no user information about these users, they will be disabled. + This is what I mean by dangerous. + + If this happens to some of your user accounts then see below, for + the question "Q: Dpsyco has removed...". + +-- + +Q: Where are the config files? + +A: See the User administration and Group administration sections of + /usr/share/doc/dpsyco-base/README -- @@ -30,6 +57,6 @@ Q: Is there any documentation that explains how dpsyco is working? -A: The only documentation yet is the source code and the documentation - in /usr/share/doc/dpcyso*/. All contributions are welcome. +A: The only documentation so far is the source code and the documentation + in /usr/share/doc/dpsyco*/ . All contributions are welcome. -- @@ -37,5 +64,5 @@ Q: Can Dpsyco replace NIS? -A: Yes and no, it depends on what you are going to use NIS.. +A: Yes and no; it depends on how you are going to use NIS.. Dpsyco can: @@ -44,20 +71,20 @@ * Change name and password for users * Can configure samba to a degree - * Make sure the user get "good" permissions on his home directory + * Make sure the user gets "good" permissions on his home directory (including samba profile and email) if UID/GID is changed. - * The idea is to change/create debian packets with system information - and push it out to a cluser of computers + * The idea is to change/create Debian packages with system information + and push them out to a cluster of computers Problems: * There is no check what UID/GID the user gets - * Information is only updated if the packets updates (if you are + * Information is only updated if the package updates (if you are not using rsync or similar) Conclusion: - * This works good for administration accounts or accounts where there - is no need for NFS shared files (or similar) that depends on - UID/GID is the same across systems + * This works well for administration accounts or accounts where there + is no need for NFS shared files (or similar) that depend on + UID/GID being the same across systems * Passwords are hard to change, as you have to manually paste the - encrypted password in a special file. I have not had the time/energy + encrypted password into a special file. I have not had the time/energy to write such a script yet... @@ -67,10 +94,10 @@ they get the same UID/GID? -A: If all packages (that contains user information) installs in the same - order on all computers they *should* get the same UID/GID +A: If all packages (that contain user information) install in the same + order on all computers they *should* get the same UID/GID. -- -Q: Is there any problems rebuilding Dpsyco on a Potato (2.2 / Stable) +Q: Are there any problems rebuilding Dpsyco on a Potato (2.2 / Stable) machine [Dpsyco only exists in woody/sid at the moment]? @@ -81,7 +108,7 @@ Q: How does the communication between machines work? -A: Simple: there is none. User information gets packaged and then it's - up to you (as the administrator) to copy the package to all the - machines and install it. +A: Simple: there is none within dpsyco. User information gets packaged + and then it's up to you (as the administrator) to copy the package(s) + to all the machines and install them. -- @@ -91,21 +118,48 @@ A: I recommend you to create several packages for this. Dpsyco can handle - same user in several packages without problems. + the same user in several packages without problems. -- -Q: This FAQ has several spelling errors, who do I shout at? +Q: If this FAQ has spelling errors, who do I email? -A: Well, I rather have a email sent to me at michael.boman@securecirt.com - with a diff file. +A: Well, I'd rather have an email sent to me at michael.boman@securecirt.com + with a diff file please. -- -Q: I read this and now my system doesn't work anymore +Q: I read this and now my system doesn't work anymore! -A: Well, sorry. Please restore from your latest backup (you do that - backups, right?). This FAQ is provided "AS IS" an does not offer any +A: Well, sorry. Please restore from your latest backup (you do + backups, right?). This FAQ is provided "AS IS" and does not offer any kind of warranty. +-- + +Q: Dpsyco has removed one or more of my users, for example each time + I run dselect or apt-get etc. How do I reverse and stop this? +A: I understand that for example for compatibility with other distros on your + machine, you may use UIDs starting from 500 (Debian starts from 1000). + For UIDs in the range FIRST_UID to LAST_UID inclusive (see + /etc/dpsyco/adduser.conf), dpsyco will move the users' home directories + to e.g. userName.disabled; to fix this, + log in as root; cd /home; mv userName.disabled userName + If you also mkdir userName.disabled, then subsequent runs of dpsyco will + not modify nor move userName . + + To stop this from happening again, you can either + apt-get remove dpsyco* or + patch /etc/dpsyco/adduser.conf (also check /etc/adduser.conf) + with e.g. the following, which instructs dpsyco to leave UIDs 500 to 599 + untouched, and to work only with UIDs 600 to 999 (version 1.0.25 includes + this patch): +39c39 +< FIRST_UID=500 +--- +> FIRST_UID=600 +71c71 +< UID_MATCH=[5-9][0-9][0-9] +--- +> UID_MATCH=[6-9][0-9][0-9] README.diff0000644000000000000000000000215610114333642012604 0ustar rootroot00000000000000--- README.orig 2001-09-03 14:16:17.000000000 +0100 +++ README 2004-08-28 23:45:38.000000000 +0100 @@ -23,5 +23,5 @@ I have decided to split the packages into different subpackages which provides some simple functionality. You can read about each of them in -it's own README file (none of them are written now though). +its own README file (none of them are written now though). File structure: @@ -29,5 +29,5 @@ /etc/dpsyco Configuration files. -/etc/dpsyco/cmd Dpsyco commands, preferrably symlinks. +/etc/dpsyco/cmd Dpsyco commands, preferably symlinks. /usr/share/dpsyco users - See dpsyco-base @@ -40,5 +40,5 @@ =========== -This package is still in progress, I have to have a system for versioning +This package is still in progress. I have to have a system for versioning so that people can depend on it in a good way. @@ -56,5 +56,5 @@ So this means that you should add a dependency line that looks something -like the following one (x,y,z is the current version of dpsyco): +like the following one (x.y.z is the current version of dpsyco): Depends: dpsyco-base (<< x.(y+1).0), dpsyco-base (>= x.y.z) update-dpsyco.diff0000644000000000000000000000052510114334602014423 0ustar rootroot00000000000000--- base/src/update-dpsyco.orig 2001-09-03 15:05:53.000000000 +0100 +++ base/src/update-dpsyco 2004-08-29 11:31:05.000000000 +0100 @@ -6,5 +6,5 @@ # Updates the dpsyco base. -echo "Updating Debian Packages of System Configurations." +echo "Updating Debian Packages of System Configurations (dpsyco)." export PATH=$PATH:/sbin:/usr/sbin update-dpsyco-groups.diff0000644000000000000000000000056510114332754015752 0ustar rootroot00000000000000--- base/src/update-dpsyco-groups.orig 2003-04-03 07:24:32.000000000 +0100 +++ base/src/update-dpsyco-groups 2004-08-29 11:28:53.000000000 +0100 @@ -66,5 +66,5 @@ echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FGROUPS" | grep "^$RG$" > /dev/null 2>&1 ; then - echo "Del group $RG" + echo "dpsyco is deleting group $RG" groupdel $RG fi update-dpsyco-users.diff0000644000000000000000000000077310114332724015572 0ustar rootroot00000000000000--- base/src/update-dpsyco-users.orig 2003-08-29 07:28:50.000000000 +0100 +++ base/src/update-dpsyco-users 2004-08-29 11:23:21.000000000 +0100 @@ -42,5 +42,5 @@ echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then - echo "Del user $RU" + echo "dpsyco is deleting user $RU (moving $RU to $RU.disabled)" if [ "$SUDO_USER" == "$RU" -o "$USER" == "$RU" ] ; then echo "The script does not kick out any process that the admin runs." dpsyco-1.0.36/patches/dpsch-auto-cronapt.author0000664000175000017500000000004210366754012017602 0ustar olaolaTomas Fasth dpsyco-1.0.36/patches/dpsyco-better-unpatch-and-upgrade-fix.author0000664000175000017500000000004410366754012023266 0ustar olaolaOtavio Salvador dpsyco-1.0.36/patches/dpsch-auto-cronapt.diff0000664000175000017500000000133510366754012017216 0ustar olaola--- /usr/bin/dpsch-auto-cronapt~ Mon Apr 15 16:36:14 2002 +++ /usr/bin/dpsch-auto-cronapt Mon May 13 16:36:46 2002 @@ -20,16 +20,17 @@ PREFIX=6 -dpsch-listbinpkgs | { +dpsch-listbinpkgs | ( while read PKG ; do mkdir -p debian/$PKG/etc/cron-apt/action.d touch debian/$PKG/etc/cron-apt/action.d/$PREFIX-$PKG echo "--yes --fix-missing --show-upgraded --no-remove install $PKG" \ >> debian/$PKG/etc/cron-apt/action.d/$PREFIX-$PKG + umask 022 mkdir -p debian/$PKG/DEBIAN touch debian/$PKG/DEBIAN/conffiles if ! grep "/etc/cron-apt/action.d/$PREFIX-$PKG" debian/$PKG/DEBIAN/conffiles > /dev/null 2>&1 ; then echo "/etc/cron-apt/action.d/$PREFIX-$PKG" >> debian/$PKG/DEBIAN/conffiles fi done -} +) dpsyco-1.0.36/patches/dpsycoPatches20040829.tar.author0000664000175000017500000000070610366754012020325 0ustar olaolaFrom: Guy *SNIP* 1) I attach some patches including updated documentation etc for dpsyco, which are intended to help users who set UIDs from 500 onwards. *SNIP* 3) In order to reduce your support load greatly, it would be helpful to users if such a change to e.g. 600 were included as default in dpsyco. I have taken the liberty of describing this as ver 1.0.25 at the end of the FAQ; I trust you're OK with this. *SNIP* dpsyco-1.0.36/patches/fixbashisms.patch0000644000175000017500000000476210776476416016235 0ustar olaoladiff -ur dpsyco-1.0.34.orig/base/src/update-dpsyco-users dpsyco-1.0.34/base/src/update-dpsyco-users --- dpsyco-1.0.34.orig/base/src/update-dpsyco-users 2006-07-19 21:02:18.000000000 +0300 +++ dpsyco-1.0.34/base/src/update-dpsyco-users 2008-04-06 10:32:11.000000000 +0300 @@ -59,7 +59,7 @@ echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then echo "dpsyco is deleting user $RU (moving $RU to $RU.disabled)" - if [ "$SUDO_USER" == "$RU" -o "$USER" == "$RU" ] ; then + if [ "$SUDO_USER" = "$RU" -o "$USER" = "$RU" ] ; then echo "The script does not kick out any process that the admin runs." echo "FIX THIS MANUALLY:" echo "Log out the user and kill all its processes." diff -ur dpsyco-1.0.34.orig/base/src/update-dpsyco-users-shell dpsyco-1.0.34/base/src/update-dpsyco-users-shell --- dpsyco-1.0.34.orig/base/src/update-dpsyco-users-shell 2006-07-19 21:02:18.000000000 +0300 +++ dpsyco-1.0.34/base/src/update-dpsyco-users-shell 2008-04-06 10:31:57.000000000 +0300 @@ -50,7 +50,7 @@ else # User should not have shell access. if ! grep "^$U:X:" $SHDF > /dev/null 2>&1 ; then - if [ "$SUDO_USER" == "$U" -o "$USER" == "$U" ] ; then + if [ "$SUDO_USER" = "$U" -o "$USER" = "$U" ] ; then echo "Can not remove the password for the user you are logged in as." echo "So you have to do that manually by typing:" echo " usermod -p X $U" @@ -63,7 +63,7 @@ else # User should not have shell access. if ! grep "^$U:x:" $SHDF > /dev/null 2>&1 ; then - if [ "$SUDO_USER" == "$U" -o "$USER" == "$U" ] ; then + if [ "$SUDO_USER" = "$U" -o "$USER" = "$U" ] ; then echo "Can not remove the password for the user you are logged in as." echo "So you have to do that manually by typing:" echo " usermod -p x $U" diff -ur dpsyco-1.0.34.orig/src/update-twinspot-users dpsyco-1.0.34/src/update-twinspot-users --- dpsyco-1.0.34.orig/src/update-twinspot-users 2006-01-28 22:46:03.000000000 +0200 +++ dpsyco-1.0.34/src/update-twinspot-users 2008-04-06 10:32:40.000000000 +0300 @@ -63,7 +63,7 @@ echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then echo "Del user $RU" - if [ "$SUDO_USER" == "$RU" -o "$USER" == "$RU" ] ; then + if [ "$SUDO_USER" = "$RU" -o "$USER" = "$RU" ] ; then echo "The script does not kick out any process that the admin runs." echo "FIX THIS MANUALLY:" echo "Log out the user and kill all its processes." dpsyco-1.0.36/patches/sync-fix.patch0000664000175000017500000000070610571723525015436 0ustar olaolaTomas Fasth --- /usr/sbin/update-dpsyco-users-sshaccess-dist 2005-04-18 04:48:17.000000000 +0000 +++ /usr/sbin/update-dpsyco-users-sshaccess 2007-03-01 19:00:43.887604500 +0000 @@ -36,6 +36,7 @@ && [ "$user" != "+" ] \ && [ "$uid" != "" ] \ && [ $uid -le $LAST_UID ] \ + && grep -q \^$shell\$ /etc/shells \ && su $user -c "test -w $home" \ && find "$USERSRC"/*/"$user" -printf "" 2>/dev/null then dpsyco-1.0.36/ssh/0000775000175000017500000000000011047072017012010 5ustar olaoladpsyco-1.0.36/ssh/src/0000775000175000017500000000000011047072017012577 5ustar olaoladpsyco-1.0.36/ssh/src/update-dpsyco-users-sshaccess0000775000175000017500000000433210571723341020430 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-users-sshaccess 2402 2007-03-02 06:00:13Z ola $ # Author: $Author: ola $ # Date: $Date: 2007-03-02 07:00:13 +0100 (fre, 02 mar 2007) $ # Summary: # Updates the user access (via ssh). # # Copyright (C) 2001-2004 Ola Lundqvist # Copyright (C) 2007 Tomas Fasth # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Read the default dpsyco config. . /etc/dpsyco/defaults.conf TESTNFS="/ $DHOME" . /usr/share/dpsyco/checknfs.test # Users that exist in password file. IFS=: cat $PWDF | while read user junk uid gid gecos home shell ; do if [ "$user" != "" ] \ && [ "$user" != "+" ] \ && [ "$uid" != "" ] \ && grep -q \^$shell\$ /etc/shells \ && [ $uid -le $LAST_UID ] \ && su $user -c "test -w $home" \ && find "$USERSRC"/*/"$user" -printf "" 2>/dev/null then ISSH="$home/.ssh" RIDENT="$ISSH/identity" RIDENTP="$RIDENT.pub" DIDENT="$ISSH/id_dsa" DIDENTP="$DIDENT.pub" A1=authorized_keys AUTHK="$ISSH/$A1" A2=authorized_keys2 AUTHK2="$ISSH/$A2" if [ ! -e $RIDENTP -o ! -e $DIDENTP ] ; then echo "Gen authorized_keys for $user." if [ ! -e $RIDENTP ] ; then su $user -c "ssh-keygen -t rsa1 -N '' -f '$RIDENT'" fi if [ ! -e $DIDENTP ] ; then su $user -c "ssh-keygen -t dsa -N '' -f '$DIDENT'" fi fi if [ -e $ISSH ] ; then > "$AUTHK" find "$ISSH" "$USERSRC"/*/"$user" -name "*.pub" -type f \ | while read i ; do cat "$i" >> "$AUTHK" done fi if [ ! -e "$AUTHK2" ] ; then ln -s $A1 $AUTHK2 fi chown $uid.$gid $AUTHK chown $uid.$gid $AUTHK2 fi done dpsyco-1.0.36/ssh/man/0000775000175000017500000000000011047072017012563 5ustar olaoladpsyco-1.0.36/ssh/man/update-dpsyco-users-sshaccess.pod0000664000175000017500000000104210366754013021167 0ustar olaola=head1 NAME uppdate-dpsyco-users-sshaccess =head1 USAGE uppdate-dpsyco-users-sshaccess =head1 DESCRIPTION Searches for public keys in /usr/share/dpsyco/users. The information there will be added to the authorized_keys for the apropriate user and removed for the ones that should not have ssh access to the system. The public keys should have the extension .pub. Keys will also be generated for all users that have not already done that. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) ssh-keygen(1) =cut dpsyco-1.0.36/cfengine/0000775000175000017500000000000011047072017012771 5ustar olaoladpsyco-1.0.36/cfengine/man/0000775000175000017500000000000011047072017013544 5ustar olaoladpsyco-1.0.36/cfengine/man/update-dpsyco-cfengine.pod0000664000175000017500000000050110366754016020612 0ustar olaola=head1 NAME update-dpsyco-cdengine =head1 USAGE update-dpsyco-cdengine =head1 DESCRIPTION This tool will configure the system using the cfengine configuration scripts that it can find in /usr/share/dpsyco/cfengine. =head1 AUTHOR Ola Lundqvist =head1 SEE ALSO update-dpsyco(1) cfengine(1) =cut dpsyco-1.0.36/cfengine/src/0000775000175000017500000000000011047072017013560 5ustar olaoladpsyco-1.0.36/cfengine/src/update-dpsyco-cfengine0000775000175000017500000000241510457471652020061 0ustar olaola#!/bin/sh # DocumentId: $Id: update-dpsyco-cfengine 2318 2006-07-19 17:58:05Z ola $ # Author: $Author: ola $ # Date: $Date: 2006-07-19 19:58:05 +0200 (ons, 19 jul 2006) $ # Summary: # Apply cfengine configs. # # Copyright (C) 2001-2004 Ola Lundqvist # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # . /etc/dpsyco/defaults.conf TESTNFS="/" . /usr/share/dpsyco/checknfs.test if [ -d "$CFENGINESRC" ] ; then find $CFENGINESRC -depth -maxdepth 2 -type f -name "*.conf" | sort | { while read LINE ; do if ! cfengine -f $LINE ; then echo "ERROR occured when applying cfconfig $LINE." fi done } fi dpsyco-1.0.36/helpscripts/0000775000175000017500000000000011047072017013553 5ustar olaoladpsyco-1.0.36/helpscripts/manpod2text.sh0000775000175000017500000000106610366754015016372 0ustar olaola#!/bin/sh # This scripts content was contributed by: # Michael Boman # # Some things added to make it more useful. # Intended to be run from the source root dir. # Depends on: perldoc to run. # # You can give it one argument and that is where to place the files. tmp=tmp if [ ! -z "$1" ] ; then tmp="$1" fi if [ -d $tmp ] ; then rm -Rf $tmp fi mkdir $tmp cd $tmp # This is the contributed script. for file in `find .. -name "*.pod" -print`; do PERLDOC_PAGER=cat perldoc -t $file > `basename $file | sed s/pod/txt/g`; done dpsyco-1.0.36/src/0000775000175000017500000000000011047072017012002 5ustar olaoladpsyco-1.0.36/src/update-twinspot-users-samba0000775000175000017500000000701410366754013017327 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-users-samba 1074 2001-08-20 08:41:19Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-08-20 10:41:19 +0200 (mÃ¥n, 20 aug 2001) $ # Summary: # Updates the shell accounts. # Read the default twinspot config. . /usr/share/twinspot/defaults.conf . /usr/share/twinspot/change.func . /usr/share/twinspot/owner.func for TEST in / $DHOME /etc ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not add or remove users when $TEST is nfsmounted." exit 0 fi done if [ ! -e "$(which smbpasswd)" ] ; then echo "Samba not installed, skipping." exit 0 fi # Users that should have shell access. FUSERS=$(find $USERSRC -maxdepth 3 -path "$USERSRC/*/*" -type f -name "samba" | sed -e "s|/samba||;" | sed -e "s|.*/||;" | sort -u) if [ ! -e $SMBF ] ; then if [ ! -z "$FUSERS" ] ; then echo "# SMB password file, generated by update-twinspot-users-samba." > $SMBF chown 600 $SMBF else echo "No samba users to configure, skipping." exit 0 fi fi # Users that exist in smbpassword file. # NOTE! This line has to be after FUSERS= and the $SMBF checking routine. EUSERS=$(grep "^[^:]*:[^:]*:[5-9][0-9][0-9]:" $SMBF | sed -e "s|:.*||g;") # When removing a user do the following: # smbpasswd -x $USER for RU in $EUSERS ; do UPID=$(grep "^$RU:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if [ $UPID -ge 1000 ] ; then echo "User $RU is a ordinary user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif [ $UPID -lt 500 ] ; then echo "User $RU is a system user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then echo "Del user $RU from samba." smbpasswd -x $RU echo "Remove the profile information manually." fi done # Users that exist in smbpassword file. EUSERS=$(grep "^[^:]*:[^:]*:[5-9][0-9][0-9]:" $SMBF | sed -e "s|:.*||g;") # Modify the user information for all users that should and do exist. for U in $FUSERS ; do . $USERSC if [ -f $USERSRC/$U ] ; then . $USERSRC/$U fi if [ ! -z "$SMBCRYPT" ] ; then SMBCRT=$(echo "$SMBCRYPT" | sed -e "s|:.*||;") # User should have samba access. if ! grep "^$U:" $SMBF > /dev/null 2>&1 ; then echo "Adding user $U to smbpasswd." UPID=$(grep "^$U:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") echo "$U:$UPID:$SMBCRYPT" >> $SMBF elif ! grep "^$U:[0-9]*:$SMBCRT" $SMBF > /dev/null 2>&1 ; then echo "Updating password for user $U." SMBCR=$(echo "$SMBCRYPT" | sed -e "s/|/\\|/g;") changefile "s|^\($U:[0-9]*\):.*|\1:$SMBCR|;" $SMBF else # User should not have samba access. if ! grep "^$U:" $SMBF > /dev/null 2>&1 ; then echo "Samba not enabled for $U, removing user from smbpasswd." smbpasswd -x $U fi fi if [ -e /etc/samba/smb.conf ] ; then if grep "^$U:" $SMBF > /dev/null 2>&1 ; then # User should exist and cat /etc/samba/smb.conf | grep -A 20 "^[[:space:]]*\[profiles\]" | grep -B 20 "^[[:space:]]*\[[^p]" | grep "^[[:space:]]*path[[:space:]]*=[[:space:]]*" | sed -e "s|^[[:space:]]*path[[:space:]]*=[[:space:]]*||;" | { read PROFPATH if [ ! -z "$PROFPATH" ] ; then changeowner $U $U $PROFPATH/$U fi } fi fi else # User should not have samba access. if grep "^$U:" $SMBF > /dev/null 2>&1 ; then echo "No SMBCRYPT info for $U, removing user from smbpasswd." smbpasswd -x $U fi fi done dpsyco-1.0.36/src/update-twinspot0000775000175000017500000000107210366754013015105 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot 1088 2001-08-24 15:20:57Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-08-24 17:20:57 +0200 (fre, 24 aug 2001) $ # Summary: # Updates the twinspot base. echo "Updating twinspot system configuration." export PATH=$PATH:/sbin:/usr/sbin update-twinspot-skel update-twinspot-users-sudoers update-twinspot-users update-twinspot-groups update-twinspot-users-skel update-twinspot-users-sshaccess update-twinspot-users-shell update-twinspot-users-samba find /usr/share/twinspot/updatecmd -maxdepth 1 -type f -exec {} \; dpsyco-1.0.36/src/update-twinspot-users0000775000175000017500000001276210776476563016274 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-users 2576 2008-04-07 20:00:51Z ola $ # Author: $Author: ola $ # Date: $Date: 2008-04-07 22:00:51 +0200 (mÃ¥n, 07 apr 2008) $ # Summary: # Updates the twinspot base users. # When adding a user, just do adduser --disabled-password $USER # With name from /usr/share/twinspot/users/$USER if that file exist. # If not the name is the same as the login. # Read the default twinspot config. . /usr/share/twinspot/defaults.conf . /usr/share/twinspot/change.func . /usr/share/twinspot/owner.func TUSERCFG=/etc/twinspot/adduser.conf.user TUDIR=/etc/twinspot/adduser for TEST in / $DHOME /etc /var /var/mail /var/spool/mail ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not add or remove users when $TEST is nfsmounted." exit 0 fi done LAST_SYSTEM_UID=$(($BASE_UID-1)) if ! grep "LAST_SYSTEM_UID=$LAST_SYSTEM_UID" $ADDUSERCFG > /dev/null 2>&1 ; then echo "Updates $ADDUSERCFG and sets LAST_SYSTE_UID=$LAST_SYSTEM_UID." changefile \ "s|LAST_SYSTEM_UID=[0-9]*|LAST_SYSTEM_UID=$LAST_SYSTEM_UID|g;" \ $ADDUSERCFG fi LAST_UID=$(($FIRST_UID-1)) FIRST_UID=$BASE_UID cat $ADDUSERCFG | sed -e " s|LAST_UID=[0-9]*|LAST_UID=$LAST_UID|g; s|FIRST_UID=[0-9]*|FIRST_UID=$FIRST_UID|g;" > $TUSERCFG # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:[5-9][0-9][0-9]:" $PWDF | sed -e "s|:.*||g;") # Users that should exist. FUSERS=$(find $USERSRC -maxdepth 2 -path "$USERSRC/*/*" -type d | sed -e "s|/CVS||;" | sed -e "s|.*/||;" | sort -u) # When removing a user do the following: # * Sparka ut användaren, ps & kill. # * Ta bort (flytta?) $DHOME/$USER/.ssh/authorized_keys # * userdel $USER # * Tarra ner $DHOME/$USER till $DHOME/user.tar.gz. # * Ta bort $DHOME/$USER for RU in $EUSERS ; do UPID=$(grep "^$RU:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if [ $UPID -ge 1000 ] ; then echo "User $RU is a ordinary user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif [ $UPID -lt 500 ] ; then echo "User $RU is a system user and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FUSERS" | grep "^$RU$" > /dev/null 2>&1 ; then echo "Del user $RU" if [ "$SUDO_USER" = "$RU" -o "$USER" = "$RU" ] ; then echo "The script does not kick out any process that the admin runs." echo "FIX THIS MANUALLY:" echo "Log out the user and kill all its processes." echo "Run the following commands (as root, using an other admin account):" echo " userdel $RU" if [ -d $DHOME/$RU ] ; then echo " /usr/sbin/twinspot-delhome $RU &" fi if [ -e /var/mail/$RU ] ; then echo " mv /var/mail/$RU $DHOME/$RU.mail" fi if [ -e /var/spool/mail/$RU ] ; then echo " mv /var/spool/mail/$RU $DHOME/$RU.mailspool" fi else # First kill all root processes. ps --user $RU -H | grep -v "^[[:space:]]*PID" | grep "[[:space:]]*[0-9][0-9]*[[:space:]][^[:space:]][^[:space:]]*[[:space:]][[:space:]]*[0-9][0-9]:[0-9][0-9]:[0-9][0-9][[:space:]][^[:space:]]" | sed -e "s|[[:space:]]*\([0-9][0-9]*\).*|\1|;" | { while read -e PL ; do kill $PL done } sleep 1 # Then kill all processes that did not want to be killed. ps --user $RU | grep -v "^[[:space:]]*PID" | sed -e "s|^[[:space:]]*\([0-9][0-9]*\).*|\1|;" | { while read -e PL ; do kill -9 $PL done } userdel $RU if [ -d $DHOME/$RU ] ; then /usr/sbin/twinspot-delhome $RU & fi if [ -e /var/mail/$RU ] ; then mv /var/mail/$RU $DHOME/$RU.mail fi if [ -e /var/spool/mail/$RU ] ; then mv /var/spool/mail/$RU $DHOME/$RU.mailspool fi fi fi done # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:[5-9][0-9][0-9]:" $PWDF | sed -e "s|:.*||g;") # Who should be added to or modified in the passwd file. for AU in $FUSERS ; do . $USERSC if [ -f $USERSRC/$AU ] ; then . $USERSRC/$AU fi UPID=$(grep "^$AU:" $PWDF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|;") if ! echo "$EUSERS" | grep "^$AU$" > /dev/null 2>&1 ; then # If the user is not in the passwd file. if grep "^$AU:" $PWDF > /dev/null 2>&1 ; then if [ $UPID -ge 100 ] ; then echo "User $AU ($UPID) does already exist, FIX THIS MANUALLY!!!" fi else # CREATING USER. adduser --conf $TUSERCFG --gecos "$NAME" --disabled-password $AU if [ -f $DHOME/$AU.tar.gz ] ; then cd / echo "Restore user ($AU) home directory." tar xfz $DHOME/$AU.tar.gz fi changeowner $AU $AU "$DHOME/$AU" if [ -f $DHOME/$AU.mail ] ; then echo "Restore user $AU incoming mail." if [ -e /var/mail/$AU ] ; then cat $DHOME/$AU.mail >> /var/mail/$AU rm $DHOME/$AU.mail else mv $DHOME/$AU.mail /var/mail/$AU fi changeowner $AU mail "/var/mail/$AU" fi if [ -f $DHOME/$AU.mailspool ] ; then echo "Restore user $AU incoming mailspool." if [ -e /var/spool/mail/$AU ] ; then cat $DHOME/$AU.mailspool >> /var/spool/mail/$AU rm $DHOME/$AU.mailspool else mv $DHOME/$AU.mailspool /var/spool/mail/$AU fi changeowner $AU mail "/var/spool/mail/$AU" fi fi else changeowner $AU mail "/var/spool/mail/$AU" changeowner $AU mail "/var/mail/$AU" if ! grep "^$AU:[^:]*:[^:]*:[^:]*:$NAME" $PWDF > /dev/null 2>&1 ; then if [ $UPID -ge 1000 ] ; then echo "User $AU is a ordinary user and should not be changed." else echo "Changing information for user $AU." usermod -c "$NAME" $AU fi fi fi done dpsyco-1.0.36/src/update-twinspot-groups0000775000175000017500000000445010366754013016425 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-groups 1055 2001-08-08 14:04:00Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-08-08 16:04:00 +0200 (ons, 08 aug 2001) $ # Summary: # Updates the twinspot base groups. # Read the default twinspot config. . /usr/share/twinspot/defaults.conf . /usr/share/twinspot/change.func for TEST in / /etc ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not add or remove groups when $TEST is nfsmounted." exit 0 fi done # Groups that exist in password file. EGROUPS=$(grep "^[^:]*:[^:]*:[3-4][0-9][0-9]:" $GRPF | sed -e "s|:.*||g;") # Groups that should exist. FGROUPS=$(find $GROUPSRC -maxdepth 3 -path "$GROUPSRC/*/*/exist" -type f | sed -e "s|/CVS||;" | sed -e "s|/exist||;" | sed -e "s|.*/||;" | sort -u) # Who should be added or changed. for AG in $FGROUPS ; do . $GROUPSC if [ -f $GROUPSRC/$AG ] ; then . $GROUPSRC/$AG fi if ! echo "$EGROUPS" | grep "^$AG$" > /dev/null 2>&1 ; then if grep "^$AG:" $GRPF > /dev/null 2>&1 ; then GPID=$(grep "^$AG:" $GRPF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|") if [ $GPID -ge 100 ] ; then echo "Group $AG ($GPID) does already exist, FIX THIS MANUALLY!!!" fi else SEGID=300 while [ -z "$FOUND" ] ; do if ! grep "^[^:]*:[^:]:$SEGID:" $GRPF > /dev/null 2>&1 ; then groupadd -g $SEGID $AG FOUND=yes fi SEGID=$(($SEGID+1)) done fi fi changefile "s|^\($AG:[^:]*:[0-9]*:\).*|\1|;" $GRPF find $GROUPSRC -maxdepth 3 -path "$GROUPSRC/*/$AG/members" -type f -exec cat {} \; | sort -u | { while read -e U ; do if [ ! -z "$U" ] ; then adduser --quiet $U $AG fi done } done # When removing a group do the following: # * groupdel $GROUP for RG in $EGROUPS ; do GPID=$(grep "^$RG:" $GRPF | sed -e "s|^[^:]*:[^:]*:\([^:]*\):.*|\1|") if [ $GPID -ge 500 ] ; then echo "Group $RG is a ordinary group and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif [ $GPID -lt 300 ] ; then echo "Group $RG is a system group and should not be removed." echo "THIS SHOULD NEVER HAPPEN, error in update script." elif ! echo "$FGROUPS" | grep "^$RG$" > /dev/null 2>&1 ; then echo "Del group $RG" groupdel $RG fi done dpsyco-1.0.36/src/twinspot-delhome0000775000175000017500000000046310366754013015243 0ustar olaola#!/bin/sh # DocumentId: $Id: twinspot-delhome 964 2001-07-16 12:00:20Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-07-16 14:00:20 +0200 (mÃ¥n, 16 jul 2001) $ # Summary: # Deletes the user home directory. . /etc/adduser.conf tar czf $DHOME/$1.tar.gz $DHOME/$1 > /dev/null 2>&1 rm -Rf $DHOME/$1 dpsyco-1.0.36/src/update-twinspot-users-sudoers0000775000175000017500000000227510366754013017734 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-users-sudoers 1009 2001-07-29 11:42:23Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-07-29 13:42:23 +0200 (sön, 29 jul 2001) $ # Summary: # Updates the twinspot base administrators (sudoers). SUDOERSF=/etc/sudoers SUDOSRC=/usr/share/twinspot-base/sudoers # Read the twinspot default config. . /usr/share/twinspot/defaults.conf for TEST in / /etc ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not regenerate sudoers when $TEST is nfsmounted." exit 0 fi done cd $USERSRC if [ -f $SUDOSRC ] ; then cp -f $SUDOSRC $SUDOERSF else echo "root ALL=(ALL) ALL" > $SUDOSRC fi chmod 0440 $SUDOERSF for P in * ; do if [ -d $P -a "$P" != "." -a "$P" != ".." -a "$P" != "CVS" ] ; then cd $P for U in * ; do if [ -d $U -a "$U" != "." -a "$U" != ".." -a "$P" != "CVS" ] ; then if [ -f $U/sudo ] ; then cat $U/sudo | sed -e "s/#.*//" | grep -v "^$" | { while read -e SL ; do if ! grep "$U $SL" $SUDOERSF > /dev/null 2>&1 ; then echo "$U $SL" >> $SUDOERSF fi done } fi fi done cd .. fi done dpsyco-1.0.36/src/update-twinspot-skel0000775000175000017500000000176010366754013016045 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-skel 982 2001-07-25 10:53:21Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-07-25 12:53:21 +0200 (ons, 25 jul 2001) $ # Summary: # Updates the twinspot base users. # When adding a user, just do adduser --disabled-password $USER # With name from /usr/share/twinspot/users/$USER if that file exist. # If not the name is the same as the login. # Read the default twinspot config. . /usr/share/twinspot/defaults.conf TUSERCFG=/etc/twinspot/adduser.conf.user TUDIR=/etc/twinspot/adduser # Read the adduser config file. . $ADDUSERCFG for TEST in / /etc ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not add or remove users when $TEST is nfsmounted." exit 0 fi done if [ -d $SKELSRC ] ; then rsync -a -I $SKELSRC/ / fi if [ -d $PATCHSRC ] ; then export PATCHDEST=/ find $PATCHSRC -type d -name "*.patch" -exec twinspot-patch {} \; fi dpsyco-1.0.36/src/update-twinspot-users-shell0000775000175000017500000000333710366754013017357 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-users-shell 1017 2001-07-29 12:52:06Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-07-29 14:52:06 +0200 (sön, 29 jul 2001) $ # Summary: # Updates the shell accounts. # Read the default twinspot config. . /usr/share/twinspot/defaults.conf for TEST in / $DHOME /etc ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not add or remove users when $TEST is nfsmounted." exit 0 fi done # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:[5-9][0-9][0-9]:" $PWDF | sed -e "s|:.*||g;") # Users that should have shell access. FUSERS=$(find $USERSRC -maxdepth 3 -path "$USERSRC/*/*" -type f -name "shell" | sed -e "s|/shell||;" | sed -e "s|.*/||;" | sort -u) for U in $EUSERS ; do # Modify the user information for all users that should exist. . $USERSC if [ -f $USERSRC/$U ] ; then . $USERSRC/$U fi if [ ! -z "$CRYPT" ] ; then if echo "$FUSERS" | grep "^$U\$" > /dev/null 2>&1 ; then # User should have shell access. if ! grep "^$U:$CRYPT:" $SHDF > /dev/null 2>&1 ; then echo "Updating password for user $U." usermod -p "$CRYPT" $U fi else # User should not have shell access. if ! grep "^$U:X:" $SHDF > /dev/null 2>&1 ; then echo "Updating password for user $U (no shell access)." usermod -p "X" $U fi fi else # User should not have shell access. if ! grep "^$U:x:" $SHDF > /dev/null 2>&1 ; then echo "Updating password for user $U (no password found)." usermod -p "x" $U fi fi if [ ! -z "$SHELL" ] ; then if ! grep ":$SHELL\$" $PWDF > /dev/null 2>&1 ; then usermod -s $SHELL $U fi fi done dpsyco-1.0.36/src/update-twinspot-users-skel0000775000175000017500000000325210366754013017202 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-users-skel 1076 2001-08-20 08:45:21Z olalu $ # Author: $Author: olalu $ # Date: $Date: 2001-08-20 10:45:21 +0200 (mÃ¥n, 20 aug 2001) $ # Summary: # Updates the twinspot base users skeleton, and patch if needed. # Read the default twinspot config. . /usr/share/twinspot/defaults.conf . /usr/share/twinspot/change.func . /usr/share/twinspot/owner.func for TEST in / $DHOME /etc ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not add or remove users when $TEST is nfsmounted." exit 0 fi done # Users that exist in password file. EUSERS=$(grep "^[^:]*:[^:]*:[5-9][0-9][0-9]:" $PWDF | sed -e "s|:.*||g;") for U in $EUSERS ; do . $USERSC if [ -f $USERSRC/$U ] ; then . $USERSRC/$U fi if [ -d "$DHOME/$U" ] ; then if [ -d "$USERSKELSRC" ] ; then rsync -rlptD -I "$USERSKELSRC/" /etc/skel rsync -rlptD -I "$USERSKELSRC/" "$DHOME/$U" export PATCHDEST="$DHOME/$U" find $USERSKELSRC -path "$USERSKELSRC/*/$U/*" -type f -name "*.patch" -exec twinspot-patch {} \; fi changeowner $U $U "$DHOME/$U" if [ ! -z "$EMAIL" ] ; then PROFILE="$DHOME/$U/.bash_profile" if grep "^EMAIL=" /dev/null 2>&1 ; then changefile "s|\(EMAIL=.*\)|export \1|;" $PROFILE fi if grep "export[[:space:]][[:space:]]*EMAIL=" $PROFILE > /dev/null 2>&1 ; then if ! grep grep "export[[:space:]][[:space:]]*EMAIL='$EMAIL'" $PROFILE > /dev/null 2>&1 ; then changefile "s|export[[:space:]][[:space:]]*EMAIL=.*|export EMAIL='$EMAIL'|;" $PROFILE fi else echo "export EMAIL='$EMAIL'" >> $PROFILE fi fi fi done dpsyco-1.0.36/src/update-twinspot-users-sshaccess0000775000175000017500000000233410366754013020223 0ustar olaola#!/bin/sh # DocumentId: $Id: update-twinspot-users-sshaccess 1051 2001-08-08 13:19:55Z tomfa $ # Author: $Author: tomfa $ # Date: $Date: 2001-08-08 15:19:55 +0200 (ons, 08 aug 2001) $ # Summary: # Updates the twinspot base user access (via ssh). # Read the default twinspot config. . /usr/share/twinspot/defaults.conf for TEST in / $DHOME ; do if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then echo "Does not regenerate authorized_keys when $TEST is nfsmounted." exit 0 fi done # Users that exist in password file. IFS=: cat $PWDF | while read user junk uid gid gecos home shell ; do if [ "$user" != "" ] \ && [ "$uid" != "" ] \ && [ $uid -lt 1000 ] \ && sudo -u $user test -w $home \ && find "$USERSRC"/*/"$user" -printf "" 2>/dev/null then ISSH="$home/.ssh" IDENT="$ISSH/identity" IDENTP="$IDENT.pub" AUTHK="$ISSH/authorized_keys" if [ ! -e $IDENTP ] ; then echo "Gen authorized_keys for $user." sudo -H -u $user ssh-keygen -N "" -f "$IDENT" fi if [ -e $ISSH ] ; then > "$AUTHK" find "$ISSH" "$USERSRC"/*/"$user" -name "*.pub" -type f \ | while read i ; do cat "$i" >> "$AUTHK" done fi fi done dpsyco-1.0.36/src/twinspot-patch0000775000175000017500000000151610366754013014725 0ustar olaola#!/bin/sh # DocumentId: $Id: twinspot-patch 975 2001-07-17 13:22:01Z olalu $ # Author: $Author: olalu $ # Ola Lundqvist # Date: $Date: 2001-07-17 15:22:01 +0200 (tis, 17 jul 2001) $ # Arguments: A list of patch files. # Summary: # Patches a file structure. if [ ! -z "PATCHDEST" ] ; then cd "$PATCHDEST" fi TF=/etc/twinspot/twinspot-patch for PF in $*; do if [ ! -f $PF ] ; then echo "Can not find patch file $1." else echo "Autopatch using $FP." FILES=$(grep "^+++ " $PF | sed -e "s|^+++ ||" | sed "s|[[:space:]].*||") if [ -e $TF ] ; then rm -f $TF fi echo "#\!/bin/sh" > $TF for $FILE in $FILES ; do find $FILE -prune -printf "chown %u.%g %p\nchmod %m %p\n" >> $TF done patch -s -t -T -p0 -i $PF if [ -e $TF ] ; then chmod +x $TF $TF rm -f $TF fi fi done dpsyco-1.0.36/debian/0000775000175000017500000000000011047072017012435 5ustar olaoladpsyco-1.0.36/debian/dpsyco-ssh.dirs0000664000175000017500000000001710366754012015417 0ustar olaolaetc/dpsyco/cmd dpsyco-1.0.36/debian/dpsyco-devel.dirs0000664000175000017500000000007210366754012015722 0ustar olaolausr/share/dpsyco-devel/genpkg/example etc/dpsyco/examples dpsyco-1.0.36/debian/rules0000775000175000017500000001220010457472054013521 0ustar olaola#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatability version to use. export DH_COMPAT=4 export DEST=$(CURDIR)/debian/dpsyco export DESTBASE=$(CURDIR)/debian/dpsyco-base export DESTLIB=$(CURDIR)/debian/dpsyco-lib export DESTDEVEL=$(CURDIR)/debian/dpsyco-devel export DESTSKEL=$(CURDIR)/debian/dpsyco-skel export DESTSUDO=$(CURDIR)/debian/dpsyco-sudo export DESTPATCH=$(CURDIR)/debian/dpsyco-patch export DESTSSH=$(CURDIR)/debian/dpsyco-ssh export DESTDOC=$(CURDIR)/debian/dpsyco-doc export DESTMYSQL=$(CURDIR)/debian/dpsyco-mysql export DESTSAMBA=$(CURDIR)/debian/dpsyco-samba export DESTCFENGINE=$(CURDIR)/debian/dpsyco-cfengine configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: configure-stamp build-stamp build-stamp: dh_testdir # Add here commands to compile the package. $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. -$(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into dpsyco. # None, meta package. #export DEST=$(CURDIR)/debian/dpsyco # Add here commands to install the package into dpsyco-base. #export DESTBASE=$(CURDIR)/debian/dpsyco-base ./install $(DESTBASE) base mkdir -p $(DESTBASE)/etc/logcheck/ignore.d.server cp base/logcheck/server $(DESTBASE)/etc/logcheck/ignore.d.server/dpsyco-base mkdir -p $(DESTBASE)/etc/logcheck/ignore.d.workstation cp base/logcheck/workstation $(DESTBASE)/etc/logcheck/ignore.d.workstation/dpsyco-base ln -s /usr/sbin/update-dpsyco-users $(DESTBASE)/etc/dpsyco/cmd/R05users ln -s /usr/sbin/update-dpsyco-groups $(DESTBASE)/etc/dpsyco/cmd/R15groups ln -s /usr/sbin/update-dpsyco-users-shell $(DESTBASE)/etc/dpsyco/cmd/R15users-shell cp -f debian/apt.conf $(DESTBASE)/etc/apt/apt.conf.d/90dpsyco # Add here commands to install the package into dpsyco-lib. #export DESTLIB=$(CURDIR)/debian/dpsyco-lib ./install $(DESTLIB) lib # Add here commands to install the package into dpsyco-devel. #export DESTDEVEL=$(CURDIR)/debian/dpsyco-devel ./install $(DESTDEVEL) devel cp -aRf devel/example/* $(DESTDEVEL)/usr/share/dpsyco-devel/genpkg/example mkdir -p $(DESTDEVEL)/usr/share/lintian/overrides install -m644 debian/dpsyco-devel.lintian-override $(DESTDEVEL)/usr/share/lintian/overrides/dpsyco-devel # install examples to usr/share/dpsyco-devel/genpkg/debian # Add here commands to install the package into dpsyco-skel. #export DESTSKEL=$(CURDIR)/debian/dpsyco-skel ./install $(DESTSKEL) skel ln -s /usr/sbin/update-dpsyco-skel $(DESTSKEL)/etc/dpsyco/cmd/R20skel ln -s /usr/sbin/update-dpsyco-users-skel $(DESTSKEL)/etc/dpsyco/cmd/R22users-skel # Add here commands to install the package into dpsyco-sudo. #export DESTSUDO=$(CURDIR)/debian/dpsyco-sudo ./install $(DESTSUDO) sudo ln -s /usr/sbin/update-dpsyco-users-sudoers $(DESTSUDO)/etc/dpsyco/cmd/R10users-sudoers # Add here commands to install the package into dpsyco-patch. #export DESTPATCH=$(CURDIR)/debian/dpsyco-patch ./install $(DESTPATCH) patch ln -s /usr/sbin/update-dpsyco-patch $(DESTPATCH)/etc/dpsyco/cmd/R45patch ln -s /usr/sbin/update-dpsyco-users-patch $(DESTPATCH)/etc/dpsyco/cmd/R45users-patch # Add here commands to install the package into dpsyco-ssh. #export DESTSSH=$(CURDIR)/debian/dpsyco-ssh ./install $(DESTSSH) ssh ln -s /usr/sbin/update-dpsyco-users-sshaccess $(DESTSSH)/etc/dpsyco/cmd/R30users-sshaccess # Add here commands to install the package into dpsyco-doc. #export DESTDOC=$(CURDIR)/debian/dpsyco-doc # Add here commands to install the package into dpsyco-mysql. #export DESTMYSQL=$(CURDIR)/debian/dpsyco-mysql ./install $(DESTMYSQL) mysql #ln -s /usr/sbin/update-dpsyco-... $(DESTBASE)/etc/dpsyco/cmd/R20skel # Add here commands to install the package into dpsyco-samba. #export DESTSAMBA=$(CURDIR)/debian/dpsyco-samba ./install $(DESTSAMBA) samba ln -s /usr/sbin/update-dpsyco-users-samba $(DESTSAMBA)/etc/dpsyco/cmd/R30samba # Add here commands to install the package into dpsyco-cfengine. #export DESTCFENGINE=$(CURDIR)/debian/dpsyco-cfengine ./install $(DESTCFENGINE) cfengine ln -s /usr/sbin/update-dpsyco-cfengine $(DESTCFENGINE)/etc/dpsyco/cmd/R50cfengine # Remove all CVS information. devel/src/dpsch-cvsclean devel/src/dpsch-backupclean binary-arch: # Build architecture-independent files here. binary-indep: build install dh_testdir -i dh_testroot -i # dh_installdebconf -i dh_installdocs -i dh_installexamples -i dh_installmenu -i # dh_installlogrotate -i # dh_installemacsen -i # dh_installpam -i # dh_installmime -i # dh_installinit -i # dh_installcron -i # dh_installman -i # dh_installinfo -i # dh_undocumented -i dh_installchangelogs -i dh_link -i dh_strip -i dh_compress -i dh_fixperms -i # dh_makeshlibs -i dh_installdeb -i # dh_perl -i # dh_shlibdeps -i dh_gencontrol -i dh_md5sums dh_builddeb binary: binary-indep .PHONY: build clean binary-indep binary install configure dpsyco-1.0.36/debian/dpsyco-lib.postinst0000664000175000017500000000704210366754012016317 0ustar olaola#! /bin/sh # postinst script for dpsyco # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) ############################################################################# ######################### Adduser config generation ######################### ############################################################################# . /etc/dpsyco/defaults.conf if [ ! -e $DPADDUSERCFG ] ; then ADDUSERCFG=/etc/adduser.conf . $ADDUSERCFG . /usr/share/dpsyco/change.func LAST_SYSTEM_UID=$(($BASE_UID-1)) if ! grep "LAST_SYSTEM_UID=$LAST_SYSTEM_UID" $ADDUSERCFG > /dev/null 2>&1 ; then echo "Updates $ADDUSERCFG and sets LAST_SYSTEM_UID=$LAST_SYSTEM_UID." changefile \ "s|LAST_SYSTEM_UID=[0-9]*|LAST_SYSTEM_UID=$LAST_SYSTEM_UID|g;" \ $ADDUSERCFG fi LAST_UID=$(($FIRST_UID-1)) FIRST_UID=$BASE_UID echo "# This file was automaticly generated from /etc/adduser.conf."\ > $DPADDUSERCFG echo "# So if you change this file you have to change that file"\ >> $DPADDUSERCFG echo "# acordingly." \ >> $DPADDUSERCFG cat $ADDUSERCFG | sed -e " s|LAST_UID=[0-9]*|LAST_UID=$LAST_UID|g; s|FIRST_UID=[0-9]*|FIRST_UID=$FIRST_UID|g;" >> $DPADDUSERCFG fi if ! grep "FIRST_GID=" $DPADDUSERCFG > /dev/null 2>&1 ; then echo "" >> $DPADDUSERCFG echo "# The first GID to be used when autocreating a new group." \ >> $DPADDUSERCFG echo "FIRST_GID=300" >> $DPADDUSERCFG fi if ! grep "UID_MATCH=" $DPADDUSERCFG > /dev/null 2>&1 ; then echo "" >> $DPADDUSERCFG echo "# The UID match to use. NOTE that it is only possible to" \ >> $DPADDUSERCFG echo "# have UID ranges for whole 100 or 1000 number ranges." \ >> $DPADDUSERCFG echo "UID_MATCH=[5-9][0-9][0-9]" >> $DPADDUSERCFG fi if ! grep "GID_MATCH=" $DPADDUSERCFG > /dev/null 2>&1 ; then echo "" >> $DPADDUSERCFG echo "# The GID match to use. NOTE that it is only possible to" \ >> $DPADDUSERCFG echo "# have GID ranges for whole 100 or 1000 number ranges." \ >> $DPADDUSERCFG echo "GID_MATCH=[3-4][0-9][0-9]" >> $DPADDUSERCFG fi ############################################################################# #################### Permissions to fix some security flaws ################# ############################################################################# chmod o+x /etc/dpsyco chmod o+x /usr/share/dpsyco chmod o-rw /usr/share/dpsyco chmod o-rw /etc/dpsyco ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/copyright0000664000175000017500000000221411047071733014373 0ustar olaolaThis package was debianized by Ola Lundqvist on Mon, 2 Jul 2001 12:21:43 +0200. Copyright: Copyright (C) 2000-2004,2008 Ola Lundqvist Copyright (C) 2008 Eric Gerlach Copyright (C) 2002,2007 Tomas Fasth Copyright (C) 2004 Guy Copyright (C) 2003 Otavio Salvador This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License with your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with the dpkg source package as the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. dpsyco-1.0.36/debian/dpsyco-lib.prerm0000664000175000017500000000414010366754012015555 0ustar olaola#! /bin/sh # prerm script for dpsyco # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ case "$1" in remove|deconfigure) if [ -e /usr/sbin/update-dpsyco ] ; then /usr/sbin/update-dpsyco fi if [ -f /etc/apt/apt.conf ] ; then if [ -f /etc/apt/apt.conf.d/90dpsyco ] ; then cat /etc/apt/apt.conf.d/90dpsyco | { while read LINE ; do LINEM=$(echo "$LINE" | sed -e "s|[[:space:]][[:space:]]*|[[:space:]][[:space:]]*|g;") if grep "$LINEM" /etc/apt/apt.conf > /dev/null 2>&1 ; then cp -a /etc/apt/apt.conf /etc/apt/apt.conf.tmp cat /etc/apt/apt.conf | grep -v "$LINEM" > /etc/apt/apt.conf rm /etc/apt/apt.conf.tmp fi done } fi fi ############################################################################# ######################### Adduser config changing ########################### ############################################################################# if [ -f /etc/dpsyco/defaults.conf ] ; then . /etc/dpsyco/defaults.conf if [ ! -e $DPADDUSERCFG ] ; then ADDUSERCFG=/etc/adduser.conf . /usr/share/dpsyco/change.func LAST_SYSTEM_UID=29999 if ! grep "LAST_SYSTEM_UID=$LAST_SYSTEM_UID" $ADDUSERCFG > /dev/null 2>&1 ; then echo "Updates $ADDUSERCFG and sets LAST_SYSTEM_UID=$LAST_SYSTEM_UID." changefile \ "s|LAST_SYSTEM_UID=[0-9]*|LAST_SYSTEM_UID=$LAST_SYSTEM_UID|g;" \ $ADDUSERCFG fi fi fi ;; upgrade) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/apt.conf0000664000175000017500000000016510366754012014077 0ustar olaola// All dpsyco packages should be updated after installation. DPkg::Post-Invoke {"/usr/sbin/update-dpsyco || true";}; dpsyco-1.0.36/debian/dpsyco-skel.postinst0000664000175000017500000000245510366754012016512 0ustar olaola#! /bin/sh # postinst script for dpsyco-skel # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) chmod o-rwx /usr/share/dpsyco/skel chmod o-rwx /usr/share/dpsyco/userskel ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/dpsyco-sudo.postinst0000664000175000017500000000320510366754012016520 0ustar olaola#! /bin/sh # postinst script for dpsyco-sudo # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) ############################################################################# ######################### Sudo default handling ############################# ############################################################################# SUDOERSF=/etc/sudoers SUDOSRC=/etc/dpsyco/sudoers . /etc/dpsyco/defaults.conf if [ ! -e "$SUDOSRC" ] ; then if [ -f "$SUDOERSF" ] ; then cp -a $SUDOERSF $SUDOSRC fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/dpsyco-patch.dirs0000664000175000017500000000022310366754012015720 0ustar olaolausr/share/dpsyco/patch usr/share/dpsyco/userpatch usr/share/dpsyco-patch etc/dpsyco/cmd etc/dpsyco/patch etc/dpsyco/userpatch var/lib/dpsyco-patch dpsyco-1.0.36/debian/dpsyco-skel.postrm0000664000175000017500000000171710366754012016153 0ustar olaola#! /bin/sh # postrm script for dpsyco-skel # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see /usr/share/doc/packaging-manual/ case "$1" in purge) if [ -d /var/lib/dpsyco-skel ] ; then rm -Rf /var/lid/dpsyco-skel fi ;; remove) ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# dpsyco-1.0.36/debian/dpsyco-base.dirs0000664000175000017500000000012210366754012015531 0ustar olaolaetc/dpsyco/cmd etc/apt/apt.conf.d/ usr/share/dpsyco/users usr/share/dpsyco/groups dpsyco-1.0.36/debian/control0000664000175000017500000001327510506137523014053 0ustar olaolaSource: dpsyco Section: admin Priority: extra Maintainer: Ola Lundqvist Build-Depends-Indep: perl-doc Build-Depends: debhelper (>> 4.0.0) Standards-Version: 3.7.2 Package: dpsyco Architecture: all Depends: dpsyco-base, dpsyco-lib (>= 1.0.21), adduser Recommends: dpsyco-skel, dpsyco-patch, dpsyco-sudo Suggests: dpsyco-devel, dpsyco-ssh, dpsyco-mysql, debarchiver Description: Debian packages of system configurations Dpsyco introduces the concept of configuration packages. It is a special form of debian packages that is applied on top of the original debian packages. With this you can add users, groups, apply a file skeleton, patch things and more. Observe! No such configuration packages should be uploaded to the debian archives. This kind of things are intended to be created and used by the system administrator only. . For more information see http://www.opal.dhs.org/programs/dpsyco/. . This tool is very useful if you have a lot of servers on which you want to have similar configuration (but not identical). If you only have one server (or client) this is probably not useful at all. . WARNING! Users with UID and GID between 500 and 999 will be automatically administrated by this tool. This means that if you do not have a admin package that set up users these users WILL BE REMOVED. Groups with GID between 300 and 499 will be handled in the same way. YOU HAVE BEEN WARNED! Package: dpsyco-base Architecture: all Depends: dpsyco-lib (>= 1.0.9) Conflicts: dpsyco-lib (<< 1.0.9) Description: Base package for the debian packages of system configurations The base package for dpsyco. It makes it possible to create users and groups. It also contains some basic configuration files. . WARNING! Users with UID and GID between 500 and 999 will be automatically administrated by this tool. This means that if you do not have a admin package that set up users these users WILL BE REMOVED. Groups with GID between 300 and 499 will be handled in the same way. YOU HAVE BEEN WARNED! Package: dpsyco-lib Architecture: all Depends: rsync, adduser Conflicts: dpsyco-base (<< 1.0.5), dpsyco-patch (<< 1.0.21) Suggests: patch Description: Libraries for the debian packages of system configurations It contains a couple of shell functions and other useful tools to make all dpsyco utils work as it should. Package: dpsyco-skel Architecture: all Depends: dpsyco-lib (>= 1.0.9), rsync Description: Automatically install a add-on skeleton Makes it possible to create a package that updates the system with the skel installed to /usr/share/dpsyco/skel. . This makes it possible to overwrite files (on top of) the ordinary debian file system. When the file is removed from this skeleton the original file will also be restored. If there were no original file it will be removed. . You can also use Replaces in the control field of a package to make similar functionality of this package. Package: dpsyco-patch Architecture: all Depends: dpsyco-lib (>= 1.0.23), patch Suggests: dpsyco-skel Description: Automatically patch the debian file-system Makes it possible to apply patches to the debian file system. It can be useful when a lot of configuration packages want to make changes to the same file. But be aware of that you can cause conflicts if you make changes on two different packages. Package: dpsyco-devel Architecture: all Depends: dpsyco-lib (>= 1.0.9), dpkg-dev, patch, make Suggests: debian-policy, dpkg-repack, dpkg-doc, jablicator, dpkg-dev-el Description: Tools to create configuration packages Tools to create the configuration packages. These tools are similar to the debhelper tools and should be used quite like them, but they lack some options. Package: dpsyco-sudo Architecture: all Depends: dpsyco-lib (>= 1.0.9), sudo Description: Automate administration of sudo privileges This package contains a tool to automatically give some users sudo privileges. . WARNING! This tool will automatically administrate all sudo permissions so if you do not have a admin package installed that give users sudo privileges they will no longer be able to use sudo. YOU HAVE BEEN WARNED! Package: dpsyco-ssh Architecture: all Depends: dpsyco-lib (>= 1.0.9), ssh (>> 3.4p1) Suggests: xfree86-common, xbase-clients Description: Automate administration of access via ssh This package contains a tool to automatically give some users access via ssh. . WARNING! Users with UID < 999 will have its ssh access administrated automatically which means that the authorized_keys file will be removed if there is no admin package installed that gives the user ssh access. YOU HAVE BEEN WARNED! Package: dpsyco-mysql Architecture: all Depends: dpsyco-lib(>= 1.0.9), mysql-client Description: Automate administration of access to mysql This package contains a tool to automatically give some users or hosts access to a mysql database. . This package is not fully functional though. Package: dpsyco-samba Architecture: all Depends: dpsyco-lib (>= 1.0.9), samba-common Recommends: samba Suggests: smbclient Description: Automate administration of access to samba This package contains a tool to automatically give some users or hosts access to a samba server. It is not that easy to administrate yet, but that should change soon. . WARNING! Samba users with UID between 500 and 999 will be automatically administrated by this tool. This means that if you do not have a admin package that set up users correctly, these users WILL BE REMOVED and the user will not be able to log in again. YOU HAVE BEEN WARNED! Package: dpsyco-cfengine Architecture: all Depends: dpsyco-lib (>= 1.0.9), cfengine2 Description: Automate applying of cfengine configs This package contains a tool to automatically apply cfengine configurations to the system. dpsyco-1.0.36/debian/dpsyco-lib.postrm0000664000175000017500000000166610366754012015766 0ustar olaola#! /bin/sh # postrm script for dpsyco # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see /usr/share/doc/packaging-manual/ case "$1" in purge|remove) ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 ;; esac case "$1" in purge) rm -f /etc/dpsyco/adduser.conf ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# dpsyco-1.0.36/debian/dpsyco-mysql.dirs0000664000175000017500000000000010366754012015757 0ustar olaoladpsyco-1.0.36/debian/dpsyco.docs0000664000175000017500000000002410366754012014611 0ustar olaolaREADME TODO doc/FAQ dpsyco-1.0.36/debian/changelog0000664000175000017500000002726011047071703014317 0ustar olaoladpsyco (1.0.36) unstable; urgency=low * Corrected problem in dpsch-installcfengine. Closes: #494197. Thanks to Eric Gerlach for the patch. * Documented copyright more thoughout for contributors. -- Ola Lundqvist Fri, 8 Aug 2008 18:18:32 +0200 dpsyco (1.0.35) unstable; urgency=low * Applied patch from Mert Dirik to correct the bashisms in the package, closes: #464642. * Now force purge of /etc/dpsyco/sudoers on purge of package, closes: #454392, #330786. -- Ola Lundqvist Mon, 7 Apr 2008 22:03:48 +0200 dpsyco (1.0.34) unstable; urgency=low * Correction of a typo and check for // in the beginning of a path, instead of just for /, closes: #415550. -- Ola Lundqvist Wed, 21 Mar 2007 10:31:29 +0100 dpsyco (1.0.33) unstable; urgency=medium * Applied patch from Tomas Fasth that disables a warning about sync user, closes: #413026. -- Ola Lundqvist Fri, 2 Mar 2007 05:23:35 +0100 dpsyco (1.0.32) unstable; urgency=low * Changed dependency on cfengine to cfengine2, closes: #383407. -- Ola Lundqvist Tue, 26 Sep 2006 07:48:48 +0200 dpsyco (1.0.31) unstable; urgency=low * Applied simple patch from Free Ekanayaka to correct an issue with blankspace in files, closes: #368836. * Updated FSF address of a number of files. * Added an empty binary-arch target in debian/rules file. -- Ola Lundqvist Wed, 19 Jul 2006 20:04:43 +0200 dpsyco (1.0.30) unstable; urgency=low * Corrected wrong character issue in manpage. * Corrected so that debhelper is now build depends instead of build depends indep. * Updated to debhelper 4 compatibility. * Updated to standards version 3.7.2. * Updated to new FSF address. -- Ola Lundqvist Thu, 6 Jul 2006 00:41:38 +0200 dpsyco (1.0.29) unstable; urgency=low * Fixed so that dpsyco work better with nis, closes: #273587. -- Ola Lundqvist Sun, 17 Apr 2005 20:22:53 +0200 dpsyco (1.0.28) unstable; urgency=low * Fixed a minor bug in dpsyco-lib.postrm. -- Ola Lundqvist Sun, 12 Dec 2004 17:03:50 +0100 dpsyco (1.0.27) unstable; urgency=low * Changed code so there is no longer any dependency on sudo for ssh access generation. -- Ola Lundqvist Wed, 15 Sep 2004 09:50:23 +0200 dpsyco (1.0.26) unstable; urgency=high * Fixed some email references, that point to depricated email address. -- Ola Lundqvist Mon, 30 Aug 2004 11:45:08 +0200 dpsyco (1.0.25) unstable; urgency=medium * Updated spelling on some different files. Thanks to Guy Atkinson for the patches. * Fixed visibility issue when dpsyco add or delete users. Thanks (again) to Guy Atkinson for the patches. * FAQ update. Thanks (again) to Guy Atkinson for the patch. * Added correct GPL statements so it correctly released. Also added a COPYING files as I should have done from the beginning. -- Ola Lundqvist Sun, 29 Aug 2004 17:50:00 +0200 dpsyco (1.0.24) unstable; urgency=low * Removed dpsyco-doc package that is empty, closes: #196195. * Converted changelog to UTF-8. * Removed emacs variable in the bottom of this changelog. * Updated standards version to 3.6.1. -- Ola Lundqvist Thu, 12 Aug 2004 08:45:53 +0200 dpsyco (1.0.23) unstable; urgency=low * Fixed problem with dpsyco-patch command. It do not apply patches for files that exist in skel when skel has ben run. * Updated standards version from 3.5.8 to 3.5.10. -- Ola Lundqvist Wed, 17 Sep 2003 14:29:03 +0200 dpsyco (1.0.22) unstable; urgency=low * Added a check for multiple account information in update-dpsyco- users. -- Ola Lundqvist Fri, 29 Aug 2003 08:28:16 +0200 dpsyco (1.0.21) unstable; urgency=low * Added lintian override, closes: #204959. * Applied patch from Otavio Salvador , that makes patches be upgradeable (without the need of skel). * Fixed dpsch-installpatch, closes: #204268. * Fixed dpsch-auto-cronapt manpage, closes: #204255. -- Ola Lundqvist Tue, 12 Aug 2003 07:28:26 +0200 dpsyco (1.0.20) unstable; urgency=low * dpsch-genpkg uses getent passwd instead of grepping directly in /etc/passwd. -- Ola Lundqvist Mon, 12 May 2003 21:31:26 +0200 dpsyco (1.0.19) unstable; urgency=low * Fixed patch issues, so now you can patch files in skel too, closes: #190575. * Output changed (minor) from dpsyco-skel. -- Ola Lundqvist Wed, 7 May 2003 09:54:09 +0200 dpsyco (1.0.18) unstable; urgency=low * No longer modifies apt.conf on installation. -- Ola Lundqvist Tue, 22 Apr 2003 08:22:38 +0200 dpsyco (1.0.17) unstable; urgency=low * Fixed one more read -e bashism. -- Ola Lundqvist Fri, 4 Apr 2003 07:55:26 +0200 dpsyco (1.0.16) unstable; urgency=low * Removed option -e to read that is a bashism. -- Ola Lundqvist Thu, 3 Apr 2003 08:24:17 +0200 dpsyco (1.0.15) unstable; urgency=low * Heavily modified and improved dpsyco-skel version, closes: #144952. * Versioned dependency on ssh, closes: #179577. * Removed debian/*.conffiles because they create duplicated configuration files on build. -- Ola Lundqvist Wed, 5 Feb 2003 19:36:10 +0100 dpsyco (1.0.14) unstable; urgency=low * Skel handling improved becuase it now makes backup of all modified files and not just once. This is an alternative solution to 144952, so it closes: #144952. * Updated to standards version 3.5.8 (from 3.5.2). * Made sure that all man pages are properly generated * Removed full stop from all descriptions. -- Ola Lundqvist Thu, 26 Dec 2002 00:14:44 +0100 dpsyco (1.0.13) unstable; urgency=low * Added dependency on adduser for dpsyco-lib, closes: #169826. -- Ola Lundqvist Wed, 20 Nov 2002 10:00:24 +0100 dpsyco (1.0.12) unstable; urgency=low * Applied patch from Tomas Fasth for dpsh-auto-cronapt. Now builds with other umask. * Fixed so that dsa keys are generated in addition to rsa1 keys. * Added logcheck lines to make updates a bit less verbose in logcheck, closes: #146141. * Fixed dpsh-gendepends so it generates dependencies on dpsyco-ssh correctly. -- Ola Lundqvist Fri, 5 Jul 2002 14:37:33 +0200 dpsyco (1.0.11) unstable testing; urgency=low * Fixed a minor bug in dpsch-installcronapt. * Fixing with cronapt so it will be prefixed by a number. * Updated gendepend versions. -- Ola Lundqvist Mon, 15 Apr 2002 16:35:35 +0200 dpsyco (1.0.10) unstable; urgency=low * Added documentation from Machael Boman , closes: #128120. * Fixed purge problem, moved deconfiguring to prerm from postinst, closes: #141732. -- Ola Lundqvist Mon, 8 Apr 2002 20:41:30 +0200 dpsyco (1.0.9) unstable; urgency=low * Created some scripts to automate dependency information and allow for cron-apt update. * Fixed error on update, closes: #134894. -- Ola Lundqvist Mon, 11 Mar 2002 23:23:07 +0100 dpsyco (1.0.8) unstable; urgency=low * Fixed spelling errors in dpsyco, closes: #124567. * Fixed spelling errors in dpsyco-base, closes: #124568. * Fixed spelling errors in dpsyco-cfengine, closes: #124569. * Fixed spelling errors in dpsyco-devel, closes: #124570. * Fixed spelling errors in dpsyco-mysql, closes: #124571. * Fixed spelling errors in dpsyco-patch, closes: #124572. * Fixed spelling errors in dpsyco-sudo, closes: #124576. * Fixed spelling errors in dpsyco-samba, closes: #124573. * Fixed spelling errors in dpsyco-skel, closes: #124574. * Moved two chmod lines to the correct package, closes: #125652. -- Ola Lundqvist Thu, 20 Dec 2001 15:56:29 +0100 dpsyco (1.0.7) unstable; urgency=low * Made dpsyco-ssh ssh2 aware, using a simple symlink. * Fixed sudo dependency in dpsyco-ssh, closes: #122369. * Fixed problem with the sudo file. Now it backs up the sudo file, closes: #121194, #121197. * Fixed a ssh generation problem, closes: #112896. * Fixed a uninstallation problem, closes: #121196. * Added a test-nfs option. -- Ola Lundqvist Fri, 07 Dec 2001 15:05:59 +0100 dpsyco (1.0.6) unstable; urgency=low * Fixed bug in dpsyco-sudo, closes: #119291. * Think the cat bug should habe been fixed by now, closes: #114456. * Made the build dep arch independent. -- Ola Lundqvist Mon, 13 Nov 2001 23:21:51 +0100 dpsyco (1.0.5) unstable; urgency=low * Fixed conflict problem. * Fixed postinst error. * Removes the /etc/dpsyco/adduser.conf only on purge. -- Ola Lundqvist Wed, 10 Oct 2001 21:40:49 +0200 dpsyco (1.0.4) unstable; urgency=low * Fixed prerm bug when removing. * Implemented the UID/GID change possibility mentioned in the README file. * Moved the postinst scripts to dpsyco-lib instead because the adduser.conf is needed by everything. * Wrote some manual pages. * Fixed bug in dpsyco-delhome so that it is not doing the same time as dpsyco-restorehome. * Updated the control file so that packages only depend on dpsyco-lib and not on dpsyco-base. This makes things more flexible. -- Ola Lundqvist Tue, 9 Oct 2001 15:26:04 +0200 dpsyco (1.0.3) unstable; urgency=low * Fixed installation problem, closes: #114183. -- Ola Lundqvist Tue, 2 Oct 2001 12:01:00 +0200 dpsyco (1.0.2) unstable; urgency=low * Added suggestion of jablicator and dpkg-repack. * Removed -depth from the find line in dpsch-cvsclean so that it works in potato too. * Fixed group problem. * Fixed el recommendation, now suggests. * Fixed weblink www.opal not debian.opal. * Fixed so that the sudo script will be runned on update, closes: #113561. * Fixed cfengine run problem. * Updates the samba UID automaticly from passwd. * Fixed bug in samba update. Users was not removed correctly. * Now removes the user profile in the same way as the user home directory is removed. * Moved defaults.conf to the lib package so that packages only need to depend on dpsyco-lib to work properly. * Sudo run problem fixed. -- Ola Lundqvist Thu, 27 Sep 2001 16:37:48 +0200 dpsyco (1.0.1) unstable; urgency=low * Updated the description, closes: #112106. * Fixed the example rules file so that it uses installuserskel and installuserpatch too, missed that before. * Fixed missing dependency on dpsyco-base for dpsyco-devel. * Fixed permission problems with dpsyco-devel. * Fixed permission problems, minor security fix. -- Ola Lundqvist Thu, 13 Sep 2001 15:01:45 +0200 dpsyco (1.0.0) unstable; urgency=low * Broke down the base package to several sub-packages and renamed the project to dpsyco which is an acronym for Debian Packages of System Configurations. * Changed the license to GPL. * Added some administration scripts for mysql administration. * Written all the manual pages. They will be updated later. * Extracted the patch code from the skel code. * Did a lot of testing, and corrected some of the scripts. * Implemented a improved version of the skel handling. It will now remove itself in a clean way. * Did the same for the patch code. * Initial official debian release, closes: #110877. * Wrote the helper scripts that installs the information to the configuration packages. -- Ola Lundqvist Sat, 1 Sep 2001 17:11:02 +0200 dpsyco-1.0.36/debian/dpsyco-base.postinst0000664000175000017500000000302410366754012016457 0ustar olaola#! /bin/sh # postinst script for dpsyco-base # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) ############################################################################# #################### Permissions to fix some security flaws ################# ############################################################################# chmod o-rw /usr/share/dpsyco/users chmod o-rw /usr/share/dpsyco/groups ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/dpsyco-sudo.dirs0000664000175000017500000000001710366754012015574 0ustar olaolaetc/dpsyco/cmd dpsyco-1.0.36/debian/dpsyco-sudo.postrm0000664000175000017500000000163710776476742016210 0ustar olaola#! /bin/sh # postrm script for dpsyco # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' overwrit>r> # for details, see /usr/share/doc/packaging-manual/ case "$1" in purge) rm -f /etc/dpsyco/sudoers ;; remove) ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# dpsyco-1.0.36/debian/conffiles0000664000175000017500000000000010366754012014323 0ustar olaoladpsyco-1.0.36/debian/dpsyco-samba.dirs0000664000175000017500000000001710366754012015705 0ustar olaolaetc/dpsyco/cmd dpsyco-1.0.36/debian/dpsyco-skel.dirs0000664000175000017500000000013410366754012015560 0ustar olaolaetc/dpsyco/cmd usr/share/dpsyco/skel usr/share/dpsyco/userskel usr/sbin var/lib/dpsyco-skel dpsyco-1.0.36/debian/dpsyco-cfengine.dirs0000664000175000017500000000005110366754012016376 0ustar olaolausr/share/dpsyco/cfengine etc/dpsyco/cmd dpsyco-1.0.36/debian/dpsyco-devel.lintian-override0000664000175000017500000000004410366754012020233 0ustar olaoladpsyco-devel: script-not-executable dpsyco-1.0.36/debian/dpsyco-base.docs0000664000175000017500000000001410366754012015520 0ustar olaolabase/README dpsyco-1.0.36/debian/dpsyco-patch.postinst0000664000175000017500000000323110366754012016644 0ustar olaola#! /bin/sh # postinst script for dpsyco-patch # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. case "$1" in configure) chmod o-rwx /usr/share/dpsyco/patch chmod o-rwx /usr/share/dpsyco/userpatch # Upgrade from 1.0.18 (or below) to 1.0.19 (or above). if [ -d /var/lib/dpsyco-patch/patches ] ; then mv /var/lib/dpsyco-patch/patches \ /var/lib/dpsyco-patch/_usr_share_dpsyco_patch-patches fi if [ -f /var/lib/dpsyco-patch/patch.list ] ; then mv /var/lib/dpsyco-patch/patch.list \ /var/lib/dpsyco-patch/_usr_share_dpsyco_patch-patch.list fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/dpsyco-sudo.prerm0000664000175000017500000000231610366754012015764 0ustar olaola#! /bin/sh # prerm script for dpsyco # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see /usr/share/doc/packaging-manual/ case "$1" in remove|deconfigure) ############################################################################# ######################### Sudo default handling ############################# ############################################################################# SUDOERSF=/etc/sudoers SUDOSRC=/etc/dpsyco/sudoers . /etc/dpsyco/defaults.conf if [ -e "$SUDOSRC" ] ; then cp -a $SUDOSRC $SUDOERSF fi ;; upgrade) ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 0 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 dpsyco-1.0.36/debian/dpsyco-lib.dirs0000664000175000017500000000003410366754012015367 0ustar olaolaetc/dpsyco usr/share/dpsyco dpsyco-1.0.36/install0000775000175000017500000000324310453037476012623 0ustar olaola#!/bin/sh # DocumentId: $Id: install 2221 2006-07-05 22:35:21Z ola $ # Author: $Author: ola $ # Ola Lundqvist # Arguments: # $1 Destination # $2 Part # Summary: # Installs the tools. # if [ -z "$1" ] ; then echo "No part specified, exiting." exit -1 fi if [ -z "$2" ] ; then echo "No part specified, exiting." exit -1 fi DDATE=$(LANG=C date) DEST="$1" PART="$2" cd $PART if [ -d man ] ; then mkdir -p $DEST/usr/share/man/man1 find man -name "*.pod" | { while read POD ; do NAME=$(echo $POD | sed -e "s|.pod$||;") PT="" if [ ! -z "$PART" ] ; then PT="-$PART" fi echo "Generating $NAME.1" pod2man --section=1 \ --release="Dpsyco " \ --date="$DDATE" \ $POD > $NAME.1 DNAME=$(echo "$NAME" | sed -e "s|man/||;") echo "Copy $NAME.1 to $DEST/usr/share/man/man1/$DNAME.1.gz" gzip -c -9 $NAME.1 > $DEST/usr/share/man/man1/$DNAME.1.gz done } fi if [ -d conf ] ; then cp conf/*.conf $DEST/etc/dpsyco fi if [ -d src ] ; then find src -name "*.func" | { while read FILE ; do mkdir -p $DEST/usr/share/dpsyco cp $FILE $DEST/usr/share/dpsyco done } find src -name "*.test" | { while read FILE ; do mkdir -p $DEST/usr/share/dpsyco cp $FILE $DEST/usr/share/dpsyco done } find src -name "dpsyco-*" | { while read FILE ; do mkdir -p $DEST/usr/bin cp $FILE $DEST/usr/bin done } find src -name "dpsch-*" | { while read FILE ; do mkdir -p $DEST/usr/bin cp $FILE $DEST/usr/bin done } find src -name "update-dpsyco*" | { while read FILE ; do mkdir -p $DEST/usr/sbin cp $FILE $DEST/usr/sbin done } fi dpsyco-1.0.36/README0000664000175000017500000000606711047071763012113 0ustar olaolaDocumentId: $Id: README 2594 2008-08-08 16:27:28Z ola $ Author: $Author: ola $ Ola Lundqvist Date: $Date: 2008-08-08 18:27:28 +0200 (fre, 08 aug 2008) $ Summary: Information about the (Debian Packages of System Configurations) dpsyco way of configure your system License: ======== Copyright (C) 2000-2004,2008 Ola Lundqvist Copyright (C) 2008 Eric Gerlach Copyright (C) 2002,2007 Tomas Fasth Copyright (C) 2004 Guy Copyright (C) 2003 Otavio Salvador This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program as the file COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Introduction: ============= Dpsyco is an acronym for Debian Packages of System Configurations and with this you can create and maintain "configuration packages". A configuration package is a package that resides "on top of" the normal debian packages. With this system you can overwrite normal files, patch the system, add users and groups and much more. Sub-packages: ============= I have decided to split the packages into different subpackages which provides some simple functionality. You can read about each of them in its own README file (none of them are written now though). File structure: =============== /etc/dpsyco Configuration files. /etc/dpsyco/cmd Dpsyco commands, preferably symlinks. /usr/share/dpsyco users - See dpsyco-base groups - See dpsyco-base skel - See dpsyco-skel userskel - See dpsyco-skel patch - See dpsyco-patch Versioning: =========== This package is still in progress. I have to have a system for versioning so that people can depend on it in a good way. The syntax is x.y.z, where x, y, z is a natural number. x - Major version number. This will only be changed in some special cases. The first major change was when the package was renamed from twinspot-base to dpsyco. y - If this version number changes something have changed so that it is not backwards compatible. You probably have to change some things to make the configure packages work fine again. z - Minor changes, additions and bugfixes. Everything that does not affect the backward compatibility. Yes there can still be problems if the package that uses this system does depend on a bug. So this means that you should add a dependency line that looks something like the following one (x.y.z is the current version of dpsyco): Depends: dpsyco-base (<< x.(y+1).0), dpsyco-base (>= x.y.z) dpsyco-1.0.36/Makefile0000664000175000017500000000025610366754017012670 0ustar olaolaall: textman textman: helpscripts/manpod2text.sh doc/textman clean: -rm -Rf doc/textman find . -type f -name "*.1" | xargs rm -f default: dpkg-buildpackage -rfakeroot dpsyco-1.0.36/COPYING0000664000175000017500000004311210453040047012245 0ustar olaola GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. dpsyco-1.0.36/TODO0000664000175000017500000001247110366754017011722 0ustar olaolaDocumentId: $Id: TODO 2021 2005-04-17 18:21:29Z ola $ Author: $Author: ola $ Ola Lundqvist Date: $Date: 2005-04-17 20:21:29 +0200 (sön, 17 apr 2005) $ Summary: To do on this toolkit. * Implement the automatic mysql handling. * Better skel file handling. Especially for configuration files. * Better patch handling (maybe use code from source patching , like kernel patching) to allow patches to be removed even if the original package is not updated. Is this already done? When should it be done? * Better handling of /home and other variables for each user. Use the code from ssh and apply to other places. Right now it is a bit to much hard-coded. * Fix the warning message about unknown variables for adduser. This should really be moved to some other place. * Add a dpsyco-delete for deleting files? ########################################################################## Secondly, when updating users, the code fails to add a gecos field (or a decent password, but I'll come to that). I feelthat is because it uses adduser instead of useradd, which is more flexible. Thirdly, the code does dangerous things with the home dirs of users that it simply should NEVER do. It must NOT eliminate the home directory by default! That's incredibly dangerous (and probably wildly against debian policy?). I suggest that you use the files containing user details to contain more data. CRYPT -> encrypted password USERHOME -> forced home dir USERID -> forced uid USERGID -> forced gid (plural, to join other groups?) USERSHELL-> choice of shell. NAME -> gecos field Then you fill in the gecos data using "chfn", and you use useradd -p to set the password, instead of relying on adduser. Also, the code contains huge "if" blocks that are the wrong way round, with the exceptional case at the end instead of the beginning. The exception shoudl be treated first, and discarded, leaving the rest of the code to treat the normal case without further indenting. Assuming proper rephrasing to discard exceptions first, the main code would go like this: @@ -139,5 +125,121 @@ usermod -c "$NAME" $AU fi fi + continue # exceptional case discarded, continue inline + fi + + # the user is not in the to-be-eliminated list + if grep "^$AU:" $PWDF > /dev/null 2>&1 ; then + # the user is in the passwd + if [ $UPID -ge $FIRST_SYSTEM_UID ] ; then + # PTB 6/9/04 be quiet + : echo "User $AU ($UPID) does already exist, FIX THIS MANUALLY!!!" + fi + continue + fi + + # CREATING USER. + dpsyco-restorehome $AU + + CRYPTOPTS="" + if [ -n "$CRYPT" ]; then + CRYPTOPTS="-p $CRYPT" + fi + + if [ -n "$USERHOME" ]; then + HOMEOPTS="-d $USERHOME" + else + USERHOME="$DHOME/$AU" + HOMEOPTS="-d $DHOME/$AU" + fi + + UIDOPTS="" + if [ -n "$USERID" ]; then + UIDOPTS="-u $USERID" + fi + + if [ -n "$USERGID" ]; then + GROUPOPTS="-g $USERGID" + else + if [ -n "$USERID" ]; then + USERGID="$USERID" + GROUPOPTS="-g $USERID" + fi + fi + + SHOPTS="" + if [ -n "$USERSHELL" ]; then + SHOPTS="-s $USERSHELL" + fi + + if [ -n "$CRYPT" ]; then # use useradd, not adduser + useradd $HOMEOPTS $GROUPOPTS $UIDOPTS $CRYPTOPTS $SHOPTS $AU + if [ -n "$NAME" ]; then + ifs="$IFS" + IFS="," + set -- $NAME + IFS="$ifs" + FULL_NAME="$1" + ROOM_NO="$2" + WORK_PH="$3" + HOME_PH="$4" + shift 4 + OTHER="" + OTHERCOUNT="" + for i; do + if [ "$OTHERCOUNT" ]; then + OTHER="$OTHER,$i" + else + OTHER="$i" + OTHERCOUNT=1 + fi + shift + done + chfn $AU + fi + if [ -n "$FULL_NAME" ]; then + chfn -f "$FULL_NAME" $AU + fi + if [ -n "$ROOM_NO" ]; then + chfn -r "$ROOM_NO" $AU + fi + if [ -n "$WORK_PH" ]; then + chfn -w "$WORK_PH" $AU + fi + if [ -n "$HOME_PH" ]; then + chfn -h "$HOME_PH" $AU + fi + if [ -n "$OTHER" ]; then + chfn -o "$OTHER" $AU + fi + else # previous use of adduser + adduser --conf $DPADDUSERCFG --gecos "$NAME" --disabled-password $AU + fi + if [ -n "$USERGID" ]; then + : changeowner $AU $USERGID "$USERHOME" + else + : changeowner $AU $AU "$USERHOME" + fi + + if [ -f $USERHOME.mail ] ; then + echo "Restore user $AU incoming mail." + if [ -e /var/mail/$AU ] ; then + cat $USERHOME.mail >> /var/mail/$AU + rm $USERHOME.mail + else + mv $USERHOME.mail /var/mail/$AU + fi + changeowner $AU mail "/var/mail/$AU" + fi + + if [ -f $USERHOME.mailspool ] ; then + echo "Restore user $AU incoming mailspool." + if [ -e /var/spool/mail/$AU ] ; then + cat $USERHOME.mailspool >> /var/spool/mail/$AU + rm $USERHOME.mailspool + else + mv $USERHOME.mailspool /var/spool/mail/$AU + fi + changeowner $AU mail "/var/spool/mail/$AU" fi done Peter