diff options
34 files changed, 3355 insertions, 9 deletions
diff --git a/kde-base/kdebase/ChangeLog b/kde-base/kdebase/ChangeLog index 45316402da48..b6cd20cf44a7 100644 --- a/kde-base/kdebase/ChangeLog +++ b/kde-base/kdebase/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdebase # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdebase/ChangeLog,v 1.49 2003/01/08 21:45:57 gerk Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdebase/ChangeLog,v 1.50 2003/01/17 20:31:28 hannes Exp $ + +*kdebase-2.2.2-r4 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdebase-2.2.2-r4.ebuild: + new version, fixes #12520 08 Jan 2003; Mark Guertin <gerk@gentoo.org> kde-3.1_rc6.ebuild: added ~ppc to keywords diff --git a/kde-base/kdebase/files/2.2.2-r4/startkde-2.2.2-r4-gentoo b/kde-base/kdebase/files/2.2.2-r4/startkde-2.2.2-r4-gentoo new file mode 100644 index 000000000000..3028aebbd49f --- /dev/null +++ b/kde-base/kdebase/files/2.2.2-r4/startkde-2.2.2-r4-gentoo @@ -0,0 +1,126 @@ +#!/bin/bash --login +export KDEDIR="_KDEDIR_" +export KDEDIRS="_KDEDIR_:${KDEDIRS}" +export PATH="_KDEDIR_/bin:${PATH}" +rm -rf ~/.kde +ln -fs ~/.kde2 ~/.kde +[ -e "~/.kde2" ] || mkdir ~/.kde2 +#################################################### +# DEFAULT GENTOO KDE STARTUP SCRIPT ( KDE-2.2.2 ) ## +#################################################### + +################################# +#Initial cleanup of old sessions# +################################# +real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"` +rm -f ~/.DCOPserver-`/bin/hostname`_$DISPLAY + +##################################### +#Check for space on /tmp and "$HOME"# +#If not, abort startup # +##################################### +space_tmp=`df /tmp | xargs | cut -d" " -f11` +space_home=`df "$HOME" | xargs | cut -d" " -f11` + +if [ $space_tmp -lt 50 ]; then + echo $"Not enough free disk space on /tmp" + exit 1 +fi + +if [ $space_home -lt 25 ]; then + echo $"Not enough free disk space on "$HOME"" + exit 1 +fi + +############################################ +#Check for write access on /tmp and "$HOME"# +#If not, abort startup # +############################################ +testfile_tmp=`mktemp /tmp/KDE.startkde.XXXXXX` +testfile_home=`mktemp "$HOME"/KDE.startkde.XXXXXX` + +if ! echo TEST_TEXT >$testfile_tmp 2>/dev/null ; then + echo $"You don't have write permissions for /tmp" + exit 1 +fi +rm -f $testfile_tmp + +if ! echo TEST_TEXT >$testfile_home 2>/dev/null ; then + echo $"You don't have write permissions for "$HOME"" + exit 1 +fi +rm -f $testfile_home + +########################## +#Set Background and stuff# +########################## +xsetroot -cursor_name left_ptr -solid '#5477A0' + +##################### +#Set the KDE Home...# +#################### +kdehome=$HOME/.kde +test -n "$KDEHOME" && kdehome=$KDEHOME + +########################### +#Activate Font Directories# +########################### +usr_odir=$kdehome/share/fonts/override +usr_fdir=$kdehome/share/fonts +if test -n "$KDEDIRS"; then + kdedirs_first=`echo $KDEDIRS|sed -e 's/:.*//'` + sys_odir=$kdedirs_first/share/fonts/override + sys_fdir=$kdedirs_first/share/fonts +else + sys_odir=$KDEDIR/share/fonts/override + sys_fdir=$KDEDIR/share/fonts +fi + +######################################################## +#Check for newly installed fonts, if we have permission# +######################################################## + +test -d $usr_odir && (mkfontdir $usr_odir ; xset +fp $usr_odir) +test -d $sys_odir && xset +fp $sys_odir +test -d $usr_fdir && (mkfontdir $usr_fdir ; xset fp+ $usr_fdir) +test -d $sys_fdir && xset fp+ $sys_fdir + +#################################### +# Ask X11 to rebuild its font list.# +#################################### +xset fp rehash + +################################################################## +#Link "tmp" resource to directory in /tmp # +#Create a dir /tmp/kde-$USER, links $KDEHOME/tmp-$HOSTNAME to it.# +################################################################## +lnusertemp tmp >/dev/null + +######################################################################## +#Link "socket" resource to directory in /tmp # +#Create a dir /tmp/ksocket-$USER, links $KDEHOME/socket-$HOSTNAME to it# +######################################################################## +lnusertemp socket >/dev/null + +######################## +#Start the splashscreen# +######################## +ksplash + +########################################################### +#Set LD_BIND_NOW to increase the efficiency of kdeinit. # +#kdeinit unsets this variable before loading applications.# +########################################################### +# turn it off, it creates aa trouble +#LD_BIND_NOW=true kdeinit +kcminit +knotify +kdeinit +kcminit +knotify + +########################################################### +# finally, give the session control to the session manager# +########################################################### +ksmserver --restore + +########## +#Clean up# +########## +kdeinit_shutdown diff --git a/kde-base/kdebase/files/digest-kdebase-2.2.2-r4 b/kde-base/kdebase/files/digest-kdebase-2.2.2-r4 new file mode 100644 index 000000000000..8fca5069d629 --- /dev/null +++ b/kde-base/kdebase/files/digest-kdebase-2.2.2-r4 @@ -0,0 +1,2 @@ +MD5 39635e42056ab2afb8e6f2ff761eea38 kdebase-2.2.2.tar.bz2 12888455 +MD5 522331e2b47f84956eb2df1fcf89ba17 post-2.2.2-kdebase.diff 18908 diff --git a/kde-base/kdebase/kdebase-2.2.2-r4.ebuild b/kde-base/kdebase/kdebase-2.2.2-r4.ebuild new file mode 100644 index 000000000000..1c7345c32c41 --- /dev/null +++ b/kde-base/kdebase/kdebase-2.2.2-r4.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdebase/kdebase-2.2.2-r4.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ + +IUSE="ssl motif ldap encode cups oggvorbis pam" +inherit kde-dist + +DESCRIPTION="KDE $PV - base packages: the desktop, panel, window manager, konqueror..." + +KEYWORDS="x86 ~sparc" + +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +export MAKEOPTS="${MAKEOPTS} -j1" + +newdepend ">=media-sound/cdparanoia-3.9.8 + ldap? ( >=net-nds/openldap-1.2 ) + pam? ( >=sys-libs/pam-0.73 ) + motif? ( >=x11-libs/openmotif-2.1.30 ) + encode? ( >=media-sound/lame-3.89b ) + oggvorbis? ( >=media-libs/libvorbis-1.0_beta1 ) + cups? ( net-print/cups ) + ssl? ( >=dev-libs/openssl-0.9.6b ) + media-libs/lcms" +# opengl? ( virtual/opengl )" #this last for opengl screensavers +# samba? ( net-fs/samba ) #use flag doesn't exist yet and we don't want such a heavy dep by deafult +# lm_sensors? ( ?/lm_sensors ) # ebuild doesn't exist yet + +src_unpack() { + unpack ${PN}-${PV/a/}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff + + kde_sandbox_patch ${S}/konsole/src +} + +src_compile() { + + kde_src_compile myconf + + use ldap && myconf="$myconf --with-ldap" || myconf="$myconf --without-ldap" + use pam && myconf="$myconf --with-pam" || myconf="$myconf --with-shadow" + use motif || myconf="$myconf --without-motif" + use encode || myconf="$myconf --without-lame" + use cups || myconf="$myconf --disable-cups" + use oggvorbis || myconf="$myconf --without-vorbis" + #use opengl || + myconf="$myconf --without-gl" + use ssl || myconf="$myconf --without-ssl" + + kde_src_compile configure make + +} + + +src_install() { + + kde_src_install + + insinto /etc/pam.d + newins ${FILESDIR}/kscreensaver.pam kscreensaver + newins kde.pamd kde + + cd ${D}/${KDEDIR}/bin + rm -f ./startkde + sed -e "s:_KDEDIR_:${KDEDIR}:" ${FILESDIR}/${PVR}/startkde-${PVR}-gentoo > startkde + chmod a+x startkde + + # x11 session script + cd ${T} + echo "#!/bin/sh +${KDEDIR}/bin/startkde" > kde-${PV} + chmod a+x kde-${PV} + # old scheme - compatibility + exeinto /usr/X11R6/bin/wm + doexe kde-${PV} + # new scheme - for now >=xfree-4.2-r3 only + exeinto /etc/X11/Sessions + doexe kde-${PV} + + cd ${D}/${KDEDIR}/share/config/kdm + mv kdmrc kdmrc.orig + sed -e 's/SessionTypes=/SessionTypes=kde-2.2.2,kde-3.0,xsession,/' kdmrc.orig | cat > kdmrc + rm kdmrc.orig + + rm -rf ${D}/${KDEDIR}/share/templates/.source/emptydir + +} + +pkg_postinst() { + + # an empty dir that would otherwise be unmerged with the previous instance + # dodir ${KDEDIR}/share/templates/.source/emptydir + # temorary fix (bug #846) until portage tracks merged dirs' mtimes + addwrite ${KDEDIR}/share/templates/.source + mkdir -p ${KDEDIR}/share/templates/.source/emptydir + +} diff --git a/kde-base/kdegames/ChangeLog b/kde-base/kdegames/ChangeLog index 148ed6037c46..ec88e408b056 100644 --- a/kde-base/kdegames/ChangeLog +++ b/kde-base/kdegames/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdegames # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegames/ChangeLog,v 1.18 2003/01/08 21:45:57 gerk Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegames/ChangeLog,v 1.19 2003/01/17 20:31:28 hannes Exp $ + +*kdegames-2.2.2-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdegames-2.2.2-r1.ebuild: + new version, fixes #12520 08 Jan 2003; Mark Guertin <gerk@gentoo.org> kdegames-3.1_rc6.ebuild: added ~ppc to keywords diff --git a/kde-base/kdegames/files/digest-kdegames-2.2.2-r1 b/kde-base/kdegames/files/digest-kdegames-2.2.2-r1 new file mode 100644 index 000000000000..380ed193b32b --- /dev/null +++ b/kde-base/kdegames/files/digest-kdegames-2.2.2-r1 @@ -0,0 +1,2 @@ +MD5 65b1e9885bdda64597e6e3cdf129cee3 kdegames-2.2.2.tar.bz2 8828605 +MD5 0dbd747882b942465646efe0ba6af802 post-2.2.2-kdegames.diff 4747 diff --git a/kde-base/kdegames/kdegames-2.2.2-r1.ebuild b/kde-base/kdegames/kdegames-2.2.2-r1.ebuild new file mode 100644 index 000000000000..18aef3de4979 --- /dev/null +++ b/kde-base/kdegames/kdegames-2.2.2-r1.ebuild @@ -0,0 +1,16 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegames/kdegames-2.2.2-r1.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ +inherit kde-dist + +DESCRIPTION="KDE $PV - games" + +KEYWORDS="x86 ~sparc " +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +src_unpack() { + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff +} diff --git a/kde-base/kdegraphics/ChangeLog b/kde-base/kdegraphics/ChangeLog index f6fba20eb790..51650aa576fb 100644 --- a/kde-base/kdegraphics/ChangeLog +++ b/kde-base/kdegraphics/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdegraphics # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics/ChangeLog,v 1.26 2003/01/08 21:45:57 gerk Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics/ChangeLog,v 1.27 2003/01/17 20:31:28 hannes Exp $ + +*kdegraphics-2.2.2-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdegraphics-2.2.2-r1.ebuild: + new version, fixes #12520 08 Jan 2003; Mark Guertin <gerk@gentoo.org> kdegraphics-3.1_rc6.ebuild: added ~ppc to keywords diff --git a/kde-base/kdegraphics/files/digest-kdegraphics-2.2.2-r1 b/kde-base/kdegraphics/files/digest-kdegraphics-2.2.2-r1 new file mode 100644 index 000000000000..1db968078ce7 --- /dev/null +++ b/kde-base/kdegraphics/files/digest-kdegraphics-2.2.2-r1 @@ -0,0 +1,2 @@ +MD5 b9341505c6b9de8f018dd9d1896356e9 kdegraphics-2.2.2.tar.bz2 1648936 +MD5 4b9c93acd452d1de2f4f0bca5b05593f post-2.2.2-kdegraphics.diff 9397 diff --git a/kde-base/kdegraphics/files/kdegraphics-2.2.2-gentoo.diff b/kde-base/kdegraphics/files/kdegraphics-2.2.2-gentoo.diff new file mode 100644 index 000000000000..98491fbf120e --- /dev/null +++ b/kde-base/kdegraphics/files/kdegraphics-2.2.2-gentoo.diff @@ -0,0 +1,11 @@ +--- kooka/scanpackager.cpp~ 2002-12-23 11:20:30.000000000 +0100 ++++ kooka/scanpackager.cpp 2002-12-23 11:20:40.000000000 +0100 +@@ -426,7 +426,7 @@ + /* ----------------------------------------------------------------------- */ + void ScanPackager::slShowContextMenue(QListViewItem *lvi, const QPoint &p, int col ) + { +- kdDebug(28000) << "Showing Context Menue" << endl; ++ kdDebug(28000) << "Showing Context Menue" << endl; + (void) col; + + PackagerItem *curr = 0; diff --git a/kde-base/kdegraphics/kdegraphics-2.2.2-r1.ebuild b/kde-base/kdegraphics/kdegraphics-2.2.2-r1.ebuild new file mode 100644 index 000000000000..f1fc2c650051 --- /dev/null +++ b/kde-base/kdegraphics/kdegraphics-2.2.2-r1.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics/kdegraphics-2.2.2-r1.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ + +IUSE="tetex gphoto2" +inherit kde-dist + +DESCRIPTION="KDE $PV - graphics-related apps" + +KEYWORDS="x86 ~sparc " + +DEPEND="$DEPEND sys-devel/perl + media-gfx/sane-backends + tetex? ( >=app-text/tetex-1.0.7 )" + + +newdepend "gphoto2? ( >=media-gfx/gphoto2-2.0_beta1 >=media-libs/libgpio-20010607 )" + +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +src_unpack() { + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff + patch -p0 < ${FILESDIR}/${P}-gentoo.diff +} + +src_compile() { + + kde_src_compile myconf + + use gphoto2 && myconf="$myconf --with-gphoto2-includes=/usr/include/gphoto2 --with-gphoto2-libraries=/usr/lib/gphoto2" || myconf="$myconf --without-kamera" + use tetex && myconf="$myconf --with-system-kpathsea --with-tex-datadir=/usr/share" + kde_src_compile configure make + +} + + diff --git a/kde-base/kdelibs/ChangeLog b/kde-base/kdelibs/ChangeLog index 9f5781091f40..74cc30d19c0a 100644 --- a/kde-base/kdelibs/ChangeLog +++ b/kde-base/kdelibs/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdelibs # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/ChangeLog,v 1.43 2003/01/15 01:23:01 hannes Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/ChangeLog,v 1.44 2003/01/17 20:31:28 hannes Exp $ + +*kdelibs-2.2.2a-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdelibs-2.2.2a-r1.ebuild: + new version, fixes #12520 14 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdelibs-3.1.ebuild: fixes for kde-3.1 (removed unneeded patches) diff --git a/kde-base/kdelibs/files/kdelibs-2.2.2a-gentoo.diff b/kde-base/kdelibs/files/kdelibs-2.2.2a-gentoo.diff new file mode 100644 index 000000000000..a1b8a0bae2cc --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-2.2.2a-gentoo.diff @@ -0,0 +1,2385 @@ +Index: kdelibs/arts/mcop/debug.cc +diff -u kdelibs/arts/mcop/debug.cc:1.6 kdelibs/arts/mcop/debug.cc:1.6.2.2 +--- arts/mcop/debug.cc:1.6 Wed Jul 25 12:41:35 2001 ++++ arts/mcop/debug.cc Fri Dec 6 16:12:02 2002 +@@ -1,8 +1,11 @@ + /* + +- Copyright (C) 2000 Stefan Westerfeld ++ Copyright (C) 2000-2002 Stefan Westerfeld + stefan@space.twc.de + ++ (see also below for details on the copyright of arts_strdup_printf, ++ which is taken from GLib) ++ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either +@@ -33,8 +36,36 @@ + static char *messageAppName = 0; + static Arts::Mutex *arts_debug_mutex = 0; + ++/* routines for variable length sprintf without buffer overflow (from GLib) */ ++static char* arts_strdup_vprintf(const char *format, va_list args1); ++static char* arts_strdup_printf (const char *format, ...); ++ + namespace Arts { + ++static char * shell_quote(const char *s) ++{ ++ char *result; ++ char *p; ++ p = result = (char *) malloc(strlen(s)*5+1); ++ while(*s) ++ { ++ if (*s == '\'') ++ { ++ *p++ = '\''; ++ *p++ = '"'; ++ *p++ = *s++; ++ *p++ = '"'; ++ *p++ = '\''; ++ } ++ else ++ { ++ *p++ = *s++; ++ } ++ } ++ *p = '\0'; ++ return result; ++} ++ + /* + * Call the graphical application to display a message, if + * defined. Otherwise, send to standard error. Debug messages are +@@ -42,8 +73,9 @@ + * Note that the external application is run in the background to + * avoid blocking the sound server. + */ +-void output_message(Debug::Level level, const char *msg) { +- char buff[1024]; ++static void output_message(Debug::Level level, const char *msg) { ++ char *quoted_msg; ++ char *buff = 0; + + /* default to text output if no message app is defined or if it is a debug message. */ + if (messageAppName == 0 || !strcmp(messageAppName, "") || (level == Debug::lDebug)) +@@ -52,20 +84,27 @@ + return; + } + ++ quoted_msg = shell_quote(msg); + switch (level) { + case Debug::lFatal: +- sprintf(buff, "%s -e \"Sound server fatal error:\n\n%s\" &", messageAppName, msg); ++ buff = arts_strdup_printf("%s -e 'Sound server fatal error:\n\n%s' &", messageAppName, quoted_msg); + break; + case Debug::lWarning: +- sprintf(buff, "%s -w \"Sound server warning message:\n\n%s\" &", messageAppName, msg); ++ buff = arts_strdup_printf("%s -w 'Sound server warning message:\n\n%s' &", messageAppName, quoted_msg); + break; + case Debug::lInfo: +- sprintf(buff, "%s -i \"Sound server informational message:\n\n%s\" &", messageAppName, msg); ++ buff = arts_strdup_printf("%s -i 'Sound server informational message:\n\n%s' &", messageAppName, quoted_msg); + break; + default: + break; // avoid compile warning + } ++ free(quoted_msg); ++ ++ if(buff != 0) ++ { + system(buff); ++ free(buff); ++ } + } + + /* +@@ -76,7 +115,7 @@ + * previously repeated message (if any) and reset the last message and + * count. + */ +-void display_message(Debug::Level level, const char *msg) { ++static void display_message(Debug::Level level, const char *msg) { + static char lastMsg[1024]; + static Debug::Level lastLevel; + static int msgCount = 0; +@@ -90,9 +129,10 @@ + } else { + if (msgCount > 0) + { +- char buff[1024]; +- sprintf(buff, "%s\n(The previous message was repeated %d times.)", lastMsg, msgCount); ++ char *buff; ++ buff = arts_strdup_printf("%s\n(The previous message was repeated %d times.)", lastMsg, msgCount); + output_message(lastLevel, buff); ++ free(buff); + } + strncpy(lastMsg, msg, 1024); + lastLevel = level; +@@ -140,12 +180,15 @@ + + void Arts::Debug::fatal(const char *fmt, ...) + { +- char buff[1024]; ++ char *buff; + va_list ap; ++ + va_start(ap, fmt); +- vsprintf(buff, fmt, ap); ++ buff = arts_strdup_vprintf(fmt, ap); + va_end(ap); ++ + display_message(Debug::lFatal, buff); ++ free(buff); + + if(arts_debug_abort) abort(); + exit(1); +@@ -155,12 +198,15 @@ + { + if(lWarning >= arts_debug_level) + { +- char buff[1024]; ++ char *buff; + va_list ap; ++ + va_start(ap, fmt); +- vsprintf(buff, fmt, ap); ++ buff = arts_strdup_vprintf(fmt, ap); + va_end(ap); ++ + display_message(Debug::lWarning, buff); ++ free(buff); + } + } + +@@ -168,12 +214,15 @@ + { + if(lInfo >= arts_debug_level) + { +- char buff[1024]; ++ char *buff; + va_list ap; ++ + va_start(ap, fmt); +- vsprintf(buff, fmt, ap); ++ buff = arts_strdup_vprintf(fmt, ap); + va_end(ap); ++ + display_message(Debug::lInfo, buff); ++ free(buff); + } + } + +@@ -181,12 +230,15 @@ + { + if(lDebug >= arts_debug_level) + { +- char buff[1024]; ++ char *buff; + va_list ap; ++ + va_start(ap, fmt); +- vsprintf(buff, fmt, ap); ++ buff = arts_strdup_vprintf(fmt, ap); + va_end(ap); ++ + display_message(Debug::lDebug, buff); ++ free(buff); + } + } + +@@ -209,4 +261,551 @@ + + delete arts_debug_mutex; + arts_debug_mutex = 0; ++} ++ ++/* ++ * For the sake of portability (snprintf is non-portable), what follows is an ++ * implementation of a variant g_strdup_printf, to format debug messages of ++ * an arbitary length appropriately. This is reduntant with flow/gsl/gslglib.c, ++ * however, as libmcop doesn't necessarily link against gslglib.c, this is a ++ * more-or-less complete copy. ++ */ ++ ++/* GLIB - Library of useful routines for C programming ++ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald ++ * ++ * GScanner: Flexible lexical scanner for general purpose. ++ * Copyright (C) 1997, 1998 Tim Janik ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++/* ++ * Modified by the GLib Team and others 1997-2000. See the AUTHORS ++ * file for a list of people on the GLib Team. See the ChangeLog ++ * files for a list of changes. These files are distributed with ++ * GLib at ftp://ftp.gtk.org/pub/gtk/. ++ */ ++ ++ ++#include <sys/types.h> ++#include <stdarg.h> ++#include <string.h> ++ ++#define g_warning printf ++#define g_strerror strerror ++ ++/*--- gslglib.h ---*/ ++ ++#include <limits.h> ++#include <float.h> ++#include <stddef.h> ++#include <stdarg.h> ++ ++/* --- GLib typedefs --- */ ++typedef void* gpointer; ++typedef const void* gconstpointer; ++typedef char gchar; ++typedef unsigned char guchar; ++typedef signed short gshort; ++typedef unsigned short gushort; ++typedef signed int gint; ++typedef unsigned int guint; ++typedef signed long glong; ++typedef unsigned long gulong; ++typedef float gfloat; ++typedef double gdouble; ++typedef size_t gsize; ++typedef gchar gint8; ++typedef guchar guint8; ++typedef gshort gint16; ++typedef gushort guint16; ++typedef gint gint32; ++typedef guint guint32; ++typedef gint gboolean; ++typedef gint32 GTime; ++#ifdef __alpha ++typedef long int gint64; ++typedef unsigned long int guint64; ++#else ++typedef long long int gint64; ++typedef unsigned long long int guint64; ++#endif ++typedef struct _GString GString; ++ ++/* --- standard macros --- */ ++#ifndef ABS ++#define ABS(a) ((a) > 0 ? (a) : -(a)) ++#endif ++#ifndef MAX ++#define MAX(a,b) ((a) > (b) ? (a) : (b)) ++#endif ++#ifndef MIN ++#define MIN(a,b) ((a) < (b) ? (a) : (b)) ++#endif ++#ifndef CLAMP ++#define CLAMP(v,l,h) ((v) < (l) ? (l) : (v) > (h) ? (h) : (v)) ++#endif ++#ifndef FALSE ++#define FALSE 0 ++#endif ++#ifndef TRUE ++#define TRUE (!FALSE) ++#endif ++#ifndef NULL ++#define NULL ((void*) 0) ++#endif ++ ++/* --- configure stuff!!! --- */ ++#ifdef WORDS_BIGENDIAN ++#define G_BYTE_ORDER G_BIG_ENDIAN ++#else ++#define G_BYTE_ORDER G_LITTLE_ENDIAN ++#endif ++ ++/* #define GLIB_HAVE_STPCPY 1 */ ++/* Define G_VA_COPY() to do the right thing for copying va_list variables. ++ * glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy. ++ */ ++#if !defined (G_VA_COPY) ++# if defined (__GNUC__) && ( defined (__PPC__) || defined (__s390__) ) && (defined (_CALL_SYSV) || defined (_WIN32) || defined (__s390__) ) ++# define G_VA_COPY(ap1, ap2) (*(ap1) = *(ap2)) ++# elif defined (G_VA_COPY_AS_ARRAY) ++# define G_VA_COPY(ap1, ap2) g_memmove ((ap1), (ap2), sizeof (va_list)) ++# else /* va_list is a pointer */ ++# define G_VA_COPY(ap1, ap2) ((ap1) = (ap2)) ++# endif /* va_list is a pointer */ ++#endif /* !G_VA_COPY */ ++ ++/* --- glib macros --- */ ++#define G_MINFLOAT FLT_MIN ++#define G_MAXFLOAT FLT_MAX ++#define G_MINDOUBLE DBL_MIN ++#define G_MAXDOUBLE DBL_MAX ++#define G_MINSHORT SHRT_MIN ++#define G_MAXSHORT SHRT_MAX ++#define G_MAXUSHORT USHRT_MAX ++#define G_MININT INT_MIN ++#define G_MAXINT INT_MAX ++#define G_MAXUINT UINT_MAX ++#define G_MINLONG LONG_MIN ++#define G_MAXLONG LONG_MAX ++#define G_MAXULONG ULONG_MAX ++#define G_USEC_PER_SEC 1000000 ++#define G_LITTLE_ENDIAN 1234 ++#define G_BIG_ENDIAN 4321 ++ ++#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string) ++#define G_STRINGIFY_ARG(contents) #contents ++#if defined __GNUC__ && !defined __cplusplus ++# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()" ++#else ++# define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ++#endif ++ ++/* subtract from biased_exponent to form base2 exponent (normal numbers) */ ++typedef union _GDoubleIEEE754 GDoubleIEEE754; ++typedef union _GFloatIEEE754 GFloatIEEE754; ++#define G_IEEE754_FLOAT_BIAS (127) ++#define G_IEEE754_DOUBLE_BIAS (1023) ++/* multiply with base2 exponent to get base10 exponent (nomal numbers) */ ++#define G_LOG_2_BASE_10 (0.30102999566398119521) ++#if G_BYTE_ORDER == G_LITTLE_ENDIAN ++union _GFloatIEEE754 ++{ ++ gfloat v_float; ++ struct { ++ guint mantissa : 23; ++ guint biased_exponent : 8; ++ guint sign : 1; ++ } mpn; ++}; ++union _GDoubleIEEE754 ++{ ++ gdouble v_double; ++ struct { ++ guint mantissa_low : 32; ++ guint mantissa_high : 20; ++ guint biased_exponent : 11; ++ guint sign : 1; ++ } mpn; ++}; ++#elif G_BYTE_ORDER == G_BIG_ENDIAN ++union _GFloatIEEE754 ++{ ++ gfloat v_float; ++ struct { ++ guint sign : 1; ++ guint biased_exponent : 8; ++ guint mantissa : 23; ++ } mpn; ++}; ++union _GDoubleIEEE754 ++{ ++ gdouble v_double; ++ struct { ++ guint sign : 1; ++ guint biased_exponent : 11; ++ guint mantissa_high : 20; ++ guint mantissa_low : 32; ++ } mpn; ++}; ++#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */ ++#error unknown ENDIAN type ++#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */ ++ ++#include <errno.h> ++#include <stdlib.h> ++#include <unistd.h> ++#include <stdio.h> ++ ++#define GLIB_SIZEOF_INTMAX (8 /* educated guess */) ++ ++typedef struct ++{ ++ guint min_width; ++ guint precision; ++ gboolean alternate_format, zero_padding, adjust_left, locale_grouping; ++ gboolean add_space, add_sign, possible_sign, seen_precision; ++ gboolean mod_half, mod_long, mod_extra_long; ++} PrintfArgSpec; ++ ++ ++static gsize ++printf_string_upper_bound (const gchar *format, ++ gboolean may_warn, ++ va_list args) ++{ ++ static gboolean honour_longs = sizeof(long) > 4 || sizeof(void*) > 4; ++ gsize len = 1; ++ ++ if (!format) ++ return len; ++ ++ while (*format) ++ { ++ register gchar c = *format++; ++ ++ if (c != '%') ++ len += 1; ++ else /* (c == '%') */ ++ { ++ PrintfArgSpec spec = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ++ gboolean seen_l = FALSE, conv_done = FALSE; ++ gsize conv_len = 0; ++ const gchar *spec_start = format; ++ ++ do ++ { ++ c = *format++; ++ switch (c) ++ { ++ GDoubleIEEE754 u_double; ++ guint v_uint; ++ gint v_int; ++ const gchar *v_string; ++ ++ /* beware of positional parameters ++ */ ++ case '$': ++ if (may_warn) ++ g_warning (G_STRLOC ": unable to handle positional parameters (%%n$)"); ++ len += 1024; /* try adding some safety padding */ ++ break; ++ ++ /* parse flags ++ */ ++ case '#': ++ spec.alternate_format = TRUE; ++ break; ++ case '0': ++ spec.zero_padding = TRUE; ++ break; ++ case '-': ++ spec.adjust_left = TRUE; ++ break; ++ case ' ': ++ spec.add_space = TRUE; ++ break; ++ case '+': ++ spec.add_sign = TRUE; ++ break; ++ case '\'': ++ spec.locale_grouping = TRUE; ++ break; ++ ++ /* parse output size specifications ++ */ ++ case '.': ++ spec.seen_precision = TRUE; ++ break; ++ case '1': ++ case '2': ++ case '3': ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ case '8': ++ case '9': ++ v_uint = c - '0'; ++ c = *format; ++ while (c >= '0' && c <= '9') ++ { ++ format++; ++ v_uint = v_uint * 10 + c - '0'; ++ c = *format; ++ } ++ if (spec.seen_precision) ++ spec.precision = MAX (spec.precision, v_uint); ++ else ++ spec.min_width = MAX (spec.min_width, v_uint); ++ break; ++ case '*': ++ v_int = va_arg (args, int); ++ if (spec.seen_precision) ++ { ++ /* forget about negative precision */ ++ if (v_int >= 0) ++ spec.precision = MAX (spec.precision, (unsigned)v_int); ++ } ++ else ++ { ++ if (v_int < 0) ++ { ++ v_int = - v_int; ++ spec.adjust_left = TRUE; ++ } ++ spec.min_width = MAX (spec.min_width, (unsigned)v_int); ++ } ++ break; ++ ++ /* parse type modifiers ++ */ ++ case 'h': ++ spec.mod_half = TRUE; ++ break; ++ case 'l': ++ if (!seen_l) ++ { ++ spec.mod_long = TRUE; ++ seen_l = TRUE; ++ break; ++ } ++ /* else, fall through */ ++ case 'L': ++ case 'q': ++ spec.mod_long = TRUE; ++ spec.mod_extra_long = TRUE; ++ break; ++ case 'z': ++ case 'Z': ++ if (sizeof(size_t)) ++ { ++ spec.mod_long = TRUE; ++ spec.mod_extra_long = TRUE; ++ } ++ break; ++ case 't': ++ if (sizeof(ptrdiff_t) > 4) ++ { ++ spec.mod_long = TRUE; ++ spec.mod_extra_long = TRUE; ++ } ++ break; ++ case 'j': ++ if (GLIB_SIZEOF_INTMAX > 4) ++ { ++ spec.mod_long = TRUE; ++ spec.mod_extra_long = TRUE; ++ } ++ break; ++ ++ /* parse output conversions ++ */ ++ case '%': ++ conv_len += 1; ++ break; ++ case 'O': ++ case 'D': ++ case 'I': ++ case 'U': ++ /* some C libraries feature long variants for these as well? */ ++ spec.mod_long = TRUE; ++ /* fall through */ ++ case 'o': ++ conv_len += 2; ++ /* fall through */ ++ case 'd': ++ case 'i': ++ conv_len += 1; /* sign */ ++ /* fall through */ ++ case 'u': ++ conv_len += 4; ++ /* fall through */ ++ case 'x': ++ case 'X': ++ spec.possible_sign = TRUE; ++ conv_len += 10; ++ if (spec.mod_long && honour_longs) ++ conv_len *= 2; ++ if (spec.mod_extra_long) ++ conv_len *= 2; ++ if (spec.mod_extra_long) ++ { ++ (void) va_arg (args, gint64); ++ } ++ else if (spec.mod_long) ++ (void) va_arg (args, long); ++ else ++ (void) va_arg (args, int); ++ break; ++ case 'A': ++ case 'a': ++ /* 0x */ ++ conv_len += 2; ++ /* fall through */ ++ case 'g': ++ case 'G': ++ case 'e': ++ case 'E': ++ case 'f': ++ spec.possible_sign = TRUE; ++ /* n . dddddddddddddddddddddddd E +- eeee */ ++ conv_len += 1 + 1 + MAX (24, spec.precision) + 1 + 1 + 4; ++ if (may_warn && spec.mod_extra_long) ++ g_warning (G_STRLOC ": unable to handle long double, collecting double only"); ++#ifdef HAVE_LONG_DOUBLE ++#error need to implement special handling for long double ++#endif ++ u_double.v_double = va_arg (args, double); ++ /* %f can expand up to all significant digits before '.' (308) */ ++ if (c == 'f' && ++ u_double.mpn.biased_exponent > 0 && u_double.mpn.biased_exponent < 2047) ++ { ++ gint exp = u_double.mpn.biased_exponent; ++ ++ exp -= G_IEEE754_DOUBLE_BIAS; ++ exp = (gint)(exp * G_LOG_2_BASE_10 + 1); ++ conv_len += ABS (exp); /* exp can be <0 */ ++ } ++ /* some printf() implementations require extra padding for rounding */ ++ conv_len += 2; ++ /* we can't really handle locale specific grouping here */ ++ if (spec.locale_grouping) ++ conv_len *= 2; ++ break; ++ case 'C': ++ spec.mod_long = TRUE; ++ /* fall through */ ++ case 'c': ++ conv_len += spec.mod_long ? MB_LEN_MAX : 1; ++ (void) va_arg (args, int); ++ break; ++ case 'S': ++ spec.mod_long = TRUE; ++ /* fall through */ ++ case 's': ++ v_string = va_arg (args, char*); ++ if (!v_string) ++ conv_len += 8; /* hold "(null)" */ ++ else if (spec.seen_precision) ++ conv_len += spec.precision; ++ else ++ conv_len += strlen (v_string); ++ conv_done = TRUE; ++ if (spec.mod_long) ++ { ++ if (may_warn) ++ g_warning (G_STRLOC": unable to handle wide char strings"); ++ len += 1024; /* try adding some safety padding */ ++ } ++ break; ++ case 'P': /* do we actually need this? */ ++ /* fall through */ ++ case 'p': ++ spec.alternate_format = TRUE; ++ conv_len += 10; ++ if (honour_longs) ++ conv_len *= 2; ++ /* fall through */ ++ case 'n': ++ conv_done = TRUE; ++ (void) va_arg (args, void*); ++ break; ++ case 'm': ++ /* there's not much we can do to be clever */ ++ v_string = g_strerror (errno); ++ v_uint = v_string ? strlen (v_string) : 0; ++ conv_len += MAX (256, v_uint); ++ break; ++ ++ /* handle invalid cases ++ */ ++ case '\000': ++ /* no conversion specification, bad bad */ ++ conv_len += format - spec_start; ++ break; ++ default: ++ if (may_warn) ++ g_warning (G_STRLOC": unable to handle `%c' while parsing format", ++ c); ++ break; ++ } ++ conv_done |= conv_len > 0; ++ } ++ while (!conv_done); ++ /* handle width specifications */ ++ conv_len = MAX (conv_len, MAX (spec.precision, spec.min_width)); ++ /* handle flags */ ++ conv_len += spec.alternate_format ? 2 : 0; ++ conv_len += (spec.add_space || spec.add_sign || spec.possible_sign); ++ /* finally done */ ++ len += conv_len; ++ } /* else (c == '%') */ ++ } /* while (*format) */ ++ ++ return len; ++} ++ ++static char* ++arts_strdup_vprintf (const char *format, va_list args1) ++{ ++ gchar *buffer; ++ va_list args2; ++ ++ G_VA_COPY (args2, args1); ++ ++ buffer = (gchar *)malloc (printf_string_upper_bound (format, TRUE, args1)); ++ ++ vsprintf (buffer, format, args2); ++ va_end (args2); ++ ++ return buffer; ++} ++ ++char* ++arts_strdup_printf (const char *format, ...) ++{ ++ gchar *buffer; ++ va_list args; ++ ++ va_start (args, format); ++ buffer = arts_strdup_vprintf (format, args); ++ va_end (args); ++ ++ return buffer; + } +Index: kdelibs/dcop/dcopc.c +diff -u kdelibs/dcop/dcopc.c:1.17 kdelibs/dcop/dcopc.c:1.17.2.1 +--- dcop/dcopc.c:1.17 Wed Apr 18 18:18:55 2001 ++++ dcop/dcopc.c Sat Dec 7 18:48:29 2002 +@@ -36,6 +36,9 @@ + #include "dcopglobal.h" + #include "dcopc.h" + ++ ++#define BUFFER_SIZE 1024 ++ + enum { + DCOP_REPLY_PENDING, + DCOP_REPLY_OK, +@@ -133,7 +136,11 @@ + int length; + char * pos = dcop_read_int(buf, &length); + fprintf(stderr, "dcop_read_string: length == %d\n", length); ++ + *output = (char *)malloc(length); ++ if (*output == NULL) ++ return pos; ++ + memcpy(*output, pos, length); + return pos + length; + } +@@ -215,6 +222,8 @@ + + fprintf(stderr, "dcop_process_message(): length == %ld\n", length); + buf = (char *)malloc(length); ++ if (buf == NULL) ++ return; + status = IceReadData(dcop_ice_conn, length, buf); + if (False == status) { + fprintf(stderr, "dcop_process_message(): IceReadData failed\n"); +@@ -253,6 +262,9 @@ + fprintf(stderr, "dcop_process_message(): DCOPSend received\n"); + + buf = (char *)malloc(length); ++ if (buf == NULL) ++ return; ++ + IceReadData(dcop_ice_conn, length, buf); + + pos = buf; +@@ -307,6 +319,8 @@ + + struct DCOPMsg * pMsgPtr = 0; + ++ static const char sAnonymous = "anonymous"; ++ + if (0 == dcop_ice_conn) { + fprintf(stderr, "Try running dcop_attach(), moron\n"); + return False; +@@ -338,10 +352,19 @@ + * as last field into the dcop msg header ;-) + */ + +- header = (char *)malloc(1024); ++ headerLength = strlen(sAnonymous) + 1 + ++ strlen(receiving_app) + 1 + ++ strlen(object) + 1 + ++ strlen(function) + 1 + ++ 4*5; /* 4 string lengths + 1 int */ ++ ++ header = (char *)malloc(headerLength); ++ if (header == NULL) ++ return False; ++ + pos = header; + +- pos = dcop_write_string(pos, "anonymous"); ++ pos = dcop_write_string(pos, sAnonymous); + pos = dcop_write_string(pos, receiving_app); + pos = dcop_write_string(pos, object); + pos = dcop_write_string(pos, function); +@@ -423,6 +446,8 @@ + temp += 1024; /* Extra space for marshalling overhead */ + + outputData = (char *)malloc(temp); ++ if (outputData == NULL) ++ return False; + + temp = 0; + +@@ -556,10 +581,16 @@ + /* Leave room for "-pid" */ + int len = strlen(app_name) + 64; + dcop_requested_name = (char *)malloc(len); ++ if (dcop_requested_name == NULL) ++ return NULL; ++ + snprintf(dcop_requested_name, len, "%s-%ld", app_name, (long)getpid()); + } + + data = (char *)malloc(strlen(dcop_requested_name) + 42); ++ if (data == NULL) ++ return NULL; ++ + pos = data; + pos = dcop_write_string(pos, dcop_requested_name); + dataLength = pos - data; +@@ -616,6 +647,7 @@ + return (dcop_major_opcode >= 0) ? True : False; + } + ++ + /***************************************************************************/ + + Bool +@@ -628,10 +660,10 @@ + char * homeDir = 0L; + char * display = 0L; + char * dcopServer = 0L; +- char errBuf[1024]; +- char fileName[512]; +- char hostName[256]; +- char displayName[256]; ++ char errBuf[BUFFER_SIZE]; ++ char fileName[BUFFER_SIZE]; ++ char hostName[BUFFER_SIZE]; ++ char displayName[BUFFER_SIZE]; + char * i; + + homeDir = getenv("HOME"); +@@ -644,7 +676,9 @@ + if (NULL == display) + return False; + +- strcpy(displayName, display); ++ strncpy(displayName, display, sizeof(displayName)); ++ displayName[sizeof(displayName) - 1] = 0; ++ + if((i = strrchr(displayName, '.')) > strrchr(displayName, ':') && i) + *i = '\0'; + +@@ -668,9 +702,12 @@ + return False; + } + +- dcopServer = (char *)malloc(1024); ++ dcopServer = (char *)malloc(BUFFER_SIZE); ++ if (dcopServer == NULL) ++ return False; + +- bytesRead = fread((void *)dcopServer, sizeof(char), 1024, f); ++ bytesRead = fread((void *)dcopServer, sizeof(char), BUFFER_SIZE, f); ++ dcopServer[BUFFER_SIZE - 1] = 0; + + if (0 == bytesRead) + return False; +@@ -719,7 +756,7 @@ + int majorVersion = 0; + int minorVersion = 0; + int status = 0; +- char errBuf[1024]; ++ char errBuf[BUFFER_SIZE]; + + status = + IceProtocolSetup( +@@ -731,7 +768,7 @@ + &(minorVersion), + &(vendor), + &(release), +- 1024, ++ BUFFER_SIZE, + errBuf + ); + +Index: kdelibs/dcop/dcopserver.cpp +diff -u kdelibs/dcop/dcopserver.cpp:1.130 kdelibs/dcop/dcopserver.cpp:1.130.2.1 +--- dcop/dcopserver.cpp:1.130 Thu Aug 2 19:23:20 2001 ++++ dcop/dcopserver.cpp Sat Dec 7 18:48:31 2002 +@@ -475,12 +475,15 @@ + char tempFile[PATH_MAX]; + char *tmp; + +- sprintf (tempFile, "%s/%sXXXXXX", path, prefix); ++ snprintf (tempFile, PATH_MAX, "%s/%sXXXXXX", path, prefix); + tmp = (char *) mktemp (tempFile); + if (tmp) + { + char *ptr = (char *) malloc (strlen (tmp) + 1); +- strcpy (ptr, tmp); ++ if (ptr != NULL) ++ { ++ strcpy (ptr, tmp); ++ } + return (ptr); + } + else +@@ -490,7 +493,7 @@ + char tempFile[PATH_MAX]; + char *ptr; + +- sprintf (tempFile, "%s/%sXXXXXX", path, prefix); ++ snprintf (tempFile, PATH_MAX, "%s/%sXXXXXX", path, prefix); + ptr = static_cast<char *>(malloc(strlen(tempFile) + 1)); + if (ptr != NULL) + { +@@ -541,7 +544,7 @@ + FILE *removefp = NULL; + const char *path; + int original_umask; +- char command[256]; ++ char command[PATH_MAX + 32]; + int i; + #ifdef HAVE_MKSTEMP + int fd; +@@ -613,7 +616,7 @@ + + umask (original_umask); + +- sprintf (command, "iceauth source %s", addAuthFile); ++ snprintf (command, PATH_MAX + 32, "iceauth source %s", addAuthFile); + system (command); + + unlink(addAuthFile); +Index: kdelibs/dcop/KDE-ICE/Xtrans.c +diff -u kdelibs/dcop/KDE-ICE/Xtrans.c:1.2 kdelibs/dcop/KDE-ICE/Xtrans.c:1.2.2.1 +--- dcop/KDE-ICE/Xtrans.c:1.2 Mon May 14 08:32:16 2001 ++++ dcop/KDE-ICE/Xtrans.c Sat Dec 7 18:48:25 2002 +@@ -1021,7 +1021,7 @@ + if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN) + continue; + +- sprintf(buffer,"%s/:%s", trans->TransName, port ? port : ""); ++ snprintf(buffer, 256, "%s/:%s", trans->TransName, port ? port : ""); + + PRMSG (5,"MakeAllCOTSServerListeners: opening %s\n", + buffer, 0, 0); +@@ -1123,7 +1123,7 @@ + if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN) + continue; + +- sprintf(buffer,"%s/:%s", trans->TransName, port ? port : ""); ++ snprintf(buffer, 256, "%s/:%s", trans->TransName, port ? port : ""); + + PRMSG (5,"MakeAllCLTSServerListeners: opening %s\n", + buffer, 0, 0); +Index: kdelibs/dcop/KDE-ICE/Xtransutil.c +diff -u kdelibs/dcop/KDE-ICE/Xtransutil.c:1.4 kdelibs/dcop/KDE-ICE/Xtransutil.c:1.4.2.1 +--- dcop/KDE-ICE/Xtransutil.c:1.4 Sun May 6 18:35:54 2001 ++++ dcop/KDE-ICE/Xtransutil.c Sat Dec 7 18:48:26 2002 +@@ -367,9 +367,9 @@ + + if (np = getnodebyaddr(saddr->sdn_add.a_addr, + saddr->sdn_add.a_len, AF_DECnet)) { +- sprintf(addrbuf, "%s:", np->n_name); ++ snprintf(addrbuf, 256, "%s:", np->n_name); + } else { +- sprintf(addrbuf, "%s:", dnet_htoa(&saddr->sdn_add)); ++ snprintf(addrbuf, 256, "%s:", dnet_htoa(&saddr->sdn_add)); + } + addr = addrbuf; + break; +Index: kdelibs/dcop/KDE-ICE/process.c +diff -u kdelibs/dcop/KDE-ICE/process.c:1.2 kdelibs/dcop/KDE-ICE/process.c:1.2.2.1 +--- dcop/KDE-ICE/process.c:1.2 Tue Mar 13 02:36:38 2001 ++++ dcop/KDE-ICE/process.c Sat Dec 7 18:48:28 2002 +@@ -734,7 +734,7 @@ + case IceMajorOpcodeDuplicate: + + prefix = "The major opcode was already used : "; +- errorStr = (char *) malloc (strlen (prefix) + 2); ++ errorStr = (char *) malloc (strlen (prefix) + 16); + sprintf (errorStr, "%s%d", prefix, (int) *pData); + break; + +Index: kdelibs/kdecore/kapp.cpp +diff -u kdelibs/kdecore/kapp.cpp:1.454.2.2 kdelibs/kdecore/kapp.cpp:1.454.2.3 +--- kdecore/kapp.cpp:1.454.2.2 Sun Sep 2 21:36:47 2001 ++++ kdecore/kapp.cpp Wed Dec 5 02:42:24 2001 +@@ -2163,6 +2163,8 @@ + int pos = dirName.findRev('/'); + if ( pos == -1 ) + return false; // No path in argument. This is evil, we won't allow this ++ else if ( pos == 0 ) // don't turn e.g. /root into an empty string ++ pos = 1; + + dirName.truncate(pos); // strip everything starting from the last '/' + +Index: kdelibs/kdecore/kdebug.cpp +diff -u kdelibs/kdecore/kdebug.cpp:1.97 kdelibs/kdecore/kdebug.cpp:1.97.2.2 +--- kdecore/kdebug.cpp:1.97 Sun Jul 29 14:58:58 2001 ++++ kdecore/kdebug.cpp Fri Dec 6 03:31:52 2002 +@@ -276,7 +276,7 @@ + } + case 3: // syslog + { +- syslog( nPriority, data); ++ syslog( nPriority, "%s", data); + } + case 4: // nothing + { +@@ -448,7 +448,8 @@ + char buf[4096]; + va_list arguments; + va_start( arguments, format ); +- vsprintf( buf, format, arguments ); ++ buf[sizeof(buf)-1] = '\0'; ++ vsnprintf( buf, sizeof(buf)-1, format, arguments ); + va_end(arguments); + *this << buf; + return *this; +Index: kdelibs/kdecore/ktempfile.cpp +diff -u kdelibs/kdecore/ktempfile.cpp:1.19.2.1 kdelibs/kdecore/ktempfile.cpp:1.19.2.2 +--- kdecore/ktempfile.cpp:1.19.2.1 Sat Aug 11 07:12:17 2001 ++++ kdecore/ktempfile.cpp Mon Dec 3 01:48:46 2001 +@@ -90,6 +90,9 @@ + KTempFile::create(const QString &filePrefix, const QString &fileExtension, + int mode) + { ++ // make sure the random seed is randomized ++ (void) KApplication::random(); ++ + QCString ext = QFile::encodeName(fileExtension); + QCString nme = QFile::encodeName(filePrefix) + "XXXXXX" + ext; + if((mFd = mkstemps(nme.data(), ext.length())) < 0) +Index: kdelibs/kdecore/netsupp.cpp +diff -u kdelibs/kdecore/netsupp.cpp:1.21.2.3 kdelibs/kdecore/netsupp.cpp:1.21.2.4 +--- kdecore/netsupp.cpp:1.21.2.3 Wed Oct 24 21:43:45 2001 ++++ kdecore/netsupp.cpp Fri Dec 13 11:18:08 2002 +@@ -926,7 +926,7 @@ + + if (servlen && serv != NULL) + *serv = '\0'; +- if (host == NULL || hostlen < strlen(s._sun->sun_path)) ++ if (host != NULL && hostlen > strlen(s._sun->sun_path)) + strcpy(host, s._sun->sun_path); + + return 0; +@@ -1008,7 +1008,7 @@ + { + sprintf(buf2, "%u.%u.%u.%u", data[0], data[1], data[2], data[3]); + +- if (len >= strlen(buf2)) ++ if (len > strlen(buf2)) + { + strcpy(buf, buf2); + return buf; +@@ -1077,7 +1077,7 @@ + } + } + +- if (strlen(buf2) <= len) ++ if (strlen(buf2) < len) + { + strcpy(buf, buf2); + return buf; +Index: kdelibs/kdecore/tests/kmemtest.cpp +diff -u kdelibs/kdecore/tests/kmemtest.cpp:1.1 kdelibs/kdecore/tests/kmemtest.cpp:1.1.6.1 +--- kdecore/tests/kmemtest.cpp:1.1 Tue Feb 22 16:06:49 2000 ++++ kdecore/tests/kmemtest.cpp Sat Dec 7 18:48:32 2002 +@@ -165,9 +165,9 @@ + char buf[200]; + + if (argc >=3) +- sprintf(buf, "%s &", argv[2]); ++ snprintf(buf, 200, "%s &", argv[2]); + else +- sprintf(buf, "%s &", argv[0]); ++ snprintf(buf, 200, "%s &", argv[0]); + + printf("Waiting for memory usage to settle down....\n"); + long prev = showTotalMem(); +Index: kdelibs/kdeprint/lpd/make_driver_db_lpd.c +diff -u kdelibs/kdeprint/lpd/make_driver_db_lpd.c:1.1 kdelibs/kdeprint/lpd/make_driver_db_lpd.c:1.1.2.1 +--- kdeprint/lpd/make_driver_db_lpd.c:1.1 Mon Apr 2 15:21:07 2001 ++++ kdeprint/lpd/make_driver_db_lpd.c Sat Dec 7 18:48:33 2002 +@@ -82,7 +82,7 @@ + c2 = strchr(c+12,'}'); + if (c1 && c2) + { +- char model[256], manuf[256]; ++ char model[BUFFER_SIZE], manuf[BUFFER_SIZE]; + char *c3; + + *c2 = 0; +Index: kdelibs/kdeprint/management/kmwlpd.cpp +diff -u kdelibs/kdeprint/management/kmwlpd.cpp:1.11 kdelibs/kdeprint/management/kmwlpd.cpp:1.11.2.1 +--- kdeprint/management/kmwlpd.cpp:1.11 Fri Aug 3 21:59:21 2001 ++++ kdeprint/management/kmwlpd.cpp Sat Dec 7 18:48:34 2002 +@@ -122,12 +122,15 @@ + } + + char buf[1024] = {0}; +- int n; ++ int n, tot(1); + kdDebug() << "reading" << endl; + while ((n=::read(sock,res,63)) > 0) + { + res[n] = 0; ++ tot += n; + kdDebug() << buf << endl; ++ if (tot >= 1024) ++ break; + strncat(buf,res,1023); + } + close(sock); +Index: kdelibs/kdeprint/management/smbview.cpp +diff -u kdelibs/kdeprint/management/smbview.cpp:1.3 kdelibs/kdeprint/management/smbview.cpp:1.3.2.1 +--- kdeprint/management/smbview.cpp:1.3 Mon Apr 2 21:01:00 2001 ++++ kdeprint/management/smbview.cpp Fri Dec 13 12:23:22 2002 +@@ -19,6 +19,9 @@ + + #include "smbview.h" + ++#include <config.h> ++#include <stdlib.h> ++ + #include <kprocess.h> + #include <qheader.h> + #include <qapplication.h> +@@ -117,20 +120,36 @@ + { + if (on && item->childCount() == 0) + { ++ QCString oldpw = getenv("PASSWD"); ++ QCString olduser = getenv("USER"); ++ QCString pw = m_password.local8Bit(); ++ setenv("PASSWD", pw, 1); ++ QCString user = m_login.local8Bit(); ++ setenv("USER", user, 1); + if (item->depth() == 0) + { // opening group + m_current = item; +- QString cmd = QString("nmblookup -M %1 -S | grep '<20>' | awk '{print $1}' | xargs -iserv_name smbclient -L serv_name -W %2 %3").arg(item->text(0)).arg(item->text(0)).arg(smbPasswordString(m_login,m_password)); ++ QString cmd = QString("nmblookup -M %1 -S | grep '<20>' | awk '{print $1}' | xargs -iserv_name ").arg(KShellProcess::quote(item->text(0))); ++ cmd += QString("smbclient -L serv_name -N -W %1").arg(KShellProcess::quote(item->text(0))); + m_proc->setExecutable(cmd); + startProcess(ServerListing); + } + else if (item->depth() == 1) + { // opening server + m_current = item; +- QString cmd = QString("smbclient -L %1 -W %2 %3").arg(item->text(0)).arg(item->parent()->text(0)).arg(smbPasswordString(m_login,m_password)); ++ QString cmd = QString("smbclient -L %1 ").arg(KShellProcess::quote(item->text(0))); ++ cmd += QString("-N -W %1").arg(KShellProcess::quote(item->parent()->text(0))); + m_proc->setExecutable(cmd); + startProcess(ShareListing); + } ++ if (oldpw.isNull()) ++ unsetenv("PASSWD"); ++ else ++ setenv("PASSWD", oldpw, 1); ++ if (olduser.isNull()) ++ unsetenv("USER"); ++ else ++ setenv("USER", olduser, 1); + } + QListView::setOpen(item,on); + } +Index: kdelibs/kdoctools/meinproc.cpp +diff -u kdelibs/kdoctools/meinproc.cpp:1.20.2.2 kdelibs/kdoctools/meinproc.cpp:1.20.2.3 +--- kdoctools/meinproc.cpp:1.20.2.2 Fri Nov 9 08:50:49 2001 ++++ kdoctools/meinproc.cpp Fri Dec 6 18:07:49 2002 +@@ -24,6 +24,7 @@ + #include <kdebug.h> + #include <qtextcodec.h> + #include <qfileinfo.h> ++#include <kprocess.h> + + extern int xmlLoadExtDtdDefaultValue; + +@@ -145,7 +146,11 @@ + exe = locate( "exe", "xmllint" ); + } + if ( !::access( QFile::encodeName( exe ), X_OK ) ) { +- FILE *xmllint = popen( QString( exe + " --catalogs --valid --noout %1 2>&1" ).arg( file.fileName() ).local8Bit().data(), "r"); ++ QString cmd = exe; ++ cmd += " --catalogs --valid --noout "; ++ cmd += KShellProcess::quote(file.fileName()); ++ cmd += " 2>&1"; ++ FILE *xmllint = popen( QFile::encodeName( cmd ), "r"); + bool noout = true; + while ( !feof( xmllint ) ) { + int c; +Index: kdelibs/kdoctools/xslt.cpp +diff -u kdelibs/kdoctools/xslt.cpp:1.41.2.2 kdelibs/kdoctools/xslt.cpp:1.41.2.4 +--- kdoctools/xslt.cpp:1.41.2.2 Fri Nov 9 08:50:49 2001 ++++ kdoctools/xslt.cpp Wed Dec 11 14:09:47 2002 +@@ -95,7 +95,9 @@ + /* if (contents.left(5) != "<?xml") { + fprintf(stderr, "xmlizer\n"); + INFO(i18n("XMLize document")); +- FILE *p = popen(QString::fromLatin1("xmlizer %1").arg(pat).latin1(), "r"); ++ QString cmd = "xmlizer "; ++ cmd += KProcess::quote(pat); ++ FILE *p = popen(QFile::encodeName(cmd), "r"); + xmlFile.open(IO_ReadOnly, p); + char buffer[5001]; + contents.truncate(0); +@@ -403,12 +405,16 @@ + for ( uint i = 0; i < len; i++ ) { + QCString test = locale->fromUnicode( part.mid( i, 1 ) ); + if ( locale->toUnicode( test ) == part.mid( i, 1 ) ) { ++ if (buffer_len + test.length() + 1 > sizeof(buffer)) ++ break; + strcpy( buffer + buffer_len, test.data() ); + buffer_len += test.length(); + } else { + QString res; + res.sprintf( "&#%d;", part.at( i ).unicode() ); + test = locale->fromUnicode( res ); ++ if (buffer_len + test.length() + 1 > sizeof(buffer)) ++ break; + strcpy( buffer + buffer_len, test.data() ); + buffer_len += test.length(); + } +Index: kdelibs/khtml/html/html_baseimpl.cpp +diff -u kdelibs/khtml/html/html_baseimpl.cpp:1.125.2.2 kdelibs/khtml/html/html_baseimpl.cpp:1.125.2.3 +--- khtml/html/html_baseimpl.cpp:1.125.2.2 Fri Nov 2 14:44:05 2001 ++++ khtml/html/html_baseimpl.cpp Fri Nov 30 07:24:07 2001 +@@ -272,7 +272,7 @@ + while ((part = part->parentPart())) + depth++; + +- if (depth > 6 || url.isNull()) { ++ if (depth > 6) { + style()->setDisplay( NONE ); + return; + } +@@ -309,6 +309,7 @@ + kdDebug( 6030 ) << "creating frame name: " << name.string() << endl; + } + ++ if (!url.isNull()) + w->part()->requestFrame( renderFrame, url.string(), name.string() ); + + HTMLElementImpl::attach(); +Index: kdelibs/khtml/html/html_imageimpl.cpp +diff -u kdelibs/khtml/html/html_imageimpl.cpp:1.104.2.1 kdelibs/khtml/html/html_imageimpl.cpp:1.104.2.2 +--- khtml/html/html_imageimpl.cpp:1.104.2.1 Thu Oct 18 05:00:07 2001 ++++ khtml/html/html_imageimpl.cpp Tue Jun 18 17:57:28 2002 +@@ -462,7 +462,7 @@ + int y1 = coords->at(3)->minWidth(height_); + region = QRegion(x0,y0,x1-x0,y1-y0); + } +- else /*if (shape==Default || shape == Unknown)*/ { ++ else if (shape==Default) { + //cout << "default/unknown" << endl; + region = QRegion(0,0,width_,height_); + } +Index: kdelibs/khtml/html/htmltokenizer.cpp +diff -u kdelibs/khtml/html/htmltokenizer.cpp:1.193.2.6 kdelibs/khtml/html/htmltokenizer.cpp:1.193.2.7 +--- khtml/html/htmltokenizer.cpp:1.193.2.6 Tue Nov 6 00:33:38 2001 ++++ khtml/html/htmltokenizer.cpp Mon Nov 26 17:37:25 2001 +@@ -281,7 +281,7 @@ + while ( src.length() ) { + checkScriptBuffer(); + unsigned char ch = src->latin1(); +- if ( !scriptCodeResync && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && QConstString( scriptCode+scriptCodeSize-3, 3 ).string() == "<!-" ) { ++ if ( !scriptCodeResync && !textarea && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && QConstString( scriptCode+scriptCodeSize-3, 3 ).string() == "<!-" ) { + comment = true; + parseComment( src ); + continue; +Index: kdelibs/kimgio/eps.cpp +diff -u kdelibs/kimgio/eps.cpp:1.14 kdelibs/kimgio/eps.cpp:1.14.2.1 +--- kimgio/eps.cpp:1.14 Mon Jul 9 22:05:21 2001 ++++ kimgio/eps.cpp Fri Dec 6 12:37:43 2002 +@@ -24,7 +24,6 @@ + { + int ret = FALSE; + char buf[BUFLEN+1]; +- char dummy[BUFLEN+1]; + + while (imageio->ioDevice()->readLine(buf, BUFLEN) != -1) + { +@@ -33,7 +32,7 @@ + // Some EPS files have non-integer values for the bbox + // We don't support that currently, but at least we parse it + float _x1, _y1, _x2, _y2; +- if ( sscanf (buf, "%s %f %f %f %f", dummy, ++ if ( sscanf (buf, "%*s %f %f %f %f", + &_x1, &_y1, &_x2, &_y2) == 5) { + *x1=(int)_x1; *y1=(int)_y1; *x2=(int)_x2; *y2=(int)_y2; + ret = TRUE; +@@ -152,7 +151,7 @@ + QFile inFile(tmpFile.name()); + QString szBoxInfo; + +- szBoxInfo.sprintf("%sBoundingBox: 0 0 %d %d\n", "%%", ++ szBoxInfo.sprintf("%%%%BoundingBox: 0 0 %d %d\n", + imageio->image().width(), + imageio->image().height()); + +Index: kdelibs/kimgio/netpbm.cpp +diff -u kdelibs/kimgio/netpbm.cpp:1.2 kdelibs/kimgio/netpbm.cpp:1.2.6.1 +--- kimgio/netpbm.cpp:1.2 Mon Mar 27 22:49:18 2000 ++++ kimgio/netpbm.cpp Sat Dec 7 16:27:03 2002 +@@ -12,30 +12,31 @@ + #include <stdio.h> + #include <stdlib.h> + #include <qimage.h> +- +-#define CMDBUFLEN 4096 ++#include <qfile.h> ++#include <kprocess.h> ++#include <ktempfile.h> + + ////// + // the real filter. + // + +-void import_graphic (char *filter, QImageIO *image) ++void import_graphic (const char *filter, QImageIO *image) + { +- char * tmpFileName; + QImage myimage; + +- char cmdBuf [CMDBUFLEN]; +- +- tmpFileName = tmpnam(NULL); ++ KTempFile tmp; ++ tmp.close(); + +- sprintf (cmdBuf, "%s %s > %s", filter, image->fileName(), tmpFileName); +-// printf (cmdBuf); +-// fflush (stdout); ++ QString cmd = filter; ++ cmd += " "; ++ cmd += KShellProcess::quote(image->fileName()); ++ cmd += " > "; ++ cmd += KShellProcess::quote(tmp.name()); + +- system (cmdBuf); +- myimage.load (tmpFileName); ++ system (QFile::encodeName(cmd)); ++ myimage.load (tmp.name()); + +- unlink (tmpFileName); ++ tmp.unlink(); + + image->setImage (myimage); + image->setStatus (0); +Index: kdelibs/kinit/lnusertemp.c +diff -u kdelibs/kinit/lnusertemp.c:1.7 kdelibs/kinit/lnusertemp.c:1.7.2.1 +--- kinit/lnusertemp.c:1.7 Wed Mar 14 20:22:29 2001 ++++ kinit/lnusertemp.c Sat Dec 7 18:48:35 2002 +@@ -109,8 +109,8 @@ + return 1; + } + +- strcpy(user_tmp_dir, tmp_prefix); +- strcat(user_tmp_dir, pw_ent->pw_name); ++ strncpy(user_tmp_dir, tmp_prefix, PATH_MAX); ++ strncat(user_tmp_dir, pw_ent->pw_name, PATH_MAX - strlen(tmp_prefix)); + + if (!kde_home || !kde_home[0]) + { +@@ -130,9 +130,9 @@ + exit(255); + } + kde_home++; +- strcat(kde_tmp_dir, home_dir); ++ strncpy(kde_tmp_dir, home_dir, PATH_MAX); + } +- strcat(kde_tmp_dir, kde_home); ++ strncat(kde_tmp_dir, kde_home, PATH_MAX - strlen(kde_tmp_dir)); + + /** Strip trailing '/' **/ + if ( kde_tmp_dir[strlen(kde_tmp_dir)-1] == '/') +@@ -148,7 +148,7 @@ + return 1; + } + +- strcat(kde_tmp_dir, kde_prefix); ++ strncat(kde_tmp_dir, kde_prefix, PATH_MAX - strlen(kde_tmp_dir)); + if (gethostname(kde_tmp_dir+strlen(kde_tmp_dir), PATH_MAX - strlen(kde_tmp_dir) - 1) != 0) + { + perror("Aborting. Could not determine hostname: "); +@@ -168,7 +168,7 @@ + result = create_link(kde_tmp_dir, user_tmp_dir); + if (result == 0) return 0; /* Success */ + unlink(kde_tmp_dir); +- strcat(user_tmp_dir, "XXXXXX"); ++ strncat(user_tmp_dir, "XXXXXX", PATH_MAX - strlen(user_tmp_dir)); + mktemp(user_tmp_dir); + return create_link(kde_tmp_dir, user_tmp_dir); + } +@@ -194,7 +194,7 @@ + result = create_link(kde_tmp_dir, user_tmp_dir); + if (result == 0) return 0; /* Success */ + unlink(kde_tmp_dir); +- strcat(user_tmp_dir, "XXXXXX"); ++ strncat(user_tmp_dir, "XXXXXX", PATH_MAX - strlen(user_tmp_dir)); + mktemp(user_tmp_dir); + return create_link(kde_tmp_dir, user_tmp_dir); + return 1; +@@ -202,7 +202,7 @@ + result = check_tmp_dir(tmp_buf); + if (result == 0) return 0; /* Success */ + unlink(kde_tmp_dir); +- strcat(user_tmp_dir, "XXXXXX"); ++ strncat(user_tmp_dir, "XXXXXX", PATH_MAX - strlen(user_tmp_dir)); + mktemp(user_tmp_dir); + return create_link(kde_tmp_dir, user_tmp_dir); + } +Index: kdelibs/kinit/setproctitle.cpp +diff -u kdelibs/kinit/setproctitle.cpp:1.6 kdelibs/kinit/setproctitle.cpp:1.6.4.2 +--- kinit/setproctitle.cpp:1.6 Sun Feb 4 01:35:48 2001 ++++ kinit/setproctitle.cpp Sat Dec 7 19:27:51 2002 +@@ -35,7 +35,6 @@ + # define _PATH_KMEM "/dev/kmem" + #endif + +-#define newstr(s) strcpy((char*)malloc(strlen(s) + 1), s) + #define SPACELEFT(buf, ptr) (sizeof buf - ((ptr) - buf)) + + +@@ -143,8 +142,13 @@ + for (i = 0; envp[i] != NULL; i++) + envpsize += strlen(envp[i]) + 1; + environ = (char **) malloc(sizeof (char *) * (i + 1)); ++ if (environ == NULL) ++ return; ++ + for (i = 0; envp[i] != NULL; i++) +- environ[i] = newstr(envp[i]); ++ { ++ environ[i] = strdup(envp[i]); ++ } + environ[i] = NULL; + + /* +Index: kdelibs/kinit/wrapper.c +diff -u kdelibs/kinit/wrapper.c:1.22 kdelibs/kinit/wrapper.c:1.22.2.2 +--- kinit/wrapper.c:1.22 Fri Jul 13 13:16:19 2001 ++++ kinit/wrapper.c Fri Dec 13 11:23:21 2002 +@@ -38,6 +38,7 @@ + #include <unistd.h> + #include <pwd.h> + #include <signal.h> ++#include <limits.h> + + extern char **environ; + +@@ -53,6 +54,9 @@ + display = ":0"; + } + result = malloc(strlen(display)+1); ++ if (result == NULL) ++ return NULL; ++ + strcpy(result, display); + screen = strrchr(result, '.'); + colon = strrchr(result, ':'); +@@ -115,12 +119,12 @@ + int s; + struct sockaddr_un server; + #define MAX_SOCK_FILE 255 +- char sock_file[MAX_SOCK_FILE]; ++ char sock_file[MAX_SOCK_FILE + 1]; + const char *home_dir = getenv("HOME"); + const char *kde_home = getenv("KDEHOME"); + char *display; + +- sock_file[0] = 0; ++ sock_file[0] = sock_file[MAX_SOCK_FILE] = 0; + + if (!kde_home || !kde_home[0]) + { +@@ -140,15 +144,15 @@ + exit(255); + } + kde_home++; +- strcat(sock_file, home_dir); ++ strncpy(sock_file, home_dir, MAX_SOCK_FILE); + } +- strcat(sock_file, kde_home); ++ strncat(sock_file, kde_home, MAX_SOCK_FILE - strlen(sock_file)); + + /** Strip trailing '/' **/ + if ( sock_file[strlen(sock_file)-1] == '/') + sock_file[strlen(sock_file)-1] = 0; + +- strcat(sock_file, "/socket-"); ++ strncat(sock_file, "/socket-", MAX_SOCK_FILE - strlen(sock_file)); + if (gethostname(sock_file+strlen(sock_file), MAX_SOCK_FILE - strlen(sock_file) - 1) != 0) + { + perror("Aborting. Could not determine hostname: "); +@@ -157,7 +161,13 @@ + + /* append $DISPLAY */ + display = getDisplay(); +- if (strlen(sock_file)+strlen(display)+2 > MAX_SOCK_FILE) ++ if (display == NULL) ++ { ++ fprintf(stderr, "Error: Could not determine display.\n"); ++ return -1; ++ } ++ ++ if (strlen(sock_file)+strlen(display)+strlen("/kdeinit-")+2 > MAX_SOCK_FILE) + { + fprintf(stderr, "Aborting. Socket name will be too long.\n"); + exit(255); +@@ -401,6 +411,11 @@ + write_socket(sock, (char *) &header, sizeof(header)); + + buffer = (char *) malloc(size); ++ if (buffer == NULL) ++ { ++ fprintf(stderr, "Error: malloc() failed."); ++ exit(255); ++ } + p = buffer; + + memcpy(p, &arg_count, sizeof(arg_count)); +@@ -472,6 +487,11 @@ + { + long pid; + buffer = (char *) malloc(header.arg_length); ++ if (buffer == NULL) ++ { ++ fprintf(stderr, "Error: malloc() failed\n"); ++ exit(255); ++ } + read_socket(sock, buffer, header.arg_length); + pid = *((long *) buffer); + if( !kwrapper ) /* kwrapper shouldn't print any output */ +Index: kdelibs/kio/job.cpp +diff -u kdelibs/kio/job.cpp:1.261.2.6 kdelibs/kio/job.cpp:1.261.2.8 +--- kio/job.cpp:1.261.2.6 Fri Oct 19 22:09:57 2001 ++++ kio/job.cpp Tue Jan 22 11:39:10 2002 +@@ -2588,11 +2588,18 @@ + break; + case STATE_RENAMING: // We were trying to rename a directory + { +- bool err = job->error() != 0; ++ int err = job->error(); + subjobs.remove( job ); + assert ( subjobs.isEmpty() ); + if ( err ) + { ++ // Only try copy+del if the reason for not renaming was "unsupported" (which includes EXDEV) ++ // One case where we really don't want to go to copy+del is renaming 'a' to 'A' on a FAT partition ++ if ( err != KIO::ERR_UNSUPPORTED_ACTION ) ++ { ++ Job::slotResult( job ); // will set the error and emit result(this) ++ return; ++ } + kdDebug(7007) << "Couldn't rename, starting listing, for copy and del" << endl; + startListing( *m_currentStatSrc ); + } +@@ -2863,59 +2870,87 @@ + //kdDebug(7007) << "deleteNextFile" << endl; + if ( !files.isEmpty() || !symlinks.isEmpty() ) + { +- // Take first file to delete out of list +- KURL::List::Iterator it = files.begin(); +- bool isLink = false; +- if ( it == files.end() ) // No more files +- { +- it = symlinks.begin(); // Pick up a symlink to delete +- isLink = true; +- } + SimpleJob *job; +- // Use shredding ? +- if ( m_shred && (*it).isLocalFile() && !isLink ) +- { +- // KShred your KTie +- KIO_ARGS << int(3) << (*it).path(); +- job = KIO::special(KURL("file:/"), packedArgs, false /*no GUI*/); +- Scheduler::scheduleJob(job); +- m_currentURL=(*it); +- //emit deleting( this, *it ); +- connect( job, SIGNAL( processedSize( KIO::Job*, unsigned long ) ), +- this, SLOT( slotProcessedSize( KIO::Job*, unsigned long ) ) ); +- } else +- { +- // Normal deletion +- job = KIO::file_delete( *it, false /*no GUI*/); +- Scheduler::scheduleJob(job); +- m_currentURL=(*it); +- //emit deleting( this, *it ); +- } +- if ( isLink ) +- symlinks.remove(it); +- else +- files.remove(it); +- addSubjob(job); +- } else +- { +- state = STATE_DELETING_DIRS; +- deleteNextDir(); ++ do { ++ // Take first file to delete out of list ++ KURL::List::Iterator it = files.begin(); ++ bool isLink = false; ++ if ( it == files.end() ) // No more files ++ { ++ it = symlinks.begin(); // Pick up a symlink to delete ++ isLink = true; ++ } ++ // Use shredding ? ++ if ( m_shred && (*it).isLocalFile() && !isLink ) ++ { ++ // KShred your KTie ++ KIO_ARGS << int(3) << (*it).path(); ++ job = KIO::special(KURL("file:/"), packedArgs, false /*no GUI*/); ++ Scheduler::scheduleJob(job); ++ m_currentURL=(*it); ++ connect( job, SIGNAL( processedSize( KIO::Job*, KIO::filesize_t ) ), ++ this, SLOT( slotProcessedSize( KIO::Job*, KIO::filesize_t ) ) ); ++ } else ++ { ++ // Normal deletion ++ // If local file, try do it directly ++ if ( (*it).isLocalFile() && unlink( QFile::encodeName((*it).path()) ) == 0 ) { ++ job = 0; ++ m_processedFiles++; ++ if ( m_processedFiles % 300 == 0 ) { // update progress info every 300 files ++ m_currentURL = *it; ++ slotReport(); ++ } ++ } else ++ { // if remote - or if unlink() failed (we'll use the job's error handling in that case) ++ job = KIO::file_delete( *it, false /*no GUI*/); ++ Scheduler::scheduleJob(job); ++ m_currentURL=(*it); ++ } ++ } ++ if ( isLink ) ++ symlinks.remove(it); ++ else ++ files.remove(it); ++ if ( job ) { ++ addSubjob(job); ++ return; ++ } ++ // loop only if direct deletion worked (job=0) and there is something else to delete ++ } while (!job && (!files.isEmpty() || !symlinks.isEmpty())); + } ++ state = STATE_DELETING_DIRS; ++ deleteNextDir(); + } + + void DeleteJob::deleteNextDir() + { + if ( !dirs.isEmpty() ) // some dirs to delete ? + { +- // Take first dir to delete out of list - last ones first ! +- KURL::List::Iterator it = dirs.fromLast(); +- SimpleJob *job = KIO::rmdir( *it ); +- Scheduler::scheduleJob(job); +- dirs.remove(it); +- addSubjob( job ); ++ do { ++ // Take first dir to delete out of list - last ones first ! ++ KURL::List::Iterator it = dirs.fromLast(); ++ // If local dir, try to rmdir it directly ++ if ( (*it).isLocalFile() && ::rmdir( QFile::encodeName((*it).path()) ) == 0 ) { ++ ++ m_processedDirs++; ++ if ( m_processedDirs % 100 == 0 ) { // update progress info every 100 dirs ++ m_currentURL = *it; ++ slotReport(); ++ } ++ } else ++ { ++ SimpleJob *job = KIO::rmdir( *it ); ++ Scheduler::scheduleJob(job); ++ dirs.remove(it); ++ addSubjob( job ); ++ return; ++ } ++ dirs.remove(it); ++ } while ( !dirs.isEmpty() ); + } +- else // We have finished deleting +- startNextJob(); ++ // We have finished deleting ++ startNextJob(); + } + + void DeleteJob::slotProcessedSize( KIO::Job*, unsigned long data_size ) +@@ -3089,9 +3124,6 @@ + assert( subjobs.isEmpty() ); + m_processedFiles++; + +- /*emit processedFiles( this, m_processedFiles ); +- if (!m_shred) +- emitPercent( m_processedFiles, m_totalFilesDirs );*/ + deleteNextFile(); + break; + case STATE_DELETING_DIRS: +Index: kdelibs/kio/kdirlister.cpp +diff -u kdelibs/kio/kdirlister.cpp:1.64 kdelibs/kio/kdirlister.cpp:1.64.2.1 +--- kio/kdirlister.cpp:1.64 Wed Jun 6 22:39:51 2001 ++++ kio/kdirlister.cpp Sun Nov 11 16:50:41 2001 +@@ -159,7 +159,8 @@ + return; + } + +- m_url = _url; ++ if ( m_url.isEmpty() || !_keep ) // Set toplevel URL if not set yet ++ m_url = _url; + + m_bComplete = false; + d->urlChanged = false; +@@ -261,15 +262,13 @@ + { + job->showErrorDialog(); + +- if ( m_lstDirs.count() > 1 ) +- emit canceled( job->url() ); ++ emit canceled( job->url() ); + if ( m_bComplete ) + emit canceled(); + } + else + { +- if ( m_lstDirs.count() > 1 ) +- emit completed( job->url() ); ++ emit completed( job->url() ); + if ( m_bComplete ) + emit completed(); + } +@@ -308,7 +307,7 @@ + + if ( name == dot ) + { +- if ( !m_rootFileItem ) // only if we didn't keep the previous dir ++ if ( !m_rootFileItem && url == m_url ) // only if we didn't keep the previous dir + { + m_rootFileItem = createFileItem( *it, url, m_bDelayedMimeTypes ); + } +Index: kdelibs/kio/kmimemagic.cpp +diff -u kdelibs/kio/kmimemagic.cpp:1.39 kdelibs/kio/kmimemagic.cpp:1.39.2.1 +--- kio/kmimemagic.cpp:1.39 Thu Aug 2 11:21:27 2001 ++++ kio/kmimemagic.cpp Sat Dec 7 18:48:04 2002 +@@ -1478,7 +1478,9 @@ + char *tmp; + char buf2[BUFSIZ + BUFSIZ + 4]; + +- strcpy(buf2, fn); ++ strncpy(buf2, fn, BUFSIZ); ++ buf2[BUFSIZ] = 0; ++ + if ((tmp = strrchr(buf2, '/')) == NULL) { + tmp = buf; /* in current dir */ + } else { +Index: kdelibs/kio/kmimetype.cpp +diff -u kdelibs/kio/kmimetype.cpp:1.134.2.1 kdelibs/kio/kmimetype.cpp:1.134.2.2 +--- kio/kmimetype.cpp:1.134.2.1 Thu Nov 8 21:50:39 2001 ++++ kio/kmimetype.cpp Sun Dec 8 01:58:10 2002 +@@ -653,7 +653,7 @@ + // at the global file, or at a file not in share/mimelnk... + + KShellProcess p; +- p << "kfmclient" << "openProperties" << url.path().local8Bit(); ++ p << "kfmclient" << "openProperties" << KShellProcess::quote(url.path()); + p.start(KProcess::DontCare); + return p.getPid(); + } +Index: kdelibs/kio/ktar.cpp +diff -u kdelibs/kio/ktar.cpp:1.32 kdelibs/kio/ktar.cpp:1.32.2.1 +--- kio/ktar.cpp:1.32 Tue Jun 26 22:22:37 2001 ++++ kio/ktar.cpp Sat Dec 7 18:48:04 2002 +@@ -355,15 +355,20 @@ + strcpy( buffer, "././@LongLink" ); + fillBuffer( buffer, " 0", dirName.length()+1, 'L', user.local8Bit(), group.local8Bit() ); + write( buffer, 0x200 ); +- memset( buffer, 0, 0x200 ); +- strcpy( buffer, QFile::encodeName(dirName) ); ++ strncpy( buffer, QFile::encodeName(dirName), 0x200 ); ++ buffer[0x200] = 0; ++ + // write long name + write( buffer, 0x200 ); + // not even needed to reclear the buffer, tar doesn't do it + } + else ++ { + // Write name +- strcpy( buffer, QFile::encodeName(dirName) ); ++ strncpy( buffer, QFile::encodeName(dirName), 0x200 ); ++ buffer[0x200] = 0; ++ } ++ + + fillBuffer( buffer, " 40755", 0, 0x35, user.local8Bit(), group.local8Bit()); + +@@ -419,15 +424,19 @@ + fillBuffer( buffer, " 0", fileName.length()+1, 'L', user.local8Bit(), group.local8Bit() ); + write( buffer, 0x200 ); + +- memset( buffer, 0, 0x200 ); +- strcpy( buffer, QFile::encodeName(fileName) ); ++ strncpy( buffer, QFile::encodeName(fileName), 0x200 ); ++ buffer[0x200] = 0; + // write long name + write( buffer, 0x200 ); + // not even needed to reclear the buffer, tar doesn't do it + } + else ++ { + // Write name +- strcpy( buffer, QFile::encodeName(fileName) ); ++ strncpy( buffer, QFile::encodeName(fileName), 0x200 ); ++ buffer[0x200] = 0; ++ } ++ + + fillBuffer( buffer, "100644", size, 0x30, user.local8Bit(), group.local8Bit() ); + +Index: kdelibs/kio/lex.l +diff -u kdelibs/kio/lex.l:1.5 kdelibs/kio/lex.l:1.5.2.1 +--- kio/lex.l:1.5 Wed Jun 13 16:16:39 2001 ++++ kio/lex.l Sat Dec 7 18:48:04 2002 +@@ -58,9 +58,11 @@ + { + int l = strlen( _name )-1; + char *p = (char *)malloc( l ); +- +- strncpy( p, _name+1, l-1 ); +- p[l-1] = 0; ++ if (p != NULL) ++ { ++ strncpy( p, _name+1, l-1 ); ++ p[l-1] = 0; ++ } + + return p; + } +@@ -68,7 +70,10 @@ + char *putSymbol( char *_name ) + { + char *p = (char*)malloc( strlen( _name ) + 1 ); +- strcpy( p, _name ); ++ if (p != NULL) ++ { ++ strcpy( p, _name ); ++ } + return p; + } + +@@ -78,6 +83,10 @@ + char *p = (char*)malloc( l ); + char *s = _str + 1; + char *d = p; ++ ++ if (p == NULL) ++ return NULL; ++ + while ( s != _str + l - 1 ) + { + if ( *s != '\\' ) +Index: kdelibs/kio/passdlg.cpp +diff -u kdelibs/kio/passdlg.cpp:1.26 kdelibs/kio/passdlg.cpp:1.26.2.1 +--- kio/passdlg.cpp:1.26 Sun May 27 01:00:31 2001 ++++ kio/passdlg.cpp Sat Nov 10 18:52:33 2001 +@@ -279,8 +279,15 @@ + if ( ret == Accepted ) + { + user = dlg->username(); ++ if ( user.isNull() ) ++ user = ""; ++ + pass = dlg->password(); +- if ( keep ) { (*keep) = dlg->keepPassword(); } ++ if ( pass.isNull() ) ++ pass = ""; ++ ++ if ( keep ) ++ (*keep) = dlg->keepPassword(); + } + delete dlg; + return ret; +Index: kdelibs/kio/rlogin.protocol +diff -u kdelibs/kio/rlogin.protocol:1.2 kdelibs/kio/rlogin.protocol:removed +--- kio/rlogin.protocol:1.2 Sun Jan 21 00:01:05 2001 ++++ kio/rlogin.protocol Fri Dec 13 17:03:06 2002 +@@ -1,11 +0,0 @@ +-[Protocol] +-exec=konsole -e rlogin `echo %u | sed -e 's,rlogin:/*,,'` +-protocol=rlogin +-input=none +-output=none +-helper=true +-listing=false +-reading=false +-writing=false +-makedir=false +-deleting=false +Index: kdelibs/kio/telnet.protocol +diff -u kdelibs/kio/telnet.protocol:1.3 kdelibs/kio/telnet.protocol:removed +--- kio/telnet.protocol:1.3 Wed Apr 11 07:37:55 2001 ++++ kio/telnet.protocol Fri Dec 13 17:03:07 2002 +@@ -1,11 +0,0 @@ +-[Protocol] +-exec=konsole -e telnet `echo %u | sed -e 's,telnet:/*,,' | sed -e 's,:\([0-9]*\), \1,'` +-protocol=telnet +-input=none +-output=none +-helper=true +-listing=false +-reading=false +-writing=false +-makedir=false +-deleting=false +Index: kdelibs/kio/ftp/ftp.cc +diff -u kdelibs/kio/ftp/ftp.cc:1.147.2.1 kdelibs/kio/ftp/ftp.cc:1.147.2.2 +--- kio/ftp/ftp.cc:1.147.2.1 Thu Sep 27 18:37:20 2001 ++++ kio/ftp/ftp.cc Wed Dec 11 23:03:47 2002 +@@ -1677,7 +1677,10 @@ + } + else + de.link = QString::null; +- ++ ++ if (strchr(p_name, '/')) ++ return 0L; // Don't trick us! ++ + de.access = 0; + de.type = S_IFREG; + switch ( p_access[0] ) { +Index: kdelibs/kparts/browserextension.cpp +diff -u kdelibs/kparts/browserextension.cpp:1.34 kdelibs/kparts/browserextension.cpp:1.34.2.1 +--- kparts/browserextension.cpp:1.34 Wed Jun 20 22:19:00 2001 ++++ kparts/browserextension.cpp Fri Nov 29 12:39:09 2002 +@@ -541,7 +541,7 @@ + + BrowserHostExtension *BrowserHostExtension::childObject( QObject *obj ) + { +- if ( !obj ) ++ if ( !obj || !obj->children() ) + return 0L; + + // we try to do it on our own, in hope that we are faster than +Index: kdelibs/kssl/kopenssl.cc +diff -u kdelibs/kssl/kopenssl.cc:1.24.2.1 kdelibs/kssl/kopenssl.cc:1.24.2.2 +--- kssl/kopenssl.cc:1.24.2.1 Tue Aug 21 18:07:31 2001 ++++ kssl/kopenssl.cc Tue Aug 13 00:23:03 2002 +@@ -92,6 +92,7 @@ + static int (*K_SSL_get_error) (SSL*, int) = NULL; + static STACK_OF(X509)* (*K_SSL_get_peer_cert_chain) (SSL*) = NULL; + static void (*K_X509_STORE_CTX_set_chain) (X509_STORE_CTX *, STACK_OF(X509)*) = NULL; ++static void (*K_X509_STORE_CTX_set_purpose) (X509_STORE_CTX *, int) = NULL; + static void (*K_sk_free) (STACK*) = NULL; + static int (*K_sk_num) (STACK*) = NULL; + static char* (*K_sk_value) (STACK*, int) = NULL; +@@ -254,6 +255,7 @@ + X509**, STACK_OF(X509)**)) _cryptoLib->symbol("PKCS12_parse"); + K_EVP_PKEY_free = (void (*) (EVP_PKEY *)) _cryptoLib->symbol("EVP_PKEY_free"); + K_X509_STORE_CTX_set_chain = (void (*)(X509_STORE_CTX *, STACK_OF(X509)*)) _cryptoLib->symbol("X509_STORE_CTX_set_chain"); ++ K_X509_STORE_CTX_set_purpose = (void (*)(X509_STORE_CTX *, int)) _cryptoLib->symbol("X509_STORE_CTX_set_purpose"); + K_sk_free = (void (*) (STACK *)) _cryptoLib->symbol("sk_free"); + K_sk_num = (int (*) (STACK *)) _cryptoLib->symbol("sk_num"); + K_sk_value = (char* (*) (STACK *, int)) _cryptoLib->symbol("sk_value"); +@@ -742,6 +744,10 @@ + + void KOpenSSLProxy::X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x) { + if (K_X509_STORE_CTX_set_chain) (K_X509_STORE_CTX_set_chain)(v,x); ++} ++ ++void KOpenSSLProxy::X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose) { ++ if (K_X509_STORE_CTX_set_purpose) (K_X509_STORE_CTX_set_purpose)(v,purpose); + } + + +Index: kdelibs/kssl/kopenssl.h +diff -u kdelibs/kssl/kopenssl.h:1.15 kdelibs/kssl/kopenssl.h:1.15.2.1 +--- kssl/kopenssl.h:1.15 Fri Jul 27 11:55:02 2001 ++++ kssl/kopenssl.h Tue Aug 13 00:23:03 2002 +@@ -277,6 +277,10 @@ + */ + void X509_STORE_CTX_set_chain(X509_STORE_CTX *v, STACK_OF(X509)* x); + ++ /* ++ * X509_STORE_CTX_set_purpose - set the purpose of the certificate ++ */ ++ void X509_STORE_CTX_set_purpose(X509_STORE_CTX *v, int purpose); + + /* + * X509_verify_cert - verify the certificate +Index: kdelibs/kssl/ksslcertificate.cc +diff -u kdelibs/kssl/ksslcertificate.cc:1.39.2.6 kdelibs/kssl/ksslcertificate.cc:1.39.2.7 +--- kssl/ksslcertificate.cc:1.39.2.6 Thu Oct 25 08:12:11 2001 ++++ kssl/ksslcertificate.cc Tue Aug 13 00:23:03 2002 +@@ -262,6 +262,8 @@ + // FIXME: do all the X509_STORE_CTX_set_flags(); here + // +-----> Note that this is for 0.9.6 or better ONLY! + ++ d->kossl->X509_STORE_CTX_set_purpose(certStoreCTX, X509_PURPOSE_SSL_SERVER); ++ + //kdDebug(7029) << "KSSL verifying.............." << endl; + certStoreCTX->error = X509_V_OK; + rc = d->kossl->X509_verify_cert(certStoreCTX); +Index: kdelibs/kssl/ksslpeerinfo.cc +diff -u kdelibs/kssl/ksslpeerinfo.cc:1.12.2.10 kdelibs/kssl/ksslpeerinfo.cc:1.12.2.11 +--- kssl/ksslpeerinfo.cc:1.12.2.10 Wed Nov 7 06:47:37 2001 ++++ kssl/ksslpeerinfo.cc Fri Nov 23 19:42:36 2001 +@@ -23,7 +23,6 @@ + #endif + + #include "ksslpeerinfo.h" +-#include <qstring.h> + #include <kdebug.h> + + #include <ksockaddr.h> +@@ -74,25 +73,54 @@ + QString cn = certinfo.getValue("CN"); + + if (d->proxying) { +- if (cn.startsWith("*")) { +- QRegExp cnre(cn.lower(), false, true); +- if (cnre.match(d->proxyHost.lower()) >= 0) return true; +- } else { +- if (cn.lower() == d->proxyHost.lower()) return true; +- } +- return false; ++ QStringList domains; ++ ++ kdDebug(7029) << "Matching CN=" << cn << " to " << d->proxyHost << endl; ++ ++ extractDomains(d->proxyHost, domains); ++ QStringList::Iterator it = domains.begin(); ++ for (; it != domains.end(); it++) ++ { ++ int match = cn.findRev(*it, -1, false); ++ kdDebug(7029) << "Match= " << match << ", CN.length= " << cn.length() ++ << ", host.length= " << (*it).length() << endl; ++ ++ if (match > -1 && ((match + (*it).length()) == cn.length())) ++ { ++ kdDebug(7029) << "Found a match ==> " << (*it) << endl; ++ return true; ++ } ++ } ++ return false; + } + + + if (cn.startsWith("*")) { // stupid wildcard cn +- QRegExp cnre(cn.lower(), false, true); + QString host, port; ++ QStringList domains; + +- if (KExtendedSocket::resolve(d->host, host, port, NI_NAMEREQD) != 0) ++ if (KExtendedSocket::resolve(d->host, host, port, NI_NAMEREQD) != 0) + host = d->host->nodeName(); + + kdDebug(7029) << "Matching CN=" << cn << " to " << host << endl; +- if (cnre.match(host.lower()) >= 0) return true; ++ ++ extractDomains( host, domains ); ++ QStringList::Iterator it = domains.begin(); ++ ++ for (; it != domains.end(); it++) ++ { ++ int match = cn.findRev(*it, -1, false); ++ kdDebug(7029) << "Match= " << match << ", CN.length= " << cn.length() ++ << ", host.length= " << (*it).length() << endl; ++ ++ if (match > -1 && ((match + (*it).length()) == cn.length())) ++ { ++ kdDebug(7029) << "Found a match ==> " << (*it) << endl; ++ return true; ++ } ++ } ++ ++ return false; + } else { + int err = 0; + QList<KAddressInfo> cns = KExtendedSocket::lookup(cn.latin1(), 0, 0, &err); +@@ -102,17 +130,55 @@ + } + cns.setAutoDelete(true); + +-// kdDebug(7029) << "The original ones were: " << d->host->nodeName() +-// << " and: " << certinfo.getValue("CN").latin1() +-// << endl; ++ kdDebug(7029) << "The original ones were: " << d->host->nodeName() ++ << " and: " << certinfo.getValue("CN").latin1() ++ << endl; + + for (KAddressInfo *x = cns.first(); x; x = cns.next()) { + if ((*x).address()->isCoreEqual(d->host)) { + return true; + } + } ++ kdDebug(7029) << "Testing failed!" << endl; + } + + #endif + return false; ++} ++ ++void KSSLPeerInfo::extractDomains(const QString &fqdn, QStringList &domains) ++{ ++ domains.clear(); ++ ++ // If fqdn is an IP address, then only use ++ // the entire IP address to find a match! (DA) ++ if (fqdn[0] >= '0' && fqdn[0] <= '9') { ++ domains.append(fqdn); ++ return; ++ } ++ ++ QStringList partList = QStringList::split('.', fqdn, false); ++ ++ if (partList.count()) ++ partList.remove(partList.begin()); // Remove hostname ++ ++ while(partList.count()) { ++ if (partList.count() == 1) ++ break; // We only have a TLD left. ++ ++ if (partList.count() == 2) { ++ // If this is a TLD, we should stop. (e.g. co.uk) ++ // We assume this is a TLD if it ends with .xx.yy or .x.yy ++ if (partList[0].length() <= 2 && partList[1].length() == 2) ++ break; // This is a TLD. ++ } ++ ++ QString domain = partList.join("."); ++ domains.append(domain); ++ partList.remove(partList.begin()); ++ } ++ ++ // Add the entire FQDN at the end of the ++ // list for fqdn == CN checks ++ domains.append(fqdn); + } +Index: kdelibs/kssl/ksslpeerinfo.h +diff -u kdelibs/kssl/ksslpeerinfo.h:1.12.2.1 kdelibs/kssl/ksslpeerinfo.h:1.12.2.2 +--- kssl/ksslpeerinfo.h:1.12.2.1 Wed Nov 7 06:47:37 2001 ++++ kssl/ksslpeerinfo.h Fri Nov 23 19:42:36 2001 +@@ -24,7 +24,7 @@ + class KSSL; + + #include <qglobal.h> +-#include <qstring.h> ++#include <qstringlist.h> + #include <ksslcertificate.h> + + class KSSLPeerInfoPrivate; +@@ -38,14 +38,15 @@ + KSSLCertificate& getPeerCertificate(); + bool certMatchesAddress(); + QString getPeerAddress(); +- ++ + void setProxying(bool active, QString realHost = QString::null); +- ++ + protected: + KSSLPeerInfo(); + + KSSLCertificate m_cert; + void setPeerAddress(KInetSocketAddress &x); ++ void extractDomains(const QString &fqdn, QStringList &domains); + + private: + KSSLPeerInfoPrivate *d; +Index: kdelibs/libkmid/fmout.cc +diff -u kdelibs/libkmid/fmout.cc:1.19 kdelibs/libkmid/fmout.cc:1.19.6.1 +--- libkmid/fmout.cc:1.19 Tue Oct 10 00:09:23 2000 ++++ libkmid/fmout.cc Sat Dec 7 18:48:38 2002 +@@ -34,6 +34,7 @@ + #include <string.h> + #include <sys/param.h> + #include <stdlib.h> ++#include <limits.h> + #include "midispec.h" + #ifdef HAVE_CONFIG_H + #include <config.h> +@@ -126,8 +127,8 @@ + void FMOut::loadFMPatches(void) + { + #ifdef HAVE_OSS_SUPPORT +- char patchesfile[120]; +- char drumsfile[120]; ++ char patchesfile[PATH_MAX]; ++ char drumsfile[PATH_MAX]; + int size; + struct sbi_instrument instr; + char tmp[60]; +@@ -140,12 +141,12 @@ + + if (opl==3) + { +- sprintf(patchesfile,"%s/std.o3",FMPatchesDirectory); ++ snprintf(patchesfile, PATH_MAX, "%s/std.o3",FMPatchesDirectory); + size=60; + } + else + { +- sprintf(patchesfile,"%s/std.sb",FMPatchesDirectory); ++ snprintf(patchesfile, PATH_MAX, "%s/std.sb",FMPatchesDirectory); + size=52; + } + fh=fopen(patchesfile,"rb"); +@@ -170,11 +171,11 @@ + + if (opl==3) + { +- sprintf(drumsfile,"%s/drums.o3",FMPatchesDirectory); ++ snprintf(drumsfile, PATH_MAX, "%s/drums.o3",FMPatchesDirectory); + } + else + { +- sprintf(drumsfile,"%s/drums.sb",FMPatchesDirectory); ++ snprintf(drumsfile, PATH_MAX, "%s/drums.sb",FMPatchesDirectory); + } + + fh=fopen(drumsfile,"rb"); +Index: kdelibs/libkmid/midfile.cc +diff -u kdelibs/libkmid/midfile.cc:1.21 kdelibs/libkmid/midfile.cc:1.21.2.3 +--- libkmid/midfile.cc:1.21 Tue Mar 13 17:41:09 2001 ++++ libkmid/midfile.cc Fri Dec 6 15:24:24 2002 +@@ -34,6 +34,9 @@ + #include "sys/stat.h" + #include <config.h> + ++#include <kprocess.h> ++#include <qfile.h> ++ + int fsearch(FILE *fh,const char *text,long *ptr); + + /* This function gives the metronome tempo, from a tempo data as found in +@@ -51,26 +54,23 @@ + int uncompressFile(const char *gzname, char *tmpname) + // Returns 0 if OK, 1 if error (tmpname not set) + { +- char *cmd=new char[20+strlen(gzname)]; +- sprintf(cmd, "gzip -dc \"%s\"",gzname); +- FILE *infile = popen( cmd, "r"); +- if (infile==NULL) +- { +- fprintf(stderr,"ERROR : popen failed : %s\n",cmd); ++ QString cmd("gzip -dc " + KShellProcess::quote(gzname)); ++ FILE *infile = popen( QFile::encodeName(cmd).data(), "r"); ++ if (infile==NULL) { ++ fprintf(stderr,"ERROR : popen failed : %s\n",QFile::encodeName(cmd).data()); ++ return 1; + } + strcpy(tmpname, "/tmp/KMid.XXXXXXXXXX"); + int fd = mkstemp(tmpname); + if (fd == -1) + { + pclose(infile); +- delete cmd; + return 1; + } + FILE *outfile= fdopen(fd,"wb"); + if (outfile==NULL) + { + pclose(infile); +- delete cmd; + return 1; + } + int n=getc(infile); +@@ -79,7 +79,6 @@ + pclose(infile); + fclose(outfile); + unlink(tmpname); +- delete cmd; + return 1; + } + fputc(n,outfile); +@@ -97,7 +96,6 @@ + // Is it right for pclose to always fail ? + + fclose(outfile); +- delete cmd; + return 0; + } + +Index: kdelibs/libkmid/midimapper.cc +diff -u kdelibs/libkmid/midimapper.cc:1.12 kdelibs/libkmid/midimapper.cc:1.12.6.1 +--- libkmid/midimapper.cc:1.12 Fri Jul 28 23:45:30 2000 ++++ libkmid/midimapper.cc Sat Dec 7 18:48:39 2002 +@@ -184,7 +184,9 @@ + MidiMapper::Keymap *MidiMapper::createKeymap(char *name,uchar use_same_note,uchar note) + { + Keymap *km=new Keymap; +- strcpy(km->name,name); ++ strncpy(km->name, name, KM_NAME_SIZE); ++ km->name[KM_NAME_SIZE - 1] = 0; ++ + int i; + if (use_same_note==1) + { +@@ -263,7 +265,7 @@ + char s[101]; + char v[101]; + char t[101]; +- char name[101]; ++ char name[256]; /* Longer than t and 'AllKeysTo' */ + int i=0; + int j,w; + #ifdef MIDIMAPPERDEBUG +@@ -323,7 +325,9 @@ + removeSpaces(first_line); + getWord(v,first_line,2); + Keymap *km=new Keymap; +- strcpy(km->name,v); ++ strncpy(km->name, v, KM_NAME_SIZE); ++ km->name[KM_NAME_SIZE - 1] = 0; ++ + int i=0; + while (i<128) + { +Index: kdelibs/libkmid/midimapper.h +diff -u kdelibs/libkmid/midimapper.h:1.8 kdelibs/libkmid/midimapper.h:1.8.6.1 +--- libkmid/midimapper.h:1.8 Fri Jul 28 23:45:30 2000 ++++ libkmid/midimapper.h Sat Dec 7 18:48:41 2002 +@@ -27,6 +27,8 @@ + #include <stdio.h> + #include <libkmid/dattypes.h> + ++#define KM_NAME_SIZE 30 ++ + /** + * A Midi Mapper class which defines the way MIDI events are translated + * (or "mapped") to different ones. This way, when two MIDI devices "talk" +@@ -65,7 +67,7 @@ + */ + struct Keymap + { +- char name[30]; ++ char name[KM_NAME_SIZE]; + uchar key[128]; + struct Keymap *next; + }; +Index: kdelibs/libkmid/player.cc +diff -u kdelibs/libkmid/player.cc:1.41 kdelibs/libkmid/player.cc:1.41.2.1 +--- libkmid/player.cc:1.41 Wed Aug 1 02:05:10 2001 ++++ libkmid/player.cc Sat Dec 7 18:48:42 2002 +@@ -366,7 +366,8 @@ + { + lasttexttime=pspev->absmilliseconds; + lasttexttype=pspev->type; +- strcpy(lasttext,pspev->text); ++ strncpy(lasttext, pspev->text, 1024); ++ lasttext[1023] = 0; + #endif + pspev->next=new SpecialEvent; + #ifdef PLAYERDEBUG diff --git a/kde-base/kdelibs/kdelibs-2.2.2a-r1.ebuild b/kde-base/kdelibs/kdelibs-2.2.2a-r1.ebuild new file mode 100644 index 000000000000..fe05ffece703 --- /dev/null +++ b/kde-base/kdelibs/kdelibs-2.2.2a-r1.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-2.2.2a-r1.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ + +IUSE="ssl cups ipv6 alsa" +inherit kde kde.org +#don't inherit kde-dist! it calls need-kde which adds kdelibs to depend -> circular deps! + +DESCRIPTION="KDE $PV - base libraries needed by all kde programs" +KEYWORDS="x86 ~sparc " +HOMEPAGE="http//www.kde.org/" + +SLOT="2" +LICENSE="GPL-2 LGPL-2" + +S=$WORKDIR/kdelibs-2.2.2 + +# kde.eclass has kdelibs in DEPEND, and we can't have that in here. so we recreate the entire +# DEPEND from scratch. +DEPEND="" +RDEPEND="" +newdepend ">=sys-devel/gcc-2.95.2 + virtual/glibc + sys-devel/perl + >=media-libs/audiofile-0.1.9 + >=sys-apps/bzip2-1.0.1 + >=dev-libs/libxslt-1.0.7 + >=dev-libs/libpcre-3.5 + >=dev-libs/libxml2-2.4.10 + ssl? ( >=dev-libs/openssl-0.9.6 ) + alsa? ( >=media-libs/alsa-lib-0.5.9 >=media-sound/alsa-driver-0.5.9 ) + cups? ( net-print/cups ) + >=media-libs/tiff-3.5.5 + app-admin/fam-oss" + +DEPEND="$DEPEND + sys-devel/make + sys-devel/autoconf + sys-devel/automake" + +RDEPEND="$RDEPEND + app-text/sgml-common + cups? ( net-print/cups ) + dev-lang/python" + +qtver-from-kdever $PV +need-qt $selected_version + +set-kdedir $PV + +#this patch contains security issues backported from kde-3.0.5a. +PATCHES="${FILESDIR}/${P}-gentoo.diff + ${FILESDIR}/${P}-crosside.diff" + +src_unpack() { + + base_src_unpack + + kde_sandbox_patch ${S}/{arts/soundserver,kio/kpac} + +} + +src_compile() { + + kde_src_compile myconf + + use ipv6 || myconf="$myconf --with-ipv6-lookup=no" + use ssl && myconf="$myconf --with-ssl-dir=/usr" || myconf="$myconf --without-ssl" + use alsa && myconf="$myconf --with-alsa" || myconf="$myconf --without-alsa" + use cups && myconf="$myconf --enable-cups" || myconf="$myconf --disable-cups" + + kde_src_compile configure make + +} + +src_install() { + + kde_src_install + + dohtml *.html + + dodir /etc/env.d + + if [ "${PREFIX}" != "/usr/kde/2" ]; then +echo "PATH=${PREFIX}/bin:/usr/kde/2/bin +ROOTPATH=${PREFIX}/bin:/usr/kde/2/bin +LDPATH=${PREFIX}/lib:/usr/kde/2/lib" > ${D}/etc/env.d/70kdelibs-${PV} + else +echo "PATH=${PREFIX}/bin +ROOTPATH=${PREFIX}/bin +LDPATH=${PREFIX}/lib" > ${D}/etc/env.d/70kdelibs-${PV} + fi + + echo "KDEDIR=/usr/kde/2" > ${D}/etc/env.d/40kdedir-${PV} + +} + + diff --git a/kde-base/kdemultimedia/ChangeLog b/kde-base/kdemultimedia/ChangeLog index 571da59689bd..82f5949c46be 100644 --- a/kde-base/kdemultimedia/ChangeLog +++ b/kde-base/kdemultimedia/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdemultimedia # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdemultimedia/ChangeLog,v 1.27 2003/01/08 21:45:57 gerk Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdemultimedia/ChangeLog,v 1.28 2003/01/17 20:31:28 hannes Exp $ + +*kdemultimedia-2.2.2-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdemultimedia-2.2.2-r1.ebuild: + new version, fixes #12520 08 Jan 2003; Mark Guertin <gerk@gentoo.org> kdemultimedia-3.1_rc6.ebuild: added ~ppc to keywords diff --git a/kde-base/kdemultimedia/files/digest-kdemultimedia-2.2.2-r1 b/kde-base/kdemultimedia/files/digest-kdemultimedia-2.2.2-r1 new file mode 100644 index 000000000000..f8b5f3a77656 --- /dev/null +++ b/kde-base/kdemultimedia/files/digest-kdemultimedia-2.2.2-r1 @@ -0,0 +1,2 @@ +MD5 76981ca284663093cd0bc37500e10441 kdemultimedia-2.2.2.tar.bz2 4700495 +MD5 d1d25b39ee98e340ac3730f7afe54f0c post-2.2.2-kdemultimedia.diff 17629 diff --git a/kde-base/kdemultimedia/files/kdemultimedia-2.2.2-r1-gentoo.diff b/kde-base/kdemultimedia/files/kdemultimedia-2.2.2-r1-gentoo.diff new file mode 100644 index 000000000000..548c6dd407ab --- /dev/null +++ b/kde-base/kdemultimedia/files/kdemultimedia-2.2.2-r1-gentoo.diff @@ -0,0 +1,66 @@ +diff -ru kdemultimedia-2.2.1.orig/kmidi/TIMIDITY/motif_p.c kdemultimedia-2.2.1/kmidi/TIMIDITY/motif_p.c +--- kmidi/TIMIDITY/motif_p.c Mon Feb 28 19:07:37 2000 ++++ kmidi/TIMIDITY/motif_p.c Fri Oct 19 04:00:10 2001 +@@ -22,6 +22,7 @@ + pipe communication between motif interface and sound generator + + */ ++#include <sys/errno.h> + #ifdef IA_MOTIF + + #include <stdio.h> +diff -ru kdemultimedia-2.2.1.orig/kmidi/alsa_a.cpp kdemultimedia-2.2.1/kmidi/alsa_a.cpp +--- kmidi/alsa_a.cpp Thu Aug 24 21:49:04 2000 ++++ kmidi/alsa_a.cpp Fri Oct 19 04:01:06 2001 +@@ -254,7 +254,7 @@ + == 1 warning + == -1 fails + */ +-static int set_playback_info (void* handle__, ++static int set_playback_info (snd_pcm_t* handle__, + uint32* encoding__, uint32* rate__, + const int32 extra_param[5]) + { +@@ -426,13 +426,13 @@ + playback_params.fragments_max = extra_param[0]; + #endif + playback_params.buf.block.frags_min = 1; +- snd_pcm_plugin_flush(handle__, SND_PCM_CHANNEL_PLAYBACK); ++ snd_pcm_plugin_flush((snd_pcm_t *)handle__, SND_PCM_CHANNEL_PLAYBACK); + + playback_params.start_mode = SND_PCM_START_FULL; + playback_params.stop_mode = SND_PCM_STOP_STOP; + //playback_params.stop_mode = SND_PCM_STOP_ROLLOVER; + +- tmp = snd_pcm_channel_params (handle__, &playback_params); ++ tmp = snd_pcm_channel_params ((snd_pcm_t *)handle__, &playback_params); + + //fprintf(stderr,"tmp = %d from snd_pcm_channel_params\n",tmp); + if (tmp != 0) +@@ -448,7 +448,7 @@ + } + + +- if (snd_pcm_plugin_prepare(handle__, SND_PCM_CHANNEL_PLAYBACK) < 0) { ++ if (snd_pcm_plugin_prepare((snd_pcm_t *)handle__, SND_PCM_CHANNEL_PLAYBACK) < 0) { + fprintf(stderr, "unable to prepare channel\n"); + return -1; + } +@@ -456,7 +456,7 @@ + memset(&setup, 0, sizeof(setup)); + setup.channel = SND_PCM_CHANNEL_PLAYBACK; + setup.mode = SND_PCM_MODE_BLOCK; +- if (snd_pcm_plugin_setup(handle__, &setup) < 0) { ++ if (snd_pcm_plugin_setup((snd_pcm_t *)handle__, &setup) < 0) { + fprintf(stderr, "unable to obtain setup\n"); + return -1; + } +@@ -466,7 +466,7 @@ + //fprintf(stderr, "setup frags = %d\n", setup.buf.block.frags); + //fprintf(stderr, "setup frag_size = %d\n", setup.buf.block.frag_size); + +- if(snd_pcm_plugin_status(handle__, &playback_status) == 0) ++ if(snd_pcm_plugin_status((snd_pcm_t *)handle__, &playback_status) == 0) + { + if (setup.format.rate != orig_rate) + { diff --git a/kde-base/kdemultimedia/kdemultimedia-2.2.2-r1.ebuild b/kde-base/kdemultimedia/kdemultimedia-2.2.2-r1.ebuild new file mode 100644 index 000000000000..b3ffc2990715 --- /dev/null +++ b/kde-base/kdemultimedia/kdemultimedia-2.2.2-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdemultimedia/kdemultimedia-2.2.2-r1.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ + +IUSE="nas esd motif gtk slang alsa" +inherit kde-dist + +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +DESCRIPTION="KDE $PV - multimedia apps" +KEYWORDS="x86 ~sparc " +MAKEOPTS="${MAKEOPTS} -j1" +newdepend ">=sys-libs/ncurses-5.2 + >=media-sound/cdparanoia-3.9.8 + >=media-libs/libvorbis-1.0_beta4 + >=media-video/xanim-2.80.1 + alsa? ( >=media-libs/alsa-lib-0.5.9 ) + nas? ( >=media-libs/nas-1.4.1 ) + esd? ( >=media-sound/esound-0.2.22 ) + motif? ( >=x11-libs/openmotif-2.1.30 ) + gtk? ( =x11-libs/gtk+-1.2* ) + slang? ( >=sys-libs/slang-1.4.4 )" + +src_unpack() { + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff + patch -p0 < ${FILESDIR}/${P}-gentoo.diff +} + +src_compile() { + + kde_src_compile myconf + + local myaudio + local myinteface + myaudio="--enable-audio=oss" + myinterface="--enable-interface=xaw,ncurses" + + use alsa && myconf="$myconf --with-alsa" && myaudio="$myaudio,alsa" + use nas && myaudio="$myaudio,nas" + use esd && myaudio="$myaudio,esd" + use motif && myinterface="$myinterface,motif" + use gtk && myinterface="$myinterface,gtk" + use slang && myinterface="$myinterface,slang" +# tcl tk does not work + + myconf="$myconf $myaudio $myinterface" + + kde_src_compile configure make + +} + + diff --git a/kde-base/kdenetwork/ChangeLog b/kde-base/kdenetwork/ChangeLog index bbe8517db937..b2abe6649463 100644 --- a/kde-base/kdenetwork/ChangeLog +++ b/kde-base/kdenetwork/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdenetwork # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdenetwork/ChangeLog,v 1.24 2003/01/08 21:45:57 gerk Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdenetwork/ChangeLog,v 1.25 2003/01/17 20:31:28 hannes Exp $ + +*kdenetwork-2.2.2-r2 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdenetwork-2.2.2-r2.ebuild: + new version, fixes #12520 08 Jan 2003; Mark Guertin <gerk@gentoo.org> kdenetwork-3.1_rc6.ebuild: added ~ppc to keywords diff --git a/kde-base/kdenetwork/files/digest-kdenetwork-2.2.2-r2 b/kde-base/kdenetwork/files/digest-kdenetwork-2.2.2-r2 new file mode 100644 index 000000000000..8571070a6480 --- /dev/null +++ b/kde-base/kdenetwork/files/digest-kdenetwork-2.2.2-r2 @@ -0,0 +1,2 @@ +MD5 ef664b35f9d8ab083855ac5118b9c7b2 kdenetwork-2.2.2.tar.bz2 3168454 +MD5 59ac7be4995bed8b119a4e5882e54cff post-2.2.2-kdenetwork.diff 8640 diff --git a/kde-base/kdenetwork/kdenetwork-2.2.2-r2.ebuild b/kde-base/kdenetwork/kdenetwork-2.2.2-r2.ebuild new file mode 100644 index 000000000000..9e3dbc154742 --- /dev/null +++ b/kde-base/kdenetwork/kdenetwork-2.2.2-r2.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdenetwork/kdenetwork-2.2.2-r2.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ +inherit kde-dist + +DESCRIPTION="KDE $PV - network apps: kmail..." +KEYWORDS="x86 ~sparc " +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +src_unpack() { + + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff + kde_sandbox_patch ${S}/kppp + +} +src_install() { + + kde_src_install + + chmod +s ${D}/${KDEDIR}/bin/reslisa + +} diff --git a/kde-base/kdepim/ChangeLog b/kde-base/kdepim/ChangeLog index bbc94bbf87e2..f8b43edc83cd 100644 --- a/kde-base/kdepim/ChangeLog +++ b/kde-base/kdepim/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdepim # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/ChangeLog,v 1.23 2003/01/17 08:46:31 danarmak Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/ChangeLog,v 1.24 2003/01/17 20:31:28 hannes Exp $ + +*kdepim-2.2.2-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdepim-2.2.2-r1.ebuild: + new version, fixes #12520 17 Jan 2003; Dan Armak <danarmak@gentoo.org> kdepim-2.2.2.ebuild : diff --git a/kde-base/kdepim/files/digest-kdepim-2.2.2-r1 b/kde-base/kdepim/files/digest-kdepim-2.2.2-r1 new file mode 100644 index 000000000000..f0a6a7a67937 --- /dev/null +++ b/kde-base/kdepim/files/digest-kdepim-2.2.2-r1 @@ -0,0 +1 @@ +MD5 55daf69b90108509895814b96fc8b671 kdepim-2.2.2.tar.bz2 2428768 diff --git a/kde-base/kdepim/files/kdepim-2.2.2-gentoo.diff b/kde-base/kdepim/files/kdepim-2.2.2-gentoo.diff new file mode 100644 index 000000000000..7b5f3a7ec14a --- /dev/null +++ b/kde-base/kdepim/files/kdepim-2.2.2-gentoo.diff @@ -0,0 +1,31 @@ +--- korganizer/calprinter.cpp 2001-07-29 07:01:34.000000000 +0200 ++++ korganizer/calprinter.cpp 2002-12-23 19:26:21.000000000 +0100 +@@ -412,7 +412,7 @@ + p.end(); + } + +-void CalPrinter::drawTodo(int count, Todo * item, QPainter &p,int level=0,QRect *r=0) ++void CalPrinter::drawTodo(int count, Todo * item, QPainter &p,int level,QRect *r) + { + QString outStr; + KLocale *local = KGlobal::locale(); +--- ldif/ldif.cpp 2001-01-08 20:46:36.000000000 +0100 ++++ ldif/ldif.cpp 2003-01-17 16:22:48.000000000 +0100 +@@ -13,6 +13,7 @@ + + #include <ctype.h> + ++using namespace std; + // The copyright notice below refers to the base64 and quoted-printable codec + // functions used below, which are modified from the original sources. + +--- libdif/ldif.cpp 2001-01-08 20:46:36.000000000 +0100 ++++ libdif/ldif.cpp 2003-01-17 16:22:48.000000000 +0100 +@@ -13,6 +13,7 @@ + + #include <ctype.h> + ++using namespace std; + // The copyright notice below refers to the base64 and quoted-printable codec + // functions used below, which are modified from the original sources. + diff --git a/kde-base/kdepim/files/post-2.2.2-kdepim.diff b/kde-base/kdepim/files/post-2.2.2-kdepim.diff new file mode 100644 index 000000000000..6f6d3266c148 --- /dev/null +++ b/kde-base/kdepim/files/post-2.2.2-kdepim.diff @@ -0,0 +1,210 @@ +Index: kdepim/korganizer/komailclient.cpp +diff -u kdepim/korganizer/komailclient.cpp:1.18 kdepim/korganizer/komailclient.cpp:1.18.2.1 +--- kdepim/korganizer/komailclient.cpp:1.18 Sun May 6 20:57:36 2001 ++++ kdepim/korganizer/komailclient.cpp Fri Dec 6 18:35:26 2002 +@@ -14,6 +14,7 @@ + #include <kurl.h> + #include <kapp.h> + #include <dcopclient.h> ++#include <kprocess.h> + + #include "version.h" + #include "event.h" +@@ -67,17 +68,16 @@ + command = KStandardDirs::findExe(QString::fromLatin1("mail")); + if (command.isNull()) return false; // give up + +- command.append(QString::fromLatin1(" -s \x22")); +- command.append(subject); +- command.append(QString::fromLatin1("\x22")); ++ command.append(QString::fromLatin1(" -s ")); ++ command.append(KShellProcess::quote(subject)); + + if (bcc) { + command.append(QString::fromLatin1(" -b ")); +- command.append(from); ++ command.append(KShellProcess::quote(from)); + } + + command.append(" "); +- command.append(to); ++ command.append(KShellProcess::quote(to)); + + needHeaders = false; + } +Index: kdepim/kpilot/conduits/popmail/parsedate.c +diff -u kdepim/kpilot/conduits/popmail/parsedate.c:1.4 kdepim/kpilot/conduits/popmail/parsedate.c:1.4.6.3 +--- kdepim/kpilot/conduits/popmail/parsedate.c:1.4 Fri Jul 28 01:07:16 2000 ++++ kdepim/kpilot/conduits/popmail/parsedate.c Thu Dec 5 19:34:09 2002 +@@ -1676,7 +1676,7 @@ + for ( ; ; ) { + (void)printf("\t> "); + (void)fflush(stdout); +- if (gets(buff) == NULL || buff[0] == '\n') ++ if (fgets(stdin,buff,sizeof(buff)-1) == NULL || buff[0] == '\n') + break; + #if YYDEBUG + if (strcmp(buff, "yydebug") == 0) { +Index: kdepim/libical/src/libicalss/icalfileset.c +diff -u kdepim/libical/src/libicalss/icalfileset.c:1.5 kdepim/libical/src/libicalss/icalfileset.c:1.5.2.1 +--- kdepim/libical/src/libicalss/icalfileset.c:1.5 Wed Apr 11 17:37:32 2001 ++++ kdepim/libical/src/libicalss/icalfileset.c Fri Dec 6 17:16:04 2002 +@@ -282,12 +282,6 @@ + + } + +-#ifdef ICAL_SAFESAVES +-int icalfileset_safe_saves=1; +-#else +-int icalfileset_safe_saves=0; +-#endif +- + icalerrorenum icalfileset_commit(icalfileset* cluster) + { + char tmp[ICAL_PATH_MAX]; +@@ -306,15 +300,6 @@ + return ICAL_NO_ERROR; + } + +- if(icalfileset_safe_saves == 1){ +- snprintf(tmp,ICAL_PATH_MAX,"cp %s %s.bak",impl->path,impl->path); +- +- if(system(tmp) < 0){ +- icalerror_set_errno(ICAL_FILE_ERROR); +- return ICAL_FILE_ERROR; +- } +- } +- + if(lseek(impl->fd,SEEK_SET,0) < 0){ + icalerror_set_errno(ICAL_FILE_ERROR); + return ICAL_FILE_ERROR; +Index: kdepim/libical/src/test/regression.c +diff -u kdepim/libical/src/test/regression.c:1.4 kdepim/libical/src/test/regression.c:1.4.2.1 +--- kdepim/libical/src/test/regression.c:1.4 Wed Apr 11 17:37:32 2001 ++++ kdepim/libical/src/test/regression.c Fri Dec 6 18:25:09 2002 +@@ -2863,8 +2863,6 @@ + struct icaldurationtype d; + int i; + int final,sec; +- +- icalfileset_safe_saves = 1; + + icalerror_clear_errno(); + +--- kdepim/libical/src/libical/icalmime.c~ 2003-01-17 17:58:09.000000000 +0100 ++++ kdepim/libical/src/libical/icalmime.c 2003-01-17 17:59:40.000000000 +0100 +@@ -205,8 +205,8 @@ + } + + if(parts[i].header.error!=SSPM_NO_ERROR){ +- char *str; +- char* temp[256]; ++ const char *str = "Unknown Error"; ++ char temp[256]; + + if(parts[i].header.error==SSPM_UNEXPECTED_BOUNDARY_ERROR){ + str = "Got an unexpected boundary, possibly due to a MIME header for a MULTIPART part that is missing the Content-Type line"; +@@ -227,16 +227,16 @@ + } + + if(parts[i].header.error_text != 0){ +- snprintf((char*)temp,256, ++ snprintf(temp,sizeof(temp), + "%s: %s",str,parts[i].header.error_text); + } else { +- strcpy((char*)temp,str); ++ strcpy(temp,str); + } + + icalcomponent_add_property + (comp, + icalproperty_vanew_xlicerror( +- (char*)temp, ++ temp, + icalparameter_new_xlicerrortype( + ICAL_XLICERRORTYPE_MIMEPARSEERROR), + 0)); +Index: libical/icalparameter.c +=================================================================== +RCS file: /home/kde/kdepim/libical/src/libical/icalparameter.c,v +retrieving revision 1.4 +diff -u -r1.4 icalparameter.c +--- kdepim/libical/src/libical/icalparameter.c 11 Apr 2001 15:37:32 -0000 1.4 ++++ kdepim/libical/src/libical/icalparameter.c 15 Dec 2002 21:58:11 -0000 +@@ -257,7 +257,7 @@ + /* Now, copy the buffer to a tmp_buffer, which is safe to give to + the caller without worring about de-allocating it. */ + +- out_buf = icalmemory_tmp_buffer(strlen(buf)); ++ out_buf = icalmemory_tmp_buffer(strlen(buf)+1); + strcpy(out_buf, buf); + + icalmemory_free_buffer(buf); +Index: libical/sspm.c +=================================================================== +RCS file: /home/kde/kdepim/libical/src/libical/sspm.c,v +retrieving revision 1.4 +diff -u -r1.4 sspm.c +--- kdepim/libical/src/libical/sspm.c 11 Apr 2001 15:37:32 -0000 1.4 ++++ kdepim/libical/src/libical/sspm.c 15 Dec 2002 21:58:12 -0000 +@@ -948,7 +948,8 @@ + + assert(strlen(buf) < BUF_SIZE); + +- strcpy(header_lines[current_line],buf); ++ strncpy(header_lines[current_line],buf,BUF_SIZE); ++ header_lines[current_line][BUF_SIZE-1] = '\0'; + + break; + } +@@ -984,7 +984,7 @@ + + assert( strlen(buf_start) + strlen(last_line) < BUF_SIZE); + +- strcat(last_line,buf_start); ++ strncat(last_line,buf_start, BUF_SIZE-strlen(last_line)-1); + + break; + } +Index: libicalvcal/vobject.c +=================================================================== +RCS file: /home/kde/kdepim/libical/src/libicalvcal/vobject.c,v +retrieving revision 1.1 +diff -u -r1.1 vobject.c +--- kdepim/libical/src/libicalvcal/vobject.c 1 Jan 2001 15:37:08 -0000 1.1 ++++ kdepim/libical/src/libicalvcal/vobject.c 15 Dec 2002 21:58:12 -0000 +@@ -1247,9 +1247,10 @@ + char buf2[256]; + strcpy(buf1,NAME_OF(o)); + while ((o=isAPropertyOf(o,VCGroupingProp)) != 0) { +- strcpy(buf2,STRINGZ_VALUE_OF(o)); +- strcat(buf2,"."); +- strcat(buf2,buf1); ++ strncpy(buf2,STRINGZ_VALUE_OF(o), sizeof(buf2)); ++ buf2[sizeof(buf2)-1] = '\0'; ++ strncat(buf2,".", sizeof(buf2)-strlen(buf2)-1); ++ strncat(buf2,buf1, sizeof(buf2)-strlen(buf2)-1); + strcpy(buf1,buf2); + } + appendsOFile(fp,buf1); +Index: versit/vobject.c +=================================================================== +RCS file: /home/kde/kdepim/libkcal/versit/vobject.c,v +retrieving revision 1.1 +diff -u -r1.1 vobject.c +--- kdepim/libkcal/versit/vobject.c 18 Apr 2001 23:28:58 -0000 1.1 ++++ kdepim/libkcal/versit/vobject.c 15 Dec 2002 21:52:11 -0000 +@@ -1226,9 +1226,10 @@ + char buf2[256]; + strcpy(buf1,NAME_OF(o)); + while ((o=isAPropertyOf(o,VCGroupingProp)) != 0) { +- strcpy(buf2,STRINGZ_VALUE_OF(o)); +- strcat(buf2,"."); +- strcat(buf2,buf1); ++ strncpy(buf2,STRINGZ_VALUE_OF(o),sizeof(buf2)); ++ buf2[sizeof(buf2)] = '\0'; ++ strncat(buf2,".",sizeof(buf2)-strlen(buf2)-1); ++ strncat(buf2,buf1,sizeof(buf2)-strlen(buf2)-1); + strcpy(buf1,buf2); + } + appendsOFile(fp,buf1); diff --git a/kde-base/kdepim/kdepim-2.2.2-r1.ebuild b/kde-base/kdepim/kdepim-2.2.2-r1.ebuild new file mode 100644 index 000000000000..c782b37c7229 --- /dev/null +++ b/kde-base/kdepim/kdepim-2.2.2-r1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdepim/kdepim-2.2.2-r1.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ +inherit kde-dist + +DESCRIPTION="KDE $PV - PIM (Personal Information Management) apps: korganizer..." +KEYWORDS="x86 ~sparc" + +DEPEND="$DEPEND sys-devel/perl" +newdepend ">=dev-libs/pilot-link-0.9.0" + +# doesn't compile with gcc3/glibc3.2 and will not be fixed +KDE_REMOVE_DIR="kpilot" + +src_unpack() { + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${FILESDIR}/post-${PV}-${PN}.diff + patch -p0 < ${FILESDIR}/${P}-gentoo.diff +} + +src_install() { + kde_src_install + docinto html + dodoc *.html +} diff --git a/kde-base/kdesdk/ChangeLog b/kde-base/kdesdk/ChangeLog index 619c4eaa3853..58a216f2d5db 100644 --- a/kde-base/kdesdk/ChangeLog +++ b/kde-base/kdesdk/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdesdk # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdesdk/ChangeLog,v 1.15 2003/01/07 00:08:01 weeve Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdesdk/ChangeLog,v 1.16 2003/01/17 20:31:28 hannes Exp $ + +*kdesdk-2.2.2-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdesdk-2.2.2-r1.ebuild: + new version, fixes #12520 *kdesdk-3.1_rc6 (05 Jan 2003) diff --git a/kde-base/kdesdk/files/digest-kdesdk-2.2.2-r1 b/kde-base/kdesdk/files/digest-kdesdk-2.2.2-r1 new file mode 100644 index 000000000000..2c414ad7ee5b --- /dev/null +++ b/kde-base/kdesdk/files/digest-kdesdk-2.2.2-r1 @@ -0,0 +1,2 @@ +MD5 f8080a3269a99f0c22a55ad9cab0682d kdesdk-2.2.2.tar.bz2 1094197 +MD5 690c7fdab1bbc743eafac9b06997a03b post-2.2.2-kdesdk.diff 1801 diff --git a/kde-base/kdesdk/files/kdesdk-2.2.2-gentoo.diff b/kde-base/kdesdk/files/kdesdk-2.2.2-gentoo.diff new file mode 100644 index 000000000000..a22706606b27 --- /dev/null +++ b/kde-base/kdesdk/files/kdesdk-2.2.2-gentoo.diff @@ -0,0 +1,39 @@ +--- kmtrace/ktrace.c 2001-03-13 20:16:09.000000000 +0100 ++++ kmtrace/ktrace.c 2003-01-11 13:03:52.000000000 +0100 +@@ -25,14 +25,15 @@ + or (US mail) as Mike Haertel c/o Free Software Foundation. + */ + +-#define _LIBC + #define MALLOC_HOOKS + #define _GNU_SOURCE + + #ifndef _MALLOC_INTERNAL + #define _MALLOC_INTERNAL ++#define _LIBC + #include <malloc.h> + #include <bits/libc-lock.h> ++#undef _LIBC + #endif + + #include <dlfcn.h> +--- poxml/GettextParser.hpp 2001-03-21 21:21:33.000000000 +0100 ++++ poxml/GettextParser.hpp 2003-01-11 13:20:32.000000000 +0100 +@@ -13,6 +13,9 @@ + #include "GettextParserTokenTypes.hpp" + #include "antlr/LLkParser.hpp" + ++#include <string> ++using namespace std; ++ + class GettextParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public GettextParserTokenTypes + { + #line 1 "gettext.g" +--- poxml/swappo.cpp 2001-05-02 12:13:59.000000000 +0200 ++++ poxml/swappo.cpp 2003-01-11 13:22:38.000000000 +0100 +@@ -1,3 +1,5 @@ ++#include <iostream> ++using namespace std; + #include "GettextParser.hpp" + #include <fstream> + #include "GettextLexer.hpp" diff --git a/kde-base/kdesdk/kdesdk-2.2.2-r1.ebuild b/kde-base/kdesdk/kdesdk-2.2.2-r1.ebuild new file mode 100644 index 000000000000..c7bf8676a1c7 --- /dev/null +++ b/kde-base/kdesdk/kdesdk-2.2.2-r1.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdesdk/kdesdk-2.2.2-r1.ebuild,v 1.1 2003/01/17 20:31:28 hannes Exp $ +inherit kde-dist + +DESCRIPTION="KDE $PV - SDK: kbabel, ..." +KEYWORDS="x86 ~sparc" + +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +src_unpack() { + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff + patch -p0 < ${FILESDIR}/${P}-gentoo.diff +} diff --git a/kde-base/kdeutils/ChangeLog b/kde-base/kdeutils/ChangeLog index 5d05bd0d38a1..df76f7ee7365 100644 --- a/kde-base/kdeutils/ChangeLog +++ b/kde-base/kdeutils/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for kde-base/kdeutils # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdeutils/ChangeLog,v 1.18 2003/01/08 21:45:57 gerk Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdeutils/ChangeLog,v 1.19 2003/01/17 20:31:28 hannes Exp $ + +*kdeutils-2.2.2-r1 (17 Jan 2003) + + 17 Jan 2003; Hannes Mehnert <hannes@gentoo.org> kdeutils-2.2.2-r1.ebuild: + new version, fixes #12520 08 Jan 2003; Mark Guertin <gerk@gentoo.org> kdeutils-3.1_rc6.ebuild: added ~ppc to keywords diff --git a/kde-base/kdeutils/files/digest-kdeutils-2.2.2-r1 b/kde-base/kdeutils/files/digest-kdeutils-2.2.2-r1 new file mode 100644 index 000000000000..e7004fcdfd2b --- /dev/null +++ b/kde-base/kdeutils/files/digest-kdeutils-2.2.2-r1 @@ -0,0 +1,2 @@ +MD5 68c3c86d97c3a95079f81b2c7f4bf35a kdeutils-2.2.2.tar.bz2 1466910 +MD5 8174e328f47e18a8a52b13b34f5c54e5 post-2.2.2-kdeutils.diff 10515 diff --git a/kde-base/kdeutils/files/kdeutils-2.2.2-gentoo.diff b/kde-base/kdeutils/files/kdeutils-2.2.2-gentoo.diff new file mode 100644 index 000000000000..1de2252aed9e --- /dev/null +++ b/kde-base/kdeutils/files/kdeutils-2.2.2-gentoo.diff @@ -0,0 +1,26 @@ +--- klprfax/klprfax/klprfax.cpp~ 2002-12-23 12:17:05.000000000 +0100 ++++ klprfax/klprfax/klprfax.cpp 2002-12-23 12:17:39.000000000 +0100 +@@ -37,7 +37,7 @@ + AddressBook::ErrorCode err; + AddressBook *bk; + int n,i; +-QString name,fax0,fax1,fax2,fax3; ++QString mname,fax0,fax1,fax2,fax3; + QString nil=""; + + app=_app; +@@ -74,12 +74,12 @@ + AddressBook::Entry e; + err=bk->getKey(i,k); + err=bk->getEntry(k,e); +- if (NameFax(e,name,fax0,fax1,fax2,fax3)) {klprfax_widget *tmp; ++ if (NameFax(e,mname,fax0,fax1,fax2,fax3)) {klprfax_widget *tmp; + + rows+=1;if (rows>=names->numRows()) { names->setNumRows(rows+1); } + + tmp=new klprfax_widget(rows,0,names); +- tmp->add(name); ++ tmp->add(mname); + tmp->commit(); + tmp->adjustSize(); + if (tmp->width()>col0) { col0=tmp->widget()->width()+5; } diff --git a/kde-base/kdeutils/kdeutils-2.2.2-r1.ebuild b/kde-base/kdeutils/kdeutils-2.2.2-r1.ebuild new file mode 100644 index 000000000000..e95a5bd0025b --- /dev/null +++ b/kde-base/kdeutils/kdeutils-2.2.2-r1.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdeutils/kdeutils-2.2.2-r1.ebuild,v 1.1 2003/01/17 20:31:29 hannes Exp $ +inherit kde-dist + +DESCRIPTION="KDE $PV - utilities" +KEYWORDS="x86 ~sparc" + +SRC_URI="${SRC_URI} + mirror://kde/security_patches/post-${PV}-${PN}.diff" + +src_unpack() { + unpack ${P}.tar.bz2 + cd ${S} + patch -p1 < ${DISTDIR}/post-${PV}-${PN}.diff + patch -p0 < ${FILESDIR}/${P}-gentoo.diff +} |