pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for lssparse fixes, Nfs3Attr EA fixes+misc, 2025-04-05
Posted by Anonymous on Sat 5th Apr 2025 19:01
raw | new post

  1. From ed7f138e1682b7da95d606125b81abf754653a0f Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Sat, 5 Apr 2025 16:43:13 +0200
  4. Subject: [PATCH 1/5] tests: lssparse -H does not print hole at offset 0 if
  5.  more data exists
  6.  
  7. lssparse -H does not print hole at offset 0 if more data exists.
  8.  
  9. Fixes: https://cygwin.com/pipermail/cygwin/2025-April/257843.html
  10. Reported-by: Christian Franke <Christian.Franke@t-online.de>
  11. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  12. ---
  13. tests/lssparse/lssparse.c | 10 ++++++----
  14.  1 file changed, 6 insertions(+), 4 deletions(-)
  15.  
  16. diff --git a/tests/lssparse/lssparse.c b/tests/lssparse/lssparse.c
  17. index 4adb200..6fc269e 100644
  18. --- a/tests/lssparse/lssparse.c
  19. +++ b/tests/lssparse/lssparse.c
  20. @@ -2,7 +2,7 @@
  21.  /*
  22.   * MIT License
  23.   *
  24. - * Copyright (c) 2011-2012 Roland Mainz <roland.mainz@nrubsig.org>
  25. + * Copyright (c) 2011-2025 Roland Mainz <roland.mainz@nrubsig.org>
  26.   *
  27.   * Permission is hereby granted, free of charge, to any person obtaining a copy
  28.   * of this software and associated documentation files (the "Software"), to deal
  29. @@ -139,7 +139,8 @@ int main(int argc, char *argv[])
  30.       * $ /cygdrive/c/Windows/system32/fsutil sparse queryrange ... #
  31.       * output
  32.       */
  33. -    for (i=1 ;;) {
  34. +#define LSSPARSE_START_INDEX 1
  35. +    for (i=LSSPARSE_START_INDEX ;;) {
  36.          data_start = lseek(fd, offset, SEEK_DATA);
  37.          if (data_start == -1)
  38.              break;
  39. @@ -159,7 +160,8 @@ int main(int argc, char *argv[])
  40.              }
  41.          }
  42.  
  43. -        if (print_holes && (i == 0) && (data_start > 0)) {
  44. +        if (print_holes &&
  45. +            (i == LSSPARSE_START_INDEX) && (data_start > 0)) {
  46.              (void)printf((pb == pb_hex)?
  47.                  "Hole range[%ld]: offset=0x%llx,\tlength=0x%llx\n":
  48.                  "Hole range[%ld]: offset=%lld,\tlength=%lld\n",
  49. @@ -215,7 +217,7 @@ int main(int argc, char *argv[])
  50.              (void)printf((pb == pb_hex)?
  51.                  "Hole range[%ld]: offset=0x%llx,\tlength=0x%llx\n":
  52.                  "Hole range[%ld]: offset=%lld,\tlength=%lld\n",
  53. -                (long)0,
  54. +                (long)LSSPARSE_START_INDEX,
  55.                  (long long)0LL,
  56.                  (long long)file_size);
  57.          }
  58. --
  59. 2.45.1
  60.  
  61. From 1b23534234fa58633bc96137220a9b9b32d4aa5f Mon Sep 17 00:00:00 2001
  62. From: Roland Mainz <roland.mainz@nrubsig.org>
  63. Date: Sat, 5 Apr 2025 16:48:36 +0200
  64. Subject: [PATCH 2/5] tests: lssparse usage message should print all options in
  65.  short form line
  66.  
  67. lssparse usage message should print all options in short form line.
  68.  
  69. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  70. ---
  71. tests/lssparse/lssparse.c | 2 +-
  72.  1 file changed, 1 insertion(+), 1 deletion(-)
  73.  
  74. diff --git a/tests/lssparse/lssparse.c b/tests/lssparse/lssparse.c
  75. index 6fc269e..399ac75 100644
  76. --- a/tests/lssparse/lssparse.c
  77. +++ b/tests/lssparse/lssparse.c
  78. @@ -42,7 +42,7 @@
  79.  static
  80.  void usage(const char *progname)
  81.  {
  82. -    (void)fprintf(stderr, "Usage: %s [-h] <sparse_file>\n"
  83. +    (void)fprintf(stderr, "Usage: %s [-h] [-xdH] <sparse_file>\n"
  84.          "  -h: Display this help message\n"
  85.          "  -x: Print offsets in hexadecimal (base 16)\n"
  86.          "  -d: Print offsets in decimal (base 10)\n"
  87. --
  88. 2.45.1
  89.  
  90. From 96fd0d99372b83f17835422a80f5f165c071d9c4 Mon Sep 17 00:00:00 2001
  91. From: Roland Mainz <roland.mainz@nrubsig.org>
  92. Date: Sat, 5 Apr 2025 17:08:50 +0200
  93. Subject: [PATCH 3/5] cygwin: Fix cygwinaccount2nfs4account error messages
  94.  
  95. Fix cygwinaccount2nfs4account error messages
  96.  
  97. Reported-by: Joshuah Hurst <joshhurst@gmail.com>
  98. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  99. ---
  100. .../cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh  | 5 +++--
  101.  1 file changed, 3 insertions(+), 2 deletions(-)
  102.  
  103. diff --git a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
  104. index 264b9c5..128e6d8 100644
  105. --- a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
  106. +++ b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
  107. @@ -406,7 +406,7 @@ function main
  108.  
  109.         # fixme: Need better text layout for $ cygwinaccount2nfs4account --man #
  110.         typeset -r cygwinaccount2nfs4account_usage=$'+
  111. -       [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2025-03-19 \$\n]
  112. +       [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2025-04-05 \$\n]
  113.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  114.         [+NAME?cygwinaccount2nfs4account - convert Cygwin user/group account
  115.                 info to Linux/UNIX NFSv4 server account data]
  116. @@ -455,12 +455,13 @@ function main
  117.         done
  118.  
  119.         if [[ ! -v c.os ]] ; then
  120. -               print -u2 -f $"%s: Require -O <operating-system>\n"
  121. +               print -u2 -f $"%s: Require -O <operating-system>\n" "${progname}"
  122.                 return 1
  123.         fi
  124.  
  125.         if [[ "${c.os}" != ~(Elr)(linux|solaris|illumos) ]] ; then
  126.                 print -u2 -f $"%s: Unsuppoted -O value %q, supported are 'linux', 'solaris', 'illumos'\n" \
  127. +                       "${progname}" \
  128.                         "${c.os}"
  129.                 return 1
  130.         fi
  131. --
  132. 2.45.1
  133.  
  134. From 56e4b20fdfee6100c3b3f511355854b466cede8e Mon Sep 17 00:00:00 2001
  135. From: Roland Mainz <roland.mainz@nrubsig.org>
  136. Date: Sat, 5 Apr 2025 18:55:42 +0200
  137. Subject: [PATCH 4/5] cygwin,tests: Remove native "git clone" failure from bug
  138.  list, fixed via |NFS41_DRIVER_HACK_DISABLE_FCB_ATTR_UPDATE_ON_OPEN|
  139.  
  140. Remove native "git clone" failure from bug list, we worked around that
  141. issue via |NFS41_DRIVER_HACK_DISABLE_FCB_ATTR_UPDATE_ON_OPEN|
  142. (see commit "nfs41_build_features.h,sys: Add hack to avoid updating
  143. FCB attributes we open an already opened FCB")
  144.  
  145. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  146. ---
  147. cygwin/README.bintarball.txt | 20 --------------------
  148.  tests/manual_testing.txt     | 20 ++------------------
  149.  2 files changed, 2 insertions(+), 38 deletions(-)
  150.  
  151. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  152. index 6a5c025..bfa378d 100644
  153. --- a/cygwin/README.bintarball.txt
  154. +++ b/cygwin/README.bintarball.txt
  155. @@ -609,26 +609,6 @@ $ mount -t drvfs '\0.49.202.230@2049\nfs4\bigdisk' /mnt/bigdisk
  156.    Datei befindet. Versuchen Sie, die Datei woanders zu speichern.
  157.    ---- snip ----
  158.  
  159. -- Bug: Native Windows git (NOT cygwin /usr/bin/git) clone fails
  160. -  like this:
  161. -  # ---- snip ----
  162. -  $ '/cygdrive/c/Program Files/Git/cmd/git' --version
  163. -  git version 2.45.2.windows.1
  164. -  $ '/cygdrive/c/Program Files/Git/cmd/git' clone https://github.com/kofemann/ms-nfs41-client.git
  165. -  Cloning into 'ms-nfs41-client'...
  166. -  remote: Enumerating objects: 6558, done.
  167. -  remote: Counting objects: 100% (318/318), done.
  168. -  remote: Compressing objects: 100% (172/172), done.
  169. -  remote: Total 6558 (delta 191), reused 233 (delta 141), pack-reused 6240 (from 1)
  170. -  Receiving objects: 100% (6558/6558), 2.43 MiB | 4.66 MiB/s, done.
  171. -  fatal: premature end of pack file, 655 bytes missing
  172. -  warning: die() called many times. Recursion error or racy threaded death!
  173. -  fatal: fetch-pack: invalid index-pack output
  174. -  # ---- snip ----
  175. -  Workaround is to mount the NFS filesystem with the "writethru"
  176. -  OR "nocache" option, e.g.
  177. -  $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
  178. -
  179.  
  180.  #
  181.  # 12. Notes for troubleshooting && finding bugs/debugging:
  182. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  183. index 57c4861..d9291c0 100644
  184. --- a/tests/manual_testing.txt
  185. +++ b/tests/manual_testing.txt
  186. @@ -567,24 +567,8 @@ svn checkout https://svn.FreeBSD.org/base/head/share/man
  187.  #
  188.  # NATIVE Windows git clone (NOT Cygwin /usr/bin/git!)
  189.  #
  190. -# Currently fails like this:
  191. -# ---- snip ----
  192. -# $ '/cygdrive/c/Program Files/Git/cmd/git' --version
  193. -# git version 2.45.2.windows.1
  194. -# $ '/cygdrive/c/Program Files/Git/cmd/git' clone https://github.com/kofemann/ms-nfs41-client.git
  195. -# Cloning into 'ms-nfs41-client'...
  196. -# remote: Enumerating objects: 6558, done.
  197. -# remote: Counting objects: 100% (318/318), done.
  198. -# remote: Compressing objects: 100% (172/172), done.
  199. -# remote: Total 6558 (delta 191), reused 233 (delta 141), pack-reused 6240 (from 1)
  200. -# Receiving objects: 100% (6558/6558), 2.43 MiB | 4.66 MiB/s, done.
  201. -# fatal: premature end of pack file, 655 bytes missing
  202. -# warning: die() called many times. Recursion error or racy threaded death!
  203. -# fatal: fetch-pack: invalid index-pack output
  204. -# ---- snip ----
  205. -# Workaround is to mount the NFS filesystem with the "writethru"
  206. -# OR "nocache" option, e.g.
  207. -# $ /sbin/nfs_mount -o rw,writethru 'j' derfwpc5131:/export/home/rmainz #
  208. +# This can fail with older Linux nfsd like Linux 5.10,
  209. +# but works with Linux 6.6.32-rt32 nfsd
  210.  #
  211.  # Test:
  212.  '/cygdrive/c/Program Files/Git/cmd/git' clone https://github.com/kofemann/ms-nfs41-client.git
  213. --
  214. 2.45.1
  215.  
  216. From 86d69fed7ca51432964392a2a963d21034f8b4d6 Mon Sep 17 00:00:00 2001
  217. From: Roland Mainz <roland.mainz@nrubsig.org>
  218. Date: Sat, 5 Apr 2025 19:49:14 +0200
  219. Subject: [PATCH 5/5] daemon,tests: Fix Nfs3Attr EA local uid/gid
  220.  
  221. Nfs3Attr EA (probed via $ /bin/winfsinfo nfs3attr ... #) sometimes
  222. contains local uid=0/local gid=0 instead of the real local uid/gid.
  223. Fix is to always do the uid/gid lookup.
  224.  
  225. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  226. ---
  227. daemon/open.c            | 246 ++++++++++++++++++++++-----------------
  228.  tests/manual_testing.txt |  15 +++
  229.  2 files changed, 155 insertions(+), 106 deletions(-)
  230.  
  231. diff --git a/daemon/open.c b/daemon/open.c
  232. index 95d724a..d2629c0 100644
  233. --- a/daemon/open.c
  234. +++ b/daemon/open.c
  235. @@ -688,6 +688,134 @@ void symlink2ntpath(
  236.          (int)*out_target_type));
  237.  }
  238.  
  239. +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
  240. +static
  241. +void open_get_localuidgid(IN nfs41_daemon_globals *restrict nfs41dg,
  242. +    IN nfs41_open_state *restrict state,
  243. +    IN OUT nfs41_file_info *restrict info,
  244. +    OUT DWORD *restrict owner_local_uid,
  245. +    OUT DWORD *restrict owner_group_local_gid)
  246. +{
  247. +    int status = 0;
  248. +    char owner[NFS4_FATTR4_OWNER_LIMIT+1];
  249. +    char owner_group[NFS4_FATTR4_OWNER_LIMIT+1];
  250. +    uid_t map_uid = ~0UL;
  251. +    gid_t map_gid = ~0UL;
  252. +    char *at_ch; /* pointer to '@' */
  253. +
  254. +#if 1
  255. +    EASSERT(info->attrmask.count >= 2);
  256. +
  257. +    /* this should only happen for newly created files/dirs */
  258. +    if ((info->attrmask.count < 2) ||
  259. +        ((info->attrmask.arr[1] & FATTR4_WORD1_OWNER) == 0) ||
  260. +        ((info->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) == 0)) {
  261. +        bitmap4 og_attr_request;
  262. +        nfs41_file_info og_info = { 0 };
  263. +
  264. +        og_attr_request.count = 2;
  265. +        og_attr_request.arr[0] = 0;
  266. +        og_attr_request.arr[1] =
  267. +            FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
  268. +        og_info.owner = og_info.owner_buf;
  269. +        og_info.owner_group = og_info.owner_group_buf;
  270. +        status = nfs41_getattr(state->session, &state->file,
  271. +            &og_attr_request, &og_info);
  272. +        if (status) {
  273. +            eprintf("open_get_localuidgid: nfs41_getattr('%s') "
  274. +                "failed with %d\n",
  275. +                state->path.path,
  276. +                status);
  277. +            *owner_local_uid = NFS_USER_NOBODY_UID;
  278. +            *owner_group_local_gid = NFS_GROUP_NOGROUP_GID;
  279. +            goto out;
  280. +        }
  281. +
  282. +        info->owner = info->owner_buf;
  283. +        (void)strcpy(info->owner, og_info.owner);
  284. +        info->attrmask.arr[1] |= FATTR4_WORD1_OWNER;
  285. +        info->owner_group = info->owner_group_buf;
  286. +        (void)strcpy(info->owner_group, og_info.owner_group);
  287. +        info->attrmask.arr[1] |= FATTR4_WORD1_OWNER_GROUP;
  288. +    }
  289. +#endif
  290. +
  291. +    EASSERT((info->attrmask.arr[1] & FATTR4_WORD1_OWNER) != 0);
  292. +    EASSERT((info->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) != 0);
  293. +    EASSERT(info->owner != NULL);
  294. +    EASSERT(info->owner_group != NULL);
  295. +    EASSERT(info->owner == info->owner_buf);
  296. +    EASSERT(info->owner_group == info->owner_group_buf);
  297. +    EASSERT(strlen(info->owner) > 0);
  298. +    EASSERT(strlen(info->owner_group) > 0);
  299. +
  300. +    /* Make copies as we will modify  them */
  301. +    (void)strcpy(owner, info->owner);
  302. +    (void)strcpy(owner_group, info->owner_group);
  303. +
  304. +    /*
  305. +     * Map owner to local uid
  306. +     *
  307. +     * |owner| can be numeric string ("1616"), plain username
  308. +     *  ("gisburn") or username@domain ("gisburn@sun.com")
  309. +     */
  310. +    /* stomp over '@' */
  311. +    at_ch = strchr(owner, '@');
  312. +    if (at_ch)
  313. +        *at_ch = '\0';
  314. +
  315. +    if (nfs41_idmap_name_to_uid(
  316. +        nfs41dg->idmapper,
  317. +        owner,
  318. +        &map_uid) == 0) {
  319. +         *owner_local_uid = map_uid;
  320. +    }
  321. +    else {
  322. +        *owner_local_uid = NFS_USER_NOBODY_UID;
  323. +        eprintf("open_get_localuidgid('%s'): "
  324. +            "no username mapping for '%s', fake uid=%u\n",
  325. +            state->path.path,
  326. +            owner,
  327. +            (unsigned int)*owner_local_uid);
  328. +    }
  329. +
  330. +    /*
  331. +     * Map owner_group to local gid
  332. +     *
  333. +     * |owner_group| can be numeric string ("1616"), plain username
  334. +     * ("gisgrp") or username@domain ("gisgrp@sun.com")
  335. +     */
  336. +    /* stomp over '@' */
  337. +    at_ch = strchr(owner_group, '@');
  338. +    if (at_ch)
  339. +        *at_ch = '\0';
  340. +
  341. +    if (nfs41_idmap_group_to_gid(
  342. +        nfs41dg->idmapper,
  343. +        owner_group,
  344. +        &map_gid) == 0) {
  345. +        *owner_group_local_gid = map_gid;
  346. +    }
  347. +    else {
  348. +        *owner_group_local_gid = NFS_GROUP_NOGROUP_GID;
  349. +        eprintf("open_get_localuidgid('%s'): "
  350. +            "no group mapping for '%s', fake gid=%u\n",
  351. +            state->path.path,
  352. +            owner_group,
  353. +            (unsigned int)*owner_group_local_gid);
  354. +    }
  355. +
  356. +out:
  357. +    DPRINTF(1,
  358. +        ("open_get_localuidgid('%s'): "
  359. +        "stat: owner=%u/'%s', owner_group=%u/'%s'\n",
  360. +        state->path.path,
  361. +        (unsigned int)*owner_local_uid, owner,
  362. +        (unsigned int)*owner_group_local_gid,
  363. +        owner_group));
  364. +}
  365. +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
  366. +
  367.  static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  368.  {
  369.      int status = 0;
  370. @@ -911,114 +1039,10 @@ static int handle_open(void *daemon_context, nfs41_upcall *upcall)
  371.          args->mode = info.mode;
  372.          EASSERT(bitmap_isset(&info.attrmask, 0, FATTR4_WORD0_CHANGE));
  373.          args->changeattr = info.change;
  374. -
  375. -#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
  376. -        char owner[NFS4_FATTR4_OWNER_LIMIT+1];
  377. -        char owner_group[NFS4_FATTR4_OWNER_LIMIT+1];
  378. -        uid_t map_uid = ~0UL;
  379. -        gid_t map_gid = ~0UL;
  380. -        char *at_ch; /* pointer to '@' */
  381. -
  382. -#if 1
  383. -        /* this should only happen for newly created files/dirs */
  384. -        if (((info.attrmask.arr[1] & FATTR4_WORD1_OWNER) == 0) ||
  385. -            ((info.attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) == 0)) {
  386. -            bitmap4 og_attr_request;
  387. -            nfs41_file_info og_info = { 0 };
  388. -
  389. -            og_attr_request.count = 2;
  390. -            og_attr_request.arr[0] = 0;
  391. -            og_attr_request.arr[1] =
  392. -                FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP;
  393. -            og_info.owner = og_info.owner_buf;
  394. -            og_info.owner_group = og_info.owner_group_buf;
  395. -            status = nfs41_getattr(state->session, &state->file,
  396. -                &og_attr_request, &og_info);
  397. -            if (status) {
  398. -                eprintf("get_stat_data: nfs41_getattr('%s') "
  399. -                    "failed with %d\n",
  400. -                    state->path.path,
  401. -                    status);
  402. -                goto out_free_state;
  403. -            }
  404. -
  405. -            info.owner = info.owner_buf;
  406. -            (void)strcpy(info.owner, og_info.owner);
  407. -            info.attrmask.arr[1] |= FATTR4_WORD1_OWNER;
  408. -            info.owner_group = info.owner_group_buf;
  409. -            (void)strcpy(info.owner_group, og_info.owner_group);
  410. -            info.attrmask.arr[1] |= FATTR4_WORD1_OWNER_GROUP;
  411. -        }
  412. -#endif
  413. -
  414. -        EASSERT((info.attrmask.arr[1] & FATTR4_WORD1_OWNER) != 0);
  415. -        EASSERT((info.attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) != 0);
  416. -        EASSERT(info.owner != NULL);
  417. -        EASSERT(info.owner_group != NULL);
  418. -        EASSERT(info.owner == info.owner_buf);
  419. -        EASSERT(info.owner_group == info.owner_group_buf);
  420. -        EASSERT(strlen(info.owner) > 0);
  421. -        EASSERT(strlen(info.owner_group) > 0);
  422. -
  423. -        /* Make copies as we will modify  them */
  424. -        (void)strcpy(owner, info.owner);
  425. -        (void)strcpy(owner_group, info.owner_group);
  426. -
  427.          /*
  428. -         * Map owner to local uid
  429. -         *
  430. -         * |owner| can be numeric string ("1616"), plain username
  431. -         *  ("gisburn") or username@domain ("gisburn@sun.com")
  432. +         + |args->owner_local_uid| and |args->owner_group_local_gid|
  433. +         * is set below
  434.           */
  435. -        /* stomp over '@' */
  436. -        at_ch = strchr(owner, '@');
  437. -        if (at_ch)
  438. -            *at_ch = '\0';
  439. -
  440. -        if (nfs41_idmap_name_to_uid(
  441. -            nfs41dg->idmapper,
  442. -            owner,
  443. -            &map_uid) == 0) {
  444. -             args->owner_local_uid = map_uid;
  445. -        }
  446. -        else {
  447. -            args->owner_local_uid = NFS_USER_NOBODY_UID;
  448. -            eprintf("get_stat_data('%s'): "
  449. -                "no username mapping for '%s', fake uid=%d\n",
  450. -                state->path.path,
  451. -                owner, args->owner_local_uid);
  452. -        }
  453. -
  454. -        /*
  455. -         * Map owner_group to local gid
  456. -         *
  457. -         * |owner_group| can be numeric string ("1616"), plain username
  458. -         * ("gisgrp") or username@domain ("gisgrp@sun.com")
  459. -         */
  460. -        /* stomp over '@' */
  461. -        at_ch = strchr(owner_group, '@');
  462. -        if (at_ch)
  463. -            *at_ch = '\0';
  464. -
  465. -        if (nfs41_idmap_group_to_gid(
  466. -            nfs41dg->idmapper,
  467. -            owner_group,
  468. -            &map_gid) == 0) {
  469. -            args->owner_group_local_gid = map_gid;
  470. -        }
  471. -        else {
  472. -            args->owner_group_local_gid = NFS_GROUP_NOGROUP_GID;
  473. -            eprintf("get_stat_data('%s'): "
  474. -                "no group mapping for '%s', fake gid=%d\n",
  475. -                state->path.path,
  476. -                owner_group, args->owner_group_local_gid);
  477. -        }
  478. -
  479. -        DPRINTF(1, ("handle_open('%s'): stat: owner=%u/'%s', owner_group=%u/'%s'\n",
  480. -            state->path.path,
  481. -            (unsigned int)args->owner_local_uid, owner,
  482. -            (unsigned int)args->owner_group_local_gid, owner_group));
  483. -#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
  484.      } else {
  485.          nfs41_file_info createattrs;
  486.          uint32_t create = 0, createhowmode = 0, lookup_status = status;
  487. @@ -1167,6 +1191,16 @@ create_chgrp_out:
  488.          }
  489.      }
  490.  
  491. +#ifdef NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES
  492. +    if (status == 0) {
  493. +        open_get_localuidgid(nfs41dg,
  494. +            state,
  495. +            &info,
  496. +            &args->owner_local_uid,
  497. +            &args->owner_group_local_gid);
  498. +    }
  499. +#endif /* NFS41_DRIVER_FEATURE_LOCAL_UIDGID_IN_NFSV3ATTRIBUTES */
  500. +
  501.  #ifdef DEBUG_OPEN_SPARSE_FILES
  502.      if ((status == 0) &&
  503.          (info.type == NF4REG) &&
  504. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  505. index d9291c0..8f0fbdd 100644
  506. --- a/tests/manual_testing.txt
  507. +++ b/tests/manual_testing.txt
  508. @@ -196,6 +196,21 @@ $ rm -f d1 d2 d1.diff ; printf '1\n2\n' >d1 ; cp d1 d2 ; printf '3\n' >> d2 ; di
  509.  The test should print "# test OK"
  510.  
  511.  
  512. +#
  513. +# Tests for Cycgwin/UWIN/SFU Nfs3Attr EA-based local uid/gid
  514. +#
  515. +# ToDO:
  516. +# - iterate over multiple groups via newgrp(1)/winsg(1)
  517. +# - iterate with bash/ksh93 (because it changes the pipeline process ordering)
  518. +#
  519. +
  520. +# create file, and the uid/gid fro Nfs3Attr EA must match /bin/id -u+/bin/id -g
  521. +# output should highlight uid=/gid= in colour
  522. +---- snip ----
  523. +ksh93 -c 'rm -f test1.txt ; command exec {n}>>test1.txt ; printf "fd=%d\n" $n ; printf "x" >&$n ; command exec {n}<&- ; /bin/winfsinfo nfs3attr test1.txt | egrep --colour "(uid=$(id -u)|gid=$(id -g))" ; true'
  524. +---- snip ----
  525. +
  526. +
  527.  #
  528.  # Test for native mklink  && powershell New-Item -ItemType SymbolicLink
  529.  #
  530. --
  531. 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