pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patch to filter out unmappable SIDs, 2025-06-04
Posted by Anonymous on Wed 4th Jun 2025 20:26
raw | new post

  1. From 66217075abd99dc9a2ab4d6847f2ff5b8bd1717e Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 4 Jun 2025 21:15:51 +0200
  4. Subject: [PATCH] daemon: |get_token_groups_names()| should filter out Null,
  5.  World and LoginId SIDs
  6.  
  7. |get_token_groups_names()| should filter out Null, World and LoginId SIDs,
  8. because the Cygwin idmapper cannot map them.
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. daemon/accesstoken.c | 19 ++++++++++++++++++-
  13.  1 file changed, 18 insertions(+), 1 deletion(-)
  14.  
  15. diff --git a/daemon/accesstoken.c b/daemon/accesstoken.c
  16. index e9a8d14..6432bdb 100644
  17. --- a/daemon/accesstoken.c
  18. +++ b/daemon/accesstoken.c
  19. @@ -1,6 +1,6 @@
  20.  /*
  21.   * NFSv4.1 client for Windows
  22. - * Copyright (C) 2024 Roland Mainz <roland.mainz@nrubsig.org>
  23. + * Copyright (C) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
  24.   *
  25.   * Roland Mainz <roland.mainz@nrubsig.org>
  26.   *
  27. @@ -221,6 +221,23 @@ bool get_token_groups_names(HANDLE tok,
  28.              continue;
  29.          }
  30.  
  31. +        /*
  32. +         * Filter out groups which cannot be used as normal user or
  33. +         * group account names (e.g. cannot be mapped by the idmapper)
  34. +         */
  35. +        if (IsWellKnownSid(ptgroups->Groups[i].Sid, WinNullSid)) {
  36. +            DPRINTF(1, ("get_token_groups_names: rejecting WinNullSid\n"));
  37. +            continue;
  38. +        }
  39. +        if (IsWellKnownSid(ptgroups->Groups[i].Sid, WinWorldSid)) {
  40. +            DPRINTF(1, ("get_token_groups_names: rejecting WinWorldSid\n"));
  41. +            continue;
  42. +        }
  43. +        if (IsWellKnownSid(ptgroups->Groups[i].Sid, WinLogonIdsSid)) {
  44. +            DPRINTF(1, ("get_token_groups_names: rejecting WinLogonIdsSid\n"));
  45. +            continue;
  46. +        }
  47. +
  48.          namesize = sizeof(namebuffer)-1;
  49.          domainbuffer_size = sizeof(domainbuffer)-1;
  50.  
  51. --
  52. 2.45.1

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at