summaryrefslogtreecommitdiffstats
path: root/source/a/slocate
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2012-09-26 01:10:42 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:51:55 +0200
commit9664bee729d487bcc0a0bc35859f8e13d5421c75 (patch)
treeb428a16618e36ed864a8d76ea3435e19a452bf90 /source/a/slocate
parent75a4a592e5ccda30715f93563d741b83e0dcf39e (diff)
downloadcurrent-9664bee729d487bcc0a0bc35859f8e13d5421c75.tar.gz
current-9664bee729d487bcc0a0bc35859f8e13d5421c75.tar.xz
Slackware 14.0slackware-14.0
Wed Sep 26 01:10:42 UTC 2012 Slackware 14.0 x86_64 stable is released! We're perfectionists here at Slackware, so this release has been a long time a-brewing. But we think you'll agree that it was worth the wait. Slackware 14.0 combines modern components, ease of use, and flexible configuration... our "KISS" philosophy demands it. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Thanks to everyone who helped make this happen. The Slackware team, the upstream developers, and (of course) the awesome Slackware user community. Have fun! :-)
Diffstat (limited to 'source/a/slocate')
-rw-r--r--source/a/slocate/slocate.CVE-2007-0277.diff42
-rwxr-xr-xsource/a/slocate/slocate.SlackBuild14
-rw-r--r--source/a/slocate/slocate.bigfile.diff33
3 files changed, 84 insertions, 5 deletions
diff --git a/source/a/slocate/slocate.CVE-2007-0277.diff b/source/a/slocate/slocate.CVE-2007-0277.diff
new file mode 100644
index 000000000..4f109922f
--- /dev/null
+++ b/source/a/slocate/slocate.CVE-2007-0277.diff
@@ -0,0 +1,42 @@
+--- slocate-3.1.orig/src/utils.c
++++ slocate-3.1/src/utils.c
+@@ -524,6 +524,7 @@
+ {
+ struct stat path_stat;
+ int ret = 0;
++ char *path_copy = NULL;
+ char *ptr = NULL;
+
+ if (lstat(path, &path_stat) == -1)
+@@ -532,15 +533,25 @@
+ if (!S_ISLNK(path_stat.st_mode)) {
+ if (access(path, F_OK) != 0)
+ goto EXIT;
+- } else if ((ptr = rindex(path, '/'))) {
+- *ptr = 0;
+- if (access(path, F_OK) == 0)
+- ret = 1;
+- *ptr = '/';
+- goto EXIT;
+ }
+
++ /* "path" is const, so we shouldn't modify it. Also, for speed,
++ * I suspect strdup/free is less expensive than the deep access
++ * checks... */
++ if (!(path_copy = strdup(path)))
++ goto EXIT;
++
+ ret = 1;
++
++ /* Each directory leading to the file (symlink or not) must be
++ * readable for us to allow it to be listed in search results. */
++ while (ret && (ptr=rindex(path_copy,'/'))) {
++ *ptr=0;
++ if (*path_copy && access(path_copy, R_OK) != 0)
++ ret = 0;
++ }
++ free(path_copy);
++
+ EXIT:
+ return ret;
+ }
diff --git a/source/a/slocate/slocate.SlackBuild b/source/a/slocate/slocate.SlackBuild
index eef2fd1f6..def08b8c8 100755
--- a/source/a/slocate/slocate.SlackBuild
+++ b/source/a/slocate/slocate.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,7 +22,7 @@
VERSION=3.1
-BUILD=${BUILD:-3}
+BUILD=${BUILD:-4}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -55,8 +55,12 @@ explodepkg $CWD/_slocate.tar.gz
cd $TMP
rm -rf slocate-$VERSION
-tar xzvf $CWD/slocate-$VERSION.tar.gz
-cd slocate-$VERSION
+tar xzvf $CWD/slocate-$VERSION.tar.gz || exit 1
+cd slocate-$VERSION || exit 1
+
+zcat $CWD/slocate.bigfile.diff.gz | patch -p0 --verbose || exit 1
+zcat $CWD/slocate.CVE-2007-0277.diff.gz | patch -p1 --verbose || exit 1
+
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 2750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -65,7 +69,7 @@ find . \
-exec chmod 644 {} \;
cd src
-make CFLAGS="$SLKCFLAGS"
+make CFLAGS="$SLKCFLAGS -D_LARGEFILE64_SOURCE" || exit 1
cd ..
strip --strip-unneeded src/slocate
mkdir -p $PKG/usr/bin
diff --git a/source/a/slocate/slocate.bigfile.diff b/source/a/slocate/slocate.bigfile.diff
new file mode 100644
index 000000000..6ccd1202e
--- /dev/null
+++ b/source/a/slocate/slocate.bigfile.diff
@@ -0,0 +1,33 @@
+Fix 2GB limitation - brought to you by mancha
+
+--- src/utils.c.orig 2012-08-25
++++ src/utils.c 2012-08-25
+@@ -284,12 +284,12 @@ int
+ verify_slocate_db(struct g_data_s *g_data, char *file)
+ {
+ char ch[1];
+- struct stat tf_stat;
++ struct stat64 tf_stat;
+ int bytes = 0;
+ int fd = -1;
+
+ if (access(file, W_OK | R_OK) == 0) {
+- if (lstat(file, &tf_stat) == -1) {
++ if (lstat64(file, &tf_stat) == -1) {
+ if (!report_error(g_data, FATAL, "get_temp_file: fstat(): %s: %s\n", file, strerror(errno)))
+ goto EXIT;
+
+@@ -522,11 +522,11 @@ EXIT:
+ * to check them separately */
+ int verify_access(const char *path)
+ {
+- struct stat path_stat;
++ struct stat64 path_stat;
+ int ret = 0;
+ char *ptr = NULL;
+
+- if (lstat(path, &path_stat) == -1)
++ if (lstat64(path, &path_stat) == -1)
+ goto EXIT;
+
+ if (!S_ISLNK(path_stat.st_mode)) {