summaryrefslogtreecommitdiff
path: root/x11/kdelibs3/patches/patch-an
diff options
context:
space:
mode:
Diffstat (limited to 'x11/kdelibs3/patches/patch-an')
-rw-r--r--x11/kdelibs3/patches/patch-an32
1 files changed, 31 insertions, 1 deletions
diff --git a/x11/kdelibs3/patches/patch-an b/x11/kdelibs3/patches/patch-an
index 7519c48168d..5a271fb7047 100644
--- a/x11/kdelibs3/patches/patch-an
+++ b/x11/kdelibs3/patches/patch-an
@@ -1,7 +1,37 @@
-$NetBSD: patch-an,v 1.3 2004/02/04 13:58:39 markd Exp $
+$NetBSD: patch-an,v 1.3.4.1 2004/08/13 13:05:04 agc Exp $
--- kdecore/kstandarddirs.cpp.orig 2004-01-26 06:24:42.000000000 +1300
+++ kdecore/kstandarddirs.cpp
+@@ -651,7 +651,28 @@ void KStandardDirs::createSpecialResourc
+ char link[1024];
+ link[1023] = 0;
+ int result = readlink(QFile::encodeName(dir).data(), link, 1023);
+- if ((result == -1) && (errno == ENOENT))
++ bool relink = (result == -1) && (errno == ENOENT);
++ if ((result > 0) && (link[0] == '/'))
++ {
++ link[result] = 0;
++ struct stat stat_buf;
++ int res = lstat(link, &stat_buf);
++ if ((res == -1) && (errno == ENOENT))
++ {
++ relink = true;
++ }
++ else if ((res == -1) || (!S_ISDIR(stat_buf.st_mode)))
++ {
++ fprintf(stderr, "Error: \"%s\" is not a directory.\n", link);
++ relink = true;
++ }
++ else if (stat_buf.st_uid != getuid())
++ {
++ fprintf(stderr, "Error: \"%s\" is owned by uid %d instead of uid %d.\n", link, stat_buf.st_uid, getuid());
++ relink = true;
++ }
++ }
++ if (relink)
+ {
+ QString srv = findExe(QString::fromLatin1("lnusertemp"), KDEDIR+QString::fromLatin1("/bin"));
+ if (srv.isEmpty())
@@ -847,33 +847,33 @@ static int tokenize( QStringList& tokens
QString KStandardDirs::kde_default(const char *type) {