aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Monaco <dgbaley27@verizon.net>2010-03-17 21:55:00 -0400
committerGerd Hoffmann <kraxel@redhat.com>2011-01-26 15:06:27 +0100
commit450895f047ea093f73eab2e40d10e2c8bbdb19c9 (patch)
tree0dd4d0d157719aaba50a8692d3578a45098dc680
parentf2fa128c6b9fae758c7d0957fd6f06ea31a872b7 (diff)
downloadwebfs-450895f047ea093f73eab2e40d10e2c8bbdb19c9.tar.gz
patch for secondary groups
Sorry, I'm inexperienced with actually creating patches, but it should be obvious what to do... I tested this with and without chrooting. Hopefully this finds you well, please let me know what you think. In addition, I thought it would be nice to have a flag that gives the option to resolve uid and gids... Upon further thought however, the simplicity of webfs might indicate that the uid and gid don't need to be listed in the first place. What might be nice though, is command line option to specify a format string for dir entries with the usual %a %b %c notation.
-rw-r--r--ls.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/ls.c b/ls.c
index 7645966..cc3218e 100644
--- a/ls.c
+++ b/ls.c
@@ -240,14 +240,7 @@ ls(time_t now, char *hostname, char *filename, char *path, int *length)
files[count]->r = 0;
if (S_ISDIR(files[count]->s.st_mode) ||
S_ISREG(files[count]->s.st_mode)) {
- if (files[count]->s.st_uid == uid &&
- files[count]->s.st_mode & 0400)
- files[count]->r = 1;
- else if (files[count]->s.st_uid == gid &&
- files[count]->s.st_mode & 0040)
- files[count]->r = 1; /* FIXME: check additional groups */
- else if (files[count]->s.st_mode & 0004)
- files[count]->r = 1;
+ if (access(line, R_OK) == 0) files[count]->r = 1;
}
}
closedir(dir);