tags 652942 patch thanks Christian,
On Tue, Jun 19, 2012 at 08:08:46AM +0200, Christian PERRIER wrote: > > If I understand you correctly, you want us to drop the entire dhcp hook? > > There > > Yes. > > > might still be time to do this before the freeze. > > Except that I'm much less in "samba mode" than I was in May, but > you're here to help in this, now..:-) That was my point :) Anyway, patch attached. > > Does anybody think we should keep the hook? > Just say "Steve, do you agree", it will be clearer..:-) :) Steve, what do you think? And if you agree, could you have a quick look at the patch? I think I did everything that's needed for the cleanup, but I might have forgotten something... Cheers, Ivo
Index: samba-common.maintscript =================================================================== --- samba-common.maintscript (revision 0) +++ samba-common.maintscript (working copy) @@ -0,0 +1,3 @@ +rm_conffile /etc/dhcp3/dhclient-enter-hooks.d/samba 2:3.6.5-8~ samba-common +rm_conffile /etc/dhcp/dhclient-enter-hooks.d/samba 2:3.6.5-8~ samba-common +rm_conffile /etc/samba/dhcp.conf 2:3.6.5-8~ samba-common Index: samba-common.dhcp =================================================================== --- samba-common.dhcp (revision 4124) +++ samba-common.dhcp (working copy) @@ -1,75 +0,0 @@ -#!/bin/sh - -SAMBA_DHCP_CONF=/etc/samba/dhcp.conf - -netbios_setup() { - # No need to continue if we're called with an unsupported option - - case $reason in - BOUND|RENEW|REBIND|REBOOT|EXPIRE|FAIL|RELEASE|STOP) - ;; - *) - return - ;; - esac - - umask 022 - - local other_servers="" - local serverlist="" - - # the destination file won't exist yet on the first run after - # installing samba - if [ -e $SAMBA_DHCP_CONF ] && [ -s $SAMBA_DHCP_CONF ] - then - # don't continue if no settings have changed - if [ "$new_netbios_name_servers" = "$old_netbios_name_servers" ] \ - && [ "$new_netbios_scope" = "$old_netbios_scope" ] \ - && [ -n "$new_netbios_name_servers" ] - then - return - fi - - # reparse our own file - other_servers=`sed -n -e"s/[[:space:]]$interface:[^[:space:]]*//g; \ - s/^[[:space:]]*wins server[[:space:]]*=[[:space:]]*//pi" \ - $SAMBA_DHCP_CONF` - - serverlist="$other_servers" - fi - - for server in $new_netbios_name_servers - do - serverlist="$serverlist $interface:$server" - done - - echo -n > ${SAMBA_DHCP_CONF}.new - - # If we're updating on failure/expire, AND there are no WINS - # servers for other interfaces, leave the file empty. - if [ -z "$other_servers" ] - then - if [ "$reason" = FAIL ] || [ "$reason" = EXPIRE ] - then - mv ${SAMBA_DHCP_CONF}.new $SAMBA_DHCP_CONF - return - fi - fi - - if [ -n "$serverlist" ] - then - echo " wins server =$serverlist" >> ${SAMBA_DHCP_CONF}.new - fi - if [ -n "$new_netbios_scope" ] - then - echo " netbios scope = $new_netbios_scope" >> ${SAMBA_DHCP_CONF}.new - fi - mv ${SAMBA_DHCP_CONF}.new $SAMBA_DHCP_CONF - - # reload the samba server - # We don't necessarily have the samba package installed. #414841 - [ -x /etc/init.d/samba ] && /usr/sbin/invoke-rc.d samba reload - -} - -netbios_setup Index: rules =================================================================== --- rules (revision 4124) +++ rules (working copy) @@ -98,11 +98,6 @@ mkdir -p $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig install -m 0644 source3/pkgconfig/wbclient.pc $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig - # Install samba-common's conffiles - they'll get moved later to their - # correct place by dh_install - mkdir -p $(DESTDIR)/etc/dhcp3/dhclient-enter-hooks.d - install -m755 debian/samba-common.dhcp $(DESTDIR)/etc/dhcp3/dhclient-enter-hooks.d/samba - override_dh_installpam: dh_installpam --name=samba Index: samba-common.links =================================================================== --- samba-common.links (revision 4124) +++ samba-common.links (working copy) @@ -1 +0,0 @@ -etc/dhcp3/dhclient-enter-hooks.d/samba etc/dhcp/dhclient-enter-hooks.d/samba Index: samba-common.dirs =================================================================== --- samba-common.dirs (revision 4124) +++ samba-common.dirs (working copy) @@ -1,5 +1,4 @@ etc/samba -etc/dhcp3/dhclient-enter-hooks.d var/cache/samba var/lib/samba var/log/samba Index: control =================================================================== --- control (revision 4124) +++ control (working copy) @@ -57,6 +57,7 @@ Package: samba-common Architecture: all Multi-Arch: foreign +Pre-Depends: ${misc:Pre-Depends} Depends: ucf, ${misc:Depends} Replaces: samba (<< 3.0.20b-1), samba4-common (<< 4.0.0~alpha7-1) Conflicts: samba4-common (<< 4.0.0~alpha7-1) Index: samba-common.postinst =================================================================== --- samba-common.postinst (revision 4124) +++ samba-common.postinst (working copy) @@ -11,11 +11,14 @@ NEWFILE=$TEMPDIR/smb.conf CONFIG=/etc/samba/smb.conf +OLDVERSION="$2" + # ------------------------- Debconf questions start --------------------- configure_smb_conf() { local CONFIG CONFIG="$1" + OLDVERSION="$2" # Is the user configuring with debconf, or he/she prefers # swat/manual config? @@ -50,19 +53,9 @@ s/^\([[:space:]]*\)encrypt passwords[[:space:]]*=.*/\1encrypt passwords = ${ENCRYPT_PASSWORDS}/i" \ "$CONFIG" - # Install DHCP support - db_get samba-common/dhcp - if [ "$RET" = true ] && \ - ! grep -q dhcp.conf "$CONFIG" + # Remove DHCP support prio to version 2:3.6.5-8 + if dpkg --compare-versions "$OLDVERSION" lt '2:3.6.5-8~' then - sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i - /^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ { - /wins server[[:space:]]*=/a \\ -\\ -# If we receive WINS server info from DHCP, override the options above. \\ - include = /etc/samba/dhcp.conf -}" "$CONFIG" - elif [ "$RET" != true ]; then sed -i -e ' /^#[[:space:]]*If we receive WINS server info from DHCP, override the options above/d /^#*[[:space:]]*include[[:space:]]*=[[:space:]]*\/etc\/samba\/dhcp.conf/,/[^[:space:]]/ { @@ -75,7 +68,7 @@ if [ -e "$CONFIG" ]; then - configure_smb_conf "$CONFIG" + configure_smb_conf "$CONFIG" "$OLDVERSION" fi mkdir -p "$TEMPDIR" Index: samba-common.install =================================================================== --- samba-common.install (revision 4124) +++ samba-common.install (working copy) @@ -1,6 +1,5 @@ etc/samba/ debian/gdbcommands etc/samba -etc/dhcp3/ usr/share/samba/lowcase.dat debian/panic-action usr/share/samba debian/smb.conf* usr/share/samba Index: samba-common.templates =================================================================== --- samba-common.templates (revision 4124) +++ samba-common.templates (working copy) @@ -2,19 +2,6 @@ Type: title _Description: Samba server and utilities -Template: samba-common/dhcp -Type: boolean -Default: false -_Description: Modify smb.conf to use WINS settings from DHCP? - If your computer gets IP address information from a DHCP server on the - network, the DHCP server may also provide information about WINS servers - ("NetBIOS name servers") present on the network. This requires a - change to your smb.conf file so that DHCP-provided WINS settings will - automatically be read from /etc/samba/dhcp.conf. - . - The dhcp3-client package must be installed to take advantage of this - feature. - Template: samba-common/do_debconf Type: boolean Default: true Index: samba-common.config =================================================================== --- samba-common.config (revision 4124) +++ samba-common.config (working copy) @@ -77,32 +77,3 @@ db_input medium samba-common/encrypt_passwords || true db_go -DHCPPRIORITY=medium -#if [ "$DEBCONF_RECONFIGURE" = 1 ] && [ -f /sbin/dhclient3 ] -if [ -f /sbin/dhclient3 ] -then - DHCPPRIORITY=high -# TODO: see if we can detect that dhcp3-client is *going* to be installed, -# even if it isn't yet. -#elif dpkg-query -W --showformat='${Status}\n' dhcp3-client | grep ??? -# unknown ok not-installed ? -# DHCPPRIORITY=high -fi - -FOUND=false -if [ -f $FILE ]; then - if grep -q 'include[[:space:]]*=[[:space:]]*/etc/samba/dhcp.conf' $FILE - then - FOUND=true - fi - db_set samba-common/dhcp $FOUND -fi - -# we only prompt in one of three cases: the file doesn't exist yet, it -# has the context we need to add our include line, or the include line -# is already present. -if [ ! -f $FILE ] || grep -q -i 'wins server' $FILE || [ "$FOUND" = "true" ]; -then - db_input $DHCPPRIORITY samba-common/dhcp || true - db_go -fi Index: changelog =================================================================== --- changelog (revision 4124) +++ changelog (working copy) @@ -1,3 +1,9 @@ +samba (2:3.6.5-8) UNRELEASED; urgency=low + + * Remove DHCP hook. Closes: #652942, #629406, #649100 + + -- Ivo De Decker <ivo.dedec...@ugent.be> Tue, 19 Jun 2012 21:19:29 +0200 + samba (2:3.6.5-7) unstable; urgency=low * Allow installing smbclient package together with newer versions of