[Midnightbsd-cvs] mports [21647] trunk/emulators: add experimental open-vm-tools port
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Aug 13 22:40:08 EDT 2016
Revision: 21647
http://svnweb.midnightbsd.org/mports/?rev=21647
Author: laffer1
Date: 2016-08-13 22:40:07 -0400 (Sat, 13 Aug 2016)
Log Message:
-----------
add experimental open-vm-tools port
Modified Paths:
--------------
trunk/emulators/Makefile
Added Paths:
-----------
trunk/emulators/open-vm-tools/
trunk/emulators/open-vm-tools/Makefile
trunk/emulators/open-vm-tools/distinfo
trunk/emulators/open-vm-tools/files/
trunk/emulators/open-vm-tools/files/patch-base64rename
trunk/emulators/open-vm-tools/files/patch-configure
trunk/emulators/open-vm-tools/files/patch-freebsd-8
trunk/emulators/open-vm-tools/files/patch-getpwnam
trunk/emulators/open-vm-tools/files/patch-guestApp.c
trunk/emulators/open-vm-tools/files/patch-hgfsProto.h
trunk/emulators/open-vm-tools/files/patch-hgfsmounter-Makefile.in
trunk/emulators/open-vm-tools/files/patch-lib__include__vm_assert.h
trunk/emulators/open-vm-tools/files/patch-lib__include__vm_atomic.h
trunk/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c
trunk/emulators/open-vm-tools/files/patch-lib_include_vmware_tools_log.h
trunk/emulators/open-vm-tools/files/patch-libguestlib-Makefile
trunk/emulators/open-vm-tools/files/patch-libvmtools__i18n.c
trunk/emulators/open-vm-tools/files/patch-modules-Makefile.in
trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h
trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c
trunk/emulators/open-vm-tools/files/patch-net_compat.h
trunk/emulators/open-vm-tools/files/patch-scripts-Makefile
trunk/emulators/open-vm-tools/files/patch-scripts-network
trunk/emulators/open-vm-tools/files/patch-scripts_linux_pam.d_vmtoolsd
trunk/emulators/open-vm-tools/files/patch-toolbox__toolboxcmd-shrink.c
trunk/emulators/open-vm-tools/files/patch-util_misc.c
trunk/emulators/open-vm-tools/files/patch-vm_basic_asm.h
trunk/emulators/open-vm-tools/files/patch-vm_basic_types.h
trunk/emulators/open-vm-tools/files/patch-vmblock-vfsops.c
trunk/emulators/open-vm-tools/files/patch-vmblock-vnops.c
trunk/emulators/open-vm-tools/files/patch-vmblockmounter-Makefile.in
trunk/emulators/open-vm-tools/files/patch-vmhgfs-Makefile
trunk/emulators/open-vm-tools/files/patch-vmhgfs-kernelStubs.h
trunk/emulators/open-vm-tools/files/patch-vmhgfs-os.c
trunk/emulators/open-vm-tools/files/patch-vmhgfs-vfsops.c
trunk/emulators/open-vm-tools/files/patch-vmhgfs-vnopscommon.c
trunk/emulators/open-vm-tools/files/patch-vmmemctl-os.c
trunk/emulators/open-vm-tools/files/patch-vmtoolsd-Makefile.in
trunk/emulators/open-vm-tools/files/patch-wrapper-Makefile.am
trunk/emulators/open-vm-tools/files/pkg-message.in
trunk/emulators/open-vm-tools/files/vmware-guestd.in
trunk/emulators/open-vm-tools/files/vmware-kmod.in
trunk/emulators/open-vm-tools/pkg-descr
trunk/emulators/open-vm-tools/pkg-plist
Modified: trunk/emulators/Makefile
===================================================================
--- trunk/emulators/Makefile 2016-08-14 01:53:33 UTC (rev 21646)
+++ trunk/emulators/Makefile 2016-08-14 02:40:07 UTC (rev 21647)
@@ -17,6 +17,7 @@
SUBDIR += linux_base-c6
SUBDIR += linux_base-f10
SUBDIR += mtools
+SUBDIR += open-vm-tools
SUBDIR += pearpc
SUBDIR += qemu
SUBDIR += rtc
Added: trunk/emulators/open-vm-tools/Makefile
===================================================================
--- trunk/emulators/open-vm-tools/Makefile (rev 0)
+++ trunk/emulators/open-vm-tools/Makefile 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,85 @@
+# Created by: mbr at FreeBSD.org
+# $FreeBSD: head/emulators/open-vm-tools/Makefile 412346 2016-04-01 14:00:51Z mat $
+# $MidnightBSD$
+
+PORTNAME= open-vm-tools
+PORTVERSION= ${BUILD_VER}
+PORTREVISION= 12
+PORTEPOCH= 1
+CATEGORIES= emulators
+MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/stable-9.4.x
+DISTNAME= open-vm-tools-${RELEASE_VER}-${BUILD_VER}
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT?= Open VMware tools for FreeBSD VMware guests
+
+LICENSE= lgpl2.1
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+RELEASE_VER= 9.4.0
+BUILD_VER= 1280544
+
+OPTIONS_DEFINE= X11 LIBNOTIFY UNITY FUSE DNET ICU
+OPTIONS_DEFAULT= X11 LIBNOTIFY FUSE DNET ICU
+OPTIONS_SUB=
+
+DNET_DESC= libdnet support
+LIBNOTIFY_DESC= Desktop notification support
+UNITY_DESC= liburiparser support
+
+X11_CONFIGURE_WITH= x gtk2 gtkmm
+X11_LDFLAGS= -L${LOCALBASE}/lib
+X11_USE= xorg=x11,ice,sm,xext,xineramaproto,xinerama,xrandr,xrender,xtst \
+ gnome=gtk20,gtkmm24
+X11_USES= fuse
+LIBNOTIFY_LIB_DEPENDS= libnotify.so:devel/libnotify
+UNITY_CONFIGURE_ENV= CUSTOM_URIPARSER_CPPFLAGS="-I${LOCALBASE}/include/uriparser"
+UNITY_LIB_DEPENDS= liburiparser.so:net/uriparser
+UNITY_CONFIGURE_ENABLE= unity
+DNET_CONFIGURE_WITH= dnet
+DNET_LIB_DEPENDS= libdnet.so:net/libdnet
+ICU_CONFIGURE_WITH= icu
+ICU_LIB_DEPENDS= libicuuc.so:devel/icu
+
+WRKSRC= ${WRKDIR}/open-vm-tools-${RELEASE_VER}-${BUILD_VER}
+GNU_CONFIGURE= yes
+USES= pkgconfig kmod libtool autotools:automake
+USE_GNOME= glib20
+USE_LDCONFIG= yes
+CPPFLAGS+= -Wno-deprecated-declarations -D__FreeBSD__=9 -DFreeBSD_version=901000
+
+SSP_UNSAFE= kernel module does not support ssp
+
+CONFIGURE_ARGS+= --without-procps --sysconfdir=${LOCALBASE}/etc
+
+CONFLICTS+= vmware-guestd[0-9]* vmware-tools[0-9]*
+SUB_FILES= pkg-message
+
+USE_RC_SUBR= vmware-guestd vmware-kmod
+
+.include <bsd.mport.options.mk>
+
+.if ${PORT_OPTIONS:MX11}
+CONFLICTS= open-vm-tools-nox11-[0-9]*
+.else
+CONFLICTS= open-vm-tools-[0-9]*
+.endif
+
+.include <bsd.port.pre.mk>
+
+post-build:
+ cd ${WRKSRC} && make MODULES=vmhgfs && make MODULES=vmblock && make MODULES=vmmemctl && make MODULES=vmxnet
+ cd ${WRKSRC}/modules && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} ${FAKE_MAKEARGS}
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers
+ ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/input
+ ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmmemctl.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmmemctl.ko
+ ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmxnet.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmxnet.ko
+ ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmhgfs.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmhgfs.ko
+ ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmblock.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmblock.ko
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/vmware/
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/scripts/
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/open-vm-tools/tests/
+
+.include <bsd.port.post.mk>
Property changes on: trunk/emulators/open-vm-tools/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/distinfo
===================================================================
--- trunk/emulators/open-vm-tools/distinfo (rev 0)
+++ trunk/emulators/open-vm-tools/distinfo 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,2 @@
+SHA256 (open-vm-tools-9.4.0-1280544.tar.gz) = 5d30652eb0f6dc5e930781029c184837e700be5543b6a7116db4c62a6f3ca399
+SIZE (open-vm-tools-9.4.0-1280544.tar.gz) = 3659504
Property changes on: trunk/emulators/open-vm-tools/distinfo
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-base64rename
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-base64rename (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-base64rename 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,1480 @@
+--- lib/include/base64.h.orig 2013-12-27 16:38:14.000000000 +0000
++++ lib/include/base64.h 2013-12-27 16:38:30.000000000 +0000
+@@ -1,46 +0,0 @@
+-/*********************************************************
+- * Copyright (C) 2004 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.
+- *
+- *********************************************************/
+-
+-/*
+- * base64.h --
+- *
+- * Functions to base64 encode/decode buffers. Implemented in
+- * lib/misc/base64.c.
+- */
+-
+-#ifndef _BASE64_H
+-#define _BASE64_H
+-
+-Bool Base64_Encode(uint8 const *src, size_t srcLength,
+- char *target, size_t targSize,
+- size_t *dataLength);
+-Bool Base64_Decode(char const *src,
+- uint8 *target, size_t targSize,
+- size_t *dataLength);
+-Bool Base64_ChunkDecode(char const *src, size_t inSize,
+- uint8 *target, size_t targSize,
+- size_t *dataLength);
+-Bool Base64_ValidEncoding(char const *src, size_t srcLength);
+-size_t Base64_EncodedLength(uint8 const *src, size_t srcLength);
+-size_t Base64_DecodedLength(char const *src, size_t srcLength);
+-Bool Base64_EasyEncode(const uint8 *src, size_t srcLength,
+- char **target);
+-Bool Base64_EasyDecode(const char *src,
+- uint8 **target, size_t *targSize);
+-
+-#endif
+--- lib/misc/base64.c.orig 2013-12-27 16:38:22.000000000 +0000
++++ lib/misc/base64.c 2013-12-27 16:38:36.000000000 +0000
+@@ -1,634 +0,0 @@
+-/*
+- * Copyright (c) 1996, 1998 by Internet Software Consortium.
+- *
+- * Permission to use, copy, modify, and distribute this software for any
+- * purpose with or without fee is hereby granted, provided that the above
+- * copyright notice and this permission notice appear in all copies.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+- * SOFTWARE.
+- */
+-
+-/*
+- * Portions Copyright (c) 1995 by International Business Machines, Inc.
+- *
+- * International Business Machines, Inc. (hereinafter called IBM) grants
+- * permission under its copyrights to use, copy, modify, and distribute this
+- * Software with or without fee, provided that the above copyright notice and
+- * all paragraphs of this notice appear in all copies, and that the name of IBM
+- * not be used in connection with the marketing of any product incorporating
+- * the Software or modifications thereof, without specific, written prior
+- * permission.
+- *
+- * To the extent it has a right to do so, IBM grants an immunity from suit
+- * under its patents, if any, for the use, sale or manufacture of products to
+- * the extent that such products are used for performing Domain Name System
+- * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+- * granted for any product per se or for any other function of any product.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+- * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+- * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+- * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+- */
+-
+-#include <sys/types.h>
+-
+-#include <ctype.h>
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include "vm_basic_types.h"
+-#include "vm_assert.h"
+-#include "base64.h"
+-
+-static const char Base64[] =
+-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+-static const char Pad64 = '=';
+-
+-// Special markers
+-enum {
+- ILLEGAL = -1, EOM = -2, WS = -3
+-};
+-
+-/*
+- * Reverse byte map used for decoding. Except for specials (negative values), contains the index
+- * into Base64[] where given value is found, ie: base64Reverse[Base64[n]] = n, for 0 <= n < 64
+- *
+- * This static initialization replaces, and should have identical result to, this runtime init:
+- *
+- * for (i = 0; i < 256; ++i) {
+- * base64Reverse[i] = isspace(i) ? WS : ILLEGAL;
+- * }
+- * base64Reverse['\0'] = EOM;
+- * base64Reverse['='] = EOM;
+- * for (i = 0; Base64[i]; ++i) {
+- * base64Reverse[(unsigned)Base64[i]] = (char) i;
+- * }
+- */
+-
+-static const signed char base64Reverse[256] = {
+- EOM, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 00-07 */
+- ILLEGAL, WS, WS, WS, WS, WS, ILLEGAL, ILLEGAL, /* 08-0F */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 10-17 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 18-1F */
+- WS, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 20-27 */
+- ILLEGAL, ILLEGAL, ILLEGAL, 62, ILLEGAL, ILLEGAL, ILLEGAL, 63, /* 28-2F */
+- 52, 53, 54, 55, 56, 57, 58, 59, /* 30-37 */
+- 60, 61, ILLEGAL, ILLEGAL, ILLEGAL, EOM, ILLEGAL, ILLEGAL, /* 38-3F */
+- ILLEGAL, 0, 1, 2, 3, 4, 5, 6, /* 40-47 */
+- 7, 8, 9, 10, 11, 12, 13, 14, /* 48-4F */
+- 15, 16, 17, 18, 19, 20, 21, 22, /* 50-57 */
+- 23, 24, 25, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 58-5F */
+- ILLEGAL, 26, 27, 28, 29, 30, 31, 32, /* 60-67 */
+- 33, 34, 35, 36, 37, 38, 39, 40, /* 68-6F */
+- 41, 42, 43, 44, 45, 46, 47, 48, /* 70-77 */
+- 49, 50, 51, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 78-7F */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 80-87 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 88-8F */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 90-97 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 98-9F */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* A0-A7 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* A8-AF */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* B0-B7 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* B8-BF */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* C0-C7 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* C8-CF */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* D0-D7 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* D8-DF */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* E0-E7 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* E8-EF */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* F0-F7 */
+- ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL }; /* F8-FF */
+-
+-/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+- The following encoding technique is taken from RFC 1521 by Borenstein
+- and Freed. It is reproduced here in a slightly edited form for
+- convenience.
+-
+- A 65-character subset of US-ASCII is used, enabling 6 bits to be
+- represented per printable character. (The extra 65th character, "=",
+- is used to signify a special processing function.)
+-
+- The encoding process represents 24-bit groups of input bits as output
+- strings of 4 encoded characters. Proceeding from left to right, a
+- 24-bit input group is formed by concatenating 3 8-bit input groups.
+- These 24 bits are then treated as 4 concatenated 6-bit groups, each
+- of which is translated into a single digit in the base64 alphabet.
+-
+- Each 6-bit group is used as an index into an array of 64 printable
+- characters. The character referenced by the index is placed in the
+- output string.
+-
+- Table 1: The Base64 Alphabet
+-
+- Value Encoding Value Encoding Value Encoding Value Encoding
+- 0 A 17 R 34 i 51 z
+- 1 B 18 S 35 j 52 0
+- 2 C 19 T 36 k 53 1
+- 3 D 20 U 37 l 54 2
+- 4 E 21 V 38 m 55 3
+- 5 F 22 W 39 n 56 4
+- 6 G 23 X 40 o 57 5
+- 7 H 24 Y 41 p 58 6
+- 8 I 25 Z 42 q 59 7
+- 9 J 26 a 43 r 60 8
+- 10 K 27 b 44 s 61 9
+- 11 L 28 c 45 t 62 +
+- 12 M 29 d 46 u 63 /
+- 13 N 30 e 47 v
+- 14 O 31 f 48 w (pad) =
+- 15 P 32 g 49 x
+- 16 Q 33 h 50 y
+-
+- Special processing is performed if fewer than 24 bits are available
+- at the end of the data being encoded. A full encoding quantum is
+- always completed at the end of a quantity. When fewer than 24 input
+- bits are available in an input group, zero bits are added (on the
+- right) to form an integral number of 6-bit groups. Padding at the
+- end of the data is performed using the '=' character.
+-
+- Since all base64 input is an integral number of octets, only the
+- -------------------------------------------------
+- following cases can arise:
+-
+- (1) the final quantum of encoding input is an integral
+- multiple of 24 bits; here, the final unit of encoded
+- output will be an integral multiple of 4 characters
+- with no "=" padding,
+- (2) the final quantum of encoding input is exactly 8 bits;
+- here, the final unit of encoded output will be two
+- characters followed by two "=" padding characters, or
+- (3) the final quantum of encoding input is exactly 16 bits;
+- here, the final unit of encoded output will be three
+- characters followed by one "=" padding character.
+-*/
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Base64_Encode --
+- *
+- * Base64-encodes srcLength bytes from src and stores result in dst.
+- *
+- * Results:
+- * TRUE if the destination held enough space for the decoded result,
+- * FALSE otherwise.
+- *
+- * Side effects:
+- * Updates dstSize with the number of encoded bytes (excluding the
+- * terminating '\0').
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-Bool
+-Base64_Encode(uint8 const *src, // IN:
+- size_t srcSize, // IN:
+- char *dst, // OUT:
+- size_t dstMax, // IN: max result length, including NUL byte
+- size_t *dstSize) // OUT: result length, may be NULL
+-{
+- char *dst0 = dst;
+-
+- ASSERT(src || srcSize == 0);
+- ASSERT(dst);
+-
+- if (4 * ((srcSize + 2) / 3) >= dstMax) {
+- if (dstSize) {
+- *dstSize = 0;
+- }
+-
+- return FALSE;
+- }
+-
+- while (LIKELY(srcSize > 2)) {
+- dst[0] = Base64[src[0] >> 2];
+- dst[1] = Base64[(src[0] & 0x03) << 4 | src[1] >> 4];
+- dst[2] = Base64[(src[1] & 0x0f) << 2 | src[2] >> 6];
+- dst[3] = Base64[src[2] & 0x3f];
+-
+- srcSize -= 3;
+- src += 3;
+- dst += 4;
+- }
+-
+- /* Now we worry about padding. */
+- if (LIKELY(srcSize--)) {
+- uint8 src1 = srcSize ? src[1] : 0;
+-
+- dst[0] = Base64[src[0] >> 2];
+- dst[1] = Base64[(src[0] & 0x03) << 4 | src1 >> 4];
+- dst[2] = srcSize ? Base64[(src1 & 0x0f) << 2] : Pad64;
+- dst[3] = Pad64;
+- dst += 4;
+- }
+-
+- dst[0] = '\0'; /* Returned value doesn't count \0. */
+- if (dstSize) {
+- *dstSize = dst - dst0;
+- }
+-
+- return TRUE;
+-}
+-
+-
+-#ifdef __I_WANT_TO_TEST_THIS__
+-main()
+-{
+- struct {
+- char *in, *out;
+- } tests[] = {
+- {"", ""},
+- {"MQ==", "1"},
+- {"MTI=", "12"},
+- {"MTIz", "123"},
+- {"MTIzNA==", "1234"},
+- {"SGVsbG8gRWR3YXJkIGFuZCBKb2huIQ==","Hello Edward and John!"},
+- {NULL, NULL}
+- }, *test;
+-
+- size_t bufMax;
+- if (1) {
+- for (bufMax = 0; bufMax < 7; ++bufMax) {
+- char buf[999];
+- size_t bufSize;
+-
+- if (bufMax == 6) {
+- bufMax = sizeof buf;
+- }
+-
+- printf("\nBuffer size %ld:\n", bufMax);
+-
+- test = tests;
+- for (; test->in; ++test) {
+- Bool r;
+-
+- r = Base64_Decode(test->in, buf, bufMax, &bufSize);
+-
+- if ((bufMax > strlen(test->out)) && (bufSize < strlen(test->out))) {
+- printf("Decoding of %s failed. Decoded size %ld < expected %ld\n",
+- test->in, bufSize, strlen(test->out));
+- }
+- if (memcmp(test->out, buf, bufSize) != 0) {
+- printf("Decoding of %s failed. Got %s (%ld), not %s\n",
+- test->in, buf, bufSize, test->out);
+- } else {
+- printf("Good: %s -> %s (%ld)\n", test->in, buf, bufSize);
+- }
+-
+- r = Base64_Encode(test->out, strlen(test->out),
+- buf, bufMax, &bufSize);
+- buf[bufMax] = 0;
+-
+- if (bufMax <= strlen(test->in) && r == 0) {
+- printf("Good: %s. Failed for bufMax %ld (required %ld)\n", test->out, bufMax, strlen(test->in));
+- } else {
+- if (!r || bufSize != strlen(test->in) ||
+- strncmp(test->in, buf, bufSize) != 0) {
+- printf("Encoding of %s failed. r = %d. Got %s (%ld), not %s\n",
+- test->out, r, buf, bufSize, test->in);
+- } else {
+- printf("Good: %s -> %s (%ld)\n", test->out, buf, bufSize);
+- }
+- }
+- }
+- }
+- }
+-
+- for (bufMax = 0; bufMax < 100000; ++bufMax) {
+- char random_in[8000];
+- char random_out[16000];
+- size_t bufSize;
+-
+- Bool r = Base64_Encode(random_in, sizeof random_in,
+- random_out, sizeof random_out, &bufSize);
+-
+- if (!r) {
+- printf("Encoding failed.\n");
+- }
+- }
+-}
+-#endif
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Base64_Decode --
+- *
+- * Skips all whitespace anywhere. Converts characters, four at
+- * a time, starting at (or after) src from base - 64 numbers into three
+- * 8 bit bytes in the target area. Returns the number of data bytes
+- * stored at the target in the provided out parameter.
+- *
+- * Results:
+- * TRUE on success, FALSE on failure.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-Bool
+-Base64_Decode(char const *in, // IN:
+- uint8 *out, // OUT:
+- size_t outSize, // IN:
+- size_t *dataLength) // OUT:
+-{
+- return Base64_ChunkDecode(in, -1, out, outSize, dataLength);
+-}
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Base64_ChunkDecode --
+- *
+- * Skips all whitespace anywhere. Converts characters, four at
+- * a time, starting at (or after) src from base - 64 numbers into three
+- * 8 bit bytes in the target area. Conversion stops after inSize (which
+- * must be a multiple of 4) characters, or an EOM marker. Returns the
+- * number of data bytes stored at the target in the provided out parameter.
+- *
+- * Results:
+- * TRUE on success, FALSE on failure.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-Bool
+-Base64_ChunkDecode(char const *in, // IN:
+- size_t inSize, // IN:
+- uint8 *out, // OUT:
+- size_t outSize, // IN:
+- size_t *dataLength) // OUT:
+-{
+- uint32 b = 0;
+- int n = 0;
+- uintptr_t i = 0;
+- size_t inputIndex = 0;
+-
+- ASSERT(in);
+- ASSERT(out || outSize == 0);
+- ASSERT(dataLength);
+- ASSERT((inSize == -1) || (inSize % 4) == 0);
+- *dataLength = 0;
+-
+- i = 0;
+- for (;inputIndex < inSize;) {
+- int p = base64Reverse[(unsigned char)in[inputIndex]];
+-
+- if (UNLIKELY(p < 0)) {
+- switch (p) {
+- case WS:
+- inputIndex++;
+- break;
+- case EOM:
+- *dataLength = i;
+- return TRUE;
+- case ILLEGAL:
+- default:
+- return FALSE;
+- }
+- } else {
+- inputIndex++;
+- if (UNLIKELY(i >= outSize)) {
+- return FALSE;
+- }
+- b = (b << 6) | p;
+- n += 6;
+- if (LIKELY(n >= 8)) {
+- n -= 8;
+- out[i++] = b >> n;
+- }
+- }
+- }
+- *dataLength = i;
+- return TRUE;
+-}
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Base64_ValidEncoding --
+- *
+- * Returns TRUE if the specified input buffer is valid Base64 input.
+- *
+- * Results:
+- * TRUE or FALSE.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-Bool
+-Base64_ValidEncoding(char const *src, // IN:
+- size_t srcLength) // IN:
+-{
+- size_t i;
+-
+- ASSERT(src);
+- for (i = 0; i < srcLength; i++) {
+- uint8 c = src[i]; /* MSVC CRT will die on negative arguments to is* */
+-
+- if (!isalpha(c) && !isdigit(c) &&
+- c != '+' && c != '=' && c != '/') {
+- return FALSE;
+- }
+- }
+-
+- return TRUE;
+-}
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Base64_EncodedLength --
+- *
+- * Given a binary buffer, how many bytes would it take to encode it.
+- *
+- * Results:
+- * Number of bytes needed to encode, including terminating NUL byte.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-size_t
+-Base64_EncodedLength(uint8 const *src, // IN:
+- size_t srcLength) // IN:
+-{
+- return ((srcLength + 2) / 3 * 4) + 1;
+-}
+-
+-
+-/*
+- *----------------------------------------------------------------------------
+- *
+- * Base64_DecodedLength --
+- *
+- * Given a base64 encoded string, how many bytes do we need to decode it.
+- * Assumes no whitespace. This is not necessarily the length of the
+- * decoded data (Base64_Decode requires a few extra bytes... don't blame
+- * me, I didn't write it).
+- *
+- * Results:
+- * Number of bytes needed to decode input.
+- *
+- * Side effects:
+- * None.
+- *
+- *----------------------------------------------------------------------------
+- */
+-
+-size_t
+-Base64_DecodedLength(char const *src, // IN:
+- size_t srcLength) // IN:
+-{
+- size_t length;
+-
+- ASSERT(src);
+-
+- length = srcLength / 4 * 3;
+- // PR 303173 - do the following check to avoid a negative value returned
+- // from this function. Note: length can only be in a multiple of 3
+- if (length > 2) {
+- if (src[srcLength-1] == '=') {
+- length--;
+- }
+- if (src[srcLength-2] == '=') {
+- length--;
+- }
+- }
+- return length;
+-}
+-
+-
+-/*
+- *-----------------------------------------------------------------------------
+- *
+- * Base64_EasyEncode --
+- *
+- * Base64-encode 'data' into a NUL-terminated string.
+- *
+- * Results:
+- * On success: TRUE. '*target' is set to an allocated string, that the
+- * caller must eventually free().
+- * On failure: FALSE. '*target' is set to NULL.
+- *
+- * Side effects:
+- * None.
+- *
+- *-----------------------------------------------------------------------------
+- */
+-
+-Bool
+-Base64_EasyEncode(const uint8 *src, // IN: data to encode
+- size_t srcLength, // IN: data size
+- char **target) // OUT: encoded string
+-{
+- Bool succeeded = FALSE;
+- size_t size;
+-
+- ASSERT(src);
+- ASSERT(target);
+-
+- size = Base64_EncodedLength(src, srcLength);
+-
+- *target = (char *) malloc(size);
+-
+- if (!*target) {
+- goto exit;
+- }
+-
+- if (!Base64_Encode(src, srcLength, *target, size, NULL)) {
+- goto exit;
+- }
+-
+- succeeded = TRUE;
+-
+-exit:
+- if (!succeeded) {
+- free(*target);
+- *target = NULL;
+- }
+-
+- return succeeded;
+-}
+-
+-
+-/*
+- *-----------------------------------------------------------------------------
+- *
+- * Base64_EasyDecode --
+- *
+- * Base64-decode 'src' into a buffer.
+- *
+- * Results:
+- * TRUE on success, FALSE otherwise, plus the decoded data on success.
+- * Caller must free 'target' with free().
+- *
+- * Side effects:
+- * None.
+- *
+- *-----------------------------------------------------------------------------
+- */
+-
+-Bool
+-Base64_EasyDecode(const char *src, // IN: data to decode
+- uint8 **target, // OUT: decoded data
+- size_t *targSize) // OUT: data size
+-{
+- Bool succeeded = FALSE;
+- size_t theDataSize;
+- uint8 *theData;
+-
+- ASSERT(src);
+- ASSERT(target);
+- ASSERT(targSize);
+-
+- theDataSize = Base64_DecodedLength(src, strlen(src));
+-
+- theData = (uint8 *) malloc(theDataSize);
+-
+- if (!theData) {
+- goto exit;
+- }
+-
+- if (!Base64_Decode(src, theData, theDataSize, &theDataSize)) {
+- free(theData);
+- goto exit;
+- }
+-
+- *target = theData;
+- *targSize = theDataSize;
+-
+- succeeded = TRUE;
+-
+-exit:
+- if (!succeeded) {
+- *target = NULL;
+- *targSize = 0;
+- }
+-
+- return succeeded;
+-}
+--- lib/include/ovmbase64.h.orig 2013-12-27 16:39:12.000000000 +0000
++++ lib/include/ovmbase64.h 2013-12-27 16:39:46.000000000 +0000
+@@ -0,0 +1,46 @@
++/*********************************************************
++ * Copyright (C) 2004 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.
++ *
++ *********************************************************/
++
++/*
++ * base64.h --
++ *
++ * Functions to base64 encode/decode buffers. Implemented in
++ * lib/misc/base64.c.
++ */
++
++#ifndef _BASE64_H
++#define _BASE64_H
++
++Bool Base64_Encode(uint8 const *src, size_t srcLength,
++ char *target, size_t targSize,
++ size_t *dataLength);
++Bool Base64_Decode(char const *src,
++ uint8 *target, size_t targSize,
++ size_t *dataLength);
++Bool Base64_ChunkDecode(char const *src, size_t inSize,
++ uint8 *target, size_t targSize,
++ size_t *dataLength);
++Bool Base64_ValidEncoding(char const *src, size_t srcLength);
++size_t Base64_EncodedLength(uint8 const *src, size_t srcLength);
++size_t Base64_DecodedLength(char const *src, size_t srcLength);
++Bool Base64_EasyEncode(const uint8 *src, size_t srcLength,
++ char **target);
++Bool Base64_EasyDecode(const char *src,
++ uint8 **target, size_t *targSize);
++
++#endif
+--- lib/misc/ovmbase64.c.orig 2013-12-27 16:39:33.000000000 +0000
++++ lib/misc/ovmbase64.c 2013-12-27 16:39:56.000000000 +0000
+@@ -0,0 +1,634 @@
++/*
++ * Copyright (c) 1996, 1998 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Portions Copyright (c) 1995 by International Business Machines, Inc.
++ *
++ * International Business Machines, Inc. (hereinafter called IBM) grants
++ * permission under its copyrights to use, copy, modify, and distribute this
++ * Software with or without fee, provided that the above copyright notice and
++ * all paragraphs of this notice appear in all copies, and that the name of IBM
++ * not be used in connection with the marketing of any product incorporating
++ * the Software or modifications thereof, without specific, written prior
++ * permission.
++ *
++ * To the extent it has a right to do so, IBM grants an immunity from suit
++ * under its patents, if any, for the use, sale or manufacture of products to
++ * the extent that such products are used for performing Domain Name System
++ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
++ * granted for any product per se or for any other function of any product.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
++ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
++ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
++ */
++
++#include <sys/types.h>
++
++#include <ctype.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include "vm_basic_types.h"
++#include "vm_assert.h"
++#include "base64.h"
++
++static const char Base64[] =
++"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
++static const char Pad64 = '=';
++
++// Special markers
++enum {
++ ILLEGAL = -1, EOM = -2, WS = -3
++};
++
++/*
++ * Reverse byte map used for decoding. Except for specials (negative values), contains the index
++ * into Base64[] where given value is found, ie: base64Reverse[Base64[n]] = n, for 0 <= n < 64
++ *
++ * This static initialization replaces, and should have identical result to, this runtime init:
++ *
++ * for (i = 0; i < 256; ++i) {
++ * base64Reverse[i] = isspace(i) ? WS : ILLEGAL;
++ * }
++ * base64Reverse['\0'] = EOM;
++ * base64Reverse['='] = EOM;
++ * for (i = 0; Base64[i]; ++i) {
++ * base64Reverse[(unsigned)Base64[i]] = (char) i;
++ * }
++ */
++
++static const signed char base64Reverse[256] = {
++ EOM, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 00-07 */
++ ILLEGAL, WS, WS, WS, WS, WS, ILLEGAL, ILLEGAL, /* 08-0F */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 10-17 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 18-1F */
++ WS, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 20-27 */
++ ILLEGAL, ILLEGAL, ILLEGAL, 62, ILLEGAL, ILLEGAL, ILLEGAL, 63, /* 28-2F */
++ 52, 53, 54, 55, 56, 57, 58, 59, /* 30-37 */
++ 60, 61, ILLEGAL, ILLEGAL, ILLEGAL, EOM, ILLEGAL, ILLEGAL, /* 38-3F */
++ ILLEGAL, 0, 1, 2, 3, 4, 5, 6, /* 40-47 */
++ 7, 8, 9, 10, 11, 12, 13, 14, /* 48-4F */
++ 15, 16, 17, 18, 19, 20, 21, 22, /* 50-57 */
++ 23, 24, 25, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 58-5F */
++ ILLEGAL, 26, 27, 28, 29, 30, 31, 32, /* 60-67 */
++ 33, 34, 35, 36, 37, 38, 39, 40, /* 68-6F */
++ 41, 42, 43, 44, 45, 46, 47, 48, /* 70-77 */
++ 49, 50, 51, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 78-7F */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 80-87 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 88-8F */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 90-97 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* 98-9F */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* A0-A7 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* A8-AF */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* B0-B7 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* B8-BF */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* C0-C7 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* C8-CF */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* D0-D7 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* D8-DF */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* E0-E7 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* E8-EF */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, /* F0-F7 */
++ ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL, ILLEGAL }; /* F8-FF */
++
++/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
++ The following encoding technique is taken from RFC 1521 by Borenstein
++ and Freed. It is reproduced here in a slightly edited form for
++ convenience.
++
++ A 65-character subset of US-ASCII is used, enabling 6 bits to be
++ represented per printable character. (The extra 65th character, "=",
++ is used to signify a special processing function.)
++
++ The encoding process represents 24-bit groups of input bits as output
++ strings of 4 encoded characters. Proceeding from left to right, a
++ 24-bit input group is formed by concatenating 3 8-bit input groups.
++ These 24 bits are then treated as 4 concatenated 6-bit groups, each
++ of which is translated into a single digit in the base64 alphabet.
++
++ Each 6-bit group is used as an index into an array of 64 printable
++ characters. The character referenced by the index is placed in the
++ output string.
++
++ Table 1: The Base64 Alphabet
++
++ Value Encoding Value Encoding Value Encoding Value Encoding
++ 0 A 17 R 34 i 51 z
++ 1 B 18 S 35 j 52 0
++ 2 C 19 T 36 k 53 1
++ 3 D 20 U 37 l 54 2
++ 4 E 21 V 38 m 55 3
++ 5 F 22 W 39 n 56 4
++ 6 G 23 X 40 o 57 5
++ 7 H 24 Y 41 p 58 6
++ 8 I 25 Z 42 q 59 7
++ 9 J 26 a 43 r 60 8
++ 10 K 27 b 44 s 61 9
++ 11 L 28 c 45 t 62 +
++ 12 M 29 d 46 u 63 /
++ 13 N 30 e 47 v
++ 14 O 31 f 48 w (pad) =
++ 15 P 32 g 49 x
++ 16 Q 33 h 50 y
++
++ Special processing is performed if fewer than 24 bits are available
++ at the end of the data being encoded. A full encoding quantum is
++ always completed at the end of a quantity. When fewer than 24 input
++ bits are available in an input group, zero bits are added (on the
++ right) to form an integral number of 6-bit groups. Padding at the
++ end of the data is performed using the '=' character.
++
++ Since all base64 input is an integral number of octets, only the
++ -------------------------------------------------
++ following cases can arise:
++
++ (1) the final quantum of encoding input is an integral
++ multiple of 24 bits; here, the final unit of encoded
++ output will be an integral multiple of 4 characters
++ with no "=" padding,
++ (2) the final quantum of encoding input is exactly 8 bits;
++ here, the final unit of encoded output will be two
++ characters followed by two "=" padding characters, or
++ (3) the final quantum of encoding input is exactly 16 bits;
++ here, the final unit of encoded output will be three
++ characters followed by one "=" padding character.
++*/
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * Base64_Encode --
++ *
++ * Base64-encodes srcLength bytes from src and stores result in dst.
++ *
++ * Results:
++ * TRUE if the destination held enough space for the decoded result,
++ * FALSE otherwise.
++ *
++ * Side effects:
++ * Updates dstSize with the number of encoded bytes (excluding the
++ * terminating '\0').
++ *
++ *----------------------------------------------------------------------------
++ */
++
++Bool
++Base64_Encode(uint8 const *src, // IN:
++ size_t srcSize, // IN:
++ char *dst, // OUT:
++ size_t dstMax, // IN: max result length, including NUL byte
++ size_t *dstSize) // OUT: result length, may be NULL
++{
++ char *dst0 = dst;
++
++ ASSERT(src || srcSize == 0);
++ ASSERT(dst);
++
++ if (4 * ((srcSize + 2) / 3) >= dstMax) {
++ if (dstSize) {
++ *dstSize = 0;
++ }
++
++ return FALSE;
++ }
++
++ while (LIKELY(srcSize > 2)) {
++ dst[0] = Base64[src[0] >> 2];
++ dst[1] = Base64[(src[0] & 0x03) << 4 | src[1] >> 4];
++ dst[2] = Base64[(src[1] & 0x0f) << 2 | src[2] >> 6];
++ dst[3] = Base64[src[2] & 0x3f];
++
++ srcSize -= 3;
++ src += 3;
++ dst += 4;
++ }
++
++ /* Now we worry about padding. */
++ if (LIKELY(srcSize--)) {
++ uint8 src1 = srcSize ? src[1] : 0;
++
++ dst[0] = Base64[src[0] >> 2];
++ dst[1] = Base64[(src[0] & 0x03) << 4 | src1 >> 4];
++ dst[2] = srcSize ? Base64[(src1 & 0x0f) << 2] : Pad64;
++ dst[3] = Pad64;
++ dst += 4;
++ }
++
++ dst[0] = '\0'; /* Returned value doesn't count \0. */
++ if (dstSize) {
++ *dstSize = dst - dst0;
++ }
++
++ return TRUE;
++}
++
++
++#ifdef __I_WANT_TO_TEST_THIS__
++main()
++{
++ struct {
++ char *in, *out;
++ } tests[] = {
++ {"", ""},
++ {"MQ==", "1"},
++ {"MTI=", "12"},
++ {"MTIz", "123"},
++ {"MTIzNA==", "1234"},
++ {"SGVsbG8gRWR3YXJkIGFuZCBKb2huIQ==","Hello Edward and John!"},
++ {NULL, NULL}
++ }, *test;
++
++ size_t bufMax;
++ if (1) {
++ for (bufMax = 0; bufMax < 7; ++bufMax) {
++ char buf[999];
++ size_t bufSize;
++
++ if (bufMax == 6) {
++ bufMax = sizeof buf;
++ }
++
++ printf("\nBuffer size %ld:\n", bufMax);
++
++ test = tests;
++ for (; test->in; ++test) {
++ Bool r;
++
++ r = Base64_Decode(test->in, buf, bufMax, &bufSize);
++
++ if ((bufMax > strlen(test->out)) && (bufSize < strlen(test->out))) {
++ printf("Decoding of %s failed. Decoded size %ld < expected %ld\n",
++ test->in, bufSize, strlen(test->out));
++ }
++ if (memcmp(test->out, buf, bufSize) != 0) {
++ printf("Decoding of %s failed. Got %s (%ld), not %s\n",
++ test->in, buf, bufSize, test->out);
++ } else {
++ printf("Good: %s -> %s (%ld)\n", test->in, buf, bufSize);
++ }
++
++ r = Base64_Encode(test->out, strlen(test->out),
++ buf, bufMax, &bufSize);
++ buf[bufMax] = 0;
++
++ if (bufMax <= strlen(test->in) && r == 0) {
++ printf("Good: %s. Failed for bufMax %ld (required %ld)\n", test->out, bufMax, strlen(test->in));
++ } else {
++ if (!r || bufSize != strlen(test->in) ||
++ strncmp(test->in, buf, bufSize) != 0) {
++ printf("Encoding of %s failed. r = %d. Got %s (%ld), not %s\n",
++ test->out, r, buf, bufSize, test->in);
++ } else {
++ printf("Good: %s -> %s (%ld)\n", test->out, buf, bufSize);
++ }
++ }
++ }
++ }
++ }
++
++ for (bufMax = 0; bufMax < 100000; ++bufMax) {
++ char random_in[8000];
++ char random_out[16000];
++ size_t bufSize;
++
++ Bool r = Base64_Encode(random_in, sizeof random_in,
++ random_out, sizeof random_out, &bufSize);
++
++ if (!r) {
++ printf("Encoding failed.\n");
++ }
++ }
++}
++#endif
++
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * Base64_Decode --
++ *
++ * Skips all whitespace anywhere. Converts characters, four at
++ * a time, starting at (or after) src from base - 64 numbers into three
++ * 8 bit bytes in the target area. Returns the number of data bytes
++ * stored at the target in the provided out parameter.
++ *
++ * Results:
++ * TRUE on success, FALSE on failure.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------------
++ */
++
++Bool
++Base64_Decode(char const *in, // IN:
++ uint8 *out, // OUT:
++ size_t outSize, // IN:
++ size_t *dataLength) // OUT:
++{
++ return Base64_ChunkDecode(in, -1, out, outSize, dataLength);
++}
++
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * Base64_ChunkDecode --
++ *
++ * Skips all whitespace anywhere. Converts characters, four at
++ * a time, starting at (or after) src from base - 64 numbers into three
++ * 8 bit bytes in the target area. Conversion stops after inSize (which
++ * must be a multiple of 4) characters, or an EOM marker. Returns the
++ * number of data bytes stored at the target in the provided out parameter.
++ *
++ * Results:
++ * TRUE on success, FALSE on failure.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------------
++ */
++
++Bool
++Base64_ChunkDecode(char const *in, // IN:
++ size_t inSize, // IN:
++ uint8 *out, // OUT:
++ size_t outSize, // IN:
++ size_t *dataLength) // OUT:
++{
++ uint32 b = 0;
++ int n = 0;
++ uintptr_t i = 0;
++ size_t inputIndex = 0;
++
++ ASSERT(in);
++ ASSERT(out || outSize == 0);
++ ASSERT(dataLength);
++ ASSERT((inSize == -1) || (inSize % 4) == 0);
++ *dataLength = 0;
++
++ i = 0;
++ for (;inputIndex < inSize;) {
++ int p = base64Reverse[(unsigned char)in[inputIndex]];
++
++ if (UNLIKELY(p < 0)) {
++ switch (p) {
++ case WS:
++ inputIndex++;
++ break;
++ case EOM:
++ *dataLength = i;
++ return TRUE;
++ case ILLEGAL:
++ default:
++ return FALSE;
++ }
++ } else {
++ inputIndex++;
++ if (UNLIKELY(i >= outSize)) {
++ return FALSE;
++ }
++ b = (b << 6) | p;
++ n += 6;
++ if (LIKELY(n >= 8)) {
++ n -= 8;
++ out[i++] = b >> n;
++ }
++ }
++ }
++ *dataLength = i;
++ return TRUE;
++}
++
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * Base64_ValidEncoding --
++ *
++ * Returns TRUE if the specified input buffer is valid Base64 input.
++ *
++ * Results:
++ * TRUE or FALSE.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------------
++ */
++
++Bool
++Base64_ValidEncoding(char const *src, // IN:
++ size_t srcLength) // IN:
++{
++ size_t i;
++
++ ASSERT(src);
++ for (i = 0; i < srcLength; i++) {
++ uint8 c = src[i]; /* MSVC CRT will die on negative arguments to is* */
++
++ if (!isalpha(c) && !isdigit(c) &&
++ c != '+' && c != '=' && c != '/') {
++ return FALSE;
++ }
++ }
++
++ return TRUE;
++}
++
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * Base64_EncodedLength --
++ *
++ * Given a binary buffer, how many bytes would it take to encode it.
++ *
++ * Results:
++ * Number of bytes needed to encode, including terminating NUL byte.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------------
++ */
++
++size_t
++Base64_EncodedLength(uint8 const *src, // IN:
++ size_t srcLength) // IN:
++{
++ return ((srcLength + 2) / 3 * 4) + 1;
++}
++
++
++/*
++ *----------------------------------------------------------------------------
++ *
++ * Base64_DecodedLength --
++ *
++ * Given a base64 encoded string, how many bytes do we need to decode it.
++ * Assumes no whitespace. This is not necessarily the length of the
++ * decoded data (Base64_Decode requires a few extra bytes... don't blame
++ * me, I didn't write it).
++ *
++ * Results:
++ * Number of bytes needed to decode input.
++ *
++ * Side effects:
++ * None.
++ *
++ *----------------------------------------------------------------------------
++ */
++
++size_t
++Base64_DecodedLength(char const *src, // IN:
++ size_t srcLength) // IN:
++{
++ size_t length;
++
++ ASSERT(src);
++
++ length = srcLength / 4 * 3;
++ // PR 303173 - do the following check to avoid a negative value returned
++ // from this function. Note: length can only be in a multiple of 3
++ if (length > 2) {
++ if (src[srcLength-1] == '=') {
++ length--;
++ }
++ if (src[srcLength-2] == '=') {
++ length--;
++ }
++ }
++ return length;
++}
++
++
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * Base64_EasyEncode --
++ *
++ * Base64-encode 'data' into a NUL-terminated string.
++ *
++ * Results:
++ * On success: TRUE. '*target' is set to an allocated string, that the
++ * caller must eventually free().
++ * On failure: FALSE. '*target' is set to NULL.
++ *
++ * Side effects:
++ * None.
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++Bool
++Base64_EasyEncode(const uint8 *src, // IN: data to encode
++ size_t srcLength, // IN: data size
++ char **target) // OUT: encoded string
++{
++ Bool succeeded = FALSE;
++ size_t size;
++
++ ASSERT(src);
++ ASSERT(target);
++
++ size = Base64_EncodedLength(src, srcLength);
++
++ *target = (char *) malloc(size);
++
++ if (!*target) {
++ goto exit;
++ }
++
++ if (!Base64_Encode(src, srcLength, *target, size, NULL)) {
++ goto exit;
++ }
++
++ succeeded = TRUE;
++
++exit:
++ if (!succeeded) {
++ free(*target);
++ *target = NULL;
++ }
++
++ return succeeded;
++}
++
++
++/*
++ *-----------------------------------------------------------------------------
++ *
++ * Base64_EasyDecode --
++ *
++ * Base64-decode 'src' into a buffer.
++ *
++ * Results:
++ * TRUE on success, FALSE otherwise, plus the decoded data on success.
++ * Caller must free 'target' with free().
++ *
++ * Side effects:
++ * None.
++ *
++ *-----------------------------------------------------------------------------
++ */
++
++Bool
++Base64_EasyDecode(const char *src, // IN: data to decode
++ uint8 **target, // OUT: decoded data
++ size_t *targSize) // OUT: data size
++{
++ Bool succeeded = FALSE;
++ size_t theDataSize;
++ uint8 *theData;
++
++ ASSERT(src);
++ ASSERT(target);
++ ASSERT(targSize);
++
++ theDataSize = Base64_DecodedLength(src, strlen(src));
++
++ theData = (uint8 *) malloc(theDataSize);
++
++ if (!theData) {
++ goto exit;
++ }
++
++ if (!Base64_Decode(src, theData, theDataSize, &theDataSize)) {
++ free(theData);
++ goto exit;
++ }
++
++ *target = theData;
++ *targSize = theDataSize;
++
++ succeeded = TRUE;
++
++exit:
++ if (!succeeded) {
++ *target = NULL;
++ *targSize = 0;
++ }
++
++ return succeeded;
++}
+--- lib/foundryMsg/foundryMsg.c.orig 2013-12-27 16:40:58.000000000 +0000
++++ lib/foundryMsg/foundryMsg.c 2013-12-27 16:41:30.000000000 +0000
+@@ -29,7 +29,7 @@
+ #include "vm_version.h"
+ #include "util.h"
+ #include "str.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+
+ #include "vixOpenSource.h"
+ #include "vixCommands.h"
+--- lib/file/file.c.orig 2013-12-27 16:40:58.000000000 +0000
++++ lib/file/file.c 2013-12-27 16:41:39.000000000 +0000
+@@ -60,7 +60,7 @@
+ #include "fileIO.h"
+ #include "fileInt.h"
+ #include "dynbuf.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+ #include "timeutil.h"
+ #include "hostinfo.h"
+ #include "hostType.h"
+--- lib/misc/Makefile.in.orig 2013-09-23 15:51:46.000000000 +0000
++++ lib/misc/Makefile.in 2013-12-27 16:57:14.000000000 +0000
+@@ -82,7 +82,7 @@
+ CONFIG_CLEAN_VPATH_FILES =
+ LTLIBRARIES = $(noinst_LTLIBRARIES)
+ libMisc_la_LIBADD =
+-am_libMisc_la_OBJECTS = atomic.lo base64.lo codeset.lo codesetBase.lo \
++am_libMisc_la_OBJECTS = atomic.lo ovmbase64.lo codeset.lo codesetBase.lo \
+ codesetOld.lo dynarray.lo dynbuf.lo escape.lo hashTable.lo \
+ hostinfo.lo hostinfoHV.lo hostinfoPosix.lo hostname.lo \
+ hostType.lo idLinux.lo iovector.lo logFixed.lo machineID.lo \
+@@ -301,7 +301,7 @@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ noinst_LTLIBRARIES = libMisc.la
+-libMisc_la_SOURCES = atomic.c base64.c codeset.c codesetBase.c \
++libMisc_la_SOURCES = atomic.c ovmbase64.c codeset.c codesetBase.c \
+ codesetOld.c dynarray.c dynbuf.c escape.c hashTable.c \
+ hostinfo.c hostinfoHV.c hostinfoPosix.c hostname.c hostType.c \
+ idLinux.c iovector.c logFixed.c machineID.c miscSolaris.c \
+--- lib/misc/Makefile.am.orig 2013-12-27 16:40:58.000000000 +0000
++++ lib/misc/Makefile.am 2013-12-27 16:42:00.000000000 +0000
+@@ -19,7 +19,7 @@
+
+ libMisc_la_SOURCES =
+ libMisc_la_SOURCES += atomic.c
+-libMisc_la_SOURCES += base64.c
++libMisc_la_SOURCES += ovmbase64.c
+ libMisc_la_SOURCES += codeset.c
+ libMisc_la_SOURCES += codesetBase.c
+ libMisc_la_SOURCES += codesetOld.c
+--- lib/user/util.c.orig 2013-12-27 16:40:58.000000000 +0000
++++ lib/user/util.c 2013-12-27 16:42:25.000000000 +0000
+@@ -69,7 +69,7 @@
+ #include "file.h"
+ #include "util_shared.h"
+ #include "escape.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+ #include "unicode.h"
+ #include "posix.h"
+
+--- services/plugins/vix/foundryToolsDaemon.c.orig 2013-12-27 16:40:58.000000000 +0000
++++ services/plugins/vix/foundryToolsDaemon.c 2013-12-27 16:42:38.000000000 +0000
+@@ -68,7 +68,7 @@
+ #include "guest_msg_def.h"
+ #include "conf.h"
+ #include "vixCommands.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+ #include "syncDriver.h"
+ #include "hgfsServerManager.h"
+ #include "hgfs.h"
+--- services/plugins/vix/vixTools.c.orig 2013-12-27 16:40:58.000000000 +0000
++++ services/plugins/vix/vixTools.c 2013-12-27 16:42:46.000000000 +0000
+@@ -87,7 +87,7 @@
+ #include "guest_msg_def.h"
+ #include "conf.h"
+ #include "vixCommands.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+ #include "hostinfo.h"
+ #include "hgfsServerManager.h"
+ #include "hgfs.h"
+--- xferlogs/xferlogs.c.orig 2013-12-27 16:40:58.000000000 +0000
++++ xferlogs/xferlogs.c 2013-12-27 16:43:01.000000000 +0000
+@@ -50,7 +50,7 @@
+ #include "debug.h"
+ #include "rpcvmx.h"
+ #include "rpcout.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+ #include "str.h"
+ #include "strutil.h"
+
+--- lib/misc/ovmbase64.c.orig 2013-12-27 16:50:49.000000000 +0000
++++ lib/misc/ovmbase64.c 2013-12-27 16:50:58.000000000 +0000
+@@ -48,7 +48,7 @@
+ #include <string.h>
+ #include "vm_basic_types.h"
+ #include "vm_assert.h"
+-#include "base64.h"
++#include "ovmbase64.h"
+
+ static const char Base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
Property changes on: trunk/emulators/open-vm-tools/files/patch-base64rename
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-configure
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-configure (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-configure 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,40 @@
+--- ./configure.orig 2013-09-23 15:51:43.000000000 +0000
++++ ./configure 2014-04-23 15:36:44.174844399 +0000
+@@ -2823,6 +2823,9 @@
+ x86_64)
+ userSpaceBitness="64"
+ ;;
++ amd64)
++ userSpaceBitness="64"
++ ;;
+ *)
+ as_fn_error $? "Unknown architecture." "$LINENO" 5
+ ;;
+@@ -21733,18 +21736,6 @@
+
+ done
+
+-for ac_header in unwind.h
+-do :
+- ac_fn_c_check_header_mongrel "$LINENO" "unwind.h" "ac_cv_header_unwind_h" "$ac_includes_default"
+-if test "x$ac_cv_header_unwind_h" = xyes; then :
+- cat >>confdefs.h <<_ACEOF
+-#define HAVE_UNWIND_H 1
+-_ACEOF
+-
+-fi
+-
+-done
+-
+
+ ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default"
+ if test "x$ac_cv_header_wchar_h" = xyes; then :
+@@ -22238,7 +22229,7 @@
+
+ ### General flags / actions
+ CFLAGS="$CFLAGS -Wall"
+-CFLAGS="$CFLAGS -Werror"
++CFLAGS="$CFLAGS -Werror -Wno-unused-function"
+
+ # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris.
+ for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \
Property changes on: trunk/emulators/open-vm-tools/files/patch-configure
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-freebsd-8
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-freebsd-8 (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-freebsd-8 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,170 @@
+--- modules/freebsd/vmhgfs/vnops.c.orig 2009-02-18 17:02:35.000000000 +0900
++++ modules/freebsd/vmhgfs/vnops.c 2009-03-01 17:47:10.000000000 +0900
+@@ -325,7 +325,11 @@
+ */
+ {
+ struct vnode *vp = ap->a_vp;
++#if __FreeBSD_version >= 800001 || defined(__MidnightBSD__)
++ int mode = ap->a_accmode;
++#else
+ int mode = ap->a_mode;
++#endif
+ HgfsAccessMode accessMode = 0;
+ Bool isDir = vp->v_type == VDIR;
+ if (mode & VREAD) {
+--- modules/freebsd/vmblock/vfsops.c.orig 2009-03-18 03:03:21.000000000 -0400
++++ modules/freebsd/vmblock/vfsops.c 2009-05-23 02:25:50.892549675 -0400
+@@ -126,6 +126,11 @@
+ char *target;
+ int len, error = 0;
+
++#if __FreeBSD_version >= 800087 || defined(__MidnightBSD__)
++ struct thread *td;
++ td = curthread;
++#endif
++
+ VMBLOCKDEBUG("VMBlockVFSMount(mp = %p)\n", (void *)mp);
+
+ /*
+@@ -273,6 +278,11 @@
+ int error;
+ int flags = 0, removed = 0;
+
++#if __FreeBSD_version >= 800087 || defined(__MidnightBSD__)
++ struct thread *td;
++ td = curthread;
++#endif
++
+ VMBLOCKDEBUG("VMBlockVFSUnmount: mp = %p\n", (void *)mp);
+
+ xmp = MNTTOVMBLOCKMNT(mp);
+@@ -448,10 +458,15 @@
+ VMBlockVFSSync(struct mount *mp, // Ignored
+ int waitfor) // Ignored
+ #else
++#if __FreeBSD_version >= 800087
++VMBlockVFSSync(struct mount *mp,
++ int waitfor)
++#else
+ VMBlockVFSSync(struct mount *mp, // Ignored
+ int waitfor, // Ignored
+ struct thread *td) // Ignored
+ #endif
++#endif
+ {
+ return 0;
+ }
+--- modules/freebsd/vmhgfs/vfsops.c.orig 2009-03-18 03:03:26.000000000 -0400
++++ modules/freebsd/vmhgfs/vfsops.c 2009-05-23 02:56:39.608109670 -0400
+@@ -109,8 +109,12 @@
+ */
+
+ static int
++#if __FreeBSD_version >= 800087 || defined(__MidnightBSD__)
++HgfsVfsMount(struct mount *mp)
++#else
+ HgfsVfsMount(struct mount *mp, // IN: structure representing the file system
+ struct thread *td) // IN: thread which is mounting the file system
++#endif
+ {
+ HgfsSuperInfo *sip;
+ struct vnode *vp;
+@@ -122,6 +126,10 @@
+ int *uid = NULL;
+ Bool *gidSet = NULL;
+ int *gid = NULL;
++#if __FreeBSD_version >= 800087
++ struct thread *td;
++ td = curthread;
++#endif
+
+ /*
+ * - Examine/validate mount flags from userland.
+@@ -145,7 +153,11 @@
+ * Since Hgfs requires the caller to be root, only allow mount attempts made
+ * by the superuser.
+ */
++#if __FreeBSD_version >= 800001
++ if ((ret = priv_check(td, PRIV_VFS_MOUNT)) != 0) {
++#else
+ if ((ret = suser(td)) != 0) {
++#endif
+ return ret;
+ }
+
+@@ -277,11 +289,19 @@
+ */
+
+ static int
++#if __FreeBSD_version >= 800087 || defined(__MidnightBSD__)
++HgfsVfsUnmount(struct mount *mp, int mntflags)
++#else
+ HgfsVfsUnmount(struct mount *mp, int mntflags, struct thread *td)
++#endif
+ {
+ HgfsSuperInfo *sip;
+ int ret = 0;
+ int flags = 0;
++#if __FreeBSD_version >= 800087
++ struct thread *td;
++ td = curthread;
++#endif
+
+ sip = (HgfsSuperInfo *)mp->mnt_data;
+
+@@ -348,10 +368,18 @@
+ */
+
+ static int
++#if __FreeBSD_version >= 800087
++HgfsVfsStatfs(struct mount *mp, struct statfs *sbp)
++#else
+ HgfsVfsStatfs(struct mount *mp, struct statfs *sbp, struct thread *td)
++#endif
+ {
+ int ret = 0;
+ struct vnode *vp;
++#if __FreeBSD_version >= 800087
++ struct thread *td;
++ td = curthread;
++#endif
+
+ /* We always want HGFS_BLOCKSIZE to be a power of two */
+ ASSERT_ON_COMPILE(HGFS_IS_POWER_OF_TWO(HGFS_BLOCKSIZE));
+@@ -361,8 +389,11 @@
+ * we got from a call to vfs_getnewfsid() in HgfsVfsMount()
+ */
+ bcopy(&mp->mnt_stat, sbp, sizeof mp->mnt_stat);
+-
++#if __FreeBSD_version >= 800087
++ ret = HgfsVfsRoot(mp, LK_SHARED, &vp);
++#else
+ ret = HgfsVfsRoot(mp, LK_SHARED, &vp, td);
++#endif
+ if (ret) {
+ DEBUG(VM_DEBUG_FAIL, "HgfsVfsRoot failed\n");
+ return ret;
+@@ -397,13 +428,23 @@
+ */
+
+ static int
++#if __FreeBSD_version >= 800087
++HgfsVfsRoot(struct mount *mp,
++ int flags,
++ struct vnode **vpp)
++#else
+ HgfsVfsRoot(struct mount *mp, // IN: Filesystem structure
+ int flags, // IN: Flags to vget
+ struct vnode **vpp, // OUT: Address of root vnode
+ struct thread *td) // IN: Thread structure
++#endif
+ {
+ HgfsSuperInfo *sip = (HgfsSuperInfo *)mp->mnt_data;
+ int ret = 0;
++#if __FreeBSD_version >= 800087
++ struct thread *td;
++ td = curthread;
++#endif
+
+ *vpp = NULL;
+
Property changes on: trunk/emulators/open-vm-tools/files/patch-freebsd-8
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-getpwnam
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-getpwnam (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-getpwnam 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,40 @@
+--- lib/auth/authPosix.c 2008-03-19 08:49:49.000000000 +0100
++++ lib/auth/authPosix.c 2008-03-27 11:20:20.000000000 +0100
+@@ -264,7 +264,11 @@
+ #endif
+ /* If this point is reached, the user has been authenticated. */
+ setpwent();
++#if defined(__FreeBSD__) || defined(__MidnightBSD__)
++ pwd = getpwnam(user);
++#else
+ pwd = Posix_Getpwnam(user);
++#endif
+ endpwent();
+
+ #else /* !USE_PAM */
+@@ -274,7 +278,11 @@
+ corresponding #endif below. */
+
+ setpwent(); //XXX can kill?
++#if defined(__FreeBSD__) || defined(__MidnightBSD__)
++ pwd = getpwnam(user);
++#else
+ pwd = Posix_Getpwnam(user);
++#endif
+ endpwent(); //XXX can kill?
+
+ if (!pwd) {
+--- lib/impersonate/impersonatePosix.c 2008-03-19 08:49:50.000000000 +0100
++++ lib/impersonate/impersonatePosix.c 2008-03-27 11:21:38.000000000 +0100
+@@ -432,7 +432,11 @@
+ struct passwd *ppw = &pw;
+ int error;
+
++#if defined(__FreeBSD__) || defined(__MidnightBSD__)
++ if ((error = getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) {
++#else
+ if ((error = Posix_Getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) {
++#endif
+ if (error == 0) {
+ error = ENOENT;
+ }
Property changes on: trunk/emulators/open-vm-tools/files/patch-getpwnam
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-guestApp.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-guestApp.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-guestApp.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- lib/guestApp/guestApp.c.orig 2008-05-29 10:42:37.000000000 +0300
++++ lib/guestApp/guestApp.c 2008-05-29 10:43:09.000000000 +0300
+@@ -65,7 +65,7 @@
+ #elif defined __APPLE__
+ # define GUESTAPP_TOOLS_INSTALL_PATH "/Library/Application Support/VMware Tools"
+ #else
+-# define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools"
++# define GUESTAPP_TOOLS_INSTALL_PATH "/usr/local/share/vmware-tools"
+ #endif
+
+ /*
Property changes on: trunk/emulators/open-vm-tools/files/patch-guestApp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-hgfsProto.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-hgfsProto.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-hgfsProto.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,22 @@
+--- lib/include/hgfsProto.h.orig
++++ lib/include/hgfsProto.h
+@@ -148,6 +148,9 @@
+ HGFS_OP_SET_EAS_V4, /* Add or modify extended attributes. */
+
+ HGFS_OP_MAX, /* Dummy op, must be last in enum */
++
++/* If a V4 packet is being processed as a legacy packet it will have this opcode. */
++ HGFS_V4_LEGACY_OPCODE = 0xff,
+ } HgfsOp;
+
+
+@@ -155,9 +158,6 @@
+ #define HGFS_VERSION_OLD (1 << 0)
+ #define HGFS_VERSION_3 (1 << 1)
+
+-/* If a V4 packet is being processed as a legacy packet it will have this opcode. */
+-#define HGFS_V4_LEGACY_OPCODE 0xff
+-
+ /* XXX: Needs change when VMCI is supported. */
+ #define HGFS_REQ_PAYLOAD_SIZE_V3(hgfsReq) (sizeof *hgfsReq + sizeof(HgfsRequest))
+ #define HGFS_REP_PAYLOAD_SIZE_V3(hgfsRep) (sizeof *hgfsRep + sizeof(HgfsReply))
Property changes on: trunk/emulators/open-vm-tools/files/patch-hgfsProto.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-hgfsmounter-Makefile.in
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-hgfsmounter-Makefile.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-hgfsmounter-Makefile.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,22 @@
+--- hgfsmounter/Makefile.in.orig 2011-09-21 18:25:50.000000000 +0000
++++ hgfsmounter/Makefile.in 2011-09-25 04:03:22.000000000 +0000
+@@ -606,14 +606,14 @@
+ @FREEBSD_TRUE@ mv $(DESTDIR)$(sbindir)/mount.vmhgfs \
+ @FREEBSD_TRUE@ $(DESTDIR)$(sbindir)/mount_vmhgfs
+ @FREEBSD_TRUE@ -$(MKDIR_P) $(DESTDIR)/sbin
+- at FREEBSD_TRUE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount_vmhgfs \
+- at FREEBSD_TRUE@ $(DESTDIR)/sbin/mount_vmhgfs &> /dev/null
++#@FREEBSD_TRUE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount_vmhgfs \
++#@FREEBSD_TRUE@ $(DESTDIR)/sbin/mount_vmhgfs &> /dev/null
+ @FREEBSD_TRUE at uninstall-hook:
+ @FREEBSD_TRUE@ rm -f $(DESTDIR)$(sbindir)/mount_vmhgfs
+ @FREEBSD_FALSE at install-exec-hook:
+- at FREEBSD_FALSE@ -$(MKDIR_P) $(DESTDIR)/sbin
+- at FREEBSD_FALSE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount.vmhgfs \
+- at FREEBSD_FALSE@ $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null
++#@FREEBSD_FALSE@ -$(MKDIR_P) $(DESTDIR)/sbin
++#@FREEBSD_FALSE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount.vmhgfs \
++#@FREEBSD_FALSE@ $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null
+ @FREEBSD_FALSE at uninstall-hook:
+ @FREEBSD_FALSE@ rm -f $(DESTDIR)/sbin/mount.vmhgfs
+
Property changes on: trunk/emulators/open-vm-tools/files/patch-hgfsmounter-Makefile.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-lib__include__vm_assert.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-lib__include__vm_assert.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-lib__include__vm_assert.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,12 @@
+--- lib/include/vm_assert.h.orig 2013-09-23 17:51:10.000000000 +0200
++++ lib/include/vm_assert.h 2015-02-04 15:55:56.011187000 +0100
+@@ -363,7 +363,8 @@
+ #define ASSERT_ON_COMPILE(e) \
+ do { \
+ enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \
+- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \
++ typedef char AssertOnCompileFailed[AssertOnCompileMisused] \
++ __attribute__((__unused__)); \
+ } while (0)
+
+
Property changes on: trunk/emulators/open-vm-tools/files/patch-lib__include__vm_assert.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-lib__include__vm_atomic.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-lib__include__vm_atomic.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-lib__include__vm_atomic.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,12 @@
+--- lib/include/vm_atomic.h.orig 2013-09-23 17:51:10.000000000 +0200
++++ lib/include/vm_atomic.h 2015-02-04 16:28:59.372337000 +0100
+@@ -2460,7 +2460,8 @@
+ && 8 * sizeof (out) == size \
+ && 8 * sizeof (cast) == size \
+ ? 1 : -1 }; \
+- typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \
++ typedef char AssertOnCompileFailed[AssertOnCompileMisused] \
++ __attribute__((__unused__)); \
+ } \
+ \
+ \
Property changes on: trunk/emulators/open-vm-tools/files/patch-lib__include__vm_atomic.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,10 @@
+--- ./lib/vmCheck/vmcheck.c.orig 2013-09-23 15:51:10.000000000 +0000
++++ ./lib/vmCheck/vmcheck.c 2014-04-23 15:36:44.323843725 +0000
+@@ -134,6 +134,7 @@
+ #else
+ do {
+ int signals[] = {
++ SIGBUS,
+ SIGILL,
+ SIGSEGV,
+ };
Property changes on: trunk/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-lib_include_vmware_tools_log.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-lib_include_vmware_tools_log.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-lib_include_vmware_tools_log.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,13 @@
+--- lib/include/vmware/tools/log.h.orig 2014-11-07 12:41:57.111095753 +0100
++++ lib/include/vmware/tools/log.h 2014-11-07 12:42:24.867212316 +0100
+@@ -134,8 +134,9 @@
+ *******************************************************************************
+ */
+
++#ifndef g_info
+ #define g_info(fmt, ...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
+-
++#endif
+
+ /*
+ *******************************************************************************
Property changes on: trunk/emulators/open-vm-tools/files/patch-lib_include_vmware_tools_log.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-libguestlib-Makefile
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-libguestlib-Makefile (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-libguestlib-Makefile 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,22 @@
+--- ./libguestlib/Makefile.am.orig 2010-04-28 03:17:28.000000000 +0900
++++ ./libguestlib/Makefile.am 2010-11-11 22:21:38.000000000 +0900
+@@ -41,7 +41,7 @@
+
+ EXTRA_DIST = vmguestlib.pc.in
+
+-pkgconfigdir = $(libdir)/pkgconfig
++pkgconfigdir = $(prefix)/libdata/pkgconfig
+ pkgconfig_DATA = vmguestlib.pc
+
+ $(pkgconfig_DATA): $(top_builddir)/config.status
+--- ./libguestlib/Makefile.in.orig 2010-04-28 03:18:19.000000000 +0900
++++ ./libguestlib/Makefile.in 2010-11-11 22:22:04.000000000 +0900
+@@ -298,7 +298,7 @@
+ $(top_srcdir)/lib/include/vmSessionId.h \
+ $(top_srcdir)/lib/include/vm_basic_types.h
+ EXTRA_DIST = vmguestlib.pc.in
+-pkgconfigdir = $(libdir)/pkgconfig
++pkgconfigdir = $(prefix)/libdata/pkgconfig
+ pkgconfig_DATA = vmguestlib.pc
+ all: all-am
+
Property changes on: trunk/emulators/open-vm-tools/files/patch-libguestlib-Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-libvmtools__i18n.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-libvmtools__i18n.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-libvmtools__i18n.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,18 @@
+--- libvmtools/i18n.c.orig 2014-04-17 19:02:44.102203216 +0000
++++ libvmtools/i18n.c 2014-04-17 19:08:48.881598972 +0000
+@@ -88,6 +88,7 @@
+ }
+
+
++#ifdef BUG_ON
+ /*
+ ******************************************************************************
+ * MsgHasMsgID -- */ /**
+@@ -112,6 +113,7 @@
+ *(s += MSG_MAGIC_LEN) == '(' &&
+ strchr(s + 1, ')') != NULL;
+ }
++#endif
+
+
+ /*
Property changes on: trunk/emulators/open-vm-tools/files/patch-libvmtools__i18n.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-modules-Makefile.in
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-modules-Makefile.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-modules-Makefile.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,19 @@
+--- modules/Makefile.in.orig 2009-04-06 18:44:58.000000000 -0400
++++ modules/Makefile.in 2009-04-06 18:45:57.000000000 -0400
+@@ -528,11 +528,11 @@
+ @SOLARIS_TRUE@ $(MAKE) VM_UNAME=$(KERNEL_RELEASE) MV=mv RM=rm \
+ @SOLARIS_TRUE@ -C "$(modulesrc)/$(MODULES_OS)/$$MOD" install || exit 1; \
+ @SOLARIS_TRUE@ done
+- at FREEBSD_TRUE@ for MOD in $(MODULES); do \
+- at FREEBSD_TRUE@ $(INSTALL) -d $(DESTDIR)$(MODULES_DIR); \
+- at FREEBSD_TRUE@ $(INSTALL) -m644 $(modulesrc)/$(MODULES_OS)/$$MOD.ko \
+- at FREEBSD_TRUE@ $(DESTDIR)$(MODULES_DIR); \
+- at FREEBSD_TRUE@ done
++#@FREEBSD_TRUE@ for MOD in $(MODULES); do \
++#@FREEBSD_TRUE@ $(INSTALL) -d $(DESTDIR)$(MODULES_DIR); \
++#@FREEBSD_TRUE@ $(INSTALL) -m644 $(modulesrc)/$(MODULES_OS)/$$MOD.ko \
++#@FREEBSD_TRUE@ $(DESTDIR)$(MODULES_DIR); \
++#@FREEBSD_TRUE@ done
+ @LINUX_TRUE@ for MOD in $(MODULES); do \
+ @LINUX_TRUE@ $(INSTALL) -d $(DESTDIR)`eval echo '$$'$${MOD}dir`; \
+ @LINUX_TRUE@ $(INSTALL) -m644 $(modulesrc)/$(MODULES_OS)/$$MOD/$$MOD.ko \
Property changes on: trunk/emulators/open-vm-tools/files/patch-modules-Makefile.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- modules/freebsd/vmhgfs/channel.h.orig 2014-04-23 15:36:34.432844311 +0000
++++ modules/freebsd/vmhgfs/channel.h 2014-04-23 15:36:44.389843756 +0000
+@@ -21,7 +21,7 @@
+ */
+
+ #ifndef _HGFS_CHANNEL_H_
+-#define _HGFS_CHANNEL__H_
++#define _HGFS_CHANNEL_H_
+
+ #include "hgfs_kernel.h"
+ #include "requestInt.h"
Property changes on: trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,80 @@
+--- modules/freebsd/vmxnet/if_vxn.c.orig 2013-09-23 19:51:10.000000000 +0400
++++ modules/freebsd/vmxnet/if_vxn.c 2014-10-02 22:13:31.000000000 +0400
+@@ -76,6 +76,10 @@
+ #include <pci/pcivar.h>
+ #endif
+
++#if __FreeBSD_version >= 1100001
++#include <net/if_var.h>
++#endif
++
+ /* define INLINE the way gcc likes it */
+ #define INLINE __inline__
+
+@@ -936,14 +940,14 @@
+ if (m != NULL) {
+ struct mbuf *m_new = NULL;
+
+- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
++ MGETHDR(m_new, M_NOWAIT, MT_DATA);
+ if (m_new == NULL) {
+ printf("vxn%d: no memory for tx list\n", VXN_IF_UNIT(ifp));
+ return 1;
+ }
+
+ if (m_head->m_pkthdr.len > MHLEN) {
+- MCLGET(m_new, M_DONTWAIT);
++ MCLGET(m_new, M_NOWAIT);
+ if (!(m_new->m_flags & M_EXT)) {
+ m_freem(m_new);
+ printf("vxn%d: no memory for tx list\n", VXN_IF_UNIT(ifp));
+@@ -1067,7 +1071,11 @@
+ VMXNET_INC(dd->txDriverNext, dd->txRingLength);
+ dd->txNumDeferred++;
+ sc->vxn_tx_pending++;
++#if __FreeBSD_version >= 1100036
++ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
++#else
+ ifp->if_opackets++;
++#endif
+ }
+
+ /*
+@@ -1266,9 +1274,9 @@
+ /*
+ * Allocate a new mbuf cluster to replace the current one
+ */
+- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
++ MGETHDR(m_new, M_NOWAIT, MT_DATA);
+ if (m_new != NULL) {
+- MCLGET(m_new, M_DONTWAIT);
++ MCLGET(m_new, M_NOWAIT);
+ if (m_new->m_flags & M_EXT) {
+ m_adj(m_new, ETHER_ALIGN);
+ } else {
+@@ -1286,8 +1294,11 @@
+
+ sc->vxn_rx_buffptr[dd->rxDriverNext] = m_new;
+ rre->paddr = (uint32)vtophys(mtod(m_new, caddr_t));
+-
++#if __FreeBSD_version >= 1100036
++ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
++#else
+ ifp->if_ipackets++;
++#endif
+ m->m_pkthdr.rcvif = ifp;
+ m->m_pkthdr.len = m->m_len = pkt_len;
+
+@@ -1401,10 +1412,10 @@
+ * Allocate an mbuf and initialize it to contain a packet header and
+ * internal data.
+ */
+- MGETHDR(m_new, M_DONTWAIT, MT_DATA);
++ MGETHDR(m_new, M_NOWAIT, MT_DATA);
+ if (m_new != NULL) {
+ /* Allocate and attach an mbuf cluster to mbuf. */
+- MCLGET(m_new, M_DONTWAIT);
++ MCLGET(m_new, M_NOWAIT);
+ if (m_new->m_flags & M_EXT) {
+ m_adj(m_new, ETHER_ALIGN);
+ sc->vxn_rx_ring[i].paddr = (uint32)vtophys(mtod(m_new, caddr_t));
Property changes on: trunk/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-net_compat.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-net_compat.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-net_compat.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,17 @@
+--- modules/freebsd/vmxnet/net_compat.h.orig 2011-09-21 14:25:15.000000000 -0400
++++ modules/freebsd/vmxnet/net_compat.h 2012-06-28 17:05:44.638526644 -0400
+@@ -170,9 +170,12 @@
+ #if __FreeBSD_version < 505000
+ # define VXN_IF_ADDR_LOCK(_ifp)
+ # define VXN_IF_ADDR_UNLOCK(_ifp)
++#elif __FreeBSD_version < 1000000 || defined(__MidnightBSD__)
++# define VXN_IF_ADDR_LOCK(_ifp) IF_ADDR_LOCK((_ifp))
++# define VXN_IF_ADDR_UNLOCK(_ifp) IF_ADDR_UNLOCK((_ifp))
+ #else
+-# define VXN_IF_ADDR_LOCK(_ifp) IF_ADDR_LOCK((_ifp))
+-# define VXN_IF_ADDR_UNLOCK(_ifp) IF_ADDR_UNLOCK((_ifp))
++# define VXN_IF_ADDR_LOCK(_ifp) IF_ADDR_WLOCK((_ifp))
++# define VXN_IF_ADDR_UNLOCK(_ifp) IF_ADDR_WUNLOCK((_ifp))
+ #endif
+
+ #endif /* _VXN_NET_COMPAT_H_ */
Property changes on: trunk/emulators/open-vm-tools/files/patch-net_compat.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-scripts-Makefile
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-scripts-Makefile (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-scripts-Makefile 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- scripts/Makefile.in.orig 2010-05-22 04:41:58.000000000 +0200
++++ scripts/Makefile.in 2010-05-22 04:43:57.000000000 +0200
+@@ -236,7 +236,7 @@
+ top_srcdir = @top_srcdir@
+ defaultscripts = poweron-vm-default poweroff-vm-default \
+ suspend-vm-default resume-vm-default
+-confdir = /etc/vmware-tools
++confdir = ${prefix}/share/vmware-tools
+ conf_SCRIPTS = ./common/vm-support ./common/statechange.subr \
+ $(defaultscripts)
+ vmwsrcdir = $(confdir)/scripts/vmware
Property changes on: trunk/emulators/open-vm-tools/files/patch-scripts-Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-scripts-network
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-scripts-network (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-scripts-network 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,10 @@
+--- ./scripts/freebsd/network.orig 2010-04-28 03:17:28.000000000 +0900
++++ ./scripts/freebsd/network 2010-11-11 22:18:23.000000000 +0900
+@@ -59,6 +59,7 @@
+
+ for intf in `list_net_interfaces dhcp`; do
+ /etc/rc.d/netif $1 $intf
++ /etc/rc.d/dhclient $1 $intf
+ ec=$?
+
+ # Failure to stop an interface should not interfere with suspend.
Property changes on: trunk/emulators/open-vm-tools/files/patch-scripts-network
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-scripts_linux_pam.d_vmtoolsd
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-scripts_linux_pam.d_vmtoolsd (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-scripts_linux_pam.d_vmtoolsd 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,10 @@
+--- scripts/linux/pam.d/vmtoolsd.orig 2013-09-23 15:51:10 UTC
++++ scripts/linux/pam.d/vmtoolsd
+@@ -1,7 +1,3 @@
+ #%PAM-1.0
+-auth sufficient pam_unix2.so nullok
+ auth sufficient pam_unix.so shadow nullok
+-auth required pam_unix_auth.so shadow nullok
+-account sufficient pam_unix2.so
+ account sufficient pam_unix.so
+-account required pam_unix_acct.so
Property changes on: trunk/emulators/open-vm-tools/files/patch-scripts_linux_pam.d_vmtoolsd
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-toolbox__toolboxcmd-shrink.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-toolbox__toolboxcmd-shrink.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-toolbox__toolboxcmd-shrink.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- toolbox/toolboxcmd-shrink.c.orig 2013-09-23 17:51:10.000000000 +0200
++++ toolbox/toolboxcmd-shrink.c 2014-11-25 17:57:44.000000000 +0100
+@@ -391,7 +391,7 @@ ShrinkDoWipeAndShrink(char *mountPoint,
+ * Verify that wiping/shrinking are permitted before going through with the
+ * wiping operation.
+ */
+- if (!ShrinkGetWiperState() == WIPER_ENABLED && !Wiper_IsWipeSupported(part)) {
++ if (ShrinkGetWiperState() != WIPER_ENABLED && !Wiper_IsWipeSupported(part)) {
+ g_debug("%s cannot be wiped / shrunk\n", mountPoint);
+ ToolsCmd_PrintErr("%s",
+ SU_(disk.shrink.disabled, SHRINK_DISABLED_ERR));
Property changes on: trunk/emulators/open-vm-tools/files/patch-toolbox__toolboxcmd-shrink.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-util_misc.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-util_misc.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-util_misc.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,20 @@
+--- lib/misc/util_misc.c.orig 2009-04-14 02:38:09.000000000 +0200
++++ lib/misc/util_misc.c 2009-04-14 02:39:00.000000000 +0200
+@@ -292,7 +292,7 @@
+ return (strcmp(path1, path2) == 0);
+ #elif defined(_WIN32)
+ return (_stricmp(path1, path2) == 0);
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
+ return (strcasecmp(path1, path2) == 0);
+ #else
+ NOT_IMPLEMENTED();
+@@ -319,7 +319,7 @@
+ Bool
+ Util_IsAbsolutePath(const char *path) // IN: path to check
+ {
+-#if defined(__linux__) || defined(__APPLE__)
++#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__MidnightBSD__)
+ // path[0] is valid even for the empty string.
+ return path && path[0] == DIRSEPC;
+ #elif defined(_WIN32)
Property changes on: trunk/emulators/open-vm-tools/files/patch-util_misc.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vm_basic_asm.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vm_basic_asm.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vm_basic_asm.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- lib/include/vm_basic_asm.h.orig 2013-11-13 03:22:29.000000000 +0000
++++ lib/include/vm_basic_asm.h 2013-11-13 03:24:26.000000000 +0000
+@@ -208,7 +208,7 @@
+ GetCallerEFlags(void)
+ {
+ unsigned long flags;
+- asm volatile("pushf; pop %0" : "=r"(flags));
++ __asm__ volatile("pushf; pop %0" : "=r"(flags));
+ return flags;
+ }
+
Property changes on: trunk/emulators/open-vm-tools/files/patch-vm_basic_asm.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vm_basic_types.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vm_basic_types.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vm_basic_types.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,10 @@
+--- ./lib/include/vm_basic_types.h.orig 2010-10-20 05:19:54.000000000 +0900
++++ ./lib/include/vm_basic_types.h 2010-10-29 20:11:03.000000000 +0900
+@@ -333,6 +333,7 @@
+ #define FMTPD ""
+ #endif
+ #elif defined(__linux__) \
++ || (defined(__clang__)) \
+ || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \
+ || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
+ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L)
Property changes on: trunk/emulators/open-vm-tools/files/patch-vm_basic_types.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmblock-vfsops.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmblock-vfsops.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmblock-vfsops.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- modules/freebsd/vmblock/vfsops.c.orig
++++ modules/freebsd/vmblock/vfsops.c
+@@ -236,7 +236,7 @@
+ */
+ MNT_ILOCK(mp);
+ mp->mnt_flag |= lowerrootvp->v_mount->mnt_flag & MNT_LOCAL;
+-#if __FreeBSD_version >= 600000
++#if __FreeBSD_version >= 600000 && __FreeBSD_version < 1000021
+ mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE;
+ #endif
+ MNT_IUNLOCK(mp);
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmblock-vfsops.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmblock-vnops.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmblock-vnops.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmblock-vnops.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,24 @@
+--- modules/freebsd/vmblock/vnops.c.orig 2011-09-21 14:25:15.000000000 -0400
++++ modules/freebsd/vmblock/vnops.c 2012-06-28 20:51:22.897344202 -0400
+@@ -1362,7 +1362,9 @@
+ */
+ {
+ struct vnode *vp = ap->a_vp;
++#if __FreeBSD_version < 1000000
+ struct thread *td = ap->a_td;
++#endif
+
+ vp->v_object = NULL;
+
+@@ -1370,7 +1372,11 @@
+ * If this is the last reference, then free up the vnode so as not to
+ * tie up the lower vnode.
+ */
++#if __FreeBSD_version < 1000000
+ vrecycle(vp, td);
++#else
++ vrecycle(vp);
++#endif
+
+ return 0;
+ }
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmblock-vnops.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmblockmounter-Makefile.in
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmblockmounter-Makefile.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmblockmounter-Makefile.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,12 @@
+--- vmblockmounter/Makefile.in.orig 2013-12-27 17:42:57.000000000 +0000
++++ vmblockmounter/Makefile.in 2013-12-27 17:44:31.000000000 +0000
+@@ -644,9 +644,6 @@
+ @FREEBSD_TRUE at install-exec-hook:
+ @FREEBSD_TRUE@ mv $(DESTDIR)$(sbindir)/mount.vmblock \
+ @FREEBSD_TRUE@ $(DESTDIR)$(sbindir)/mount_vmblock
+- at FREEBSD_TRUE@ -$(MKDIR_P) $(DESTDIR)/sbin
+- at FREEBSD_TRUE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount_vmblock \
+- at FREEBSD_TRUE@ $(DESTDIR)/sbin/mount_vmblock &> /dev/null
+ @FREEBSD_TRUE at uninstall-hook:
+ @FREEBSD_TRUE@ rm -f $(DESTDIR)$(sbindir)/mount_vmblock
+ @FREEBSD_FALSE at install-exec-hook:
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmblockmounter-Makefile.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmhgfs-Makefile
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmhgfs-Makefile (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmhgfs-Makefile 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,21 @@
+--- modules/freebsd/vmhgfs/Makefile.orig 2013-04-17 22:12:22.000000000 +0000
++++ modules/freebsd/vmhgfs/Makefile 2013-11-16 03:21:39.890032940 +0000
+@@ -47,7 +47,7 @@
+ .endif
+
+ COMMON_HGFS_SRCS := debug.c
+-COMMON_HGFS_SRCS := bdhandler.c
++COMMON_HGFS_SRCS += bdhandler.c
+ COMMON_HGFS_SRCS += request.c
+ COMMON_HGFS_SRCS += worker.c
+ COMMON_HGFS_SRCS += fsutil.c
+@@ -108,7 +108,9 @@
+ CWARNFLAGS += -Wpointer-arith
+ CWARNFLAGS += -Winline
+ CWARNFLAGS += -Wcast-qual
++CWARNFLAGS += ${NO_WUNNEEDED_INTERNAL_DECL}
+
+ EXPORT_SYMS = NO
+
++.include <bsd.own.mk>
+ .include <bsd.kmod.mk>
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmhgfs-Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmhgfs-kernelStubs.h
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmhgfs-kernelStubs.h (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmhgfs-kernelStubs.h 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- modules/freebsd/vmhgfs/kernelStubs.h.orig 2010-10-20 05:19:54.000000000 +0900
++++ modules/freebsd/vmhgfs/kernelStubs.h 2010-11-16 13:26:24.000000000 +0900
+@@ -132,7 +132,7 @@
+ * Stub functions we provide.
+ */
+
+-void Panic(const char *fmt, ...);
++/* void Panic(const char *fmt, ...); -> vm_assert.h */
+
+ char *Str_Strcpy(char *buf, const char *src, size_t maxSize);
+ int Str_Vsnprintf(char *str, size_t size, const char *format,
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmhgfs-kernelStubs.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmhgfs-os.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmhgfs-os.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmhgfs-os.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- modules/freebsd/vmhgfs/os.c.orig
++++ modules/freebsd/vmhgfs/os.c
+@@ -647,7 +647,7 @@
+ OS_THREAD_T *newThread) // OUT
+ {
+ return compat_kthread_create(function, parameter,
+- newThread, 0, 0, threadName);
++ newThread, 0, 0, "%s", threadName);
+ }
+
+
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmhgfs-os.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmhgfs-vfsops.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmhgfs-vfsops.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmhgfs-vfsops.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,12 @@
+--- modules/freebsd/vmhgfs/vfsops.c.orig
++++ modules/freebsd/vmhgfs/vfsops.c
+@@ -201,7 +201,9 @@
+ * structures, not oplocks/leases with the VM's host.)
+ */
++#if __FreeBSD_version < 1000021
+ MNT_ILOCK(mp);
+ mp->mnt_kern_flag |= MNTK_MPSAFE;
+ MNT_IUNLOCK(mp);
++#endif
+
+ /* Get a new unique filesystem ID */
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmhgfs-vfsops.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmhgfs-vnopscommon.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmhgfs-vnopscommon.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmhgfs-vnopscommon.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- modules/freebsd/vmhgfs/vnopscommon.c.orig 2010-10-20 05:19:54.000000000 +0900
++++ modules/freebsd/vmhgfs/vnopscommon.c 2010-11-16 13:26:55.000000000 +0900
+@@ -50,7 +50,7 @@
+ static int HgfsDoGetattrInt(const char *path, const HgfsHandle handle, HgfsSuperInfo *sip,
+ HgfsAttrV2 *hgfsAttrV2);
+ static int HgfsDoGetattrByName(const char *path, HgfsSuperInfo *sip, HgfsAttrV2 *hgfsAttrV2);
+-int HgfsReadlinkInt(struct vnode *vp, struct uio *uiop);
++/* int HgfsReadlinkInt(struct vnode *vp, struct uio *uiop); -> vnopscommon.h */
+ static int HgfsQueryAttrInt(const char *path, HgfsHandle handle, HgfsSuperInfo *sip,
+ HgfsKReqHandle req);
+ static int HgfsRefreshHandle(struct vnode *vp, HgfsSuperInfo *sip, HgfsHandle *handle);
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmhgfs-vnopscommon.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmmemctl-os.c
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmmemctl-os.c (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmmemctl-os.c 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,157 @@
+--- modules/freebsd/vmmemctl/os.c.orig 2013-09-23 10:51:10.000000000 -0500
++++ modules/freebsd/vmmemctl/os.c 2014-04-23 15:51:43.823041178 -0500
+@@ -37,9 +37,11 @@
+ #include <sys/param.h>
+ #include <sys/systm.h>
+ #include <sys/kernel.h>
++#include <sys/lock.h>
+ #include <sys/malloc.h>
+ #include <sys/module.h>
+ #include <sys/conf.h>
++#include <sys/rwlock.h>
+ #include <sys/sysctl.h>
+
+ #include <vm/vm.h>
+@@ -223,7 +225,11 @@ static __inline__ unsigned long os_ffz(u
+ unsigned long
+ OS_ReservedPageGetLimit(void)
+ {
++#if __FreeBSD_version < 1100015
+ return cnt.v_page_count;
++#else
++ return vm_cnt.v_page_count;
++#endif
+ }
+
+
+@@ -295,7 +301,13 @@ OS_ReservedPageGetHandle(PA64 pa) //
+ Mapping
+ OS_MapPageHandle(PageHandle handle) // IN
+ {
++
++#if __FreeBSD_version >= 1000042
++ vm_offset_t res = kva_alloc(PAGE_SIZE);
++#else
+ vm_offset_t res = kmem_alloc_nofault(kernel_map, PAGE_SIZE);
++#endif
++
+ vm_page_t page = (vm_page_t)handle;
+
+ if (!res) {
+@@ -352,7 +364,11 @@ void
+ OS_UnmapPage(Mapping mapping) // IN
+ {
+ pmap_qremove((vm_offset_t)mapping, 1);
++#if __FreeBSD_version >= 1000042
++ kva_free((vm_offset_t)mapping, PAGE_SIZE);
++#else
+ kmem_free(kernel_map, (vm_offset_t)mapping, PAGE_SIZE);
++#endif
+ }
+
+
+@@ -360,7 +376,11 @@ static void
+ os_pmap_alloc(os_pmap *p) // IN
+ {
+ /* number of pages (div. 8) */
++#if __FreeBSD_version < 1100015
+ p->size = (cnt.v_page_count + 7) / 8;
++#else
++ p->size = (vm_cnt.v_page_count + 7) / 8;
++#endif
+
+ /*
+ * expand to nearest word boundary
+@@ -369,14 +389,23 @@ os_pmap_alloc(os_pmap *p) // IN
+ p->size = (p->size + sizeof(unsigned long) - 1) &
+ ~(sizeof(unsigned long) - 1);
+
++#if __FreeBSD_version >= 1000042
++ p->bitmap = (unsigned long *)kmem_malloc(kernel_arena, p->size,
++ M_WAITOK | M_ZERO);
++#else
+ p->bitmap = (unsigned long *)kmem_alloc(kernel_map, p->size);
++#endif
+ }
+
+
+ static void
+ os_pmap_free(os_pmap *p) // IN
+ {
++#if __FreeBSD_version >= 1000042
++ kva_free((vm_offset_t)p->bitmap, p->size);
++#else
+ kmem_free(kernel_map, (vm_offset_t)p->bitmap, p->size);
++#endif
+ p->size = 0;
+ p->bitmap = NULL;
+ }
+@@ -449,12 +478,31 @@ os_kmem_free(vm_page_t page) // IN
+ os_state *state = &global_state;
+ os_pmap *pmap = &state->pmap;
+
+- if ( !vm_page_lookup(state->vmobject, page->pindex) ) {
+- return;
+- }
+
+- os_pmap_putindex(pmap, page->pindex);
+- vm_page_free(page);
++#if __FreeBSD_version > 1000029
++ VM_OBJECT_WLOCK(state->vmobject);
++#else
++ VM_OBJECT_LOCK(state->vmobject);
++#endif
++ if ( vm_page_lookup(state->vmobject, page->pindex) ) {
++ os_pmap_putindex(pmap, page->pindex);
++#if __FreeBSD_version >= 900000
++ vm_page_lock(page);
++#else
++ vm_page_lock_queues();
++#endif
++ vm_page_free(page);
++#if __FreeBSD_version >= 900000
++ vm_page_unlock(page);
++#else
++ vm_page_unlock_queues();
++#endif
++ }
++#if __FreeBSD_version > 1000029
++ VM_OBJECT_WUNLOCK(state->vmobject);
++#else
++ VM_OBJECT_UNLOCK(state->vmobject);
++#endif
+ }
+
+
+@@ -466,8 +514,19 @@ os_kmem_alloc(int alloc_normal_failed) /
+ os_state *state = &global_state;
+ os_pmap *pmap = &state->pmap;
+
++#if __FreeBSD_version > 1000029
++ VM_OBJECT_WLOCK(state->vmobject);
++#else
++ VM_OBJECT_LOCK(state->vmobject);
++#endif
++
+ pindex = os_pmap_getindex(pmap);
+ if (pindex == (vm_pindex_t)-1) {
++#if __FreeBSD_version > 1000029
++ VM_OBJECT_WUNLOCK(state->vmobject);
++#else
++ VM_OBJECT_UNLOCK(state->vmobject);
++#endif
+ return NULL;
+ }
+
+@@ -488,6 +547,11 @@ os_kmem_alloc(int alloc_normal_failed) /
+ if (!page) {
+ os_pmap_putindex(pmap, pindex);
+ }
++#if __FreeBSD_version > 1000029
++ VM_OBJECT_WUNLOCK(state->vmobject);
++#else
++ VM_OBJECT_UNLOCK(state->vmobject);
++#endif
+
+ return page;
+ }
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmmemctl-os.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-vmtoolsd-Makefile.in
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-vmtoolsd-Makefile.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-vmtoolsd-Makefile.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- services/vmtoolsd/Makefile.in.orig 2009-04-06 18:40:27.000000000 -0400
++++ services/vmtoolsd/Makefile.in 2009-04-06 18:41:16.000000000 -0400
+@@ -722,7 +722,7 @@
+ $@ || (rm -f $@ && exit 1)
+
+ install-exec-hook:
+- $(INSTALL) -d $(DESTDIR)/etc/vmware-tools
++# $(INSTALL) -d $(DESTDIR)/etc/vmware-tools
+
+ uninstall-hook:
+ rm -rf $(DESTDIR)/etc/vmware-tools
Property changes on: trunk/emulators/open-vm-tools/files/patch-vmtoolsd-Makefile.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/patch-wrapper-Makefile.am
===================================================================
--- trunk/emulators/open-vm-tools/files/patch-wrapper-Makefile.am (rev 0)
+++ trunk/emulators/open-vm-tools/files/patch-wrapper-Makefile.am 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+--- vmware-user-suid-wrapper/Makefile.am.orig 2010-10-20 05:19:54.000000000 +0900
++++ vmware-user-suid-wrapper/Makefile.am 2010-11-16 17:52:55.000000000 +0900
+@@ -19,6 +19,8 @@
+
+ AM_CPPFLAGS =
+ AM_CPPFLAGS += -DVMTOOLSD_PATH=\"$(bindir)/vmtoolsd\"
++# See post-install on Makefile of ports.
++AM_CPPFLAGS += -DVMWARE_KMOD_DIR=\"$(prefix)/lib/vmware-tools/modules/drivers\"
+
+ vmware_user_suid_wrapper_SOURCES =
+ vmware_user_suid_wrapper_SOURCES += main.c
Property changes on: trunk/emulators/open-vm-tools/files/patch-wrapper-Makefile.am
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/pkg-message.in
===================================================================
--- trunk/emulators/open-vm-tools/files/pkg-message.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/pkg-message.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,11 @@
+*******************************************************************
+To run the Open Virtual Machine tools at startup, add the following
+settings to your /etc/rc.conf
+
+vmware_guest_vmblock_enable="YES"
+vmware_guest_vmhgfs_enable="YES"
+vmware_guest_vmmemctl_enable="YES"
+vmware_guest_vmxnet_enable="YES"
+vmware_guestd_enable="YES"
+
+*******************************************************************
Property changes on: trunk/emulators/open-vm-tools/files/pkg-message.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/vmware-guestd.in
===================================================================
--- trunk/emulators/open-vm-tools/files/vmware-guestd.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/vmware-guestd.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD: head/emulators/open-vm-tools/files/vmware-guestd.in 337221 2013-12-22 22:23:06Z swills $
+#
+
+# PROVIDE: vmware-guestd
+# REQUIRE: DAEMON netif
+# BEFORE: LOGIN
+
+. /etc/rc.subr
+
+# Global
+checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
+
+# VMware guest daemon
+name="vmware_guestd"
+rcvar=vmware_guestd_enable
+start_precmd="${checkvm_cmd}"
+unset start_cmd
+stop_precmd="${checkvm_cmd}"
+unset stop_cmd
+command="%%PREFIX%%/bin/vmtoolsd"
+command_args="-c %%PREFIX%%/share/vmware-tools/tools.conf -p %%PREFIX%%/lib/open-vm-tools/plugins/vmsvc"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+[ -z "$vmware_guestd_enable" ] && vmware_guestd_enable="YES"
+[ -z "$vmware_guestd_flags" ] && vmware_guestd_flags="--background ${pidfile}"
+run_rc_command "$1"
Property changes on: trunk/emulators/open-vm-tools/files/vmware-guestd.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/files/vmware-kmod.in
===================================================================
--- trunk/emulators/open-vm-tools/files/vmware-kmod.in (rev 0)
+++ trunk/emulators/open-vm-tools/files/vmware-kmod.in 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# $FreeBSD: head/emulators/open-vm-tools/files/vmware-kmod.in 375346 2014-12-23 15:48:33Z brd $
+#
+
+# PROVIDE: vmware-kmod
+# REQUIRE: FILESYSTEMS ldconfig
+# BEFORE: netif
+
+. /etc/rc.subr
+
+# Global
+checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
+
+# Functions
+vmware_mod_load()
+{
+ echo -n "Loading $1 kernel module: "
+ kldstat -n %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1
+ if [ "$?" = "0" ]; then
+ echo "already loaded."
+ else
+ kldload %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1
+ if [ "$?" = "0" ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+ fi
+}
+vmware_mod_status()
+{
+ echo -n "Checking $1 kernel module: "
+ kldstat -n %%PREFIX%%/lib/vmware-tools/modules/drivers/$1.ko >/dev/null 2>&1
+ if [ "$?" = "0" ]; then
+ echo "loaded."
+ else
+ echo "not loaded"
+ fi
+}
+
+# VMware kernel module: vmmemctl
+kernel_mod="vmmemctl"
+name="vmware_guest_${kernel_mod}"
+rcvar=vmware_guest_${kernel_mod}_enable
+extra_commands="status"
+status_cmd="vmware_mod_status ${kernel_mod}"
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_mod_load ${kernel_mod}"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_vmmemctl_enable" ] && vmware_guest_vmmemctl_enable="NO"
+[ -n "$vmware_guest_kmod_enable" ] && vmware_guest_vmmemctl_enable="$vmware_guest_kmod_enable"
+run_rc_command "$1"
+
+# VMware kernel module: vmxnet
+kernel_mod="vmxnet"
+name="vmware_guest_${kernel_mod}"
+rcvar=vmware_guest_${kernel_mod}_enable
+extra_commands="status"
+status_cmd="vmware_mod_status ${kernel_mod}"
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_mod_load ${kernel_mod}"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_vmxnet_enable" ] && vmware_guest_vmxnet_enable="NO"
+run_rc_command "$1"
+
+# VMware kernel module: vmblock
+kernel_mod="vmblock"
+name="vmware_guest_${kernel_mod}"
+rcvar=vmware_guest_${kernel_mod}_enable
+extra_commands="status"
+status_cmd="vmware_mod_status ${kernel_mod}"
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_mod_load ${kernel_mod}"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_vmblock_enable" ] && vmware_guest_vmblock_enable="NO"
+run_rc_command "$1"
+
+# VMware kernel module: vmhgfs
+kernel_mod="vmhgfs"
+name="vmware_guest_${kernel_mod}"
+rcvar=vmware_guest_${kernel_mod}_enable
+extra_commands="status"
+status_cmd="vmware_mod_status ${kernel_mod}"
+start_precmd="${checkvm_cmd}"
+start_cmd="vmware_mod_load ${kernel_mod}"
+stop_precmd="${checkvm_cmd}"
+stop_cmd=":"
+
+load_rc_config $name
+[ -z "$vmware_guest_vmhgfs_enable" ] && vmware_guest_vmhgfs_enable="NO"
+run_rc_command "$1"
Property changes on: trunk/emulators/open-vm-tools/files/vmware-kmod.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/pkg-descr
===================================================================
--- trunk/emulators/open-vm-tools/pkg-descr (rev 0)
+++ trunk/emulators/open-vm-tools/pkg-descr 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,13 @@
+The Open Virtual Machine Tools (open-vm-tools) are the open source
+implementation of VMware Tools. They are a set of guest operating
+system virtualization components that enhance performance and user
+experience of virtual machines. As virtualization technology rapidly
+becomes mainstream, each virtualization solution provider implements
+their own set of tools and utilities to supplement the guest virtual
+machine. However, most of the implementations are proprietary and
+are tied to a specific virtualization platform.
+
+This port replaces the vmware guest ports and the binary only vmware
+tools ports in the ports tree.
+
+WWW: http://open-vm-tools.sourceforge.net
Property changes on: trunk/emulators/open-vm-tools/pkg-descr
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/emulators/open-vm-tools/pkg-plist
===================================================================
--- trunk/emulators/open-vm-tools/pkg-plist (rev 0)
+++ trunk/emulators/open-vm-tools/pkg-plist 2016-08-14 02:40:07 UTC (rev 21647)
@@ -0,0 +1,61 @@
+bin/vmware-checkvm
+bin/vmware-hgfsclient
+bin/vmware-rpctool
+bin/vmware-xferlogs
+bin/vmtoolsd
+bin/vmware-toolbox-cmd
+%%X11%%%%FUSE%%bin/vmware-vmblock-fuse
+lib/open-vm-tools/plugins/vmsvc/libguestInfo.so
+lib/open-vm-tools/plugins/vmsvc/libpowerOps.so
+lib/open-vm-tools/plugins/vmsvc/libtimeSync.so
+lib/open-vm-tools/plugins/vmsvc/libvmbackup.so
+lib/open-vm-tools/plugins/common/libhgfsServer.so
+lib/open-vm-tools/plugins/common/libvix.so
+%%X11%%lib/open-vm-tools/plugins/vmusr/libresolutionSet.so
+%%X11%%lib/open-vm-tools/plugins/vmusr/libdesktopEvents.so
+%%X11%%lib/open-vm-tools/plugins/vmusr/libdndcp.so
+%%X11%%etc/xdg/autostart/vmware-user.desktop
+lib/libhgfs.a
+lib/libhgfs.so
+lib/libhgfs.so.0
+lib/libhgfs.so.0.0.0
+lib/libvmtools.a
+lib/libvmtools.so
+lib/libvmtools.so.0
+lib/libvmtools.so.0.0.0
+lib/libguestlib.a
+lib/libguestlib.so
+lib/libguestlib.so.0
+lib/libguestlib.so.0.0.0
+libdata/pkgconfig/vmguestlib.pc
+lib/vmware-tools/modules/drivers/vmblock.ko
+lib/vmware-tools/modules/drivers/vmhgfs.ko
+lib/vmware-tools/modules/drivers/vmmemctl.ko
+lib/vmware-tools/modules/drivers/vmxnet.ko
+include/vmGuestLib/includeCheck.h
+include/vmGuestLib/vmGuestLib.h
+include/vmGuestLib/vmSessionId.h
+include/vmGuestLib/vm_basic_types.h
+ at dir lib/vmware-tools/modules/input
+ at comment sbin/mount_vmhgfs
+sbin/mount_vmblock
+%%X11%%bin/vmware-user-suid-wrapper
+share/vmware-tools/poweroff-vm-default
+share/vmware-tools/poweron-vm-default
+share/vmware-tools/resume-vm-default
+share/vmware-tools/suspend-vm-default
+share/vmware-tools/vm-support
+share/vmware-tools/statechange.subr
+share/vmware-tools/scripts/vmware/network
+%%DATADIR%%/messages/de/toolboxcmd.vmsg
+%%DATADIR%%/messages/de/vmtoolsd.vmsg
+%%DATADIR%%/messages/ja/toolboxcmd.vmsg
+%%DATADIR%%/messages/ja/vmtoolsd.vmsg
+%%DATADIR%%/messages/ko/toolboxcmd.vmsg
+%%DATADIR%%/messages/ko/vmtoolsd.vmsg
+%%DATADIR%%/messages/zh_CN/toolboxcmd.vmsg
+ at rmtry share/vmware-tools/tools.conf
+ at rmtry etc/vmware-tools/plugins
+etc/pam.d/vmtoolsd
+ at dir %%DATADIR%%/scripts/vmware
+ at dir %%DATADIR%%/tests
Property changes on: trunk/emulators/open-vm-tools/pkg-plist
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list