pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for SidTypeAlias (chgrp support), Cygwin 3.6.0 and misc, 2024-02-22
Posted by Anonymous on Thu 22nd Feb 2024 16:11
raw | new post

  1. From f65fe1d07eea059163a83efe97052ceecbaa6097 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Thu, 22 Feb 2024 14:31:38 +0100
  4. Subject: [PATCH 1/3] cygwin: Fix "installdest" target failure in Cygwin 3.6.0
  5.  
  6. Fix "installdest" Makefile target failure in Cygwin 3.6.0,
  7. caused by bash now setting the process title to the command it is
  8. currently executing.
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. cygwin/Makefile | 2 +-
  13.  1 file changed, 1 insertion(+), 1 deletion(-)
  14.  
  15. diff --git a/cygwin/Makefile b/cygwin/Makefile
  16. index e2953c7..44f3308 100644
  17. --- a/cygwin/Makefile
  18. +++ b/cygwin/Makefile
  19. @@ -51,7 +51,7 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  20.         $(PROJECT_BASEDIR_DIR)/etc_netconfig \
  21.         $(PROJECT_BASEDIR_DIR)/ms-nfs41-idmap.conf \
  22.         $(CYGWIN_MAKEFILE_DIR)/devel/msnfs41client.bash
  23. -       @if [[ "$$(ps -ef)" =~ "$(DESTDIR)" ]] ; then \
  24. +       @if [[ "$$(ps -ef | grep -v -E "[[:space:]]+$${BASH_PID}[[:space:]]+")" =~ "$(DESTDIR)" ]] ; then \
  25.                 printf 'DIR %q is in use by a process\n' "$DESTDIR" 1>&2 ; \
  26.                 exit 1 ; \
  27.         fi
  28. --
  29. 2.43.0
  30.  
  31. From a05b34c5e48d525833264751dff51628c615799b Mon Sep 17 00:00:00 2001
  32. From: Roland Mainz <roland.mainz@nrubsig.org>
  33. Date: Thu, 22 Feb 2024 15:14:51 +0100
  34. Subject: [PATCH 2/3] cygwin: msnfs41client.bash: Add support for VSDiagnostics
  35.  profiling
  36.  
  37. Add support for VSDiagnostics.exe profiling to msnfs41client.bash
  38.  
  39. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  40. ---
  41. cygwin/devel/msnfs41client.bash | 29 +++++++++++++++++++++++++++++
  42.  1 file changed, 29 insertions(+)
  43.  
  44. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  45. index 07c1dd5..8474264 100644
  46. --- a/cygwin/devel/msnfs41client.bash
  47. +++ b/cygwin/devel/msnfs41client.bash
  48. @@ -202,6 +202,18 @@ function nfsclient_rundeamon
  49.                                 '--crtdbgmem' 'none'
  50.                         )
  51.                 "${nfsd_args[@]}"
  52. +       elif false ; then
  53. +               typeset -i vsdiagnostics_id=50
  54. +               VSDiagnostics \
  55. +                       start ${vsdiagnostics_id} \
  56. +                       "/launch:$(cygpath -w "$PWD/nfsd_debug.exe")" \
  57. +                       "/launchArgs:${nfsd_args[*]:1}" \
  58. +                       "/loadConfig:$(cygpath -w "${vsdiagnostics_path}/AgentConfigs/CpuUsageHigh.json")"
  59. +               printf '#\n'
  60. +               printf '# use\n'
  61. +               printf '# $ "%s" stop %d /output:nfsd_debug%d # to correct profiling data\n#\n' \
  62. +                       "$(which -a 'VSDiagnostics.exe')" \
  63. +                       "${vsdiagnostics_id}" "$$"
  64.         else
  65.                 "${nfsd_args[@]}"
  66.         fi
  67. @@ -283,7 +295,20 @@ function nfsclient_system_rundeamon
  68.                                 '--crtdbgmem' 'none'
  69.                         )
  70.                 "${nfsd_args[@]}"
  71. +       elif false ; then
  72. +               typeset -i vsdiagnostics_id=50
  73. +               VSDiagnostics \
  74. +                       start ${vsdiagnostics_id} \
  75. +                       "/launch:$(cygpath -w "$PWD/nfsd_debug.exe")" \
  76. +                       "/launchArgs:${nfsd_args[*]:1}" \
  77. +                       "/loadConfig:$(cygpath -w "${vsdiagnostics_path}/AgentConfigs/CpuUsageHigh.json")"
  78. +               printf '#\n'
  79. +               printf '# use\n'
  80. +               printf '# $ "%s" stop %d /output:nfsd_debug%d # to correct profiling data\n#\n' \
  81. +                       "$(which -a 'VSDiagnostics.exe')" \
  82. +                       "${vsdiagnostics_id}" "$$"
  83.         else
  84. +
  85.                 "${nfsd_args[@]}"
  86.         fi
  87.         return $?
  88. @@ -407,6 +432,10 @@ function main
  89.         # path to WinDBG cdb (fixme: 64bit x86-specific)
  90.         PATH+=':/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/'
  91.  
  92. +       # PATH to VSDiagnostics.exe and AgentConfigs
  93. +       vsdiagnostics_path='/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/Team Tools/DiagnosticsHub/Collector/'
  94. +       PATH+=":${vsdiagnostics_path}"
  95. +
  96.         # my own path to pstools
  97.         PATH+=':/home/roland_mainz/work/win_pstools/'
  98.  
  99. --
  100. 2.43.0
  101.  
  102. From cfa13ae6ed3c1a818f76543cbc9feb288c8414f2 Mon Sep 17 00:00:00 2001
  103. From: Roland Mainz <roland.mainz@nrubsig.org>
  104. Date: Thu, 22 Feb 2024 16:30:55 +0100
  105. Subject: [PATCH 3/3] daemon: |map_nfs4servername_2_sid()| should treat
  106.  |SidTypeAlias| as (local) group
  107.  
  108. Treat |SidTypeAlias| returned by |LookupAccountNameA()| as a (local)
  109. group in |map_nfs4servername_2_sid()|.
  110.  
  111. See
  112. https://stackoverflow.com/questions/39373188/lookupaccountnamew-returns-sidtypealias-but-expected-sidtypegroup
  113. for more information.
  114.  
  115. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  116. ---
  117. daemon/sid.c | 18 ++++++++++++++++++
  118.  1 file changed, 18 insertions(+)
  119.  
  120. diff --git a/daemon/sid.c b/daemon/sid.c
  121. index a145607..881b638 100644
  122. --- a/daemon/sid.c
  123. +++ b/daemon/sid.c
  124. @@ -517,6 +517,24 @@ int map_nfs4servername_2_sid(nfs41_daemon_globals *nfs41dg, int query, DWORD *si
  125.  out:
  126.  #ifdef NFS41_DRIVER_SID_CACHE
  127.      if ((status == 0) && *sid) {
  128. +        if ((query & GROUP_SECURITY_INFORMATION) &&
  129. +            (sid_type == SidTypeAlias)) {
  130. +            /*
  131. +             * Treat |SidTypeAlias| as (local) group
  132. +             *
  133. +             * It seems that |LookupAccountNameA()| will always return
  134. +             * |SidTypeAlias| for local groups created with
  135. +             * $ net localgroup cygwingrp1 /add #
  136. +             *
  137. +             * References:
  138. +             * - https://stackoverflow.com/questions/39373188/lookupaccountnamew-returns-sidtypealias-but-expected-sidtypegroup
  139. +             */
  140. +            DPRINTF(1, ("map_nfs4servername_2_sid(query=%x,name='%s'): "
  141. +                "SID_TYPE='SidTypeAlias' mapped to 'SidTypeGroup'\n",
  142. +                query, orig_name, sid_type));
  143. +            sid_type = SidTypeGroup;
  144. +        }
  145. +
  146.          switch (sid_type) {
  147.              case SidTypeUser:
  148.                  sidcache_add(&user_sidcache, orig_name, *sid);
  149. --
  150. 2.43.0

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