diff options
author | Eloy Paris <peloy@samba.org> | 2003-06-01 04:30:13 +0000 |
---|---|---|
committer | Eloy Paris <peloy@samba.org> | 2003-06-01 04:30:13 +0000 |
commit | 72cc0c82c415c872e270d924c795d6ac907a32fb (patch) | |
tree | dd0b7cb81c75fe123179988c264e445383eb25ed /packaging/Debian/debian/samba.config | |
parent | dbd4a83c7ffbf7043e085c5382f55cf336daf27e (diff) | |
download | samba-72cc0c82c415c872e270d924c795d6ac907a32fb.tar.gz samba-72cc0c82c415c872e270d924c795d6ac907a32fb.tar.bz2 samba-72cc0c82c415c872e270d924c795d6ac907a32fb.zip |
Bringing packaging/Debian/ up to date with the current Samba package
in Debian unstable. The stuff here was ages old...
(This used to be commit 5646df8bfb327d74f9c07fc219023a5aecdbc70d)
Diffstat (limited to 'packaging/Debian/debian/samba.config')
-rw-r--r-- | packaging/Debian/debian/samba.config | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/packaging/Debian/debian/samba.config b/packaging/Debian/debian/samba.config new file mode 100644 index 0000000000..e3da337b2e --- /dev/null +++ b/packaging/Debian/debian/samba.config @@ -0,0 +1,93 @@ +#/bin/sh -e +# +# $Id: samba.config,v 1.1.6.1 2003/06/01 04:30:10 peloy Exp $ +# + +# Source debconf library. +. /usr/share/debconf/confmodule + +# Function for grabbing a parameter from an smb.conf file +smbconf_retr() { + if [ -z "$1" ]; then + return + fi + + if [ -n "$2" ]; then + local FILE="$2" + fi + + if [ -z "$FILE" ]; then + return + fi + + sed -n -e" + s/^[[:space:]]*\[global\]/\[global\]/i + /^\[global\]/,/^[[:space:]]*\[/ { + s/^[[:space:]]*$1[[:space:]]*=[[:space:]]*//pi + }" $FILE \ + | tail -1 +} + +FILE=/etc/samba/smb.conf + +db_title "Samba Server" + +# Babysit users who don't read README.Debian +if [ -n "$2" ] && dpkg --compare-versions "$2" lt "2.2" +then + db_input medium samba/log_files_moved || true + db_go +fi + +db_input medium samba/run_mode || true +db_go + + +# Offer to move the password database for existing users +if [ "$1" = "configure" -a -n "$2" -a -e /etc/samba/smbpasswd \ + -a ! -e /var/lib/samba/passdb.tdb ] \ + && dpkg --compare-versions "$2" lt 2.99.cvs.20020713-2 +then + FILE=/etc/samba/smb.conf + PASSDB="" + if [ -f "$FILE" ]; then + PASSDB=`smbconf_retr "passdb backend"` + fi + TDBPRIORITY=medium + if echo "$PASSDB" | grep -q ldapsam; then + TDBPRIORITY=low + fi + db_get samba-common/do_debconf || true + if [ "${RET}" = "false" ]; then + TDBPRIORITY=low + fi + + db_input "$TDBPRIORITY" samba/tdbsam || true +fi + +# We vary the priority of the next question depending on whether +# the password database already exists... +if [ -e /etc/samba/smbpasswd -o -e /var/lib/samba/passdb.tdb ]; then + PRIORITY="low" +else + # If 'encrypt passwords' is true in smb.conf, and smbpasswd + # does not exist, default to yes here. + FILE=/etc/samba/smb.conf + if [ -f "$FILE" ]; then + ENCRYPT=`smbconf_retr "encrypt passwords"` + if [ "$ENCRYPT" ]; then + ENCRYPT=`echo $ENCRYPT | tr '[A-Z]' '[a-z]'` + if [ "$ENCRYPT" = "yes" ]; then + ENCRYPT=true + fi + if [ "$ENCRYPT" = "no" ]; then + ENCRYPT=false + fi + fi + db_set samba/generate_smbpasswd "$ENCRYPT" + fi + PRIORITY="medium" +fi + +db_input $PRIORITY samba/generate_smbpasswd || true +db_go |