pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for newgrp(1) with sec=none+misc, 2025-06-10
Posted by Anonymous on Tue 10th Jun 2025 20:26
raw | new post

  1. From 6fd67cc4a5f00630f6dd2c807f78699183c7e08f Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Tue, 10 Jun 2025 17:33:04 +0200
  4. Subject: [PATCH 1/3] daemon: newgrp support should not try to set owner_group
  5.  after file creation for sec=none
  6.  
  7. newgrp support should not try to set owner_group after file creation for
  8. sec=none, because sec=none does not support changing groups for files/dirs
  9. (tested with the Solaris 11.4 NFSv4.1 server).
  10.  
  11. Reported-by: Cedric Blancher <cedric.blancher@gmail.com>
  12. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  13. ---
  14. daemon/open.c | 8 +++++++-
  15.  1 file changed, 7 insertions(+), 1 deletion(-)
  16.  
  17. diff --git a/daemon/open.c b/daemon/open.c
  18. index d1ca062..c3c471f 100644
  19. --- a/daemon/open.c
  20. +++ b/daemon/open.c
  21. @@ -1075,8 +1075,14 @@ supersede_retry:
  22.               * Hack: Support |setgid()|/newgrp(1)/sg(1)/winsg(1) by
  23.               * fetching groupname from auth token for new files and
  24.               * do a "manual" chgrp on the new file
  25. +             *
  26. +             * Note that |RPCSEC_AUTH_NONE| does not have any
  27. +             * user/group information, therefore newgrp will be a
  28. +             * NOP here.
  29.               */
  30. -            if (create == OPEN4_CREATE) {
  31. +            if ((create == OPEN4_CREATE) &&
  32. +                (state->session->client->rpc->sec_flavor !=
  33. +                    RPCSEC_AUTH_NONE)) {
  34.                  char *s;
  35.                  int chgrp_status;
  36.                  stateid_arg stateid;
  37. --
  38. 2.45.1
  39.  
  40. From fdd89fa2affeaa42bf3993f350c9ffa40e38ce04 Mon Sep 17 00:00:00 2001
  41. From: Dan Shelton <dan.f.shelton@gmail.com>
  42. Date: Tue, 10 Jun 2025 19:45:33 +0200
  43. Subject: [PATCH 2/3] install: Fix "Arithmetic overflow: Using operator '+' on
  44.  a 4 byte value and then casting the result to a 8 byte value."
  45.  
  46. Fix "Arithmetic overflow: Using operator '+' on a 4 byte value and then
  47. casting the result to a 8 byte value."
  48.  
  49. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  50. ---
  51. install/nfs_install.c | 2 +-
  52.  1 file changed, 1 insertion(+), 1 deletion(-)
  53.  
  54. diff --git a/install/nfs_install.c b/install/nfs_install.c
  55. index 9d75552..c963675 100644
  56. --- a/install/nfs_install.c
  57. +++ b/install/nfs_install.c
  58. @@ -101,7 +101,7 @@ int main(int ac, char *av[])
  59.      DPRINTF(1, ("# RegQueryValueExA(), result=%d, dataSize=%d\n",
  60.          (int)result, (int)dataSize));
  61.  
  62. -    originalValue = malloc(dataSize+1);
  63. +    originalValue = malloc((size_t)dataSize+1);
  64.  
  65.      if (!originalValue) {
  66.          (void)fprintf(stderr, "%s: Out of memory\n", av[0]);
  67. --
  68. 2.45.1
  69.  
  70. From 288d7613fbacba48ac272bb2e91a098f86f77b11 Mon Sep 17 00:00:00 2001
  71. From: Dan Shelton <dan.f.shelton@gmail.com>
  72. Date: Tue, 10 Jun 2025 20:30:19 +0200
  73. Subject: [PATCH 3/3] sys: Fix "warning C6273: Non-integer passed as _Param_(4)
  74.  when an integer is required in call to 'DbgPrintEx'"
  75.  
  76. Fix "warning C6273: Non-integer passed as _Param_(4) when an integer is
  77. required in call to 'DbgPrintEx' Actual type: 'struct _KPROCESS *':
  78. if a pointer value is being passed, %p should be used."
  79.  
  80. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  81. ---
  82. sys/nfs41sys_debug.c | 9 ++++++---
  83.  1 file changed, 6 insertions(+), 3 deletions(-)
  84.  
  85. diff --git a/sys/nfs41sys_debug.c b/sys/nfs41sys_debug.c
  86. index ed88ca7..ee95c9a 100644
  87. --- a/sys/nfs41sys_debug.c
  88. +++ b/sys/nfs41sys_debug.c
  89. @@ -79,7 +79,8 @@ ULONG __cdecl DbgP(IN PCCH fmt, ...)
  90.          RtlTimeToTimeFields(&local_time, &time_fields);
  91.  
  92.          DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
  93. -            "[%ld].[%02u:%02u:%02u.%u] %s", IoGetCurrentProcess(),
  94. +            "[%04x].[%02u:%02u:%02u.%u] %s",
  95. +            PsGetCurrentProcessShortDebugId(),
  96.              time_fields.Hour, time_fields.Minute, time_fields.Second,
  97.              time_fields.Milliseconds, msg);
  98.  #else
  99. @@ -111,7 +112,8 @@ ULONG __cdecl print_error(IN PCCH fmt, ...)
  100.          RtlTimeToTimeFields(&local_time, &time_fields);
  101.  
  102.          DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
  103. -            "[%ld].[%02u:%02u:%02u.%u] %s", IoGetCurrentProcess(),
  104. +            "[%04x].[%02u:%02u:%02u.%u] %s",
  105. +            PsGetCurrentProcessShortDebugId(),
  106.              time_fields.Hour, time_fields.Minute, time_fields.Second,
  107.              time_fields.Milliseconds, msg);
  108.  #else
  109. @@ -135,7 +137,8 @@ void print_hexbuf(const char *title, unsigned char *buf, int len)
  110.      RtlTimeToTimeFields(&local_time, &time_fields);
  111.  
  112.      DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
  113. -        "[%ld].[%02u:%02u:%02u.%u] %s\n", IoGetCurrentProcess(),
  114. +        "[%04x].[%02u:%02u:%02u.%u] %s\n",
  115. +        PsGetCurrentProcessShortDebugId(),
  116.          time_fields.Hour, time_fields.Minute, time_fields.Second,
  117.          time_fields.Milliseconds, title);
  118.      for(j = 0, k = 0; j < len; j++, k++) {
  119. --
  120. 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