diff --git a/kdelibs-3.5.10-libice-1.0.10.patch b/kdelibs-3.5.10-libice-1.0.10.patch new file mode 100644 index 0000000..450f3c7 --- /dev/null +++ b/kdelibs-3.5.10-libice-1.0.10.patch @@ -0,0 +1,190 @@ +diff -ur kdelibs-3.5.10/dcop/client/dcop.cpp kdelibs-3.5.10-libice-1.0.10/dcop/client/dcop.cpp +--- kdelibs-3.5.10/dcop/client/dcop.cpp 2005-09-10 10:27:22.000000000 +0200 ++++ kdelibs-3.5.10-libice-1.0.10/dcop/client/dcop.cpp 2020-06-18 12:43:29.743385950 +0200 +@@ -593,9 +593,29 @@ + ( getenv( "ICEAUTHORITY" ) == 0 || getenv( "DISPLAY" ) == 0 ) ) ) + { + // Check for ICE authority file and if the file can be read by us +- QString home = it.data(); +- QString iceFile = it.data() + "/.ICEauthority"; +- QFileInfo fi( iceFile ); ++ QString iceFileBase = "ICEauthority"; ++ QString iceFile; ++ QFileInfo fi; ++ ++ if (getenv("XDG_RUNTIME_DIR") != 0 ) ++ { ++ QFileInfo xdgRuntime(getenv("XDG_RUNTIME_DIR")); ++ passwd* pstruct = getpwnam(it.key().local8Bit()); ++ if (pstruct) ++ { ++ iceFile = QString("%1/%2/%3").arg(xdgRuntime.dirPath()).arg(pstruct->pw_uid).arg(iceFileBase); ++ fi.setFile(iceFile); ++ } ++ if (!pstruct || !fi.exists()) ++ { ++ iceFile = QString::null; ++ } ++ } ++ if (iceFile.isEmpty()) ++ { ++ iceFile = QString("%1/.%2").arg(it.data()).arg(iceFileBase); ++ fi.setFile(iceFile); ++ } + if( iceFile.isEmpty() ) + { + cerr_ << "WARNING: Cannot determine home directory for user " +diff -ur kdelibs-3.5.10/dcop/KDE-ICE/authutil.c kdelibs-3.5.10-libice-1.0.10/dcop/KDE-ICE/authutil.c +--- kdelibs-3.5.10/dcop/KDE-ICE/authutil.c 2005-09-10 10:27:21.000000000 +0200 ++++ kdelibs-3.5.10-libice-1.0.10/dcop/KDE-ICE/authutil.c 2020-06-18 12:43:29.743385950 +0200 +@@ -81,11 +81,13 @@ + IceAuthFileName () + + { ++ static char baseICEauthority[] = "ICEauthority"; + #ifdef _WIN32 +- static char slashDotICEauthority[] = "\\.ICEauthority"; ++ static char pathSep[] = "\\"; + #else +- static char slashDotICEauthority[] = "/.ICEauthority"; ++ static char pathSep[] = "/"; + #endif ++ char fileSep[2]; + char *name; + static char *buf; + static int bsize; +@@ -95,37 +97,70 @@ + #endif + + name = getenv ("ICEAUTHORITY"); +- if ( name ) ++ if (name && name[0]) + return (name); + +- name = getenv ("HOME"); ++ name = getenv("XDG_RUNTIME_DIR"); ++ if (name && name[0]) ++ { ++ char *testBuf; ++ strcpy(fileSep, ""); ++ size = strlen(name) + strlen(pathSep) + strlen(fileSep) + strlen(baseICEauthority) + 1; ++ testBuf = malloc(size); ++ if (!testBuf) ++ { ++ return (NULL); ++ } ++ snprintf(testBuf, size, "%s%s%s%s", name, pathSep, fileSep, baseICEauthority); ++ if (access(testBuf, F_OK)) ++ { ++ name = NULL; ++ } ++ free(testBuf); ++ } + +- if (!name) ++ if (!name || !name[0]) + { ++ name = getenv ("HOME"); ++ strcpy(fileSep, "."); + #ifdef _WIN32 +- if(name = getenv ("HOMEDRIVE")) ++ if (!name || !name[0]) + { +- strcpy (dir, name); +- if(name = getenv ("HOMEPATH")) +- strcat (dir, name); +- } +- else ++ if(name = getenv ("HOMEDRIVE")) ++ { ++ strcpy (dir, name); ++ if(name = getenv ("HOMEPATH")) + { +- if(name = getenv ("USERPROFILE")) +- strcpy (dir, name); +- } +- name = dir; +- if (!name) ++ strcat (dir, name); ++ } ++ name = dir; ++ } ++ else ++ { ++ name = getenv ("USERPROFILE"); ++ } ++ } + #endif + #ifdef __EMX__ +- strcpy (dir,"c:"); +- name = dir; +- if (!name) ++ if (!name || !name[0]) ++ { ++ strcpy (dir,"c:"); ++ name = dir; ++ } + #endif ++ } ++ if (!name || !name[0]) ++ { + return (NULL); + } + +- size = strlen (name) + strlen (&slashDotICEauthority[1]) + 2; ++ /* Special case for "/". We will add our own '/' later. */ ++ if (strcmp(name, pathSep) == 0) ++ { ++ name++; ++ } ++ ++ size = strlen(name) + strlen(pathSep) + strlen(fileSep) + strlen(baseICEauthority) + 1; + + if (size > bsize) + { +@@ -137,8 +172,7 @@ + bsize = size; + } + +- strcpy (buf, name); +- strcat (buf, slashDotICEauthority + (name[1] == '\0' ? 1 : 0)); ++ snprintf(buf, bsize, "%s%s%s%s", name, pathSep, fileSep, baseICEauthority); + + return (buf); + } +diff -ur kdelibs-3.5.10/kinit/kinit.cpp kdelibs-3.5.10-libice-1.0.10/kinit/kinit.cpp +--- kdelibs-3.5.10/kinit/kinit.cpp 2007-10-08 11:52:03.000000000 +0200 ++++ kdelibs-3.5.10-libice-1.0.10/kinit/kinit.cpp 2020-06-18 12:44:24.293631687 +0200 +@@ -59,6 +59,7 @@ + #include + #include + #include ++#include + + #ifdef Q_OS_LINUX + #include +@@ -852,12 +853,7 @@ + exit(255); + } + } +- path = getenv("ICEAUTHORITY"); +- if (path.isEmpty()) +- { +- path = home_dir; +- path += "/.ICEauthority"; +- } ++ path = IceAuthFileName(); + if (access(path.data(), R_OK|W_OK) && (errno != ENOENT)) + { + fprintf(stderr, "kdeinit: Aborting. No write access to '%s'.\n", path.data()); +diff -ur kdelibs-3.5.10/kinit/Makefile.am kdelibs-3.5.10-libice-1.0.10/kinit/Makefile.am +--- kdelibs-3.5.10/kinit/Makefile.am 2007-10-08 11:52:03.000000000 +0200 ++++ kdelibs-3.5.10-libice-1.0.10/kinit/Makefile.am 2020-06-18 12:50:13.443817851 +0200 +@@ -31,6 +31,7 @@ + # into $(all_libraries) isn't better + AM_LDFLAGS = $(LDFLAGS_AS_NEEDED) $(LDFLAGS_NEW_DTAGS) + ++kdeinit_LIBADD = $(top_builddir)/dcop/KDE-ICE/libkICE.la + kdeinit_LDFLAGS = $(KDE_MT_LDFLAGS) $(QT_LDFLAGS) $(X_LDFLAGS) $(USER_LDFLAGS) \ + $(KDE_RPATH) + kdeinit_LDADD = $(LIB_KPARTS) diff --git a/kdelibs3.spec b/kdelibs3.spec index 5060eb1..5dfdfe0 100644 --- a/kdelibs3.spec +++ b/kdelibs3.spec @@ -18,7 +18,7 @@ Summary: KDE 3 Libraries Name: kdelibs3 Version: 3.5.10 -Release: 104%{?dist} +Release: 105%{?dist} License: LGPLv2 Url: http://www.kde.org/ @@ -109,6 +109,11 @@ Patch153: kdelibs-3.5.10-kglobalsettings-xdg-user-dirs.patch # http://mirror.git.trinitydesktop.org/cgit/tdelibs/commit/?id=36a7df39b0f89c467fc6d9c957a7a30f20d96994 # https://bugs.trinitydesktop.org/show_bug.cgi?id=2116 Patch154: kdelibs-3.5.10-fix-accidental-double-free-in-kjs-garbage-collector.patch +# Process the new (libice 1.0.10) location of the ICEauthority file (#1768193) +# patch by Slávek Banko, backported by Kevin Kofler +# http://mirror.git.trinitydesktop.org/cgit/tdelibs/commit/?id=38b2b0be7840d868c21093a406ab98a646212de1 +# https://bugs.trinitydesktop.org/show_bug.cgi?id=3027 +Patch155: kdelibs-3.5.10-libice-1.0.10.patch ## security fixes # fix CVE-2009-2537 - select length DoS @@ -323,6 +328,7 @@ This package includes tools kgrantpty and kpac_dhcp_helper. %patch150 -p1 -b .cups16 %patch151 -p1 -b .cups22 +%patch155 -p1 -b .libice-1.0.10 # security fixes %patch200 -p1 -b .cve-2009-2537 @@ -685,6 +691,9 @@ fi %attr(4755,root,root) %{_bindir}/kpac_dhcp_helper %changelog +* Thu Jun 18 2020 Kevin Kofler - 3.5.10-105 +- Process the new (libice 1.0.10) location of the ICEauthority file (#1768193) + * Wed May 13 2020 Kevin Kofler - 3.5.10-104 - Remove obsolete BuildRequires: db4-devel