Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 77453 - dispatch-conf didn't merge correctly
Summary: dispatch-conf didn't merge correctly
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-10 18:56 UTC by Adam
Modified: 2007-01-11 10:37 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam 2005-01-10 18:56:40 UTC
I ran dispatch-conf and at one file it wanted to update, /etc/hotplug/usb/libusbscanner, I selected to interactively merge it because there was one change I made that I wanted to keep.  This resulted in the file:

------------------
#!/bin/sh

# This file is part of sane-backends.
#
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the scanner group.
#
# Ownership is set to root:scanner, permissions are set to 0660.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/BBB/DDD
# TYPE=usb

# latest hotplug doesn't set DEVICE on 2.6.x kernels
if [ -z "$DEVICE" ] ; then
  IF=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\2/'`
  DEV=`echo $DEVPATH | sed 's/\(bus\/usb\/devices\/\)\(.*\)-\(.*\)/\3/'`
  DEV=`expr $DEV + 1`
  DEVICE=`printf '/proc/bus/usb/%.03d/%.03d' $IF $DEV`
fi


if [ -z "${DEVICE}" ] ; then
        IF=$(echo ${DEVPATH} | sed 's:\(bus/usb/devices/\)\(.*\)-\(.*\):\2:')
        if [ -r /sys/${DEVPATH}/devnum ]; then
             DEV=$(cat /sys/${DEVPATH}/devnum)
        else
             DEV=1 # you'll have to adjust this manually for kernel < 2.6.6
        fi
        DEVICE=$(printf '/proc/bus/usb/%.03d/%.03d' ${IF} ${DEV})
fi

#if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
#  chown root:scanner "$DEVICE"
#  chmod 0660 "$DEVICE"
#fi


# That's an insecure but simple alternative
# Everyone has access to the scanner

 if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
  chmod 0666 "$DEVICE"
 fi
-------------------

It looked suspicious that the first 2 major blocks of code looked similar, so I searched for the original file in the tar.bz2 and looked at it.  Sure enough, the 2nd block wasn't there and must have come from the old configuration file.  But the merge process didn't remove that block in the diff.


Reproducible: Didn't try
Steps to Reproduce:




adam>emerge info
Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, glibc-2.3.3.20040420-r2,
2.6.9-gentoo-r9 i686)
=================================================================
System uname: 2.6.9-gentoo-r9 i686 AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks nostrip sandbox sfperms strict
userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.seren.com/gentoo ftp://mirrors.tds.net/gentoo
http://mirrors.tds.net/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow acl alsa arts avi bitmap-fonts cdr crypt cups dvd encode fam
foomaticdb gdbm gif gpm gtk2 imagemagick imlib ipv6 java jpeg junit kde libwww
mmx mozilla mpeg mysql ncurses oggvorbis opengl pam pdflib perl png ppds qt
quicktime readline scanner sdl slang ssl tcpd tiff truetype usb xml2 xmms xprint
zlib"
Comment 1 Alec Warner archtester Gentoo Infrastructure gentoo-dev Security 2005-01-12 09:15:07 UTC
You chose interactive mode, which lets you ( among other things ) edit both files and merge them in a pretty open ended fashion.  Are you sure you didn't just merge the extra section in by mistake?
Comment 2 Adam 2005-01-12 09:59:12 UTC
It asked me for 3 parts, I'm quite sure: whether I want to use nothing or the block starting with "# latest hotplug doesn't ", whether I want the 2nd from last block commented out, and whether I want the last block commented out.  In the first choice I chose to include the block.  But it should have been a choice between the 2 blocks.  In the diff that it displayed before I selected "merge", it didn't have the old code minused out with "-"; it only had the new code added with "+".
Comment 3 Adam 2005-02-09 16:34:38 UTC
Well, this is darn strange.  I just re-installed Gentoo and unless I'm quite mistaken, I haven't touched that file since the installation.  But both blocks of code are now in it.  Even stranger, only the one block of code is still in the tar.gz file.  So maybe there's no problem with dispatch-conf but there is a problem with something.
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-04-14 07:17:29 UTC
Might have got this while fixing bug 69869. After 2.0.51.20 comes out, please repoen this if it happens again.
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2007-01-11 10:37:15 UTC
Closing