--- projects/libstatgrab/src/statgrab/statgrab.c 2003/10/19 01:25:55 1.11 +++ projects/libstatgrab/src/statgrab/statgrab.c 2004/01/05 16:39:15 1.14 @@ -279,6 +279,8 @@ void populate_fs() { die("out of memory"); name = buf; + if (strlen(name) == 2 && name[1] == ':') + name[1] = '\0'; if (strncmp(name, "/dev/", 5) == 0) name += 5; while ((p = strchr(name, '/')) != NULL) @@ -602,6 +604,18 @@ int main(int argc, char **argv) { use_diffs = 1; select_interesting(argc - optind, &argv[optind]); + + /* We don't care if statgrab_init fails, because we can just display + the statistics that can be read as non-root. */ + statgrab_init(); +#ifdef ALLBSD + if (setegid(getgid()) != 0) + die("Failed to lose effective group"); +#endif +#ifdef SOLARIS + if (seteuid(getuid()) != 0) + die("Failed to lose effective user"); +#endif switch (repeat_mode) { case REPEAT_NONE: