diff -Naur slocate-3.1/src/cmds.c slocate-3.1-null/src/cmds.c --- slocate-3.1/src/cmds.c 2006-03-07 23:40:11.000000000 -0500 +++ slocate-3.1-null/src/cmds.c 2008-04-08 05:21:08.000000000 -0400 @@ -129,6 +129,7 @@ " --output= - Specifies the database to create.\n" " -d \n" " --database= - Specfies the path of databases to search in.\n" + " -0 - Delimit results with \\0 rather than \\n\n" " -h\n" " --help - Display this help.\n" " -v\n" @@ -707,7 +708,7 @@ if (strcmp(g_data->progname, "updatedb") == 0) cmd_data->updatedb = TRUE; - while ((ch = getopt(argc,argv,"VvuhqU:r:o:e:l:d:-:n:f:c:i")) != EOF) { + while ((ch = getopt(argc,argv,"VvuhqU:r:o:e:l:d:-:n:f:c:i0")) != EOF) { switch(ch) { /* Help */ case 'h': @@ -823,6 +824,9 @@ goto EXIT; } break; + case '0': + g_data->delim = '\0'; + break; default: break; } @@ -871,4 +875,3 @@ return NULL; } - diff -Naur slocate-3.1/src/cmds.c~ slocate-3.1-null/src/cmds.c~ --- slocate-3.1/src/cmds.c~ 1969-12-31 19:00:00.000000000 -0500 +++ slocate-3.1-null/src/cmds.c~ 2008-04-08 05:13:31.000000000 -0400 @@ -0,0 +1,877 @@ +/***************************************************************************** + * Secure Locate + * Copyright (c) 2005, 2006 Kevin Lindsay + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "slocate.h" +#include "utils.h" +#include "cmds.h" +#include "conf.h" + +/* Init Command Data */ +struct cmd_data_s *init_cmd_data(struct g_data_s *g_data) +{ + struct cmd_data_s *cmd_data = NULL; + + if (!(cmd_data = malloc(sizeof(struct cmd_data_s)))) { + if (!report_error(g_data, FATAL, "cmd_dat_s: malloc: %s\n", strerror(errno))) + goto EXIT; + } + + /* cmd_data Defaults */ + cmd_data->updatedb = FALSE; + cmd_data->search_str = NULL; + cmd_data->updatedb_conf = NULL; + cmd_data->exit_but_nice = 0; + + return cmd_data; + +EXIT: + return NULL; +} + +/* Free Command Data */ +void free_cmd_data(struct cmd_data_s *cmd_data) +{ + int i; + + if (!cmd_data) + return; + + if (cmd_data->search_str) { + for (i = 0; cmd_data->search_str[i]; i += 1) + free(cmd_data->search_str[i]); + + free(cmd_data->search_str); + } + if (cmd_data->updatedb_conf) + free(cmd_data->updatedb_conf); + + free(cmd_data); + cmd_data = NULL; +} + +/* Usage + * XXX: Review for accuracy + */ +void usage(struct g_data_s *g_data) +{ + int i; + + printf("%s\n" + "Copyright (c) 2005 Kevin Lindsay\n\n" + "Search: %s [-qi] [-d ] [--database=]\n", SL_VERSION, g_data->progname); + for (i = 0; i < strlen(g_data->progname)-1; i+=1) + printf(" "); + printf(" \n" + " %s [-r ] [--regexp=]\n" + "Update database: %s [-qv] [-o ] [--output=]\n" + " %s [-e ] [-f ] [-l ]\n" + , g_data->progname, g_data->progname, g_data->progname); + + for (i = 0; i < strlen(g_data->progname)-1; i+=1) + printf(" "); + + printf( +#ifndef __FreeBSD__ + " [-c ] <[-U ] [-u]>\n" +#else + " <[-U ] [-u]>\n" +#endif + "General: %s [-Vh] [--version] [--help]\n\n" + " Options:\n" + " -u - Create slocate database starting at path /.\n" + " -U - Create slocate database starting at path .\n", g_data->progname); + +#ifndef __FreeBSD__ + printf(" -c - Parse original GNU Locate's configuration file\n" + " when using the -u or -U options. If 'updatedb' is\n" + " symbolically linked to the '%s' binary, the\n" + " original configuration file '/etc/updatedb.conf' will\n" + " automatically be used.\n", g_data->progname); +#endif + + printf(" -e - Exclude directories from the slocate database when\n" + " using the -u or -U options.\n" + " -f - Exclude file system types from the slocate database\n" + " when using the -u or -U options. (ie. NFS, etc).\n" + " -l - Security level. \n" + " 0 turns security checks off. This will make\n" + " searchs faster.\n" + " 1 turns security checks on. This is the default.\n" + " -q - Quiet mode. Error messages are suppressed.\n" + " -n - Limit the amount of results shown to .\n" + " -i - Does a case insensitive search.\n" + " -r \n" + " --regexp= - Search the database using a basic POSIX regular\n" + " expression.\n" + " -o \n" + " --output= - Specifies the database to create.\n" + " -d \n" + " --database= - Specfies the path of databases to search in.\n" + " -0 - Delimit results with null terminators rather than newlines\n" + " -h\n" + " --help - Display this help.\n" + " -v\n" + " --verbose - Verbose mode. Display files when creating database.\n" + " -V\n" + " --version - Display version.\n" + "\n" + "Author: Kevin Lindsay\n" + "Bugs: slocate@trakker.ca\n" + "HTTP: http://slocate.trakker.ca/\n" + "\n"); +} + +/* Parse a comma delimited string of files and dirs into an array of pointers. + * + * string == "file,dir,...\0" + */ +/* TODO: Clean up returns. use ret. */ +int parse_exclude(struct g_data_s *g_data, char *estr) +{ + char *token = NULL; + char *ptr1 = NULL; + char *ptr2 = NULL; + int len = 0; + + if (!estr) { + if (!report_error(g_data, WARNING, "parse_exclude: String passed is NULL.\n")) + goto EXIT; + + return 1; + } + + if (strlen(estr) == 0) + return 1; + + /* Get the array length */ + for (len = 0; g_data->exclude && g_data->exclude[len]; len++); + + ptr1 = estr; + + /* Loop until we run out of string to parse. + * Loop ends via break; */ + while (1) { + /* If *ptr2 == 0 then we have already parsed the last token */ + if (ptr2 && *ptr2 == 0) + break; + + /* Move start pointer to start of next token. + * If ptr2 == NULL then this is the first token and we havn't + * parsed it yet. */ + if (ptr2) + ptr1 = ptr2+1; + + /* Get first token postion. + * If no delimeter, most ptr2 to the end of the string. */ + if (!(ptr2 = index(ptr1, ','))) { + ptr2 = ptr1; + while(*ptr2 != 0) + ptr2 += 1; + } + + /* Make token */ + if (!(token = sl_strndup(ptr1, ptr2-ptr1))) { + if (!report_error(g_data, FATAL, "parse_exclude: sl_strndup: failed.\n")) + goto EXIT; + } + + /* Make sure the file exists and is accessible, otherwise ignore it */ + if (access(token, F_OK) != 0) { + if (errno != EACCES && errno != ENOENT) { + if (!report_error(g_data, FATAL, "parse_exclude: access: '%s': %s\n", token, strerror(errno))) + goto EXIT; + } + + if (token) + free(token); + token = NULL; + + continue; + } + + /* Increment the length */ + len += 1; + + /* Allocate memory */ + if (!g_data->exclude) { + if (!(g_data->exclude = malloc(sizeof(char *) * (len+1)))) { + if (!report_error(g_data, FATAL, "parse_exclude: malloc: %s\n", strerror(errno))) + goto EXIT; + } + } else { + if (!(g_data->exclude = realloc(g_data->exclude, sizeof(char *) * (len+1)))) { + if (!report_error(g_data, FATAL, "parse_exclude: realloc: %s\n", strerror(errno))) + goto EXIT; + } + } + + /* Assign the token to the array */ + g_data->exclude[len] = NULL; + if (!(g_data->exclude[len-1] = strdup(token))) { + if (!report_error(g_data, FATAL, "parse_exclude: strdup: %s\n", strerror(errno))) + goto EXIT; + } + + if (token) + free(token); + token = NULL; + + } + + return 1; + +EXIT: + if (token) + free(token); + token = NULL; + + return 0; +} + +/* Parse Database Paths. + * + * Concatenate all database paths into one string and validate each database. + * + */ +int parse_userdb(struct g_data_s *g_data, char *dblist) +{ + char *tmp_ptr = NULL; + struct stat db_stat; + int last_sgid = 0; + int ret = 1; + char *ptr1 = NULL; + char *ptr2 = NULL; + int i_pos = 0; + int list_len = 0; + gid_t db_gid = -1; + int ret_val = 0; + int duplicate = 0; + int d = 0; + + /* Make sure dblist is not empty */ + if (!dblist || strlen(dblist) == 0) { + //report_error(g_data, WARNING, "parse_userdb: database string is empty.\n"); + goto EXIT; + } + + /* Check how many paths are currently in the string. */ + list_len = 1; + ptr1 = dblist; + while ((ptr1 = strchr(ptr1+1, ':'))) + list_len += 1; + + if (!(g_data->input_db = init_input_db(g_data, list_len))) { + ret = 0; + goto EXIT; + } + + /* Find next position in input_db */ + i_pos = 0; + while (g_data->input_db[i_pos]) + i_pos += 1; + + /* Parse dblist */ + ptr1 = dblist; + + while (ptr1 && *ptr1) { + if (*ptr1 == ':') + ptr1 += 1; + + if (!(ptr2 = strchr(ptr1, ':'))) { + ptr2 = dblist+strlen(dblist); + } + + /* Don't worry about blank entries */ + if (ptr2-ptr1 > 0) { + /* Check for duplicates */ + duplicate = 0; + for (d = 0; g_data->input_db[d]; d += 1) { + if (!strncmp(g_data->input_db[d], ptr1, ptr2-ptr1)) { + duplicate = 1; + break; + } + } + if (!duplicate) { + if (!(g_data->input_db[i_pos] = sl_strndup(ptr1, ptr2-ptr1))) { + ret = 0; + goto EXIT; + } + i_pos += 1; + } + } + + if (*ptr2 == ':') { + ptr1 = ptr2 + 1; + } else + ptr1 = NULL; + } + + + // DDD + //for (i_pos = 0; g_data->input_db[i_pos]; i_pos += 1) { + // printf("IDB: *%s*\n", g_data->input_db[i_pos]); + //} + + db_gid = get_gid(g_data, DB_GROUP, &ret_val); + if (!ret_val) { + ret = 0; + goto EXIT; + } + + last_sgid = 0; + /* Sort sgid slocate db's to the top */ + for (i_pos = 0; g_data->input_db[i_pos]; i_pos += 1) { + + if (stat(g_data->input_db[i_pos], &db_stat) == -1) { + report_error(g_data, FATAL, "Could not find user database '%s': %s\n", g_data->input_db[i_pos], strerror(errno)); + ret = 0; + goto EXIT; + } + + if (db_stat.st_gid == db_gid) { + + if (i_pos != last_sgid) { + tmp_ptr = g_data->input_db[last_sgid]; + g_data->input_db[last_sgid] = g_data->input_db[i_pos]; + g_data->input_db[i_pos] = tmp_ptr; + } + + last_sgid += 1; + } + + } + + // DDD + //for (i = 0; g_data->input_db[i]; i++) + // printf("SDB: *%s*\n", g_data->input_db[i]); +EXIT: + + return ret; +} + +char **parse_search_str(struct g_data_s *g_data, char **argv, int str_pos) +{ + int i = 0; + int len = 0; + int o = 0; + char **search_str = NULL; + + i = str_pos; + len = 0; + while (argv[i]) { + len += 1; + i += 1; + } + + if (i > 0) { + if (!(search_str = malloc(sizeof(char *)*(len+1)))) { + report_error(g_data, FATAL, "parse_cmds: search string: malloc: %s\n", strerror(errno)); + goto EXIT; + } + + for (i = 0; i <= len; i++) + search_str[i] = NULL; + + o = str_pos; + i = 0; + while (argv[o]) { + if (!(search_str[i] = strdup(argv[o]))) { + report_error(g_data, FATAL, "parse_cmds: search string: strdup: %s\n", strerror(errno)); + goto EXIT; + } + + o += 1; + i += 1; + } + } + + return search_str; + +EXIT: + if (search_str) + free(search_str); + search_str = NULL; + + return NULL; +} + +/* Set the Output DB */ +int set_output_db(struct g_data_s *g_data, char *output_db) +{ + int ret = 1; + + if (g_data->output_db) { + free(g_data->output_db); + g_data->output_db = NULL; + } + + if (!(g_data->output_db = make_absolute_path(g_data, output_db))) { + report_error(g_data, FATAL, "set_output_db: make_absolute_path(): path was returned NULL.\n"); + ret = 0; + goto EXIT; + } + +EXIT: + return ret; +} + +/* Set the regexp_data */ +int set_regexp_data(struct g_data_s *g_data, char *pattern) +{ + int ret = 1; + + /* If already set, override with new settings */ + if (g_data->regexp_data) { + if (g_data->regexp_data->pattern) { + free(g_data->regexp_data->pattern); + g_data->regexp_data->pattern = NULL; + } + if (g_data->regexp_data->preg) { + regfree(g_data->regexp_data->preg); + g_data->regexp_data->preg = NULL; + } + free(g_data->regexp_data); + g_data->regexp_data = NULL; + } + + if (!(g_data->regexp_data = malloc(sizeof(struct regexp_data_s *)))) { + report_error(g_data, FATAL, "set_regexp_data: regexp_data: malloc: %s\n", strerror(errno)); + ret = 0; + goto EXIT; + } + + g_data->regexp_data->preg = NULL; + g_data->regexp_data->pattern = NULL; + + if (!(g_data->regexp_data->pattern = strdup(pattern))) { + report_error(g_data, FATAL, "set_regexp_data: pattern: strdup: %s\n", strerror(errno)); + ret = 0; + goto EXIT; + } + +EXIT: + return ret; +} + + +/* Parse Dash */ +/* ret code: 0 - error + * 1 - success + * 2 - success but exit nicely */ +int parse_dash(struct g_data_s *g_data, char *option) +{ + char *ptr = NULL; + int ret = 1; + /* Upper Case Option */ + char *uc_option = NULL; + + if (!option) { + report_error(g_data, FATAL, "parse_dash: 'option' variable == NULL.\n"); + ret = 0; + goto EXIT; + } + + /* Duplicate option string so we don't harm optarg */ + if (!(uc_option = strdup(option))) { + report_error(g_data, FATAL, "parse_dash: strdup: %s\n", strerror(errno)); + ret = 0; + goto EXIT; + } + + for (ptr = uc_option; *ptr != 0 && *ptr != '='; ptr++) + *ptr = toupper(*ptr); + + if (strcmp(uc_option, "HELP") == 0) { + usage(g_data); + ret = 2; + goto EXIT; + } else if (strcmp(uc_option, "VERSION") == 0) { + printf("%s\n", SL_VERSION); + ret = 2; + goto EXIT; + } else if (strcmp(uc_option, "VERBOSE") == 0) { + g_data->VERBOSE = TRUE; + } + + if (*ptr == '=') { + *ptr = '\0'; + ptr++; + + if (strcmp(uc_option, "OUTPUT") == 0) { + if (!set_output_db(g_data, ptr)) { + ret = 0; + goto EXIT; + } + } else if (strcmp(uc_option,"DATABASE") == 0) { + if (!parse_userdb(g_data, ptr)) { + ret = 0; + goto EXIT; + } + } else if (strcmp(uc_option,"REGEXP") == 0) { + if (!set_regexp_data(g_data, ptr)) { + ret = 0; + goto EXIT; + } + } + } + + ptr = NULL; + +EXIT: + + if (uc_option) + free(uc_option); + uc_option = NULL; + + return ret; +} + +/* Parse File System Type Exclusion */ +int parse_fs_exclude(struct g_data_s *g_data, char *data_str) +{ + char *fs_str = NULL; + int ret = 0; + int exclude_str_len = 0; + char *fbuf=NULL; + char *head_ptr; + char *tail_ptr; + char *exclude_str=NULL; + int fd = -1; + int i = 0; + int matched = 0; + char *match_ptr = NULL; + + if (!data_str) { + report_error(g_data, FATAL, "parse_fs_exclude: data_str == NULL\n"); + goto EXIT; + } + + /* Duplicate so that we can change the case */ + if (!(fs_str = strdup(data_str))) { + report_error(g_data, FATAL, "parse_fs_exclude: fs_str: malloc: %s\n", strerror(errno)); + goto EXIT; + } + + for (i = 0; fs_str[i]; i++) + fs_str[i] = toupper(fs_str[i]); + + /* Load the mtab file */ + if (!load_file(g_data, MTAB_FILE, &fbuf)) { + report_error(g_data, FATAL, "parse_fs_exclude: Could not load file data: %s\n", MTAB_FILE); + goto EXIT; + } + + head_ptr = fbuf; + while (head_ptr) { + /* find filesystem type */ + if ((head_ptr = strchr(head_ptr,' '))) { + head_ptr += 1; + head_ptr = strchr(head_ptr,' '); + } + + if (!head_ptr) + continue; + + head_ptr += 1; + + tail_ptr = strchr(head_ptr,' '); + if (!tail_ptr) { + head_ptr = NULL; + continue; + } + + *tail_ptr = 0; + /* Upper case string */ + for (i = 0; head_ptr[i]; i++) + head_ptr[i] = toupper(head_ptr[i]); + + /* Check if file sytem type exists in exclude string */ + matched = 0; + if ((match_ptr = strstr(fs_str, head_ptr))) { + if ((match_ptr == fs_str || *(match_ptr-1) == ',') && + (*(match_ptr+(tail_ptr-head_ptr)) == ',' || *(match_ptr+(tail_ptr-head_ptr)) == '\0')) + matched = 1; + } + + *tail_ptr = ' '; + + if (matched) { + /* go backwards a bit so that we can get the + * mount point of the filesystem */ + head_ptr -= 2; + + while (*head_ptr != ' ' && head_ptr != fbuf) + head_ptr -= 1; + + if (head_ptr == fbuf) { + report_error(g_data, FATAL, "parse_fs_exclude: File System Exclude: (1) corrupt mtab file: %s\n", MTAB_FILE); + goto EXIT; + } + + head_ptr += 1; + + if (!(tail_ptr = strchr(head_ptr,' '))) { + report_error(g_data, FATAL, "parse_fs_exclude: File System Exclude: (2) corrupt mtab file: %s\n", MTAB_FILE); + goto EXIT; + } + + *tail_ptr = 0; + + /* +1 for the extra "," delimiter */ + exclude_str_len += strlen(head_ptr)+1; + exclude_str = realloc(exclude_str, exclude_str_len+1); + + if (exclude_str_len == strlen(head_ptr)+1) + *exclude_str = 0; + else + strcat(exclude_str, ","); + strcat(exclude_str, head_ptr); + + *tail_ptr = ' '; + } + + + head_ptr = strchr(head_ptr,'\n'); + } + + if (exclude_str) { + if (!parse_exclude(g_data, exclude_str)) + goto EXIT; + } + + ret = 1; + +EXIT: + + if (fd != -1) { + if (close(fd) == -1) { + report_error(g_data, FATAL, "parse_fs_exclude: close: %s: %s\n", MTAB_FILE, strerror(errno)); + goto EXIT; + } + } + + if (exclude_str) { + free(exclude_str); + exclude_str = NULL; + } + + if (fbuf) { + free(fbuf); + fbuf = NULL; + } + + if (fs_str) { + free(fs_str); + fs_str = NULL; + } + + return ret; +} + +/* Parse command line options */ +struct cmd_data_s * parse_cmds(struct g_data_s *g_data, int argc, char **argv) +{ + struct cmd_data_s *cmd_data = NULL; + int ch; + int i = 0; + int reg_ret = 0; + char regex_errbuf[1024]; + char *ENV_locate_path = NULL; + int add_default_db = 1; + int dash_ret = 0; + + if (!(cmd_data = init_cmd_data(g_data))) + goto EXIT; + + if (strcmp(g_data->progname, "updatedb") == 0) + cmd_data->updatedb = TRUE; + + while ((ch = getopt(argc,argv,"VvuhqU:r:o:e:l:d:-:n:f:c:i0")) != EOF) { + switch(ch) { + /* Help */ + case 'h': + usage(g_data); + cmd_data->exit_but_nice = 1; + goto EXIT; + break; + /* Quiet Mode. Don't print warnings or errors. */ + case 'q': + /* We set g_data since this is the only place it is + * called from */ + g_data->QUIET = TRUE; + break; + case 'V': + printf("%s\n", SL_VERSION); + cmd_data->exit_but_nice = 1; + goto EXIT; + break; + /* Turn VERBOSE mode ON */ + case 'v': + g_data->VERBOSE = TRUE; + break; + /* Exclude specified directories from database */ + case 'e': + if (!parse_exclude(g_data, optarg)) + goto EXIT; + break; + + /* Set the security level of the database when creating or updating the + * database. If set to 0, security checks will not be preformed */ + case 'l': + if (optarg[0] != '0' && optarg[0] != '1') { + report_error(g_data, FATAL,"Security level must be 0 or 1.\n"); + goto EXIT; + } + + g_data->slevel = optarg[0]; + break; + + /* Index from the root '/' path */ + case 'u': + cmd_data->updatedb = TRUE; + add_default_db = 0; + break; + + /* Index from a specific path */ + case 'U': + /* TODO: Parse multiple paths to index */ + cmd_data->updatedb = TRUE; + if (g_data->index_path) + free(g_data->index_path); + g_data->index_path = strdup(optarg); + add_default_db = 0; + break; + case 'c': + if (cmd_data->updatedb_conf) + free(cmd_data->updatedb_conf); + cmd_data->updatedb_conf = strdup(optarg); + break; + /* Search database with specified regular expression */ + case 'r': + if (!set_regexp_data(g_data, optarg)) + goto EXIT; + + break; + + /* Specify the database to search in */ + case 'd': + add_default_db = 0; + if (!parse_userdb(g_data, optarg)) + goto EXIT; + break; + + /* Specify the database path to write to when creating or updating a database */ + case 'o': + // XXX + //if (!o_OPT_READY) + // report_error(FATAL,QUIET,"%s: Must specify an 'Update' database option first.\n",progname); + if (!set_output_db(g_data, optarg)) + goto EXIT; + + break; + + /* Limit the amount of search results */ + case 'n': + /* Make sure it is a digit */ + for (i=0; i < strlen(optarg); i+=1) { + if (!isdigit(optarg[i]) && optarg[i] != '-') { + report_error(g_data, FATAL, "Argument 'n': '%s': value must be an integer.\n", optarg); + goto EXIT; + } + } + g_data->queries = atoi(optarg); + if (g_data->queries < 0) + report_error(g_data, WARNING, "Argument 'n': '%d': value should be greater than 0.\n", g_data->queries); + break; + + /* Make search case insensitive */ + case 'i': + g_data->nocase = 1; + break; + /* Exclude by filesystem */ + case 'f': + if (!parse_fs_exclude(g_data, optarg)) + goto EXIT; + break; + case '-': + dash_ret = parse_dash(g_data, optarg); + if (!dash_ret) + goto EXIT; + else if (dash_ret == 2) { + cmd_data->exit_but_nice = 1; + goto EXIT; + } + break; + case '0': + g_data->delim = '\0'; + break; + default: + break; + } + } + + /* Get search strings, unless a regular expression was specified */ + if (!g_data->regexp_data) + cmd_data->search_str = parse_search_str(g_data, argv, optind); + else { + /* Initialize preg here so that regcomp can initialize it incase an error occurs */ + if (!(g_data->regexp_data->preg = malloc(sizeof(regex_t)))) { + report_error(g_data, FATAL, "parse_cmds: Argument 'r': preg: malloc: %s\n", strerror(errno)); + goto EXIT; + } + + /* We compile the regexp here so that g_data->nocase will be determined */ + if ((reg_ret = regcomp(g_data->regexp_data->preg, g_data->regexp_data->pattern, g_data->nocase?REG_ICASE:0)) != 0) { + regerror(reg_ret, g_data->regexp_data->preg, regex_errbuf, 1024); + report_error(g_data, FATAL, "match: regular expression: %s\n", regex_errbuf); + goto EXIT; + } + } + + if (!cmd_data->updatedb) { + /* Parse environment variables */ + if ((ENV_locate_path = getenv("LOCATE_PATH"))) { + if (!parse_userdb(g_data, getenv("LOCATE_PATH"))) + goto EXIT; + } + + if (add_default_db) { + if (!parse_userdb(g_data, DEFAULT_DB)) + goto EXIT; + } + } else + parse_updatedb(g_data, cmd_data->updatedb_conf); + + return cmd_data; + +EXIT: + if (cmd_data->exit_but_nice) + return cmd_data; + + free_cmd_data(cmd_data); + cmd_data = NULL; + + return NULL; +} diff -Naur slocate-3.1/src/cmds.o slocate-3.1-null/src/cmds.o --- slocate-3.1/src/cmds.o 1969-12-31 19:00:00.000000000 -0500 +++ slocate-3.1-null/src/cmds.o 2008-04-08 05:21:30.000000000 -0400 @@ -0,0 +1,151 @@ +ELF>P%@@ UHSHHtPHGHt+H8HtHEH<HHuHH}HtHH[]H[]ff.AWHc‰AVIAUAATUH,S1HH}H<$tAEHHHHHuE1{HcHHIIx1HDIHH9uH}HtfAELHIH;HHHt@HHEu8E1H<$H11LfDHL[]A\A]A^A_8E1H<$H11H\$Hl$HH HHt2HHCHCCH\$Hl$HH8H11H1҅uHl$Ld$HH\$HHPIHtEHHtHH}PHHGHtHH}PHGHEPHHHEPt9H@HLHHt?H$Hl$Ld$H8H1H11fD8Hf.H\$Hl$HHH0HHt HC0HHHHC0tH\$Hl$Hú1H1fAWIAVAUATUSHHH4$tDŽ$>HuHĸ[]A\A]A^A_@Hx:HuLHIG@H8D$ tHfHBD$ HHuL$$A$to<::ILHI-LL)H~5Mw@I>HLH{HHHLuA}:H$LD$IG@H0HE11E1Iw@H43IHHHT$D9t$0uD9tyIw@IcHI4HHI 4AHLHcT$ HIt:D$ A}:2MI fH<$H$L,1Iw@8IW@I1L1I 1fffff.AWAVIAUATUSHH^>HG8H@H86HE1HBAHHuIE1MtA<$Ml$,LHI;LL)LHH1HI~8AHAwHcHHIF8aIF8IcHHHHHHHHAHMEA<$5H[]A\A]A^A_8 tt1IH1LuHt-H111LH1[]A\A]A^A_fD1A}MIA<$uAHcHHIF88HA81H1L78H11Lw +E11@fff.AWIAVAUATUSH(HHD$ HHIt,INHLHHËHHuHT$ L0HD$ HHND$ HD$ HHx HHLh LHItt]t)HMHLHHËHHuLLHHt I9tJx,tDA$ L +HHJ@H|$rHt$L1\LL)<,tuA$ A} IEt}HT$ DH8 thH9u1L11H|$t +H|$HD$ HtHHD$ MtLH([]A\A]A^A_H;D$ tLh LHHLT$ H|$T։T$ HcHc\$ HD$LHH9tKH|$HT$f,H|$LE 1L1HD$ HD$HD$ 1E1HD$ 181H1L1HD$ 1L1AUI1ATU1SHH LI]LeHHH9rHHH޿11 LImLcHHH9wH1Iu1H[]A\A]ATHIUSHHH=IHHHËAIAu4HHu&LH[]A\=uŸHHt0HHu AD$ A8=tYI뀿1ۺ1[]A\81H1L1]AHIuLLz1! HuLLN1H1LL1AWAAVAUIATUSHH$HIt~Iu t3D$ H4$DZ-Iwމ$AE fAD$ H5LuAVLE1AEtH5L]H-1HI&f +HHDPu -@HL9u1 +HAEHL1HB<AUAELfAFHL[]A\A]A^A_H5LwH5L[H5LD$ /I~HtH=IF AFRI}AHtH=D$ IEAEXH5LAFI]PHf@HHCA}IEPHxH0҃A6uoHtLHpL$ ^LOD@H1L1-IvLIEPH\$HHpHٺ1L1H4$LIF+8H1L11L1parse_cmds: search string: malloc: %s +parse_cmds: search string: strdup: %s +set_regexp_data: regexp_data: malloc: %s +set_regexp_data: pattern: strdup: %s +set_output_db: make_absolute_path(): path was returned NULL. +Could not find user database '%s': %s +parse_exclude: String passed is NULL. +parse_exclude: sl_strndup: failed. +parse_exclude: access: '%s': %s +parse_fs_exclude: data_str == NULL +parse_fs_exclude: fs_str: malloc: %s +parse_fs_exclude: Could not load file data: %s +parse_fs_exclude: File System Exclude: (1) corrupt mtab file: %s +parse_fs_exclude: File System Exclude: (2) corrupt mtab file: %s +Secure Locate 3.1 - Released March 7, 2006%s +Copyright (c) 2005 Kevin Lindsay + +Search: %s [-qi] [-d ] [--database=] + + %s [-r ] [--regexp=] +Update database: %s [-qv] [-o ] [--output=] + %s [-e ] [-f ] [-l ] + [-c ] <[-U ] [-u]> +General: %s [-Vh] [--version] [--help] + + Options: + -u - Create slocate database starting at path /. + -U - Create slocate database starting at path . + -c - Parse original GNU Locate's configuration file + when using the -u or -U options. If 'updatedb' is + symbolically linked to the '%s' binary, the + original configuration file '/etc/updatedb.conf' will + automatically be used. + -e - Exclude directories from the slocate database when + using the -u or -U options. + -f - Exclude file system types from the slocate database + when using the -u or -U options. (ie. NFS, etc). + -l - Security level. + 0 turns security checks off. This will make + searchs faster. + 1 turns security checks on. This is the default. + -q - Quiet mode. Error messages are suppressed. + -n - Limit the amount of results shown to . + -i - Does a case insensitive search. + -r + --regexp= - Search the database using a basic POSIX regular + expression. + -o + --output= - Specifies the database to create. + -d + --database= - Specfies the path of databases to search in. + -0 - Delimit results with \0 rather than \n + -h + --help - Display this help. + -v + --verbose - Verbose mode. Display files when creating database. + -V + --version - Display version. + +Author: Kevin Lindsay +Bugs: slocate@trakker.ca +HTTP: http://slocate.trakker.ca/ +parse_dash: 'option' variable == NULL. +Security level must be 0 or 1. +Argument 'n': '%s': value must be an integer. +Argument 'n': '%d': value should be greater than 0. +parse_cmds: Argument 'r': preg: malloc: %s +match: regular expression: %s +cmd_dat_s: malloc: %s +slocateparse_exclude: malloc: %s +parse_exclude: realloc: %s +parse_exclude: strdup: %s +/etc/mtabparse_dash: strdup: %s +HELPVERSIONVERBOSEOUTPUTDATABASEREGEXPupdatedbVvuhqU:r:o:e:l:d:-:n:f:c:i0LOCATE_PATH/var/lib/slocate/slocate.dbzRx eADD 4<8BGE E(A0E8F@t}N JL gJG 4RBEB B(A0A8G4BBE B(A0A8D@4<OBEB B(A0A8D`$tBLA C(D0BGA 4BEB E(A0A8GGCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0).symtab.strtab.shstrtab.rela.text.data.bss.rodata.str1.8.rodata.str1.1.rela.rodata.rela.eh_frame.comment.note.GNU-stack @h0 &,12 @2O T` POCa"\xJ k$&t$$P)@  .   ep8,3<MVc}q00gR +O*>HOV \ckp {pcmds.cfree_cmd_datafreeparse_search_strmalloc__strdup__errno_locationstrerrorreport_errorinit_cmd_dataset_regexp_dataregfreeset_output_dbmake_absolute_pathparse_userdbstrchrinit_input_dbstrncmpget_gid__xstatsl_strndupstrlenparse_excludeindexaccessreallocparse_fs_exclude__ctype_toupper_locload_filestrstrstrcatusageprintfputcharputsparse_dashparse_cmdsgetoptoptarg__ctype_b_locstrtolregcompgetenvparse_updatedbregerroroptind% > L 1?IU +(^f  +  +!^ z  +P +N a + c ++j +u!"# GXg +`o  +8 + +% +V/AHM +:\{ +% +q &L c   % '  + _ + +qd + +p + + + + + + + # / G (U +qZ +f  +    +  +q +P  + + + * +. E +8N *] +m ~ + * + * +p  % +* )2  M +b + + , +    +{  +  +&; +V + +/ 0) B0J[0eq12 + 0)(00$D0L c0k 0 +, 00-<e3{ +4 +4 + + 56 +h $/7; IPU +8 dn + zZ , (08@HPX`hpx (08@HPX`hpx`A%X? 2(08@H +@ +px + +0 +0 + +@ +x +  +  +p \ No newline at end of file diff -Naur slocate-3.1/src/conf.o slocate-3.1-null/src/conf.o --- slocate-3.1/src/conf.o 1969-12-31 19:00:00.000000000 -0500 +++ slocate-3.1-null/src/conf.o 2008-04-08 05:21:30.000000000 -0400 @@ -0,0 +1,35 @@ +ELF>@@ uD< +tHt8uH8иHEHAVIHAUIATUHSHLcLHHHL9sKHڄt6H9t_< +t_<#HSu@$H9tH< +tAH<#t uH9t-H{@A HHDP u=u< +uH޿=DHHHƿ"Ht\Hh"HHHtH9[H)H]A\A]A^ML1[]A\A]A^1Hk[teH +tVH]tJHDA ut; +t6UHu) +lH]HDA tMML1[]A\A]A^1ML1<H\$Ll$HLt$Hl$MLd$L|$H8H $I1MtSLHxHIA]t%LIIHDB t4H]uH\$Hl$Ld$Ll$ Lt$(L|$0H8EIHDB u IA$uL9t8I>H4$HILHH)LIA$g|I>8H1H11USHHHLD$HD$u1H|$HtH[Ht$H߻uSHHHLD$HD$u1H|$HtH[Ht$H߻uSHHHHD$tZHT$u1H|$HtH[Ht$HtHt$H߻uHT$/etc/updatedb.conf,PRUNEPATHSPRUNEFS%s: syntax error at '%s': Could not find '=' character. +%s: syntax error at '%s': No value found. +%s: syntax error at '%s': Missing second ". +parse_prune: data_str: malloc: %s +zRx 9,4BHE A(D0$d9JMQ@]AT ]AT AG GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0).symtab.strtab.shstrtab.rela.text.data.bss.rodata.str1.1.rodata.str1.8.rela.eh_frame.comment.note.GNU-stack @  &,12(@20TO ^&gw  +   + 9@ '.<FS@9_fmu]]@conf.cget_next_charget_valuestrlenstrstr__ctype_b_loc__strndupreport_errorparse_prunemallocstrcatstrncat__errno_locationstrerrorparse_PRUNEPATHSfreeparse_excludeparse_PRUNEFSparse_fs_excludeparse_updatedbload_fileU d x  + +0 +\ +a +pp + +@ +  +/m  4SZ_ +n + + + + 3\q +T +8 +@h +@ + + +@ \ No newline at end of file diff -Naur slocate-3.1/src/slocate slocate-3.1-null/src/slocate --- slocate-3.1/src/slocate 1969-12-31 19:00:00.000000000 -0500 +++ slocate-3.1-null/src/slocate 2008-04-08 05:21:31.000000000 -0400 @@ -0,0 +1,179 @@ +ELF>@@@8 +@# @@@@@00pp@p@@@{{ ~~`~`H @~@~`@~`@@ Ptd,t,t@,t@LLQtdRtd~~`~`e(/lib64/ld-linux-x86-64.so.2GNU CG8'0@4CD-2?AEB=!/ :37#>)"F9(<;$,516 +   %*+.& CCDE)92$10l - F@ +]4M'=7eT"y/K?7U=r + lU:(% ezJ8!5!%kvD7!nK%'Xf%7"~P`dH`N `]@`__gmon_start__libc.so.6fflushstrcpyfchmodfnmatch_IO_putcfopenstrncmpoptindstrrchrregexec__strdupstrncpyregfreetime__lxstatputcharreallocstrtolfts_closestrlenstrstr__errno_locationgetoptvsnprintfgetgrnamstdoutfputcfts_readfputsregerrormemcpyfclosemallocstrcat__strndupgetgidgetenv__ctype_b_locfts_setregcompoptargstderrgetuidgetegid__fxstatstrncatfilenochowngetcwdrenamestrchrfprintfrindex__ctype_toupper_loc__ctype_tolower_locfts_open__xstataccesssetgidstrcmpstrerror__libc_start_mainGLIBC_2.3GLIBC_2.3.4GLIBC_2.2.5ii %ti /ui ;` `E@`FH`DP`C```` `(`0`8` @` +H` P` X` ``h`p`x``````````Ȁ`Ѐ`؀```` `!`"`#`$`% `&(`'0`(8`)@`*H`+P`,X`-``.h`/p`0x`1`2`3`4`5`6`7`8`9`:ȁ`;Ё`<؁`=`>`?`@`A`BH[AH5jj %lj @%jj h%bj h%Zj h%Rj h%Jj h%Bj h%:j h%2j hp%*j h`%"j h P%j h +@%j h 0% +j h %j h %i h%i h%i h%i h%i h%i h%i h%i h%i h%i hp%i h`%i hP%i h@%i h0%i h %i h%zi h%ri h%ji h %bi h!%Zi h"%Ri h#%Ji h$%Bi h%%:i h&%2i h'p%*i h(`%"i h)P%i h*@%i h+0% +i h, %i h-%h h.%h h/%h h0%h h1%h h2%h h3%h h4%h h5%h h6%h h7p%h h8`%h h9P%h h:@%h h;0%h h< %h h=%zh h>%rh h?%jh h@1I^HHPTIV@HV@Hp0@HH f HtHÐUH=ih t#HHh Hh HHuBh ]UHH=d tHt 8~`I]A]ÐATAUHSx}H}@H1H?tH1HBHHuBt#HcHHHE@B4#9_HM@HcHؐHH9~H[]A\11W@0mH}@1Ht1HE@HE@A|$HcHLH3H|yHHHt$(HLHH|$0t +H|$0LHHD$0MtLL$HuHĸ[]A\A]A^A_@Hx:HuL0HIG@H8D$ tHfHBD$ HHuL$$A$to<::ILyHI-LL)H~5Mw@I>HLH{HHHLuA}:H$^@LD$IG@H0HE11E1Iw@H43IHHHT$D9t$0uD9tyIw@IcHI4HHI 4AHLBHcT$ HIt:D$ A}:2MI fH<$WH$L,1Iw@X8IW@I1L1I _@u1fffff.AWAVIAUATUSHH^>HG8H@H86HE1HBAHHuIE1MtA<$Ml$,LHI;LL)LHH1HWI~8AHAwHcH>HIF8aIF8IcHHHHHHHHAHMEA<$5H[]A\A]A^A_8 tt1IH1X`@LuHt-H[1110`@LH1[]A\A]A^A_fD1A}MIA<$uAHcH`HIF88Wk@HA8A1Hk@1L-78k@H11Lw +E11`@@fff.AWIAVAUATUSH(HHD$ HHIt,INHLHHËHHuHT$ k@L0HD$ HHND$ HD$ HHx yHHLh L\HItt]t)HMHLHHËHHuLLHHt I9tJx,tDA$ L +HHJ@H|$rHt$L1\LL)<,tuA$ A} IEt}HT$ DH8 thH9uk@a@1L1 1H|$t +H|$XHD$ HtHFHD$ MtL0H([]A\A]A^A_H;D$ tLh LHHLT$ H|$T։T$ HcHc\$ HD$LHH9tKH|$HT$f,H|$L5E k@`@1L1 HD$ HD$HD$ `@1E1 HD$ 1s81`@H1L1 HD$ k@Ha@1L1v AUa@I1ATU1SHHa@ LI]LeHHH9rHHH޿0b@11N LImLcHHH9wHc@1Iud@1Hhe@[]A\A]SATHIUSHHH=IHHHËAIAu4 +l@HHu&LH[]A\=uŸl@HHt0l@HHu AD$ A8=tYI뀿a@e1ۺj@1 +[]A\i81k@H1L1 +]Al@HIuLL2z1!&l@ HuLLvN1/l@H1LL1AWAAVAUIATUSHH$ HIt~Iu6l@ t3D$ H4$?l@D\Z-Iwމ$hl@AE fAD$ H56@ LuAVLE1AEtH5? L]H-? 1HI&f +HHDPu -@HL9u1 +HAEHj@L1Hi? B<AUAELfAFHL[]A\A]A^A_H5? LlwH5> L[H5> L1D$ /I~HtNH=> "IF a@OAFRI}AHt H=f> D$ IEAEXH5?> LAFI]PHf@HHCA}IEPHxH0҃GA6uo[l@Ht[l@}LHpL$ ^^@LOD@Hj@1L1|-IvLIEPH\$HHp,Hٺ`k@1L18< H4$L1IF+8 0k@H1L1j@1L1uD< +tHt8uH8иHEHAVIHAUIATUHSHLcLxHHHL9sKHڄt6H9t_< +t_<#HSu@$H9tH< +tAH<#t uH9t-H{@A HHDP u=u< +uH޿=DHHHƿ"Ht\Hh"HHHtH9[H)H]A\A]A^8M蹸n@Po@L1\[]A\A]A^1Hk[teH +tVH]tJHDA ut; +t6UHu) +lH]HDA tMMLn@ o@1[]A\A]A^1M蹸n@n@L1<H\$Ll$HLt$Hl$MLd$L|$H8H $I1MtSLHx4HIA]t%LIIHDB t4H]uH\$Hl$Ld$Ll$ Lt$(L|$0H8EIHDB u IA$uL9t8I>H4$HILHH)LIA$g|I>98ro@H1H1^1USHn@n@HHLD$HD$u1H|$HtH[Ht$H߻uSHn@n@HHLD$HD$8u1H|$Ht3H[Ht$H߻uSHHHHD$tZHT$u1H|$HtH[Ht$HStHt$H߻uHT$n@럐Ld$H\$IHl$HHtE/HHt3X@L^]H$Hl$Ld$H1fff.UHSHHH1҃t!D$%=t1H1҅HĘ[]þ/HsHHźt1H1҅E/HĘ[]fLl$Lt$IH\$Hl$ILd$L|$HHL$Hȉt$HK@LD$PLL$XH)H$)x)p)h)`)X)P)H)@OT$D$PHIOL|$DH$ LLHLD$HD$HD$0D$0HD$ 9|$f|$2IH=5 Lᾼs@1H=5 DL(H$H$L$L$L$L$HE11ۀ|$uuLHHI81#IH=5 Ho@1U81IH=4 Ho@1)IH=4 Lᾘs@11H=4 IH=4 Lᾬs@1dffffff.Hl$Ld$HLl$H\$HHIIH11H0tiHƿH|$0HHI$HT$0HƉHL$0HH9Ipp@1L1#8HIo@1L1I<$1HtI$1H$H$L$L$Hĸ&8_HI p@1L1HfDI$랐s@11"p8fD Hp@H1L1EfH\$HLd$Hl$Ll$IHHbt*H$H$L$L$HHH޿1H|$0t11HPteH$IEt$1҃0<]11Hٺs@LuѺ;@81IH1p@Ll{81IH1p@LK81IH1p@Lm3bUHSHH0Hx5HHtmHu0HAHHHH.stf@!tt HH[]1Hٺq@HuHt;1HH[]81Hs@1HkH1fff.H\$Hl$HLd$HIHHHtEH$Hl$Ld$H1^@q@L1u +11q@Ltfff.AVHIAUIATUSE1>/u HHHHuLMt L@+HHHIuS81H@r@1Lxu1QLHHH|CHHt8HHPHHf/LGHH[]A\A]A^81Hxr@1LuHtHbf[]A\A]A^H.r@111fff.H\$Hl$HHHHu1H\$Hl$HfDH9rH}]HtHHH(뼐ATIUHSHG8HtOHtJH0HtBH HsHHt0HuAt$ tHt@18[]A\1[]A\USH5HHt)t"!HHHHËHuHH[]f.Hl$HH\$Ld$Ll$H(HEPHHAHtpHxE1H l1t$E11۽MtLHtHH$H$L$L$ H(HDEEtcHIHHHE1HL3bt[Xs@1H1LtC1E11*tHﺠr@11H)E111HH9H8s@H1H1qLHH18HHr@11fffff.Hl$L|$H-C' L=<' Ld$Ll$Lt$H\$H8L)AIHIcHt1@LLDAHH9uH\$Hl$Ld$Ll$ Lt$(L|$0H8ÐUHSHH& Ht1H~`HHuH[]ÐH[Hinit_input_db: Initialization length must be 0 or greater. +set_path_head: prev_code_str == NULL. +set_path_head: realloc: path_head: %s +set_path_head: path_head len <= 0: %d +Could not obtain information on database file '%s': %s +search_db: could not get time: %s +database %s' is more than %s old +search_db: read: '%s': Database file is empty. +search_db: code_str: malloc: %s +search_db: code_str: realloc: %s +search_db: full_path: strdup: %s +search_db: full_path: malloc: %s +search_db: prev_code_str: strdup: %s +encode: fputc(): SLOC_ESC: %s +encode: fputc(): SLOC_ESC: code_num >> 8: %s +encode: fputc(): SLOC_ESC: code_num: %s +encode: fputc(): code_num: %s +encode: fprintf(): code_line: %s +You are not authorized to create a default slocate database! +Unable to create database: %s +Could not access index path '%s': %s +Could not open file for writing: %s: %s +Could not convert FILE stream into an integer descriptor: %s +Could not change permissions of '%u' on file: %s: %s +create_db: Could not write to database. putc returned EOF. +create_db: 'index_path_list': malloc: %s +fts_close(): Could not close fts: %s +fclose(): Could not close tmp file: %s: %s +create_db(): rename(): Could not rename '%s' to '%s': %s +create_db(): chown(): Could not set '%s' group on file: %s: %schown: %s +%s: fatal: init_global_data: malloc: %s +%s: fatal: init_global_data: strdup: %s +init_input_db: malloc: %s +init_input_db: realloc: %s +set_path_head: malloc: %s +set_path_head: realloc: %s +%s%cCould not drop privileges.8 dayssearch_db: open: '%s': %s +serach_db: read: '%s': %s +search_db: read: '%s': %s +encode: 'char *path' is NULL +encode: strdup(): %s +/var/lib/slocate/slocate.dbwfts_open: %s +slocatemain: strdup: %s +encode: fputc(): '': %s +parse_cmds: search string: malloc: %s +parse_cmds: search string: strdup: %s +set_regexp_data: regexp_data: malloc: %s +set_regexp_data: pattern: strdup: %s +set_output_db: make_absolute_path(): path was returned NULL. +Could not find user database '%s': %s +parse_exclude: String passed is NULL. +parse_exclude: sl_strndup: failed. +parse_exclude: access: '%s': %s +parse_fs_exclude: data_str == NULL +parse_fs_exclude: fs_str: malloc: %s +parse_fs_exclude: Could not load file data: %s +parse_fs_exclude: File System Exclude: (1) corrupt mtab file: %s +parse_fs_exclude: File System Exclude: (2) corrupt mtab file: %s +Secure Locate 3.1 - Released March 7, 2006%s +Copyright (c) 2005 Kevin Lindsay + +Search: %s [-qi] [-d ] [--database=] + + %s [-r ] [--regexp=] +Update database: %s [-qv] [-o ] [--output=] + %s [-e ] [-f ] [-l ] + [-c ] <[-U ] [-u]> +General: %s [-Vh] [--version] [--help] + + Options: + -u - Create slocate database starting at path /. + -U - Create slocate database starting at path . + -c - Parse original GNU Locate's configuration file + when using the -u or -U options. If 'updatedb' is + symbolically linked to the '%s' binary, the + original configuration file '/etc/updatedb.conf' will + automatically be used. + -e - Exclude directories from the slocate database when + using the -u or -U options. + -f - Exclude file system types from the slocate database + when using the -u or -U options. (ie. NFS, etc). + -l - Security level. + 0 turns security checks off. This will make + searchs faster. + 1 turns security checks on. This is the default. + -q - Quiet mode. Error messages are suppressed. + -n - Limit the amount of results shown to . + -i - Does a case insensitive search. + -r + --regexp= - Search the database using a basic POSIX regular + expression. + -o + --output= - Specifies the database to create. + -d + --database= - Specfies the path of databases to search in. + -0 - Delimit results with \0 rather than \n + -h + --help - Display this help. + -v + --verbose - Verbose mode. Display files when creating database. + -V + --version - Display version. + +Author: Kevin Lindsay +Bugs: slocate@trakker.ca +HTTP: http://slocate.trakker.ca/ +parse_dash: 'option' variable == NULL. +Security level must be 0 or 1. +Argument 'n': '%s': value must be an integer. +Argument 'n': '%d': value should be greater than 0. +parse_cmds: Argument 'r': preg: malloc: %s +match: regular expression: %s +cmd_dat_s: malloc: %s +parse_exclude: malloc: %s +parse_exclude: realloc: %s +parse_exclude: strdup: %s +/etc/mtabparse_dash: strdup: %s +HELPVERSIONVERBOSEOUTPUTDATABASEREGEXPupdatedbVvuhqU:r:o:e:l:d:-:n:f:c:i0LOCATE_PATHC@A@A@C@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@A@C@C@A@A@A@A@A@A@A@A@A@A@A@A@C@`C@AC@%C@A@B@B@A@A@B@A@XB@?B@A@2B@B@A@A@A@A@/etc/updatedb.conf,PRUNEPATHSPRUNEFS%s: syntax error at '%s': Could not find '=' character. +%s: syntax error at '%s': No value found. +%s: syntax error at '%s': Missing second ". +parse_prune: data_str: malloc: %s +%s: report_error: fatal: malloc: %s +%s: report_error: fatal: realloc: %s +load_file: Could not open file: %s: %s +load_file: Could not stat file: %s: %s +load_file: *file_data: malloc: %s +load_file: read: Failed to read all %d bytes from %s. +get_temp_file: fstat(): %s: %s +get_temp_file: open(): %s: %s +get_temp_file: close(): %s: %s +The temp file '%s' already exists and does not appear to be a valid slocate database. Please remove before creating the database. +Could not find the group: %s in the /etc/group file. +This is a result of the group missing or a corrupted group file. +make_absolute_path(): char *path == NULL +make_absolute_path(): malloc(): do {} while: %s +make_absolute_path(): malloc(): %s +match: fnmatch: unknown error. +match: not FNM_CASEFOLD: tolower_strdup: nocase_str: Returned NULL: %s +match: not FNM_CASEFOLD: tolower_strdup: nocase_path: Returned NULL: %s +match: not FNM_CASEFOLD: fnmatch: nocase: unknown error. +%s: fatal error: %s%s: warning: %s%s: %sload_file: filename == NULL. +Could not read from file: %s +get_temp_file: malloc(): %s +Excluding: %s +;H(dT4Ĵ4lDԾD<Tttt<dDd,DLl44D4T4tT4LzRx @@?BFD <@JML0\`@uADG 4|@+BBB B(A0A8G"4&@BEE E(A0D8D@4(@0BHE B(D0A8D`$ .@ADD D /@PAFD04dp0@BEB H(A0F8G@3@eADD 4p3@8BGE E(A0E8F@4@}N  05@JL ,06@gJG 4L6@RBEB B(A0A8G49@BBE B(A0A8D@4;@OBEB B(A0A8D`$>@BLA C(D0?@BGA 4<pA@BEB E(A0A8GtE@9,E@BHE A(D0$G@9JMQ@I@]AT pI@]AT $I@AG D`J@dJL dJ@ADO$`K@qJaM@JTpO@ERJQ@ADD  Q@JL ,,`R@DBHE A(A0\S@_N tT@iBDD T@FAAD T@EYzRx H$4@Jf@ h@ W@@o@ @@ +G `P@@x o@oo@@~`@@@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@v@@@@@@@@@@@&@6@F@V@f@v@@@0~`GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0)L@h@ W@<{@W@/var/tmp/portage/sys-libs/glibc-2.7-r2/work/build-amd64-x86_64-pc-linux-gnu-nptl/csu/crti.S/var/tmp/portage/sys-libs/glibc-2.7-r2/work/glibc-2.7/csuGNU AS 2.18P/var/tmp/portage/sys-libs/glibc-2.7-r2/work/build-amd64-x86_64-pc-linux-gnu-nptl/csu/crtn.S/var/tmp/portage/sys-libs/glibc-2.7-r2/work/glibc-2.7/csuGNU AS 2.18U%U%r /var/tmp/portage/sys-libs/glibc-2.7-r2/work/build-amd64-x86_64-pc-linux-gnu-nptl/csucrti.S @ +Ku=/0K h@K W@$r /var/tmp/portage/sys-libs/glibc-2.7-r2/work/build-amd64-x86_64-pc-linux-gnu-nptl/csucrtn.S {@K W@K@@h@q@W@W@{@@W@W@.symtab.strtab.shstrtab.interp.note.ABI-tag.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss.comment.debug_aranges.debug_info.debug_abbrev.debug_line.debug_rangesp@p#@ 5@01o@4; @C @ GKo@Xo@@g@xqP@P {h@hv@ @=W@WW@W,t@,tLxu@xu,~`~(~`(~8~`8~@~`@~`` ` ` @  |0p$ą^ 0."- @p@@@@@ @@@ @ +P@ h@ @ @W@W@,t@xu@~`(~`8~`@~```` ` @#-4;CN`d~`u~`@~` ` E@9 T@$ S@_ V@0 `J@d) @0 3@e> 6@RKl^ I@m   I@]W@ pA@- 4@} &8Ma +t4 9@ M@ T@i 05@' 06@g=W@$7CTY"l &@s pO@ ``K7 ?@=/ `@u;Qf| @@?`l Q@ Q@ V@  (@0@`*:?%S J@aeu T@F E@J `R@D* `6 @+@!T @b5v%D7``!( .@9N ;@O_Ku >@{ p3@8H`% pI@] `K@q `Xf+=%QP`e"{ p0@ h@ G@9 /@Pinit.cinitfini.ccall_gmon_startslocate.ccmds.cconf.cutils.celf-init.c_GLOBAL_OFFSET_TABLE___init_array_end__init_array_start_DYNAMICdata_startget_next_charmatchfileno@@GLIBC_2.2.5sl_strndupprintf@@GLIBC_2.2.5getgid@@GLIBC_2.2.5__libc_csu_finigetgrnam@@GLIBC_2.2.5access_path_startfree_cmd_dataparse_userdbclose@@GLIBC_2.2.5parse_updatedbstrncat@@GLIBC_2.2.5fts_open@@GLIBC_2.2.5__gmon_start___Jv_RegisterClassesputs@@GLIBC_2.2.5parse_PRUNEPATHS_finiparse_cmdsputchar@@GLIBC_2.2.5init_cmd_datagetopt@@GLIBC_2.2.5read@@GLIBC_2.2.5strncmp@@GLIBC_2.2.5malloc@@GLIBC_2.2.5fopen@@GLIBC_2.2.5__libc_start_main@@GLIBC_2.2.5regexec@@GLIBC_2.3.4parse_excludeload_filematch_excludeset_regexp_datafts_set@@GLIBC_2.2.5set_output_dbrindex@@GLIBC_2.2.5_IO_stdin_used__ctype_toupper_loc@@GLIBC_2.3__strdup@@GLIBC_2.2.5fputc@@GLIBC_2.2.5encodefree@@GLIBC_2.2.5fnmatch@@GLIBC_2.2.5verify_slocate_dbstrlen@@GLIBC_2.2.5optind@@GLIBC_2.2.5__data_start__xstat@@GLIBC_2.2.5__ctype_b_loc@@GLIBC_2.3parse_dashstrrchr@@GLIBC_2.2.5search_pathregerror@@GLIBC_2.2.5getegid@@GLIBC_2.2.5strerror@@GLIBC_2.2.5strstr@@GLIBC_2.2.5strcat@@GLIBC_2.2.5init_input_db__dso_handlefputs@@GLIBC_2.2.5get_temp_filestrtol@@GLIBC_2.2.5get_gid__libc_csu_initcreate_dboptarg@@GLIBC_2.2.5regcomp@@GLIBC_2.2.5fchmod@@GLIBC_2.2.5verify_accessmemcpy@@GLIBC_2.2.5strchr@@GLIBC_2.2.5tolower_strdupget_valuevsnprintf@@GLIBC_2.2.5__fxstat@@GLIBC_2.2.5getenv@@GLIBC_2.2.5make_absolute_path__errno_location@@GLIBC_2.2.5fts_read@@GLIBC_2.2.5__bss_startsearch_dbstrcmp@@GLIBC_2.2.5set_path_headgetcwd@@GLIBC_2.2.5index@@GLIBC_2.2.5strcpy@@GLIBC_2.2.5chown@@GLIBC_2.2.5getuid@@GLIBC_2.2.5fts_close@@GLIBC_2.2.5regfree@@GLIBC_2.2.5__ctype_tolower_loc@@GLIBC_2.3_endfclose@@GLIBC_2.2.5free_global_datastrncpy@@GLIBC_2.2.5parse_fs_exclude__lxstat@@GLIBC_2.2.5usageparse_search_strstderr@@GLIBC_2.2.5access@@GLIBC_2.2.5parse_PRUNEFSreport_errorrealloc@@GLIBC_2.2.5_edata__strndup@@GLIBC_2.2.5fprintf@@GLIBC_2.2.5setgid@@GLIBC_2.2.5open@@GLIBC_2.2.5rename@@GLIBC_2.2.5stdout@@GLIBC_2.2.5_IO_putc@@GLIBC_2.2.5time@@GLIBC_2.2.5main_initfflush@@GLIBC_2.2.5parse_pruneinit_global_data \ No newline at end of file diff -Naur slocate-3.1/src/slocate.c slocate-3.1-null/src/slocate.c --- slocate-3.1/src/slocate.c 2006-03-07 23:40:11.000000000 -0500 +++ slocate-3.1-null/src/slocate.c 2008-04-08 05:15:44.000000000 -0400 @@ -164,6 +164,7 @@ g_data->regexp_data = NULL; g_data->queries = -1; g_data->SLOCATE_GID = get_gid(g_data, DB_GROUP, &ret); + g_data->delim = '\n'; if (!ret) goto EXIT; @@ -191,7 +192,7 @@ goto EXIT; } if (g_data->VERBOSE) - fprintf(stdout, "%s\n", path); + fprintf(stdout, "%s%c", path, g_data->delim); /* Match number string */ ptr1 = path; code_len = 0; @@ -471,7 +472,7 @@ if (match_ret == 1) { if (g_data->queries > 0) g_data->queries -= 1; - fprintf(stdout, "%s\n", full_path); + fprintf(stdout, "%s%c", full_path, g_data->delim); } ret = 1; EXIT: @@ -736,7 +737,6 @@ ret = 0; goto EXIT; } - #if 0 printf("Q: %d\n", g_data->QUIET); printf("V: %d\n", g_data->VERBOSE); diff -Naur slocate-3.1/src/slocate.h slocate-3.1-null/src/slocate.h --- slocate-3.1/src/slocate.h 2006-03-07 23:40:11.000000000 -0500 +++ slocate-3.1-null/src/slocate.h 2008-04-08 05:13:50.000000000 -0400 @@ -81,6 +81,7 @@ char **input_db; int queries; struct regexp_data_s *regexp_data; + char delim; }; /* Encoding data */ diff -Naur slocate-3.1/src/slocate.o slocate-3.1-null/src/slocate.o --- slocate-3.1/src/slocate.o 1969-12-31 19:00:00.000000000 -0500 +++ slocate-3.1-null/src/slocate.o 2008-04-08 05:21:29.000000000 -0400 @@ -0,0 +1,132 @@ +ELF>"@@ ATAUHSx}H}@H1H?tH1HBHHuBt#HcHHHE@B4#9_HM@HcHؐHH9~H[]A\11mH}@1Ht1HE@HE@A|$HcHHHE@t01r81H1HtI81H1Hi1H\$Hl$HLd$Ll$E1Lt$H(HIIt HAă~fMHAHAt$HcHHIcHcLHHHl$H$Ld$Ll$Lt$ H(tA,,uHHcHHA9|Hc@HHTf81H1L^D11LH7H1(11Lt:fD81H1LI81H1LUHSHHt1҃H[]À{1t5CH~CHKXH=H1H[]Htff.AWAVAUATUSHH|$Ht$HT$HDŽ$Ht$H$@HD$;X(HT$Ru;H$H$HH$H+$H= +H|$11D$$ |$$H$H|$$H|$*HH|$xHcHc*Ht$HxHHD*D+H|$H\$D$<$HT$Ht$@B|$$AHD$(HD$01AHcZD@<&A9YHL$0Ht$(H|$HHD$(RE1LcB|,@uFAu\L)ډD1LILcLHICD7E1CA9܉~Hcŀ|@At)߃HcHIA)؉Ht$@LHcLD9I+AD$H|@|$$Ht$@A1AH|$?H H|$[HtH|$]HD$<9A9"8@H|$H1111ۃ|$$~ |$$HtHMtLH|$0t +H|$0H|$(t +H|$(H[]A\A]A^A_DH|$(yH|$(LHH|HHHt$(HLHH|$0t +H|$0LHHD$0MtLL$> 8: %s +encode: fputc(): SLOC_ESC: code_num: %s +encode: fputc(): code_num: %s +encode: fprintf(): code_line: %s +You are not authorized to create a default slocate database! +Unable to create database: %s +Could not access index path '%s': %s +Could not open file for writing: %s: %s +Could not convert FILE stream into an integer descriptor: %s +Could not change permissions of '%u' on file: %s: %s +create_db: Could not write to database. putc returned EOF. +create_db: 'index_path_list': malloc: %s +fts_close(): Could not close fts: %s +fclose(): Could not close tmp file: %s: %s +create_db(): rename(): Could not rename '%s' to '%s': %s +create_db(): chown(): Could not set '%s' group on file: %s: %schown: %s +%s: fatal: init_global_data: malloc: %s +%s: fatal: init_global_data: strdup: %s +init_input_db: malloc: %s +init_input_db: realloc: %s +set_path_head: malloc: %s +set_path_head: realloc: %s +%s%cCould not drop privileges.8 dayssearch_db: open: '%s': %s +serach_db: read: '%s': %s +search_db: read: '%s': %s +encode: 'char *path' is NULL +encode: strdup(): %s +/var/lib/slocate/slocate.dbwfts_open: %s +slocatemain: strdup: %s +encode: fputc(): '': %s +zRx ?BFD <JML0\uADG 4|+BBB B(A0A8G"4BEE E(A0D8D@40BHE B(D0A8D`$ADD DPAFD04dBEB H(A0F8G@GCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0).symtab.strtab.shstrtab.rela.text.data.bss.rodata.str1.8.rodata.str1.1.rodata.rela.eh_frame.comment.note.GNU-stack @.H &,12@2`O9 \X W@J f!&o""X&  ,  + ?!.3:KT@biq u}+ 0$+9?FMV_hv~P0 slocate.cinit_input_dbreallocreport_errorfreemalloc__errno_locationstrerrorset_path_headstrlenstrncatsearch_pathmatchstdoutfprintfverify_accesssearch_dbgetegid__xstattimeopenreadstrchrmemcpyclosestrcpystrcat__strdupsetgidencodefputcfputscreate_dbaccess_pathaccessget_temp_filefopenfilenofchmod_IO_putcfts_openfts_readmatch_excludefts_setfts_closefcloserenamechownfree_global_dataregfreeinit_global_datastrrchrgetuidgetgidget_gidstderrmainparse_cmdsfree_cmd_datausageE +  + " +, t  &AHR +h\ r +@z  +  +7  +R  -ai +npRu !y 1j    +p " -?Q~#$%#V]n +s %   +#  7 > O +T  q    +  & +s   +! +A + +@F + q +x + + + + + + + + + + + + + +   / +4  S +X +b  t   +  u ( ) (  % ( ( () 0 5 +D  _ i +nn    +    +8    +X  * +4 L +Q elq +~ +  ++  +@ -M +y, +` - +6./01$Ar2345 + +6'KUiz +0 678 +  +p 18I +Q cjt +8~  +  + 9' +F, +84 FO^ +f  +  +  2Kf;=#%Re>m? +F@:A +A# +*P<iC@:HDd&* Egnx +N  +s  +@ +@` +  + + +( +H +h +0 \ No newline at end of file diff -Naur slocate-3.1/src/utils.o slocate-3.1-null/src/utils.o --- slocate-3.1/src/utils.o 1969-12-31 19:00:00.000000000 -0500 +++ slocate-3.1-null/src/utils.o 2008-04-08 05:21:31.000000000 -0400 @@ -0,0 +1,78 @@ +ELF>`@@ Ld$H\$IHl$HHtE/HHt3X@L]H$Hl$Ld$H1fff.UHSHHH1҃t!D$%=t1H1҅HĘ[]þ/HHHźt1H1҅E/HĘ[]fLl$Lt$IH\$Hl$ILd$L|$HHL$Hȉt$HLD$PLL$XH)H$)x)p)h)`)X)P)H)@OT$D$HIOL|$DH$ LLHLD$HD$HD$0D$0HD$ 9|$f|$2IH=L1H=DLH$H$L$L$L$L$HE11ۀ|$uuLHHI81IH=H1U81IH=H1)IH=L11H=IH=L1ffffff.Hl$Ld$HLl$H\$HHIIH11HtiHƿH|$0HHI$HT$0HƉHL$0HH9I1L1#8HI1L1I<$1HtI$1H$H$L$L$Hĸ8HI1L1fDI$랐11p8fDH1L1EfH\$HLd$Hl$Ll$IHHt*H$H$L$L$HHH޿1H|$0t11HteH$IEt$1҃0<]11HٺLuѺ;@81IH1Ll81IH1L81IH1L3bUHSHH0HxHHtmHu0HHHHH.stf@tt HH[]1HٺHuHt;1HH[]81H1HkH1fff.H\$Hl$HLd$HIHHHtEH$Hl$Ld$H1Lu +11Ltfff.AVHIAUIATUSE1>/u HHHHuLMt L@HHHIu81H1Lu1QLHHH|HHt8HHHHf/LHH[]A\A]A^81H1LuHtHf[]A\A]A^H111fff.H\$Hl$HHHHu1H\$Hl$HfDH9rH}HtHHH(뼐ATIUHSHG8HtOHtJH0HtBH HsHHt0HuAt$ tH1[]A\1[]A\USHHHt)t"HHHHËHuHH[]f.Hl$HH\$Ld$Ll$H(HEPHHAHtpHxE1H 1t$E11۽MtLHtHH$H$L$L$ H(HDEEtcHIHHHE1HLbt[1H1LtC1E11*tH11)E111HHH8H1H1qLHH18HH11%s: report_error: fatal: malloc: %s +%s: report_error: fatal: realloc: %s +load_file: Could not open file: %s: %s +load_file: Could not stat file: %s: %s +load_file: *file_data: malloc: %s +load_file: read: Failed to read all %d bytes from %s. +get_temp_file: fstat(): %s: %s +get_temp_file: open(): %s: %s +get_temp_file: close(): %s: %s +The temp file '%s' already exists and does not appear to be a valid slocate database. Please remove before creating the database. +Could not find the group: %s in the /etc/group file. +This is a result of the group missing or a corrupted group file. +make_absolute_path(): char *path == NULL +make_absolute_path(): malloc(): do {} while: %s +make_absolute_path(): malloc(): %s +match: fnmatch: unknown error. +match: not FNM_CASEFOLD: tolower_strdup: nocase_str: Returned NULL: %s +match: not FNM_CASEFOLD: tolower_strdup: nocase_path: Returned NULL: %s +match: not FNM_CASEFOLD: fnmatch: nocase: unknown error. +%s: fatal error: %s%s: warning: %s%s: %sload_file: filename == NULL. +Could not read from file: %s +get_temp_file: malloc(): %s +slocateExcluding: %s +zRx dJL <ADO$\qJaJTERJADD JL ,DBHE A(A04_N LiBDD lFAAD EYGCC: (GNU) 4.2.3 (Gentoo 4.2.3 p1.0).symtab.strtab.shstrtab.rela.text.data.bss.rodata.str1.8.rodata.str1.1.rela.eh_frame.comment.note.GNU-stack @O 8h & , 12 @2zTO*  ^&gw +  + d#p1:qGNX_gns{pD +!P _,4 iBIP +F_sp +yutils.caccess_pathrindexaccessverify_access__lxstatreport_errormallocvsnprintfstderrfprintffflushfreerealloc__errno_locationstrerrorload_fileopen__fxstatreadverify_slocate_dbcloseget_temp_filestrlenstrcpyget_gidgetgrnammake_absolute_pathgetcwdstrcat__strdupsl_strndupstrncpymatch_excludestrcmpprintftolower_strdup__ctype_tolower_locmatchregexecfnmatchstrstr! >    @ +{'/ +$6=GT +( +-5 +>EJYa +h +*18C +PO_ +x ++ +: } +I' + /AHW +_qx +@ !  +`18B +gL^# + + + ;%QYipz +  ! & +  3 +h>    ) + + +,' +'; +. +0 + +# -7 -Y 1k +w  1 +  2   +`  2& - 8 +F . ' +@ +p` + + + + +p +8 +P P + p + + +p + \ No newline at end of file