1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

Add another missed patch.

This commit is contained in:
Michael Nottebrock 2004-08-12 21:28:53 +00:00
parent 3f9cf344ae
commit a4d6c1c4b5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=116075
4 changed files with 78 additions and 2 deletions

View File

@ -8,7 +8,7 @@
PORTNAME= kdelibs
PORTVERSION= ${KDE_VERSION}
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= x11 kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION}/src

View File

@ -0,0 +1,38 @@
Index: kstandarddirs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kstandarddirs.cpp,v
retrieving revision 1.168.2.3
retrieving revision 1.168.2.4
diff -u -p -r1.168.2.3 -r1.168.2.4
--- kdecore/kstandarddirs.cpp 8 Jun 2004 09:27:57 -0000 1.168.2.3
+++ kdecore/kstandarddirs.cpp 26 Jun 2004 14:42:16 -0000 1.168.2.4
@@ -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())

View File

@ -8,7 +8,7 @@
PORTNAME= kdelibs
PORTVERSION= ${KDE_VERSION}
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= x11 kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION}/src

View File

@ -0,0 +1,38 @@
Index: kstandarddirs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kstandarddirs.cpp,v
retrieving revision 1.168.2.3
retrieving revision 1.168.2.4
diff -u -p -r1.168.2.3 -r1.168.2.4
--- kdecore/kstandarddirs.cpp 8 Jun 2004 09:27:57 -0000 1.168.2.3
+++ kdecore/kstandarddirs.cpp 26 Jun 2004 14:42:16 -0000 1.168.2.4
@@ -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())