lufis-allow-uid-and-gid-addon.patch 1.1 KB

123456789101112131415161718192021222324252627282930
  1. --- lufis-0.3.orig/lufis.c 2005-02-05 18:59:56.000000000 +0100
  2. +++ lufis-0.3/lufis.c 2005-02-05 19:00:38.000000000 +0100
  3. @@ -276,15 +276,21 @@ static int lu_getattr(const char *path,
  4. if(res < 0)
  5. return res;
  6. - /* Take uid= and gid= vars when the filesystem returns 1 */
  7. + // Take uid= and gid= vars when the filesystem returns 1
  8. if(fattr.f_uid == (uid_t) 1) {
  9. - lu_opt_getint(&lu_cfg, "MOUNT", "uid", &option_uid, 0);
  10. - fattr.f_uid = (uid_t) option_uid;
  11. + if(!lu_opt_getint(&lu_cfg, "MOUNT", "uid", &option_uid, 0))
  12. + fattr.f_uid = (uid_t) option_uid;
  13. + else
  14. + // default to 0 (root) when no argument was supplied
  15. + fattr.f_uid = (uid_t) 0;
  16. }
  17. if(fattr.f_gid == (gid_t) 1) {
  18. - lu_opt_getint(&lu_cfg, "MOUNT", "gid", &option_gid, 0);
  19. - fattr.f_gid = (gid_t) option_gid;
  20. + if(!lu_opt_getint(&lu_cfg, "MOUNT", "gid", &option_gid, 0))
  21. + fattr.f_gid = (gid_t) option_gid;
  22. + else
  23. + // default to 0 (root) when no argument was supplied
  24. + fattr.f_gid = (gid_t) 0;
  25. }
  26. stbuf->st_mode = fattr.f_mode;