Index: head/emulators/open-vm-tools/Makefile =================================================================== --- head/emulators/open-vm-tools/Makefile (revision 464094) +++ head/emulators/open-vm-tools/Makefile (revision 464095) @@ -1,96 +1,96 @@ # Created by: mbr@FreeBSD.org # $FreeBSD$ PORTNAME= open-vm-tools PORTVERSION= ${RELEASE_VER} DISTVERSIONPREFIX= stable- -PORTREVISION= 3 +PORTREVISION= 4 PORTEPOCH= 2 CATEGORIES= emulators MAINTAINER= jpaetzel@FreeBSD.org COMMENT?= Open VMware tools for FreeBSD VMware guests LICENSE= LGPL21 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 i386 LIB_DEPENDS= libmspack.so:archivers/libmspack RELEASE_VER= 10.2.0 BUILD_VER= 7253323 OPTIONS_DEFINE= DNET LIBNOTIFY OPENSSL X11 OPTIONS_DEFAULT= DNET LIBNOTIFY OPENSSL X11 OPTIONS_SUB= DNET_DESC= libdnet support LIBNOTIFY_DESC= Desktop notification support X11_CONFIGURE_WITH= x gtk2 gtkmm X11_USE= xorg=ice,sm,x11,xext,xi,xinerama,xineramaproto,xrandr,xrender,xtst \ gnome=gdkpixbuf2,gtk20,gtkmm24 X11_LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 LIBNOTIFY_LIB_DEPENDS= libnotify.so:devel/libnotify DNET_CONFIGURE_WITH= dnet DNET_LIB_DEPENDS= libdnet.so:net/libdnet OPENSSL_CONFIGURE_WITH= ssl WRKSRC_SUBDIR= open-vm-tools GNU_CONFIGURE= yes USES= autoreconf fuse gettext-runtime kmod libtool localbase pathfix pkgconfig USE_GNOME= glib20 USE_GITHUB= yes GH_ACCOUNT= vmware USE_LDCONFIG= yes CPPFLAGS+= -Wno-deprecated-declarations SSP_UNSAFE= kernel module does not support ssp CONFIGURE_ARGS+= --without-icu \ --disable-vgauth \ --sysconfdir=${PREFIX}/etc CONFLICTS+= vmware-guestd[0-9]* vmware-tools[0-9]* USE_RC_SUBR= vmware-guestd vmware-kmod INSTALL_TARGET= install-strip .include .if ${PORT_OPTIONS:MX11} CONFLICTS= open-vm-tools-nox11-[0-9]* .else CONFLICTS= open-vm-tools-[0-9]* .endif CONFIGURE_ENV+= SYSDIR=${SRC_BASE}/sys .include post-patch: @${REINPLACE_CMD} -e "s@%%PREFIX%%@${PREFIX}@"\ ${WRKSRC}/lib/guestApp/guestApp.c post-build: cd ${WRKSRC}/modules && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers ${MKDIR} ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/input ${INSTALL_DATA} ${WRKSRC}/modules/freebsd/vmblock.ko ${STAGEDIR}${PREFIX}/lib/vmware-tools/modules/drivers/vmblock.ko ${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 ${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/ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/rc.conf.d .include Index: head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c (nonexistent) +++ head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c (revision 464095) @@ -0,0 +1,45 @@ +--- lib/auth/authPosix.c.orig 2017-12-15 21:11:49 UTC ++++ lib/auth/authPosix.c +@@ -1,5 +1,5 @@ + /********************************************************* +- * Copyright (C) 2003-2017 VMware, Inc. All rights reserved. ++ * Copyright (C) 2003-2018 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 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include // for access, crypt, etc. + #if !defined USE_PAM && !defined __APPLE__ + #include +@@ -262,8 +263,8 @@ static struct pam_conv PAM_conversation = { + static AuthTokenInternal * + AuthAllocateToken(void) + { ++ long bufSize; + AuthTokenInternal *ati; +- size_t bufSize; + + /* + * We need to get the maximum size buffer needed by getpwuid_r from +@@ -271,9 +272,15 @@ AuthAllocateToken(void) + * by the Posix_Get*_r() wrappers. + */ + +- bufSize = (size_t) sysconf(_SC_GETPW_R_SIZE_MAX) * 4; ++ errno = 0; ++ bufSize = sysconf(_SC_GETPW_R_SIZE_MAX); ++ if ((errno != 0) || (bufSize <= 0)) { ++ bufSize = 16 * 1024; // Unlimited; pick something reasonable ++ } + +- ati = Util_SafeMalloc(sizeof *ati + bufSize); ++ bufSize *= 4; ++ ++ ati = Util_SafeMalloc(sizeof *ati + (size_t) bufSize); + ati->bufSize = bufSize; + + return ati; Property changes on: head/emulators/open-vm-tools/files/patch-lib_auth_authPosix.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property 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 Index: head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c =================================================================== --- head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c (nonexistent) +++ head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c (revision 464095) @@ -0,0 +1,21 @@ +--- lib/file/fileTempPosix.c.orig 2017-12-15 21:11:49 UTC ++++ lib/file/fileTempPosix.c +@@ -203,12 +203,17 @@ FileGetUserName(uid_t uid) // IN: + #if defined(__APPLE__) + memPoolSize = _PASSWORD_LEN; + #else ++ errno = 0; + memPoolSize = sysconf(_SC_GETPW_R_SIZE_MAX); + +- if (memPoolSize <= 0) { ++ if ((errno != 0) || (memPoolSize == 0)) { + Warning("%s: sysconf(_SC_GETPW_R_SIZE_MAX) failed.\n", __FUNCTION__); + + return NULL; ++ } ++ ++ if (memPoolSize == -1) { // Unlimited; pick something reasonable ++ memPoolSize = 16 * 1024; + } + #endif + Property changes on: head/emulators/open-vm-tools/files/patch-lib_file_fileTempPosix.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property 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 Index: head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c =================================================================== --- head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c (revision 464094) +++ head/emulators/open-vm-tools/files/patch-services_plugins_vix_vixTools.c (revision 464095) @@ -1,29 +1,29 @@ ---- services/plugins/vix/vixTools.c.orig 2017-12-15 21:11:49 UTC +--- services/plugins/vix/vixTools.c.orig 2018-02-24 17:50:37 UTC +++ services/plugins/vix/vixTools.c -@@ -52,6 +52,7 @@ - #include - #include - #include -+#include +@@ -10135,7 +10135,7 @@ abort: + struct passwd pwd; + struct passwd *ppwd = &pwd; + char *buffer = NULL; // a pool of memory for Posix_Getpwnam_r() to use. +- size_t bufferSize; ++ long bufferSize; - #ifdef _WIN32 - #include -@@ -7330,7 +7331,7 @@ VixToolsRunScript(VixCommandRequestHeader *requestMsg, - goto abort; - } - } -- for (var = 0; var <= 0xFFFFFFFF; var++) { -+ for (var = 0; ; var++) { - free(tempScriptFilePath); - tempScriptFilePath = Str_SafeAsprintf(NULL, - "%s"DIRSEPS"%s%d%s", -@@ -7372,6 +7373,9 @@ VixToolsRunScript(VixCommandRequestHeader *requestMsg, - * deletes it), we should not try 4+ billion times. - */ - break; -+ } -+ if (var == INT_MAX) { -+ break; - } - } - if (fd < 0) { + /* + * For POSIX systems, look up the uid of 'username', and compare +@@ -10148,9 +10148,15 @@ abort: + * Multiply by 4 to compensate for the conversion to UTF-8 by + * the Posix_Getpwnam_r() wrapper. + */ +- bufferSize = (size_t) sysconf(_SC_GETPW_R_SIZE_MAX) * 4; ++ errno = 0; ++ bufferSize = sysconf(_SC_GETPW_R_SIZE_MAX); ++ if ((errno != 0) || (bufferSize <= 0)) { ++ bufferSize = 16 * 1024; // Unlimited; pick something reasonable ++ } + +- buffer = Util_SafeMalloc(bufferSize); ++ bufferSize *= 4; ++ ++ buffer = Util_SafeMalloc((size_t)bufferSize); + + if (Posix_Getpwnam_r(username, &pwd, buffer, bufferSize, &ppwd) != 0 || + NULL == ppwd) {