patch-utils_mountd_cache_c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- nfs-utils-1.1.4.orig/utils/mountd/cache.c 2008-10-17 16:20:09.000000000 +0200
  3. +++ nfs-utils-1.1.4/utils/mountd/cache.c 2009-01-03 13:48:33.000000000 +0100
  4. @@ -118,54 +118,6 @@ void auth_unix_ip(FILE *f)
  5. free(he);
  6. }
  7. -void auth_unix_gid(FILE *f)
  8. -{
  9. - /* Request are
  10. - * uid
  11. - * reply is
  12. - * uid expiry count list of group ids
  13. - */
  14. - int uid;
  15. - struct passwd *pw;
  16. - gid_t glist[100], *groups = glist;
  17. - int ngroups = 100;
  18. - int rv, i;
  19. - char *cp;
  20. -
  21. - if (readline(fileno(f), &lbuf, &lbuflen) != 1)
  22. - return;
  23. -
  24. - cp = lbuf;
  25. - if (qword_get_int(&cp, &uid) != 0)
  26. - return;
  27. -
  28. - pw = getpwuid(uid);
  29. - if (!pw)
  30. - rv = -1;
  31. - else {
  32. - rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
  33. - if (rv == -1 && ngroups >= 100) {
  34. - groups = malloc(sizeof(gid_t)*ngroups);
  35. - if (!groups)
  36. - rv = -1;
  37. - else
  38. - rv = getgrouplist(pw->pw_name, pw->pw_gid,
  39. - groups, &ngroups);
  40. - }
  41. - }
  42. - qword_printint(f, uid);
  43. - qword_printint(f, time(0)+30*60);
  44. - if (rv >= 0) {
  45. - qword_printint(f, ngroups);
  46. - for (i=0; i<ngroups; i++)
  47. - qword_printint(f, groups[i]);
  48. - } else
  49. - qword_printint(f, 0);
  50. - qword_eol(f);
  51. -
  52. - if (groups != glist)
  53. - free(groups);
  54. -}
  55. #if USE_BLKID
  56. static const char *get_uuid_blkdev(char *path)
  57. @@ -730,7 +682,6 @@ struct {
  58. FILE *f;
  59. } cachelist[] = {
  60. { "auth.unix.ip", auth_unix_ip},
  61. - { "auth.unix.gid", auth_unix_gid},
  62. { "nfsd.export", nfsd_export},
  63. { "nfsd.fh", nfsd_fh},
  64. { NULL, NULL }
  65. @@ -742,8 +693,6 @@ void cache_open(void)
  66. int i;
  67. for (i=0; cachelist[i].cache_name; i++ ) {
  68. char path[100];
  69. - if (!manage_gids && cachelist[i].cache_handle == auth_unix_gid)
  70. - continue;
  71. sprintf(path, "/proc/net/rpc/%s/channel", cachelist[i].cache_name);
  72. cachelist[i].f = fopen(path, "r+");
  73. }