slocate: replaced with mlocate

This commit is contained in:
Juergen Daubert 2008-10-31 10:45:15 +01:00
parent 09ec296f78
commit 142ccd2c08
6 changed files with 0 additions and 119 deletions

View File

@ -1,19 +0,0 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/cron/
drwxr-xr-x root/root etc/cron/daily/
-rwxr-xr-x root/root etc/cron/daily/slocate
-rw-r--r-- root/root etc/updatedb.conf
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
lrwxrwxrwx root/root usr/bin/locate -> slocate
-rwxr-sr-x root/slocate usr/bin/slocate
lrwxrwxrwx root/root usr/bin/updatedb -> slocate
drwxr-xr-x root/root usr/man/
drwxr-xr-x root/root usr/man/man1/
lrwxrwxrwx root/root usr/man/man1/locate.1.gz -> slocate.1.gz
-rw-r--r-- root/root usr/man/man1/slocate.1.gz
-rw-r--r-- root/root usr/man/man1/updatedb.1.gz
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/lib/
drwxr-x--- root/slocate var/lib/slocate/
-rw-r----- root/slocate var/lib/slocate/slocate.db (EMPTY)

View File

@ -1,4 +0,0 @@
7aa005d9c9f39f18896e68af6cb301f0 CVE-2007-0227.patch
8f0b2571a7a6abf2cb519f85c5225436 slocate
69b45865ebce0cbfeb430381f0eb8b51 slocate_3.1.orig.tar.gz
4203633cf028280a596b00b33455c181 updatedb.conf

View File

@ -1,42 +0,0 @@
--- 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;
}

View File

@ -1,33 +0,0 @@
# Description: Secure version of the GNU locate program
# URL: http://packages.debian.org/unstable/utils/slocate
# Maintainer: CRUX System Team, core-ports at crux dot nu
name=slocate
version=3.1
release=1
source=(http://ftp.debian.org/debian/pool/main/s/$name/${name}_${version}.orig.tar.gz \
slocate updatedb.conf CVE-2007-0227.patch)
build() {
cd $name-$version
patch -p1 -i $SRC/CVE-2007-0227.patch
sed -i "s/-O2/$CFLAGS/" src/Makefile
make -j1
install -D -m 2755 -g slocate src/slocate $PKG/usr/bin/slocate
ln -sf slocate $PKG/usr/bin/locate
ln -sf slocate $PKG/usr/bin/updatedb
touch slocate.db
install -d -m 0750 -g slocate $PKG/var/lib/slocate
install -m 0640 -g slocate slocate.db $PKG/var/lib/slocate
install -D -m 0755 $SRC/slocate $PKG/etc/cron/daily/slocate
install -m 0644 $SRC/updatedb.conf $PKG/etc
install -D -m 0644 doc/slocate.1 $PKG/usr/man/man1/slocate.1
install -m 0644 doc/updatedb.1 $PKG/usr/man/man1
ln -sf slocate.1.gz $PKG/usr/man/man1/locate.1.gz
}

View File

@ -1,8 +0,0 @@
#!/bin/sh
#
# /etc/cron/daily/updatedb: update the slocate database
#
/usr/bin/updatedb
# End of file

View File

@ -1,13 +0,0 @@
#
# /etc/updatedb.conf
#
# This file sets environment variables which are
# used by updatedb and slocate -u
# filesystems which are pruned from updatedb database
PRUNEFS="nfs afs proc smbfs autofs auto iso9660"
export PRUNEFS
# paths which are pruned from updatedb database
PRUNEPATHS="/tmp /var/tmp /var/spool /mnt"
export PRUNEPATHS