pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patch for cygwin binary tarball dist+misc 2023-12-12
Posted by Anonymous on Tue 12th Dec 2023 16:21
raw | new post

  1. From b8c2f085d6f7c95573c9075b6e3bd1ca909cd087 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Mon, 11 Dec 2023 00:16:29 +0100
  4. Subject: [PATCH 1/8] cygwin/Makefile: Add Makefile target for Cygwin binary
  5.  release tarball
  6.  
  7. Add Makefile target bintarball to create a binary release tarball which
  8. can be unpacked into a Cygwin installation.
  9.  
  10. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  11. ---
  12. cygwin/Makefile | 33 ++++++++++++++++++++++++++-------
  13.  1 file changed, 26 insertions(+), 7 deletions(-)
  14.  
  15. diff --git a/cygwin/Makefile b/cygwin/Makefile
  16. index b7a3b1e..e423d6f 100644
  17. --- a/cygwin/Makefile
  18. +++ b/cygwin/Makefile
  19. @@ -57,7 +57,12 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  20.         fi
  21.         mkdir -p $(DESTDIR)
  22.         mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/sbin/
  23. -       mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/usr/bin
  24. +       # /usr/bin is a bind mount to C:/cygwin64/bin, so copy binaries to /cygdrive/c/cygwin64/bin
  25. +       mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/bin
  26. +       # /usr/lib is a bind mount to C:/cygwin64/lib, so copy library data to /cygdrive/c/cygwin64/lib
  27. +       mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/lib
  28. +       mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client
  29. +       mkdir -p $(DESTDIR)/cygdrive/c/cygwin64/src/msnfs41client
  30.         cp -r $(VS_BUILD_DIR)/nfsd.exe          $(DESTDIR)/cygdrive/c/cygwin64/sbin/nfsd_debug.exe
  31.         cp -r $(VS_BUILD_DIR)/nfsd.pdb          $(DESTDIR)/cygdrive/c/cygwin64/sbin/nfsd_debug.pdb
  32.         cp -r $(VS_BUILD_DIR)/nfs_mount.*       $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  33. @@ -68,17 +73,23 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  34.         cp -r $(VS_BUILD_DIR)/libtirpc.*        $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  35.         cp $(PROJECT_BASEDIR_DIR)/nfs41rdr.inf  $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  36.         cp $(PROJECT_BASEDIR_DIR)/etc_netconfig $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  37. -       cp $(PROJECT_BASEDIR_DIR)/ms-nfs41-idmap.conf $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  38. -       cp $(CYGWIN_MAKEFILE_DIR)/devel/msnfs41client.bash $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  39. +       cp $(PROJECT_BASEDIR_DIR)/ms-nfs41-idmap.conf           $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  40. +       cp $(CYGWIN_MAKEFILE_DIR)/devel/msnfs41client.bash      $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  41. +       cp $(PROJECT_BASEDIR_DIR)/cygwin_idmapper.ksh           $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  42. +       @ printf "# Package sources and diffs\n"
  43. +       git bundle create "$(DESTDIR)/cygdrive/c/cygwin64/src/msnfs41client/msnfs41client_git.bundle" HEAD
  44. +       git diff -w     >"$(DESTDIR)/cygdrive/c/cygwin64/src/msnfs41client/msnfs41client_diff_w.diff"
  45. +       git diff        >"$(DESTDIR)/cygdrive/c/cygwin64/src/msnfs41client/msnfs41client_diff.diff"
  46. +       @ printf "# Package utilties\n"
  47.         cp $(CYGWIN_MAKEFILE_DIR)/utils/mount_sshnfs/mount_sshnfs.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/mount_sshnfs
  48.         chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/mount_sshnfs
  49.         cp $(CYGWIN_MAKEFILE_DIR)/utils/sshnfs/sshnfs.ksh $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs
  50.         chmod a+x $(DESTDIR)/cygdrive/c/cygwin64/sbin/sshnfs
  51.         @ printf "# Package tests\n"
  52. -       cp tests/winfsinfo1/winfsinfo.exe $(DESTDIR)/cygdrive/c/cygwin64/usr/bin/winfsinfo.exe
  53. +       cp tests/winfsinfo1/winfsinfo.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/winfsinfo.exe
  54.         @ printf "# Package ksh93&co (if available) since Cygwin does not ship with it yet\n"
  55. -       [[ -x /usr/bin/ksh93.exe ]] && cp /usr/bin/ksh93.exe $(DESTDIR)/cygdrive/c/cygwin64/usr/bin/ksh93.exe
  56. -       [[ -x /usr/bin/shcomp.exe ]] && cp /usr/bin/shcomp.exe $(DESTDIR)/cygdrive/c/cygwin64/usr/bin/shcomp.exe
  57. +       [[ -x /usr/bin/ksh93.exe ]] && cp /usr/bin/ksh93.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/ksh93.exe
  58. +       [[ -x /usr/bin/shcomp.exe ]] && cp /usr/bin/shcomp.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/shcomp.exe
  59.         @ printf "# Set file flags\n"
  60.         (cd $(DESTDIR)/cygdrive/c/cygwin64/sbin/ ; chmod a+x *.exe *.dll *.sys *.bash)
  61.         @printf "\n#\n# TEST sbin dir is %s\n#\n" "$(DESTDIR)/cygdrive/c/cygwin64/sbin/"
  62. @@ -86,6 +97,14 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  63.         @printf "\n#\n# Now use\n# $$ cd '%s' && bash ./msnfs41client.bash install #\n# to install the kernel driver as Admin\n#\n" \
  64.                 "$(DESTDIR)/cygdrive/c/cygwin64/sbin/"
  65.  
  66. +bintarball: installdest
  67. +       (cd destdir && \
  68. +       tar -cvf - \
  69. +               --owner=SYSTEM \
  70. +               --group=SYSTEM \
  71. +               cygdrive/c/cygwin64 | \
  72. +                       bzip2 -9 >msnfs41client_cygwin_binaries.tar.bz2)
  73. +
  74.  #
  75.  # clean destdir/, but only if nfsd*.exe does not use it right now
  76.  #
  77. @@ -94,6 +113,6 @@ cleandest:
  78.                 printf 'DIR %q is in use by a process\n' "$DESTDIR" 1>&2 ; \
  79.                 exit 1 ; \
  80.         fi
  81. -       rm -r "$(DESTDIR)"
  82. +       rm -rvf "$(DESTDIR)"
  83.  
  84.  # EOF.
  85. --
  86. 2.42.1
  87.  
  88. From 906ccbd3899217736ba398abacb6c684c7ce1b37 Mon Sep 17 00:00:00 2001
  89. From: Roland Mainz <roland.mainz@nrubsig.org>
  90. Date: Mon, 11 Dec 2023 00:22:50 +0100
  91. Subject: [PATCH 2/8] daemon: Fix Cygwin idmapper script path
  92.  
  93. Set Cygwin idmapper script patch to
  94. /cygdrive/c/cygwin64/lib/msnfs41client/cygwin_idmapper.ksh
  95.  
  96. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  97. ---
  98. daemon/idmap_cygwin.c | 2 +-
  99.  1 file changed, 1 insertion(+), 1 deletion(-)
  100.  
  101. diff --git a/daemon/idmap_cygwin.c b/daemon/idmap_cygwin.c
  102. index 64c1bff..f8bb74e 100644
  103. --- a/daemon/idmap_cygwin.c
  104. +++ b/daemon/idmap_cygwin.c
  105. @@ -40,7 +40,7 @@
  106.  
  107.  #define CYGWIN_IDMAPPER_SCRIPT \
  108.      ("C:\\cygwin64\\bin\\ksh93.exe " \
  109. -    "/home/roland_mainz/work/msnfs41_uidmapping/ms-nfs41-client/cygwin_idmapper.ksh")
  110. +    "/cygdrive/c/cygwin64/lib/msnfs41client/cygwin_idmapper.ksh")
  111.  
  112.  
  113.  #ifdef NFS41_DRIVER_FEATURE_NAMESERVICE_CYGWIN
  114. --
  115. 2.42.1
  116.  
  117. From 044535a00a1e38fc0d7b900c5abd3a6496345cd6 Mon Sep 17 00:00:00 2001
  118. From: Roland Mainz <roland.mainz@nrubsig.org>
  119. Date: Mon, 11 Dec 2023 00:30:04 +0100
  120. Subject: [PATCH 3/8] mount_sshnfs: PATH+='/sbin:...' as Cygwin has
  121.  nfs_mount.exe in /sbin
  122.  
  123. Add PATH+=':/sbin:/usr/sbin:/usr/bin:/bin' because Cygwin binary
  124. tarball installs nfs_mount.exe in /sbin
  125.  
  126. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  127. ---
  128. cygwin/utils/mount_sshnfs/mount_sshnfs.ksh | 10 +++++-----
  129.  1 file changed, 5 insertions(+), 5 deletions(-)
  130.  
  131. diff --git a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  132. index 9b5c76e..4193d56 100755
  133. --- a/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  134. +++ b/cygwin/utils/mount_sshnfs/mount_sshnfs.ksh
  135. @@ -312,7 +312,7 @@ function cmd_mount
  136.  
  137.         # fixme: Need better text layout for $ mount_sshnfs mount --man #
  138.         typeset -r mount_sshnfs_cmdmount_usage=$'+
  139. -       [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2023-07-24 \$\n]
  140. +       [-?\n@(#)\$Id: mount_sshnfs mount (Roland Mainz) 2023-12-08 \$\n]
  141.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  142.         [+NAME?mount_sshnfs mount - mount NFSv4 filesystem through ssh
  143.                 tunnel]
  144. @@ -668,7 +668,7 @@ function cmd_umount
  145.         typeset mydebug=false # fixme: should be "bool" for ksh93v
  146.         # fixme: Need better text layout for $ mount_sshnfs mount --man #
  147.         typeset -r mount_sshnfs_cmdumount_usage=$'+
  148. -       [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2023-07-24 \$\n]
  149. +       [-?\n@(#)\$Id: mount_sshnfs umount (Roland Mainz) 2023-12-08 \$\n]
  150.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  151.         [+NAME?mount_sshnfs umount - unmount NFSv4 filesystem mounted
  152.                 via mount_sshnfs mount]
  153. @@ -772,7 +772,7 @@ function main
  154.  
  155.         # fixme: Need better text layout for $ mount_sshnfs --man #
  156.         typeset -r mount_sshnfs_usage=$'+
  157. -       [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2023-07-24 \$\n]
  158. +       [-?\n@(#)\$Id: mount_sshnfs (Roland Mainz) 2023-12-08 \$\n]
  159.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  160.         [+NAME?mount_sshnfs - mount/umount NFSv4 filesystem via ssh
  161.                 tunnel]
  162. @@ -809,8 +809,8 @@ function main
  163.         if [[ "${ uname -o ;}" == 'Cygwin' ]] ; then
  164.                 integer c.is_ccygwin=1
  165.  
  166. -               # only for testing!!
  167. -               PATH+=':/cygdrive/c/Users/roland_mainz/Downloads/ms-nfs41-client-x64/ms-nfs41-client-x64/'
  168. +               # Cygwin has nfs_mount.exe in /sbin
  169. +               PATH+=':/sbin:/usr/sbin:/usr/bin:/bin'
  170.  
  171.                 typeset c.msnfsv41_nfsmountcmd="$(which 'nfs_mount.exe')"
  172.  
  173. --
  174. 2.42.1
  175.  
  176. From 9111f150ab34453985f00f1b933ebf0abe6e9cf4 Mon Sep 17 00:00:00 2001
  177. From: Roland Mainz <roland.mainz@nrubsig.org>
  178. Date: Mon, 11 Dec 2023 15:11:37 +0100
  179. Subject: [PATCH 4/8] cygwin: Rework binary tarball layout
  180.  
  181. Rework binary tarball layout, so "internal" files are
  182. in /usr/lib/msnfs41client. Also drop *.bash suffix from
  183. /sbin/msnfs41client script, remove obsolete comments,
  184. and make sure it can find its files regardless what $PWD
  185. is.
  186.  
  187. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  188. ---
  189. cygwin/Makefile                 | 25 ++++++++++++++-----------
  190.  cygwin/devel/msnfs41client.bash | 24 ++++++++++++++----------
  191.  2 files changed, 28 insertions(+), 21 deletions(-)
  192.  
  193. diff --git a/cygwin/Makefile b/cygwin/Makefile
  194. index e423d6f..07f84a5 100644
  195. --- a/cygwin/Makefile
  196. +++ b/cygwin/Makefile
  197. @@ -68,13 +68,15 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  198.         cp -r $(VS_BUILD_DIR)/nfs_mount.*       $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  199.         cp -r $(VS_BUILD_DIR)/nfsd.*            $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  200.         cp -r $(VS_BUILD_DIR)/nfs_install.*     $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  201. -       cp -r $(VS_BUILD_DIR)/nfs41_np.*        $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  202. -       cp -r $(VS_BUILD_DIR)/nfs41_driver.*    $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  203.         cp -r $(VS_BUILD_DIR)/libtirpc.*        $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  204. -       cp $(PROJECT_BASEDIR_DIR)/nfs41rdr.inf  $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  205. -       cp $(PROJECT_BASEDIR_DIR)/etc_netconfig $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  206. -       cp $(PROJECT_BASEDIR_DIR)/ms-nfs41-idmap.conf           $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  207. -       cp $(CYGWIN_MAKEFILE_DIR)/devel/msnfs41client.bash      $(DESTDIR)/cygdrive/c/cygwin64/sbin/.
  208. +       cp -r $(VS_BUILD_DIR)/nfs41_np.*        $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  209. +       cp -r $(VS_BUILD_DIR)/nfs41_driver.*    $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  210. +       cp $(PROJECT_BASEDIR_DIR)/nfs41rdr.inf  $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  211. +       cp $(PROJECT_BASEDIR_DIR)/etc_netconfig $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  212. +       cp $(PROJECT_BASEDIR_DIR)/ms-nfs41-idmap.conf           $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  213. +       cp $(CYGWIN_MAKEFILE_DIR)/devel/msnfs41client.bash      $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/msnfs41client
  214. +       chmod a+x "$(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/msnfs41client"
  215. +       (cd "$(DESTDIR)/cygdrive/c/cygwin64/sbin/" && ln -sf ../lib/msnfs41client/msnfs41client .)
  216.         cp $(PROJECT_BASEDIR_DIR)/cygwin_idmapper.ksh           $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/.
  217.         @ printf "# Package sources and diffs\n"
  218.         git bundle create "$(DESTDIR)/cygdrive/c/cygwin64/src/msnfs41client/msnfs41client_git.bundle" HEAD
  219. @@ -91,19 +93,20 @@ installdest: $(VS_BUILD_DIR)/nfsd.exe \
  220.         [[ -x /usr/bin/ksh93.exe ]] && cp /usr/bin/ksh93.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/ksh93.exe
  221.         [[ -x /usr/bin/shcomp.exe ]] && cp /usr/bin/shcomp.exe $(DESTDIR)/cygdrive/c/cygwin64/bin/shcomp.exe
  222.         @ printf "# Set file flags\n"
  223. -       (cd $(DESTDIR)/cygdrive/c/cygwin64/sbin/ ; chmod a+x *.exe *.dll *.sys *.bash)
  224. +       (cd $(DESTDIR)/cygdrive/c/cygwin64/sbin/ && chmod a+x *.exe *.dll)
  225. +       (cd $(DESTDIR)/cygdrive/c/cygwin64/lib/msnfs41client/ && chmod a+x *.dll)
  226.         @printf "\n#\n# TEST sbin dir is %s\n#\n" "$(DESTDIR)/cygdrive/c/cygwin64/sbin/"
  227.         @printf '\n'
  228. -       @printf "\n#\n# Now use\n# $$ cd '%s' && bash ./msnfs41client.bash install #\n# to install the kernel driver as Admin\n#\n" \
  229. +       @printf "\n#\n# Now use\n# $$ cd '%s' && ./msnfs41client install #\n# to install the kernel driver as Admin\n#\n" \
  230.                 "$(DESTDIR)/cygdrive/c/cygwin64/sbin/"
  231.  
  232.  bintarball: installdest
  233.         (cd destdir && \
  234.         tar -cvf - \
  235. -               --owner=SYSTEM \
  236. -               --group=SYSTEM \
  237. +               --owner=SYSTEM:18 \
  238. +               --group=SYSTEM:18 \
  239.                 cygdrive/c/cygwin64 | \
  240. -                       bzip2 -9 >msnfs41client_cygwin_binaries.tar.bz2)
  241. +                       bzip2 -9 >'msnfs41client_cygwin_binaries.tar.bz2')
  242.  
  243.  #
  244.  # clean destdir/, but only if nfsd*.exe does not use it right now
  245. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  246. index a9782bb..9bb2523 100644
  247. --- a/cygwin/devel/msnfs41client.bash
  248. +++ b/cygwin/devel/msnfs41client.bash
  249. @@ -50,6 +50,11 @@ function nfsclient_install
  250.         set -o xtrace
  251.         set -o errexit
  252.  
  253. +       # switch to the location where this script is installed,
  254. +       # because on Cygwin the script will be installed
  255. +       # in /cygdrive/c/cygwin64/lib/msnfs41client/
  256. +       cd -P "$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")"
  257. +
  258.         if ! is_windows_admin_account ; then
  259.                 printf $"%s: Install requires Windows Adminstator permissions.\n" "$0"
  260.                 return 1
  261. @@ -58,7 +63,8 @@ function nfsclient_install
  262.         # make sure all binaries are executable, Windows cmd does
  263.         # not care, but Cygwin&bash do.
  264.         # If *.ddl are not executable nfs*.exe fail with 0xc0000022
  265. -       chmod a+x *.exe *.dll
  266. +       chmod a+x *.dll
  267. +       chmod a+x ../../sbin/nfs*.exe ../../sbin/libtirpc*.dll
  268.  
  269.         if false ; then
  270.                 # install.bat needs PATH to include $PWD
  271. @@ -297,10 +303,6 @@ function nfsclient_mount_homedir
  272.         set -o errexit
  273.  
  274.         #nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home/rmainz'
  275. -       # fixme: Specifying IPv6 addresses do not work yet, as soon as
  276. -       # they come as UNC paths (e.g.
  277. -       # $ cd '//[fe80::219:99ff:feae:73ce]@2049/nfs4/export/home/rmainz' #
  278. -       # they get corrupted once they arrive in nfsd_debug.exe)
  279.         #nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home/rmainz'
  280.         nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6:/export/home/rmainz'
  281.         mkdir -p '/home/rmainz'
  282. @@ -318,10 +320,6 @@ function nfsclient_system_mount_homedir
  283.         su_system net use H: /delete || true
  284.  
  285.         #su_system nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home/rmainz'
  286. -       # fixme: Specifying IPv6 addresses do not work yet, as soon as
  287. -       # they come as UNC paths (e.g.
  288. -       # $ cd '//[fe80::219:99ff:feae:73ce]@2049/nfs4/export/home/rmainz' #
  289. -       # they get corrupted once they arrive in nfsd_debug.exe)
  290.         #su_system nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home/rmainz'
  291.         su_system nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6:/export/home/rmainz'
  292.  
  293. @@ -388,8 +386,13 @@ function main
  294.  {
  295.         typeset cmd="$1"
  296.  
  297. +       # path where this script is installed
  298. +       typeset scriptpath="$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")"
  299. +
  300.         # "$PATH:/usr/bin:/bin" is used for PsExec where $PATH might be empty
  301. -       export PATH="$PWD:$PATH:/usr/bin:/bin"
  302. +       PATH="$PWD:$PATH:${scriptpath}../../usr/bin:${scriptpath}/../../bin:${scriptpath}/../../sbin:${scriptpath}/../../usr/sbin"
  303. +       # add defauft system path for POSIX utilities
  304. +       PATH+=':/sbin:/usr/sbin:/bin:/usr/bin'
  305.  
  306.         # path to WinDBG cdb (fixme: 64bit x86-specific)
  307.         PATH+=':/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/'
  308. @@ -457,6 +460,7 @@ function main
  309.                         ;;
  310.                 'sys_terminal')
  311.                         require_cmd 'mintty.exe' || return 1
  312. +                       require_cmd 'PsExec.exe' || return 1
  313.                         if ! is_windows_admin_account ; then
  314.                                 printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
  315.                                 return 1
  316. --
  317. 2.42.1
  318.  
  319. From 5dfb1ac2806ad8f400e3d1f0831d56a8959f485a Mon Sep 17 00:00:00 2001
  320. From: Roland Mainz <roland.mainz@nrubsig.org>
  321. Date: Mon, 11 Dec 2023 20:52:13 +0100
  322. Subject: [PATCH 5/8] msnfs41client.bash: Moved homedir in demo script
  323.  
  324. Moved homedir in demo script, from server:/export/home/rmainz/
  325. to server:/export/home2/rmainz/ (bigger disk).
  326.  
  327. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  328. ---
  329. cygwin/devel/msnfs41client.bash | 12 ++++++------
  330.  1 file changed, 6 insertions(+), 6 deletions(-)
  331.  
  332. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  333. index 9bb2523..130b508 100644
  334. --- a/cygwin/devel/msnfs41client.bash
  335. +++ b/cygwin/devel/msnfs41client.bash
  336. @@ -302,9 +302,9 @@ function nfsclient_mount_homedir
  337.         set -o nounset
  338.         set -o errexit
  339.  
  340. -       #nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home/rmainz'
  341. -       #nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home/rmainz'
  342. -       nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6:/export/home/rmainz'
  343. +       #nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home2/rmainz'
  344. +       #nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home2/rmainz'
  345. +       nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6:/export/home2/rmainz'
  346.         mkdir -p '/home/rmainz'
  347.         mount -o bind,posix=1 '/cygdrive/h' '/home/rmainz'
  348.         return $?
  349. @@ -319,9 +319,9 @@ function nfsclient_system_mount_homedir
  350.         # purge any leftover persistent mappings to device H:
  351.         su_system net use H: /delete || true
  352.  
  353. -       #su_system nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home/rmainz'
  354. -       #su_system nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home/rmainz'
  355. -       su_system nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6:/export/home/rmainz'
  356. +       #su_system nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home2/rmainz'
  357. +       #su_system nfs_mount -p -o sec=sys H '[fe80::219:99ff:feae:73ce]:/export/home2/rmainz'
  358. +       su_system nfs_mount -p -o sec=sys H 'derfwpc5131_ipv6:/export/home2/rmainz'
  359.  
  360.         return $?
  361.  }
  362. --
  363. 2.42.1
  364.  
  365. From 088f6b7f557d7fe5ad71205e313540e056d5e874 Mon Sep 17 00:00:00 2001
  366. From: Roland Mainz <roland.mainz@nrubsig.org>
  367. Date: Mon, 11 Dec 2023 21:02:27 +0100
  368. Subject: [PATCH 6/8] libtirpc: Use DEBUG |syslog()| to track socket
  369.  |close()|&co
  370.  
  371. Use DEBUG |syslog()| to track |close()|/|closesocket()| calls
  372. to see whether we leak socket (fds).
  373.  
  374. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  375. ---
  376. libtirpc/src/wintirpc.c | 4 ++++
  377.  1 file changed, 4 insertions(+)
  378.  
  379. diff --git a/libtirpc/src/wintirpc.c b/libtirpc/src/wintirpc.c
  380. index cc8266c..dba1873 100644
  381. --- a/libtirpc/src/wintirpc.c
  382. +++ b/libtirpc/src/wintirpc.c
  383. @@ -278,6 +278,8 @@ int wintirpc_closesocket(int in_fd)
  384.  {
  385.         SOCKET s = _get_osfhandle(in_fd);
  386.  
  387. +       (void)syslog(LOG_DEBUG, "wintirpc_closesocket(in_fd=%d)", in_fd);
  388. +
  389.         wintirpc_unregister_osfhandle(s);
  390.  
  391.         return closesocket(s);
  392. @@ -285,6 +287,8 @@ int wintirpc_closesocket(int in_fd)
  393.  
  394.  int wintirpc_close(int in_fd)
  395.  {
  396. +       (void)syslog(LOG_DEBUG, "wintirpc_close(in_fd=%d)", in_fd);
  397. +
  398.         wintirpc_unregister_osf_fd(in_fd);
  399.  
  400.         return _close(in_fd);
  401. --
  402. 2.42.1
  403.  
  404. From 3a1cc1a9fed95a41db32b627443adcc8a029ff37 Mon Sep 17 00:00:00 2001
  405. From: Roland Mainz <roland.mainz@nrubsig.org>
  406. Date: Tue, 12 Dec 2023 16:02:28 +0100
  407. Subject: [PATCH 7/8] idmapper: cygwin idmapper should source getent
  408.  passwd/group for data
  409.  
  410. idmapper: Cygwin idmapper script cygwin_idmapper.ksh should use
  411. getent passwd $name / getent group $name for account data if no
  412. static information is stored in the script.
  413.  
  414. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  415. ---
  416. cygwin_idmapper.ksh | 76 +++++++++++++++++++++++++++++++++------------
  417.  1 file changed, 57 insertions(+), 19 deletions(-)
  418.  
  419. diff --git a/cygwin_idmapper.ksh b/cygwin_idmapper.ksh
  420. index acf6e32..55251b9 100644
  421. --- a/cygwin_idmapper.ksh
  422. +++ b/cygwin_idmapper.ksh
  423. @@ -4,13 +4,13 @@ set -o nounset
  424.  typeset IFS=''
  425.  
  426.  #
  427. -# global variables
  428. +# global variables for this script
  429.  # (stored in compound variable so we
  430.  # can do a $ print -u2 -v c # for debugging)
  431.  #
  432.  compound c=(
  433. -        mode="$1"
  434. -        name="$2"
  435. +       mode="$1"
  436. +       name="$2"
  437.  )
  438.  
  439.  compound -A localusers=(
  440. @@ -53,33 +53,32 @@ compound -A localusers=(
  441.  
  442.  compound -A localgroups=(
  443.         ["Kein"]=(
  444. -               localaccoutname='Kein'
  445. +               localgroupname='Kein'
  446.                 localgid=197121
  447.         )
  448.         ["rmainz"]=(
  449. -               localaccoutname='rmainz'
  450. -               localuid=1616
  451. +               localgroupname='rmainz'
  452.                 localgid=1616
  453.         )
  454.         ["swulsch"]=(
  455. -               localaccoutname='swulsch'
  456. -               localuid=1818
  457. +               localgroupname='swulsch'
  458.                 localgid=1818
  459.         )
  460.         ["root"]=(
  461. -               localaccoutname='root'
  462. -               localuid=0
  463. +               localgroupname='root'
  464.                 localgid=0
  465.         )
  466.         ["nogroup"]=(
  467. -               localaccoutname='nogroup'
  468. -               localuid=65534
  469. +               localgroupname='nogroup'
  470.                 localgid=65534
  471.         )
  472.  )
  473.  
  474.  case "${c.mode}" in
  475.         'nfsserver_owner2localaccount')
  476. +               #
  477. +               # Try static info
  478. +               #
  479.                 if [[ "${c.name}" == ~(Elr)[[:digit:]]+ ]] ; then
  480.                         for s in "${!localusers[@]}" ; do
  481.                                 if (( localusers[$s].localuid == c.name )) ; then
  482. @@ -87,17 +86,38 @@ case "${c.mode}" in
  483.                                         exit 0
  484.                                 fi
  485.                         done
  486. +                       # getent passwd accepts numeric uids too, so continue below
  487.                 fi
  488.  
  489.                 if [[ -v localusers["${c.name}"] ]] ; then
  490.                         print -v localusers["${c.name}"]
  491.                         exit 0
  492. -               else
  493. -                       print -u2 -f "cygwin_idmapper.ksh: Account '%s' not found.\n" "${c.name}"
  494. -                       exit 1
  495.                 fi
  496. +
  497. +               #
  498. +               # try getent passwd
  499. +               #
  500. +               compound gec # getent compound var
  501. +               typeset dummy1 dummy2
  502. +               getent passwd "${c.name}" | \
  503. +                       IFS=':' read gec.localaccountname dummy1 gec.localuid gec.localgid dummy2
  504. +
  505. +               if [[ "${gec.localaccountname-}" != '' ]] ; then
  506. +                       if [[ "${gec.localuid-}" == ~(Elr)[[:digit:]]+ && "${gec.localgid-}" == ~(Elr)[[:digit:]]+ ]] ; then
  507. +                               print -v gec
  508. +                               exit 0
  509. +                       else
  510. +                               print -u2 -f "cygwin_idmapper.ksh: getent passwd %q returned garbage.\n" "${c.name}"
  511. +                       fi
  512. +               fi
  513. +
  514. +               print -u2 -f "cygwin_idmapper.ksh: Account '%q' not found.\n" "${c.name}"
  515. +               exit 1
  516.                 ;;
  517.         'nfsserver_owner_group2localgroup')
  518. +               #
  519. +               # Try static info
  520. +               #
  521.                 if [[ "${c.name}" == ~(Elr)[[:digit:]]+ ]] ; then
  522.                         for s in "${!localgroups[@]}" ; do
  523.                                 if (( localgroups[$s].localgid == c.name )) ; then
  524. @@ -105,18 +125,36 @@ case "${c.mode}" in
  525.                                         exit 0
  526.                                 fi
  527.                         done
  528. +                       # getent group accepts numeric gids too, so continue below
  529.                 fi
  530.  
  531.                 if [[ -v localgroups["${c.name}"] ]] ; then
  532.                         print -v localgroups["${c.name}"]
  533.                         exit 0
  534. -               else
  535. -                       print -u2 -f "cygwin_idmapper.ksh: Account '%s' not found.\n" "${c.name}"
  536. -                       exit 1
  537.                 fi
  538. +
  539. +               #
  540. +               # try getent group
  541. +               #
  542. +               compound gec # getent compound var
  543. +               typeset dummy1 dummy2
  544. +               getent group "${c.name}" | \
  545. +                       IFS=':' read gec.localgroupname dummy1 gec.localgid dummy2
  546. +
  547. +               if [[ "${gec.localgroupname-}" != '' ]] ; then
  548. +                       if [[ "${gec.localgid-}" == ~(Elr)[[:digit:]]+ ]] ; then
  549. +                               print -v gec
  550. +                               exit 0
  551. +                       else
  552. +                               print -u2 -f "cygwin_idmapper.ksh: getent group %q returned garbage.\n" "${c.name}"
  553. +                       fi
  554. +               fi
  555. +
  556. +               print -u2 -f "cygwin_idmapper.ksh: Group '%q' not found.\n" "${c.name}"
  557. +               exit 1
  558.                 ;;
  559.         *)
  560. -               print -u2 "cygwin_idmapper.ksh: Unknown mode"
  561. +               print -u2 "cygwin_idmapper.ksh: Unknown mode %q." "${c.mode}"
  562.                 exit 1
  563.                 ;;
  564.  esac
  565. --
  566. 2.42.1
  567.  
  568. From 257904c4a73e762b01cbe93a7f2313495bc0366e Mon Sep 17 00:00:00 2001
  569. From: Roland Mainz <roland.mainz@nrubsig.org>
  570. Date: Tue, 12 Dec 2023 16:14:43 +0100
  571. Subject: [PATCH 8/8] Cygwin binary tarball filename should have timestamp+git
  572.  commit id
  573.  
  574. The filename of the binary tarball for Cygwin should have a timestamp
  575. and commit id, to avoid confusion which version is being deployed and
  576. tested.
  577.  
  578. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  579. ---
  580. cygwin/Makefile | 2 +-
  581.  1 file changed, 1 insertion(+), 1 deletion(-)
  582.  
  583. diff --git a/cygwin/Makefile b/cygwin/Makefile
  584. index 07f84a5..28c03e9 100644
  585. --- a/cygwin/Makefile
  586. +++ b/cygwin/Makefile
  587. @@ -106,7 +106,7 @@ bintarball: installdest
  588.                 --owner=SYSTEM:18 \
  589.                 --group=SYSTEM:18 \
  590.                 cygdrive/c/cygwin64 | \
  591. -                       bzip2 -9 >'msnfs41client_cygwin_binaries.tar.bz2')
  592. +                       bzip2 -9 >"msnfs41client_cygwin_binaries_git$$(git rev-parse --short HEAD)_$$(date +%Y%m%d_%Hh%Mm).tar.bz2")
  593.  
  594.  #
  595.  # clean destdir/, but only if nfsd*.exe does not use it right now
  596. --
  597. 2.42.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