From 450895f047ea093f73eab2e40d10e2c8bbdb19c9 Mon Sep 17 00:00:00 2001 From: Matthew Monaco Date: Wed, 17 Mar 2010 21:55:00 -0400 Subject: 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. --- ls.c | 9 +-------- 1 file changed, 1 insertion(+), 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); -- cgit