diff -urN --exclude=CVS ../../sysutils/open-vm-tools/Makefile ./Makefile --- ../../sysutils/open-vm-tools/Makefile 2015-06-13 15:13:33.000000000 +0900 +++ ./Makefile 2015-06-13 11:37:47.000000000 +0900 @@ -1,8 +1,7 @@ # $NetBSD: Makefile,v 1.51 2015/04/25 14:24:54 tnn Exp $ -DISTNAME= open-vm-tools-2008.08.08-109361 -PKGNAME= open-vm-tools-2008.08.08.109361 -PKGREVISION= 40 +DISTNAME= open-vm-tools-9.10.0-2476743 +PKGNAME= open-vm-tools-9.10.0.2476743 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=open-vm-tools/} @@ -17,6 +16,8 @@ USE_LIBTOOL= yes USE_TOOLS+= pkg-config autoconf automake +# only for debug +MAKE_JOBS_SAFE= no PLIST_SRC= PLIST.common CONFIGURE_ARGS+= --disable-unity @@ -32,6 +33,15 @@ CONF_FILES_PERMS+= ${EGDIR}/tools.conf ${PKG_SYSCONFDIR}/tools.conf ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755 RCD_SCRIPTS= vmtools +SUBST_CLASSES+= bsd +SUBST_MESSAGE.bsd= Add NetBSD next to FreeBSD +SUBST_STAGE.bsd= post-patch +SUBST_SED.bsd= -e 's/ defined(__FreeBSD__)/ defined(__FreeBSD__) || defined(__NetBSD__)/' +SUBST_SED.bsd+= -e 's/ defined __FreeBSD__/ ( defined __FreeBSD__ || defined __NetBSD__ )/' +SUBST_SED.bsd+= -e 's/ifdef __FreeBSD__/if (defined __FreeBSD__ || defined __NetBSD__ )/' +SUBST_SED.bsd+= -e 's/ !defined(__FreeBSD__)/ ( !defined(__FreeBSD__) || !defined(__NetBSD__) )/' +.include "Makefile.subst" + pre-configure: cd ${WRKSRC} && autoreconf -f @@ -41,9 +51,14 @@ CWRAPPERS_APPEND.cc+= -Wno-error=unused-local-typedef .endif +.include "../../wip/libmspack/buildlink3.mk" +.include "../../x11/gtkmm/buildlink3.mk" +.include "../../graphics/gdk-pixbuf2-xlib/buildlink3.mk" .include "../../net/libdnet/buildlink3.mk" .include "../../security/openssl/buildlink3.mk" +.include "../../security/xml-security-c/buildlink3.mk" .include "../../textproc/icu/buildlink3.mk" +.include "../../textproc/xerces-c/buildlink3.mk" .include "options.mk" diff -urN --exclude=CVS ../../sysutils/open-vm-tools/Makefile.subst ./Makefile.subst --- ../../sysutils/open-vm-tools/Makefile.subst 1970-01-01 09:00:00.000000000 +0900 +++ ./Makefile.subst 2015-06-13 11:41:22.000000000 +0900 @@ -0,0 +1,76 @@ +# -*- Makefile -*- +SUBST_FILES.bsd= \ + hgfsmounter/hgfsmounter.c \ + lib/auth/authPosix.c \ + lib/dynxdr/dynxdr.c \ + lib/file/file.c \ + lib/file/fileIO.c \ + lib/file/fileIOPosix.c \ + lib/file/fileLockPosix.c \ + lib/file/filePosix.c \ + lib/file/fileTempPosix.c \ + lib/hgfs/hgfsEscape.c \ + lib/hgfsHelper/hgfsHelperPosix.c \ + lib/hgfsServer/hgfsServerLinux.c \ + lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c \ + lib/include/bsdfmt.h \ + lib/include/codeset.h \ + lib/include/cpName.h \ + lib/include/cpNameLite.h \ + lib/include/escBitvector.h \ + lib/include/file.h \ + lib/include/fileIO.h \ + lib/include/hgfsUtil.h \ + lib/include/iovector.h \ + lib/include/memaligned.h \ + lib/include/mntinfo.h \ + lib/include/posix.h \ + lib/include/sigPosixRegs.h \ + lib/include/su.h \ + lib/include/util.h \ + lib/include/vm_atomic.h \ + lib/include/vm_basic_defs.h \ + lib/include/vm_basic_types.h \ + lib/include/vm_product.h \ + lib/include/vmblock.h \ + lib/include/vmblock_user.h \ + lib/include/vmxrpc.h \ + lib/lock/ulSema.c \ + lib/misc/codesetOld.c \ + lib/misc/hostinfoPosix.c \ + lib/misc/idLinux.c \ + lib/misc/msgfmt.c \ + lib/misc/posixPosix.c \ + lib/misc/posixPwd.c \ + lib/misc/sha1.c \ + lib/misc/strutil.c \ + lib/misc/util_misc.c \ + lib/netUtil/netUtilLinux.c \ + lib/nicInfo/nicInfoInt.h \ + lib/nicInfo/nicInfoPosix.c \ + lib/procMgr/procMgrPosix.c \ + lib/string/bsd_output_shared.c \ + lib/string/bsd_vsnprintf.c \ + lib/string/bsd_vsnwprintf.c \ + lib/system/systemLinux.c \ + lib/unicode/unicodeSimpleTypes.c \ + lib/wiper/wiperPosix.c \ + modules/freebsd/vmxnet/if_vxn.c \ + modules/linux/shared/kernelStubs.h \ + modules/shared/vmblock/block.c \ + modules/shared/vmblock/stubs.c \ + modules/shared/vmmemctl/balloonInt.h \ + modules/shared/vmmemctl/kernelStubs.h \ + modules/solaris/vmhgfs/kernelStubs.h \ + rpctool/rpctool.c \ + services/plugins/dndcp/dnd/dndLinux.c \ + services/plugins/vix/foundryToolsDaemon.c \ + services/plugins/vix/vixTools.c \ + services/plugins/vix/vixToolsEnvVars.c \ + services/plugins/vix/vixToolsInt.h \ + tests/testVmblock/vmblocktest.c \ + vgauth/lib/impersonateLinux.c \ + vgauth/public/VGAuthError.h \ + vgauth/service/servicePosix.c \ + vmblockmounter/vmblockmounter.c \ + vmware-user-suid-wrapper/main.c diff -urN --exclude=CVS ../../sysutils/open-vm-tools/PLIST ./PLIST --- ../../sysutils/open-vm-tools/PLIST 1970-01-01 09:00:00.000000000 +0900 +++ ./PLIST 2015-06-12 23:11:55.000000000 +0900 @@ -0,0 +1 @@ +@comment $NetBSD$ diff -urN --exclude=CVS ../../sysutils/open-vm-tools/TODO ./TODO --- ../../sysutils/open-vm-tools/TODO 1970-01-01 09:00:00.000000000 +0900 +++ ./TODO 2015-06-13 11:38:24.000000000 +0900 @@ -0,0 +1,5 @@ +===> Creating toolchain wrappers for open-vm-tools-9.10.0.2476743 +=> Add NetBSD next to FreeBSD +INFO: [subst.mk:bsd] Nothing changed in ./lib/string/str.c. +INFO: [subst.mk:bsd] Nothing changed in ./modules/freebsd/vmxnet/if_vxn.c. + diff -urN --exclude=CVS ../../sysutils/open-vm-tools/distinfo ./distinfo --- ../../sysutils/open-vm-tools/distinfo 2013-12-20 14:37:02.000000000 +0900 +++ ./distinfo 2015-06-13 11:41:41.000000000 +0900 @@ -1,70 +1,14 @@ $NetBSD: distinfo,v 1.8 2013/11/11 16:42:38 joerg Exp $ -SHA1 (open-vm-tools-2008.08.08-109361.tar.gz) = 1c44c3524cd9cbc5870f1c6065b03a6b31859a25 -RMD160 (open-vm-tools-2008.08.08-109361.tar.gz) = 4ea0a6aa2edda2bc404c865dc5b58f3a177ae411 -Size (open-vm-tools-2008.08.08-109361.tar.gz) = 2971141 bytes -SHA1 (patch-ac) = 141db2136d1068408ca3470e11d35233f936a11c -SHA1 (patch-ad) = 4ec9292667918c23ef182ae05d5f8417d9af7673 -SHA1 (patch-ae) = 785a5d5d27ce6f8281caa56a27f90a3b200ac082 -SHA1 (patch-af) = 7ead621ec1b8987e64ceaa73909c74927e50330f -SHA1 (patch-ag) = 6d5d462934942ec8b7439e2e51d179e627833111 -SHA1 (patch-ah) = 18577d28bea81a036495d3f86b4713b8a1003fdc -SHA1 (patch-ai) = 59cdf9ae813aa9ac0cf5920e19cbfd23b720b50b -SHA1 (patch-aj) = ee2e2bfc5f976d00fb4a830184e37427852a90d3 -SHA1 (patch-ak) = d27cd0cbbf2db45a07a8bf4a006ad5e28feb8b3a -SHA1 (patch-al) = 0342d300f6c27a3a523f80f06d087c60c68b9a53 -SHA1 (patch-am) = a4d678ad7e163de381a547cad1c24bca08c72a73 -SHA1 (patch-an) = abd94ec83c54e4ee1e64a34996db21ce86cf7ae3 -SHA1 (patch-ao) = 5d6457e994f559fd826811644d2e77f46ce10d1e -SHA1 (patch-ap) = ca1a6efeaa90cf6e759e2d27ff3b2da8ffef63d0 -SHA1 (patch-aq) = 18a3072f2c307ed35e5c2356e5656c0ce5f19dc0 -SHA1 (patch-ar) = aa98d78890c9fb46c18f727ba3609ad562c01480 -SHA1 (patch-as) = 45e3957d07227c8fb1741fcf6b15c982e9b52bfd -SHA1 (patch-at) = 659b97c50168fa74f3e6a8ffe2bafae0420f0d49 -SHA1 (patch-au) = 31eeee4521020952ef51b29351802efd9fe4297f -SHA1 (patch-av) = b61f165fd9a6e5241795e2e69aa73caba32539a8 -SHA1 (patch-aw) = 82788d7ab312ee07abf3e159028b440d41912a14 -SHA1 (patch-ax) = 70633d0675b11aea8a8c12edbb765ad7d230276f -SHA1 (patch-ay) = c9c7a7f9871fdc3213bafce05a7433db862ac4a4 -SHA1 (patch-az) = 2a8494c8cbfb0270a5fdd46e0c5ccaf19fc5f94f -SHA1 (patch-ba) = cb0433af4a7c5c9a9010edbc15998577c44c92ae -SHA1 (patch-bb) = 2dc1b2281eff27965fc83ca20e9c026287227287 -SHA1 (patch-bc) = d806bf75979d870db8616fa212e3f619d4508249 -SHA1 (patch-bd) = 0af45ab34089ea1d47b15f9dc3ddec129ab98b1a -SHA1 (patch-be) = 29d8fd6b32d622b4ed03efecb4aeb2a35a7c254b -SHA1 (patch-bf) = c14f4c641f6f1536d8ae7cd20995506bb59470b4 -SHA1 (patch-bg) = e129e88832690763e4b34cc59c614cf31e79802a -SHA1 (patch-bh) = 723d8bc1a2064572e7ff4768c137830fbb6773d6 -SHA1 (patch-bi) = d3749e561947e32b5de2af3acb3ff7c26a47ccb4 -SHA1 (patch-bj) = b3c6961c4e8ec54ed2a1c608a8d04e0d38c4176c -SHA1 (patch-bk) = 48d44394dc31d50dc1ffebfac10c813a18a8f094 -SHA1 (patch-bl) = 651f31b2c1d056e5090b893d1db7badfdb592561 -SHA1 (patch-bm) = 4a0235a64263b1f56a357fe5106a40269a2a11e1 -SHA1 (patch-bn) = 12e1bbd0aea73a2df4fd36e7a8ad8006327404ea -SHA1 (patch-bo) = 7480a6016308049eef86aeec8103ccf12733133c -SHA1 (patch-bp) = c577501c0c00dcb8d4b6b8aec8347879aabc0330 -SHA1 (patch-bq) = 121e5db459e1e0f5f5dbaa5e0e3a40e7bc8a74a7 -SHA1 (patch-br) = 7c14091b3f7a7e75e0d7db654cff1e0476e36888 -SHA1 (patch-bs) = 4b2a334ed4611c87b90f2e092cffb88aae058928 -SHA1 (patch-bt) = 34c85d8d994c33fb4e18f76bb8b6baa41098f23e -SHA1 (patch-bu) = 9e2533d967cfb1cdc780516359ab8e7c373b70f5 -SHA1 (patch-bv) = 180df7c4a5fb7544b6d9014f567a4f31e6c2a38d -SHA1 (patch-bw) = c242890caa3cc720d18eec612aca6e46c69c5b04 -SHA1 (patch-bx) = deeea5eefae750b046d7a9c81679125e26fb82fa -SHA1 (patch-by) = c6018a330fdabefd3fc60d3e6e6c95bdf4f7f2bc -SHA1 (patch-checkvm_checkvm.c) = 1da596cf11ccb9af1ba39013775a3a6b3a85345f -SHA1 (patch-configure.ac) = d39767cc2006088203341782fca7895c2710fd55 -SHA1 (patch-guestd_Makefile.am) = 4855efa62b6633e23c11e3ea184f60f4c6952244 -SHA1 (patch-hgfsclient_Makefile.am) = 3b6adf9e4d88bcce2c191260b669615537927e28 -SHA1 (patch-lib_hgfsServer_hgfsServer.c) = 68a3102d4f53626717f64284eb5e51bfb584e783 -SHA1 (patch-lib_hgfsServer_hgfsServerLinux.c) = ef5a3135a8e4dc9f16d93d6eb7d88b8194aa0907 -SHA1 (patch-lib_panic_panic.c) = f784479ef9000e67389c04ca80ad22da5e3a2165 -SHA1 (patch-lib_vmCheck_Makefile.am) = 5956c6e81d6ea5679d949083fcf60066d8374672 -SHA1 (patch-lib_vmSignal_Makefile.am) = 6c562e558f846666ed9da3298f15a9cd489bd75f -SHA1 (patch-libguestlib_Makefile.am) = d46ae6b600831b3f7ecd39f675fbf480a7882e60 -SHA1 (patch-scripts_Makefile.am) = 18bac57a5bfed9883734fdc58a4d6214b6614d92 -SHA1 (patch-toolbox_Makefile.am) = cc0d0f3a0b2b269da903ff6918d329ce74158d17 -SHA1 (patch-toolbox_toolboxcmd-stat.c) = 17d1188de53cea4897fc1d08a02d9db06f6bbc28 -SHA1 (patch-vmware-user_Makefile.am) = 20c389aa42c5419106e1d6619e812725602ead6c -SHA1 (patch-vmware-user_copyPaste.c) = 58286d54e72d9290fc9392212d37c0c406a4e6f8 -SHA1 (patch-vmware-user_dnd.c) = 9d2b242b5e5042f12440ccbf44b10367a8184b0b +SHA1 (open-vm-tools-9.10.0-2476743.tar.gz) = 5954c2a3eb66f7ffe4be1861f3bf6b43a2b3c6fc +RMD160 (open-vm-tools-9.10.0-2476743.tar.gz) = 50aae478f18dd839ee55997aae1b6665194eb96b +Size (open-vm-tools-9.10.0-2476743.tar.gz) = 4093306 bytes +SHA1 (patch-lib_dataMap_dataMap_c) = 9e2e21394e4ed6bfc3a7ea1aca66605c1b9bc2ca +SHA1 (patch-lib_dynxdr_dynxdr_c) = 59e0c3ac2b6287fbd0747a768511c938b1aff489 +SHA1 (patch-lib_file_fileIOPosix_c) = 28e0b4af427331f774d71ed26feb682eccaab8b8 +SHA1 (patch-lib_file_fileInt_h) = 4b775eb51ffa7332979ee2f7ec024ab9f061d12c +SHA1 (patch-lib_file_fileTempPosix_c) = c7355760d02b3c81caed977d212424b64e7976a7 +SHA1 (patch-lib_include_posix_h) = dc041de58543e6e6287c51193d200bf37ac6e2d4 +SHA1 (patch-lib_include_vm__product_h) = f0c2dcd9c32f1660667c6fc328e97fb9ae0ca41b +SHA1 (patch-lib_include_vmci__sockets_h) = 0c63830b4833cd58585c5132a4c6c69bf61a9b2f +SHA1 (patch-lib_string_str_c) = f0d50883713f881b2a209743118cc21e1c132dff diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ac ./patches/patch-ac --- ../../sysutils/open-vm-tools/patches/patch-ac 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-ac 1970-01-01 09:00:00.000000000 +0900 @@ -1,23 +0,0 @@ -$NetBSD: patch-ac,v 1.3 2012/12/25 21:02:15 joerg Exp $ - ---- guestd/foreignVMToolsDaemon.c.orig 2008-08-08 07:01:56.000000000 +0000 -+++ guestd/foreignVMToolsDaemon.c -@@ -55,7 +55,7 @@ - #include - #include - #include --#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) -+#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) || defined(__NetBSD__) - #include - #else - #include -@@ -833,8 +833,7 @@ ForeignToolsSetProperties(ForeignVMTools - * Do some validation - */ - if ((NULL == asyncCommand) -- || (NULL == requestMsg) -- || (0 > requestMsg->bufferSize)) { -+ || (NULL == requestMsg)) { - err = VIX_E_INVALID_ARG; - goto abort; - } diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ad ./patches/patch-ad --- ../../sysutils/open-vm-tools/patches/patch-ad 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-ad 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-ad,v 1.3 2012/12/25 21:02:15 joerg Exp $ - ---- guestd/foreignVMToolsDaemon.h.orig 2008-08-08 07:01:56.000000000 +0000 -+++ guestd/foreignVMToolsDaemon.h -@@ -59,7 +59,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock - - #ifdef __APPLE__ - #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE --#elif defined(__FreeBSD__) || defined(sun) -+#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - #include - #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE - #else -@@ -72,7 +72,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock - - typedef pthread_mutex_t VixLockType; - static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr); --VixError VIX_INIT_LOCK(VixLockType *lockPtr) -+static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr) - { - int result; - pthread_mutexattr_t attr; diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ae ./patches/patch-ae --- ../../sysutils/open-vm-tools/patches/patch-ae 2008-08-31 15:36:47.000000000 +0900 +++ ./patches/patch-ae 1970-01-01 09:00:00.000000000 +0900 @@ -1,49 +0,0 @@ -$NetBSD: patch-ae,v 1.2 2008/08/31 06:36:47 scottr Exp $ - ---- guestd/main.c.orig 2008-08-08 02:01:56.000000000 -0500 -+++ guestd/main.c -@@ -59,7 +59,7 @@ - #include "vmBackup.h" - #include "codeset.h" - --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - #include "socketMgr.h" - #endif - -@@ -864,7 +864,7 @@ GuestdSleep(uint64 numUsecs, - int maxFd; /* Max fd of all Fd sets */ - fd_set readFds; /* Read fd set to select on */ - fd_set writeFds; --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - SocketSelectable *sockReadFds = NULL; - SocketSelectable *sockWriteFds = NULL; - int numSockReadFds = 0; -@@ -911,7 +911,7 @@ GuestdSleep(uint64 numUsecs, - } - #endif - --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - SocketMgr_GetSelectables(SOCKETMGR_IN, - &sockReadFds, - &numSockReadFds); -@@ -969,7 +969,7 @@ GuestdSleep(uint64 numUsecs, - curAsyncProc = NULL; - } - --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - for (index = 0; index < numSockReadFds; index++) { - if (FD_ISSET(sockReadFds[index], &readFds)) { - SocketMgr_ProcessSelectable(sockReadFds[index], SOCKETMGR_IN); -@@ -984,7 +984,7 @@ GuestdSleep(uint64 numUsecs, - #endif - } - --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - free((void *) sockReadFds); - free((void *) sockWriteFds); - #endif diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-af ./patches/patch-af --- ../../sysutils/open-vm-tools/patches/patch-af 2008-08-31 15:36:47.000000000 +0900 +++ ./patches/patch-af 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-af,v 1.2 2008/08/31 06:36:47 scottr Exp $ - ---- lib/dnd/dndLinux.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/dnd/dndLinux.c -@@ -39,7 +39,7 @@ - #include "util.h" - #include "escape.h" - #include "su.h" --#if defined(linux) || defined(sun) || defined(__FreeBSD__) -+#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__) - #include "vmblock.h" - #include "mntinfo.h" - #endif -@@ -288,7 +288,7 @@ DnD_UriListGetNextFile(char const *uriLi - - - /* We need to make this suck less. */ --#if defined(linux) || defined(sun) || defined(__FreeBSD__) -+#if defined(linux) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__) - /* - *---------------------------------------------------------------------------- - * diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ag ./patches/patch-ag --- ../../sysutils/open-vm-tools/patches/patch-ag 2008-08-31 15:36:47.000000000 +0900 +++ ./patches/patch-ag 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-ag,v 1.2 2008/08/31 06:36:47 scottr Exp $ - ---- lib/dynxdr/dynxdr.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/dynxdr/dynxdr.c -@@ -54,7 +54,7 @@ typedef struct DynXdrData { - * Mac OS X, FreeBSD and Solaris don't take a const parameter to the - * "x_getpostn" function. - */ --#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) | defined(__NetBSD__) - # define DYNXDR_GETPOS_CONST - #else - # define DYNXDR_GETPOS_CONST const diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ah ./patches/patch-ah --- ../../sysutils/open-vm-tools/patches/patch-ah 2008-08-31 15:36:47.000000000 +0900 +++ ./patches/patch-ah 1970-01-01 09:00:00.000000000 +0900 @@ -1,49 +0,0 @@ -$NetBSD: patch-ah,v 1.2 2008/08/31 06:36:47 scottr Exp $ - ---- lib/file/fileIO.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/file/fileIO.c -@@ -254,7 +254,7 @@ FileIO_Lock(FileIODescriptor *file, // I - - ASSERT(file); - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - if (access & FILEIO_OPEN_LOCKED) { - int err; - -@@ -286,7 +286,7 @@ FileIO_Lock(FileIODescriptor *file, // I - } - #else - ASSERT(file->lockToken == NULL); --#endif // !__FreeBSD__ && !sun -+#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__) - - return ret; - } -@@ -316,7 +316,7 @@ FileIO_Unlock(FileIODescriptor *file) - - ASSERT(file); - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - if (file->lockToken != NULL) { - int err; - -@@ -333,7 +333,7 @@ FileIO_Unlock(FileIODescriptor *file) - } - #else - ASSERT(file->lockToken == NULL); --#endif // !__FreeBSD__ && !sun -+#endif // !__FreeBSD__ && !sun && !defined(__NetBSD__) - - return ret; - } -@@ -449,7 +449,7 @@ FileIO_StatsExit(const FileIODescriptor - /* - * Pwrite & Pread are not available in the FreeBSD tools build VM - */ --#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) -+#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) && !defined(__NetBSD__) - #if defined(_WIN32) || defined(GLIBC_VERSION_21) || defined(__APPLE__) - /* - *---------------------------------------------------------------------- diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ai ./patches/patch-ai --- ../../sysutils/open-vm-tools/patches/patch-ai 2008-08-31 15:36:47.000000000 +0900 +++ ./patches/patch-ai 1970-01-01 09:00:00.000000000 +0900 @@ -1,31 +0,0 @@ -$NetBSD: patch-ai,v 1.2 2008/08/31 06:36:47 scottr Exp $ - ---- lib/file/fileIOPosix.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/file/fileIOPosix.c -@@ -62,7 +62,7 @@ - #include - #include - #else --#if defined(__FreeBSD__) -+#if defined(__FreeBSD__) || defined(__NetBSD__) - #include - #include - #else -@@ -720,7 +720,7 @@ FileIO_Create(FileIODescriptor *file, - ASSERT(file->lockToken == NULL); - ASSERT_ON_COMPILE(FILEIO_ERROR_LAST < 16); /* See comment in fileIO.h */ - --#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM) && !defined(__NetBSD__) - /* - * If FILEIO_OPEN_EXCLUSIVE_LOCK or FILEIO_OPEN_MULTIWRITER_LOCK or - * (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_LOCKED) are passed, and we are -@@ -1248,7 +1248,7 @@ FileIO_Sync(const FileIODescriptor *file - /* - * readv & writev are not available in the FreeBSD or Solaris Tools builds - */ --#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun)) -+#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__)) - - - /* diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-aj ./patches/patch-aj --- ../../sysutils/open-vm-tools/patches/patch-aj 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-aj 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-aj,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/file/fileLockPosix.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/file/fileLockPosix.c -@@ -26,7 +26,7 @@ - #include - #include - #include /* Needed before sys/vfs.h with glibc 2.0 --hpreg */ --#if !defined(__FreeBSD__) -+#if !defined(__FreeBSD__) && !defined(__NetBSD__) - #if defined(__APPLE__) - #include - #include -@@ -121,7 +121,7 @@ FileLock_Init(int lockerPid, - fileLockOptions.userWorld = userWorld; - } - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - /* - *---------------------------------------------------------------------- - * diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ak ./patches/patch-ak --- ../../sysutils/open-vm-tools/patches/patch-ak 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-ak 1970-01-01 09:00:00.000000000 +0900 @@ -1,58 +0,0 @@ -$NetBSD: patch-ak,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/file/filePosix.c.orig 2008-08-08 02:01:54.000000000 -0500 -+++ lib/file/filePosix.c -@@ -24,7 +24,7 @@ - - #include /* Needed before sys/vfs.h with glibc 2.0 --hpreg */ - --#if !__FreeBSD__ -+#if !__FreeBSD__ && !__NetBSD__ - # if !__APPLE__ - # include - # endif -@@ -64,7 +64,7 @@ - - #include "unicodeOperations.h" - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - #if !defined(__APPLE__) - static char *FilePosixLookupMountPoint(char const *canPath, Bool *bind); - #endif -@@ -320,7 +320,7 @@ FileAttributes(ConstUnicode pathName, / - *---------------------------------------------------------------------- - */ - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - Bool - File_IsRemote(ConstUnicode pathName) // IN: Path name - { -@@ -626,7 +626,7 @@ File_GetTimes(ConstUnicode pathName, - * XXX atime is almost always MAX. - */ - --#if defined(__FreeBSD__) -+#if defined(__FreeBSD__) || defined(__NetBSD__) - /* - * FreeBSD: All supported versions have timestamps with nanosecond resolution. - * FreeBSD 5+ has also file creation time. -@@ -788,7 +788,7 @@ File_SetTimes(ConstUnicode pathName, - } - - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - /* - *----------------------------------------------------------------------------- - * -@@ -1747,7 +1747,7 @@ File_IsSameFile(ConstUnicode path1, // - } - - --#endif /* !FreeBSD && !sun */ -+#endif /* !FreeBSD && !sun && !NetBSD */ - - - /* diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-al ./patches/patch-al --- ../../sysutils/open-vm-tools/patches/patch-al 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-al 1970-01-01 09:00:00.000000000 +0900 @@ -1,12 +0,0 @@ -$NetBSD: patch-al,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/guestApp/Makefile.in.orig 2008-08-08 02:02:08.000000000 -0500 -+++ lib/guestApp/Makefile.in -@@ -248,6 +248,7 @@ libGuestApp_a_SOURCES = guestApp.c guest - @HAVE_X11_TRUE@libGuestAppX11_a_SOURCES = $(libGuestApp_a_SOURCES) \ - @HAVE_X11_TRUE@ guestAppPosixX11.c - @HAVE_X11_TRUE@libGuestAppX11_a_CPPFLAGS = -DGUESTAPP_HAS_X11 -+CFLAGS += -DGUESTAPP_TOOLS_INSTALL_PATH=\"$(sysconfdir)/vmware-tools\" - all: all-am - - .SUFFIXES: diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-am ./patches/patch-am --- ../../sysutils/open-vm-tools/patches/patch-am 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-am 1970-01-01 09:00:00.000000000 +0900 @@ -1,20 +0,0 @@ -$NetBSD: patch-am,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/guestApp/guestApp.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/guestApp/guestApp.c -@@ -72,6 +72,7 @@ extern "C" { - * intelligent for that platform as well. - */ - -+#if !defined(GUESTAPP_TOOLS_INSTALL_PATH) - #if defined(N_PLAT_NLM) - #define GUESTAPP_TOOLS_INSTALL_PATH "SYS:\\ETC\\VMWTOOL" - #elif defined(_WIN32) -@@ -79,6 +80,7 @@ extern "C" { - #else - #define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools" - #endif -+#endif - - /* - * An option name/value pair stored locally in the guest app. diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-an ./patches/patch-an --- ../../sysutils/open-vm-tools/patches/patch-an 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-an 1970-01-01 09:00:00.000000000 +0900 @@ -1,72 +0,0 @@ -$NetBSD: patch-an,v 1.3 2012/12/25 21:02:15 joerg Exp $ - ---- lib/guestInfo/guestInfoPosix.c.orig 2008-08-08 07:01:52.000000000 +0000 -+++ lib/guestInfo/guestInfoPosix.c -@@ -38,10 +38,11 @@ - #endif - #include - #include -+#include - #include - #include - #include --#if defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) - # include - #endif - #ifndef NO_DNET -@@ -200,7 +201,7 @@ ReadInterfaceDetails(const struct intf_e - char ipAddress[NICINFO_MAX_IP_LEN]; - - Str_Sprintf(macAddress, sizeof macAddress, -- addr_ntoa(&entry->intf_link_addr)); -+ "%s", addr_ntoa(&entry->intf_link_addr)); - nic = GuestInfoAddNicEntry(nicInfo, macAddress); - - if (nic == NULL) { -@@ -229,6 +230,7 @@ ReadInterfaceDetails(const struct intf_e - if (ip) { - GuestInfoAddSubnetMask(ip, entry->intf_addr.addr_bits); - } -+#if !defined(__NetBSD__) /* libdnet addr_ntoa() breaks with IPv6 on NetBSD */ - } else if (entry->intf_alias_addrs[i].addr_type == ADDR_TYPE_IP6) { - memcpy(ipAddress, - addr_ntoa(&entry->intf_alias_addrs[i]), -@@ -236,6 +238,7 @@ ReadInterfaceDetails(const struct intf_e - GuestInfoAddIpAddress(nic, - ipAddress, - INFO_IP_ADDRESS_FAMILY_IPV6); -+#endif /* defined(__NetBSD__) */ - } - } - } -@@ -697,6 +700,20 @@ GuestInfoGetOSName(unsigned int outBufFu - if (releaseLen != 0) { - Str_Strncat(osName, outBufLen, buf.release, releaseLen); - } -+ } else if (strstr(osNameFull, "NetBSD")) { -+ size_t nameLen = sizeof STR_OS_NETBSD - 1; -+ size_t releaseLen = 0; -+ -+ /* NetBSD, as usual, just DTRT */ -+ releaseLen = strlen(buf.release); -+ -+ if (nameLen + releaseLen + 1 > outBufLen) { -+ Debug("GuestInfoGetOSName: Error: buffer too small\n"); -+ return FALSE; -+ } -+ -+ Str_Strcpy(osName, STR_OS_NETBSD, outBufLen); -+ Str_Strncat(osName, outBufLen, buf.release, releaseLen); - } else if (strstr(osNameFull, "SunOS")) { - size_t nameLen = sizeof STR_OS_SOLARIS - 1; - size_t releaseLen = 0; -@@ -766,7 +783,7 @@ int - GuestInfo_GetSystemBitness(void) - { - char buf[MAX_ARCH_NAME_LEN] = { 0 }; --#if defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) - int mib[2]; - size_t len; - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ao ./patches/patch-ao --- ../../sysutils/open-vm-tools/patches/patch-ao 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-ao 1970-01-01 09:00:00.000000000 +0900 @@ -1,14 +0,0 @@ -$NetBSD: patch-ao,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/conf.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/conf.h -@@ -41,6 +41,9 @@ - # ifdef sun - # define CONFVAL_HALT_DEFAULT "/usr/sbin/init 5" - # define CONFVAL_REBOOT_DEFAULT "/usr/sbin/init 6" -+# elif defined(__NetBSD__) -+# define CONFVAL_HALT_DEFAULT "/sbin/shutdown -p now" -+# define CONFVAL_REBOOT_DEFAULT "/sbin/shutdown -r now" - # else - # define CONFVAL_HALT_DEFAULT "/sbin/shutdown -h now" - # define CONFVAL_REBOOT_DEFAULT "/sbin/shutdown -r now" diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ap ./patches/patch-ap --- ../../sysutils/open-vm-tools/patches/patch-ap 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-ap 1970-01-01 09:00:00.000000000 +0900 @@ -1,14 +0,0 @@ -$NetBSD: patch-ap,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/guest_os.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/guest_os.h -@@ -298,6 +298,9 @@ typedef enum GuestOSFamilyType { - /* FreeBSD */ - #define STR_OS_FREEBSD "FreeBSD" - -+/* NetBSD */ -+#define STR_OS_NETBSD "NetBSD" -+ - /* Solaris */ - #define STR_OS_SOLARIS "Solaris" - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-aq ./patches/patch-aq --- ../../sysutils/open-vm-tools/patches/patch-aq 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-aq 1970-01-01 09:00:00.000000000 +0900 @@ -1,21 +0,0 @@ -$NetBSD: patch-aq,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/hgfsUtil.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/hgfsUtil.h -@@ -44,6 +44,7 @@ - !defined(__timespec_defined) && \ - !defined(sun) && \ - !defined(__FreeBSD__) && \ -+ !defined(__NetBSD__) && \ - !__APPLE__ && \ - !defined(_WIN32) - struct timespec { -@@ -96,7 +97,7 @@ struct timespec { - /* - * FreeBSD (pre-6.0) does not define EPROTO, so we'll define our own error code. - */ --#if defined(__FreeBSD__) && !defined(EPROTO) -+#if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(EPROTO) - #define EPROTO (ELAST + 1) - #endif - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ar ./patches/patch-ar --- ../../sysutils/open-vm-tools/patches/patch-ar 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-ar 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-ar,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/iovector.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/iovector.h -@@ -32,7 +32,7 @@ - /* - * Ugly definition of struct iovec. - */ --#if __linux__ || sun || __APPLE__ -+#if __linux__ || sun || __APPLE__ || __NetBSD__ - #include // for struct iovec - #else // if __linux__ || sun || __APPLE__ - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-as ./patches/patch-as --- ../../sysutils/open-vm-tools/patches/patch-as 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-as 1970-01-01 09:00:00.000000000 +0900 @@ -1,57 +0,0 @@ -$NetBSD: patch-as,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/mntinfo.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/mntinfo.h -@@ -34,7 +34,7 @@ - # include - #elif defined(__linux__) - # include --#elif defined(__FreeBSD__) -+#elif defined(__FreeBSD__) || defined(__NetBSD__) - # include - #endif - #include "posix.h" -@@ -106,17 +106,27 @@ - # define MNTINFO_FSTYPE(mnt) mnt->mnt_type - # define MNTINFO_MNTPT(mnt) mnt->mnt_dir - # define MNTINFO_MNT_IS_RO(mnt) (hasmntopt((mnt), "rw") == NULL) --#elif defined(__FreeBSD__) || defined(__APPLE__) -+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) - struct mntHandle { -+# if defined(__NetBSD__) -+ struct statvfs *mountPoints; // array of mountpoints per getmntinfo(3) -+# else - struct statfs *mountPoints; // array of mountpoints per getmntinfo(3) -+# endif - int numMountPoints; // number of elements in mntArray - int mountIndex; // current location within mountPoints array - }; - # define MNTFILE _PATH_FSTAB - # define MNTHANDLE struct mntHandle * --# define MNTINFO struct statfs --# define DECLARE_MNTINFO(name) struct statfs __ ## name; \ -+# if defined(__NetBSD__) -+# define MNTINFO struct statvfs -+# define DECLARE_MNTINFO(name) struct statvfs __ ## name; \ -+ struct statvfs *name = &__ ## name -+# else -+# define MNTINFO struct statfs -+# define DECLARE_MNTINFO(name) struct statfs __ ## name; \ - struct statfs *name = &__ ## name -+# endif - - # define OPEN_MNTFILE(mode) \ - ({ \ -@@ -155,7 +165,11 @@ struct mntHandle { - # define MNTINFO_NAME(mnt) mnt->f_mntfromname - # define MNTINFO_FSTYPE(mnt) mnt->f_fstypename - # define MNTINFO_MNTPT(mnt) mnt->f_mntonname --# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY) -+# if defined(__NetBSD__) -+# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flag & MNT_RDONLY) -+# else -+# define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY) -+# endif - #else - # error "Define mount information macros for your OS type" - #endif diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-at ./patches/patch-at --- ../../sysutils/open-vm-tools/patches/patch-at 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-at 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-at,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/posix.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/posix.h -@@ -151,7 +151,7 @@ int Posix_Getgrnam_r(ConstUnicode name, - char *buf, size_t size, struct group **pgr); - - #if !defined(sun) --#if !defined(__APPLE__) && !defined(__FreeBSD__) -+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) - int Posix_Mount(ConstUnicode source, ConstUnicode target, - const char *filesystemtype, unsigned long mountflags, - const void *data); -@@ -161,7 +161,7 @@ struct mntent *Posix_Getmntent(FILE *fp) - struct mntent *Posix_Getmntent_r(FILE *fp, struct mntent *m, - char *buf, int size); - --#endif // !defined(__APPLE__) && !defined(__FreeBSD__) -+#endif // !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) - #else // !defined(sun) - int Posix_Getmntent(FILE *fp, struct mnttab *mp); - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-au ./patches/patch-au --- ../../sysutils/open-vm-tools/patches/patch-au 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-au 1970-01-01 09:00:00.000000000 +0900 @@ -1,37 +0,0 @@ -$NetBSD: patch-au,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/su.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/su.h -@@ -51,7 +51,7 @@ Bool Id_AuthSet(void const *buf, size_t - Bool Id_AuthCheck(char const *right, - char const *localizedDescription); - --#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__)) && !defined(N_PLAT_NLM) -+#elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(N_PLAT_NLM) - - #include - #include -@@ -87,7 +87,11 @@ int Id_SetRESGid(gid_t rgid, gid_t egid, - static INLINE int - Id_SetEUid(uid_t euid) - { -+#if defined(__NetBSD__) -+ return seteuid(euid); -+#else - return Id_SetRESUid((uid_t)-1, euid, (uid_t)-1); -+#endif - } - - -@@ -111,7 +115,11 @@ Id_SetEUid(uid_t euid) - static INLINE int - Id_SetEGid(gid_t egid) - { -+#if defined(__NetBSD__) -+ return setegid(egid); -+#else - return Id_SetRESGid((gid_t)-1, egid, (gid_t)-1); -+#endif - } - - #define IsSuperUser() (0 == geteuid()) diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-av ./patches/patch-av --- ../../sysutils/open-vm-tools/patches/patch-av 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-av 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-av,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/util.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/util.h -@@ -55,7 +55,7 @@ - /* - * Define the Util_ThreadID type. - */ --#if defined(__APPLE__) || defined(__FreeBSD__) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) - #include - typedef pthread_t Util_ThreadID; - #elif defined(_WIN32) -@@ -119,7 +119,7 @@ EXTERN char *Util_GetSafeTmpDir(Bool use - EXTERN int Util_MakeSafeTemp(ConstUnicode tag, - Unicode *presult); - --#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) -+#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - EXTERN Bool Util_GetProcessName(pid_t pid, char *bufOut, size_t bufOutSize); - #endif - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-aw ./patches/patch-aw --- ../../sysutils/open-vm-tools/patches/patch-aw 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-aw 1970-01-01 09:00:00.000000000 +0900 @@ -1,31 +0,0 @@ -$NetBSD: patch-aw,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/vm_atomic.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/vm_atomic.h -@@ -22,8 +22,8 @@ - * Atomic power - */ - --#ifndef _ATOMIC_H_ --#define _ATOMIC_H_ -+#ifndef _VM_ATOMIC_H_ -+#define _VM_ATOMIC_H_ - - #define INCLUDE_ALLOW_USERLEVEL - #define INCLUDE_ALLOW_VMMEXT -@@ -154,7 +154,8 @@ Atomic_VolatileToAtomic(volatile uint32 - __GNUC__ >= 3 && \ - !defined(BSD_VERSION) && \ - (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \ -- !defined(__APPLE__) /* PR136775 */ -+ !defined(__APPLE__) /* PR136775 */ || \ -+ !defined(__NetBSD__) - #define ATOMIC_USE_FENCE - #endif - -@@ -2046,4 +2047,4 @@ Atomic_MFence(void) - Atomic_Xor(&fence, 0x1); - } - --#endif // ifndef _ATOMIC_H_ -+#endif // ifndef _VM_ATOMIC_H_ diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ax ./patches/patch-ax --- ../../sysutils/open-vm-tools/patches/patch-ax 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-ax 1970-01-01 09:00:00.000000000 +0900 @@ -1,50 +0,0 @@ -$NetBSD: patch-ax,v 1.5 2012/12/25 21:02:15 joerg Exp $ - ---- lib/include/vm_basic_types.h.orig 2008-08-08 07:01:52.000000000 +0000 -+++ lib/include/vm_basic_types.h -@@ -41,7 +41,7 @@ - #include "includeCheck.h" - - /* STRICT ANSI means the Xserver build and X defines Bool differently. */ --#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) -+#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) || defined(__NetBSD__) - typedef char Bool; - #endif - -@@ -151,7 +151,7 @@ typedef char int8; - #endif - - #if !defined(USING_AUTOCONF) --# if defined(__FreeBSD__) || defined(sun) -+# if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - # ifdef KLD_MODULE - # include - # else -@@ -244,7 +244,7 @@ typedef int64 VmTimeVirtualClock; /* Vi - #define FMTSZ "" - #define FMTPD "" - #endif -- #elif defined(__linux__) \ -+ #elif defined(__linux__) || defined(__NetBSD__) \ - || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \ - || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \ - || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) -@@ -267,7 +267,7 @@ typedef int64 VmTimeVirtualClock; /* Vi - #endif - #ifdef VM_X86_64 - #define FMT64 "l" -- #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) -+ #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) - #define FMT64 "ll" - #else - #define FMT64 "L" -@@ -717,7 +717,8 @@ typedef void * UserVA; - * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_ - * is defined. Use the same logic here so we don't define it twice. [greg] - */ --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__NetBSD__) -+# include - # ifdef _BSD_SIZE_T_ - # undef _BSD_SIZE_T_ - # ifdef VM_I386 diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ay ./patches/patch-ay --- ../../sysutils/open-vm-tools/patches/patch-ay 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-ay 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-ay,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/vm_product.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/vm_product.h -@@ -498,6 +498,8 @@ - # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Windows" - #elif defined(__FreeBSD__) - # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for FreeBSD" -+#elif defined(__NetBSD__) -+# define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for NetBSD" - #elif defined(sun) - # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Solaris" - #elif defined(__APPLE__) diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-az ./patches/patch-az --- ../../sysutils/open-vm-tools/patches/patch-az 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-az 1970-01-01 09:00:00.000000000 +0900 @@ -1,38 +0,0 @@ -$NetBSD: patch-az,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/include/vmblock.h.orig 2008-08-08 02:01:52.000000000 -0500 -+++ lib/include/vmblock.h -@@ -25,12 +25,13 @@ - #ifndef _VMBLOCK_H_ - #define _VMBLOCK_H_ - --#if defined(sun) || defined(__FreeBSD__) -+#if defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__) - # include - #endif - --#if defined(__FreeBSD__) -+#if defined(__FreeBSD__) || defined(__NetBSD__) - # include -+# include - #endif - - #define VMBLOCK_FS_NAME "vmblock" -@@ -54,7 +55,7 @@ - # define VMBLOCK_DEVICE_MODE O_WRONLY - # define VMBLOCK_CONTROL(fd, op, path) write(fd, path, op) - --#elif defined(sun) || defined(__FreeBSD__) -+#elif defined(sun) || defined(__FreeBSD__) || defined(__NetBSD__) - # define VMBLOCK_MOUNT_POINT "/var/run/" VMBLOCK_FS_NAME - # define VMBLOCK_DEVICE VMBLOCK_MOUNT_POINT - # define VMBLOCK_DEVICE_MODE O_RDONLY -@@ -71,7 +72,7 @@ - # endif - # define VMBLOCK_CONTROL(fd, op, path) ioctl(fd, op, path) - --# elif defined(__FreeBSD__) /* } else if (FreeBSD) { */ -+# elif defined(__FreeBSD__) || defined(__NetBSD__) /* } else if (FreeBSD) { */ - /* - * Similar to Solaris, construct ioctl(2) commands for block operations. - * Since the FreeBSD implementation does not change the user's passed-in diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-ba ./patches/patch-ba --- ../../sysutils/open-vm-tools/patches/patch-ba 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-ba 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-ba,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/misc/codesetOld.c.orig 2008-08-08 02:01:54.000000000 -0500 -+++ lib/misc/codesetOld.c -@@ -70,7 +70,7 @@ - #endif - - --#if defined(__FreeBSD__) || defined(sun) -+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - static const char nul[] = {'\0', '\0'}; - #else - static const wchar_t nul = L'\0'; -@@ -735,7 +735,7 @@ CodeSetOldGetCodeSetFromLocale(void) - codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new)); - freelocale(new); - --#elif defined(sun) -+#elif defined(sun) || defined(__NetBSD__) - - char *locale = setlocale(LC_CTYPE, NULL); - if (!setlocale(LC_CTYPE, "")) { diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bb ./patches/patch-bb --- ../../sysutils/open-vm-tools/patches/patch-bb 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bb 1970-01-01 09:00:00.000000000 +0900 @@ -1,62 +0,0 @@ -$NetBSD: patch-bb,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/misc/idLinux.c.orig 2008-08-08 02:01:54.000000000 -0500 -+++ lib/misc/idLinux.c -@@ -99,7 +99,7 @@ static AuthorizationRef IdAuthCreateWith - #endif - - --#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) -+#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__) - /* - *---------------------------------------------------------------------------- - * -@@ -163,6 +163,9 @@ Id_SetGid(gid_t egid) // IN: new egid - #elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; -+#elif defined(__NetBSD__) -+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__); -+ return -1; - #else - if (uid32) { - int r = syscall(SYS_setgid32, egid); -@@ -207,6 +210,9 @@ Id_SetRESUid(uid_t uid, // IN: new uid - #elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; -+#elif defined(__NetBSD__) -+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__); -+ return -1; - #else - if (uid32) { - int r = syscall(SYS_setresuid32, uid, euid, suid); -@@ -249,6 +255,9 @@ Id_SetRESGid(gid_t gid, // IN: new gid - #elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; -+#elif defined(__NetBSD__) -+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__); -+ return -1; - #else - if (uid32) { - int r = syscall(SYS_setresgid32, gid, egid, sgid); -@@ -295,6 +304,9 @@ Id_SetREUid(uid_t uid, // IN: new uid - #elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; -+#elif defined(__NetBSD__) -+ Warning("XXXNetBSD: implement %s\n", __FUNCTION__); -+ return -1; - #else - if (uid32) { - int r = syscall(SYS_setreuid32, uid, euid); -@@ -308,7 +320,7 @@ Id_SetREUid(uid_t uid, // IN: new uid - } - - --#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) -+#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__) - /* - *---------------------------------------------------------------------------- - * diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bc ./patches/patch-bc --- ../../sysutils/open-vm-tools/patches/patch-bc 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bc 1970-01-01 09:00:00.000000000 +0900 @@ -1,89 +0,0 @@ -$NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $ - ---- lib/misc/posixPosix.c.orig 2008-08-08 02:01:54.000000000 -0500 -+++ lib/misc/posixPosix.c -@@ -50,7 +50,7 @@ - #include - #include - #include --#elif defined(__FreeBSD__) -+#elif defined(__FreeBSD__) || defined(__NetBSD__) - #include - #include - #elif !defined(N_PLAT_NLM) -@@ -77,6 +77,7 @@ - # endif - - #include "vmware.h" -+#include "vm_atomic.h" - #include "posixInt.h" - #if defined(sun) - #include "hashTable.h" // For setenv emulation -@@ -1578,7 +1579,7 @@ GetpwInternal(struct passwd *pw) // IN: - spw.pw_gecos = NULL; - free(spw.pw_shell); - spw.pw_shell = NULL; --#if defined(__FreeBSD__) -+#if defined(__FreeBSD__) || defined(__NetBSD__) - free(spw.pw_class); - spw.pw_class = NULL; - #endif -@@ -1586,10 +1587,12 @@ GetpwInternal(struct passwd *pw) // IN: - /* Fill out structure with new values. */ - spw.pw_uid = pw->pw_uid; - spw.pw_gid = pw->pw_gid; --#if defined(__FreeBSD__) -+#if defined(__FreeBSD__) || defined(__NetBSD__) - spw.pw_change = pw->pw_change; - spw.pw_expire = pw->pw_expire; -+# if defined(__FreeBSD__) - spw.pw_fields = pw->pw_fields; -+# endif - #endif - - #if !defined(sun) -@@ -1617,7 +1620,7 @@ GetpwInternal(struct passwd *pw) // IN: - (spw.pw_shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) { - goto exit; - } --#if defined(__FreeBSD__) -+#if defined(__FreeBSD__) || defined(__NetBSD__) - if (pw->pw_class && - (spw.pw_class = Unicode_Alloc(pw->pw_class, STRING_ENCODING_DEFAULT)) == NULL) { - goto exit; -@@ -1634,7 +1637,7 @@ exit: - } - - --#if !defined(sun) // { -+#if !defined(sun) && !defined(__NetBSD__) // { - - /* - *---------------------------------------------------------------------- -@@ -1902,7 +1905,7 @@ PasswdCopy(struct passwd *orig, // IN - if (!CopyFieldIntoBuf(orig->pw_shell, &new->pw_shell, &buf, &bufLen)) { - return NULL; - } --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__NetBSD__) - if (!CopyFieldIntoBuf(orig->pw_class, &new->pw_class, &buf, &bufLen)) { - return NULL; - } -@@ -2647,7 +2650,7 @@ Posix_Getgrnam_r(ConstUnicode name, / - - #if !defined(sun) // { - --#if !defined(__APPLE__) && !defined(__FreeBSD__) // { -+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) // { - /* - *---------------------------------------------------------------------- - * -@@ -3030,7 +3033,7 @@ Posix_Fprintf(FILE *stream, - } - - --#endif // } !defined(__APPLE__) && !defined(__FreeBSD) -+#endif // } !defined(__APPLE__) && !defined(__FreeBSD) && !defined(__NetBSD__) - - - #else // } !defined(sun) { diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bd ./patches/patch-bd --- ../../sysutils/open-vm-tools/patches/patch-bd 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bd 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-bd,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/misc/util_misc.c.orig 2008-08-08 02:01:54.000000000 -0500 -+++ lib/misc/util_misc.c -@@ -47,7 +47,7 @@ - # include - #endif - --#if defined(__APPLE__) || defined(__FreeBSD__) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) - #include - #endif - -@@ -481,7 +481,7 @@ Util_GetCurrentThreadId(void) - tid = getpid(); - ASSERT(tid != (pid_t)-1); - return tid; --#elif defined(__APPLE__) || defined(__FreeBSD__) -+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) - ASSERT_ON_COMPILE(sizeof(Util_ThreadID) == sizeof(pthread_t)); - return pthread_self(); - #elif defined(_WIN32) diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-be ./patches/patch-be --- ../../sysutils/open-vm-tools/patches/patch-be 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-be 1970-01-01 09:00:00.000000000 +0900 @@ -1,40 +0,0 @@ -$NetBSD: patch-be,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/netUtil/netUtilLinux.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/netUtil/netUtilLinux.c -@@ -31,7 +31,7 @@ - #endif - - --#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - # error This file should not be compiled - #endif - -@@ -58,7 +58,7 @@ - #include - #include - --#if defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) - #include "ifaddrs.h" - #endif - -@@ -94,7 +94,7 @@ - *---------------------------------------------------------------------- - */ - --#if !defined(__FreeBSD__) && !defined(__APPLE__) /* { */ -+#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__) /* { */ - char * - NetUtil_GetPrimaryIP(void) - { -@@ -168,7 +168,7 @@ error: - return NULL; - } - --#else /* } FreeBSD || APPLE { */ -+#else /* } FreeBSD || APPLE || NetBSD { */ - - char * - NetUtil_GetPrimaryIP(void) diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bf ./patches/patch-bf --- ../../sysutils/open-vm-tools/patches/patch-bf 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bf 1970-01-01 09:00:00.000000000 +0900 @@ -1,31 +0,0 @@ -$NetBSD: patch-bf,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/procMgr/procMgrPosix.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/procMgr/procMgrPosix.c -@@ -31,7 +31,7 @@ - // pull in setresuid()/setresgid() if possible - #define _GNU_SOURCE - #include --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - #include - #include - #include -@@ -158,7 +158,7 @@ ProcMgr_ProcList * - ProcMgr_ListProcesses(void) - { - ProcMgr_ProcList *procList = NULL; --#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - Bool failed = FALSE; - DynBuf dbProcId; - DynBuf dbProcCmd; -@@ -453,7 +453,7 @@ abort: - ProcMgr_FreeProcList(procList); - procList = NULL; - } --#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - - return procList; - } diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bg ./patches/patch-bg --- ../../sysutils/open-vm-tools/patches/patch-bg 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bg 1970-01-01 09:00:00.000000000 +0900 @@ -1,24 +0,0 @@ -$NetBSD: patch-bg,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/string/str.c.orig 2008-08-08 02:01:55.000000000 -0500 -+++ lib/string/str.c -@@ -37,6 +37,10 @@ - #endif - #include "codeset.h" - -+#ifdef __NetBSD__ -+#include -+#endif -+ - #if defined _WIN32 && !defined HAS_BSD_PRINTF - #define vsnprintf _vsnprintf - #endif -@@ -604,7 +608,7 @@ Str_SafeVasprintf(size_t *length, - return StrVasprintf_Internal(length, format, arguments, TRUE); - } - --#if defined(_WIN32) || defined(GLIBC_VERSION_22) -+#if defined(_WIN32) || (defined(GLIBC_VERSION_22) && !defined(__NetBSD__)) - - /* - *---------------------------------------------------------------------- diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bh ./patches/patch-bh --- ../../sysutils/open-vm-tools/patches/patch-bh 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bh 1970-01-01 09:00:00.000000000 +0900 @@ -1,31 +0,0 @@ -$NetBSD: patch-bh,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/system/systemLinux.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/system/systemLinux.c -@@ -26,7 +26,7 @@ - * - */ - --#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) -+#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) && !defined(__NetBSD__) - # error This file should not be compiled - #endif - -@@ -55,7 +55,7 @@ - #include - #include - --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__NetBSD__) - #include "ifaddrs.h" - #endif - -@@ -352,7 +352,7 @@ System_Shutdown(Bool reboot) // IN: "re - if (reboot) { - cmd = "shutdown -r now"; - } else { --#if __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__NetBSD__) - cmd = "shutdown -p now"; - #else - cmd = "shutdown -h now"; diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bi ./patches/patch-bi --- ../../sysutils/open-vm-tools/patches/patch-bi 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bi 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-bi,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/unicode/unicodeSimpleTypes.c.orig 2008-08-08 02:01:55.000000000 -0500 -+++ lib/unicode/unicodeSimpleTypes.c -@@ -2198,7 +2198,7 @@ UnicodeNormalizeEncodingName(const char - - for (currentResult = result; *encodingName != '\0'; encodingName++) { - if (isalnum((int) *encodingName)) { -- *currentResult = tolower(*encodingName); -+ *currentResult = tolower((int)(*encodingName)); - currentResult++; - } - } diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bj ./patches/patch-bj --- ../../sysutils/open-vm-tools/patches/patch-bj 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bj 1970-01-01 09:00:00.000000000 +0900 @@ -1,38 +0,0 @@ -$NetBSD: patch-bj,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/user/hostinfoPosix.c.orig 2008-08-08 02:01:55.000000000 -0500 -+++ lib/user/hostinfoPosix.c -@@ -894,8 +894,8 @@ HostinfoGetCpuInfo(int nCpu, // - e = s + strlen(s); - - /* Skip leading and trailing while spaces */ -- for (; s < e && isspace(*s); s++); -- for (; s < e && isspace(e[-1]); e--); -+ for (; s < e && isspace((unsigned)*s); s++); -+ for (; s < e && isspace((unsigned)e[-1]); e--); - *e = 0; - - /* Free previous value */ -@@ -1224,7 +1224,9 @@ Hostinfo_ResetProcessState(const int *ke - { - int s, fd; - struct sigaction sa; -+#ifdef RLIMIT_AS - struct rlimit rlim; -+#endif - #ifdef __linux__ - int err; - uid_t euid; -@@ -1260,10 +1262,12 @@ Hostinfo_ResetProcessState(const int *ke - } - } - -+#ifdef RLIMIT_AS - if (getrlimit(RLIMIT_AS, &rlim) == 0) { - rlim.rlim_cur = rlim.rlim_max; - setrlimit(RLIMIT_AS, &rlim); - } -+#endif - - #ifdef __linux__ - /* diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bk ./patches/patch-bk --- ../../sysutils/open-vm-tools/patches/patch-bk 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bk 1970-01-01 09:00:00.000000000 +0900 @@ -1,31 +0,0 @@ -$NetBSD: patch-bk,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/user/utilPosix.c.orig 2008-08-08 02:01:55.000000000 -0500 -+++ lib/user/utilPosix.c -@@ -35,7 +35,7 @@ - #include - #include - --#if !__FreeBSD__ && !sun -+#if !__FreeBSD__ && !sun && !__NetBSD__ - # include - #endif - -@@ -85,7 +85,7 @@ - - - --#if !__FreeBSD__ && !sun -+#if !__FreeBSD__ && !sun && !__NetBSD__ - - /* - *----------------------------------------------------------------------------- -@@ -624,7 +624,7 @@ Util_GetSafeTmpDir(Bool useConf) // IN - #endif // __linux__ - - --#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) -+#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - /* - *---------------------------------------------------------------------------- - * diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bl ./patches/patch-bl --- ../../sysutils/open-vm-tools/patches/patch-bl 2008-08-31 15:36:48.000000000 +0900 +++ ./patches/patch-bl 1970-01-01 09:00:00.000000000 +0900 @@ -1,67 +0,0 @@ -$NetBSD: patch-bl,v 1.1 2008/08/31 06:36:48 scottr Exp $ - ---- lib/vixTools/vixTools.c.orig 2008-08-08 02:01:53.000000000 -0500 -+++ lib/vixTools/vixTools.c -@@ -74,7 +74,7 @@ - #endif - - /* Only Windows and Linux use impersonation functions. */ --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - #include "impersonate.h" - #endif - -@@ -702,7 +702,7 @@ VixTools_GetToolsPropertiesImpl(GuestApp - VixPropertyListImpl propList; - char *serializedBuffer = NULL; - size_t serializedBufferLength = 0; --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - char guestName[512]; - int osFamily; - char *packageList = NULL; -@@ -937,7 +937,7 @@ VixToolsSetProperties(VixCommandRequestH - GuestApp_Dict **confDictRef) // IN - { - VixError err = VIX_OK; --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - size_t serialBufferLength; - char *serialBuffer = NULL; - VixPropertyListImpl propList; -@@ -1734,7 +1734,7 @@ VixToolsMoveFile(VixCommandRequestHeader - * Be careful. Renaming a file to itself can cause it to be deleted. - * This should be a no-op anyway. - */ --#if !defined(sun) && !defined(__FreeBSD__) -+#if !defined(sun) && !defined(__FreeBSD__) && !defined(__NetBSD__) - if (File_IsSameFile(srcFilePathName, destFilePathName)) { - err = VIX_OK; - goto abort; -@@ -2716,7 +2716,7 @@ VixToolsImpersonateUserImplEx(char const - } - - /////////////////////////////////////////////////////////////////////// --#if defined(__FreeBSD__) || defined(sun) -+#if defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - err = VIX_E_NOT_SUPPORTED; - /////////////////////////////////////////////////////////////////////// - #elif defined(_WIN32) || defined(linux) -@@ -2913,7 +2913,7 @@ VixToolsLogoutUser(void *userToken) / - return; - } - --#if !defined(__FreeBSD__) && !defined(sun) -+#if !defined(__FreeBSD__) && !defined(sun) && !defined(__NetBSD__) - if (NULL != userToken) { - AuthToken authToken = (AuthToken) userToken; - Auth_CloseToken(authToken); -@@ -3105,7 +3105,7 @@ VixToolsProcessHgfsPacket(VixCommandHgfs - hgfsPacket = ((char *) requestMsg) + sizeof(*requestMsg); - hgfsPacketSize = requestMsg->hgfsPacketSize; - --#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__) -+#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__) && !defined(__NetBSD__) - /* - * Impersonation was okay, so let's give our packet to - * the HGFS server and forward the reply packet back. diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bm ./patches/patch-bm --- ../../sysutils/open-vm-tools/patches/patch-bm 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bm 1970-01-01 09:00:00.000000000 +0900 @@ -1,72 +0,0 @@ -$NetBSD: patch-bm,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- lib/wiper/wiperPosix.c.orig 2008-08-08 02:01:55.000000000 -0500 -+++ lib/wiper/wiperPosix.c -@@ -23,7 +23,7 @@ - * - */ - --#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__) -+#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__) - #error This file should not be compiled on this platform. - #endif - -@@ -31,12 +31,12 @@ - #include - #if defined(__linux__) || defined(sun) - # include --#elif defined(__FreeBSD__) || defined(__APPLE__) -+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) - # include - # include - # include - # include --# if __FreeBSD_version >= 500000 -+# if defined(__FreeBSD__) && __FreeBSD_version >= 500000 - # include - # endif /* __FreeBSD_version < 500000 */ - #endif -@@ -66,7 +66,7 @@ - - #if defined(sun) || defined(__linux__) - # define PROCFS "proc" --#elif defined(__FreeBSD__) || defined(__APPLE__) -+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) - # define PROCFS "procfs" - #endif - -@@ -196,7 +196,7 @@ WiperIsDiskDevice(MNTINFO *mnt, - return TRUE; - } - --#elif defined(__FreeBSD__) || defined(__APPLE__) /* } FreeBSD { */ -+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) /* } FreeBSD { */ - - static INLINE Bool - WiperIsDiskDevice(MNTINFO *mnt, // IN: file system being considered -@@ -210,7 +210,7 @@ WiperIsDiskDevice(MNTINFO *mnt, - * function, as a whole, does not even apply to OS X, so this caveat is - * only minor. - */ --#if __FreeBSD_version < 500000 -+#if defined(__NetBSD__) || __FreeBSD_version < 500000 - /* - * Before FreeBSD 5, device nodes had static major/minor numbers. - * (FreeBSD 5 included devfs which got rid of this concept.) So -@@ -511,14 +511,14 @@ WiperSinglePartition_GetSpace(const Wipe - uint64 *free, // OUT - uint64 *total) // OUT - { --#ifdef sun -+#if defined(sun) || defined(__NetBSD__) - struct statvfs statfsbuf; - #else - struct statfs statfsbuf; - #endif - ASSERT(p); - --#ifdef sun -+#if defined(sun) || defined(__NetBSD__) - if (statvfs(p->mountPoint, &statfsbuf) < 0) { - #else - if (Posix_Statfs(p->mountPoint, &statfsbuf) < 0) { diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bn ./patches/patch-bn --- ../../sysutils/open-vm-tools/patches/patch-bn 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bn 1970-01-01 09:00:00.000000000 +0900 @@ -1,37 +0,0 @@ -$NetBSD: patch-bn,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- scripts/netbsd/poweroff-vm-default.orig 2008-08-19 17:54:40.000000000 -0500 -+++ scripts/netbsd/poweroff-vm-default -@@ -0,0 +1,32 @@ -+#!/bin/sh -+########################################################## -+# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. -+# -+# This program is free software; you can redistribute it and/or modify it -+# under the terms of the GNU Lesser General Public License as published -+# by the Free Software Foundation version 2.1 and no later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public -+# License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public License -+# along with this program; if not, write to the Free Software Foundation, Inc., -+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+# -+########################################################## -+ -+########################################################################## -+# DO NOT modify this file directly as it will be overwritten the next -+# time the VMware Tools are installed. -+########################################################################## -+ -+echo `date` ": Executing '$0'" -+ -+scriptsdir="`dirname $0`/scripts/`basename $0`.d" -+if [ -d "$scriptsdir" ]; then -+ for scriptfile in "$scriptsdir"/*; do -+ [ -x "$scriptfile" ] && "$scriptfile" poweroff-vm -+ done -+fi diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bo ./patches/patch-bo --- ../../sysutils/open-vm-tools/patches/patch-bo 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bo 1970-01-01 09:00:00.000000000 +0900 @@ -1,37 +0,0 @@ -$NetBSD: patch-bo,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- scripts/netbsd/poweron-vm-default.orig 2008-08-19 17:54:40.000000000 -0500 -+++ scripts/netbsd/poweron-vm-default -@@ -0,0 +1,32 @@ -+#!/bin/sh -+########################################################## -+# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. -+# -+# This program is free software; you can redistribute it and/or modify it -+# under the terms of the GNU Lesser General Public License as published -+# by the Free Software Foundation version 2.1 and no later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public -+# License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public License -+# along with this program; if not, write to the Free Software Foundation, Inc., -+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+# -+########################################################## -+ -+########################################################################## -+# DO NOT modify this file directly as it will be overwritten the next -+# time the VMware Tools are installed. -+########################################################################## -+ -+echo `date` ": Executing '$0'" -+ -+scriptsdir="`dirname $0`/scripts/`basename $0`.d" -+if [ -d "$scriptsdir" ]; then -+ for scriptfile in "$scriptsdir"/*; do -+ [ -x "$scriptfile" ] && "$scriptfile" poweron-vm -+ done -+fi diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bp ./patches/patch-bp --- ../../sysutils/open-vm-tools/patches/patch-bp 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bp 1970-01-01 09:00:00.000000000 +0900 @@ -1,40 +0,0 @@ -$NetBSD: patch-bp,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- scripts/netbsd/resume-vm-default.orig 2008-08-19 17:54:40.000000000 -0500 -+++ scripts/netbsd/resume-vm-default -@@ -0,0 +1,35 @@ -+#!/bin/sh -+########################################################## -+# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. -+# -+# This program is free software; you can redistribute it and/or modify it -+# under the terms of the GNU Lesser General Public License as published -+# by the Free Software Foundation version 2.1 and no later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public -+# License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public License -+# along with this program; if not, write to the Free Software Foundation, Inc., -+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+# -+########################################################## -+ -+########################################################################## -+# DO NOT modify this file directly as it will be overwritten the next -+# time the VMware Tools are installed. -+########################################################################## -+ -+echo `date` ": Executing '$0'" -+ -+scriptsdir="`dirname $0`/scripts/`basename $0`.d" -+if [ -d "$scriptsdir" ]; then -+ for scriptfile in "$scriptsdir"/*; do -+ [ -x "$scriptfile" ] && "$scriptfile" resume-vm -+ done -+fi -+ -+# Start the network. -+/etc/rc.d/dhclient start diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bq ./patches/patch-bq --- ../../sysutils/open-vm-tools/patches/patch-bq 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bq 1970-01-01 09:00:00.000000000 +0900 @@ -1,42 +0,0 @@ -$NetBSD: patch-bq,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- scripts/netbsd/suspend-vm-default.orig 2008-08-19 17:54:40.000000000 -0500 -+++ scripts/netbsd/suspend-vm-default -@@ -0,0 +1,37 @@ -+#!/bin/sh -+########################################################## -+# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. -+# -+# This program is free software; you can redistribute it and/or modify it -+# under the terms of the GNU Lesser General Public License as published -+# by the Free Software Foundation version 2.1 and no later version. -+# -+# This program is distributed in the hope that it will be useful, but -+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+# or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public -+# License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public License -+# along with this program; if not, write to the Free Software Foundation, Inc., -+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+# -+########################################################## -+ -+########################################################################## -+# DO NOT modify this file directly as it will be overwritten the next -+# time the VMware Tools are installed. -+########################################################################## -+ -+echo `date` ": Executing '$0'" -+ -+scriptsdir="`dirname $0`/scripts/`basename $0`.d" -+if [ -d "$scriptsdir" ]; then -+ for scriptfile in "$scriptsdir"/*; do -+ [ -x "$scriptfile" ] && "$scriptfile" suspend-vm -+ done -+fi -+ -+ps auxw | grep -q dhclient -+if [ "$?" -eq 0 ]; then -+ dhclient -r -+fi diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-br ./patches/patch-br --- ../../sysutils/open-vm-tools/patches/patch-br 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-br 1970-01-01 09:00:00.000000000 +0900 @@ -1,16 +0,0 @@ -$NetBSD: patch-br,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- toolbox/toolbox-cmd.c.orig 2008-08-08 02:01:57.000000000 -0500 -+++ toolbox/toolbox-cmd.c -@@ -43,7 +43,10 @@ typedef void (*ToolboxHelpFunc)(char *pr - * Local Data - */ - --const typedef struct CmdTable { -+#if !defined(__NetBSD__) || __NetBSD_Version__ >= 400000000 // Work around gcc? const-const issue -+const -+#endif -+typedef struct CmdTable { - const char *command; /* The name of the command. */ - ToolboxCmdFunc func; /* The function to execute. */ - Bool requireRoot; /* Indicates whether root is required. */ diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bs ./patches/patch-bs --- ../../sysutils/open-vm-tools/patches/patch-bs 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bs 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-bs,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- vmware-user-suid-wrapper/locationsdb.c.orig 2008-08-08 02:01:56.000000000 -0500 -+++ vmware-user-suid-wrapper/locationsdb.c -@@ -26,7 +26,7 @@ - * link against lib/unixinstall. - */ - --#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) -+#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) && !defined(__NetBSD__) - # error This program is not supported on your platform. - #endif - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bt ./patches/patch-bt --- ../../sysutils/open-vm-tools/patches/patch-bt 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bt 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-bt,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- vmware-user-suid-wrapper/main.c.orig 2008-08-08 02:01:56.000000000 -0500 -+++ vmware-user-suid-wrapper/main.c -@@ -28,7 +28,7 @@ - * remove blocks in the blocking file system. - */ - --#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) -+#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) && !defined(__NetBSD__) - # error This program is not supported on your platform. - #endif - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bu ./patches/patch-bu --- ../../sysutils/open-vm-tools/patches/patch-bu 2008-08-31 15:36:49.000000000 +0900 +++ ./patches/patch-bu 1970-01-01 09:00:00.000000000 +0900 @@ -1,145 +0,0 @@ -$NetBSD: patch-bu,v 1.1 2008/08/31 06:36:49 scottr Exp $ - ---- vmware-user-suid-wrapper/wrapper-netbsd.c.orig 2008-08-19 17:54:40.000000000 -0500 -+++ vmware-user-suid-wrapper/wrapper-netbsd.c -@@ -0,0 +1,140 @@ -+/********************************************************* -+ * Copyright (C) 2007 VMware, Inc. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU Lesser General Public License as published -+ * by the Free Software Foundation version 2.1 and no later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public -+ * License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program; if not, write to the Free Software Foundation, Inc., -+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ *********************************************************/ -+ -+/* -+ * wrapper.c -- -+ * -+ * Platform specific code for the VMware User Agent setuid wrapper. -+ */ -+ -+ -+#include -+#include -+// #include // for nmount(2) -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "vmware.h" -+#include "wrapper.h" -+ -+ -+/* -+ * Global functions -+ */ -+ -+ -+#ifdef USES_LOCATIONS_DB -+/* -+ *----------------------------------------------------------------------------- -+ * -+ * BuildExecPath -- -+ * -+ * Determine & return path of vmware-user for use by execve(2). -+ * -+ * Results: -+ * TRUE on success, FALSE otherwise -+ * -+ * Side effects: -+ * None. -+ * -+ *----------------------------------------------------------------------------- -+ */ -+ -+Bool -+BuildExecPath(char *execPath, // OUT: Buffer to store executable's path -+ size_t execPathSize) // IN : size of execPath buffer -+{ -+ char tmpPath[MAXPATHLEN]; -+ int execLen; -+ -+ /* -+ * The locations database is the only path that's fixed, and it contains the -+ * paths to all the other paths selected during Tools configuration. The -+ * locations database file is only writable by root, so we can trust it. -+ */ -+ if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_BINDIR, tmpPath, sizeof tmpPath)) { -+ Error("could not obtain BINDIR\n"); -+ return FALSE; -+ } -+ -+ if (strlcat(tmpPath, -+ "/vmware-user-wrapper", sizeof tmpPath) >= sizeof tmpPath) { -+ Error("could not construct program filename\n"); -+ return FALSE; -+ } -+ -+ /* -+ * From readlink(2), "The readlink() system call does not append a NUL -+ * character to buf." (NB: This breaks if user ever replaces the symlink -+ * with the target.) -+ */ -+ if ((execLen = readlink(tmpPath, execPath, execPathSize - 1)) == -1) { -+ Error("could not resolve symlink: %s\n", strerror(errno)); -+ return FALSE; -+ } -+ -+ execPath[execLen] = '\0'; -+ -+ /* -+ * Now make sure that the target is actually part of our "trusted" -+ * directory. (Check that execPath has LIBDIR as a prefix and does -+ * not contain "..".) -+ */ -+ if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_LIBDIR, tmpPath, -+ sizeof tmpPath)) { -+ Error("could not obtain LIBDIR\n"); -+ return FALSE; -+ } -+ -+ if ((strncmp(execPath, tmpPath, strlen(tmpPath)) != 0) || -+ (strstr(execPath, "..") != NULL)) { -+ Error("vmware-user path untrusted\n"); -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+#endif // ifdef USES_LOCATIONS_DB -+ -+ -+/* -+ *---------------------------------------------------------------------------- -+ * -+ * CompatExec -- -+ * -+ * Simple platform-dependent execve() wrapper. -+ * -+ * Results: -+ * False. -+ * -+ * Side effects: -+ * This function may not return. -+ * -+ *---------------------------------------------------------------------------- -+ */ -+ -+Bool -+CompatExec(const char *path, char * const argv[], char * const envp[]) -+{ -+ execve(path, argv, envp); -+ return FALSE; -+} diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bv ./patches/patch-bv --- ../../sysutils/open-vm-tools/patches/patch-bv 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-bv 1970-01-01 09:00:00.000000000 +0900 @@ -1,23 +0,0 @@ -$NetBSD: patch-bv,v 1.2 2012/12/25 21:02:15 joerg Exp $ - ---- vmware-user/foreignVMToolsDaemon.c.orig 2008-08-08 07:01:56.000000000 +0000 -+++ vmware-user/foreignVMToolsDaemon.c -@@ -55,7 +55,7 @@ - #include - #include - #include --#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) -+#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) || defined(__NetBSD__) - #include - #else - #include -@@ -833,8 +833,7 @@ ForeignToolsSetProperties(ForeignVMTools - * Do some validation - */ - if ((NULL == asyncCommand) -- || (NULL == requestMsg) -- || (0 > requestMsg->bufferSize)) { -+ || (NULL == requestMsg)) { - err = VIX_E_INVALID_ARG; - goto abort; - } diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bw ./patches/patch-bw --- ../../sysutils/open-vm-tools/patches/patch-bw 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-bw 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-bw,v 1.2 2012/12/25 21:02:15 joerg Exp $ - ---- vmware-user/foreignVMToolsDaemon.h.orig 2008-08-08 07:01:56.000000000 +0000 -+++ vmware-user/foreignVMToolsDaemon.h -@@ -59,7 +59,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock - - #ifdef __APPLE__ - #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE --#elif defined(__FreeBSD__) || defined(sun) -+#elif defined(__FreeBSD__) || defined(sun) || defined(__NetBSD__) - #include - #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE - #else -@@ -72,7 +72,7 @@ VixError VIX_INIT_LOCK(VixLockType *lock - - typedef pthread_mutex_t VixLockType; - static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr); --VixError VIX_INIT_LOCK(VixLockType *lockPtr) -+static INLINE VixError VIX_INIT_LOCK(VixLockType *lockPtr) - { - int result; - pthread_mutexattr_t attr; diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-bx ./patches/patch-bx --- ../../sysutils/open-vm-tools/patches/patch-bx 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-bx 1970-01-01 09:00:00.000000000 +0900 @@ -1,33 +0,0 @@ -$NetBSD: patch-bx,v 1.2 2012/12/25 21:02:15 joerg Exp $ - ---- xferlogs/xferlogs.c.orig 2008-08-08 07:01:57.000000000 +0000 -+++ xferlogs/xferlogs.c -@@ -125,7 +125,7 @@ xmitFile(char *filename) //IN : file to - RpcVMX_Log("%s: %s: ver - %d", LOG_START_MARK, filename, LOG_VERSION); - while ((readLen = fread(buf, 1, sizeof buf, fp)) > 0 ) { - if (Base64_Encode(buf, readLen, base64Buf, sizeof base64B - 1, NULL)) { -- RpcVMX_Log(base64B); -+ RpcVMX_Log("%s", base64B); - } else { - Warning("Error in Base64_Encode\n"); - goto exit; -@@ -200,8 +200,8 @@ extractFile(char *filename) //IN: vmx lo - * Ignore the filename in the log, for obvious security reasons - * and create a new filename consiting of time and enumerator. - */ -- Str_Sprintf(fname, sizeof fname, "%d_%"FMTTIME".log", -- filenu++, time(NULL)); -+ Str_Sprintf(fname, sizeof fname, "%d_%lld.log", -+ filenu++, (long long)time(NULL)); - - /* - * Read the version information, if they dont match just warn -@@ -261,7 +261,7 @@ main(int argc, char *argv[]) - usage(); - return -1; - } if (argc == 2) { -- RpcVMX_Log(argv[1]); -+ RpcVMX_Log("%s", argv[1]); - return 0; - } - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-by ./patches/patch-by --- ../../sysutils/open-vm-tools/patches/patch-by 2009-09-22 16:08:05.000000000 +0900 +++ ./patches/patch-by 1970-01-01 09:00:00.000000000 +0900 @@ -1,60 +0,0 @@ -$NetBSD: patch-by,v 1.1 2009/09/22 07:08:05 taca Exp $ - ---- lib/hgfs/hgfsUtil.c.orig 2008-08-08 16:01:54.000000000 +0900 -+++ lib/hgfs/hgfsUtil.c -@@ -95,24 +95,19 @@ int - HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT: Time in UNIX format - uint64 ntTime) // IN: Time in Windows NT format - { --#ifndef VM_X86_64 - uint32 sec; - uint32 nsec; - - ASSERT(unixTime); -- /* We assume that time_t is 32bit */ -- ASSERT_ON_COMPILE(sizeof (unixTime->tv_sec) == 4); - -- /* Cap NT time values that are outside of Unix time's range */ -- -- if (ntTime >= UNIX_S32_MAX) { -- unixTime->tv_sec = 0x7FFFFFFF; -- unixTime->tv_nsec = 0; -- return 1; -- } --#else -- ASSERT(unixTime); --#endif -+ if (sizeof(unixTime->tv_sec) == 4) { -+ /* Cap NT time values that are outside of Unix time's range */ -+ if (ntTime >= UNIX_S32_MAX) { -+ unixTime->tv_sec = 0x7FFFFFFF; -+ unixTime->tv_nsec = 0; -+ return 1; -+ } -+ } - - if (ntTime < UNIX_EPOCH) { - unixTime->tv_sec = 0; -@@ -120,14 +115,14 @@ HgfsConvertFromNtTimeNsec(struct timespe - return -1; - } - --#ifndef VM_X86_64 -- Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); -- unixTime->tv_sec = sec; -- unixTime->tv_nsec = nsec * 100; --#else -- unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; -- unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; --#endif -+ if (sizeof(unixTime->tv_sec) == 4) { -+ Div643232(ntTime - UNIX_EPOCH, 10000000, &sec, &nsec); -+ unixTime->tv_sec = sec; -+ unixTime->tv_nsec = nsec * 100; -+ } else { -+ unixTime->tv_sec = (ntTime - UNIX_EPOCH) / 10000000; -+ unixTime->tv_nsec = ((ntTime - UNIX_EPOCH) % 10000000) * 100; -+ } - - return 0; - } diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-checkvm_checkvm.c ./patches/patch-checkvm_checkvm.c --- ../../sysutils/open-vm-tools/patches/patch-checkvm_checkvm.c 2013-12-20 14:37:02.000000000 +0900 +++ ./patches/patch-checkvm_checkvm.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,62 +0,0 @@ -$NetBSD: patch-checkvm_checkvm.c,v 1.2 2013/11/11 16:42:38 joerg Exp $ - ---- checkvm/checkvm.c.orig 2012-12-25 19:48:10.000000000 +0000 -+++ checkvm/checkvm.c -@@ -46,30 +46,6 @@ VM_EMBED_VERSION(CHECKVM_VERSION_STRING) - #ifdef __GNUC__ - - /* -- * outl and inl: Output or input a 32-bit word -- */ --static __inline__ void --outl( -- const uint32 port, -- uint32 val --) --{ -- __asm__ volatile("out%L0 (%%dx)" : :"a" (val), "d" (port)); --} -- --static __inline__ uint32 --inl( -- const uint32 port --) --{ -- uint32 ret; -- -- __asm__ volatile("in%L0 (%%dx)" : "=a" (ret) : "d" (port)); -- return ret; --} -- -- --/* - * getVersion - Read VM version & product code through backdoor - */ - void -@@ -77,7 +53,7 @@ getVersion(uint32 *version) - { - uint32 eax, ebx, ecx, edx; - -- __asm__ volatile("inl (%%dx)" : -+ __asm__ volatile("inl %%dx, %%eax" : - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : - "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION), - "2"(BDOOR_PORT) : "memory"); -@@ -94,7 +70,7 @@ getHWVersion(uint32 *hwVersion) - { - uint32 eax, ebx, ecx, edx; - -- __asm__ volatile("inl (%%dx)" : -+ __asm__ volatile("inl %%dx, %%eax" : - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : - "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION), - "2"(BDOOR_PORT) : "memory"); -@@ -110,7 +86,7 @@ getScreenSize(uint32 *screensize) - { - uint32 eax, ebx, ecx, edx; - -- __asm__ volatile("inl (%%dx)" : -+ __asm__ volatile("inl %%dx, %%eax" : - "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : - "0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE), - "2"(BDOOR_PORT) : "memory"); diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-configure.ac ./patches/patch-configure.ac --- ../../sysutils/open-vm-tools/patches/patch-configure.ac 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-configure.ac 1970-01-01 09:00:00.000000000 +0900 @@ -1,23 +0,0 @@ -$NetBSD: patch-configure.ac,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- configure.ac.orig 2008-08-08 07:01:58.000000000 +0000 -+++ configure.ac -@@ -111,6 +111,9 @@ case "$host_os" in - [linux*]) - os="linux" - ;; -+ [netbsd*]) -+ os="netbsd" -+ ;; - [freebsd*]) - os="freebsd" - ;; -@@ -573,7 +576,7 @@ if test "$with_dnet" = "yes"; then - - GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" - VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" -- if test "$DNET_CONFIG" == dumbnet-config; then -+ if test "$DNET_CONFIG" = dumbnet-config; then - AC_DEFINE([DNET_IS_DUMBNET], 1, [Define to 1 if substituting Debian's libdumbnet for libdnet.]) - fi - else diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-guestd_Makefile.am ./patches/patch-guestd_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-guestd_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-guestd_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,39 +0,0 @@ -$NetBSD: patch-guestd_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- guestd/Makefile.am.orig 2008-08-08 07:01:56.000000000 +0000 -+++ guestd/Makefile.am -@@ -50,8 +50,8 @@ vmware_guestd_LDADD += ../lib/system/lib - vmware_guestd_LDADD += ../lib/user/libUser.a - vmware_guestd_LDADD += ../lib/vixTools/libVixTools.a - vmware_guestd_LDADD += ../lib/vmBackupLib/libVmBackupLib.a --vmware_guestd_LDADD += ../lib/vmCheck/libVmCheck.a --vmware_guestd_LDADD += ../lib/vmSignal/libVmSignal.a -+vmware_guestd_LDADD += ../lib/vmCheck/libVmCheck.la -+vmware_guestd_LDADD += ../lib/vmSignal/libVmSignal.la - vmware_guestd_LDADD += ../lib/wiper/libWiper.a - # In the absence of the linker options --start-group and --end-group (which - # can't be put in LDADD), we need to bring the following libraries out of the -@@ -92,19 +92,11 @@ else - vmware_guestd_LINK = $(LINK) - endif - --if LINUX --if PAMD --if THIRTY_TWO_BIT_USERSPACE --pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd --else --pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd-x64 --endif !THIRTY_TWO_BIT_USERSPACE --endif PAMD --endif LINUX -+EGDIR = @datarootdir@/examples - - install-exec-hook: -- $(INSTALL) -d $(DESTDIR)/etc/vmware-tools -- echo 'disable-tools-version = "true"' > $(DESTDIR)/etc/vmware-tools/tools.conf -+ $(INSTALL) -d $(DESTDIR)${EGDIR}/vmware-tools -+ echo 'disable-tools-version = "true"' > $(DESTDIR)${EGDIR}/vmware-tools/tools.conf - - uninstall-hook: -- $(RM) -rf $(DESTDIR)/etc/vmware-tools -+ $(RM) -rf $(DESTDIR)${EGDIR}/vmware-tools diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-hgfsclient_Makefile.am ./patches/patch-hgfsclient_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-hgfsclient_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-hgfsclient_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,15 +0,0 @@ -$NetBSD: patch-hgfsclient_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- hgfsclient/Makefile.am.orig 2008-08-08 07:01:57.000000000 +0000 -+++ hgfsclient/Makefile.am -@@ -25,8 +25,8 @@ vmware_hgfsclient_LDADD += ../lib/hgfsBd - vmware_hgfsclient_LDADD += ../lib/rpcOut/libRpcOut.a - vmware_hgfsclient_LDADD += ../lib/string/libString.a - vmware_hgfsclient_LDADD += ../lib/toolsLogger/libToolsLogger.a --vmware_hgfsclient_LDADD += ../lib/vmCheck/libVmCheck.a --vmware_hgfsclient_LDADD += ../lib/vmSignal/libVmSignal.a -+vmware_hgfsclient_LDADD += ../lib/vmCheck/libVmCheck.la -+vmware_hgfsclient_LDADD += ../lib/vmSignal/libVmSignal.la - # In the absence of the linker options --start-group and --end-group (which can't - # be put in LDADD), we need to bring the following libraries out of the alphebetical - # order so their symbols are properly resolved. diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_dataMap_dataMap_c ./patches/patch-lib_dataMap_dataMap_c --- ../../sysutils/open-vm-tools/patches/patch-lib_dataMap_dataMap_c 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_dataMap_dataMap_c 2015-06-13 07:23:01.000000000 +0900 @@ -0,0 +1,11 @@ +--- lib/dataMap/dataMap.c~ 2015-03-20 07:53:25.000000000 +0900 ++++ lib/dataMap/dataMap.c 2015-06-13 07:22:26.000000000 +0900 +@@ -1012,7 +1012,7 @@ + */ + + static Bool +-IsPrintable(const char *str, // IN ++IsPrintable(const unsigned char *str, // IN + int32 strLen, // IN + int32 *len) // OUT + { diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_dynxdr_dynxdr_c ./patches/patch-lib_dynxdr_dynxdr_c --- ../../sysutils/open-vm-tools/patches/patch-lib_dynxdr_dynxdr_c 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_dynxdr_dynxdr_c 2015-06-13 10:22:43.000000000 +0900 @@ -0,0 +1,82 @@ +--- lib/dynxdr/dynxdr.c.orig 2015-03-20 07:53:25.000000000 +0900 ++++ lib/dynxdr/dynxdr.c 2015-06-13 10:22:14.000000000 +0900 +@@ -86,7 +86,7 @@ + # define DYNXDR_INLINE_LEN_T u_int + #endif + +- ++#if 0 + /* + *----------------------------------------------------------------------------- + * +@@ -112,7 +112,7 @@ + DynXdrData *priv = (DynXdrData *) xdrs->x_private; + return DynBuf_Append(&priv->data, data, len); + } +- ++#endif + + /* + *----------------------------------------------------------------------------- +@@ -132,7 +132,7 @@ + * + *----------------------------------------------------------------------------- + */ +- ++#if 0 + static u_int + DynXdrGetPos(DYNXDR_GETPOS_CONST XDR *xdrs) // IN + { +@@ -140,7 +140,6 @@ + return (u_int) DynBuf_GetSize(&priv->data); + } + +- + /* + *----------------------------------------------------------------------------- + * +@@ -169,6 +168,7 @@ + } + return FALSE; + } ++#endif + + + #if defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL))) +@@ -205,7 +205,7 @@ + } + #endif + +- ++#if 0 + /* + *----------------------------------------------------------------------------- + * +@@ -283,7 +283,7 @@ + + return retAddr; + } +- ++#endif + + /* + *----------------------------------------------------------------------------- +@@ -313,13 +313,17 @@ + */ + #if !defined(sun) || (defined(sun) && !defined(_KERNEL)) + NULL, /* x_getlong */ ++#if 0 + DynXdrPutLong, /* x_putlong */ + #endif ++#endif + NULL, /* x_getbytes */ ++#if 0 + DynXdrPutBytes, /* x_putbytes */ +- DynXdrGetPos, /* x_getpostn */ ++ DynXdrGetPos, /* x_getpostn */ + DynXdrSetPos, /* x_setpostn */ + DynXdrInline, /* x_inline */ ++#endif + NULL, /* x_destroy */ + #if defined(__GLIBC__) + NULL, /* x_getint32 */ diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_file_fileIOPosix_c ./patches/patch-lib_file_fileIOPosix_c --- ../../sysutils/open-vm-tools/patches/patch-lib_file_fileIOPosix_c 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_file_fileIOPosix_c 2015-06-13 08:16:04.000000000 +0900 @@ -0,0 +1,11 @@ +--- lib/file/fileIOPosix.c~ 2015-03-20 07:53:25.000000000 +0900 ++++ lib/file/fileIOPosix.c 2015-06-13 08:15:28.000000000 +0900 +@@ -78,7 +78,7 @@ + #include + #include + #else +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__NetBSD__) + #include + #include + #else diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_file_fileInt_h ./patches/patch-lib_file_fileInt_h --- ../../sysutils/open-vm-tools/patches/patch-lib_file_fileInt_h 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_file_fileInt_h 2015-06-13 11:25:44.000000000 +0900 @@ -0,0 +1,12 @@ +--- lib/file/fileInt.h~ 2015-03-20 07:53:25.000000000 +0900 ++++ lib/file/fileInt.h 2015-06-13 11:25:30.000000000 +0900 +@@ -40,7 +40,8 @@ + */ + #define MAX_SUPPORTED_FILE_SIZE CONST64U(0x400000000000) + +-#if defined __linux__ ++/* to compile, define temporarily (for NetBSD) */ ++#if defined(__linux__) || defined(__NetBSD__) + /* + * These magic constants are used only for parsing Linux statfs data. + * So they make sense only for Linux build. If you need them on other OSes, diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_file_fileTempPosix_c ./patches/patch-lib_file_fileTempPosix_c --- ../../sysutils/open-vm-tools/patches/patch-lib_file_fileTempPosix_c 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_file_fileTempPosix_c 2015-06-13 10:18:39.000000000 +0900 @@ -0,0 +1,28 @@ +--- lib/file/fileTempPosix.c~ 2015-06-13 10:12:27.000000000 +0900 ++++ lib/file/fileTempPosix.c 2015-06-13 10:16:00.000000000 +0900 +@@ -243,7 +243,7 @@ + return userName; + } + +- ++#if 0 + /* + *----------------------------------------------------------------------------- + * +@@ -305,7 +305,6 @@ + return result; + } + +- + /* + *----------------------------------------------------------------------------- + * +@@ -440,7 +439,7 @@ + } + #endif // __linux__ + +- ++#endif + /* + *----------------------------------------------------------------------------- + * diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServer.c ./patches/patch-lib_hgfsServer_hgfsServer.c --- ../../sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServer.c 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-lib_hgfsServer_hgfsServer.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,24 +0,0 @@ -$NetBSD: patch-lib_hgfsServer_hgfsServer.c,v 1.1 2012/12/25 21:02:15 joerg Exp $ - ---- lib/hgfsServer/hgfsServer.c.orig 2012-12-25 19:41:00.000000000 +0000 -+++ lib/hgfsServer/hgfsServer.c -@@ -2441,7 +2441,7 @@ HgfsServerStatFs(const char *pathName, / - * delimiter on copy. Allow 0 length drives so that hidden feature "" can - * work. - */ -- if (pathLength < 0 || pathLength >= sizeof p.mountPoint) { -+ if (pathLength >= sizeof p.mountPoint) { - LOG(4, ("HgfsServerStatFs: could not get the volume name\n")); - return FALSE; - } -@@ -3305,10 +3305,6 @@ HgfsCreateAndCacheFileNode(HgfsFileOpenI - * for the share name, should be none. - */ - len = CPName_GetComponentGeneric(openInfo->cpName, inEnd, "", &next); -- if (len < 0) { -- LOG(4, ("HgfsServerGetAccess: get first component failed\n")); -- return FALSE; -- } - - /* See if we are dealing with the base of the namespace */ - if (!len) { diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServerLinux.c ./patches/patch-lib_hgfsServer_hgfsServerLinux.c --- ../../sysutils/open-vm-tools/patches/patch-lib_hgfsServer_hgfsServerLinux.c 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-lib_hgfsServer_hgfsServerLinux.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,13 +0,0 @@ -$NetBSD: patch-lib_hgfsServer_hgfsServerLinux.c,v 1.1 2012/12/25 21:02:15 joerg Exp $ - ---- lib/hgfsServer/hgfsServerLinux.c.orig 2012-12-25 19:41:43.000000000 +0000 -+++ lib/hgfsServer/hgfsServerLinux.c -@@ -544,7 +544,7 @@ HgfsServerGetOpenFlags(HgfsOpenFlags fla - - arraySize = ARRAYSIZE(HgfsServerOpenFlags); - -- if (flagsIn < 0 || flagsIn >= arraySize) { -+ if (flagsIn >= arraySize) { - Log("HgfsServerGetOpenFlags: Invalid HgfsOpenFlags %d\n", flagsIn); - return FALSE; - } diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_include_posix_h ./patches/patch-lib_include_posix_h --- ../../sysutils/open-vm-tools/patches/patch-lib_include_posix_h 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_include_posix_h 2015-06-12 23:54:08.000000000 +0900 @@ -0,0 +1,31 @@ +--- lib/include/posix.h-orig 2015-03-20 07:53:25.000000000 +0900 ++++ lib/include/posix.h 2015-06-12 23:53:37.000000000 +0900 +@@ -194,9 +194,11 @@ + Posix_GetHostByName(ConstUnicode name) // IN + { + struct hostent *newhostent; +- int error; + struct hostent he; ++#ifndef __NetBSD__ ++ int error; + char buffer[1024]; ++#endif + struct hostent *phe = &he; + char **p; + int i; +@@ -204,11 +206,15 @@ + + ASSERT(name); + ++#ifdef __NetBSD__ ++ if (( phe = gethostbyname(name) )) { ++#else + if ((gethostbyname_r(name, &he, buffer, sizeof buffer, + #if !defined(sun) && !defined(SOLARIS) && !defined(SOL10) + &phe, + #endif + &error) == 0) && phe) { ++#endif + + newhostent = (struct hostent *)Util_SafeMalloc(sizeof *newhostent); + newhostent->h_name = Unicode_Alloc(phe->h_name, diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_include_vm__product_h ./patches/patch-lib_include_vm__product_h --- ../../sysutils/open-vm-tools/patches/patch-lib_include_vm__product_h 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_include_vm__product_h 2015-06-12 23:55:55.000000000 +0900 @@ -0,0 +1,11 @@ +--- lib/include/vm_product.h.orig 2015-03-20 07:53:25.000000000 +0900 ++++ lib/include/vm_product.h 2015-06-12 23:55:28.000000000 +0900 +@@ -525,6 +525,8 @@ + # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Windows" + #elif defined(__FreeBSD__) + # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for FreeBSD" ++#elif defined(__NetBSD__) ++# define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for NetBSD" + #elif defined(sun) + # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Solaris" + #elif defined(__APPLE__) diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_include_vmci__sockets_h ./patches/patch-lib_include_vmci__sockets_h --- ../../sysutils/open-vm-tools/patches/patch-lib_include_vmci__sockets_h 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_include_vmci__sockets_h 2015-06-13 07:20:00.000000000 +0900 @@ -0,0 +1,20 @@ +--- lib/include/vmci_sockets.h~ 2015-03-20 07:53:25.000000000 +0900 ++++ lib/include/vmci_sockets.h 2015-06-13 07:19:54.000000000 +0900 +@@ -487,7 +487,7 @@ + } + # endif // !NT_INCLUDED + #else // _WIN32 +-#if (defined(linux) && !defined(VMKERNEL)) || (defined(__APPLE__)) ++#if (defined(linux) && !defined(VMKERNEL)) || (defined(__APPLE__)) || (defined(__NetBSD__)) + # if defined(linux) && defined(__KERNEL__) + void VMCISock_KernelRegister(void); + void VMCISock_KernelDeregister(void); +@@ -507,7 +507,7 @@ + /** \cond PRIVATE */ + # define VMCI_SOCKETS_DEFAULT_DEVICE "/dev/vsock" + # define VMCI_SOCKETS_CLASSIC_ESX_DEVICE "/vmfs/devices/char/vsock/vsock" +-# if defined(linux) ++# if defined(linux) || defined(__NetBSD__) + # define VMCI_SOCKETS_VERSION 1972 + # define VMCI_SOCKETS_GET_AF_VALUE 1976 + # define VMCI_SOCKETS_GET_LOCAL_CID 1977 diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_panic_panic.c ./patches/patch-lib_panic_panic.c --- ../../sysutils/open-vm-tools/patches/patch-lib_panic_panic.c 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-lib_panic_panic.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,22 +0,0 @@ -$NetBSD: patch-lib_panic_panic.c,v 1.1 2012/12/25 21:02:15 joerg Exp $ - ---- lib/panic/panic.c.orig 2012-12-25 19:42:53.000000000 +0000 -+++ lib/panic/panic.c -@@ -497,7 +497,7 @@ Panic_Panic(const char *format, - case 0: - break; - case 1: -- Log(buf); -+ Log("%s", buf); - Log("Panic loop\n"); - default: - fprintf(stderr, "Panic loop\n"); -@@ -510,7 +510,7 @@ Panic_Panic(const char *format, - * the log file on exit. - */ - -- Log(buf); -+ Log("%s", buf); - Util_Backtrace(0); - Log_SetAlwaysKeep(TRUE); - diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_string_str_c ./patches/patch-lib_string_str_c --- ../../sysutils/open-vm-tools/patches/patch-lib_string_str_c 1970-01-01 09:00:00.000000000 +0900 +++ ./patches/patch-lib_string_str_c 2015-06-13 11:40:55.000000000 +0900 @@ -0,0 +1,10 @@ +--- lib/string/str.c~ 2015-03-20 07:53:25.000000000 +0900 ++++ lib/string/str.c 2015-06-13 11:40:24.000000000 +0900 +@@ -69,6 +69,7 @@ + */ + # if !(defined(__linux__) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 500000)) || \ ++ (defined(__NetBSD__) || \ + defined(sun)) + extern int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args); + # endif diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_vmCheck_Makefile.am ./patches/patch-lib_vmCheck_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-lib_vmCheck_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-lib_vmCheck_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,14 +0,0 @@ -$NetBSD: patch-lib_vmCheck_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- lib/vmCheck/Makefile.am.orig 2008-08-08 07:01:50.000000000 +0000 -+++ lib/vmCheck/Makefile.am -@@ -15,7 +15,6 @@ - ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - ################################################################################ - --noinst_LIBRARIES = libVmCheck.a -+noinst_LTLIBRARIES = libVmCheck.la - --libVmCheck_a_SOURCES = --libVmCheck_a_SOURCES += vmcheck.c -+libVmCheck_la_SOURCES = vmcheck.c diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-lib_vmSignal_Makefile.am ./patches/patch-lib_vmSignal_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-lib_vmSignal_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-lib_vmSignal_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,15 +0,0 @@ -$NetBSD: patch-lib_vmSignal_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- lib/vmSignal/Makefile.am.orig 2013-03-31 21:45:43.000000000 +0000 -+++ lib/vmSignal/Makefile.am -@@ -15,7 +15,7 @@ - ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - ################################################################################ - --noinst_LIBRARIES = libVmSignal.a -+noinst_LTLIBRARIES = libVmSignal.la - --libVmSignal_a_SOURCES = --libVmSignal_a_SOURCES += vmsignal.c -+libVmSignal_la_SOURCES = -+libVmSignal_la_SOURCES += vmsignal.c diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-libguestlib_Makefile.am ./patches/patch-libguestlib_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-libguestlib_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-libguestlib_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,20 +0,0 @@ -$NetBSD: patch-libguestlib_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- libguestlib/Makefile.am.orig 2008-08-08 07:01:57.000000000 +0000 -+++ libguestlib/Makefile.am -@@ -26,12 +26,14 @@ libguestlib_la_LIBADD += ../lib/stubs/sh - # order so their symbols are properly resolved. - libguestlib_la_LIBADD += ../lib/message/shared/libMessage.la - libguestlib_la_LIBADD += ../lib/backdoor/shared/libBackdoor.la -+libguestlib_la_LIBADD += ../lib/vmCheck/libVmCheck.la -+libguestlib_la_LIBADD += ../lib/vmSignal/libVmSignal.la - - libguestlib_la_SOURCES = - libguestlib_la_SOURCES += vmGuestLib.c - libguestlib_la_SOURCES += vmGuestLibPanic.c - --libguestlib_la_LDFLAGS = -+libguestlib_la_LDFLAGS = -no-undefined - # We require GCC, so we're fine passing compiler-specific flags. - # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD - libguestlib_la_LDFLAGS += -Wl,-lc diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-scripts_Makefile.am ./patches/patch-scripts_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-scripts_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-scripts_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,15 +0,0 @@ -$NetBSD: patch-scripts_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- scripts/Makefile.am.orig 2008-08-08 07:01:58.000000000 +0000 -+++ scripts/Makefile.am -@@ -1,7 +1,7 @@ --confdir = /etc/vmware-tools -+EGDIR = @datarootdir@/examples -+confdir = ${EGDIR}/vmware-tools - --conf_SCRIPTS = ./common/vm-support --conf_SCRIPTS += $(MODULES_OS)/poweron-vm-default -+conf_SCRIPTS = $(MODULES_OS)/poweron-vm-default - conf_SCRIPTS += $(MODULES_OS)/poweroff-vm-default - conf_SCRIPTS += $(MODULES_OS)/suspend-vm-default - conf_SCRIPTS += $(MODULES_OS)/resume-vm-default diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-toolbox_Makefile.am ./patches/patch-toolbox_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-toolbox_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-toolbox_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,15 +0,0 @@ -$NetBSD: patch-toolbox_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- toolbox/Makefile.am.orig 2008-08-08 07:01:57.000000000 +0000 -+++ toolbox/Makefile.am -@@ -26,8 +26,8 @@ COMMON += ../lib/rpcOut/libRpcOut.a - COMMON += ../lib/string/libString.a - COMMON += ../lib/system/libSystem.a - COMMON += ../lib/user/libUser.a --COMMON += ../lib/vmCheck/libVmCheck.a --COMMON += ../lib/vmSignal/libVmSignal.a -+COMMON += ../lib/vmCheck/libVmCheck.la -+COMMON += ../lib/vmSignal/libVmSignal.la - COMMON += ../lib/wiper/libWiper.a - # In the absence of the linker options --start-group and --end-group (which - # can't be put in LDADD), we need to bring the following libraries out of diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-toolbox_toolboxcmd-stat.c ./patches/patch-toolbox_toolboxcmd-stat.c --- ../../sysutils/open-vm-tools/patches/patch-toolbox_toolboxcmd-stat.c 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-toolbox_toolboxcmd-stat.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,37 +0,0 @@ -$NetBSD: patch-toolbox_toolboxcmd-stat.c,v 1.1 2012/12/25 21:02:15 joerg Exp $ - ---- toolbox/toolboxcmd-stat.c.orig 2012-12-25 19:51:17.000000000 +0000 -+++ toolbox/toolboxcmd-stat.c -@@ -96,10 +96,6 @@ Stat_ProcessorSpeed(void) - bp.in.cx.halfs.low = BDOOR_CMD_GETMHZ; - Backdoor(&bp); - speed = bp.out.ax.word; -- if (speed < 0) { -- fprintf(stderr, "Unable to get processor speed\n"); -- return EX_TEMPFAIL; -- } - printf("%u MHz\n", speed); - return EXIT_SUCCESS; - } -@@ -130,10 +126,6 @@ Stat_MemorySize(void) - bp.in.cx.halfs.low = BDOOR_CMD_GETMEMSIZE; - Backdoor(&bp); - memsize = bp.out.ax.word; -- if (memsize < 0) { -- fprintf(stderr, "Unable to get memory size\n"); -- return EX_TEMPFAIL; -- } - printf("%u MB\n", memsize); - return EXIT_SUCCESS; - } -@@ -166,10 +158,6 @@ Stat_HostTime(void) - bp.in.cx.halfs.low = BDOOR_CMD_GETTIME; - Backdoor(&bp); - time = bp.out.ax.word; -- if (time < 0) { -- fprintf(stderr, "Unable to get host time\n"); -- return EX_TEMPFAIL; -- } - sprintf(buf, "%u", time); - strptime(buf, "%s", &tm); - strftime(buf, sizeof(buf), "%d %b %Y %H:%M:%S", &tm); diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-vmware-user_Makefile.am ./patches/patch-vmware-user_Makefile.am --- ../../sysutils/open-vm-tools/patches/patch-vmware-user_Makefile.am 2013-04-01 21:25:17.000000000 +0900 +++ ./patches/patch-vmware-user_Makefile.am 1970-01-01 09:00:00.000000000 +0900 @@ -1,15 +0,0 @@ -$NetBSD: patch-vmware-user_Makefile.am,v 1.1 2013/04/01 12:25:17 joerg Exp $ - ---- vmware-user/Makefile.am.orig 2013-03-31 21:25:01.000000000 +0000 -+++ vmware-user/Makefile.am -@@ -60,8 +60,8 @@ else - endif - vmware_user_LDADD += ../lib/user/libUser.a - vmware_user_LDADD += ../lib/vixTools/libVixTools.a --vmware_user_LDADD += ../lib/vmCheck/libVmCheck.a --vmware_user_LDADD += ../lib/vmSignal/libVmSignal.a -+vmware_user_LDADD += ../lib/vmCheck/libVmCheck.la -+vmware_user_LDADD += ../lib/vmSignal/libVmSignal.la - vmware_user_LDADD += ../lib/wiper/libWiper.a - # In the absence of the linker options --start-group and --end-group (which - # can't be put in LDADD), we need to bring the following libraries out of diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-vmware-user_copyPaste.c ./patches/patch-vmware-user_copyPaste.c --- ../../sysutils/open-vm-tools/patches/patch-vmware-user_copyPaste.c 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-vmware-user_copyPaste.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,31 +0,0 @@ -$NetBSD: patch-vmware-user_copyPaste.c,v 1.1 2012/12/25 21:02:15 joerg Exp $ - ---- vmware-user/copyPaste.c.orig 2012-12-25 19:45:44.000000000 +0000 -+++ vmware-user/copyPaste.c -@@ -655,14 +655,6 @@ CopyPasteSelectionGetCB(GtkWidget - const size_t origTextLen = textLen; - Bool freeBegin = FALSE; - -- if (len < 0) { -- Debug("CopyPasteSelectionGetCB: error getting next component\n"); -- if (text) { -- free(text); -- } -- return; -- } -- - /* - * A URI list will expect the provided path to be escaped. If we cannot - * escape the path for some reason we just use the unescaped version and -@@ -1761,11 +1753,6 @@ CopyPasteRpcInGHGetNextFileCB(char const - cpNameSize = CPNameUtil_ConvertToRoot(fileName, - sizeof resultBuffer - (fileNameSize + 1), - resultBuffer + fileNameSize + 1); -- if (cpNameSize < 0) { -- Warning("CopyPasteRpcInGHGetNextFileCB: could not convert to CPName\n"); -- return RpcIn_SetRetVals(result, resultLen, -- "error on CPName conversion", FALSE); -- } - - /* Set manually because RpcIn_SetRetVals() assumes no NUL characters */ - *result = resultBuffer; diff -urN --exclude=CVS ../../sysutils/open-vm-tools/patches/patch-vmware-user_dnd.c ./patches/patch-vmware-user_dnd.c --- ../../sysutils/open-vm-tools/patches/patch-vmware-user_dnd.c 2012-12-26 06:02:15.000000000 +0900 +++ ./patches/patch-vmware-user_dnd.c 1970-01-01 09:00:00.000000000 +0900 @@ -1,32 +0,0 @@ -$NetBSD: patch-vmware-user_dnd.c,v 1.1 2012/12/25 21:02:15 joerg Exp $ - ---- vmware-user/dnd.c.orig 2012-12-25 19:46:26.000000000 +0000 -+++ vmware-user/dnd.c -@@ -943,12 +943,6 @@ DnDRpcInGetNextFileCB(char const **resul - cpNameSize = CPNameUtil_ConvertToRoot(fileName, - sizeof resultBuffer - (fileNameSize + 1), - resultBuffer + fileNameSize + 1); -- if (cpNameSize < 0) { -- Warning("DnDRpcInGetNextFileCB: could not convert to CPName\n"); -- DnDGHCancel(mainWnd); -- return RpcIn_SetRetVals(result, resultLen, -- "error on CPName conversion", FALSE); -- } - - /* Set manually because RpcIn_SetRetVals() assumes no NUL characters */ - *result = resultBuffer; -@@ -1223,14 +1217,6 @@ DnDGtkDataRequestCB(GtkWidget *widget, - const size_t origTextLen = textLen; - Bool freeBegin = FALSE; - -- if (len < 0) { -- Log("DnDGtkDataRequestCB: error getting next component\n"); -- if (text) { -- free(text); -- } -- return; -- } -- - /* - * A URI list will expect the provided path to be escaped. If we cannot - * escape the path for some reason we just use the unescaped version and