From: Elliot Lee Date: Mon, 14 Apr 2008 22:55:51 +0000 (-0700) Subject: 2008.04.14-87812 refresh. X-Git-Tag: 2008.04.04-87182 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c52f3dbc9a90d320885cbee554e684e510bf8526;p=thirdparty%2Fopen-vm-tools.git 2008.04.14-87812 refresh. --- diff --git a/open-vm-tools/ChangeLog b/open-vm-tools/ChangeLog index 86f6c93ad..371b5a141 100755 --- a/open-vm-tools/ChangeLog +++ b/open-vm-tools/ChangeLog @@ -1,3 +1,311 @@ +2008-04-14 Elliot Lee + + * Resync with internal trunk (2008.04.01). + + * Fixed legal header on all LGPL-licensed files. + + * vmware-user/resolution.c: Normalize the display topology that + comes in from the host, and report 'global_offset' capability. + + * toolbox/Makefile.am, vmware-user/Makefile.am, + lib/misc/Makefile.am, lib/misc/atomic.c, lib/Makefile.am, + lib/atomic/*, hgfsclient/Makefile.am: Move libAtomic stuff into libmisc + + * vmware-user/foundryToolsDaemon.c, lib/vixTools/vixTools.c, + lib/include/hgfsServerInt.h, guestd/toolsDaemon.c, + guestd/foundryToolsDaemon.c: Remove WIN9XCOMPAT, and some + SOCKET_MGR code. + + * vmware-user/copyPaste.c: Copy/paste fixes for cross-platform + operation. + + * modules/linux/vmxnet/vmnet_def.h: Add SG_SPAN_PAGES capability. + + * modules/linux/vmxnet/vm_device_version.h: Update some device limits. + + * modules/linux/*/compat_sched.h: Add TASK_COMM_LEN define. + + * modules/linux/*/compat_kernel.h, + modules/linux/*/kernelStubsLinux.c: Add vsnprintf define. + + * modules/linux/*/x86cpuid.h: Add new CPUs. + + * modules/linux/vmhgfs/vmhgfs_version.h: Bump HGFS version. + + * modules/linux/*/vm_basic_asm_x86.h, + modules/linux/*/vm_basic_asm_x86_64.h, + lib/include/vm_basic_asm_x86.h, lib/include/vm_basic_asm_x86_64.h: + Formatting fixes, and change asm directives used. + + * modules/linux/vmhgfs/module.h, + modules/linux/vmhgfs/filesystem.c, + modules/linux/vmhgfs/bdhandler.c, + modules/linux/*/compat_kthread.h: compat_kthread fixes. + + * modules/freebsd/vmxnet/net_compat.h, + modules/freebsd/vmxnet/if_vxn.c: Updates for FreeBSD 7.0. + (Thanks to Martin Blapp for contributing to these changes.) + + * lib/misc/util_misc.c, lib/include/loglevel_user.h, + lib/user/hostinfoPosix.c, lib/misc/hostname.c: Bugfix. + + * lib/unityStub/unityStub.c, lib/include/unity.h: Add stub and enums + related to DnD support. + + * lib/unicode/unicodeSimpleTypes.c, + lib/unicode/unicodeSimpleTransforms.c, + lib/unicode/unicodeSimpleBase.c, lib/unicode/unicodeCommon.c, + lib/include/unicodeTypes.h, + lib/include/unicodeTransforms.h, + lib/include/unicodeBase.h, lib/include/unicodeCommon.h: Add + additional Unicode-related functions. + + * lib/sync/syncMutex.c, lib/include/syncMutex.h: Add TryLock method. + + * lib/strUtil/strutil.c: Add int64-related functions. + + * lib/string/str.c: Compile fix + + * lib/string/bsd_output_shared.c: Better handling of floating + point on Windows. + + * lib/include/progMgr.h, lib/procMgr/procMgrPosix.c: Clarify that + the strings are in UTF-8, do conversion as needed. + + * lib/include/posix.h, lib/misc/posixPosix.c, + lib/misc/posixWin32.c, lib/file/filePosix.c: Add new Posix_ + function implementations, and unicodify existing ones. + + * lib/misc/hashTable.c, lib/include/hashTable.h: Add lock-less hash + table functions. + + * lib/misc/util_misc.c, lib/include/w32util.h: Add a couple of + Win32 utility functions. + + * lib/include/vm_version.h: Add WS5 config version. + + * lib/include/vm_atomic.h: Add typecasts to atomic operations to + make compilers stop complaining, and expand the AtomicUseFence option. + + * lib/include/vm_app.h: Add a couple of HGFS-related options. + + * lib/include/vix.h: Update a few errors and other macros. + + * lib/include/vixCommands.h, lib/foundry/foundryMsg.c: Change a + bunch of structure members from int32 to uint32, and add a parsing + function. + + * lib/include/msgfmt.h, lib/include/msg.h: Additional + message-handling prototypes. + + * lib/include/guestInfoInt.h, lib/include/guestInfo.h, + lib/guestInfo/Makefile.am, lib/guestInfo/guestInfoServer.c, + lib/guestInfo/guestInfoPosix.c, + lib/guestInfo/guestInfoPerfMonLinux.c: Add IPv6 support, and the + ability to read mem stats on Linux. + + * lib/include/fileIO.h, lib/file/fileIOPosix.c: Add MacOS function + related to Time Machine. + + * lib/guestApp/guestApp.c: Use Posix_ variants of functions. + + * lib/ghIntegrationStub/ghIntegrationStub.c: Add GHI capabilities + stubs. + + * lib/dnd/dndCommon.c, lib/file/file.c: Use new Unicode_Format() + function, bugfix. + + * guestd/main.c: Fix a security bug. + + * configure.ac: Allow calling libdnet 'dumbnet' for Debian + systems. Detect libprocps. + +2008-03-19 Adar Dembo + * Resync with internal trunk (2008.03.13). + + * vm_version.h: Updated Tools version. + + * configure.ac: Added dynamic dnet detection and --without-dnet flag. + + * guestd/debugStdio.c, lib/include/system.h, lib/system/systemLinux.c: + Modified debugging to file behavior to prepend debug strings with human + readable timestamps. + + * guestd/main.c, guestd/toolsDaemon.c, lib/conf/conf.c, + lib/guestApp/guestApp.c, lib/include/guestApp.h: Internationalized + GuestApp_GetInstallPath and GuestApp_GetconfPath. + + * lib/auth/authPosix.c, lib/dnd/dndLinux.c, lib/file/*, + lib/impersonate/impersonatePosix.c, lib/include/fileInt.h, + lib/include/posix.h, lib/misc/posix*.c: Refactored, extended, and made + use of the set of POSIX internationalization-safe function wrappers. + + * lib/dnd/dndCommon.c, lib/include/dnd.h, lib/include/dndInt.h, + vmware-user/copyPaste.c, vmware-user/dnd.c: Replaced some duplicated + UTF-8 formatting code with calls to lib/unicode. + + * lib/guestInfo/guestInfoPosix.c: Replaced the old syscall-based + implementation of nicinfo with a simpler implementation that uses dnet. + + * lib/guestInfo/guestInfoServer.c, lib/include/guestInfo.h, + lib/include/guestInfoInt.h: Added Win32 implementation of + meminfo. POSIX implementation to follow. + + * lib/hgfsServer/hgfsServerLinux.c: Replaced a direct readlink(3) call + with a call to the POSIX wrapper for readlink(3). Relax an overeager + ASSERT in symlink checking when using the special empty share. + + * lib/include/codeset.h, lib/string/bsd_vsnprintf.c, lib/string/str.c, + lib/unicode/unicodeSimpleOperations.c, lib/unicode/unicodeSimpleUTF16.h: + Refactored ICU routines from unicodeSimpleUtf16.h to codeset.h, which + is now licensed under the ICU license (BSD variant). + + * lib/include/file.h, lib/file/file.c: Added function File_StripSlashes. + + * lib/include/hgfsProto.h: Removed an A acute from a comment to allow + the file to be built on Windows systems where the default language isn't + English. + + * lib/include/hostinfo.h, lib/include/util.h, lib/user/hostinfoPosix.c, + lib/user/util.c, lib/user/utilPosix.c: More conversions to + lib/unicode. Added Util_ZeroFreeStringW function for Windows in util.h. + + * lib/include/msg.h: Removed obsolete NO_MSGFMT macro. + + * lib/include/unicodeBase.h, lib/unicode/unicodeCommon.c, + lib/unicode/unicodeSimpleBase.c: Added some more encoding functions. + + * lib/include/vixCommands.h, lib/include/vixOpenSource.h: Added another + user credential type, some command flags, some command layouts, some + error codes, some properties, and tweaked existing commands. + + * lib/include/vixTools.h: Added VixToolsUserIsMemberOfAdministratorGroup + function. + + * lib/include/vm_assert.h, lib/include/vm_basic_defs.h: Move IMPLIES to + vm_basic_defs.h. Removed some vprobes definitions. + + * lib/include/vmBackup.h, lib/vmBackupLib/scriptOps.c, + lib/vmBackupLib/stateMachine.c: Added infrastructure to disable + quiescing targets from a config file. + + * lib/include/vm_basic_asm.h: Changed __GET_CPUID2 handling for Windows. + + * lib/include/vm_produt.h: Added VDM product. + + * lib/include/vm_tools_version.h: Bumped internal Tools version. + + * lib/include/win32util.h, lib/misc/hostname.c, lib/misc/util_misc: + Refactored functions to separate set of Win32 wrappers (next to the + POSIX wrappers mentioned earlier). + + * lib/misc/codeset.c: Made CodeSetGetCurrentCodeSet non-static. + + * lib/misc/*/Makefile.am: Added POSIX wrappers to build system. + + * lib/strUtil/strutil.c: Fixed bug in StrUtil_EndsWith function. + + * lib/include/unicodeTypes.h, lib/unicode/unicodeSimpleTypes.c: Removed + ISO-8859-11 encoding. Added cross-reference of IANA character set + names, windows code pages, and ICU encodings. + + * lib/vixTools/vixTools.c: Impersonation tweaks. + + * modules/*/*/*: Reflect header file changes from elsewhere in the + source code tree. + +2008-03-11 Adar Dembo + * vm_version.h: Updated Tools version. + + * modules/vmblock/linux/*: Make vmblock build under 2.6.25-rc2. + The dentry and mount objects have been moved out of struct + nameidata and into the new struct path. Also, path_release() is + now path_put(). + + * modules/vmsync/linux/*: Make vmsync build under 2.6.25-rc2. + The same changes were needed here as in vmblock above. + +2008-03-10 Adar Dembo + * vm_version.h: Updated Tools version. + + * modules/vmhgfs/linux/*: Make vmhgfs build under 2.6.25-rc1. + The iget() function has been removed and filesystems are now + expected to implement it themselves using iget_locked(). + +2008-02-27 Elliot Lee + + * configure.ac, guestd/Makefile.am, toolbox/Makefile.am, + vmware-user/Makefile.am: Allow passing custom LDFLAGS in to + build process (patch by Mike Auty). + + * Resync with internal trunk (2008.02.27). + + * guestd/foundryToolsDaemon.c, lib/vixTools/vixTools.c, + vmware-user/foundryToolsDaemon.c: Win9x compat changes. + + * guestd/toolsDaemon.c: Style fixes. + + * hgfsmounter/hgfsmounter.c: Bug fixes. + + * lib/dnd/dndLinux.c, lib/dnd/dndCommon.c: Move some code to the + platform-independant file, some DnDv3 support. + + * lib/include/dnd.h, lib/include/dndInt.h: DnDv3 support. + + * lib/file/file.c, lib/file/fileIO.c, lib/file/fileIOPosix.c, + lib/file/fileLockPrimitive.c, lib/file/filePosix.c, + lib/include/file_extensions.h, lib/include/fileInt.h, + lib/include/fileIO.h: Move functions around, Unicode fixes, misc + fixes. + + * lib/foundryMsg/foundryPropertyListCommon.c: Error handling fixes. + + * lib/hgfsServer/*.c, lib/include/hgfs*.h, + modules/freebsd/vmhgfs/*, modules/linux/vmhgfs/*: HGFS v3 support, + updates to improve code re-use between the FreeBSD and MacOS X + ports, and updates to make the Linux port build on 2.6.25-rc1 (but + not rc2, yet). + + * lib/include/auth.h, lib/include/codeset.h, + lib/include/hostinfo.h, lib/include/str.h, lib/include/unicode*.h, + lib/include/vm_basic_types.h, lib/misc/hostname.c, + lib/unicode/*.c, lib/user/hostinfoPosix.c: Unicode fixes. + + * lib/include/backdoor_def.h: Add a new command for use by the + BIOS in checking the GuestOS against Darwin. + + * lib/include/dynarray.h, lib/misc/dynarray.c, + lib/misc/Makefile.am, lib/misc/shared/Makefile.am: Add Dynarray + implementation. + + * lib/include/bsdfmt.h, lib/include/bsd_output_int.h, + lib/string/bsd_output_shared.c, lib/string/bs_vsnprintf.c, + lib/string/bsd_vsnwprintf.c, lib/string/str.c: Rework built-in + printf implementation, esp. for Unicode fixes. + + * lib/include/ghIntegration.h: Shuffle types around. + + * lib/include/loglevel_user.h, lib/include/unity.h, + lib/syncDriver/syncDriverPosix.c, lib/user/util.c, + toolbox/toolbox-gtk.c: Misc fixes. + + * lib/include/vmBackup.h, lib/vmBackupLib/scriptOps.c, + lib/vmBackupLib/stateMachine.c, lib/vmBackupLib/vmBackupInt.h: + Rework scripts for freeze & thaw operations. + + * lib/include/vm_product.h, lib/include/vm_version.h: Add new + product defs (VMRC). + + * lib/include/vm_tools_version.h: Add ESX 3.5U1 product. + + * lib/include/vixCommands.h, lib/include/vix.h: Add new VIX + commands and error code. + + * lib/include/win32util.h: Add misc Win32 utilities. + + * modules/*/*/*: Reflect header file changes from elsewhere in the + source code tree. + 2008-02-13 Adar Dembo * Resync with internal trunk (2008.02.12). @@ -5,7 +313,7 @@ lib/Makefile.am, vmware-user/Makefile.am, vmware-user/vmware-user.c: Added lib/unityStub and lib/ghIntegrationStub. Unity and guest-host integration features for X11 guests are on the way. - + * configure.ac, guestd/Makefile.am, lib/fileUtf8/*, lib/vixTools/vixTools.c, vmare-user/Makefile.am: lib/file is now fully internationalized. Removed unneeded lib/fileUtf8. @@ -81,7 +389,7 @@ * lib/include/vm_atomic.h: Comment cleanup and added VMKERNEL-specific calls for fencing. - + * lib/include/vm_basic_asm_x86_64.h: Added inline routines to save and restore ES1. @@ -152,7 +460,7 @@ * configure.ac, guestd/Makefile.am, hgfsclient/Makefile.am, lib/Makefile.am, toolbox/Makefile.am, vmware-user/Makefile.am: integrated lib/unicode for internationalizing strings. - + * guestd/main.c: Stopped using pgrep for finding existing instances of guestd. Removed ancient bandwidth test code. @@ -210,7 +518,7 @@ * lib/include/hash.h, lib/misc/hash.c, lib/misc/Makefile.am, lib/misc/shared/Makefile.am: Added basic hash table implementation. - + * lib/include/hostinfo.h, lib/user/hostinfoPosix.c: Refactored and added several timekeeping functions. @@ -311,7 +619,7 @@ * modules/linux/vmblock/linux/filesystem.c, modules/linux/vmblock/Makefile.kernel: Added check for newer kernels where the slab allocator's constructor function expects three - arguments. + arguments. Makes it work with 2.6.25-rc1 (but not rc2, yet). * modules/linux/vmblock/linux/vmblock_version.h: Bumped module version. @@ -327,7 +635,7 @@ 2007-11-15 Elliot Lee * Bandsaw release (2007.11.15). - + * configure.ac: Handle building modules for multiple OS's. Improve X detection to allow building --without-x. Improve Gtk+ detection. Detect libdnet on Solaris. Detect which -Wwarning flags diff --git a/open-vm-tools/FILES b/open-vm-tools/FILES index 8e90c20e7..24ab8618c 100644 --- a/open-vm-tools/FILES +++ b/open-vm-tools/FILES @@ -1,1199 +1,1197 @@ -open-vm-tools-2008.02.13-77928: -total 1644 --rw-r--r-- 1 mts mts 262309 2008-02-20 18:18 aclocal.m4 --rwxr-xr-x 1 mts mts 33 2008-02-20 18:18 AUTHORS -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autom4te.cache --rwxr-xr-x 1 mts mts 21027 2008-02-20 18:18 ChangeLog -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 checkvm --r-xr-xr-x 1 mts mts 43668 2007-08-16 17:29 config.guess --r-xr-xr-x 1 mts mts 32151 2007-08-16 17:29 config.sub --rwxr-xr-x 1 mts mts 895870 2008-02-20 18:18 configure --rwxr-xr-x 1 mts mts 19801 2008-02-20 18:18 configure.ac --rwxr-xr-x 1 mts mts 26425 2008-02-20 18:18 COPYING --r-xr-xr-x 1 mts mts 17574 2008-02-20 18:18 depcomp -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 guestd -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfsclient -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfsmounter --r--r--r-- 1 mts mts 9416 2008-02-20 18:18 INSTALL --r-xr-xr-x 1 mts mts 13184 2008-02-20 18:18 install-sh -drwxr-xr-x 49 mts mts 4096 2008-02-20 18:18 lib -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 libguestlib --r--r--r-- 1 mts mts 198422 2007-08-16 17:29 ltmain.sh --rwxr-xr-x 1 mts mts 1361 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 20946 2008-02-20 18:18 Makefile.in --r-xr-xr-x 1 mts mts 11135 2008-02-20 18:18 missing -drwxr-xr-x 4 mts mts 4096 2008-02-20 18:18 modules --rwxr-xr-x 1 mts mts 742 2008-02-20 18:18 NEWS --rwxr-xr-x 1 mts mts 6311 2008-02-20 18:18 README -drwxr-xr-x 6 mts mts 4096 2008-02-20 18:18 scripts -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 toolbox -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmware-user -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 xferlogs - -open-vm-tools-2008.02.13-77928/autom4te.cache: -total 2280 --rw-r--r-- 1 mts mts 898004 2008-02-20 18:18 output.0 --rw-r--r-- 1 mts mts 897434 2008-02-20 18:18 output.1 --rw-r--r-- 1 mts mts 10783 2008-02-20 18:18 requests --rw-r--r-- 1 mts mts 439206 2008-02-20 18:18 traces.0 --rw-r--r-- 1 mts mts 58260 2008-02-20 18:18 traces.1 - -open-vm-tools-2008.02.13-77928/checkvm: +open-vm-tools-2008.04.14-87182: +total 1668 +-rwxr-xr-x 1 mts mts 33 Apr 14 13:03 AUTHORS +-rwxr-xr-x 1 mts mts 26425 Apr 14 13:03 COPYING +-rwxr-xr-x 1 mts mts 32371 Apr 14 13:03 ChangeLog +-r--r--r-- 1 mts mts 9416 Apr 14 13:03 INSTALL +-rwxr-xr-x 1 mts mts 1361 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 20998 Apr 14 13:03 Makefile.in +-rwxr-xr-x 1 mts mts 1293 Apr 14 13:03 NEWS +-rwxr-xr-x 1 mts mts 6311 Apr 14 13:03 README +-rw-r--r-- 1 mts mts 262309 Apr 14 13:03 aclocal.m4 +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autom4te.cache +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 checkvm +-r-xr-xr-x 1 mts mts 43668 Apr 28 2007 config.guess +-r-xr-xr-x 1 mts mts 32151 Apr 28 2007 config.sub +-rwxr-xr-x 1 mts mts 905644 Apr 14 13:03 configure +-rwxr-xr-x 1 mts mts 22293 Apr 14 13:03 configure.ac +-r-xr-xr-x 1 mts mts 17574 Apr 14 13:03 depcomp +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 guestd +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfsclient +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfsmounter +-r-xr-xr-x 1 mts mts 13184 Apr 14 13:03 install-sh +drwxr-xr-x 48 mts mts 4096 Apr 14 13:03 lib +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 libguestlib +-r--r--r-- 1 mts mts 198422 Apr 28 2007 ltmain.sh +-r-xr-xr-x 1 mts mts 11135 Apr 14 13:03 missing +drwxr-xr-x 4 mts mts 4096 Apr 14 13:03 modules +drwxr-xr-x 6 mts mts 4096 Apr 14 13:03 scripts +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 toolbox +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmware-user +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 xferlogs + +open-vm-tools-2008.04.14-87182/autom4te.cache: +total 2296 +-rw-r--r-- 1 mts mts 907832 Apr 14 13:03 output.0 +-rw-r--r-- 1 mts mts 907262 Apr 14 13:03 output.1 +-rw-r--r-- 1 mts mts 10783 Apr 14 13:03 requests +-rw-r--r-- 1 mts mts 439522 Apr 14 13:03 traces.0 +-rw-r--r-- 1 mts mts 58923 Apr 14 13:03 traces.1 + +open-vm-tools-2008.04.14-87182/checkvm: total 60 --r--r--r-- 1 mts mts 7093 2008-02-20 18:18 checkvm.c --r--r--r-- 1 mts mts 1530 2008-02-20 18:18 checkvm_version.h --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 1001 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14502 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1001 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14554 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 7107 Apr 14 13:03 checkvm.c +-r--r--r-- 1 mts mts 1544 Apr 14 13:03 checkvm_version.h -open-vm-tools-2008.02.13-77928/guestd: +open-vm-tools-2008.04.14-87182/guestd: total 352 --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 5793 2008-02-20 18:18 debugStdio.c --r--r--r-- 1 mts mts 37352 2008-02-20 18:18 foreignVMToolsDaemon.c --r--r--r-- 1 mts mts 6196 2008-02-20 18:18 foreignVMToolsDaemon.h --r--r--r-- 1 mts mts 37041 2008-02-20 18:18 foreignVMToolsNetworking.c --r--r--r-- 1 mts mts 55393 2008-02-20 18:18 foundryToolsDaemon.c --r--r--r-- 1 mts mts 1752 2008-02-20 18:18 foundryToolsDaemon.h --r--r--r-- 1 mts mts 1507 2008-02-20 18:18 guestd_version.h --r--r--r-- 1 mts mts 60504 2008-02-20 18:18 main.c --r--r--r-- 1 mts mts 3533 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18460 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 4717 2008-02-20 18:18 stub.c --r--r--r-- 1 mts mts 54814 2008-02-20 18:18 toolsDaemon.c --r--r--r-- 1 mts mts 4035 2008-02-20 18:18 toolsDaemon.h - -open-vm-tools-2008.02.13-77928/hgfsclient: +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3469 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18278 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 6258 Apr 14 13:03 debugStdio.c +-r--r--r-- 1 mts mts 37366 Apr 14 13:03 foreignVMToolsDaemon.c +-r--r--r-- 1 mts mts 6210 Apr 14 13:03 foreignVMToolsDaemon.h +-r--r--r-- 1 mts mts 37055 Apr 14 13:03 foreignVMToolsNetworking.c +-r--r--r-- 1 mts mts 54646 Apr 14 13:03 foundryToolsDaemon.c +-r--r--r-- 1 mts mts 1766 Apr 14 13:03 foundryToolsDaemon.h +-r--r--r-- 1 mts mts 1521 Apr 14 13:03 guestd_version.h +-r--r--r-- 1 mts mts 61201 Apr 14 13:03 main.c +-r--r--r-- 1 mts mts 4731 Apr 14 13:03 stub.c +-r--r--r-- 1 mts mts 54186 Apr 14 13:03 toolsDaemon.c +-r--r--r-- 1 mts mts 4049 Apr 14 13:03 toolsDaemon.h + +open-vm-tools-2008.04.14-87182/hgfsclient: total 76 --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 16742 2008-02-20 18:18 hgfsclient.c --r--r--r-- 1 mts mts 1562 2008-02-20 18:18 hgfsclient_version.h --r--r--r-- 1 mts mts 2197 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15981 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 2384 2008-02-20 18:18 stub.c - -open-vm-tools-2008.02.13-77928/hgfsmounter: +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 2151 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15981 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 16756 Apr 14 13:03 hgfsclient.c +-r--r--r-- 1 mts mts 1576 Apr 14 13:03 hgfsclient_version.h +-r--r--r-- 1 mts mts 2398 Apr 14 13:03 stub.c + +open-vm-tools-2008.04.14-87182/hgfsmounter: total 88 --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 29733 2008-02-20 18:18 hgfsmounter.c --r--r--r-- 1 mts mts 1564 2008-02-20 18:18 hgfsmounter_version.h --r--r--r-- 1 mts mts 1164 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14804 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 2099 2008-02-20 18:18 stub.c - -open-vm-tools-2008.02.13-77928/lib: -total 236 -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 atomic -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 auth -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 backdoor -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 conf --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 deployPkg -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 dict -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 dnd -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 err -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 eventManager -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 file -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 foundryMsg -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 ghIntegrationStub -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 guestApp -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 guestInfo -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfs -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfsBd -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfsServer -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfsServerManagerGuest -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 hgfsServerPolicyGuest -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 impersonate -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 include --r--r--r-- 1 mts mts 1811 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 16284 2008-02-20 18:18 Makefile.in -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 message -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 misc -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 netUtil -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 panic -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 panicDefault -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 printer -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 procMgr -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 rpcIn -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 rpcOut -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 rpcVmx -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 SLPv2Parser -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 socketMgr -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 string -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 strUtil -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 sync -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 syncDriver -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 system -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 toolsLogger -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 unicode -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 unityStub -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 user -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vixTools -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmBackupLib -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmCheck -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmSignal -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 wiper - -open-vm-tools-2008.02.13-77928/lib/atomic: -total 32 --r--r--r-- 1 mts mts 1020 2008-02-20 18:18 atomic.c --r--r--r-- 1 mts mts 1042 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18528 2008-02-20 18:18 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared - -open-vm-tools-2008.02.13-77928/lib/atomic/shared: -total 20 --r--r--r-- 1 mts mts 1020 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15550 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1164 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14856 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 29755 Apr 14 13:03 hgfsmounter.c +-r--r--r-- 1 mts mts 1578 Apr 14 13:03 hgfsmounter_version.h +-r--r--r-- 1 mts mts 2113 Apr 14 13:03 stub.c + +open-vm-tools-2008.04.14-87182/lib: +total 232 +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1793 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 16329 Apr 14 13:03 Makefile.in +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 SLPv2Parser +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 auth +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 backdoor +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 conf +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 deployPkg +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 dict +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 dnd +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 err +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 eventManager +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 file +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 foundryMsg +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 ghIntegrationStub +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 guestApp +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 guestInfo +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfs +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfsBd +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfsServer +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfsServerManagerGuest +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 hgfsServerPolicyGuest +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 impersonate +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 include +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 message +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 misc +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 netUtil +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 panic +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 panicDefault +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 printer +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 procMgr +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 rpcIn +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 rpcOut +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 rpcVmx +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 socketMgr +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 strUtil +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 string +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 sync +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 syncDriver +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 system +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 toolsLogger +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 unicode +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 unityStub +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 user +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vixTools +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmBackupLib +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmCheck +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmSignal +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 wiper + +open-vm-tools-2008.04.14-87182/lib/SLPv2Parser: +total 68 +-r--r--r-- 1 mts mts 1125 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14952 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 7514 Apr 14 13:03 SLPv2Match.c +-r--r--r-- 1 mts mts 18294 Apr 14 13:03 SLPv2MsgAssembler.c +-r--r--r-- 1 mts mts 16818 Apr 14 13:03 SLPv2MsgParser.c -open-vm-tools-2008.02.13-77928/lib/auth: +open-vm-tools-2008.04.14-87182/lib/auth: total 32 --r--r--r-- 1 mts mts 8560 2008-02-20 18:18 authPosix.c --r--r--r-- 1 mts mts 1041 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14513 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1041 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14565 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8605 Apr 14 13:03 authPosix.c -open-vm-tools-2008.02.13-77928/lib/backdoor: +open-vm-tools-2008.04.14-87182/lib/backdoor: total 52 --r--r--r-- 1 mts mts 6393 2008-02-20 18:18 backdoor.c --r--r--r-- 1 mts mts 6184 2008-02-20 18:18 backdoorGcc32.c --r--r--r-- 1 mts mts 5560 2008-02-20 18:18 backdoorGcc64.c --r--r--r-- 1 mts mts 1177 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 19226 2008-02-20 18:18 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared - -open-vm-tools-2008.02.13-77928/lib/backdoor/shared: +-r--r--r-- 1 mts mts 1177 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 19278 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 6407 Apr 14 13:03 backdoor.c +-r--r--r-- 1 mts mts 6198 Apr 14 13:03 backdoorGcc32.c +-r--r--r-- 1 mts mts 5574 Apr 14 13:03 backdoorGcc64.c +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 shared + +open-vm-tools-2008.04.14-87182/lib/backdoor/shared: total 24 --r--r--r-- 1 mts mts 1164 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18103 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1164 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18155 Apr 14 13:03 Makefile.in -open-vm-tools-2008.02.13-77928/lib/conf: +open-vm-tools-2008.04.14-87182/lib/conf: total 28 --r--r--r-- 1 mts mts 5019 2008-02-20 18:18 conf.c --r--r--r-- 1 mts mts 1005 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14480 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1005 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14532 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 5057 Apr 14 13:03 conf.c -open-vm-tools-2008.02.13-77928/lib/deployPkg: +open-vm-tools-2008.04.14-87182/lib/deployPkg: total 40 --r--r--r-- 1 mts mts 8560 2008-02-20 18:18 deployPkg.c --r--r--r-- 1 mts mts 3232 2008-02-20 18:18 deployPkgLog.c --r--r--r-- 1 mts mts 1112 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14849 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 3591 2008-02-20 18:18 runDeployPkgPosix.c +-r--r--r-- 1 mts mts 1112 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14901 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8574 Apr 14 13:03 deployPkg.c +-r--r--r-- 1 mts mts 3246 Apr 14 13:03 deployPkgLog.c +-r--r--r-- 1 mts mts 3605 Apr 14 13:03 runDeployPkgPosix.c -open-vm-tools-2008.02.13-77928/lib/dict: +open-vm-tools-2008.04.14-87182/lib/dict: total 36 --r--r--r-- 1 mts mts 14687 2008-02-20 18:18 dictll.c --r--r--r-- 1 mts mts 1008 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14486 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1008 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14538 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 14701 Apr 14 13:03 dictll.c -open-vm-tools-2008.02.13-77928/lib/dnd: -total 56 --r--r--r-- 1 mts mts 17773 2008-02-20 18:18 dndCommon.c --r--r--r-- 1 mts mts 16359 2008-02-20 18:18 dndLinux.c --r--r--r-- 1 mts mts 1038 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14576 2008-02-20 18:18 Makefile.in +open-vm-tools-2008.04.14-87182/lib/dnd: +total 64 +-r--r--r-- 1 mts mts 1038 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14628 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 27742 Apr 14 13:03 dndCommon.c +-r--r--r-- 1 mts mts 15018 Apr 14 13:03 dndLinux.c -open-vm-tools-2008.02.13-77928/lib/err: +open-vm-tools-2008.04.14-87182/lib/err: total 28 --r--r--r-- 1 mts mts 1451 2008-02-20 18:18 err.c --r--r--r-- 1 mts mts 1510 2008-02-20 18:18 errPosix.c --r--r--r-- 1 mts mts 1033 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14558 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1033 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14610 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 1465 Apr 14 13:03 err.c +-r--r--r-- 1 mts mts 1524 Apr 14 13:03 errPosix.c -open-vm-tools-2008.02.13-77928/lib/eventManager: +open-vm-tools-2008.04.14-87182/lib/eventManager: total 28 --r--r--r-- 1 mts mts 7069 2008-02-20 18:18 eventManager.c --r--r--r-- 1 mts mts 1037 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14672 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/file: -total 288 --r--r--r-- 1 mts mts 48559 2008-02-20 18:18 file.c --r--r--r-- 1 mts mts 13049 2008-02-20 18:18 fileIO.c --r--r--r-- 1 mts mts 57846 2008-02-20 18:18 fileIOPosix.c --r--r--r-- 1 mts mts 26848 2008-02-20 18:18 fileLockPosix.c --r--r--r-- 1 mts mts 42707 2008-02-20 18:18 fileLockPrimitive.c --r--r--r-- 1 mts mts 61789 2008-02-20 18:18 filePosix.c --r--r--r-- 1 mts mts 1213 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15065 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/foundryMsg: -total 104 --r--r--r-- 1 mts mts 22385 2008-02-20 18:18 foundryMsg.c --r--r--r-- 1 mts mts 41064 2008-02-20 18:18 foundryPropertyListCommon.c --r--r--r-- 1 mts mts 6828 2008-02-20 18:18 foundryThreads.c --r--r--r-- 1 mts mts 1183 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15059 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 7402 2008-02-20 18:18 vixTranslateErrOpenSource.c - -open-vm-tools-2008.02.13-77928/lib/ghIntegrationStub: +-r--r--r-- 1 mts mts 1037 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14724 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 7083 Apr 14 13:03 eventManager.c + +open-vm-tools-2008.04.14-87182/lib/file: +total 292 +-r--r--r-- 1 mts mts 1213 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15117 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 49677 Apr 14 13:03 file.c +-r--r--r-- 1 mts mts 13064 Apr 14 13:03 fileIO.c +-r--r--r-- 1 mts mts 55082 Apr 14 13:03 fileIOPosix.c +-r--r--r-- 1 mts mts 26927 Apr 14 13:03 fileLockPosix.c +-r--r--r-- 1 mts mts 42496 Apr 14 13:03 fileLockPrimitive.c +-r--r--r-- 1 mts mts 62027 Apr 14 13:03 filePosix.c + +open-vm-tools-2008.04.14-87182/lib/foundryMsg: +total 108 +-r--r--r-- 1 mts mts 1183 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15111 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 24798 Apr 14 13:03 foundryMsg.c +-r--r--r-- 1 mts mts 42795 Apr 14 13:03 foundryPropertyListCommon.c +-r--r--r-- 1 mts mts 6842 Apr 14 13:03 foundryThreads.c +-r--r--r-- 1 mts mts 7416 Apr 14 13:03 vixTranslateErrOpenSource.c + +open-vm-tools-2008.04.14-87182/lib/ghIntegrationStub: total 24 --r--r--r-- 1 mts mts 1147 2008-02-20 18:18 ghIntegrationStub.c --r--r--r-- 1 mts mts 1088 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14810 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/guestApp: -total 72 --r--r--r-- 1 mts mts 43988 2008-02-20 18:18 guestApp.c --r--r--r-- 1 mts mts 5706 2008-02-20 18:18 guestAppPosix.c --r--r--r-- 1 mts mts 1062 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14693 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/guestInfo: -total 100 --r--r--r-- 1 mts mts 30348 2008-02-20 18:18 guestInfoPosix.c --r--r--r-- 1 mts mts 47973 2008-02-20 18:18 guestInfoServer.c --r--r--r-- 1 mts mts 1102 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14756 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1088 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14862 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 1228 Apr 14 13:03 ghIntegrationStub.c -open-vm-tools-2008.02.13-77928/lib/hgfs: +open-vm-tools-2008.04.14-87182/lib/guestApp: +total 76 +-r--r--r-- 1 mts mts 1062 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14745 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 45993 Apr 14 13:03 guestApp.c +-r--r--r-- 1 mts mts 5720 Apr 14 13:03 guestAppPosix.c + +open-vm-tools-2008.04.14-87182/lib/guestInfo: +total 112 +-r--r--r-- 1 mts mts 1181 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14969 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 6480 Apr 14 13:03 guestInfoPerfMonLinux.c +-r--r--r-- 1 mts mts 25690 Apr 14 13:03 guestInfoPosix.c +-r--r--r-- 1 mts mts 50325 Apr 14 13:03 guestInfoServer.c + +open-vm-tools-2008.04.14-87182/lib/hgfs: total 88 --r--r--r-- 1 mts mts 12055 2008-02-20 18:18 cpName.c --r--r--r-- 1 mts mts 5773 2008-02-20 18:18 cpNameLinux.c --r--r--r-- 1 mts mts 2652 2008-02-20 18:18 cpNameLite.c --r--r--r-- 1 mts mts 9101 2008-02-20 18:18 cpNameUtil.c --r--r--r-- 1 mts mts 1463 2008-02-20 18:18 cpNameUtilInt.h --r--r--r-- 1 mts mts 5599 2008-02-20 18:18 cpNameUtilLinux.c --r--r--r-- 1 mts mts 6832 2008-02-20 18:18 hgfsUtil.c --r--r--r-- 1 mts mts 1217 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15164 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 8833 2008-02-20 18:18 staticEscape.c - -open-vm-tools-2008.02.13-77928/lib/hgfsBd: +-r--r--r-- 1 mts mts 1217 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15216 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 12069 Apr 14 13:03 cpName.c +-r--r--r-- 1 mts mts 5787 Apr 14 13:03 cpNameLinux.c +-r--r--r-- 1 mts mts 2666 Apr 14 13:03 cpNameLite.c +-r--r--r-- 1 mts mts 9115 Apr 14 13:03 cpNameUtil.c +-r--r--r-- 1 mts mts 1477 Apr 14 13:03 cpNameUtilInt.h +-r--r--r-- 1 mts mts 5613 Apr 14 13:03 cpNameUtilLinux.c +-r--r--r-- 1 mts mts 6846 Apr 14 13:03 hgfsUtil.c +-r--r--r-- 1 mts mts 8847 Apr 14 13:03 staticEscape.c + +open-vm-tools-2008.04.14-87182/lib/hgfsBd: total 32 --r--r--r-- 1 mts mts 8699 2008-02-20 18:18 hgfsBd.c --r--r--r-- 1 mts mts 1013 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14528 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/hgfsServer: -total 296 --r--r--r-- 1 mts mts 140841 2008-02-20 18:18 hgfsServer.c --r--r--r-- 1 mts mts 127882 2008-02-20 18:18 hgfsServerLinux.c --r--r--r-- 1 mts mts 1112 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14775 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/hgfsServerManagerGuest: +-r--r--r-- 1 mts mts 1013 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14580 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8713 Apr 14 13:03 hgfsBd.c + +open-vm-tools-2008.04.14-87182/lib/hgfsServer: +total 324 +-r--r--r-- 1 mts mts 1112 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14827 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 158165 Apr 14 13:03 hgfsServer.c +-r--r--r-- 1 mts mts 140786 Apr 14 13:03 hgfsServerLinux.c + +open-vm-tools-2008.04.14-87182/lib/hgfsServerManagerGuest: total 28 --r--r--r-- 1 mts mts 6621 2008-02-20 18:18 hgfsServerManagerGuest.c --r--r--r-- 1 mts mts 1077 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14920 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1077 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14972 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 6635 Apr 14 13:03 hgfsServerManagerGuest.c -open-vm-tools-2008.02.13-77928/lib/hgfsServerPolicyGuest: +open-vm-tools-2008.04.14-87182/lib/hgfsServerPolicyGuest: total 36 --r--r--r-- 1 mts mts 13836 2008-02-20 18:18 hgfsServerPolicyGuest.c --r--r--r-- 1 mts mts 1073 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14896 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1073 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14948 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 13984 Apr 14 13:03 hgfsServerPolicyGuest.c -open-vm-tools-2008.02.13-77928/lib/impersonate: +open-vm-tools-2008.04.14-87182/lib/impersonate: total 40 --r--r--r-- 1 mts mts 8174 2008-02-20 18:18 impersonate.c --r--r--r-- 1 mts mts 11863 2008-02-20 18:18 impersonatePosix.c --r--r--r-- 1 mts mts 1118 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14802 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/include: -total 1164 --r--r--r-- 1 mts mts 2190 2008-02-20 18:18 auth.h --r--r--r-- 1 mts mts 5807 2008-02-20 18:18 backdoor_def.h --r--r--r-- 1 mts mts 1347 2008-02-20 18:18 backdoor.h --r--r--r-- 1 mts mts 1042 2008-02-20 18:18 backdoorInt.h --r--r--r-- 1 mts mts 3553 2008-02-20 18:18 backdoor_types.h --r--r--r-- 1 mts mts 1684 2008-02-20 18:18 base64.h --r--r--r-- 1 mts mts 1904 2008-02-20 18:18 bsd_output.h --r--r--r-- 1 mts mts 4381 2008-02-20 18:18 bsd_output_int.h --r--r--r-- 1 mts mts 272 2008-02-20 18:18 buildNumber.h --r--r--r-- 1 mts mts 10251 2008-02-20 18:18 circList.h --r--r--r-- 1 mts mts 3412 2008-02-20 18:18 codeset.h -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 compat --r--r--r-- 1 mts mts 3875 2008-02-20 18:18 conf.h --r--r--r-- 1 mts mts 4796 2008-02-20 18:18 config.h --r--r--r-- 1 mts mts 4184 2008-02-20 18:18 cpName.h --r--r--r-- 1 mts mts 1808 2008-02-20 18:18 cpNameInt.h --r--r--r-- 1 mts mts 1720 2008-02-20 18:18 cpNameLite.h --r--r--r-- 1 mts mts 2607 2008-02-20 18:18 cpNameUtil.h --r--r--r-- 1 mts mts 3074 2008-02-20 18:18 cpuid_info.h --r--r--r-- 1 mts mts 3414 2008-02-20 18:18 cryptoError.h --r--r--r-- 1 mts mts 2360 2008-02-20 18:18 dbllnklst.h --r--r--r-- 1 mts mts 1290 2008-02-20 18:18 debug.h --r--r--r-- 1 mts mts 1100 2008-02-20 18:18 deployPkg.h --r--r--r-- 1 mts mts 1111 2008-02-20 18:18 deployPkgLog.h --r--r--r-- 1 mts mts 1726 2008-02-20 18:18 dictll.h --r--r--r-- 1 mts mts 4340 2008-02-20 18:18 dnd.h --r--r--r-- 1 mts mts 1643 2008-02-20 18:18 dndInt.h --r--r--r-- 1 mts mts 2618 2008-02-20 18:18 dynbuf.h --r--r--r-- 1 mts mts 1695 2008-02-20 18:18 embed_version.h --r--r--r-- 1 mts mts 2655 2008-02-20 18:18 err.h --r--r--r-- 1 mts mts 1908 2008-02-20 18:18 escape.h --r--r--r-- 1 mts mts 3842 2008-02-20 18:18 escBitvector.h --r--r--r-- 1 mts mts 1525 2008-02-20 18:18 eventManager.h --r--r--r-- 1 mts mts 3327 2008-02-20 18:18 file_extensions.h --r--r--r-- 1 mts mts 8612 2008-02-20 18:18 file.h --r--r--r-- 1 mts mts 5847 2008-02-20 18:18 fileInt.h --r--r--r-- 1 mts mts 13271 2008-02-20 18:18 fileIO.h --r--r--r-- 1 mts mts 2394 2008-02-20 18:18 fileLock.h --r--r--r-- 1 mts mts 2180 2008-02-20 18:18 foundryThreads.h --r--r--r-- 1 mts mts 2567 2008-02-20 18:18 ghIntegration.h --r--r--r-- 1 mts mts 4837 2008-02-20 18:18 guestApp.h --r--r--r-- 1 mts mts 7098 2008-02-20 18:18 guestInfo.h --r--r--r-- 1 mts mts 1420 2008-02-20 18:18 guestInfoInt.h --r--r--r-- 1 mts mts 1401 2008-02-20 18:18 guestInfoServer.h --r--r--r-- 1 mts mts 2853 2008-02-20 18:18 guest_msg_def.h --r--r--r-- 1 mts mts 14532 2008-02-20 18:18 guest_os.h --r--r--r-- 1 mts mts 2241 2008-02-20 18:18 hashTable.h --r--r--r-- 1 mts mts 1460 2008-02-20 18:18 hgfsBd.h --r--r--r-- 1 mts mts 2545 2008-02-20 18:18 hgfsDevLinux.h --r--r--r-- 1 mts mts 8396 2008-02-20 18:18 hgfs.h --r--r--r-- 1 mts mts 28755 2008-02-20 18:18 hgfsProto.h --r--r--r-- 1 mts mts 2058 2008-02-20 18:18 hgfsServer.h --r--r--r-- 1 mts mts 25409 2008-02-20 18:18 hgfsServerInt.h --r--r--r-- 1 mts mts 2198 2008-02-20 18:18 hgfsServerManager.h --r--r--r-- 1 mts mts 2706 2008-02-20 18:18 hgfsServerPolicy.h --r--r--r-- 1 mts mts 3676 2008-02-20 18:18 hgfsUtil.h --r--r--r-- 1 mts mts 1270 2008-02-20 18:18 hgfsVirtualDir.h --r--r--r-- 1 mts mts 3363 2008-02-20 18:18 hostinfo.h --r--r--r-- 1 mts mts 1265 2008-02-20 18:18 hostType.h --r--r--r-- 1 mts mts 1647 2008-02-20 18:18 impersonate.h --r--r--r-- 1 mts mts 2017 2008-02-20 18:18 impersonateInt.h --r--r--r-- 1 mts mts 4272 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 4622 2008-02-20 18:18 iovector.h --r--r--r-- 1 mts mts 1286 2008-02-20 18:18 localconfig.h --r--r--r-- 1 mts mts 3864 2008-02-20 18:18 log.h --r--r--r-- 1 mts mts 3873 2008-02-20 18:18 loglevel_defs.h --r--r--r-- 1 mts mts 5503 2008-02-20 18:18 loglevel_user.h --r--r--r-- 1 mts mts 3539 2008-02-20 18:18 message.h --r--r--r-- 1 mts mts 1254 2008-02-20 18:18 miscSolaris.h --r--r--r-- 1 mts mts 7453 2008-02-20 18:18 mntinfo.h --r--r--r-- 1 mts mts 3964 2008-02-20 18:18 msgfmt.h --r--r--r-- 1 mts mts 8456 2008-02-20 18:18 msg.h --r--r--r-- 1 mts mts 1576 2008-02-20 18:18 netutil.h --r--r--r-- 1 mts mts 2570 2008-02-20 18:18 panic.h --r--r--r-- 1 mts mts 2009 2008-02-20 18:18 preference.h --r--r--r-- 1 mts mts 1379 2008-02-20 18:18 printer.h --r--r--r-- 1 mts mts 4622 2008-02-20 18:18 procMgr.h --r--r--r-- 1 mts mts 3152 2008-02-20 18:18 productState.h --r--r--r-- 1 mts mts 1330 2008-02-20 18:18 random.h --r--r--r-- 1 mts mts 1148 2008-02-20 18:18 removable_device.h --r--r--r-- 1 mts mts 2319 2008-02-20 18:18 rpcin.h --r--r--r-- 1 mts mts 1973 2008-02-20 18:18 rpcout.h --r--r--r-- 1 mts mts 2694 2008-02-20 18:18 rpcvmx.h --r--r--r-- 1 mts mts 2134 2008-02-20 18:18 runDeployPkgInt.h --r--r--r-- 1 mts mts 4868 2008-02-20 18:18 safetime.h --r--r--r-- 1 mts mts 1921 2008-02-20 18:18 SLPv2.h --r--r--r-- 1 mts mts 12714 2008-02-20 18:18 SLPv2Private.h --r--r--r-- 1 mts mts 3470 2008-02-20 18:18 socketMgr.h --r--r--r-- 1 mts mts 2491 2008-02-20 18:18 staticEscape.h --r--r--r-- 1 mts mts 2359 2008-02-20 18:18 stats_file.h --r--r--r-- 1 mts mts 3389 2008-02-20 18:18 stats_user_defs.h --r--r--r-- 1 mts mts 10720 2008-02-20 18:18 stats_user_setup.h --r--r--r-- 1 mts mts 8505 2008-02-20 18:18 str.h --r--r--r-- 1 mts mts 2073 2008-02-20 18:18 strutil.h --r--r--r-- 1 mts mts 3409 2008-02-20 18:18 su.h --r--r--r-- 1 mts mts 2047 2008-02-20 18:18 syncDriver.h --r--r--r-- 1 mts mts 1550 2008-02-20 18:18 syncDriverIoc.h --r--r--r-- 1 mts mts 2236 2008-02-20 18:18 syncEvent.h --r--r--r-- 1 mts mts 1891 2008-02-20 18:18 syncMutex.h --r--r--r-- 1 mts mts 3401 2008-02-20 18:18 syncWaitQ.h --r--r--r-- 1 mts mts 2724 2008-02-20 18:18 system.h --r--r--r-- 1 mts mts 3226 2008-02-20 18:18 timeutil.h --r--r--r-- 1 mts mts 1737 2008-02-20 18:18 toolsDeployPkg.h --r--r--r-- 1 mts mts 2376 2008-02-20 18:18 toolsLogger.h --r--r--r-- 1 mts mts 1514 2008-02-20 18:18 toolsLoggerInt.h --r--r--r-- 1 mts mts 10438 2008-02-20 18:18 unicodeBase.h --r--r--r-- 1 mts mts 1439 2008-02-20 18:18 unicode.h --r--r--r-- 1 mts mts 1586 2008-02-20 18:18 unicodeInt.h --r--r--r-- 1 mts mts 20876 2008-02-20 18:18 unicodeOperations.h --r--r--r-- 1 mts mts 2677 2008-02-20 18:18 unicodeTransforms.h --r--r--r-- 1 mts mts 4685 2008-02-20 18:18 unicodeTypes.h --r--r--r-- 1 mts mts 2225 2008-02-20 18:18 unity.h --r--r--r-- 1 mts mts 14595 2008-02-20 18:18 util.h --r--r--r-- 1 mts mts 2980 2008-02-20 18:18 util_shared.h --r--r--r-- 1 mts mts 1818 2008-02-20 18:18 uuid.h --r--r--r-- 1 mts mts 60145 2008-02-20 18:18 vixCommands.h --r--r--r-- 1 mts mts 37388 2008-02-20 18:18 vix.h --r--r--r-- 1 mts mts 13669 2008-02-20 18:18 vixOpenSource.h --r--r--r-- 1 mts mts 3865 2008-02-20 18:18 vixTools.h --r--r--r-- 1 mts mts 3958 2008-02-20 18:18 vm_app.h --r--r--r-- 1 mts mts 9998 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 52924 2008-02-20 18:18 vm_atomic.h --r--r--r-- 1 mts mts 3324 2008-02-20 18:18 vmbackup_def.h --r--r--r-- 1 mts mts 6581 2008-02-20 18:18 vmBackup.h --r--r--r-- 1 mts mts 17569 2008-02-20 18:18 vm_basic_asm.h --r--r--r-- 1 mts mts 8795 2008-02-20 18:18 vm_basic_asm_x86_64.h --r--r--r-- 1 mts mts 16053 2008-02-20 18:18 vm_basic_asm_x86.h --r--r--r-- 1 mts mts 12289 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 21575 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 4270 2008-02-20 18:18 vmblock.h --r--r--r-- 1 mts mts 1261 2008-02-20 18:18 vmcheck.h --r--r--r-- 1 mts mts 2416 2008-02-20 18:18 vm_ctype.h --r--r--r-- 1 mts mts 14149 2008-02-20 18:18 vmGuestLib.h --r--r--r-- 1 mts mts 2104 2008-02-20 18:18 vm_legal.h --r--r--r-- 1 mts mts 16484 2008-02-20 18:18 vm_product.h --r--r--r-- 1 mts mts 1073 2008-02-20 18:18 vmSessionId.h --r--r--r-- 1 mts mts 1256 2008-02-20 18:18 vmsignal.h --r--r--r-- 1 mts mts 1322 2008-02-20 18:18 vmstdio.h --r--r--r-- 1 mts mts 28825 2008-02-20 18:18 vm_tools_version.h --r--r--r-- 1 mts mts 15306 2008-02-20 18:18 vm_version.h --r--r--r-- 1 mts mts 1899 2008-02-20 18:18 vmware.h --r--r--r-- 1 mts mts 1326 2008-02-20 18:18 vmware_pack_begin.h --r--r--r-- 1 mts mts 1346 2008-02-20 18:18 vmware_pack_end.h --r--r--r-- 1 mts mts 1966 2008-02-20 18:18 vmware_pack_init.h --r--r--r-- 1 mts mts 2737 2008-02-20 18:18 wiper.h --r--r--r-- 1 mts mts 33970 2008-02-20 18:18 x86cpuid.h - -open-vm-tools-2008.02.13-77928/lib/include/compat: +-r--r--r-- 1 mts mts 1118 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14854 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8188 Apr 14 13:03 impersonate.c +-r--r--r-- 1 mts mts 11902 Apr 14 13:03 impersonatePosix.c + +open-vm-tools-2008.04.14-87182/lib/include: +total 1212 +-r--r--r-- 1 mts mts 1935 Apr 14 13:03 SLPv2.h +-r--r--r-- 1 mts mts 12728 Apr 14 13:03 SLPv2Private.h +-r--r--r-- 1 mts mts 2232 Apr 14 13:03 auth.h +-r--r--r-- 1 mts mts 1361 Apr 14 13:03 backdoor.h +-r--r--r-- 1 mts mts 1056 Apr 14 13:03 backdoorInt.h +-r--r--r-- 1 mts mts 5864 Apr 14 13:03 backdoor_def.h +-r--r--r-- 1 mts mts 3567 Apr 14 13:03 backdoor_types.h +-r--r--r-- 1 mts mts 1698 Apr 14 13:03 base64.h +-r--r--r-- 1 mts mts 1918 Apr 14 13:03 bsd_output.h +-r--r--r-- 1 mts mts 3312 Apr 14 13:03 bsd_output_int.h +-r--r--r-- 1 mts mts 5971 Apr 14 13:03 bsdfmt.h +-r--r--r-- 1 mts mts 272 Apr 14 13:03 buildNumber.h +-r--r--r-- 1 mts mts 10265 Apr 14 13:03 circList.h +-r--r--r-- 1 mts mts 14823 Apr 14 13:03 codeset.h +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 compat +-r--r--r-- 1 mts mts 3889 Apr 14 13:03 conf.h +-r--r--r-- 1 mts mts 4810 Apr 14 13:03 config.h +-r--r--r-- 1 mts mts 4198 Apr 14 13:03 cpName.h +-r--r--r-- 1 mts mts 1822 Apr 14 13:03 cpNameInt.h +-r--r--r-- 1 mts mts 1734 Apr 14 13:03 cpNameLite.h +-r--r--r-- 1 mts mts 2621 Apr 14 13:03 cpNameUtil.h +-r--r--r-- 1 mts mts 3088 Apr 14 13:03 cpuid_info.h +-r--r--r-- 1 mts mts 3428 Apr 14 13:03 cryptoError.h +-r--r--r-- 1 mts mts 2374 Apr 14 13:03 dbllnklst.h +-r--r--r-- 1 mts mts 1304 Apr 14 13:03 debug.h +-r--r--r-- 1 mts mts 1114 Apr 14 13:03 deployPkg.h +-r--r--r-- 1 mts mts 1125 Apr 14 13:03 deployPkgLog.h +-r--r--r-- 1 mts mts 1740 Apr 14 13:03 dictll.h +-r--r--r-- 1 mts mts 7079 Apr 14 13:03 dnd.h +-r--r--r-- 1 mts mts 1819 Apr 14 13:03 dndInt.h +-r--r--r-- 1 mts mts 8051 Apr 14 13:03 dynarray.h +-r--r--r-- 1 mts mts 2632 Apr 14 13:03 dynbuf.h +-r--r--r-- 1 mts mts 1709 Apr 14 13:03 embed_version.h +-r--r--r-- 1 mts mts 2669 Apr 14 13:03 err.h +-r--r--r-- 1 mts mts 3856 Apr 14 13:03 escBitvector.h +-r--r--r-- 1 mts mts 1922 Apr 14 13:03 escape.h +-r--r--r-- 1 mts mts 1539 Apr 14 13:03 eventManager.h +-r--r--r-- 1 mts mts 8680 Apr 14 13:03 file.h +-r--r--r-- 1 mts mts 12660 Apr 14 13:03 fileIO.h +-r--r--r-- 1 mts mts 6186 Apr 14 13:03 fileInt.h +-r--r--r-- 1 mts mts 2408 Apr 14 13:03 fileLock.h +-r--r--r-- 1 mts mts 3373 Apr 14 13:03 file_extensions.h +-r--r--r-- 1 mts mts 2194 Apr 14 13:03 foundryThreads.h +-r--r--r-- 1 mts mts 2271 Apr 14 13:03 ghIntegration.h +-r--r--r-- 1 mts mts 4841 Apr 14 13:03 guestApp.h +-r--r--r-- 1 mts mts 8794 Apr 14 13:03 guestInfo.h +-r--r--r-- 1 mts mts 1954 Apr 14 13:03 guestInfoInt.h +-r--r--r-- 1 mts mts 1415 Apr 14 13:03 guestInfoServer.h +-r--r--r-- 1 mts mts 2867 Apr 14 13:03 guest_msg_def.h +-r--r--r-- 1 mts mts 14546 Apr 14 13:03 guest_os.h +-r--r--r-- 1 mts mts 2954 Apr 14 13:03 hashTable.h +-r--r--r-- 1 mts mts 7032 Apr 14 13:03 hgfs.h +-r--r--r-- 1 mts mts 1474 Apr 14 13:03 hgfsBd.h +-r--r--r-- 1 mts mts 2559 Apr 14 13:03 hgfsDevLinux.h +-r--r--r-- 1 mts mts 40105 Apr 14 13:03 hgfsProto.h +-r--r--r-- 1 mts mts 2072 Apr 14 13:03 hgfsServer.h +-r--r--r-- 1 mts mts 26256 Apr 14 13:03 hgfsServerInt.h +-r--r--r-- 1 mts mts 2212 Apr 14 13:03 hgfsServerManager.h +-r--r--r-- 1 mts mts 2786 Apr 14 13:03 hgfsServerPolicy.h +-r--r--r-- 1 mts mts 3761 Apr 14 13:03 hgfsUtil.h +-r--r--r-- 1 mts mts 1284 Apr 14 13:03 hgfsVirtualDir.h +-r--r--r-- 1 mts mts 1279 Apr 14 13:03 hostType.h +-r--r--r-- 1 mts mts 3463 Apr 14 13:03 hostinfo.h +-r--r--r-- 1 mts mts 1661 Apr 14 13:03 impersonate.h +-r--r--r-- 1 mts mts 2031 Apr 14 13:03 impersonateInt.h +-r--r--r-- 1 mts mts 4286 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 4636 Apr 14 13:03 iovector.h +-r--r--r-- 1 mts mts 1300 Apr 14 13:03 localconfig.h +-r--r--r-- 1 mts mts 3878 Apr 14 13:03 log.h +-r--r--r-- 1 mts mts 3887 Apr 14 13:03 loglevel_defs.h +-r--r--r-- 1 mts mts 5556 Apr 14 13:03 loglevel_user.h +-r--r--r-- 1 mts mts 3553 Apr 14 13:03 message.h +-r--r--r-- 1 mts mts 1268 Apr 14 13:03 miscSolaris.h +-r--r--r-- 1 mts mts 7467 Apr 14 13:03 mntinfo.h +-r--r--r-- 1 mts mts 8398 Apr 14 13:03 msg.h +-r--r--r-- 1 mts mts 4235 Apr 14 13:03 msgfmt.h +-r--r--r-- 1 mts mts 1751 Apr 14 13:03 netutil.h +-r--r--r-- 1 mts mts 2584 Apr 14 13:03 panic.h +-r--r--r-- 1 mts mts 6230 Apr 14 13:03 posix.h +-r--r--r-- 1 mts mts 2023 Apr 14 13:03 preference.h +-r--r--r-- 1 mts mts 1393 Apr 14 13:03 printer.h +-r--r--r-- 1 mts mts 4812 Apr 14 13:03 procMgr.h +-r--r--r-- 1 mts mts 3166 Apr 14 13:03 productState.h +-r--r--r-- 1 mts mts 1344 Apr 14 13:03 random.h +-r--r--r-- 1 mts mts 1162 Apr 14 13:03 removable_device.h +-r--r--r-- 1 mts mts 2333 Apr 14 13:03 rpcin.h +-r--r--r-- 1 mts mts 1987 Apr 14 13:03 rpcout.h +-r--r--r-- 1 mts mts 2708 Apr 14 13:03 rpcvmx.h +-r--r--r-- 1 mts mts 2148 Apr 14 13:03 runDeployPkgInt.h +-r--r--r-- 1 mts mts 4882 Apr 14 13:03 safetime.h +-r--r--r-- 1 mts mts 3484 Apr 14 13:03 socketMgr.h +-r--r--r-- 1 mts mts 2505 Apr 14 13:03 staticEscape.h +-r--r--r-- 1 mts mts 2373 Apr 14 13:03 stats_file.h +-r--r--r-- 1 mts mts 3403 Apr 14 13:03 stats_user_defs.h +-r--r--r-- 1 mts mts 10734 Apr 14 13:03 stats_user_setup.h +-r--r--r-- 1 mts mts 6584 Apr 14 13:03 str.h +-r--r--r-- 1 mts mts 2142 Apr 14 13:03 strutil.h +-r--r--r-- 1 mts mts 3423 Apr 14 13:03 su.h +-r--r--r-- 1 mts mts 2061 Apr 14 13:03 syncDriver.h +-r--r--r-- 1 mts mts 1564 Apr 14 13:03 syncDriverIoc.h +-r--r--r-- 1 mts mts 2250 Apr 14 13:03 syncEvent.h +-r--r--r-- 1 mts mts 1979 Apr 14 13:03 syncMutex.h +-r--r--r-- 1 mts mts 3415 Apr 14 13:03 syncWaitQ.h +-r--r--r-- 1 mts mts 2797 Apr 14 13:03 system.h +-r--r--r-- 1 mts mts 3240 Apr 14 13:03 timeutil.h +-r--r--r-- 1 mts mts 1751 Apr 14 13:03 toolsDeployPkg.h +-r--r--r-- 1 mts mts 2390 Apr 14 13:03 toolsLogger.h +-r--r--r-- 1 mts mts 1528 Apr 14 13:03 toolsLoggerInt.h +-r--r--r-- 1 mts mts 1578 Apr 14 13:03 unicode.h +-r--r--r-- 1 mts mts 11589 Apr 14 13:03 unicodeBase.h +-r--r--r-- 1 mts mts 1600 Apr 14 13:03 unicodeInt.h +-r--r--r-- 1 mts mts 20105 Apr 14 13:03 unicodeOperations.h +-r--r--r-- 1 mts mts 1853 Apr 14 13:03 unicodeTransforms.h +-r--r--r-- 1 mts mts 4787 Apr 14 13:03 unicodeTypes.h +-r--r--r-- 1 mts mts 2465 Apr 14 13:03 unity.h +-r--r--r-- 1 mts mts 15229 Apr 14 13:03 util.h +-r--r--r-- 1 mts mts 2994 Apr 14 13:03 util_shared.h +-r--r--r-- 1 mts mts 1832 Apr 14 13:03 uuid.h +-r--r--r-- 1 mts mts 38245 Apr 14 13:03 vix.h +-r--r--r-- 1 mts mts 60295 Apr 14 13:03 vixCommands.h +-r--r--r-- 1 mts mts 14219 Apr 14 13:03 vixOpenSource.h +-r--r--r-- 1 mts mts 3995 Apr 14 13:03 vixTools.h +-r--r--r-- 1 mts mts 6777 Apr 14 13:03 vmBackup.h +-r--r--r-- 1 mts mts 14163 Apr 14 13:03 vmGuestLib.h +-r--r--r-- 1 mts mts 1092 Apr 14 13:03 vmSessionId.h +-r--r--r-- 1 mts mts 4092 Apr 14 13:03 vm_app.h +-r--r--r-- 1 mts mts 9976 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 54313 Apr 14 13:03 vm_atomic.h +-r--r--r-- 1 mts mts 17721 Apr 14 13:03 vm_basic_asm.h +-r--r--r-- 1 mts mts 16103 Apr 14 13:03 vm_basic_asm_x86.h +-r--r--r-- 1 mts mts 8869 Apr 14 13:03 vm_basic_asm_x86_64.h +-r--r--r-- 1 mts mts 12206 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 21744 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 2430 Apr 14 13:03 vm_ctype.h +-r--r--r-- 1 mts mts 2118 Apr 14 13:03 vm_legal.h +-r--r--r-- 1 mts mts 17935 Apr 14 13:03 vm_product.h +-r--r--r-- 1 mts mts 29426 Apr 14 13:03 vm_tools_version.h +-r--r--r-- 1 mts mts 15783 Apr 14 13:03 vm_version.h +-r--r--r-- 1 mts mts 3338 Apr 14 13:03 vmbackup_def.h +-r--r--r-- 1 mts mts 4284 Apr 14 13:03 vmblock.h +-r--r--r-- 1 mts mts 1275 Apr 14 13:03 vmcheck.h +-r--r--r-- 1 mts mts 1270 Apr 14 13:03 vmsignal.h +-r--r--r-- 1 mts mts 1336 Apr 14 13:03 vmstdio.h +-r--r--r-- 1 mts mts 1913 Apr 14 13:03 vmware.h +-r--r--r-- 1 mts mts 1340 Apr 14 13:03 vmware_pack_begin.h +-r--r--r-- 1 mts mts 1360 Apr 14 13:03 vmware_pack_end.h +-r--r--r-- 1 mts mts 1980 Apr 14 13:03 vmware_pack_init.h +-r--r--r-- 1 mts mts 7863 Apr 14 13:03 win32util.h +-r--r--r-- 1 mts mts 2751 Apr 14 13:03 wiper.h +-r--r--r-- 1 mts mts 37619 Apr 14 13:03 x86cpuid.h + +open-vm-tools-2008.04.14-87182/lib/include/compat: total 4 --r--r--r-- 1 mts mts 1892 2008-02-20 18:18 compat_stdarg.h +-r--r--r-- 1 mts mts 1906 Apr 14 13:03 compat_stdarg.h -open-vm-tools-2008.02.13-77928/lib/message: +open-vm-tools-2008.04.14-87182/lib/message: total 68 --r--r--r-- 1 mts mts 1126 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18789 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 17275 2008-02-20 18:18 messageBackdoor.c --r--r--r-- 1 mts mts 8264 2008-02-20 18:18 message.c --r--r--r-- 1 mts mts 4737 2008-02-20 18:18 messageStub.c -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared - -open-vm-tools-2008.02.13-77928/lib/message/shared: +-r--r--r-- 1 mts mts 1126 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18841 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8278 Apr 14 13:03 message.c +-r--r--r-- 1 mts mts 17289 Apr 14 13:03 messageBackdoor.c +-r--r--r-- 1 mts mts 4751 Apr 14 13:03 messageStub.c +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 shared + +open-vm-tools-2008.04.14-87182/lib/message/shared: total 24 --r--r--r-- 1 mts mts 1113 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 17721 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/misc: -total 296 --r--r--r-- 1 mts mts 15371 2008-02-20 18:18 base64.c --r--r--r-- 1 mts mts 48215 2008-02-20 18:18 codeset.c --r--r--r-- 1 mts mts 8227 2008-02-20 18:18 dbllnklst.c --r--r--r-- 1 mts mts 9619 2008-02-20 18:18 dynbuf.c --r--r--r-- 1 mts mts 14555 2008-02-20 18:18 escape.c --r--r--r-- 1 mts mts 14589 2008-02-20 18:18 hashTable.c --r--r--r-- 1 mts mts 5929 2008-02-20 18:18 hostinfo_misc.c --r--r--r-- 1 mts mts 8216 2008-02-20 18:18 hostname.c --r--r--r-- 1 mts mts 22598 2008-02-20 18:18 idLinux.c --r--r--r-- 1 mts mts 24746 2008-02-20 18:18 iovector.c --r--r--r-- 1 mts mts 14896 2008-02-20 18:18 machineID.c --r--r--r-- 1 mts mts 1550 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 20067 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 2003 2008-02-20 18:18 miscSolaris.c --r--r--r-- 1 mts mts 5929 2008-02-20 18:18 random.c -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared --r--r--r-- 1 mts mts 25857 2008-02-20 18:18 timeutil.c --r--r--r-- 1 mts mts 9513 2008-02-20 18:18 util_misc.c --r--r--r-- 1 mts mts 6613 2008-02-20 18:18 vmstdio.c - -open-vm-tools-2008.02.13-77928/lib/misc/shared: +-r--r--r-- 1 mts mts 1113 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 17773 Apr 14 13:03 Makefile.in + +open-vm-tools-2008.04.14-87182/lib/misc: +total 368 +-r--r--r-- 1 mts mts 1681 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 20539 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 2146 Apr 14 13:03 atomic.c +-r--r--r-- 1 mts mts 15371 Apr 14 13:03 base64.c +-r--r--r-- 1 mts mts 48383 Apr 14 13:03 codeset.c +-r--r--r-- 1 mts mts 8241 Apr 14 13:03 dbllnklst.c +-r--r--r-- 1 mts mts 6500 Apr 14 13:03 dynarray.c +-r--r--r-- 1 mts mts 9633 Apr 14 13:03 dynbuf.c +-r--r--r-- 1 mts mts 14569 Apr 14 13:03 escape.c +-r--r--r-- 1 mts mts 19809 Apr 14 13:03 hashTable.c +-r--r--r-- 1 mts mts 5943 Apr 14 13:03 hostinfo_misc.c +-r--r--r-- 1 mts mts 6141 Apr 14 13:03 hostname.c +-r--r--r-- 1 mts mts 22612 Apr 14 13:03 idLinux.c +-r--r--r-- 1 mts mts 24760 Apr 14 13:03 iovector.c +-r--r--r-- 1 mts mts 14910 Apr 14 13:03 machineID.c +-r--r--r-- 1 mts mts 2017 Apr 14 13:03 miscSolaris.c +-r--r--r-- 1 mts mts 1701 Apr 14 13:03 posixDlopen.c +-r--r--r-- 1 mts mts 35625 Apr 14 13:03 posixPosix.c +-r--r--r-- 1 mts mts 14322 Apr 14 13:03 posixWin32.c +-r--r--r-- 1 mts mts 5943 Apr 14 13:03 random.c +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 shared +-r--r--r-- 1 mts mts 25871 Apr 14 13:03 timeutil.c +-r--r--r-- 1 mts mts 9503 Apr 14 13:03 util_misc.c +-r--r--r-- 1 mts mts 6627 Apr 14 13:03 vmstdio.c + +open-vm-tools-2008.04.14-87182/lib/misc/shared: total 36 --r--r--r-- 1 mts mts 1589 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 30323 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1659 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 32303 Apr 14 13:03 Makefile.in -open-vm-tools-2008.02.13-77928/lib/netUtil: +open-vm-tools-2008.04.14-87182/lib/netUtil: total 28 --r--r--r-- 1 mts mts 1022 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14567 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 7403 2008-02-20 18:18 netUtilLinux.c +-r--r--r-- 1 mts mts 1022 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14619 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 7417 Apr 14 13:03 netUtilLinux.c -open-vm-tools-2008.02.13-77928/lib/panic: +open-vm-tools-2008.04.14-87182/lib/panic: total 36 --r--r--r-- 1 mts mts 1009 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14504 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 12931 2008-02-20 18:18 panic.c +-r--r--r-- 1 mts mts 1009 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14556 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 12945 Apr 14 13:03 panic.c -open-vm-tools-2008.02.13-77928/lib/panicDefault: +open-vm-tools-2008.04.14-87182/lib/panicDefault: total 24 --r--r--r-- 1 mts mts 1030 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14651 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 1474 2008-02-20 18:18 panic.c +-r--r--r-- 1 mts mts 1030 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14703 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 1488 Apr 14 13:03 panic.c -open-vm-tools-2008.02.13-77928/lib/printer: +open-vm-tools-2008.04.14-87182/lib/printer: total 32 --r--r--r-- 1 mts mts 1017 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14552 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 9652 2008-02-20 18:18 printer.c +-r--r--r-- 1 mts mts 1017 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14604 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 9666 Apr 14 13:03 printer.c -open-vm-tools-2008.02.13-77928/lib/procMgr: +open-vm-tools-2008.04.14-87182/lib/procMgr: total 56 --r--r--r-- 1 mts mts 1057 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14589 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 36127 2008-02-20 18:18 procMgrPosix.c +-r--r--r-- 1 mts mts 1057 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14641 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 36619 Apr 14 13:03 procMgrPosix.c -open-vm-tools-2008.02.13-77928/lib/rpcIn: +open-vm-tools-2008.04.14-87182/lib/rpcIn: total 40 --r--r--r-- 1 mts mts 1009 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14504 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 17342 2008-02-20 18:18 rpcin.c +-r--r--r-- 1 mts mts 1009 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14556 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 17356 Apr 14 13:03 rpcin.c -open-vm-tools-2008.02.13-77928/lib/rpcOut: +open-vm-tools-2008.04.14-87182/lib/rpcOut: total 40 --r--r--r-- 1 mts mts 1042 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18528 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 11680 2008-02-20 18:18 rpcout.c -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared +-r--r--r-- 1 mts mts 1042 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18580 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 11694 Apr 14 13:03 rpcout.c +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 shared -open-vm-tools-2008.02.13-77928/lib/rpcOut/shared: +open-vm-tools-2008.04.14-87182/lib/rpcOut/shared: total 20 --r--r--r-- 1 mts mts 1021 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15550 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1021 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15602 Apr 14 13:03 Makefile.in -open-vm-tools-2008.02.13-77928/lib/rpcVmx: +open-vm-tools-2008.04.14-87182/lib/rpcVmx: total 28 --r--r--r-- 1 mts mts 1013 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14528 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 7264 2008-02-20 18:18 rpcvmx.c - -open-vm-tools-2008.02.13-77928/lib/SLPv2Parser: -total 68 --r--r--r-- 1 mts mts 1125 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14900 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 7500 2008-02-20 18:18 SLPv2Match.c --r--r--r-- 1 mts mts 18280 2008-02-20 18:18 SLPv2MsgAssembler.c --r--r--r-- 1 mts mts 16804 2008-02-20 18:18 SLPv2MsgParser.c +-r--r--r-- 1 mts mts 1013 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14580 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 7278 Apr 14 13:03 rpcvmx.c -open-vm-tools-2008.02.13-77928/lib/socketMgr: +open-vm-tools-2008.04.14-87182/lib/socketMgr: total 64 --r--r--r-- 1 mts mts 1025 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14600 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 41891 2008-02-20 18:18 socketMgr.c - -open-vm-tools-2008.02.13-77928/lib/string: -total 200 --r--r--r-- 1 mts mts 6562 2008-02-20 18:18 bsd_output_shared.c --r--r--r-- 1 mts mts 76028 2008-02-20 18:18 bsd_vsnprintf.c --r--r--r-- 1 mts mts 51868 2008-02-20 18:18 bsd_vsnwprintf.c --r--r--r-- 1 mts mts 1194 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18911 2008-02-20 18:18 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared --r--r--r-- 1 mts mts 26759 2008-02-20 18:18 str.c - -open-vm-tools-2008.02.13-77928/lib/string/shared: -total 24 --r--r--r-- 1 mts mts 1185 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18808 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1025 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14652 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 41905 Apr 14 13:03 socketMgr.c -open-vm-tools-2008.02.13-77928/lib/strUtil: -total 36 --r--r--r-- 1 mts mts 1017 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14552 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 15614 2008-02-20 18:18 strutil.c +open-vm-tools-2008.04.14-87182/lib/strUtil: +total 40 +-r--r--r-- 1 mts mts 1017 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14604 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 16861 Apr 14 13:03 strutil.c + +open-vm-tools-2008.04.14-87182/lib/string: +total 176 +-r--r--r-- 1 mts mts 1194 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18963 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8168 Apr 14 13:03 bsd_output_shared.c +-r--r--r-- 1 mts mts 48924 Apr 14 13:03 bsd_vsnprintf.c +-r--r--r-- 1 mts mts 50300 Apr 14 13:03 bsd_vsnwprintf.c +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 shared +-r--r--r-- 1 mts mts 32823 Apr 14 13:03 str.c + +open-vm-tools-2008.04.14-87182/lib/string/shared: +total 24 +-r--r--r-- 1 mts mts 1185 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18860 Apr 14 13:03 Makefile.in -open-vm-tools-2008.02.13-77928/lib/sync: +open-vm-tools-2008.04.14-87182/lib/sync: total 60 --r--r--r-- 1 mts mts 1077 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18615 2008-02-20 18:18 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 shared --r--r--r-- 1 mts mts 5990 2008-02-20 18:18 syncMutex.c --r--r--r-- 1 mts mts 21326 2008-02-20 18:18 syncWaitQPosix.c +-r--r--r-- 1 mts mts 1077 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18667 Apr 14 13:03 Makefile.in +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 shared +-r--r--r-- 1 mts mts 6533 Apr 14 13:03 syncMutex.c +-r--r--r-- 1 mts mts 21340 Apr 14 13:03 syncWaitQPosix.c -open-vm-tools-2008.02.13-77928/lib/sync/shared: +open-vm-tools-2008.04.14-87182/lib/sync/shared: total 24 --r--r--r-- 1 mts mts 1060 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 16652 2008-02-20 18:18 Makefile.in +-r--r--r-- 1 mts mts 1060 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 16704 Apr 14 13:03 Makefile.in -open-vm-tools-2008.02.13-77928/lib/syncDriver: +open-vm-tools-2008.04.14-87182/lib/syncDriver: total 32 --r--r--r-- 1 mts mts 1034 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14639 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 8834 2008-02-20 18:18 syncDriverPosix.c +-r--r--r-- 1 mts mts 1034 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14691 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 8740 Apr 14 13:03 syncDriverPosix.c -open-vm-tools-2008.02.13-77928/lib/system: -total 28 --r--r--r-- 1 mts mts 995 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14543 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 7332 2008-02-20 18:18 systemLinux.c +open-vm-tools-2008.04.14-87182/lib/system: +total 32 +-r--r--r-- 1 mts mts 995 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14595 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 9268 Apr 14 13:03 systemLinux.c -open-vm-tools-2008.02.13-77928/lib/toolsLogger: +open-vm-tools-2008.04.14-87182/lib/toolsLogger: total 36 --r--r--r-- 1 mts mts 15158 2008-02-20 18:18 logger.c --r--r--r-- 1 mts mts 1028 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14633 2008-02-20 18:18 Makefile.in - -open-vm-tools-2008.02.13-77928/lib/unicode: -total 148 --r--r--r-- 1 mts mts 1304 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15410 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 10490 2008-02-20 18:18 unicodeCommon.c --r--r--r-- 1 mts mts 1586 2008-02-20 18:18 unicodeInt.h --r--r--r-- 1 mts mts 19088 2008-02-20 18:18 unicodeSimpleBase.c --r--r--r-- 1 mts mts 34559 2008-02-20 18:18 unicodeSimpleCaseFolding.c --r--r--r-- 1 mts mts 15210 2008-02-20 18:18 unicodeSimpleOperations.c --r--r--r-- 1 mts mts 16118 2008-02-20 18:18 unicodeSimpleTransforms.c --r--r--r-- 1 mts mts 8183 2008-02-20 18:18 unicodeSimpleTypes.c --r--r--r-- 1 mts mts 7307 2008-02-20 18:18 unicodeSimpleUTF16.h --r--r--r-- 1 mts mts 5013 2008-02-20 18:18 unicodeStatic.c - -open-vm-tools-2008.02.13-77928/lib/unityStub: +-r--r--r-- 1 mts mts 1028 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14685 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 15172 Apr 14 13:03 logger.c + +open-vm-tools-2008.04.14-87182/lib/unicode: +total 212 +-r--r--r-- 1 mts mts 1304 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15462 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 11879 Apr 14 13:03 unicodeCommon.c +-r--r--r-- 1 mts mts 1600 Apr 14 13:03 unicodeInt.h +-r--r--r-- 1 mts mts 19786 Apr 14 13:03 unicodeSimpleBase.c +-r--r--r-- 1 mts mts 34559 Apr 14 13:03 unicodeSimpleCaseFolding.c +-r--r--r-- 1 mts mts 15794 Apr 14 13:03 unicodeSimpleOperations.c +-r--r--r-- 1 mts mts 18115 Apr 14 13:03 unicodeSimpleTransforms.c +-r--r--r-- 1 mts mts 73309 Apr 14 13:03 unicodeSimpleTypes.c +-r--r--r-- 1 mts mts 5027 Apr 14 13:03 unicodeStatic.c + +open-vm-tools-2008.04.14-87182/lib/unityStub: total 24 --r--r--r-- 1 mts mts 1056 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14618 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 1576 2008-02-20 18:18 unityStub.c +-r--r--r-- 1 mts mts 1056 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14670 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 1637 Apr 14 13:03 unityStub.c -open-vm-tools-2008.02.13-77928/lib/user: -total 132 --r--r--r-- 1 mts mts 9669 2008-02-20 18:18 hostinfo.c --r--r--r-- 1 mts mts 37757 2008-02-20 18:18 hostinfoPosix.c --r--r--r-- 1 mts mts 1138 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14825 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 38059 2008-02-20 18:18 util.c --r--r--r-- 1 mts mts 19142 2008-02-20 18:18 utilPosix.c - -open-vm-tools-2008.02.13-77928/lib/vixTools: +open-vm-tools-2008.04.14-87182/lib/user: total 132 --r--r--r-- 1 mts mts 1021 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14576 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 106750 2008-02-20 18:18 vixTools.c - -open-vm-tools-2008.02.13-77928/lib/vmBackupLib: -total 64 --r--r--r-- 1 mts mts 1118 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14876 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 10163 2008-02-20 18:18 scriptOps.c --r--r--r-- 1 mts mts 18084 2008-02-20 18:18 stateMachine.c --r--r--r-- 1 mts mts 9022 2008-02-20 18:18 syncDriverOps.c - -open-vm-tools-2008.02.13-77928/lib/vmCheck: +-r--r--r-- 1 mts mts 1138 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14877 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 9683 Apr 14 13:03 hostinfo.c +-r--r--r-- 1 mts mts 38576 Apr 14 13:03 hostinfoPosix.c +-r--r--r-- 1 mts mts 40325 Apr 14 13:03 util.c +-r--r--r-- 1 mts mts 18749 Apr 14 13:03 utilPosix.c + +open-vm-tools-2008.04.14-87182/lib/vixTools: +total 136 +-r--r--r-- 1 mts mts 1021 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14628 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 112046 Apr 14 13:03 vixTools.c + +open-vm-tools-2008.04.14-87182/lib/vmBackupLib: +total 76 +-r--r--r-- 1 mts mts 1118 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14928 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 12378 Apr 14 13:03 scriptOps.c +-r--r--r-- 1 mts mts 22182 Apr 14 13:03 stateMachine.c +-r--r--r-- 1 mts mts 9036 Apr 14 13:03 syncDriverOps.c +-r--r--r-- 1 mts mts 1264 Apr 14 13:03 vmBackupInt.h + +open-vm-tools-2008.04.14-87182/lib/vmCheck: total 28 --r--r--r-- 1 mts mts 1017 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14552 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 5323 2008-02-20 18:18 vmcheck.c +-r--r--r-- 1 mts mts 1017 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14604 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 5337 Apr 14 13:03 vmcheck.c -open-vm-tools-2008.02.13-77928/lib/vmSignal: +open-vm-tools-2008.04.14-87182/lib/vmSignal: total 24 --r--r--r-- 1 mts mts 1021 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14576 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 3066 2008-02-20 18:18 vmsignal.c +-r--r--r-- 1 mts mts 1021 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14628 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 3080 Apr 14 13:03 vmsignal.c -open-vm-tools-2008.02.13-77928/lib/wiper: +open-vm-tools-2008.04.14-87182/lib/wiper: total 44 --r--r--r-- 1 mts mts 1014 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 14519 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 24417 2008-02-20 18:18 wiperPosix.c +-r--r--r-- 1 mts mts 1014 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 14571 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 24431 Apr 14 13:03 wiperPosix.c -open-vm-tools-2008.02.13-77928/libguestlib: +open-vm-tools-2008.04.14-87182/libguestlib: total 100 --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 1799 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 17089 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 1399 2008-02-20 18:18 stubs.c --r--r--r-- 1 mts mts 26204 2008-02-20 18:18 vmGuestLib.c --r--r--r-- 1 mts mts 4214 2008-02-20 18:18 vmGuestLibInt.h --r--r--r-- 1 mts mts 2422 2008-02-20 18:18 vmGuestLibPanic.c --r--r--r-- 1 mts mts 1533 2008-02-20 18:18 vmguestlib_version.h - -open-vm-tools-2008.02.13-77928/modules: +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1799 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 17141 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 1413 Apr 14 13:03 stubs.c +-r--r--r-- 1 mts mts 26218 Apr 14 13:03 vmGuestLib.c +-r--r--r-- 1 mts mts 4228 Apr 14 13:03 vmGuestLibInt.h +-r--r--r-- 1 mts mts 2436 Apr 14 13:03 vmGuestLibPanic.c +-r--r--r-- 1 mts mts 1547 Apr 14 13:03 vmguestlib_version.h + +open-vm-tools-2008.04.14-87182/modules: total 24 -drwxr-xr-x 6 mts mts 4096 2008-02-20 18:18 freebsd -drwxr-xr-x 7 mts mts 4096 2008-02-20 18:18 linux --rwxr-xr-x 1 mts mts 351 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 9721 2008-02-20 18:18 Makefile.in +-rwxr-xr-x 1 mts mts 351 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 9773 Apr 14 13:03 Makefile.in +drwxr-xr-x 6 mts mts 4096 Apr 14 13:03 freebsd +drwxr-xr-x 7 mts mts 4096 Apr 14 13:03 linux -open-vm-tools-2008.02.13-77928/modules/freebsd: +open-vm-tools-2008.04.14-87182/modules/freebsd: total 16 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmblock -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmhgfs -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 vmmemctl -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 vmxnet +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmblock +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmhgfs +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 vmmemctl +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 vmxnet -open-vm-tools-2008.02.13-77928/modules/freebsd/vmblock: +open-vm-tools-2008.04.14-87182/modules/freebsd/vmblock: total 220 --r--r--r-- 1 mts mts 17267 2008-02-20 18:18 block.c --r--r--r-- 1 mts mts 2375 2008-02-20 18:18 block.h --r--r--r-- 1 mts mts 1430 2008-02-20 18:18 COPYING.BSD --r--r--r-- 1 mts mts 9048 2008-02-20 18:18 dbllnklst.c --r--r--r-- 1 mts mts 3181 2008-02-20 18:18 dbllnklst.h --r--r--r-- 1 mts mts 0 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 2151 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 5980 2008-02-20 18:18 os.h --r--r--r-- 1 mts mts 2141 2008-02-20 18:18 stubs.c --r--r--r-- 1 mts mts 1888 2008-02-20 18:18 stubs.h --r--r--r-- 1 mts mts 19458 2008-02-20 18:18 subr.c --r--r--r-- 1 mts mts 13036 2008-02-20 18:18 vfsops.c --r--r--r-- 1 mts mts 10819 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 13110 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 22396 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 5091 2008-02-20 18:18 vmblock.h --r--r--r-- 1 mts mts 5872 2008-02-20 18:18 vmblock_k.h --r--r--r-- 1 mts mts 2720 2008-02-20 18:18 vmware.h --r--r--r-- 1 mts mts 45731 2008-02-20 18:18 vnops.c - -open-vm-tools-2008.02.13-77928/modules/freebsd/vmhgfs: -total 752 --r--r--r-- 1 mts mts 6383 2008-02-20 18:18 backdoor.c --r--r--r-- 1 mts mts 5797 2008-02-20 18:18 backdoor_def.h --r--r--r-- 1 mts mts 6174 2008-02-20 18:18 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-02-20 18:18 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-02-20 18:18 backdoor.h --r--r--r-- 1 mts mts 1032 2008-02-20 18:18 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-02-20 18:18 backdoor_types.h --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 12045 2008-02-20 18:18 cpName.c --r--r--r-- 1 mts mts 4174 2008-02-20 18:18 cpName.h --r--r--r-- 1 mts mts 1798 2008-02-20 18:18 cpNameInt.h --r--r--r-- 1 mts mts 5763 2008-02-20 18:18 cpNameLinux.c --r--r--r-- 1 mts mts 2642 2008-02-20 18:18 cpNameLite.c --r--r--r-- 1 mts mts 1710 2008-02-20 18:18 cpNameLite.h --r--r--r-- 1 mts mts 8217 2008-02-20 18:18 dbllnklst.c --r--r--r-- 1 mts mts 2350 2008-02-20 18:18 dbllnklst.h --r--r--r-- 1 mts mts 4115 2008-02-20 18:18 debug.c --r--r--r-- 1 mts mts 3358 2008-02-20 18:18 debug.h --r--r--r-- 1 mts mts 3832 2008-02-20 18:18 escBitvector.h --r--r--r-- 1 mts mts 24973 2008-02-20 18:18 fsutil.c --r--r--r-- 1 mts mts 3506 2008-02-20 18:18 fsutil.h --r--r--r-- 1 mts mts 2843 2008-02-20 18:18 guest_msg_def.h --r--r--r-- 1 mts mts 8689 2008-02-20 18:18 hgfsBd.c --r--r--r-- 1 mts mts 1450 2008-02-20 18:18 hgfsBd.h --r--r--r-- 1 mts mts 8386 2008-02-20 18:18 hgfs.h --r--r--r-- 1 mts mts 5685 2008-02-20 18:18 hgfs_kernel.h --r--r--r-- 1 mts mts 28745 2008-02-20 18:18 hgfsProto.h --r--r--r-- 1 mts mts 6822 2008-02-20 18:18 hgfsUtil.c --r--r--r-- 1 mts mts 3666 2008-02-20 18:18 hgfsUtil.h --r--r--r-- 1 mts mts 4262 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 6043 2008-02-20 18:18 kernelStubsBSD.c --r--r--r-- 1 mts mts 4911 2008-02-20 18:18 kernelStubs.h --r--r--r-- 1 mts mts 2652 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 17265 2008-02-20 18:18 messageBackdoor.c --r--r--r-- 1 mts mts 8254 2008-02-20 18:18 message.c --r--r--r-- 1 mts mts 3529 2008-02-20 18:18 message.h --r--r--r-- 1 mts mts 16112 2008-02-20 18:18 os.c --r--r--r-- 1 mts mts 4229 2008-02-20 18:18 os.h --r--r--r-- 1 mts mts 22355 2008-02-20 18:18 request.c --r--r--r-- 1 mts mts 3184 2008-02-20 18:18 request.h --r--r--r-- 1 mts mts 6298 2008-02-20 18:18 requestInt.h --r--r--r-- 1 mts mts 11670 2008-02-20 18:18 rpcout.c --r--r--r-- 1 mts mts 1963 2008-02-20 18:18 rpcout.h --r--r--r-- 1 mts mts 6472 2008-02-20 18:18 sha1.c --r--r--r-- 1 mts mts 2207 2008-02-20 18:18 sha1.h --r--r--r-- 1 mts mts 46011 2008-02-20 18:18 state.c --r--r--r-- 1 mts mts 6710 2008-02-20 18:18 state.h --r--r--r-- 1 mts mts 8823 2008-02-20 18:18 staticEscape.c --r--r--r-- 1 mts mts 2481 2008-02-20 18:18 staticEscape.h --r--r--r-- 1 mts mts 9540 2008-02-20 18:18 vfsops.c --r--r--r-- 1 mts mts 9988 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 17559 2008-02-20 18:18 vm_basic_asm.h --r--r--r-- 1 mts mts 8785 2008-02-20 18:18 vm_basic_asm_x86_64.h --r--r--r-- 1 mts mts 16043 2008-02-20 18:18 vm_basic_asm_x86.h --r--r--r-- 1 mts mts 12279 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 1889 2008-02-20 18:18 vmware.h --r--r--r-- 1 mts mts 1316 2008-02-20 18:18 vmware_pack_begin.h --r--r--r-- 1 mts mts 1336 2008-02-20 18:18 vmware_pack_end.h --r--r--r-- 1 mts mts 1956 2008-02-20 18:18 vmware_pack_init.h --r--r--r-- 1 mts mts 23185 2008-02-20 18:18 vnops.c --r--r--r-- 1 mts mts 77815 2008-02-20 18:18 vnopscommon.c --r--r--r-- 1 mts mts 3216 2008-02-20 18:18 vnopscommon.h --r--r--r-- 1 mts mts 6265 2008-02-20 18:18 worker.c --r--r--r-- 1 mts mts 33960 2008-02-20 18:18 x86cpuid.h - -open-vm-tools-2008.02.13-77928/modules/freebsd/vmmemctl: +-r--r--r-- 1 mts mts 1430 Apr 14 13:03 COPYING.BSD +-r--r--r-- 1 mts mts 2151 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 17267 Apr 14 13:03 block.c +-r--r--r-- 1 mts mts 2375 Apr 14 13:03 block.h +-r--r--r-- 1 mts mts 9048 Apr 14 13:03 dbllnklst.c +-r--r--r-- 1 mts mts 3181 Apr 14 13:03 dbllnklst.h +-r--r--r-- 1 mts mts 0 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 5980 Apr 14 13:03 os.h +-r--r--r-- 1 mts mts 2141 Apr 14 13:03 stubs.c +-r--r--r-- 1 mts mts 1888 Apr 14 13:03 stubs.h +-r--r--r-- 1 mts mts 19458 Apr 14 13:03 subr.c +-r--r--r-- 1 mts mts 13036 Apr 14 13:03 vfsops.c +-r--r--r-- 1 mts mts 10783 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 13013 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 22551 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 5091 Apr 14 13:03 vmblock.h +-r--r--r-- 1 mts mts 5872 Apr 14 13:03 vmblock_k.h +-r--r--r-- 1 mts mts 2720 Apr 14 13:03 vmware.h +-r--r--r-- 1 mts mts 45731 Apr 14 13:03 vnops.c + +open-vm-tools-2008.04.14-87182/modules/freebsd/vmhgfs: +total 760 +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 2652 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 6383 Apr 14 13:03 backdoor.c +-r--r--r-- 1 mts mts 1337 Apr 14 13:03 backdoor.h +-r--r--r-- 1 mts mts 6174 Apr 14 13:03 backdoorGcc32.c +-r--r--r-- 1 mts mts 5550 Apr 14 13:03 backdoorGcc64.c +-r--r--r-- 1 mts mts 1032 Apr 14 13:03 backdoorInt.h +-r--r--r-- 1 mts mts 5840 Apr 14 13:03 backdoor_def.h +-r--r--r-- 1 mts mts 3543 Apr 14 13:03 backdoor_types.h +-r--r--r-- 1 mts mts 12045 Apr 14 13:03 cpName.c +-r--r--r-- 1 mts mts 4174 Apr 14 13:03 cpName.h +-r--r--r-- 1 mts mts 1798 Apr 14 13:03 cpNameInt.h +-r--r--r-- 1 mts mts 5763 Apr 14 13:03 cpNameLinux.c +-r--r--r-- 1 mts mts 2642 Apr 14 13:03 cpNameLite.c +-r--r--r-- 1 mts mts 1710 Apr 14 13:03 cpNameLite.h +-r--r--r-- 1 mts mts 8217 Apr 14 13:03 dbllnklst.c +-r--r--r-- 1 mts mts 2350 Apr 14 13:03 dbllnklst.h +-r--r--r-- 1 mts mts 4769 Apr 14 13:03 debug.c +-r--r--r-- 1 mts mts 3358 Apr 14 13:03 debug.h +-r--r--r-- 1 mts mts 3832 Apr 14 13:03 escBitvector.h +-r--r--r-- 1 mts mts 25043 Apr 14 13:03 fsutil.c +-r--r--r-- 1 mts mts 3506 Apr 14 13:03 fsutil.h +-r--r--r-- 1 mts mts 2843 Apr 14 13:03 guest_msg_def.h +-r--r--r-- 1 mts mts 7008 Apr 14 13:03 hgfs.h +-r--r--r-- 1 mts mts 8689 Apr 14 13:03 hgfsBd.c +-r--r--r-- 1 mts mts 1450 Apr 14 13:03 hgfsBd.h +-r--r--r-- 1 mts mts 40081 Apr 14 13:03 hgfsProto.h +-r--r--r-- 1 mts mts 6822 Apr 14 13:03 hgfsUtil.c +-r--r--r-- 1 mts mts 3737 Apr 14 13:03 hgfsUtil.h +-r--r--r-- 1 mts mts 5685 Apr 14 13:03 hgfs_kernel.h +-r--r--r-- 1 mts mts 4262 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 4774 Apr 14 13:03 kernelStubs.h +-r--r--r-- 1 mts mts 6043 Apr 14 13:03 kernelStubsBSD.c +-r--r--r-- 1 mts mts 8254 Apr 14 13:03 message.c +-r--r--r-- 1 mts mts 3529 Apr 14 13:03 message.h +-r--r--r-- 1 mts mts 17265 Apr 14 13:03 messageBackdoor.c +-r--r--r-- 1 mts mts 16112 Apr 14 13:03 os.c +-r--r--r-- 1 mts mts 4229 Apr 14 13:03 os.h +-r--r--r-- 1 mts mts 22550 Apr 14 13:03 request.c +-r--r--r-- 1 mts mts 3184 Apr 14 13:03 request.h +-r--r--r-- 1 mts mts 6298 Apr 14 13:03 requestInt.h +-r--r--r-- 1 mts mts 11670 Apr 14 13:03 rpcout.c +-r--r--r-- 1 mts mts 1963 Apr 14 13:03 rpcout.h +-r--r--r-- 1 mts mts 6515 Apr 14 13:03 sha1.c +-r--r--r-- 1 mts mts 2207 Apr 14 13:03 sha1.h +-r--r--r-- 1 mts mts 46819 Apr 14 13:03 state.c +-r--r--r-- 1 mts mts 6710 Apr 14 13:03 state.h +-r--r--r-- 1 mts mts 8823 Apr 14 13:03 staticEscape.c +-r--r--r-- 1 mts mts 2481 Apr 14 13:03 staticEscape.h +-r--r--r-- 1 mts mts 9540 Apr 14 13:03 vfsops.c +-r--r--r-- 1 mts mts 9952 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 17697 Apr 14 13:03 vm_basic_asm.h +-r--r--r-- 1 mts mts 16079 Apr 14 13:03 vm_basic_asm_x86.h +-r--r--r-- 1 mts mts 8845 Apr 14 13:03 vm_basic_asm_x86_64.h +-r--r--r-- 1 mts mts 12182 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 1889 Apr 14 13:03 vmware.h +-r--r--r-- 1 mts mts 1316 Apr 14 13:03 vmware_pack_begin.h +-r--r--r-- 1 mts mts 1336 Apr 14 13:03 vmware_pack_end.h +-r--r--r-- 1 mts mts 1956 Apr 14 13:03 vmware_pack_init.h +-r--r--r-- 1 mts mts 23185 Apr 14 13:03 vnops.c +-r--r--r-- 1 mts mts 77726 Apr 14 13:03 vnopscommon.c +-r--r--r-- 1 mts mts 3216 Apr 14 13:03 vnopscommon.h +-r--r--r-- 1 mts mts 6265 Apr 14 13:03 worker.c +-r--r--r-- 1 mts mts 37595 Apr 14 13:03 x86cpuid.h + +open-vm-tools-2008.04.14-87182/modules/freebsd/vmmemctl: total 180 --r--r--r-- 1 mts mts 1338 2008-02-20 18:18 backdoor_balloon.h --r--r--r-- 1 mts mts 6174 2008-02-20 18:18 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-02-20 18:18 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-02-20 18:18 backdoor.h --r--r--r-- 1 mts mts 1032 2008-02-20 18:18 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-02-20 18:18 backdoor_types.h --r--r--r-- 1 mts mts 2622 2008-02-20 18:18 balloon_def.h --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 4262 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 1259 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 10240 2008-02-20 18:18 os.c --r--r--r-- 1 mts mts 2441 2008-02-20 18:18 os.h --r--r--r-- 1 mts mts 430 2008-02-20 18:18 README --r--r--r-- 1 mts mts 9988 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 37545 2008-02-20 18:18 vmballoon.c --r--r--r-- 1 mts mts 2048 2008-02-20 18:18 vmballoon.h --r--r--r-- 1 mts mts 12279 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h - -open-vm-tools-2008.02.13-77928/modules/freebsd/vmxnet: +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1259 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 430 Apr 14 13:03 README +-r--r--r-- 1 mts mts 1337 Apr 14 13:03 backdoor.h +-r--r--r-- 1 mts mts 6174 Apr 14 13:03 backdoorGcc32.c +-r--r--r-- 1 mts mts 5550 Apr 14 13:03 backdoorGcc64.c +-r--r--r-- 1 mts mts 1032 Apr 14 13:03 backdoorInt.h +-r--r--r-- 1 mts mts 1338 Apr 14 13:03 backdoor_balloon.h +-r--r--r-- 1 mts mts 3543 Apr 14 13:03 backdoor_types.h +-r--r--r-- 1 mts mts 2622 Apr 14 13:03 balloon_def.h +-r--r--r-- 1 mts mts 4262 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 10240 Apr 14 13:03 os.c +-r--r--r-- 1 mts mts 2441 Apr 14 13:03 os.h +-r--r--r-- 1 mts mts 9952 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 12182 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 37545 Apr 14 13:03 vmballoon.c +-r--r--r-- 1 mts mts 2048 Apr 14 13:03 vmballoon.h + +open-vm-tools-2008.04.14-87182/modules/freebsd/vmxnet: total 140 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autoconf --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 34864 2008-02-20 18:18 if_vxn.c --r--r--r-- 1 mts mts 0 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 1222 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 6404 2008-02-20 18:18 net_compat.h --r--r--r-- 1 mts mts 2426 2008-02-20 18:18 net.h --r--r--r-- 1 mts mts 2240 2008-02-20 18:18 net_sg.h --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 6899 2008-02-20 18:18 vm_device_version.h --r--r--r-- 1 mts mts 2816 2008-02-20 18:18 vmnet_def.h --r--r--r-- 1 mts mts 14595 2008-02-20 18:18 vmxnet2_def.h --r--r--r-- 1 mts mts 6793 2008-02-20 18:18 vmxnet_def.h - -open-vm-tools-2008.02.13-77928/modules/freebsd/vmxnet/autoconf: +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1222 Apr 14 13:03 Makefile +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autoconf +-r--r--r-- 1 mts mts 35544 Apr 14 13:03 if_vxn.c +-r--r--r-- 1 mts mts 0 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 2426 Apr 14 13:03 net.h +-r--r--r-- 1 mts mts 6515 Apr 14 13:03 net_compat.h +-r--r--r-- 1 mts mts 2240 Apr 14 13:03 net_sg.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 7137 Apr 14 13:03 vm_device_version.h +-r--r--r-- 1 mts mts 2915 Apr 14 13:03 vmnet_def.h +-r--r--r-- 1 mts mts 14595 Apr 14 13:03 vmxnet2_def.h +-r--r--r-- 1 mts mts 6793 Apr 14 13:03 vmxnet_def.h + +open-vm-tools-2008.04.14-87182/modules/freebsd/vmxnet/autoconf: total 0 -open-vm-tools-2008.02.13-77928/modules/linux: +open-vm-tools-2008.04.14-87182/modules/linux: total 20 -drwxr-xr-x 5 mts mts 4096 2008-02-20 18:18 vmblock -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 vmhgfs -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 vmmemctl -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 vmsync -drwxr-xr-x 3 mts mts 4096 2008-02-20 18:18 vmxnet +drwxr-xr-x 5 mts mts 4096 Apr 14 13:03 vmblock +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 vmhgfs +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 vmmemctl +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 vmsync +drwxr-xr-x 3 mts mts 4096 Apr 14 13:03 vmxnet -open-vm-tools-2008.02.13-77928/modules/linux/vmblock: +open-vm-tools-2008.04.14-87182/modules/linux/vmblock: total 52 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autoconf --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 include -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 linux --r--r--r-- 1 mts mts 3761 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 2009 2008-02-20 18:18 Makefile.kernel --r--r--r-- 1 mts mts 4136 2008-02-20 18:18 Makefile.normal --r--r--r-- 1 mts mts 481 2008-02-20 18:18 README - -open-vm-tools-2008.02.13-77928/modules/linux/vmblock/autoconf: +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3761 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 2009 Apr 14 13:03 Makefile.kernel +-r--r--r-- 1 mts mts 4136 Apr 14 13:03 Makefile.normal +-r--r--r-- 1 mts mts 481 Apr 14 13:03 README +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autoconf +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 include +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 linux + +open-vm-tools-2008.04.14-87182/modules/linux/vmblock/autoconf: total 36 --r--r--r-- 1 mts mts 1670 2008-02-20 18:18 cachecreate.c --r--r--r-- 1 mts mts 1718 2008-02-20 18:18 cachector.c --r--r--r-- 1 mts mts 1261 2008-02-20 18:18 epoll.c --r--r--r-- 1 mts mts 1710 2008-02-20 18:18 filldir1.c --r--r--r-- 1 mts mts 1204 2008-02-20 18:18 geninclude.c --r--r--r-- 1 mts mts 1596 2008-02-20 18:18 getsb1.c --r--r--r-- 1 mts mts 1139 2008-02-20 18:18 setnice.c --r--r--r-- 1 mts mts 1259 2008-02-20 18:18 skas1.c --r--r--r-- 1 mts mts 1463 2008-02-20 18:18 statfs1.c - -open-vm-tools-2008.02.13-77928/modules/linux/vmblock/include: +-r--r--r-- 1 mts mts 1670 Apr 14 13:03 cachecreate.c +-r--r--r-- 1 mts mts 1718 Apr 14 13:03 cachector.c +-r--r--r-- 1 mts mts 1261 Apr 14 13:03 epoll.c +-r--r--r-- 1 mts mts 1710 Apr 14 13:03 filldir1.c +-r--r--r-- 1 mts mts 1204 Apr 14 13:03 geninclude.c +-r--r--r-- 1 mts mts 1596 Apr 14 13:03 getsb1.c +-r--r--r-- 1 mts mts 1139 Apr 14 13:03 setnice.c +-r--r--r-- 1 mts mts 1259 Apr 14 13:03 skas1.c +-r--r--r-- 1 mts mts 1463 Apr 14 13:03 statfs1.c + +open-vm-tools-2008.04.14-87182/modules/linux/vmblock/include: total 168 --r--r--r-- 1 mts mts 6088 2008-02-20 18:18 compat_completion.h --r--r--r-- 1 mts mts 1875 2008-02-20 18:18 compat_file.h --r--r--r-- 1 mts mts 9630 2008-02-20 18:18 compat_fs.h --r--r--r-- 1 mts mts 1261 2008-02-20 18:18 compat_init.h --r--r--r-- 1 mts mts 2439 2008-02-20 18:18 compat_kernel.h --r--r--r-- 1 mts mts 1917 2008-02-20 18:18 compat_list.h --r--r--r-- 1 mts mts 4231 2008-02-20 18:18 compat_mm.h --r--r--r-- 1 mts mts 2298 2008-02-20 18:18 compat_module.h --r--r--r-- 1 mts mts 1570 2008-02-20 18:18 compat_namei.h --r--r--r-- 1 mts mts 2483 2008-02-20 18:18 compat_page.h --r--r--r-- 1 mts mts 9740 2008-02-20 18:18 compat_sched.h --r--r--r-- 1 mts mts 1456 2008-02-20 18:18 compat_semaphore.h --r--r--r-- 1 mts mts 2764 2008-02-20 18:18 compat_slab.h --r--r--r-- 1 mts mts 2438 2008-02-20 18:18 compat_spinlock.h --r--r--r-- 1 mts mts 1222 2008-02-20 18:18 compat_statfs.h --r--r--r-- 1 mts mts 1907 2008-02-20 18:18 compat_string.h --r--r--r-- 1 mts mts 3122 2008-02-20 18:18 compat_uaccess.h --r--r--r-- 1 mts mts 3189 2008-02-20 18:18 compat_version.h --r--r--r-- 1 mts mts 6854 2008-02-20 18:18 compat_wait.h --r--r--r-- 1 mts mts 2216 2008-02-20 18:18 driver-config.h --r--r--r-- 1 mts mts 0 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 9988 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 12279 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 4260 2008-02-20 18:18 vmblock.h --r--r--r-- 1 mts mts 1889 2008-02-20 18:18 vmware.h - -open-vm-tools-2008.02.13-77928/modules/linux/vmblock/linux: +-r--r--r-- 1 mts mts 6088 Apr 14 13:03 compat_completion.h +-r--r--r-- 1 mts mts 1875 Apr 14 13:03 compat_file.h +-r--r--r-- 1 mts mts 9850 Apr 14 13:03 compat_fs.h +-r--r--r-- 1 mts mts 1261 Apr 14 13:03 compat_init.h +-r--r--r-- 1 mts mts 2659 Apr 14 13:03 compat_kernel.h +-r--r--r-- 1 mts mts 1917 Apr 14 13:03 compat_list.h +-r--r--r-- 1 mts mts 4231 Apr 14 13:03 compat_mm.h +-r--r--r-- 1 mts mts 2298 Apr 14 13:03 compat_module.h +-r--r--r-- 1 mts mts 2118 Apr 14 13:03 compat_namei.h +-r--r--r-- 1 mts mts 2483 Apr 14 13:03 compat_page.h +-r--r--r-- 1 mts mts 9843 Apr 14 13:03 compat_sched.h +-r--r--r-- 1 mts mts 1456 Apr 14 13:03 compat_semaphore.h +-r--r--r-- 1 mts mts 2764 Apr 14 13:03 compat_slab.h +-r--r--r-- 1 mts mts 2438 Apr 14 13:03 compat_spinlock.h +-r--r--r-- 1 mts mts 1222 Apr 14 13:03 compat_statfs.h +-r--r--r-- 1 mts mts 1907 Apr 14 13:03 compat_string.h +-r--r--r-- 1 mts mts 3122 Apr 14 13:03 compat_uaccess.h +-r--r--r-- 1 mts mts 3189 Apr 14 13:03 compat_version.h +-r--r--r-- 1 mts mts 6854 Apr 14 13:03 compat_wait.h +-r--r--r-- 1 mts mts 2216 Apr 14 13:03 driver-config.h +-r--r--r-- 1 mts mts 0 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 9952 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 12182 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 4260 Apr 14 13:03 vmblock.h +-r--r--r-- 1 mts mts 1889 Apr 14 13:03 vmware.h + +open-vm-tools-2008.04.14-87182/modules/linux/vmblock/linux: total 140 --r--r--r-- 1 mts mts 16436 2008-02-20 18:18 block.c --r--r--r-- 1 mts mts 1544 2008-02-20 18:18 block.h --r--r--r-- 1 mts mts 8894 2008-02-20 18:18 control.c --r--r--r-- 1 mts mts 8217 2008-02-20 18:18 dbllnklst.c --r--r--r-- 1 mts mts 2350 2008-02-20 18:18 dbllnklst.h --r--r--r-- 1 mts mts 3697 2008-02-20 18:18 dentry.c --r--r--r-- 1 mts mts 8089 2008-02-20 18:18 file.c --r--r--r-- 1 mts mts 17930 2008-02-20 18:18 filesystem.c --r--r--r-- 1 mts mts 4812 2008-02-20 18:18 filesystem.h --r--r--r-- 1 mts mts 6794 2008-02-20 18:18 inode.c --r--r--r-- 1 mts mts 4286 2008-02-20 18:18 module.c --r--r--r-- 1 mts mts 4292 2008-02-20 18:18 os.h --r--r--r-- 1 mts mts 1310 2008-02-20 18:18 stubs.c --r--r--r-- 1 mts mts 1057 2008-02-20 18:18 stubs.h --r--r--r-- 1 mts mts 4793 2008-02-20 18:18 super.c --r--r--r-- 1 mts mts 3399 2008-02-20 18:18 vmblockInt.h --r--r--r-- 1 mts mts 1176 2008-02-20 18:18 vmblock_version.h - -open-vm-tools-2008.02.13-77928/modules/linux/vmhgfs: -total 872 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autoconf --r--r--r-- 1 mts mts 6383 2008-02-20 18:18 backdoor.c --r--r--r-- 1 mts mts 5797 2008-02-20 18:18 backdoor_def.h --r--r--r-- 1 mts mts 6174 2008-02-20 18:18 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-02-20 18:18 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-02-20 18:18 backdoor.h --r--r--r-- 1 mts mts 1032 2008-02-20 18:18 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-02-20 18:18 backdoor_types.h --r--r--r-- 1 mts mts 8591 2008-02-20 18:18 bdhandler.c --r--r--r-- 1 mts mts 1167 2008-02-20 18:18 bdhandler.h --r--r--r-- 1 mts mts 6088 2008-02-20 18:18 compat_completion.h --r--r--r-- 1 mts mts 2052 2008-02-20 18:18 compat_dcache.h --r--r--r-- 1 mts mts 1875 2008-02-20 18:18 compat_file.h --r--r--r-- 1 mts mts 9630 2008-02-20 18:18 compat_fs.h --r--r--r-- 1 mts mts 1391 2008-02-20 18:18 compat_highmem.h --r--r--r-- 1 mts mts 2439 2008-02-20 18:18 compat_kernel.h --r--r--r-- 1 mts mts 1917 2008-02-20 18:18 compat_list.h --r--r--r-- 1 mts mts 4231 2008-02-20 18:18 compat_mm.h --r--r--r-- 1 mts mts 2298 2008-02-20 18:18 compat_module.h --r--r--r-- 1 mts mts 1570 2008-02-20 18:18 compat_namei.h --r--r--r-- 1 mts mts 2591 2008-02-20 18:18 compat_page-flags.h --r--r--r-- 1 mts mts 2483 2008-02-20 18:18 compat_page.h --r--r--r-- 1 mts mts 9740 2008-02-20 18:18 compat_sched.h --r--r--r-- 1 mts mts 1456 2008-02-20 18:18 compat_semaphore.h --r--r--r-- 1 mts mts 2764 2008-02-20 18:18 compat_slab.h --r--r--r-- 1 mts mts 2438 2008-02-20 18:18 compat_spinlock.h --r--r--r-- 1 mts mts 1222 2008-02-20 18:18 compat_statfs.h --r--r--r-- 1 mts mts 1907 2008-02-20 18:18 compat_string.h --r--r--r-- 1 mts mts 3122 2008-02-20 18:18 compat_uaccess.h --r--r--r-- 1 mts mts 3189 2008-02-20 18:18 compat_version.h --r--r--r-- 1 mts mts 6854 2008-02-20 18:18 compat_wait.h --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 12045 2008-02-20 18:18 cpName.c --r--r--r-- 1 mts mts 4174 2008-02-20 18:18 cpName.h --r--r--r-- 1 mts mts 1798 2008-02-20 18:18 cpNameInt.h --r--r--r-- 1 mts mts 5763 2008-02-20 18:18 cpNameLinux.c --r--r--r-- 1 mts mts 2642 2008-02-20 18:18 cpNameLite.c --r--r--r-- 1 mts mts 1710 2008-02-20 18:18 cpNameLite.h --r--r--r-- 1 mts mts 2350 2008-02-20 18:18 dbllnklst.h --r--r--r-- 1 mts mts 3112 2008-02-20 18:18 dentry.c --r--r--r-- 1 mts mts 22879 2008-02-20 18:18 dir.c --r--r--r-- 1 mts mts 2216 2008-02-20 18:18 driver-config.h --r--r--r-- 1 mts mts 3832 2008-02-20 18:18 escBitvector.h --r--r--r-- 1 mts mts 33249 2008-02-20 18:18 file.c --r--r--r-- 1 mts mts 20297 2008-02-20 18:18 filesystem.c --r--r--r-- 1 mts mts 1233 2008-02-20 18:18 filesystem.h --r--r--r-- 1 mts mts 51699 2008-02-20 18:18 fsutil.c --r--r--r-- 1 mts mts 3874 2008-02-20 18:18 fsutil.h --r--r--r-- 1 mts mts 2843 2008-02-20 18:18 guest_msg_def.h --r--r--r-- 1 mts mts 8689 2008-02-20 18:18 hgfsBd.c --r--r--r-- 1 mts mts 1450 2008-02-20 18:18 hgfsBd.h --r--r--r-- 1 mts mts 2535 2008-02-20 18:18 hgfsDevLinux.h --r--r--r-- 1 mts mts 8386 2008-02-20 18:18 hgfs.h --r--r--r-- 1 mts mts 28745 2008-02-20 18:18 hgfsProto.h --r--r--r-- 1 mts mts 6822 2008-02-20 18:18 hgfsUtil.c --r--r--r-- 1 mts mts 3666 2008-02-20 18:18 hgfsUtil.h --r--r--r-- 1 mts mts 4262 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 53031 2008-02-20 18:18 inode.c --r--r--r-- 1 mts mts 1318 2008-02-20 18:18 inode.h --r--r--r-- 1 mts mts 4911 2008-02-20 18:18 kernelStubs.h --r--r--r-- 1 mts mts 9816 2008-02-20 18:18 kernelStubsLinux.c --r--r--r-- 1 mts mts 5304 2008-02-20 18:18 link.c --r--r--r-- 1 mts mts 3760 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 2291 2008-02-20 18:18 Makefile.kernel --r--r--r-- 1 mts mts 3429 2008-02-20 18:18 Makefile.normal --r--r--r-- 1 mts mts 17265 2008-02-20 18:18 messageBackdoor.c --r--r--r-- 1 mts mts 8254 2008-02-20 18:18 message.c --r--r--r-- 1 mts mts 3529 2008-02-20 18:18 message.h --r--r--r-- 1 mts mts 2677 2008-02-20 18:18 module.c --r--r--r-- 1 mts mts 8600 2008-02-20 18:18 module.h --r--r--r-- 1 mts mts 24467 2008-02-20 18:18 page.c --r--r--r-- 1 mts mts 6535 2008-02-20 18:18 request.c --r--r--r-- 1 mts mts 3690 2008-02-20 18:18 request.h --r--r--r-- 1 mts mts 11670 2008-02-20 18:18 rpcout.c --r--r--r-- 1 mts mts 1963 2008-02-20 18:18 rpcout.h --r--r--r-- 1 mts mts 8823 2008-02-20 18:18 staticEscape.c --r--r--r-- 1 mts mts 2481 2008-02-20 18:18 staticEscape.h --r--r--r-- 1 mts mts 1985 2008-02-20 18:18 stubs.c --r--r--r-- 1 mts mts 10699 2008-02-20 18:18 super.c --r--r--r-- 1 mts mts 9988 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 17559 2008-02-20 18:18 vm_basic_asm.h --r--r--r-- 1 mts mts 8785 2008-02-20 18:18 vm_basic_asm_x86_64.h --r--r--r-- 1 mts mts 16043 2008-02-20 18:18 vm_basic_asm_x86.h --r--r--r-- 1 mts mts 12279 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 1168 2008-02-20 18:18 vmhgfs_version.h --r--r--r-- 1 mts mts 1889 2008-02-20 18:18 vmware.h --r--r--r-- 1 mts mts 1316 2008-02-20 18:18 vmware_pack_begin.h --r--r--r-- 1 mts mts 1336 2008-02-20 18:18 vmware_pack_end.h --r--r--r-- 1 mts mts 1956 2008-02-20 18:18 vmware_pack_init.h --r--r--r-- 1 mts mts 33960 2008-02-20 18:18 x86cpuid.h - -open-vm-tools-2008.02.13-77928/modules/linux/vmhgfs/autoconf: +-r--r--r-- 1 mts mts 16436 Apr 14 13:03 block.c +-r--r--r-- 1 mts mts 1544 Apr 14 13:03 block.h +-r--r--r-- 1 mts mts 8894 Apr 14 13:03 control.c +-r--r--r-- 1 mts mts 8217 Apr 14 13:03 dbllnklst.c +-r--r--r-- 1 mts mts 2350 Apr 14 13:03 dbllnklst.h +-r--r--r-- 1 mts mts 3749 Apr 14 13:03 dentry.c +-r--r--r-- 1 mts mts 8089 Apr 14 13:03 file.c +-r--r--r-- 1 mts mts 20088 Apr 14 13:03 filesystem.c +-r--r--r-- 1 mts mts 4856 Apr 14 13:03 filesystem.h +-r--r--r-- 1 mts mts 6794 Apr 14 13:03 inode.c +-r--r--r-- 1 mts mts 4286 Apr 14 13:03 module.c +-r--r--r-- 1 mts mts 4292 Apr 14 13:03 os.h +-r--r--r-- 1 mts mts 1310 Apr 14 13:03 stubs.c +-r--r--r-- 1 mts mts 1057 Apr 14 13:03 stubs.h +-r--r--r-- 1 mts mts 5026 Apr 14 13:03 super.c +-r--r--r-- 1 mts mts 3399 Apr 14 13:03 vmblockInt.h +-r--r--r-- 1 mts mts 1176 Apr 14 13:03 vmblock_version.h + +open-vm-tools-2008.04.14-87182/modules/linux/vmhgfs: +total 916 +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3760 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 2291 Apr 14 13:03 Makefile.kernel +-r--r--r-- 1 mts mts 3429 Apr 14 13:03 Makefile.normal +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autoconf +-r--r--r-- 1 mts mts 6383 Apr 14 13:03 backdoor.c +-r--r--r-- 1 mts mts 1337 Apr 14 13:03 backdoor.h +-r--r--r-- 1 mts mts 6174 Apr 14 13:03 backdoorGcc32.c +-r--r--r-- 1 mts mts 5550 Apr 14 13:03 backdoorGcc64.c +-r--r--r-- 1 mts mts 1032 Apr 14 13:03 backdoorInt.h +-r--r--r-- 1 mts mts 5840 Apr 14 13:03 backdoor_def.h +-r--r--r-- 1 mts mts 3543 Apr 14 13:03 backdoor_types.h +-r--r--r-- 1 mts mts 8759 Apr 14 13:03 bdhandler.c +-r--r--r-- 1 mts mts 1167 Apr 14 13:03 bdhandler.h +-r--r--r-- 1 mts mts 6088 Apr 14 13:03 compat_completion.h +-r--r--r-- 1 mts mts 2052 Apr 14 13:03 compat_dcache.h +-r--r--r-- 1 mts mts 1875 Apr 14 13:03 compat_file.h +-r--r--r-- 1 mts mts 9850 Apr 14 13:03 compat_fs.h +-r--r--r-- 1 mts mts 1391 Apr 14 13:03 compat_highmem.h +-r--r--r-- 1 mts mts 2659 Apr 14 13:03 compat_kernel.h +-r--r--r-- 1 mts mts 8066 Apr 14 13:03 compat_kthread.h +-r--r--r-- 1 mts mts 1917 Apr 14 13:03 compat_list.h +-r--r--r-- 1 mts mts 4231 Apr 14 13:03 compat_mm.h +-r--r--r-- 1 mts mts 2298 Apr 14 13:03 compat_module.h +-r--r--r-- 1 mts mts 2118 Apr 14 13:03 compat_namei.h +-r--r--r-- 1 mts mts 2591 Apr 14 13:03 compat_page-flags.h +-r--r--r-- 1 mts mts 2483 Apr 14 13:03 compat_page.h +-r--r--r-- 1 mts mts 9843 Apr 14 13:03 compat_sched.h +-r--r--r-- 1 mts mts 1456 Apr 14 13:03 compat_semaphore.h +-r--r--r-- 1 mts mts 2764 Apr 14 13:03 compat_slab.h +-r--r--r-- 1 mts mts 2438 Apr 14 13:03 compat_spinlock.h +-r--r--r-- 1 mts mts 1222 Apr 14 13:03 compat_statfs.h +-r--r--r-- 1 mts mts 1907 Apr 14 13:03 compat_string.h +-r--r--r-- 1 mts mts 3122 Apr 14 13:03 compat_uaccess.h +-r--r--r-- 1 mts mts 3189 Apr 14 13:03 compat_version.h +-r--r--r-- 1 mts mts 6854 Apr 14 13:03 compat_wait.h +-r--r--r-- 1 mts mts 12045 Apr 14 13:03 cpName.c +-r--r--r-- 1 mts mts 4174 Apr 14 13:03 cpName.h +-r--r--r-- 1 mts mts 1798 Apr 14 13:03 cpNameInt.h +-r--r--r-- 1 mts mts 5763 Apr 14 13:03 cpNameLinux.c +-r--r--r-- 1 mts mts 2642 Apr 14 13:03 cpNameLite.c +-r--r--r-- 1 mts mts 1710 Apr 14 13:03 cpNameLite.h +-r--r--r-- 1 mts mts 2350 Apr 14 13:03 dbllnklst.h +-r--r--r-- 1 mts mts 3112 Apr 14 13:03 dentry.c +-r--r--r-- 1 mts mts 27830 Apr 14 13:03 dir.c +-r--r--r-- 1 mts mts 2216 Apr 14 13:03 driver-config.h +-r--r--r-- 1 mts mts 3832 Apr 14 13:03 escBitvector.h +-r--r--r-- 1 mts mts 36564 Apr 14 13:03 file.c +-r--r--r-- 1 mts mts 20296 Apr 14 13:03 filesystem.c +-r--r--r-- 1 mts mts 1233 Apr 14 13:03 filesystem.h +-r--r--r-- 1 mts mts 57085 Apr 14 13:03 fsutil.c +-r--r--r-- 1 mts mts 3981 Apr 14 13:03 fsutil.h +-r--r--r-- 1 mts mts 2843 Apr 14 13:03 guest_msg_def.h +-r--r--r-- 1 mts mts 7008 Apr 14 13:03 hgfs.h +-r--r--r-- 1 mts mts 8689 Apr 14 13:03 hgfsBd.c +-r--r--r-- 1 mts mts 1450 Apr 14 13:03 hgfsBd.h +-r--r--r-- 1 mts mts 2535 Apr 14 13:03 hgfsDevLinux.h +-r--r--r-- 1 mts mts 40081 Apr 14 13:03 hgfsProto.h +-r--r--r-- 1 mts mts 6822 Apr 14 13:03 hgfsUtil.c +-r--r--r-- 1 mts mts 3737 Apr 14 13:03 hgfsUtil.h +-r--r--r-- 1 mts mts 4262 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 62568 Apr 14 13:03 inode.c +-r--r--r-- 1 mts mts 1318 Apr 14 13:03 inode.h +-r--r--r-- 1 mts mts 4774 Apr 14 13:03 kernelStubs.h +-r--r--r-- 1 mts mts 9629 Apr 14 13:03 kernelStubsLinux.c +-r--r--r-- 1 mts mts 5304 Apr 14 13:03 link.c +-r--r--r-- 1 mts mts 8254 Apr 14 13:03 message.c +-r--r--r-- 1 mts mts 3529 Apr 14 13:03 message.h +-r--r--r-- 1 mts mts 17265 Apr 14 13:03 messageBackdoor.c +-r--r--r-- 1 mts mts 2677 Apr 14 13:03 module.c +-r--r--r-- 1 mts mts 8784 Apr 14 13:03 module.h +-r--r--r-- 1 mts mts 27169 Apr 14 13:03 page.c +-r--r--r-- 1 mts mts 7040 Apr 14 13:03 request.c +-r--r--r-- 1 mts mts 3959 Apr 14 13:03 request.h +-r--r--r-- 1 mts mts 11670 Apr 14 13:03 rpcout.c +-r--r--r-- 1 mts mts 1963 Apr 14 13:03 rpcout.h +-r--r--r-- 1 mts mts 8823 Apr 14 13:03 staticEscape.c +-r--r--r-- 1 mts mts 2481 Apr 14 13:03 staticEscape.h +-r--r--r-- 1 mts mts 1985 Apr 14 13:03 stubs.c +-r--r--r-- 1 mts mts 12757 Apr 14 13:03 super.c +-r--r--r-- 1 mts mts 9952 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 17697 Apr 14 13:03 vm_basic_asm.h +-r--r--r-- 1 mts mts 16079 Apr 14 13:03 vm_basic_asm_x86.h +-r--r--r-- 1 mts mts 8845 Apr 14 13:03 vm_basic_asm_x86_64.h +-r--r--r-- 1 mts mts 12182 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 1168 Apr 14 13:03 vmhgfs_version.h +-r--r--r-- 1 mts mts 1889 Apr 14 13:03 vmware.h +-r--r--r-- 1 mts mts 1316 Apr 14 13:03 vmware_pack_begin.h +-r--r--r-- 1 mts mts 1336 Apr 14 13:03 vmware_pack_end.h +-r--r--r-- 1 mts mts 1956 Apr 14 13:03 vmware_pack_init.h +-r--r--r-- 1 mts mts 37595 Apr 14 13:03 x86cpuid.h + +open-vm-tools-2008.04.14-87182/modules/linux/vmhgfs/autoconf: total 36 --r--r--r-- 1 mts mts 1670 2008-02-20 18:18 cachecreate.c --r--r--r-- 1 mts mts 1718 2008-02-20 18:18 cachector.c --r--r--r-- 1 mts mts 1261 2008-02-20 18:18 epoll.c --r--r--r-- 1 mts mts 1204 2008-02-20 18:18 geninclude.c --r--r--r-- 1 mts mts 1596 2008-02-20 18:18 getsb1.c --r--r--r-- 1 mts mts 1473 2008-02-20 18:18 inode1.c --r--r--r-- 1 mts mts 1345 2008-02-20 18:18 maxbytes.c --r--r--r-- 1 mts mts 1139 2008-02-20 18:18 setnice.c --r--r--r-- 1 mts mts 1463 2008-02-20 18:18 statfs1.c - -open-vm-tools-2008.02.13-77928/modules/linux/vmmemctl: +-r--r--r-- 1 mts mts 1670 Apr 14 13:03 cachecreate.c +-r--r--r-- 1 mts mts 1718 Apr 14 13:03 cachector.c +-r--r--r-- 1 mts mts 1261 Apr 14 13:03 epoll.c +-r--r--r-- 1 mts mts 1204 Apr 14 13:03 geninclude.c +-r--r--r-- 1 mts mts 1596 Apr 14 13:03 getsb1.c +-r--r--r-- 1 mts mts 1473 Apr 14 13:03 inode1.c +-r--r--r-- 1 mts mts 1345 Apr 14 13:03 maxbytes.c +-r--r--r-- 1 mts mts 1139 Apr 14 13:03 setnice.c +-r--r--r-- 1 mts mts 1463 Apr 14 13:03 statfs1.c + +open-vm-tools-2008.04.14-87182/modules/linux/vmmemctl: total 280 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autoconf --r--r--r-- 1 mts mts 1338 2008-02-20 18:18 backdoor_balloon.h --r--r--r-- 1 mts mts 5797 2008-02-20 18:18 backdoor_def.h --r--r--r-- 1 mts mts 6174 2008-02-20 18:18 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-02-20 18:18 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-02-20 18:18 backdoor.h --r--r--r-- 1 mts mts 1032 2008-02-20 18:18 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-02-20 18:18 backdoor_types.h --r--r--r-- 1 mts mts 2622 2008-02-20 18:18 balloon_def.h --r--r--r-- 1 mts mts 6088 2008-02-20 18:18 compat_completion.h --r--r--r-- 1 mts mts 1875 2008-02-20 18:18 compat_file.h --r--r--r-- 1 mts mts 2439 2008-02-20 18:18 compat_kernel.h --r--r--r-- 1 mts mts 1917 2008-02-20 18:18 compat_list.h --r--r--r-- 1 mts mts 4231 2008-02-20 18:18 compat_mm.h --r--r--r-- 1 mts mts 2298 2008-02-20 18:18 compat_module.h --r--r--r-- 1 mts mts 2483 2008-02-20 18:18 compat_page.h --r--r--r-- 1 mts mts 9740 2008-02-20 18:18 compat_sched.h --r--r--r-- 1 mts mts 1456 2008-02-20 18:18 compat_semaphore.h --r--r--r-- 1 mts mts 2438 2008-02-20 18:18 compat_spinlock.h --r--r--r-- 1 mts mts 3189 2008-02-20 18:18 compat_version.h --r--r--r-- 1 mts mts 6854 2008-02-20 18:18 compat_wait.h --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 2216 2008-02-20 18:18 driver-config.h --r--r--r-- 1 mts mts 4262 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 3762 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 1696 2008-02-20 18:18 Makefile.kernel --r--r--r-- 1 mts mts 2868 2008-02-20 18:18 Makefile.normal --r--r--r-- 1 mts mts 14180 2008-02-20 18:18 os.c --r--r--r-- 1 mts mts 2441 2008-02-20 18:18 os.h --r--r--r-- 1 mts mts 453 2008-02-20 18:18 README --r--r--r-- 1 mts mts 9988 2008-02-20 18:18 vm_assert.h --r--r--r-- 1 mts mts 37545 2008-02-20 18:18 vmballoon.c --r--r--r-- 1 mts mts 2048 2008-02-20 18:18 vmballoon.h --r--r--r-- 1 mts mts 12279 2008-02-20 18:18 vm_basic_defs.h --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 1193 2008-02-20 18:18 vmmemctl_version.h - -open-vm-tools-2008.02.13-77928/modules/linux/vmmemctl/autoconf: +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3762 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 1696 Apr 14 13:03 Makefile.kernel +-r--r--r-- 1 mts mts 2868 Apr 14 13:03 Makefile.normal +-r--r--r-- 1 mts mts 453 Apr 14 13:03 README +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autoconf +-r--r--r-- 1 mts mts 1337 Apr 14 13:03 backdoor.h +-r--r--r-- 1 mts mts 6174 Apr 14 13:03 backdoorGcc32.c +-r--r--r-- 1 mts mts 5550 Apr 14 13:03 backdoorGcc64.c +-r--r--r-- 1 mts mts 1032 Apr 14 13:03 backdoorInt.h +-r--r--r-- 1 mts mts 1338 Apr 14 13:03 backdoor_balloon.h +-r--r--r-- 1 mts mts 5840 Apr 14 13:03 backdoor_def.h +-r--r--r-- 1 mts mts 3543 Apr 14 13:03 backdoor_types.h +-r--r--r-- 1 mts mts 2622 Apr 14 13:03 balloon_def.h +-r--r--r-- 1 mts mts 6088 Apr 14 13:03 compat_completion.h +-r--r--r-- 1 mts mts 1875 Apr 14 13:03 compat_file.h +-r--r--r-- 1 mts mts 2659 Apr 14 13:03 compat_kernel.h +-r--r--r-- 1 mts mts 1917 Apr 14 13:03 compat_list.h +-r--r--r-- 1 mts mts 4231 Apr 14 13:03 compat_mm.h +-r--r--r-- 1 mts mts 2298 Apr 14 13:03 compat_module.h +-r--r--r-- 1 mts mts 2483 Apr 14 13:03 compat_page.h +-r--r--r-- 1 mts mts 9843 Apr 14 13:03 compat_sched.h +-r--r--r-- 1 mts mts 1456 Apr 14 13:03 compat_semaphore.h +-r--r--r-- 1 mts mts 2438 Apr 14 13:03 compat_spinlock.h +-r--r--r-- 1 mts mts 3189 Apr 14 13:03 compat_version.h +-r--r--r-- 1 mts mts 6854 Apr 14 13:03 compat_wait.h +-r--r--r-- 1 mts mts 2216 Apr 14 13:03 driver-config.h +-r--r--r-- 1 mts mts 4262 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 14180 Apr 14 13:03 os.c +-r--r--r-- 1 mts mts 2441 Apr 14 13:03 os.h +-r--r--r-- 1 mts mts 9952 Apr 14 13:03 vm_assert.h +-r--r--r-- 1 mts mts 12182 Apr 14 13:03 vm_basic_defs.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 37545 Apr 14 13:03 vmballoon.c +-r--r--r-- 1 mts mts 2048 Apr 14 13:03 vmballoon.h +-r--r--r-- 1 mts mts 1193 Apr 14 13:03 vmmemctl_version.h + +open-vm-tools-2008.04.14-87182/modules/linux/vmmemctl/autoconf: total 12 --r--r--r-- 1 mts mts 1261 2008-02-20 18:18 epoll.c --r--r--r-- 1 mts mts 1204 2008-02-20 18:18 geninclude.c --r--r--r-- 1 mts mts 1139 2008-02-20 18:18 setnice.c +-r--r--r-- 1 mts mts 1261 Apr 14 13:03 epoll.c +-r--r--r-- 1 mts mts 1204 Apr 14 13:03 geninclude.c +-r--r--r-- 1 mts mts 1139 Apr 14 13:03 setnice.c -open-vm-tools-2008.02.13-77928/modules/linux/vmsync: +open-vm-tools-2008.04.14-87182/modules/linux/vmsync: total 108 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autoconf --r--r--r-- 1 mts mts 9630 2008-02-20 18:18 compat_fs.h --r--r--r-- 1 mts mts 2298 2008-02-20 18:18 compat_module.h --r--r--r-- 1 mts mts 1570 2008-02-20 18:18 compat_namei.h --r--r--r-- 1 mts mts 2764 2008-02-20 18:18 compat_slab.h --r--r--r-- 1 mts mts 3189 2008-02-20 18:18 compat_version.h --r--r--r-- 1 mts mts 6345 2008-02-20 18:18 compat_workqueue.h --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 2216 2008-02-20 18:18 driver-config.h --r--r--r-- 1 mts mts 4262 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 3760 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 1473 2008-02-20 18:18 Makefile.kernel --r--r--r-- 1 mts mts 18751 2008-02-20 18:18 sync.c --r--r--r-- 1 mts mts 1540 2008-02-20 18:18 syncDriverIoc.h --r--r--r-- 1 mts mts 1168 2008-02-20 18:18 vmsync_version.h - -open-vm-tools-2008.02.13-77928/modules/linux/vmsync/autoconf: +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3760 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 1473 Apr 14 13:03 Makefile.kernel +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autoconf +-r--r--r-- 1 mts mts 9850 Apr 14 13:03 compat_fs.h +-r--r--r-- 1 mts mts 2298 Apr 14 13:03 compat_module.h +-r--r--r-- 1 mts mts 2118 Apr 14 13:03 compat_namei.h +-r--r--r-- 1 mts mts 2764 Apr 14 13:03 compat_slab.h +-r--r--r-- 1 mts mts 3189 Apr 14 13:03 compat_version.h +-r--r--r-- 1 mts mts 6345 Apr 14 13:03 compat_workqueue.h +-r--r--r-- 1 mts mts 2216 Apr 14 13:03 driver-config.h +-r--r--r-- 1 mts mts 4262 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 18797 Apr 14 13:03 sync.c +-r--r--r-- 1 mts mts 1540 Apr 14 13:03 syncDriverIoc.h +-r--r--r-- 1 mts mts 1168 Apr 14 13:03 vmsync_version.h + +open-vm-tools-2008.04.14-87182/modules/linux/vmsync/autoconf: total 8 --r--r--r-- 1 mts mts 1670 2008-02-20 18:18 cachecreate.c --r--r--r-- 1 mts mts 1718 2008-02-20 18:18 cachector.c - -open-vm-tools-2008.02.13-77928/modules/linux/vmxnet: -total 276 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 autoconf --r--r--r-- 1 mts mts 1966 2008-02-20 18:18 bpf_meta.h --r--r--r-- 1 mts mts 1734 2008-02-20 18:18 compat_ethtool.h --r--r--r-- 1 mts mts 1391 2008-02-20 18:18 compat_highmem.h --r--r--r-- 1 mts mts 1261 2008-02-20 18:18 compat_init.h --r--r--r-- 1 mts mts 1700 2008-02-20 18:18 compat_interrupt.h --r--r--r-- 1 mts mts 2081 2008-02-20 18:18 compat_ioport.h --r--r--r-- 1 mts mts 2298 2008-02-20 18:18 compat_module.h --r--r--r-- 1 mts mts 6555 2008-02-20 18:18 compat_netdevice.h --r--r--r-- 1 mts mts 16013 2008-02-20 18:18 compat_pci.h --r--r--r-- 1 mts mts 6453 2008-02-20 18:18 compat_skbuff.h --r--r--r-- 1 mts mts 2764 2008-02-20 18:18 compat_slab.h --r--r--r-- 1 mts mts 2438 2008-02-20 18:18 compat_spinlock.h --r--r--r-- 1 mts mts 2795 2008-02-20 18:18 compat_timer.h --r--r--r-- 1 mts mts 3189 2008-02-20 18:18 compat_version.h --r--r--r-- 1 mts mts 17987 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 2216 2008-02-20 18:18 driver-config.h --r--r--r-- 1 mts mts 4262 2008-02-20 18:18 includeCheck.h --r--r--r-- 1 mts mts 3760 2008-02-20 18:18 Makefile --r--r--r-- 1 mts mts 1279 2008-02-20 18:18 Makefile.kernel --r--r--r-- 1 mts mts 2665 2008-02-20 18:18 Makefile.normal --r--r--r-- 1 mts mts 2426 2008-02-20 18:18 net.h --r--r--r-- 1 mts mts 2240 2008-02-20 18:18 net_sg.h --r--r--r-- 1 mts mts 460 2008-02-20 18:18 README --r--r--r-- 1 mts mts 21565 2008-02-20 18:18 vm_basic_types.h --r--r--r-- 1 mts mts 6899 2008-02-20 18:18 vm_device_version.h --r--r--r-- 1 mts mts 2816 2008-02-20 18:18 vmnet_def.h --r--r--r-- 1 mts mts 14595 2008-02-20 18:18 vmxnet2_def.h --r--r--r-- 1 mts mts 68841 2008-02-20 18:18 vmxnet.c --r--r--r-- 1 mts mts 6793 2008-02-20 18:18 vmxnet_def.h --r--r--r-- 1 mts mts 3735 2008-02-20 18:18 vmxnetInt.h --r--r--r-- 1 mts mts 1168 2008-02-20 18:18 vmxnet_version.h - -open-vm-tools-2008.02.13-77928/modules/linux/vmxnet/autoconf: +-r--r--r-- 1 mts mts 1670 Apr 14 13:03 cachecreate.c +-r--r--r-- 1 mts mts 1718 Apr 14 13:03 cachector.c + +open-vm-tools-2008.04.14-87182/modules/linux/vmxnet: +total 280 +-r--r--r-- 1 mts mts 17987 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3760 Apr 14 13:03 Makefile +-r--r--r-- 1 mts mts 1279 Apr 14 13:03 Makefile.kernel +-r--r--r-- 1 mts mts 2665 Apr 14 13:03 Makefile.normal +-r--r--r-- 1 mts mts 460 Apr 14 13:03 README +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 autoconf +-r--r--r-- 1 mts mts 1966 Apr 14 13:03 bpf_meta.h +-r--r--r-- 1 mts mts 1734 Apr 14 13:03 compat_ethtool.h +-r--r--r-- 1 mts mts 1391 Apr 14 13:03 compat_highmem.h +-r--r--r-- 1 mts mts 1261 Apr 14 13:03 compat_init.h +-r--r--r-- 1 mts mts 1700 Apr 14 13:03 compat_interrupt.h +-r--r--r-- 1 mts mts 2081 Apr 14 13:03 compat_ioport.h +-r--r--r-- 1 mts mts 2298 Apr 14 13:03 compat_module.h +-r--r--r-- 1 mts mts 6772 Apr 14 13:03 compat_netdevice.h +-r--r--r-- 1 mts mts 16725 Apr 14 13:03 compat_pci.h +-r--r--r-- 1 mts mts 6453 Apr 14 13:03 compat_skbuff.h +-r--r--r-- 1 mts mts 2764 Apr 14 13:03 compat_slab.h +-r--r--r-- 1 mts mts 2438 Apr 14 13:03 compat_spinlock.h +-r--r--r-- 1 mts mts 2795 Apr 14 13:03 compat_timer.h +-r--r--r-- 1 mts mts 3189 Apr 14 13:03 compat_version.h +-r--r--r-- 1 mts mts 2216 Apr 14 13:03 driver-config.h +-r--r--r-- 1 mts mts 4262 Apr 14 13:03 includeCheck.h +-r--r--r-- 1 mts mts 2426 Apr 14 13:03 net.h +-r--r--r-- 1 mts mts 2240 Apr 14 13:03 net_sg.h +-r--r--r-- 1 mts mts 21720 Apr 14 13:03 vm_basic_types.h +-r--r--r-- 1 mts mts 7137 Apr 14 13:03 vm_device_version.h +-r--r--r-- 1 mts mts 2915 Apr 14 13:03 vmnet_def.h +-r--r--r-- 1 mts mts 68841 Apr 14 13:03 vmxnet.c +-r--r--r-- 1 mts mts 14595 Apr 14 13:03 vmxnet2_def.h +-r--r--r-- 1 mts mts 3735 Apr 14 13:03 vmxnetInt.h +-r--r--r-- 1 mts mts 6793 Apr 14 13:03 vmxnet_def.h +-r--r--r-- 1 mts mts 1168 Apr 14 13:03 vmxnet_version.h + +open-vm-tools-2008.04.14-87182/modules/linux/vmxnet/autoconf: total 8 --r--r--r-- 1 mts mts 1204 2008-02-20 18:18 geninclude.c --r--r--r-- 1 mts mts 1400 2008-02-20 18:18 skblin.c +-r--r--r-- 1 mts mts 1204 Apr 14 13:03 geninclude.c +-r--r--r-- 1 mts mts 1400 Apr 14 13:03 skblin.c -open-vm-tools-2008.02.13-77928/scripts: +open-vm-tools-2008.04.14-87182/scripts: total 44 -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 common --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 freebsd -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 linux -drwxr-xr-x 2 mts mts 4096 2008-02-20 18:18 solaris +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 common +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 freebsd +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 linux +drwxr-xr-x 2 mts mts 4096 Apr 14 13:03 solaris -open-vm-tools-2008.02.13-77928/scripts/common: +open-vm-tools-2008.04.14-87182/scripts/common: total 8 --r--r--r-- 1 mts mts 7433 2008-02-20 18:18 vm-support +-r--r--r-- 1 mts mts 7452 Apr 14 13:03 vm-support -open-vm-tools-2008.02.13-77928/scripts/freebsd: +open-vm-tools-2008.04.14-87182/scripts/freebsd: total 16 --r--r--r-- 1 mts mts 1335 2008-02-20 18:18 poweroff-vm-default --r--r--r-- 1 mts mts 1334 2008-02-20 18:18 poweron-vm-default --r--r--r-- 1 mts mts 1374 2008-02-20 18:18 resume-vm-default --r--r--r-- 1 mts mts 1731 2008-02-20 18:18 suspend-vm-default +-r--r--r-- 1 mts mts 1354 Apr 14 13:03 poweroff-vm-default +-r--r--r-- 1 mts mts 1353 Apr 14 13:03 poweron-vm-default +-r--r--r-- 1 mts mts 1393 Apr 14 13:03 resume-vm-default +-r--r--r-- 1 mts mts 1750 Apr 14 13:03 suspend-vm-default -open-vm-tools-2008.02.13-77928/scripts/linux: +open-vm-tools-2008.04.14-87182/scripts/linux: total 16 --r--r--r-- 1 mts mts 1332 2008-02-20 18:18 poweroff-vm-default --r--r--r-- 1 mts mts 1332 2008-02-20 18:18 poweron-vm-default --r--r--r-- 1 mts mts 3023 2008-02-20 18:18 resume-vm-default --r--r--r-- 1 mts mts 2619 2008-02-20 18:18 suspend-vm-default +-r--r--r-- 1 mts mts 1351 Apr 14 13:03 poweroff-vm-default +-r--r--r-- 1 mts mts 1351 Apr 14 13:03 poweron-vm-default +-r--r--r-- 1 mts mts 3042 Apr 14 13:03 resume-vm-default +-r--r--r-- 1 mts mts 2638 Apr 14 13:03 suspend-vm-default -open-vm-tools-2008.02.13-77928/scripts/solaris: +open-vm-tools-2008.04.14-87182/scripts/solaris: total 16 --r--r--r-- 1 mts mts 1335 2008-02-20 18:18 poweroff-vm-default --r--r--r-- 1 mts mts 1334 2008-02-20 18:18 poweron-vm-default --r--r--r-- 1 mts mts 1534 2008-02-20 18:18 resume-vm-default --r--r--r-- 1 mts mts 1885 2008-02-20 18:18 suspend-vm-default +-r--r--r-- 1 mts mts 1354 Apr 14 13:03 poweroff-vm-default +-r--r--r-- 1 mts mts 1353 Apr 14 13:03 poweron-vm-default +-r--r--r-- 1 mts mts 1553 Apr 14 13:03 resume-vm-default +-r--r--r-- 1 mts mts 1904 Apr 14 13:03 suspend-vm-default -open-vm-tools-2008.02.13-77928/toolbox: +open-vm-tools-2008.04.14-87182/toolbox: total 176 --r--r--r-- 1 mts mts 2696 2008-02-20 18:18 bigIcon.xpm --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 5793 2008-02-20 18:18 debugStdio.c --r--r--r-- 1 mts mts 2653 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 17142 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 458 2008-02-20 18:18 smallIcon.xpm --r--r--r-- 1 mts mts 4717 2008-02-20 18:18 stub.c --r--r--r-- 1 mts mts 6309 2008-02-20 18:18 toolboxAbout.c --r--r--r-- 1 mts mts 7071 2008-02-20 18:18 toolboxDevices.c --r--r--r-- 1 mts mts 29568 2008-02-20 18:18 toolbox-gtk.c --r--r--r-- 1 mts mts 1543 2008-02-20 18:18 toolboxgtk_version.h --r--r--r-- 1 mts mts 2821 2008-02-20 18:18 toolboxInt.h --r--r--r-- 1 mts mts 3884 2008-02-20 18:18 toolboxOptions.c --r--r--r-- 1 mts mts 24446 2008-02-20 18:18 toolboxScripts.c --r--r--r-- 1 mts mts 14812 2008-02-20 18:18 toolboxShrink.c - -open-vm-tools-2008.02.13-77928/vmware-user: +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 2587 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 16961 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 2696 Apr 14 13:03 bigIcon.xpm +-r--r--r-- 1 mts mts 6258 Apr 14 13:03 debugStdio.c +-r--r--r-- 1 mts mts 458 Apr 14 13:03 smallIcon.xpm +-r--r--r-- 1 mts mts 4731 Apr 14 13:03 stub.c +-r--r--r-- 1 mts mts 29581 Apr 14 13:03 toolbox-gtk.c +-r--r--r-- 1 mts mts 6323 Apr 14 13:03 toolboxAbout.c +-r--r--r-- 1 mts mts 7085 Apr 14 13:03 toolboxDevices.c +-r--r--r-- 1 mts mts 2835 Apr 14 13:03 toolboxInt.h +-r--r--r-- 1 mts mts 3898 Apr 14 13:03 toolboxOptions.c +-r--r--r-- 1 mts mts 24460 Apr 14 13:03 toolboxScripts.c +-r--r--r-- 1 mts mts 14826 Apr 14 13:03 toolboxShrink.c +-r--r--r-- 1 mts mts 1557 Apr 14 13:03 toolboxgtk_version.h + +open-vm-tools-2008.04.14-87182/vmware-user: total 452 --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 64258 2008-02-20 18:18 copyPaste.c --r--r--r-- 1 mts mts 5793 2008-02-20 18:18 debugStdio.c --r--r--r-- 1 mts mts 83231 2008-02-20 18:18 dnd.c --r--r--r-- 1 mts mts 37352 2008-02-20 18:18 foreignVMToolsDaemon.c --r--r--r-- 1 mts mts 6196 2008-02-20 18:18 foreignVMToolsDaemon.h --r--r--r-- 1 mts mts 37041 2008-02-20 18:18 foreignVMToolsNetworking.c --r--r--r-- 1 mts mts 55393 2008-02-20 18:18 foundryToolsDaemon.c --r--r--r-- 1 mts mts 1752 2008-02-20 18:18 foundryToolsDaemon.h --r--r--r-- 1 mts mts 7478 2008-02-20 18:18 libvmwarectrl.c --r--r--r-- 1 mts mts 2031 2008-02-20 18:18 libvmwarectrl.h --r--r--r-- 1 mts mts 3986 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 18898 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 5854 2008-02-20 18:18 pointer.c --r--r--r-- 1 mts mts 15096 2008-02-20 18:18 resolution.c --r--r--r-- 1 mts mts 4717 2008-02-20 18:18 stub.c --r--r--r-- 1 mts mts 1868 2008-02-20 18:18 vmwarectrl.h --r--r--r-- 1 mts mts 3636 2008-02-20 18:18 vmwarectrlproto.h --r--r--r-- 1 mts mts 24350 2008-02-20 18:18 vmware-user.c --r--r--r-- 1 mts mts 2843 2008-02-20 18:18 vmwareuserInt.h --r--r--r-- 1 mts mts 1550 2008-02-20 18:18 vmwareuser_version.h - -open-vm-tools-2008.02.13-77928/xferlogs: +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 3906 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 18680 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 65156 Apr 14 13:03 copyPaste.c +-r--r--r-- 1 mts mts 6258 Apr 14 13:03 debugStdio.c +-r--r--r-- 1 mts mts 83230 Apr 14 13:03 dnd.c +-r--r--r-- 1 mts mts 37366 Apr 14 13:03 foreignVMToolsDaemon.c +-r--r--r-- 1 mts mts 6210 Apr 14 13:03 foreignVMToolsDaemon.h +-r--r--r-- 1 mts mts 37055 Apr 14 13:03 foreignVMToolsNetworking.c +-r--r--r-- 1 mts mts 54646 Apr 14 13:03 foundryToolsDaemon.c +-r--r--r-- 1 mts mts 1766 Apr 14 13:03 foundryToolsDaemon.h +-r--r--r-- 1 mts mts 7478 Apr 14 13:03 libvmwarectrl.c +-r--r--r-- 1 mts mts 2031 Apr 14 13:03 libvmwarectrl.h +-r--r--r-- 1 mts mts 5868 Apr 14 13:03 pointer.c +-r--r--r-- 1 mts mts 16123 Apr 14 13:03 resolution.c +-r--r--r-- 1 mts mts 4731 Apr 14 13:03 stub.c +-r--r--r-- 1 mts mts 24364 Apr 14 13:03 vmware-user.c +-r--r--r-- 1 mts mts 1868 Apr 14 13:03 vmwarectrl.h +-r--r--r-- 1 mts mts 3636 Apr 14 13:03 vmwarectrlproto.h +-r--r--r-- 1 mts mts 2857 Apr 14 13:03 vmwareuserInt.h +-r--r--r-- 1 mts mts 1564 Apr 14 13:03 vmwareuser_version.h + +open-vm-tools-2008.04.14-87182/xferlogs: total 64 --r--r--r-- 1 mts mts 26425 2008-02-20 18:18 COPYING --r--r--r-- 1 mts mts 1504 2008-02-20 18:18 Makefile.am --rw-r--r-- 1 mts mts 15083 2008-02-20 18:18 Makefile.in --r--r--r-- 1 mts mts 9197 2008-02-20 18:18 xferlogs.c --r--r--r-- 1 mts mts 1540 2008-02-20 18:18 xferlogs_version.h +-r--r--r-- 1 mts mts 26425 Apr 14 13:03 COPYING +-r--r--r-- 1 mts mts 1504 Apr 14 13:03 Makefile.am +-rw-r--r-- 1 mts mts 15135 Apr 14 13:03 Makefile.in +-r--r--r-- 1 mts mts 9211 Apr 14 13:03 xferlogs.c +-r--r--r-- 1 mts mts 1554 Apr 14 13:03 xferlogs_version.h diff --git a/open-vm-tools/Makefile.in b/open-vm-tools/Makefile.in index 6b0e95ac5..01941bf86 100644 --- a/open-vm-tools/Makefile.in +++ b/open-vm-tools/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -117,7 +117,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -129,7 +128,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -154,7 +153,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -163,6 +161,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -170,7 +170,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -353,8 +353,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -379,8 +379,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -390,12 +390,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -466,10 +467,6 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) - dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -496,8 +493,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -649,8 +644,8 @@ uninstall-am: .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-libtool distclean-tags \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ diff --git a/open-vm-tools/NEWS b/open-vm-tools/NEWS index f109f5778..89efafa33 100755 --- a/open-vm-tools/NEWS +++ b/open-vm-tools/NEWS @@ -1,3 +1,27 @@ +open-vm-tools 2008.04.14 changes: + * Update the license stamp on all LGPL files. + + * Continued Unicode support. + + * Handle libdumbnet on Debian. + + * More bug fixes, including a security fix in guestd. + +open-vm-tools 2008.03.19 changes: + * Continued Unicode support. + + * A few bug fixes. + +open-vm-tools 2008.03.03 changes: + * Bug fixes (including the ability to specify custom LDFLAGS + at build time, thanks to Mike Auty). + + * First cut of HGFSv3 implementation. + + * Beginnings of DnDv3 implementation. + + * Add Unicode support all over the code base. + open-vm-tools 2008.02.13 changes: * Some bug fixes. diff --git a/open-vm-tools/aclocal.m4 b/open-vm-tools/aclocal.m4 index 32664bdfb..b243bbc86 100644 --- a/open-vm-tools/aclocal.m4 +++ b/open-vm-tools/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,17 +11,14 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# serial 52 Debian 1.5.26-1 AC_PROG_LIBTOOL +# serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) @@ -109,6 +106,7 @@ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl + AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR @@ -183,7 +181,7 @@ test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -210,8 +208,6 @@ file_magic*) ;; esac -_LT_REQUIRED_DARWIN_CHECKS - AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) @@ -272,9 +268,8 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* @@ -286,85 +281,13 @@ $rm conftest* # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* +$rm conftest* ])# _LT_LINKER_BOILERPLATE -# _LT_REQUIRED_DARWIN_CHECKS -# -------------------------- -# Check for some things on darwin -AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - echo "int foo(void){return 1;}" > conftest.c - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib ${wl}-single_module conftest.c - if test -f libconftest.dylib; then - lt_cv_apple_cc_single_mod=yes - rm -rf libconftest.dylib* - fi - rm conftest.c - fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - case $host_os in - rhapsody* | darwin1.[[0123]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil="~$DSYMUTIL \$lib || :" - else - _lt_dsymutil= - fi - ;; - esac -]) # _LT_AC_SYS_LIBPATH_AIX # ---------------------- @@ -375,20 +298,12 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX @@ -619,17 +534,13 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|sparc*-*linux*) +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; @@ -646,9 +557,6 @@ s390*-*linux*|sparc*-*linux*) ;; *64-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; @@ -689,11 +597,7 @@ sparc*-*solaris*) *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; + *) LD="${LD-ld} -64" ;; esac ;; esac @@ -724,7 +628,7 @@ AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -765,12 +669,11 @@ fi # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_CACHE_CHECK([$1], [$2], +[AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -786,7 +689,7 @@ AC_CACHE_CHECK([$1], [$2], $2=yes fi fi - $rm -r conftest* + $rm conftest* LDFLAGS="$save_LDFLAGS" ]) @@ -884,27 +787,24 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl fi ;; *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) @@ -1057,7 +957,7 @@ else AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], @@ -1065,7 +965,7 @@ else [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) @@ -1131,8 +1031,7 @@ fi # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no @@ -1140,7 +1039,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -1280,7 +1179,6 @@ else darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) @@ -1298,8 +1196,7 @@ fi # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) +[AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= @@ -1313,58 +1210,20 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -m4_if($1,[],[ if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -1382,7 +1241,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix[[4-9]]*) +aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no @@ -1521,8 +1380,12 @@ darwin* | rhapsody*) shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -1539,6 +1402,18 @@ freebsd1*) dynamic_linker=no ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -1576,7 +1451,7 @@ freebsd* | dragonfly*) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -1639,7 +1514,7 @@ hpux9* | hpux10* | hpux11*) postinstall_cmds='chmod 555 $lib' ;; -interix[[3-9]]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -1694,7 +1569,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) version_type=linux need_lib_prefix=no need_version=no @@ -1708,10 +1583,27 @@ linux* | k*bsd*-gnu) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -1723,7 +1615,7 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) +knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -1732,7 +1624,7 @@ netbsdelf*-gnu) shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' + dynamic_linker='GNU ld.so' ;; netbsd*) @@ -1816,10 +1708,6 @@ osf3* | osf4* | osf5*) sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -1915,13 +1803,6 @@ esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no -AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], -[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) -sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], -[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) -sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" - variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -1932,8 +1813,7 @@ fi # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_ARG_WITH([tags], +[AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) @@ -2194,7 +2074,7 @@ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], # AC_PATH_TOOL_PREFIX # ------------------- -# find a file program which can recognize shared library +# find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) @@ -2257,7 +2137,7 @@ fi # AC_PATH_MAGIC # ------------- -# find a file program which can recognize a shared library +# find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then @@ -2404,7 +2284,7 @@ esac # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognize dependent libraries], +[AC_CACHE_CHECK([how to recognise dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= @@ -2421,7 +2301,7 @@ lt_cv_deplibs_check_method='unknown' # whether `pass_all' will *always* work, you probably want this one. case $host_os in -aix[[4-9]]*) +aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; @@ -2443,22 +2323,16 @@ cygwin*) mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) @@ -2496,7 +2370,7 @@ hpux10.20* | hpux11*) esac ;; -interix[[3-9]]*) +interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; @@ -2512,11 +2386,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -2546,10 +2420,6 @@ osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - solaris*) lt_cv_deplibs_check_method=pass_all ;; @@ -2602,7 +2472,7 @@ AC_DEFUN([AC_PROG_NM], lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do @@ -2818,10 +2688,10 @@ objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER @@ -2857,7 +2727,7 @@ aix3*) fi ;; -aix[[4-9]]*) +aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi @@ -2914,7 +2784,6 @@ _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= -_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= # Source file extension for C++ test sources. ac_ext=cpp @@ -2924,10 +2793,10 @@ objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER @@ -3024,7 +2893,7 @@ case $host_os in # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; - aix[[4-9]]*) + aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -3037,7 +2906,7 @@ case $host_os in # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) @@ -3073,7 +2942,7 @@ case $host_os in strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported @@ -3183,31 +3052,59 @@ case $host_os in fi ;; darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - if test "$GXX" = yes ; then + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -3241,7 +3138,7 @@ case $host_os in freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes @@ -3290,7 +3187,9 @@ case $host_os in _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in - hppa*64*|ia64*) ;; + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; @@ -3358,7 +3257,7 @@ case $host_os in ;; esac ;; - interix[[3-9]]*) + interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' @@ -3398,7 +3297,7 @@ case $host_os in _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -3450,7 +3349,7 @@ case $host_os in _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; - pgCC* | pgcpp*) + pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' @@ -3478,29 +3377,6 @@ case $host_os in # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; esac ;; lynxos*) @@ -3523,7 +3399,7 @@ case $host_os in ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= @@ -3539,20 +3415,16 @@ case $host_os in _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi + output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in @@ -3714,10 +3586,15 @@ case $host_os in case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes @@ -3764,12 +3641,6 @@ case $host_os in fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac fi ;; esac @@ -3885,8 +3756,7 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], -[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each @@ -4011,15 +3881,10 @@ fi $rm -f confest.$objext -_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi - # PORTME: override above test on systems where it is broken ifelse([$1],[CXX], [case $host_os in -interix[[3-9]]*) +interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_AC_TAGVAR(predep_objects,$1)= @@ -4027,51 +3892,19 @@ interix[[3-9]]*) _LT_AC_TAGVAR(postdeps,$1)= ;; -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - # - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - if test "$solaris_use_stlport4" != yes; then - _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - solaris*) case $cc_basename in CC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi + _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' ;; esac ;; esac ]) + case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac @@ -4114,17 +3947,10 @@ objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="\ - subroutine t - return - end -" +lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests -lt_simple_link_test_code="\ - program t - end -" +lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER @@ -4156,7 +3982,7 @@ aix3*) postinstall_cmds='$RANLIB $lib' fi ;; -aix[[4-9]]*) +aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi @@ -4203,10 +4029,10 @@ objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" +lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER @@ -4259,7 +4085,7 @@ objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" @@ -4333,7 +4159,6 @@ if test -f "$ltmain"; then _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ - _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ @@ -4349,7 +4174,6 @@ if test -f "$ltmain"; then _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ - _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do @@ -4396,7 +4220,7 @@ ifelse([$1], [], # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: @@ -4486,6 +4310,9 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -4619,11 +4446,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) +predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) +postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -4633,13 +4460,9 @@ predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) -# The directories searched by this compiler when creating a shared -# library -compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) - # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) +compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -4719,13 +4542,13 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) @@ -4808,7 +4631,6 @@ fi # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. @@ -4845,7 +4667,7 @@ hpux*) # Its linker distinguishes data from code symbols lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; -linux* | k*bsd*-gnu) +linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" @@ -4986,7 +4808,7 @@ EOF echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi - rm -rf conftest* conftst* + rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -5035,16 +4857,13 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32*) + mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform @@ -5055,7 +4874,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; - interix[[3-9]]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -5081,7 +4900,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) esac else case $host_os in - aix[[4-9]]*) + aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor @@ -5121,7 +4940,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ;; esac ;; - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -5164,7 +4983,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ;; esac ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -5177,7 +4996,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - pgCC* | pgcpp*) + pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' @@ -5191,14 +5010,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac ;; esac ;; @@ -5215,7 +5026,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in @@ -5319,17 +5130,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) @@ -5338,7 +5146,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; - interix[[3-9]]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -5396,11 +5204,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) @@ -5430,7 +5237,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -5449,22 +5256,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - esac - ;; esac ;; @@ -5474,10 +5265,6 @@ AC_MSG_CHECKING([for $compiler option to produce PIC]) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - rdos*) - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -5537,7 +5324,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; @@ -5561,7 +5348,7 @@ esac # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) @@ -5572,12 +5359,11 @@ AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in - aix[[4-9]]*) + aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then @@ -5590,16 +5376,12 @@ ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac - _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= @@ -5630,14 +5412,12 @@ ifelse([$1],[CXX],[ # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) @@ -5687,7 +5467,7 @@ dnl Note also adjust exclude_expsyms for C++ above. # See if GNU ld supports shared libraries. case $host_os in - aix[[3-9]]*) + aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no @@ -5735,7 +5515,7 @@ EOF _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -5753,7 +5533,7 @@ EOF fi ;; - interix[[3-9]]*) + interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' @@ -5768,7 +5548,7 @@ EOF _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -5786,30 +5566,20 @@ EOF ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5842,7 +5612,7 @@ EOF sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -5907,7 +5677,7 @@ _LT_EOF fi ;; - aix[[4-9]]*) + aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -5927,7 +5697,7 @@ _LT_EOF # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -5961,7 +5731,7 @@ _LT_EOF strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported @@ -6054,7 +5824,7 @@ _LT_EOF # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; @@ -6087,18 +5857,19 @@ _LT_EOF _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -6138,7 +5909,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes @@ -6240,7 +6011,7 @@ _LT_EOF _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6260,28 +6031,24 @@ _LT_EOF ;; openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else - _LT_AC_TAGVAR(ld_shlibs, $1)=no + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -6340,16 +6107,17 @@ _LT_EOF case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; @@ -6406,7 +6174,7 @@ _LT_EOF fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -6481,7 +6249,7 @@ x|xyes) # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest @@ -6584,30 +6352,6 @@ AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) - -# Cheap backport of AS_EXECUTABLE_P and required macros -# from Autoconf 2.59; we should not use $as_executable_p directly. - -# _AS_TEST_PREPARE -# ---------------- -m4_ifndef([_AS_TEST_PREPARE], -[m4_defun([_AS_TEST_PREPARE], -[if test -x / >/dev/null 2>&1; then - as_executable_p='test -x' -else - as_executable_p='test -f' -fi -])])# _AS_TEST_PREPARE - -# AS_EXECUTABLE_P -# --------------- -# Check whether a file is executable. -m4_ifndef([AS_EXECUTABLE_P], -[m4_defun([AS_EXECUTABLE_P], -[AS_REQUIRE([_AS_TEST_PREPARE])dnl -$as_executable_p $1[]dnl -])])# AS_EXECUTABLE_P - # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # @@ -6628,7 +6372,7 @@ do test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done @@ -6671,7 +6415,7 @@ AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -6686,7 +6430,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -6702,10 +6446,8 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -6977,7 +6719,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -7025,13 +6767,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008 Free Software Foundation, Inc. +# 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 13 +# serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -7136,17 +6878,16 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. -_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $_am_arg | $_am_arg:* ) + $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -7418,7 +7159,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) diff --git a/open-vm-tools/checkvm/Makefile.in b/open-vm-tools/checkvm/Makefile.in index 1ef9a8409..f206db1b6 100644 --- a/open-vm-tools/checkvm/Makefile.in +++ b/open-vm-tools/checkvm/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -104,7 +104,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -116,7 +115,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -141,7 +140,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,6 +148,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -157,7 +157,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -300,8 +300,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -313,8 +313,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -324,12 +324,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/checkvm/checkvm.c b/open-vm-tools/checkvm/checkvm.c index a637e298e..4bb77926d 100644 --- a/open-vm-tools/checkvm/checkvm.c +++ b/open-vm-tools/checkvm/checkvm.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/checkvm/checkvm_version.h b/open-vm-tools/checkvm/checkvm_version.h index 9dbebbf10..7b3a29257 100644 --- a/open-vm-tools/checkvm/checkvm_version.h +++ b/open-vm-tools/checkvm/checkvm_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/configure b/open-vm-tools/configure index 8f55b279d..f2c4afbb8 100755 --- a/open-vm-tools/configure +++ b/open-vm-tools/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for open-vm-tools 2008.02.13-77928. +# Generated by GNU Autoconf 2.61 for open-vm-tools 2008.04.14-87182. # # Report bugs to . # @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' -PACKAGE_VERSION='2008.02.13-77928' -PACKAGE_STRING='open-vm-tools 2008.02.13-77928' +PACKAGE_VERSION='2008.04.14-87182' +PACKAGE_STRING='open-vm-tools 2008.04.14-87182' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" @@ -860,8 +860,6 @@ LN_S ECHO AR RANLIB -DSYMUTIL -NMEDIT CXX CXXFLAGS ac_ct_CXX @@ -899,6 +897,8 @@ GTK_CFLAGS GTK_LIBS DNET_CFLAGS DNET_LIBS +PROCPS_CFLAGS +PROCPS_LIBS LIB_AUTH_CFLAGS LIB_FILE_CFLAGS LIB_HGFS_SERVER_CFLAGS @@ -907,9 +907,9 @@ LIB_MISC_CFLAGS LIB_PROC_MGR_CFLAGS LIB_STRING_CFLAGS LIB_USER_CFLAGS -GUESTD_LDFLAGS +GUESTD_LDADD VMWARE_USER_CFLAGS -VMWARE_USER_LDFLAGS +VMWARE_USER_LDADD LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1431,7 +1431,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures open-vm-tools 2008.02.13-77928 to adapt to many kinds of systems. +\`configure' configures open-vm-tools 2008.04.14-87182 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1505,7 +1505,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of open-vm-tools 2008.02.13-77928:";; + short | recursive ) echo "Configuration of open-vm-tools 2008.04.14-87182:";; esac cat <<\_ACEOF @@ -1529,6 +1529,10 @@ Optional Packages: both] --with-tags[=TAGS] include additional configurations [automatic] --with-x use the X Window System + --without-procps compile without libproc (disables support for + meminfo) + --without-dnet compile without libdnet (disables support for + nicinfo) Some influential environment variables: CC C compiler command @@ -1610,7 +1614,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -open-vm-tools configure 2008.02.13-77928 +open-vm-tools configure 2008.04.14-87182 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1624,7 +1628,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by open-vm-tools $as_me 2008.02.13-77928, which was +It was created by open-vm-tools $as_me 2008.04.14-87182, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2514,7 +2518,7 @@ fi # Define the identity of the package. PACKAGE='open-vm-tools' - VERSION='2008.02.13-77928' + VERSION='2008.04.14-87182' cat >>confdefs.h <<_ACEOF @@ -2666,6 +2670,10 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ### # These need to be declared after initialization. +# Some of our macro call-sites require changes to CFLAGS/LDFLAGS. In such +# places, we save the original value of CFLAGS/LDFLAGS before the macro call +# and restore it when the call is done. We must perform this save at each macro +# site, because CFLAGS/LDFLAGS may change over the course of configuration. CFLAGS="$CFLAGS -DUSING_AUTOCONF=1" ### @@ -4941,7 +4949,7 @@ do test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done @@ -5344,8 +5352,8 @@ else echo "${ECHO_T}no, using $LN_S" >&6; } fi -{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5364,7 +5372,7 @@ lt_cv_deplibs_check_method='unknown' # whether `pass_all' will *always* work, you probably want this one. case $host_os in -aix[4-9]*) +aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; @@ -5386,22 +5394,16 @@ cygwin*) mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) @@ -5439,7 +5441,7 @@ hpux10.20* | hpux11*) esac ;; -interix[3-9]*) +interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; @@ -5455,11 +5457,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -5489,10 +5491,6 @@ osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - solaris*) lt_cv_deplibs_check_method=pass_all ;; @@ -5580,7 +5578,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5583 "configure"' > conftest.$ac_ext + echo '#line 5581 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5615,8 +5613,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|sparc*-*linux*) +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -5627,9 +5624,6 @@ s390*-*linux*|sparc*-*linux*) case `/usr/bin/file conftest.o` in *32-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; @@ -5646,9 +5640,6 @@ s390*-*linux*|sparc*-*linux*) ;; *64-bit*) case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; @@ -5752,11 +5743,7 @@ sparc*-*solaris*) *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; + *) LD="${LD-ld} -64" ;; esac ;; esac @@ -7128,6 +7115,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } @@ -7214,27 +7202,24 @@ else fi ;; *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac @@ -7251,7 +7236,6 @@ fi - # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } @@ -7289,7 +7273,7 @@ hpux*) # Its linker distinguishes data from code symbols lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; -linux* | k*bsd*-gnu) +linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" @@ -7442,7 +7426,7 @@ EOF echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi - rm -rf conftest* conftst* + rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -7840,7 +7824,7 @@ test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -8002,318 +7986,6 @@ fi ;; esac - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 -echo "${ECHO_T}$DSYMUTIL" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 -echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { echo "$as_me:$LINENO: result: $NMEDIT" >&5 -echo "${ECHO_T}$NMEDIT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 -echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - - { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 -echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - echo "int foo(void){return 1;}" > conftest.c - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib ${wl}-single_module conftest.c - if test -f libconftest.dylib; then - lt_cv_apple_cc_single_mod=yes - rm -rf libconftest.dylib* - fi - rm conftest.c - fi -fi -{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 -echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } - { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 -echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - lt_cv_ld_exported_symbols_list=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_ld_exported_symbols_list=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 -echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } - case $host_os in - rhapsody* | darwin1.[0123]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil="~$DSYMUTIL \$lib || :" - else - _lt_dsymutil= - fi - ;; - esac - - enable_dlopen=no enable_win32_dll=no @@ -8352,10 +8024,10 @@ objext=o objext=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. @@ -8370,16 +8042,16 @@ compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* +$rm conftest* @@ -8396,7 +8068,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -8407,11 +8079,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8410: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8082: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8414: \$? = $ac_status" >&5 + echo "$as_me:8086: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8462,15 +8134,13 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; @@ -8480,7 +8150,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic='-fno-common' ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -8538,7 +8208,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -8571,7 +8241,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static='-Bstatic' ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' @@ -8590,22 +8260,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - esac - ;; esac ;; @@ -8615,10 +8269,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static='-non_shared' ;; - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' @@ -8681,12 +8331,12 @@ if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then +if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_pic_works=no + lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -8697,27 +8347,27 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8700: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8350: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8704: \$? = $ac_status" >&5 + echo "$as_me:8354: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes + lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then +if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -8744,13 +8394,13 @@ esac wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then +if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_static_works=no + lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -8760,20 +8410,20 @@ else $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes + lt_prog_compiler_static_works=yes fi else - lt_cv_prog_compiler_static_works=yes + lt_prog_compiler_static_works=yes fi fi - $rm -r conftest* + $rm conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } -if test x"$lt_cv_prog_compiler_static_works" = xyes; then +if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= @@ -8790,7 +8440,7 @@ else mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -8801,11 +8451,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8804: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8454: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8808: \$? = $ac_status" >&5 + echo "$as_me:8458: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8885,13 +8535,12 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do @@ -8950,7 +8599,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # See if GNU ld supports shared libraries. case $host_os in - aix[3-9]*) + aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no @@ -8998,7 +8647,7 @@ EOF allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -9016,7 +8665,7 @@ EOF fi ;; - interix[3-9]*) + interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' @@ -9031,7 +8680,7 @@ EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -9049,30 +8698,20 @@ EOF ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - link_all_deplibs=no else ld_shlibs=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -9170,7 +8809,7 @@ _LT_EOF fi ;; - aix[4-9]*) + aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -9190,7 +8829,7 @@ _LT_EOF # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -9224,7 +8863,7 @@ _LT_EOF strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported @@ -9298,18 +8937,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9364,18 +8996,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9429,7 +9054,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; @@ -9462,18 +9087,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -9513,7 +9139,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -9615,7 +9241,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi link_all_deplibs=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -9635,28 +9261,24 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' else - ld_shlibs=no + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -9715,16 +9337,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs=yes ;; @@ -9781,7 +9404,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no @@ -9858,7 +9481,7 @@ x|xyes) { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -9916,55 +9539,17 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -9985,7 +9570,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix[4-9]*) +aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no @@ -10124,8 +9709,12 @@ darwin* | rhapsody*) shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -10142,6 +9731,18 @@ freebsd1*) dynamic_linker=no ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10179,7 +9780,7 @@ freebsd* | dragonfly*) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -10242,7 +9843,7 @@ hpux9* | hpux10* | hpux11*) postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -10297,7 +9898,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) version_type=linux need_lib_prefix=no need_version=no @@ -10311,10 +9912,31 @@ linux* | k*bsd*-gnu) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 9919 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -10326,7 +9948,7 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) +knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -10335,7 +9957,7 @@ netbsdelf*-gnu) shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' + dynamic_linker='GNU ld.so' ;; netbsd*) @@ -10416,11 +10038,7 @@ osf3* | osf4* | osf5*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) @@ -10519,21 +10137,6 @@ esac echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" -fi - -sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" -fi - -sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" - variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -10591,7 +10194,6 @@ else darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else @@ -10853,7 +10455,7 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } @@ -11129,7 +10731,7 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -11178,7 +10780,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&6;} # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: @@ -11611,6 +11211,9 @@ CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -11744,11 +11347,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects +predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects +postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -11758,13 +11361,9 @@ predeps=$lt_predeps # shared library. postdeps=$lt_postdeps -# The directories searched by this compiler when creating a shared -# library -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -11844,13 +11443,13 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols @@ -12010,7 +11609,6 @@ postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= -compiler_lib_search_dirs_CXX= # Source file extension for C++ test sources. ac_ext=cpp @@ -12020,10 +11618,10 @@ objext=o objext_CXX=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" +lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }' +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -12039,16 +11637,16 @@ compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* +$rm conftest* # Allow CC to be a program name with arguments. @@ -12255,7 +11853,7 @@ case $host_os in # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - aix[4-9]*) + aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -12268,7 +11866,7 @@ case $host_os in # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) @@ -12304,7 +11902,7 @@ case $host_os in strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported @@ -12378,18 +11976,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -12445,18 +12036,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -12526,31 +12110,59 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi fi ;; darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes - allow_undefined_flag_CXX="$_lt_dar_allow_undefined" - if test "$GXX" = yes ; then + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' - archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - if test "$lt_cv_apple_cc_single_mod" != "yes"; then - archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -12584,7 +12196,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi freebsd-elf*) archive_cmds_need_lc_CXX=no ;; - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -12633,7 +12245,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_separator_CXX=: case $host_cpu in - hppa*64*|ia64*) ;; + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; @@ -12701,7 +12315,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; esac ;; - interix[3-9]*) + interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' @@ -12741,7 +12355,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -12793,7 +12407,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; - pgCC* | pgcpp*) + pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' @@ -12821,29 +12435,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; esac ;; lynxos*) @@ -12866,7 +12457,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= @@ -12882,20 +12473,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ld_shlibs_CXX=no ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - else - ld_shlibs_CXX=no + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi + output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in @@ -13057,10 +12644,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes @@ -13107,12 +12699,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac fi ;; esac @@ -13200,6 +12786,7 @@ test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" + cat > conftest.$ac_ext <&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - # - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - solaris*) case $cc_basename in CC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - postdeps_CXX='-library=Cstd -library=Crun' - fi + postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac + case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac @@ -13391,14 +12941,12 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32*) + mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) @@ -13410,7 +12958,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -13436,7 +12984,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac else case $host_os in - aix[4-9]*) + aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor @@ -13476,7 +13024,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } ;; esac ;; - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -13519,7 +13067,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } ;; esac ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -13532,7 +13080,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; - pgCC* | pgcpp*) + pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' @@ -13546,14 +13094,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static_CXX='-non_shared' ;; *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - esac ;; esac ;; @@ -13570,7 +13110,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in @@ -13663,12 +13203,12 @@ if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_pic_works_CXX=no + lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -13679,27 +13219,27 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13682: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13222: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13686: \$? = $ac_status" >&5 + echo "$as_me:13226: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_CXX=yes + lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } -if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; @@ -13726,13 +13266,13 @@ esac wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_static_works_CXX=no + lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13742,20 +13282,20 @@ else $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_CXX=yes + lt_prog_compiler_static_works_CXX=yes fi else - lt_cv_prog_compiler_static_works_CXX=yes + lt_prog_compiler_static_works_CXX=yes fi fi - $rm -r conftest* + $rm conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } -if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= @@ -13772,7 +13312,7 @@ else mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -13783,11 +13323,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13786: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13326: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13790: \$? = $ac_status" >&5 + echo "$as_me:13330: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13840,7 +13380,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in - aix[4-9]*) + aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then @@ -13853,16 +13393,12 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - link_all_deplibs_CXX=no + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } @@ -13888,7 +13424,7 @@ x|xyes) { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -13946,7 +13482,20 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -13964,7 +13513,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix[4-9]*) +aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no @@ -14103,7 +13652,12 @@ darwin* | rhapsody*) shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -14120,6 +13674,18 @@ freebsd1*) dynamic_linker=no ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -14157,7 +13723,7 @@ freebsd* | dragonfly*) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -14220,7 +13786,7 @@ hpux9* | hpux10* | hpux11*) postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -14275,7 +13841,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) version_type=linux need_lib_prefix=no need_version=no @@ -14289,10 +13855,31 @@ linux* | k*bsd*-gnu) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 13862 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -14304,7 +13891,7 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) +knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -14313,7 +13900,7 @@ netbsdelf*-gnu) shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' + dynamic_linker='GNU ld.so' ;; netbsd*) @@ -14397,10 +13984,6 @@ osf3* | osf4* | osf5*) sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -14497,21 +14080,6 @@ esac echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" -fi - -sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" -fi - -sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" - variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -14595,7 +14163,6 @@ if test -f "$ltmain"; then predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ - compiler_lib_search_dirs_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ @@ -14611,7 +14178,6 @@ if test -f "$ltmain"; then module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ - fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do @@ -14697,6 +14263,9 @@ CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -14830,11 +14399,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_CXX +predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_CXX +postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -14844,13 +14413,9 @@ predeps=$lt_predeps_CXX # shared library. postdeps=$lt_postdeps_CXX -# The directories searched by this compiler when creating a shared -# library -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX - # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -14930,13 +14495,13 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -15027,17 +14592,10 @@ objext=o objext_F77=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="\ - subroutine t - return - end -" +lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests -lt_simple_link_test_code="\ - program t - end -" +lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -15053,16 +14611,16 @@ compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* +$rm conftest* # Allow CC to be a program name with arguments. @@ -15100,7 +14658,7 @@ aix3*) postinstall_cmds='$RANLIB $lib' fi ;; -aix[4-9]*) +aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi @@ -15146,15 +14704,13 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; @@ -15164,7 +14720,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic_F77='-fno-common' ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -15222,7 +14778,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' @@ -15255,7 +14811,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static_F77='-Bstatic' ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' @@ -15274,22 +14830,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - lt_prog_compiler_wl_F77='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - lt_prog_compiler_wl_F77='' - ;; - esac - ;; esac ;; @@ -15299,10 +14839,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static_F77='-non_shared' ;; - rdos*) - lt_prog_compiler_static_F77='-non_shared' - ;; - solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' @@ -15365,12 +14901,12 @@ if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_pic_works_F77=no + lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -15381,27 +14917,27 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15384: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14920: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15388: \$? = $ac_status" >&5 + echo "$as_me:14924: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_F77=yes + lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } -if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; @@ -15428,13 +14964,13 @@ esac wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then +if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_static_works_F77=no + lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15444,20 +14980,20 @@ else $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_F77=yes + lt_prog_compiler_static_works_F77=yes fi else - lt_cv_prog_compiler_static_works_F77=yes + lt_prog_compiler_static_works_F77=yes fi fi - $rm -r conftest* + $rm conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } -if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then +if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= @@ -15474,7 +15010,7 @@ else mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -15485,11 +15021,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15488: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15024: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15492: \$? = $ac_status" >&5 + echo "$as_me:15028: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15569,13 +15105,12 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do @@ -15634,7 +15169,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # See if GNU ld supports shared libraries. case $host_os in - aix[3-9]*) + aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no @@ -15682,7 +15217,7 @@ EOF allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -15700,7 +15235,7 @@ EOF fi ;; - interix[3-9]*) + interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' @@ -15715,7 +15250,7 @@ EOF archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -15733,30 +15268,20 @@ EOF ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -15854,7 +15379,7 @@ _LT_EOF fi ;; - aix[4-9]*) + aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -15874,7 +15399,7 @@ _LT_EOF # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -15908,7 +15433,7 @@ _LT_EOF strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported @@ -15972,18 +15497,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -16028,18 +15546,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -16093,7 +15604,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; @@ -16126,18 +15637,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -16177,7 +15689,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes @@ -16279,7 +15791,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi link_all_deplibs_F77=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -16299,28 +15811,24 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' else - ld_shlibs_F77=no + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -16379,16 +15887,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs_F77=yes ;; @@ -16445,7 +15954,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no @@ -16522,7 +16031,7 @@ x|xyes) { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -16580,7 +16089,20 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -16598,7 +16120,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix[4-9]*) +aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no @@ -16737,7 +16259,12 @@ darwin* | rhapsody*) shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -16754,6 +16281,18 @@ freebsd1*) dynamic_linker=no ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -16791,7 +16330,7 @@ freebsd* | dragonfly*) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -16854,7 +16393,7 @@ hpux9* | hpux10* | hpux11*) postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -16909,7 +16448,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) version_type=linux need_lib_prefix=no need_version=no @@ -16923,10 +16462,31 @@ linux* | k*bsd*-gnu) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 16469 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -16938,7 +16498,7 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) +knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -16947,7 +16507,7 @@ netbsdelf*-gnu) shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' + dynamic_linker='GNU ld.so' ;; netbsd*) @@ -17031,10 +16591,6 @@ osf3* | osf4* | osf5*) sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -17131,21 +16687,6 @@ esac echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" -fi - -sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" -fi - -sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" - variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -17229,7 +16770,6 @@ if test -f "$ltmain"; then predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ - compiler_lib_search_dirs_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ @@ -17245,7 +16785,6 @@ if test -f "$ltmain"; then module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ - fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do @@ -17331,6 +16870,9 @@ CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -17464,11 +17006,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_F77 +predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_F77 +postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -17478,13 +17020,9 @@ predeps=$lt_predeps_F77 # shared library. postdeps=$lt_postdeps_F77 -# The directories searched by this compiler when creating a shared -# library -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 - # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -17564,13 +17102,13 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 @@ -17628,10 +17166,10 @@ objext=o objext_GCJ=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" +lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -17647,16 +17185,16 @@ compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* +$rm conftest* # Allow CC to be a program name with arguments. @@ -17694,7 +17232,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -17705,11 +17243,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17708: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17246: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17712: \$? = $ac_status" >&5 + echo "$as_me:17250: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17760,16 +17298,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) @@ -17778,7 +17314,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_pic_GCJ='-fno-common' ;; - interix[3-9]*) + interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -17836,10 +17372,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac ;; - mingw* | cygwin* | pw32* | os2*) + mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) @@ -17869,7 +17405,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static_GCJ='-Bstatic' ;; - linux* | k*bsd*-gnu) + linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' @@ -17888,22 +17424,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - lt_prog_compiler_wl_GCJ='' - ;; - esac - ;; esac ;; @@ -17913,10 +17433,6 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } lt_prog_compiler_static_GCJ='-non_shared' ;; - rdos*) - lt_prog_compiler_static_GCJ='-non_shared' - ;; - solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' @@ -17979,12 +17495,12 @@ if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_pic_works_GCJ=no + lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -17995,27 +17511,27 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17998: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17514: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18002: \$? = $ac_status" >&5 + echo "$as_me:17518: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works_GCJ=yes + lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } -if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; @@ -18042,13 +17558,13 @@ esac wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_static_works_GCJ=no + lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext + printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -18058,20 +17574,20 @@ else $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works_GCJ=yes + lt_prog_compiler_static_works_GCJ=yes fi else - lt_cv_prog_compiler_static_works_GCJ=yes + lt_prog_compiler_static_works_GCJ=yes fi fi - $rm -r conftest* + $rm conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; } +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } -if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= @@ -18088,7 +17604,7 @@ else mkdir conftest cd conftest mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -18099,11 +17615,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18102: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17618: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18106: \$? = $ac_status" >&5 + echo "$as_me:17622: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18183,13 +17699,12 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do @@ -18248,7 +17763,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # See if GNU ld supports shared libraries. case $host_os in - aix[3-9]*) + aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no @@ -18296,7 +17811,7 @@ EOF allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -18314,7 +17829,7 @@ EOF fi ;; - interix[3-9]*) + interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' @@ -18329,7 +17844,7 @@ EOF archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | k*bsd*-gnu) + linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -18347,30 +17862,20 @@ EOF ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - *) - tmp_sharedflag='-shared' ;; - esac - archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi - link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -18468,7 +17973,7 @@ _LT_EOF fi ;; - aix[4-9]*) + aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -18488,7 +17993,7 @@ _LT_EOF # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -18522,7 +18027,7 @@ _LT_EOF strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - : + hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported @@ -18596,18 +18101,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18662,18 +18160,11 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18727,7 +18218,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; @@ -18760,18 +18251,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -18811,7 +18303,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes @@ -18913,7 +18405,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi link_all_deplibs_GCJ=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -18933,28 +18425,24 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ;; openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' else - ld_shlibs_GCJ=no + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac fi ;; @@ -19013,16 +18501,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' - fi - ;; + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs_GCJ=yes ;; @@ -19079,7 +18568,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no @@ -19156,7 +18645,7 @@ x|xyes) { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -19214,7 +18703,20 @@ shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" - +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi need_lib_prefix=unknown hardcode_into_libs=no @@ -19232,7 +18734,7 @@ aix3*) soname_spec='${libname}${release}${shared_ext}$major' ;; -aix[4-9]*) +aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no @@ -19371,7 +18873,12 @@ darwin* | rhapsody*) shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -19388,6 +18895,18 @@ freebsd1*) dynamic_linker=no ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -19425,7 +18944,7 @@ freebsd* | dragonfly*) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - *) # from 4.6 on, and DragonFly + freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -19488,7 +19007,7 @@ hpux9* | hpux10* | hpux11*) postinstall_cmds='chmod 555 $lib' ;; -interix[3-9]*) +interix3*) version_type=linux need_lib_prefix=no need_version=no @@ -19543,7 +19062,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu) +linux*) version_type=linux need_lib_prefix=no need_version=no @@ -19557,10 +19076,31 @@ linux* | k*bsd*-gnu) # before this can be enabled. hardcode_into_libs=yes + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line 19083 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -19572,7 +19112,7 @@ linux* | k*bsd*-gnu) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) +knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -19581,7 +19121,7 @@ netbsdelf*-gnu) shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' + dynamic_linker='GNU ld.so' ;; netbsd*) @@ -19665,10 +19205,6 @@ osf3* | osf4* | osf5*) sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -rdos*) - dynamic_linker=no - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -19765,21 +19301,6 @@ esac echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" -fi - -sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" -fi - -sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" - variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -19863,7 +19384,6 @@ if test -f "$ltmain"; then predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ - compiler_lib_search_dirs_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ @@ -19879,7 +19399,6 @@ if test -f "$ltmain"; then module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ - fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do @@ -19965,6 +19484,9 @@ CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -20098,11 +19620,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_GCJ +predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_GCJ +postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -20112,13 +19634,9 @@ predeps=$lt_predeps_GCJ # shared library. postdeps=$lt_postdeps_GCJ -# The directories searched by this compiler when creating a shared -# library -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ - # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -20198,13 +19716,13 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ @@ -20261,7 +19779,7 @@ objext=o objext_RC=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" @@ -20280,16 +19798,16 @@ compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext +printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* +$rm conftest* # Allow CC to be a program name with arguments. @@ -20349,7 +19867,6 @@ if test -f "$ltmain"; then predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ - compiler_lib_search_dirs_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ @@ -20365,7 +19882,6 @@ if test -f "$ltmain"; then module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ - fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do @@ -20451,6 +19967,9 @@ CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + # An ERE matcher. EGREP=$lt_EGREP @@ -20584,11 +20103,11 @@ striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=$lt_predep_objects_RC +predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=$lt_postdep_objects_RC +postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. @@ -20598,13 +20117,9 @@ predeps=$lt_predeps_RC # shared library. postdeps=$lt_postdeps_RC -# The directories searched by this compiler when creating a shared -# library -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC - # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -20684,13 +20199,13 @@ variables_saved_for_relink="$variables_saved_for_relink" link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path=$lt_fix_srcfile_path +fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC @@ -22658,7 +22173,7 @@ fi echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6; } if test $ac_cv_lib_crypt_crypt = yes; then HAVE_CRYPT="yes" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lcrypt" + GUESTD_LDADD="$GUESTD_LDADD -lcrypt" else { { echo "$as_me:$LINENO: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&5 echo "$as_me: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&2;} @@ -22820,7 +22335,7 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -ldl" + GUESTD_LDADD="$GUESTD_LDADD -ldl" else { { echo "$as_me:$LINENO: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&5 echo "$as_me: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&2;} @@ -23082,8 +22597,8 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lpthread" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lpthread" + GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lpthread" else { { echo "$as_me:$LINENO: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&5 echo "$as_me: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&2;} @@ -23091,29 +22606,295 @@ echo "$as_me: error: libpthread not found. Please install the libc/libpthread de fi -if test "$os" = "solaris"; then - # libdnet is needed on Solaris to build guestInfoPosix.c. - # Extract the first word of "dnet-config", so it can be a program name with args. -set dummy dnet-config; ac_word=$2 +# Check whether --with-procps was given. +if test "${with_procps+set}" = set; then + withval=$with_procps; +else + with_procps=yes +fi + + +if test "$with_procps" = "yes"; then + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LDFLAGS $LDFLAGS" + { echo "$as_me:$LINENO: checking for getstat in -lproc-3.2.7" >&5 +echo $ECHO_N "checking for getstat in -lproc-3.2.7... $ECHO_C" >&6; } +if test "${ac_cv_lib_proc_3_2_7_getstat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lproc-3.2.7 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getstat (); +int +main () +{ +return getstat (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_proc_3_2_7_getstat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_proc_3_2_7_getstat=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_proc_3_2_7_getstat" >&5 +echo "${ECHO_T}$ac_cv_lib_proc_3_2_7_getstat" >&6; } +if test $ac_cv_lib_proc_3_2_7_getstat = yes; then + if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi +else + { { echo "$as_me:$LINENO: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&5 +echo "$as_me: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&2;} + { (exit 1); exit 1; }; } +fi + + LDFLAGS="$ORIGINAL_LDFLAGS" + + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" + + # On Debian, the 'libproc-dev' package does not contain the libproc + # shared object; it is provided in the 'procps' package. Having the + # 'procps' package installed without 'libproc-dev' would lead to + # compilation errors down the line, so to avoid that we explicitly + # check for one of the libproc headers that is consumed in the build. + if test -n "$CUSTOM_PROCPS_CFLAGS"; then + PROCPS_CFLAGS="$CUSTOM_PROCPS_CFLAGS" + else + # XXX: Unfortunately, the libproc devel package doesn't appear + # to ship with a configuration script or pkg-config manifest + # file, so there's no portable way to get the location of its + # headers. For now we default to /usr/include. + PROCPS_CFLAGS="-I/usr/include" + fi + ORIGINAL_CFLAGS="$CFLAGS" + CFLAGS="$PROCPS_CFLAGS $CFLAGS" + if test "${ac_cv_header_proc_sysinfo_h+set}" = set; then + { echo "$as_me:$LINENO: checking for proc/sysinfo.h" >&5 +echo $ECHO_N "checking for proc/sysinfo.h... $ECHO_C" >&6; } +if test "${ac_cv_header_proc_sysinfo_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_proc_sysinfo_h" >&5 +echo "${ECHO_T}$ac_cv_header_proc_sysinfo_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking proc/sysinfo.h usability" >&5 +echo $ECHO_N "checking proc/sysinfo.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking proc/sysinfo.h presence" >&5 +echo $ECHO_N "checking proc/sysinfo.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: proc/sysinfo.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: proc/sysinfo.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## -------------------------------------------------------- ## +## Report this to open-vm-tools-devel@lists.sourceforge.net ## +## -------------------------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for proc/sysinfo.h" >&5 +echo $ECHO_N "checking for proc/sysinfo.h... $ECHO_C" >&6; } +if test "${ac_cv_header_proc_sysinfo_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_proc_sysinfo_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_proc_sysinfo_h" >&5 +echo "${ECHO_T}$ac_cv_header_proc_sysinfo_h" >&6; } + +fi +if test $ac_cv_header_proc_sysinfo_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: libproc headers not found. Please configure without procps (using --without-procps) or install libproc devel package" >&5 +echo "$as_me: error: libproc headers not found. Please configure without procps (using --without-procps) or install libproc devel package" >&2;} + { (exit 1); exit 1; }; } +fi + + + CFLAGS="$ORIGINAL_CFLAGS" +fi + +if test "$with_procps" != "yes"; then +cat >>confdefs.h <<\_ACEOF +#define NO_PROCPS 1 +_ACEOF + +fi + + +# Check whether --with-dnet was given. +if test "${with_dnet+set}" = set; then + withval=$with_dnet; +else + with_dnet=yes +fi + + +if test "$with_dnet" = "yes"; then + + # On Debian, dnet is installed via the libdumbnet package. We need to + # detect this so that our source files include dumbnet.h instead of + # dnet.h, which is part of a different package altogether. + for ac_prog in dumbnet-config dnet-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DNET_CONFIG+set}" = set; then +if test "${ac_cv_prog_DNET_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $DNET_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_DNET_CONFIG="$DNET_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$DNET_CONFIG"; then + ac_cv_prog_DNET_CONFIG="$DNET_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DNET_CONFIG="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_DNET_CONFIG="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -23121,11 +22902,9 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_DNET_CONFIG" && ac_cv_path_DNET_CONFIG="no" - ;; -esac fi -DNET_CONFIG=$ac_cv_path_DNET_CONFIG +fi +DNET_CONFIG=$ac_cv_prog_DNET_CONFIG if test -n "$DNET_CONFIG"; then { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 echo "${ECHO_T}$DNET_CONFIG" >&6; } @@ -23135,18 +22914,35 @@ echo "${ECHO_T}no" >&6; } fi + test -n "$DNET_CONFIG" && break +done +test -n "$DNET_CONFIG" || DNET_CONFIG="no" + + + if test "$DNET_CONFIG" != no; then + DNET_CFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + cat >>confdefs.h <<\_ACEOF +#define DNET_IS_DUMBNET 1 +_ACEOF - if test "$DNET_CONFIG" = "no"; then - { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&5 -echo "$as_me: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&2;} + fi + else + { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&5 +echo "$as_me: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&2;} { (exit 1); exit 1; }; } - fi + fi +fi - DNET_CFLAGS="`$DNET_CONFIG --cflags`" - DNET_LIBS="`$DNET_CONFIG --libs`" +if test "$with_dnet" != "yes"; then +cat >>confdefs.h <<\_ACEOF +#define NO_DNET 1 +_ACEOF - GUESTD_LDFLAGS="$GUESTD_LDFLAGS $DNET_LIBS" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS $DNET_LIBS" fi ### @@ -26239,9 +26035,6 @@ fi ### Specific features and OS/arch flags / actions ### -# Capture the CFLAGS, so we can restore them later. -ORIGINAL_CFLAGS="$CFLAGS" - # Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will # certainly error out. if test "$os$userSpaceBitness" = "linux32"; then @@ -26301,6 +26094,7 @@ fi # remove const'ness without an explicit cast). { echo "$as_me:$LINENO: checking for the new format of iconv" >&5 echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } +ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26457,6 +26251,7 @@ done { echo "$as_me:$LINENO: checking for setresuid" >&5 echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26516,6 +26311,7 @@ for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized; do { echo "$as_me:$LINENO: checking for GCC flag $TEST_CFLAG" >&5 echo $ECHO_N "checking for GCC flag $TEST_CFLAG... $ECHO_C" >&6; } + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26612,14 +26408,14 @@ if test "$os" = "solaris"; then LIB_IMPERSONATE_CFLAGS="$LIB_IMPERSONATE_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIB_USER_CFLAGS="$LIB_USER_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lsocket" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" VMWARE_USER_CFLAGS="$VMWARE_USER_CFLAGS -I/usr/X11/include/" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lXext" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lX11" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lsocket" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" # uname -r on Solaris 10 reports "5.10" if test "$osVersion" -ge 510000; then @@ -26718,6 +26514,8 @@ fi + + ### Lib substs @@ -26739,7 +26537,7 @@ fi ### ### Create the Makefiles ### -ac_config_files="$ac_config_files Makefile lib/Makefile lib/atomic/Makefile lib/atomic/shared/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/ghIntegrationStub/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/strUtil/Makefile lib/string/Makefile lib/string/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/unityStub/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile" +ac_config_files="$ac_config_files Makefile lib/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/ghIntegrationStub/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/strUtil/Makefile lib/string/Makefile lib/string/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/unityStub/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile" ### @@ -27234,7 +27032,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by open-vm-tools $as_me 2008.02.13-77928, which was +This file was extended by open-vm-tools $as_me 2008.04.14-87182, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27281,7 +27079,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -open-vm-tools config.status 2008.02.13-77928 +open-vm-tools config.status 2008.04.14-87182 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -27389,8 +27187,6 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "lib/atomic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/Makefile" ;; - "lib/atomic/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/shared/Makefile" ;; "lib/auth/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auth/Makefile" ;; "lib/backdoor/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/Makefile" ;; "lib/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; @@ -27603,12 +27399,12 @@ LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim -DSYMUTIL!$DSYMUTIL$ac_delim -NMEDIT!$NMEDIT$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -27650,8 +27446,6 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim @@ -27683,6 +27477,8 @@ GTK_CFLAGS!$GTK_CFLAGS$ac_delim GTK_LIBS!$GTK_LIBS$ac_delim DNET_CFLAGS!$DNET_CFLAGS$ac_delim DNET_LIBS!$DNET_LIBS$ac_delim +PROCPS_CFLAGS!$PROCPS_CFLAGS$ac_delim +PROCPS_LIBS!$PROCPS_LIBS$ac_delim LIB_AUTH_CFLAGS!$LIB_AUTH_CFLAGS$ac_delim LIB_FILE_CFLAGS!$LIB_FILE_CFLAGS$ac_delim LIB_HGFS_SERVER_CFLAGS!$LIB_HGFS_SERVER_CFLAGS$ac_delim @@ -27691,9 +27487,9 @@ LIB_MISC_CFLAGS!$LIB_MISC_CFLAGS$ac_delim LIB_PROC_MGR_CFLAGS!$LIB_PROC_MGR_CFLAGS$ac_delim LIB_STRING_CFLAGS!$LIB_STRING_CFLAGS$ac_delim LIB_USER_CFLAGS!$LIB_USER_CFLAGS$ac_delim -GUESTD_LDFLAGS!$GUESTD_LDFLAGS$ac_delim +GUESTD_LDADD!$GUESTD_LDADD$ac_delim VMWARE_USER_CFLAGS!$VMWARE_USER_CFLAGS$ac_delim -VMWARE_USER_LDFLAGS!$VMWARE_USER_LDFLAGS$ac_delim +VMWARE_USER_LDADD!$VMWARE_USER_LDADD$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF @@ -28020,7 +27816,7 @@ echo "$as_me: executing $ac_file commands" >&6;} # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac index c1756f46c..92761bcc5 100755 --- a/open-vm-tools/configure.ac +++ b/open-vm-tools/configure.ac @@ -24,7 +24,7 @@ AC_INIT( [open-vm-tools], - [2008.02.13-77928], + [2008.04.14-87182], [open-vm-tools-devel@lists.sourceforge.net]) # In order to make this configure script auto-detect situations where @@ -103,6 +103,10 @@ AM_INIT_AUTOMAKE ### # These need to be declared after initialization. +# Some of our macro call-sites require changes to CFLAGS/LDFLAGS. In such +# places, we save the original value of CFLAGS/LDFLAGS before the macro call +# and restore it when the call is done. We must perform this save at each macro +# site, because CFLAGS/LDFLAGS may change over the course of configuration. CFLAGS="$CFLAGS -DUSING_AUTOCONF=1" ### @@ -256,7 +260,7 @@ AC_CHECK_LIB( [crypt], [crypt], [HAVE_CRYPT="yes" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lcrypt"], + GUESTD_LDADD="$GUESTD_LDADD -lcrypt"], [AC_MSG_ERROR( [libcrypt not found. Please install the libc/libcrypt devel package(s).])]) @@ -266,7 +270,7 @@ AC_CHECK_FUNCS( [AC_CHECK_LIB( dl, dlopen, - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -ldl", + GUESTD_LDADD="$GUESTD_LDADD -ldl", [AC_MSG_ERROR( [dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor.])])]) @@ -276,29 +280,95 @@ AC_CHECK_FUNCS([fcvt]) AC_CHECK_LIB( [pthread], [pthread_mutex_init], - [GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lpthread" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lpthread"], + [GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lpthread"], [AC_MSG_ERROR( [libpthread not found. Please install the libc/libpthread devel package(s).])]) -if test "$os" = "solaris"; then - # libdnet is needed on Solaris to build guestInfoPosix.c. - - AC_PATH_PROG( - [DNET_CONFIG], - [dnet-config], - [no]) +AC_ARG_WITH([procps], + [AS_HELP_STRING([--without-procps], + [compile without libproc (disables support for meminfo)])], + [], + [with_procps=yes]) + +if test "$with_procps" = "yes"; then + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LDFLAGS $LDFLAGS" + AC_CHECK_LIB( + [proc-3.2.7], + [getstat], + [if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi], + [AC_MSG_ERROR( + [libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])]) + LDFLAGS="$ORIGINAL_LDFLAGS" + + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" + + # On Debian, the 'libproc-dev' package does not contain the libproc + # shared object; it is provided in the 'procps' package. Having the + # 'procps' package installed without 'libproc-dev' would lead to + # compilation errors down the line, so to avoid that we explicitly + # check for one of the libproc headers that is consumed in the build. + if test -n "$CUSTOM_PROCPS_CFLAGS"; then + PROCPS_CFLAGS="$CUSTOM_PROCPS_CFLAGS" + else + # XXX: Unfortunately, the libproc devel package doesn't appear + # to ship with a configuration script or pkg-config manifest + # file, so there's no portable way to get the location of its + # headers. For now we default to /usr/include. + PROCPS_CFLAGS="-I/usr/include" + fi + ORIGINAL_CFLAGS="$CFLAGS" + CFLAGS="$PROCPS_CFLAGS $CFLAGS" + AC_CHECK_HEADER( + [proc/sysinfo.h], + [], + [AC_MSG_ERROR( + [libproc headers not found. Please configure without procps (using --without-procps) or install libproc devel package])]) + CFLAGS="$ORIGINAL_CFLAGS" +fi - if test "$DNET_CONFIG" = "no"; then - AC_MSG_ERROR( - [dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/]) - fi +if test "$with_procps" != "yes"; then +AC_DEFINE([NO_PROCPS], 1) +fi - DNET_CFLAGS="`$DNET_CONFIG --cflags`" - DNET_LIBS="`$DNET_CONFIG --libs`" +AC_ARG_WITH([dnet], + [AS_HELP_STRING([--without-dnet], + [compile without libdnet (disables support for nicinfo)])], + [], + [with_dnet=yes]) + +if test "$with_dnet" = "yes"; then + + # On Debian, dnet is installed via the libdumbnet package. We need to + # detect this so that our source files include dumbnet.h instead of + # dnet.h, which is part of a different package altogether. + AC_CHECK_PROGS([DNET_CONFIG], + [dumbnet-config dnet-config], + [no]) + + if test "$DNET_CONFIG" != no; then + DNET_CFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + AC_DEFINE([DNET_IS_DUMBNET], 1) + fi + else + AC_MSG_ERROR( + [dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net]) + fi +fi - GUESTD_LDFLAGS="$GUESTD_LDFLAGS $DNET_LIBS" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS $DNET_LIBS" +if test "$with_dnet" != "yes"; then +AC_DEFINE([NO_DNET], 1) fi ### @@ -362,9 +432,6 @@ AC_C_VOLATILE ### Specific features and OS/arch flags / actions ### -# Capture the CFLAGS, so we can restore them later. -ORIGINAL_CFLAGS="$CFLAGS" - # Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will # certainly error out. if test "$os$userSpaceBitness" = "linux32"; then @@ -385,6 +452,7 @@ fi # if the newer form is defined (because, in that case, we would be attempting to # remove const'ness without an explicit cast). AC_MSG_CHECKING([for the new format of iconv]) +ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_TRY_COMPILE( [#include ], @@ -411,6 +479,7 @@ if test "$os" = "linux"; then # setresuid() was wrapped beginning in glibc 2.3.2. AC_MSG_CHECKING([for setresuid]) # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" AC_TRY_COMPILE( [#define _GNU_SOURCE @@ -432,6 +501,7 @@ COMMON_CFLAGS="$COMMON_CFLAGS -Werror" for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized; do AC_MSG_CHECKING([for GCC flag $TEST_CFLAG]) + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" AC_TRY_COMPILE( [], @@ -490,14 +560,14 @@ if test "$os" = "solaris"; then LIB_IMPERSONATE_CFLAGS="$LIB_IMPERSONATE_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIB_USER_CFLAGS="$LIB_USER_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lsocket" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" VMWARE_USER_CFLAGS="$VMWARE_USER_CFLAGS -I/usr/X11/include/" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lXext" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lX11" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lsocket" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" # uname -r on Solaris 10 reports "5.10" if test "$osVersion" -ge 510000; then @@ -557,6 +627,8 @@ AC_SUBST([GTK_CFLAGS]) AC_SUBST([GTK_LIBS]) AC_SUBST([DNET_CFLAGS]) AC_SUBST([DNET_LIBS]) +AC_SUBST([PROCPS_CFLAGS]) +AC_SUBST([PROCPS_LIBS]) ### Lib substs @@ -571,10 +643,10 @@ AC_SUBST([LIB_USER_CFLAGS]) ### Program substs -AC_SUBST([GUESTD_LDFLAGS]) +AC_SUBST([GUESTD_LDADD]) AC_SUBST([VMWARE_USER_CFLAGS]) -AC_SUBST([VMWARE_USER_LDFLAGS]) +AC_SUBST([VMWARE_USER_LDADD]) ### ### Create the Makefiles @@ -582,8 +654,6 @@ AC_SUBST([VMWARE_USER_LDFLAGS]) AC_CONFIG_FILES([ \ Makefile \ lib/Makefile \ - lib/atomic/Makefile \ - lib/atomic/shared/Makefile \ lib/auth/Makefile \ lib/backdoor/Makefile \ lib/backdoor/shared/Makefile \ diff --git a/open-vm-tools/guestd/Makefile.am b/open-vm-tools/guestd/Makefile.am index d6218696a..65e3be5b9 100644 --- a/open-vm-tools/guestd/Makefile.am +++ b/open-vm-tools/guestd/Makefile.am @@ -25,7 +25,6 @@ AM_CFLAGS = AM_CFLAGS += @COMMON_CFLAGS@ guestd_LDADD = -guestd_LDADD += ../lib/atomic/libAtomic.a guestd_LDADD += ../lib/backdoor/libBackdoor.a guestd_LDADD += ../lib/conf/libConf.a guestd_LDADD += ../lib/dnd/libDnd.a @@ -76,9 +75,7 @@ else HGFS_BD = endif guestd_LDADD += $(HGFS_BD) - -guestd_LDFLAGS = -guestd_LDFLAGS += @GUESTD_LDFLAGS@ +guestd_LDADD += @GUESTD_LDADD@ guestd_SOURCES = guestd_SOURCES += debugStdio.c diff --git a/open-vm-tools/guestd/Makefile.in b/open-vm-tools/guestd/Makefile.in index afc42156e..08ccc2405 100644 --- a/open-vm-tools/guestd/Makefile.in +++ b/open-vm-tools/guestd/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -70,9 +70,8 @@ am_guestd_OBJECTS = debugStdio.$(OBJEXT) \ toolsDaemon.$(OBJEXT) guestd_OBJECTS = $(am_guestd_OBJECTS) @SOLARIS_TRUE@am__DEPENDENCIES_1 = ../lib/hgfsBd/libHgfsBd.a -guestd_DEPENDENCIES = ../lib/atomic/libAtomic.a \ - ../lib/backdoor/libBackdoor.a ../lib/conf/libConf.a \ - ../lib/dnd/libDnd.a ../lib/err/libErr.a \ +guestd_DEPENDENCIES = ../lib/backdoor/libBackdoor.a \ + ../lib/conf/libConf.a ../lib/dnd/libDnd.a ../lib/err/libErr.a \ ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ ../lib/hgfsServer/libHgfsServer.a \ @@ -96,9 +95,6 @@ guestd_DEPENDENCIES = ../lib/atomic/libAtomic.a \ ../lib/foundryMsg/libFoundryMsg.a ../lib/auth/libAuth.a \ ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ $(am__DEPENDENCIES_1) -guestd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(guestd_LDFLAGS) \ - $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -141,7 +137,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -153,7 +148,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -178,7 +173,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -187,6 +181,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -194,7 +190,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -255,8 +251,8 @@ AM_CFLAGS = @COMMON_CFLAGS@ # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of the # alphabetical order so their symbols are properly resolved. -guestd_LDADD = ../lib/atomic/libAtomic.a ../lib/backdoor/libBackdoor.a \ - ../lib/conf/libConf.a ../lib/dnd/libDnd.a ../lib/err/libErr.a \ +guestd_LDADD = ../lib/backdoor/libBackdoor.a ../lib/conf/libConf.a \ + ../lib/dnd/libDnd.a ../lib/err/libErr.a \ ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ ../lib/hgfsServer/libHgfsServer.a \ @@ -279,10 +275,9 @@ guestd_LDADD = ../lib/atomic/libAtomic.a ../lib/backdoor/libBackdoor.a \ ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ ../lib/foundryMsg/libFoundryMsg.a ../lib/auth/libAuth.a \ ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ - $(HGFS_BD) + $(HGFS_BD) @GUESTD_LDADD@ @SOLARIS_FALSE@HGFS_BD = @SOLARIS_TRUE@HGFS_BD = ../lib/hgfsBd/libHgfsBd.a -guestd_LDFLAGS = @GUESTD_LDFLAGS@ guestd_SOURCES = debugStdio.c foreignVMToolsDaemon.c \ foreignVMToolsNetworking.c foundryToolsDaemon.c main.c stub.c \ toolsDaemon.c @@ -328,7 +323,7 @@ clean-noinstPROGRAMS: done guestd$(EXEEXT): $(guestd_OBJECTS) $(guestd_DEPENDENCIES) @rm -f guestd$(EXEEXT) - $(guestd_LINK) $(guestd_OBJECTS) $(guestd_LDADD) $(LIBS) + $(LINK) $(guestd_OBJECTS) $(guestd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -376,8 +371,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -389,8 +384,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -400,12 +395,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/guestd/debugStdio.c b/open-vm-tools/guestd/debugStdio.c index 222fcd27d..70501cd3a 100644 --- a/open-vm-tools/guestd/debugStdio.c +++ b/open-vm-tools/guestd/debugStdio.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,11 +24,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #include #include #include @@ -48,7 +43,7 @@ #include "fileIO.h" #include "file.h" #include "system.h" - +#include "unicode.h" static char debugFile[FILE_MAXPATH] = {0}; static Bool debugEnabled = FALSE; @@ -170,7 +165,8 @@ void DebugToFile(const char *str) // IN FileIOResult fr; FileIODescriptor *fd; size_t bytesWritten; - char *str2; + Unicode timePrefix; + const char *timePrefixUtf8; ASSERT(debugFile[0] != 0); @@ -178,23 +174,33 @@ void DebugToFile(const char *str) // IN ASSERT_NOT_IMPLEMENTED(fd); FileIO_Invalidate(fd); - fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, FILEIO_OPEN_CREATE); + fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, + FILEIO_OPEN_CREATE); if (fr != FILEIO_SUCCESS) { Warning("---Error opening file '%s'.\n", debugFile); debugFile[0] = '\0'; - goto done; } - FileIO_Seek(fd, 0, FILEIO_SEEK_END); + /* + * XXX: Writing the date/time prefix in UTF-8 and the rest of the string in + * an unspecified encoding is rather broken, but it'll have to do until the + * rest of the Tools are made internationalization-safe. + */ + timePrefix = System_GetTimeAsString(); + if (timePrefix == NULL) { + Warning("---Error getting formatted time string.\n"); + goto close; + } + timePrefixUtf8 = UTF8(timePrefix); + ASSERT(timePrefixUtf8); - str2 = Str_Asprintf(NULL, "(%"FMT64"u) ", System_Uptime()); - fr = FileIO_Write(fd, str2, strlen(str2), &bytesWritten); + FileIO_Seek(fd, 0, FILEIO_SEEK_END); + fr = FileIO_Write(fd, timePrefixUtf8, strlen(timePrefixUtf8), &bytesWritten); fr = FileIO_Write(fd, str, strlen(str), &bytesWritten); - free(str2); + Unicode_Free(timePrefix); if (fr != FILEIO_SUCCESS) { Warning("---Error writing to file '%s'.\n", debugFile); - goto close; } close: diff --git a/open-vm-tools/guestd/foreignVMToolsDaemon.c b/open-vm-tools/guestd/foreignVMToolsDaemon.c index 9b2bb73a6..534116fa0 100644 --- a/open-vm-tools/guestd/foreignVMToolsDaemon.c +++ b/open-vm-tools/guestd/foreignVMToolsDaemon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/guestd/foreignVMToolsDaemon.h b/open-vm-tools/guestd/foreignVMToolsDaemon.h index 614d9b5a8..f84a22bea 100644 --- a/open-vm-tools/guestd/foreignVMToolsDaemon.h +++ b/open-vm-tools/guestd/foreignVMToolsDaemon.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/guestd/foreignVMToolsNetworking.c b/open-vm-tools/guestd/foreignVMToolsNetworking.c index 963746ea1..e1524284c 100644 --- a/open-vm-tools/guestd/foreignVMToolsNetworking.c +++ b/open-vm-tools/guestd/foreignVMToolsNetworking.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/guestd/foundryToolsDaemon.c b/open-vm-tools/guestd/foundryToolsDaemon.c index 3867f39dc..d4d587e37 100644 --- a/open-vm-tools/guestd/foundryToolsDaemon.c +++ b/open-vm-tools/guestd/foundryToolsDaemon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,10 +28,6 @@ #include #include -#if !defined(__FreeBSD__) && !defined(sun) -#define IMPLEMENT_SOCKET_MGR 1 -#endif - #ifdef _WIN32 #include #else @@ -40,7 +36,9 @@ #endif #ifdef _MSC_VER -# include +# include +# include +# include #elif _WIN32 # include "win95.h" #endif @@ -72,18 +70,13 @@ #include "hgfs.h" #include "system.h" #include "codeset.h" -#if IMPLEMENT_SOCKET_MGR -#include "socketMgr.h" -#endif #ifndef __FreeBSD__ #include "netutil.h" #endif -/* Stub out impersonation functions for these platforms. */ -#if defined(__FreeBSD__) || defined(sun) || defined(N_PLAT_NLM) -void Impersonate_Init(void) { return; } -#else +/* Only Win32 and Linux use impersonation functions. */ +#if !defined(__FreeBSD__) && !defined(sun) #include "impersonate.h" #endif @@ -95,7 +88,7 @@ static DblLnkLst_Links *globalEventQueue; // event queue for main event loop #define GUESTMSG_MAX_IN_SIZE (64 * 1024) /* vmx/main/guest_msg.c */ #define MAX64_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) # if defined(_WIN32) # define DECLARE_SYNCDRIVER_ERROR(name) DWORD name = ERROR_SUCCESS; @@ -139,7 +132,7 @@ static Bool ToolsDaemonHgfsImpersonated(char const **result, void *clientData); #endif -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonTcloSyncDriverFreeze(char const **result, size_t *resultLen, const char *name, @@ -174,10 +167,6 @@ void ToolsDaemonTcloReportProgramCompleted(const char *requestName, */ #define DEFAULT_RESULT_MSG_MAX_LENGTH 1024 -#if IMPLEMENT_SOCKET_MGR -static Bool socketMgrInitialized = FALSE; -#endif - static Bool thisProcessRunsAsRoot = FALSE; @@ -491,7 +480,7 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN Bool runAsRoot) // IN { static Bool inited = FALSE; -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool sync_driver_inited = FALSE; #endif @@ -506,6 +495,7 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN globalEventQueue, ToolsDaemonTcloReportProgramCompleted); +#if defined(linux) || defined(_WIN32) /* * Be careful, Impersonate_Init should only be ever called once per process. * @@ -515,6 +505,7 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN if (!inited && thisProcessRunsAsRoot) { Impersonate_Init(); } +#endif RpcIn_RegisterCallback(in, VIX_BACKDOORCOMMAND_RUN_PROGRAM, @@ -542,17 +533,8 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN VIX_BACKDOORCOMMAND_MOUNT_VOLUME_LIST, ToolsDaemonTcloMountHGFS, NULL); -#if IMPLEMENT_SOCKET_MGR - /* - * We can be called again in certain tools error recovery cases, such - * as restoring from a hibernation. This annoys SocketMgr_Init(). - */ - if (!inited) { - socketMgrInitialized = SocketMgr_Init(globalEventQueue); - } -#endif // IMPLEMENT_SOCKET_MGR -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) /* * Only init once, but always register the RpcIn. @@ -579,10 +561,8 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN } else { Debug("FoundryToolsDaemon: Failed to init SyncDriver, skipping command handlers.\n"); } - - inited = TRUE; - #endif + inited = TRUE; } // FoundryToolsDaemon_RegisterRoutines @@ -758,17 +738,11 @@ ToolsDaemonTcloOpenUrl(char const **result, // OUT Debug("Opening URL: \"%s\"\n", url); /* Actually open the URL. */ - #if !defined(WIN9XCOMPAT) if (!GuestApp_OpenUrl(url, strcmp(windowState, "maximize") == 0)) { err = VIX_E_FAIL; Debug("Failed to open the url \"%s\"\n", url); goto abort; } -#else - err = VIX_E_OP_NOT_SUPPORTED_ON_GUEST; - goto abort; -#endif - abort: if (impersonatingVMWareUser) { @@ -921,7 +895,7 @@ abort: *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonTcloSyncDriverFreeze(char const **result, // OUT size_t *resultLen, // OUT @@ -1038,7 +1012,7 @@ abort: *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonSyncDriverThawCallback(void *clientData) // IN (ignored) { @@ -1082,7 +1056,7 @@ exit: *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonTcloSyncDriverThaw(char const **result, // OUT size_t *resultLen, // OUT diff --git a/open-vm-tools/guestd/foundryToolsDaemon.h b/open-vm-tools/guestd/foundryToolsDaemon.h index 0b16b1f9c..30f3d0f58 100644 --- a/open-vm-tools/guestd/foundryToolsDaemon.h +++ b/open-vm-tools/guestd/foundryToolsDaemon.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/guestd/guestd_version.h b/open-vm-tools/guestd/guestd_version.h index bc06a09a8..d2e1bc67e 100644 --- a/open-vm-tools/guestd/guestd_version.h +++ b/open-vm-tools/guestd/guestd_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/guestd/main.c b/open-vm-tools/guestd/main.c index 66fefeb71..9b566cdcc 100644 --- a/open-vm-tools/guestd/main.c +++ b/open-vm-tools/guestd/main.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -68,6 +68,7 @@ #include "escape.h" #include "vmstdio.h" #include "vmBackup.h" +#include "codeset.h" #if !defined(__FreeBSD__) && !defined(sun) #include "socketMgr.h" @@ -725,20 +726,34 @@ GuestdGetBlessedAppList(void) { FILE* confFile = NULL; char *fileName = NULL; - const char *installPath = GuestApp_GetInstallPath(); + char *fileNameUtf8 = NULL; + char *installPath = GuestApp_GetInstallPath(); char *appName = NULL; size_t myLineLen; int index; blessedAppNode *ret = NULL; - ASSERT(installPath); + if (installPath == NULL) { + Debug("GuestdGetBlessedAppList: Unable to get install path\n"); + goto exit; + } - fileName = Str_Asprintf(NULL, "%s"DIRSEPS"%s", installPath, XAUTOSTART_CONF); - if (NULL == fileName) { + fileNameUtf8 = Str_Asprintf(NULL, "%s"DIRSEPS"%s", installPath, XAUTOSTART_CONF); + free(installPath); + if (NULL == fileNameUtf8) { Debug("GuestdGetBlessedAppList: Unable to allocate memory\n"); goto exit; } + + if (!CodeSet_Utf8ToCurrent(fileNameUtf8, + strlen(fileNameUtf8), + (char **)&fileName, + NULL)) { + Debug("GuestdGetBlessedAppList: Unable to convert to current encoding\n"); + goto exit; + } confFile = fopen(fileName, "r"); + free(fileName); if (NULL == confFile) { /* If can not open conf file, use default value. */ Debug("GuestdGetBlessedAppList: Unable to open conf file, use default value.\n"); @@ -786,7 +801,7 @@ default_exit: } } exit: - free(fileName); + free(fileNameUtf8); if (confFile) { fclose(confFile); } @@ -1034,16 +1049,17 @@ static void GuestdRunVMwareUser(pid_t blessedPid) // IN: blessed pid { char *fileName = NULL; - char *foundUser = NULL; char *xauth = NULL; Bool isXauthSet = FALSE; - FILE *envFile; + FILE *envFile = NULL; char buffer[65536]; size_t readSize; char *cmd; struct passwd *pwd; unsigned int index = 0; int blockFd; + struct stat sb; + int envFd = -1; /* * If current active account is non-root, vmware-user can not initialize @@ -1067,43 +1083,50 @@ GuestdRunVMwareUser(pid_t blessedPid) // IN: blessed pid * We may not be able to open the file due to the security reason. */ Debug("GuestdRunVMwareUser: Unable to open env file for %s\n", fileName); - free(fileName); goto childerror; } readSize = fread(buffer, 1, sizeof buffer, envFile); - /* Separator in environ is '\0'. */ - while (index < readSize) { - if (!strncmp(&buffer[index], "USER=", 5)) { - foundUser = Str_Asprintf(NULL, "%s", &buffer[index + 5]); - if (NULL == foundUser) { - Debug("GuestdRunVMwareUser: Unable to allocate memory\n"); - free(fileName); - fclose(envFile); - goto childerror; - } - break; - } - index += strlen(&buffer[index]) + 1; + /* + * Rather than consulting the user's USER environment variable, assume we + * can instead trust procfs's file permissions to determine processes' + * owners. + */ + if ((envFd = fileno(envFile)) == -1) { + Debug("GuestdRunVMwareUser: Unable to convert FILE * to descriptor\n"); + goto childerror; + } + + if (fstat(envFd, &sb) == -1) { + Debug("GuestdRunVMwareUser: Unable to lookup environment details\n"); + goto childerror; } + + /* + * At this point, we're finished with these, so go ahead and release them before + * executing vmware-user. + */ free(fileName); + fileName = NULL; + fclose(envFile); + envFile = NULL; - /* Switch from root to foundUser. */ - pwd = getpwnam(foundUser); + /* Switch from root to Xsession user. */ + pwd = getpwuid(sb.st_uid); if (pwd == NULL) { - Debug("GuestdRunVMwareUser: Unable to lookup UID for %s\n", foundUser); + Debug("GuestdRunVMwareUser: Unable to lookup account for uid %u\n", sb.st_uid); goto childerror; } if (setgid(pwd->pw_gid) != 0) { - Debug("GuestdRunVMwareUser: Unable to setgid for %s\n", foundUser); + Debug("GuestdRunVMwareUser: Unable to setgid for %s\n", pwd->pw_name); goto childerror; } if (setuid(pwd->pw_uid) != 0) { - Debug("GuestdRunVMwareUser: Unable to setuid for %s\n", foundUser); + Debug("GuestdRunVMwareUser: Unable to setuid for %s\n", pwd->pw_name); goto childerror; } @@ -1130,8 +1153,6 @@ GuestdRunVMwareUser(pid_t blessedPid) // IN: blessed pid goto childerror; } } - free(foundUser); - foundUser = NULL; free(xauth); xauth = NULL; @@ -1149,8 +1170,11 @@ GuestdRunVMwareUser(pid_t blessedPid) // IN: blessed pid /* We should only get here from a goto. */ childerror: - free(foundUser); free(xauth); + free(fileName); + if (envFile != NULL) { + fclose(envFile); + } if (blockFd >= 0 && !DnD_UninitializeBlocking(blockFd)) { Debug("GuestdRunVMwareUser unable to uninitialize blocking.\n"); } diff --git a/open-vm-tools/guestd/stub.c b/open-vm-tools/guestd/stub.c index 57a2ca7ed..7791bc915 100644 --- a/open-vm-tools/guestd/stub.c +++ b/open-vm-tools/guestd/stub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/guestd/toolsDaemon.c b/open-vm-tools/guestd/toolsDaemon.c index 5dd280a6b..d0c24385b 100644 --- a/open-vm-tools/guestd/toolsDaemon.c +++ b/open-vm-tools/guestd/toolsDaemon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -40,6 +40,7 @@ extern "C" { #ifdef _WIN32 # include # include "win95.h" +# include "win32u.h" #endif @@ -355,7 +356,7 @@ ToolsDaemonTimeSyncLoop(void *clientData) // IN *----------------------------------------------------------------------------- */ -#if defined(_WIN32) && !defined(SERVICE9X) +#if defined(_WIN32) static Bool ToolsDaemonDisableWinTimeDaemon(void) { @@ -477,7 +478,7 @@ ToolsDaemonStartStopTimeSyncLoop(ToolsDaemon_Data *data, // IN return FALSE; } -#if defined(_WIN32) && !defined(SERVICE9X) +#if defined(_WIN32) Debug("Daemon: Attempting to disable Windows Time daemon\n"); if (!ToolsDaemonDisableWinTimeDaemon()) { Debug("Daemon: Failed to disable Windows Time daemon\n"); @@ -845,18 +846,6 @@ ToolsDaemonTcloStateChange(char const **result, // OUT data->stateChgInProgress = (GuestOsState) stateChangeCmdTable[i].id; -#ifdef _WIN32 - /* - * Skip scripts on win95 altogether b/c they don't exit properly - * on some distributions of it (command window stays open) - */ - if (isWin95()) { - Debug("Skipping state change script on win 95\n"); - ToolsDaemonStateChangeDone(TRUE, data); - return RpcIn_SetRetVals(result, resultLen, "", TRUE); - } -#endif - script = GuestApp_GetDictEntry(*data->pConfDict, stateChgConfNames[stateChangeCmdTable[i].id]); ASSERT(script); @@ -872,21 +861,20 @@ ToolsDaemonTcloStateChange(char const **result, // OUT scriptCmd = Str_Asprintf(NULL, "(%s) 2>&1 >> %s", script, data->execLogPath); #else - /* Use different command shells on NT/9x. */ - if (isWinNTFamily()) { - char systemDir[1024]; + { + char systemDir[1024 * 3]; - GetSystemDirectory(systemDir, sizeof(systemDir)); + Win32U_GetSystemDirectory(systemDir, sizeof systemDir); scriptCmd = Str_Asprintf(NULL, "%s\\cmd.exe /c \"%s\"", systemDir, script); - } else { - char windowsDir[1024]; - - GetWindowsDirectory(windowsDir, sizeof(windowsDir)); - scriptCmd = Str_Asprintf(NULL, "%s\\command.com /c \"%s\"", - windowsDir, script); } #endif + if (scriptCmd == NULL) { + Debug("Could not format the cmd to run scripts\n"); + return RpcIn_SetRetVals(result, resultLen, + "Could not format cmd to run scritps", + FALSE); + } data->asyncProc = ProcMgr_ExecAsync(scriptCmd, NULL); if (data->asyncProc) { @@ -964,6 +952,10 @@ ToolsDaemonTcloCapReg(char const **result, // OUT Debug("ToolsDaemonTcloCapReg: Unable to register display topology set " "capability\n"); } + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 1")) { + Debug("ToolsDaemonTcloCapReg: Unable to register display global offset " + "capability\n"); + } if (!RpcOut_sendOne(NULL, NULL, "tools.capability.color_depth_set 1")) { Debug("ToolsDaemonTcloCapReg: Unable to register color depth set " "capability\n"); @@ -1002,29 +994,39 @@ ToolsDaemonTcloCapReg(char const **result, // OUT * defined when you build the NetWare Tools. */ #if (defined(_WIN32) || defined(linux)) && !defined(N_PLAT_NLM) - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.auto_upgrade 2")) { - Debug("ToolsDaemonTcloCapReg: Unable to register auto-upgrading capability.\n"); - } + { + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.auto_upgrade 2")) { + Debug("ToolsDaemonTcloCapReg: Unable to register " + "auto-upgrading capability.\n"); + } - if (guestTempDirectory == NULL) { + if (guestTempDirectory == NULL) { #ifdef _WIN32 - guestTempDirectory = File_GetTmpDir(FALSE); + guestTempDirectory = File_GetTmpDir(FALSE); #else - guestTempDirectory = Util_GetSafeTmpDir(FALSE); + guestTempDirectory = Util_GetSafeTmpDir(FALSE); #endif - } + } - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_temp_directory 1 %s", - guestTempDirectory)) { - Debug("ToolsDaemonTcloCapReg: Unable to register guest temp directory capability.\n"); - } - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_conf_directory %s", - GuestApp_GetConfPath())) { - Debug("ToolsDaemonTcloCapReg: Unable to register guest conf directory capability.\n"); + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_temp_directory 1 %s", + guestTempDirectory)) { + Debug("ToolsDaemonTcloCapReg: Unable to register guest temp " + "directory capability.\n"); + } } #endif #if !defined(N_PLAT_NLM) + { + char *confPath = GuestApp_GetConfPath(); + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_conf_directory %s", + confPath ? confPath : "")) { + Debug("ToolsDaemonTcloCapReg: Unable to register guest conf " + "directory capability.\n"); + } + free(confPath); + } + /* * Send the uptime here so that the VMX can detect soft resets. This must be * sent before the Tools version RPC since the version RPC handler uses the @@ -1419,8 +1421,8 @@ ToolsDaemon_Init(GuestApp_Dict **pConfDict, // IN ASSERT(pConfDict); ASSERT(*pConfDict); - ASSERT(haltCB); - ASSERT(rebootCB); + ASSERT(haltCB != NULL); + ASSERT(rebootCB != NULL); data = (ToolsDaemon_Data *) calloc(1, sizeof(ToolsDaemon_Data)); ASSERT_MEM_ALLOC(data); @@ -1438,13 +1440,11 @@ ToolsDaemon_Init(GuestApp_Dict **pConfDict, // IN data->resetCBData = resetCBData; data->timeSyncPeriod = 0; - if (!VmCheck_IsVirtualWorld()) { #if ALLOW_TOOLS_IN_FOREIGN_VM + if (!VmCheck_IsVirtualWorld()) { ToolsDaemon_InitializeForeignVM(data); -#else - Panic("The VMware service must be run from within a virtual machine.\n"); -#endif } +#endif #ifdef VMX86_DEBUG { @@ -1565,6 +1565,10 @@ ToolsDaemon_Cleanup(ToolsDaemon_Data *data) // IN Debug("%s: Unable to unregister display topology set capability\n", __FUNCTION__); } + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 0")) { + Debug("%s: Unable to unregister display global offset capability\n", + __FUNCTION__); + } if (!RpcOut_sendOne(NULL, NULL, "tools.capability.color_depth_set 0")) { Debug("%s: Unable to unregister color depth set capability\n", __FUNCTION__); @@ -1588,6 +1592,13 @@ ToolsDaemon_Cleanup(ToolsDaemon_Data *data) // IN } #endif +#if !defined(N_PLAT_NLM) + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_conf_directory 0")) { + Debug("%s: Unable to clear guest conf directory capability.\n", + __FUNCTION__); + } +#endif + #if ALLOW_TOOLS_IN_FOREIGN_VM if (runningInForeignVM) { ToolsDaemon_ShutdownForeignVM(); @@ -1750,47 +1761,15 @@ ToolsDaemon_GetMinResolution(GuestApp_Dict *dict, // IN unsigned int *width, // OUT unsigned int *height) // OUT { -#ifdef SERVICE9X - int minResolutionWidth; - int minResolutionHeight; - Bool success; - - ASSERT(dict); - ASSERT(width); - ASSERT(height); - - /* - * Win9x sometimes freaks out with resolutions under 640x480. See - * bug 58681. - */ - success = GuestApp_GetDictEntryInt(dict, - CONFNAME_RESOLUTION_MIN_WIDTH, - &minResolutionWidth); - if (!success) { - Debug("ToolsDaemon_GetMinResolution: Failed to get width\n"); - minResolutionWidth = 640; - } - - success = GuestApp_GetDictEntryInt(dict, - CONFNAME_RESOLUTION_MIN_HEIGHT, - &minResolutionHeight); - if (!success) { - Debug("ToolsDaemon_GetMinResolution: Failed to get height\n"); - minResolutionHeight = 480; - } - - *width = (unsigned int)minResolutionWidth; - *height = (unsigned int)minResolutionHeight; -#else ASSERT(width); ASSERT(height); /* - * It's assumed that other platforms don't have a minimum. + * This code is no longer used for Win9x platforms, and it's assumed that + * all other platforms don't have a minimum. */ *width = 0; *height = 0; -#endif } diff --git a/open-vm-tools/guestd/toolsDaemon.h b/open-vm-tools/guestd/toolsDaemon.h index cc1d1e726..d1d470dea 100644 --- a/open-vm-tools/guestd/toolsDaemon.h +++ b/open-vm-tools/guestd/toolsDaemon.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/hgfsclient/Makefile.am b/open-vm-tools/hgfsclient/Makefile.am index e93866db6..151412dfd 100644 --- a/open-vm-tools/hgfsclient/Makefile.am +++ b/open-vm-tools/hgfsclient/Makefile.am @@ -43,7 +43,6 @@ hgfsclient_LDADD += ../lib/rpcVmx/libRpcVmx.a hgfsclient_LDADD += ../lib/unicode/libUnicode.a hgfsclient_LDADD += ../lib/sync/libSync.a hgfsclient_LDADD += ../lib/misc/libMisc.a -hgfsclient_LDADD += ../lib/atomic/libAtomic.a hgfsclient_SOURCES = hgfsclient_SOURCES += hgfsclient.c diff --git a/open-vm-tools/hgfsclient/Makefile.in b/open-vm-tools/hgfsclient/Makefile.in index 76f8cd8d5..b6fed83e1 100644 --- a/open-vm-tools/hgfsclient/Makefile.in +++ b/open-vm-tools/hgfsclient/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -71,7 +71,7 @@ hgfsclient_DEPENDENCIES = ../lib/conf/libConf.a \ ../lib/err/libErr.a ../lib/file/libFile.a \ ../lib/message/libMessage.a ../lib/rpcVmx/libRpcVmx.a \ ../lib/unicode/libUnicode.a ../lib/sync/libSync.a \ - ../lib/misc/libMisc.a ../lib/atomic/libAtomic.a + ../lib/misc/libMisc.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -114,7 +114,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -126,7 +125,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -151,7 +150,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -160,6 +158,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -167,7 +167,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -237,7 +237,7 @@ hgfsclient_LDADD = ../lib/conf/libConf.a ../lib/guestApp/libGuestApp.a \ ../lib/err/libErr.a ../lib/file/libFile.a \ ../lib/message/libMessage.a ../lib/rpcVmx/libRpcVmx.a \ ../lib/unicode/libUnicode.a ../lib/sync/libSync.a \ - ../lib/misc/libMisc.a ../lib/atomic/libAtomic.a + ../lib/misc/libMisc.a hgfsclient_SOURCES = hgfsclient.c stub.c all: all-am @@ -324,8 +324,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -337,8 +337,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -348,12 +348,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/hgfsclient/hgfsclient.c b/open-vm-tools/hgfsclient/hgfsclient.c index 871f0ac5f..b60ab6f29 100644 --- a/open-vm-tools/hgfsclient/hgfsclient.c +++ b/open-vm-tools/hgfsclient/hgfsclient.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/hgfsclient/hgfsclient_version.h b/open-vm-tools/hgfsclient/hgfsclient_version.h index 70df0e1ee..ba5b52855 100644 --- a/open-vm-tools/hgfsclient/hgfsclient_version.h +++ b/open-vm-tools/hgfsclient/hgfsclient_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/hgfsclient/stub.c b/open-vm-tools/hgfsclient/stub.c index c64bbb4e0..b493f712c 100644 --- a/open-vm-tools/hgfsclient/stub.c +++ b/open-vm-tools/hgfsclient/stub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/hgfsmounter/Makefile.in b/open-vm-tools/hgfsmounter/Makefile.in index 21d1a5480..a44875692 100644 --- a/open-vm-tools/hgfsmounter/Makefile.in +++ b/open-vm-tools/hgfsmounter/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -304,8 +304,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -317,8 +317,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -328,12 +328,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/hgfsmounter/hgfsmounter.c b/open-vm-tools/hgfsmounter/hgfsmounter.c index 8dd8061fa..3a0c27fb9 100644 --- a/open-vm-tools/hgfsmounter/hgfsmounter.c +++ b/open-vm-tools/hgfsmounter/hgfsmounter.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -548,7 +548,7 @@ ParseOptions(const char *optionString, // IN: Option string to parse } else if (strcmp(key, "uid") == 0) { char *uidString = StrUtil_GetNextToken(&equalsIndex, keyVal, "="); if (uidString != NULL) { - uid_t uid; + uid_t uid = 0; valid = ParseUid(uidString, &uid); free(uidString); @@ -566,7 +566,7 @@ ParseOptions(const char *optionString, // IN: Option string to parse } else if (strcmp(key, "gid") == 0) { char *gidString = StrUtil_GetNextToken(&equalsIndex, keyVal, "="); if (gidString != NULL) { - gid_t gid; + gid_t gid = 0; valid = ParseGid(gidString, &gid); free(gidString); diff --git a/open-vm-tools/hgfsmounter/hgfsmounter_version.h b/open-vm-tools/hgfsmounter/hgfsmounter_version.h index e671ef315..1305114c2 100644 --- a/open-vm-tools/hgfsmounter/hgfsmounter_version.h +++ b/open-vm-tools/hgfsmounter/hgfsmounter_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/hgfsmounter/stub.c b/open-vm-tools/hgfsmounter/stub.c index ed45a3e92..93719e242 100644 --- a/open-vm-tools/hgfsmounter/stub.c +++ b/open-vm-tools/hgfsmounter/stub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/Makefile.am b/open-vm-tools/lib/Makefile.am index 5906e9a0e..ede2ea900 100644 --- a/open-vm-tools/lib/Makefile.am +++ b/open-vm-tools/lib/Makefile.am @@ -16,7 +16,6 @@ ################################################################################ SUBDIRS = -SUBDIRS += atomic SUBDIRS += auth SUBDIRS += backdoor SUBDIRS += conf diff --git a/open-vm-tools/lib/Makefile.in b/open-vm-tools/lib/Makefile.in index cfa93b048..d8273e9a0 100644 --- a/open-vm-tools/lib/Makefile.in +++ b/open-vm-tools/lib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -96,7 +96,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -108,7 +107,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -133,7 +132,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -142,6 +140,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -149,7 +149,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -206,13 +206,13 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = atomic auth backdoor conf dict dnd err eventManager file \ - foundryMsg ghIntegrationStub guestApp guestInfo hgfs hgfsBd \ - hgfsServer hgfsServerManagerGuest hgfsServerPolicyGuest \ - deployPkg impersonate message misc netUtil panic panicDefault \ - printer procMgr rpcIn rpcOut rpcVmx SLPv2Parser socketMgr \ - strUtil string sync syncDriver system toolsLogger unicode \ - unityStub user vixTools vmBackupLib vmCheck vmSignal wiper +SUBDIRS = auth backdoor conf dict dnd err eventManager file foundryMsg \ + ghIntegrationStub guestApp guestInfo hgfs hgfsBd hgfsServer \ + hgfsServerManagerGuest hgfsServerPolicyGuest deployPkg \ + impersonate message misc netUtil panic panicDefault printer \ + procMgr rpcIn rpcOut rpcVmx SLPv2Parser socketMgr strUtil \ + string sync syncDriver system toolsLogger unicode unityStub \ + user vixTools vmBackupLib vmCheck vmSignal wiper all: all-recursive .SUFFIXES: @@ -327,8 +327,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -353,8 +353,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -364,12 +364,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/SLPv2Parser/Makefile.in b/open-vm-tools/lib/SLPv2Parser/Makefile.in index d444d3ee9..7dfc7e9d7 100644 --- a/open-vm-tools/lib/SLPv2Parser/Makefile.in +++ b/open-vm-tools/lib/SLPv2Parser/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -303,8 +303,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -316,8 +316,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -327,12 +327,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/SLPv2Parser/SLPv2Match.c b/open-vm-tools/lib/SLPv2Parser/SLPv2Match.c index ede69b3aa..5cee725fd 100644 --- a/open-vm-tools/lib/SLPv2Parser/SLPv2Match.c +++ b/open-vm-tools/lib/SLPv2Parser/SLPv2Match.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/SLPv2Parser/SLPv2MsgAssembler.c b/open-vm-tools/lib/SLPv2Parser/SLPv2MsgAssembler.c index cab73d285..a6eb2bb51 100644 --- a/open-vm-tools/lib/SLPv2Parser/SLPv2MsgAssembler.c +++ b/open-vm-tools/lib/SLPv2Parser/SLPv2MsgAssembler.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/SLPv2Parser/SLPv2MsgParser.c b/open-vm-tools/lib/SLPv2Parser/SLPv2MsgParser.c index 2dd596884..c9427f530 100644 --- a/open-vm-tools/lib/SLPv2Parser/SLPv2MsgParser.c +++ b/open-vm-tools/lib/SLPv2Parser/SLPv2MsgParser.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/auth/Makefile.in b/open-vm-tools/lib/auth/Makefile.in index 8d2af4048..a26d16e2b 100644 --- a/open-vm-tools/lib/auth/Makefile.in +++ b/open-vm-tools/lib/auth/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/auth/authPosix.c b/open-vm-tools/lib/auth/authPosix.c index a4b72fb7a..293d59c71 100644 --- a/open-vm-tools/lib/auth/authPosix.c +++ b/open-vm-tools/lib/auth/authPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -33,6 +33,7 @@ #include "vm_version.h" #include "vm_assert.h" +#include "posix.h" #ifdef USE_PAM # include "file.h" @@ -263,7 +264,7 @@ Auth_AuthenticateUser(const char *user, //IN #endif /* If this point is reached, the user has been authenticated. */ setpwent(); - pwd = getpwnam(user); + pwd = Posix_Getpwnam(user); endpwent(); #else /* !USE_PAM */ @@ -273,7 +274,7 @@ Auth_AuthenticateUser(const char *user, //IN corresponding #endif below. */ setpwent(); //XXX can kill? - pwd = getpwnam(user); + pwd = Posix_Getpwnam(user); endpwent(); //XXX can kill? if (!pwd) { diff --git a/open-vm-tools/lib/backdoor/Makefile.in b/open-vm-tools/lib/backdoor/Makefile.in index 1c516168a..4bf4f0aa8 100644 --- a/open-vm-tools/lib/backdoor/Makefile.in +++ b/open-vm-tools/lib/backdoor/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -124,7 +124,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -136,7 +135,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -161,7 +160,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -170,6 +168,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -177,7 +177,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -391,8 +391,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -417,8 +417,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -428,12 +428,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/backdoor/backdoor.c b/open-vm-tools/lib/backdoor/backdoor.c index dcafad509..2e814dca1 100644 --- a/open-vm-tools/lib/backdoor/backdoor.c +++ b/open-vm-tools/lib/backdoor/backdoor.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/backdoor/backdoorGcc32.c b/open-vm-tools/lib/backdoor/backdoorGcc32.c index c149edec7..7524cce47 100644 --- a/open-vm-tools/lib/backdoor/backdoorGcc32.c +++ b/open-vm-tools/lib/backdoor/backdoorGcc32.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/backdoor/backdoorGcc64.c b/open-vm-tools/lib/backdoor/backdoorGcc64.c index 5a8a74d73..417c9ce97 100644 --- a/open-vm-tools/lib/backdoor/backdoorGcc64.c +++ b/open-vm-tools/lib/backdoor/backdoorGcc64.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/backdoor/shared/Makefile.in b/open-vm-tools/lib/backdoor/shared/Makefile.in index a94e5520c..64fc1bdd6 100644 --- a/open-vm-tools/lib/backdoor/shared/Makefile.in +++ b/open-vm-tools/lib/backdoor/shared/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -110,7 +110,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -122,7 +121,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -147,7 +146,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -156,6 +154,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -163,7 +163,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -331,8 +331,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -344,8 +344,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -355,12 +355,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/conf/Makefile.in b/open-vm-tools/lib/conf/Makefile.in index 798989dc3..7ae51f7d8 100644 --- a/open-vm-tools/lib/conf/Makefile.in +++ b/open-vm-tools/lib/conf/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/conf/conf.c b/open-vm-tools/lib/conf/conf.c index d2f90007f..3a2d5e2b4 100644 --- a/open-vm-tools/lib/conf/conf.c +++ b/open-vm-tools/lib/conf/conf.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -71,9 +71,9 @@ Conf_Load(void) { GuestApp_Dict *confDict; char *path; - const char *confPath = GuestApp_GetConfPath(); - const char *installPath = GuestApp_GetInstallPath(); - + char *confPath = GuestApp_GetConfPath(); + char *installPath = GuestApp_GetInstallPath(); + /* We really can't proceed without these paths. */ ASSERT(confPath); ASSERT(installPath); @@ -135,7 +135,10 @@ Conf_Load(void) /* Load the user-configured values from the conf file if it's there */ GuestApp_LoadDict(confDict); - + + free(installPath); + free(confPath); + return confDict; } diff --git a/open-vm-tools/lib/deployPkg/Makefile.in b/open-vm-tools/lib/deployPkg/Makefile.in index 34bae5ad7..7a3eadff3 100644 --- a/open-vm-tools/lib/deployPkg/Makefile.in +++ b/open-vm-tools/lib/deployPkg/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -303,8 +303,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -316,8 +316,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -327,12 +327,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/deployPkg/deployPkg.c b/open-vm-tools/lib/deployPkg/deployPkg.c index 2991e66bf..9562b078e 100644 --- a/open-vm-tools/lib/deployPkg/deployPkg.c +++ b/open-vm-tools/lib/deployPkg/deployPkg.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/deployPkg/deployPkgLog.c b/open-vm-tools/lib/deployPkg/deployPkgLog.c index bfc3e19cb..e3e9b6ee7 100644 --- a/open-vm-tools/lib/deployPkg/deployPkgLog.c +++ b/open-vm-tools/lib/deployPkg/deployPkgLog.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/deployPkg/runDeployPkgPosix.c b/open-vm-tools/lib/deployPkg/runDeployPkgPosix.c index f8f0a25a5..5d22e353b 100644 --- a/open-vm-tools/lib/deployPkg/runDeployPkgPosix.c +++ b/open-vm-tools/lib/deployPkg/runDeployPkgPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/dict/Makefile.in b/open-vm-tools/lib/dict/Makefile.in index ad36eb4ac..d3911ca79 100644 --- a/open-vm-tools/lib/dict/Makefile.in +++ b/open-vm-tools/lib/dict/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/dict/dictll.c b/open-vm-tools/lib/dict/dictll.c index ae70a039d..fc03654ac 100644 --- a/open-vm-tools/lib/dict/dictll.c +++ b/open-vm-tools/lib/dict/dictll.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/dnd/Makefile.in b/open-vm-tools/lib/dnd/Makefile.in index 189fcddef..703e2b1ce 100644 --- a/open-vm-tools/lib/dnd/Makefile.in +++ b/open-vm-tools/lib/dnd/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -300,8 +300,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -313,8 +313,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -324,12 +324,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/dnd/dndCommon.c b/open-vm-tools/lib/dnd/dndCommon.c index 07b8eb1a8..d79910c92 100644 --- a/open-vm-tools/lib/dnd/dndCommon.c +++ b/open-vm-tools/lib/dnd/dndCommon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -38,6 +38,7 @@ #include "hgfsServerPolicy.h" #include "hgfsVirtualDir.h" #include "unicodeOperations.h" +#include "hostinfo.h" #define LOGLEVEL_MODULE dnd #include "loglevel_user.h" @@ -46,12 +47,6 @@ #define WIN_DIRSEPS "\\" static ConstUnicode DnDCreateRootStagingDirectory(void); -Bool DnDDataContainsIllegalCharacters(const char *data, - const size_t dataSize, - const char *illegalChars); -Bool DnDPrependFileRoot(const char *fileRoot, const char delimiter, - char **src, size_t *srcSize); - /* *----------------------------------------------------------------------------- @@ -124,11 +119,9 @@ DnD_CreateStagingDirectory(void) Unicode_Free(stagingDir); } - - Unicode_Free(stagingDirList[i]); } - free(stagingDirList); + Unicode_FreeList(stagingDirList, numStagingDirs); /* Only create a directory if we didn't find one above. */ if (!found) { @@ -138,13 +131,11 @@ DnD_CreateStagingDirectory(void) for (i = 0; i < 10; i++) { Unicode temp; - char string[16]; /* Each staging directory is given a random name. */ Unicode_Free(ret); - Str_Sprintf(string, sizeof string, "%08x%c", Random_Quick(p), - DIRSEPC); - temp = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); + temp = Unicode_Format("%08x%c", Random_Quick(p), DIRSEPC); + ASSERT_MEM_ALLOC(temp); ret = Unicode_Append(root, temp); Unicode_Free(temp); @@ -168,6 +159,77 @@ exit: } +/* + *----------------------------------------------------------------------------- + * + * DnD_DeleteStagingFiles -- + * + * Attempts to delete all files in the filelist. + * + * Results: + * TRUE if all files were deleted. FALSE if there was an error. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +DnD_DeleteStagingFiles(ConstUnicode fileList, // IN: + Bool onReboot) // IN: +{ + Bool ret = TRUE; + UnicodeIndex start = 0; + + ASSERT(fileList); + + /* + * The list of files is composed of a concatenation of path names, each + * ending with '|' character. Select each one and delete it. + */ + + while (TRUE) { + Unicode fileName; + UnicodeIndex index; + + index = Unicode_FindSubstrInRange(fileList, start, -1, + U("|"), 0, 1); + + if (index == UNICODE_INDEX_NOT_FOUND) { + break; + } else { + fileName = Unicode_Substr(fileList, start, index - start); + } + + if (onReboot) { + if (File_UnlinkDelayed(fileName)) { + ret = FALSE; + } + } else { + + if (File_IsFile(fileName)) { + /* File_Unlink() returns -1 on error */ + if (File_Unlink(fileName) == -1) { + ret = FALSE; + } + } else if (File_IsDirectory(fileName)) { + /* File_DeleteDirectoryTree() returns false on error */ + if (!File_DeleteDirectoryTree(fileName)) { + ret = FALSE; + } + } else { + ret = FALSE; + } + } + Unicode_Free(fileName); + + start = index + 1; + } + + return ret; +} + /* *---------------------------------------------------------------------------- * @@ -239,9 +301,9 @@ DnDCreateRootStagingDirectory(void) */ Bool -DnDDataContainsIllegalCharacters(const char *data, // IN: buffer - const size_t dataSize, // IN: size of buffer - const char *illegalChars) // IN: chars to look for +DnDDataContainsIllegalCharacters(const char *data, // IN: buffer + const size_t dataSize, // IN: size of buffer + const char *illegalChars) // IN: chars to look for { size_t i; @@ -277,8 +339,7 @@ DnDDataContainsIllegalCharacters(const char *data, // IN: buffer * buffer containing the results. *srcSize is set to the size of the new * buffer, not including the NUL-terminator. * - * We can't simply use Str_Sprintf here because it calls FormatMessage on - * Win32 which doesn't play well with Unicode strings. + * The logic here and in the called functions appears to be UTF8-safe. * * Results: * TRUE on success, FALSE on failure. @@ -291,10 +352,10 @@ DnDDataContainsIllegalCharacters(const char *data, // IN: buffer */ Bool -DnDPrependFileRoot(const char *fileRoot, // IN : file root to append - const char delimiter, // IN : delimiter for output buffer - char **src, // IN/OUT: NUL-delimited list of paths - size_t *srcSize) // IN/OUT: size of list +DnDPrependFileRoot(ConstUnicode fileRoot, // IN : file root to append + char delimiter, // IN : delimiter for output buffer + char **src, // IN/OUT: NUL-delimited list of paths + size_t *srcSize) // IN/OUT: size of list { char *newData = NULL; size_t newDataLen = 0; @@ -361,55 +422,6 @@ DnDPrependFileRoot(const char *fileRoot, // IN : file root to append } -/* - *----------------------------------------------------------------------------- - * - * DnD_UTF8Asprintf -- - * - * Str_Asprintf should not be used with UTF-8 strings as it uses - * FormatMessage. This interprets UTF-8 strings as a string in the current - * locale giving wrong results. This function is otherwise funcationally - * equivalent to Str_Asprintf. The caller must first compute how large the - * output buffer needs to be and pass it in as outBufSize. - * - * Results: - * The allocated string on success. - * NULL on failure. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -char * -DnD_UTF8Asprintf(unsigned int outBufSize, // IN: size of output buffer - const char *format, // IN - ...) // IN -{ - va_list arguments; - char *buffer = NULL; - - ASSERT(format); - va_start(arguments, format); - - if (!(buffer = (char *)malloc(outBufSize))) { - Log("DnD_UTF8Asprintf: Error creating string.\n"); - goto exit; - } - - if (Str_Vsnprintf(buffer, outBufSize, format, arguments) < 0) { - Log("DnD_UTF8Asprintf: Error writing to string.\n"); - free (buffer); - buffer = NULL; - } - -exit: - va_end(arguments); - return buffer; -} - - /* *---------------------------------------------------------------------------- * @@ -420,6 +432,8 @@ exit: * this implementation must always convert from Windows path to CPName path, * regardless of the platform we are running on. * + * The logic here and in the called functions appears to be UTF8-safe. + * * Results: * On success, returns the number of bytes used in the cross-platform name, * NOT including the final terminating NUL character. On failure, returns @@ -561,6 +575,71 @@ out: } +/* + *----------------------------------------------------------------------------- + * + * DnD_CPNameListToDynBufArray -- + * + * Export CPName file list from binary buffer to DynBufArray. + * + * Results: + * TRUE if success, FALSE otherwise. + * + * Side effects: + * Memory may allocated for DynBufArray if success. + * + *----------------------------------------------------------------------------- + */ + +Bool +DnD_CPNameListToDynBufArray(char *fileList, // IN: CPName format + size_t listSize, // IN + DynBufArray *dynBufArray) // OUT +{ + DynBuf buf; + BufRead r; + int32 pathLen; + size_t count; + size_t i; + + ASSERT(fileList); + r.pos = fileList; + r.unreadLen = listSize; + + DynBufArray_Init(dynBufArray, 0); + + while (r.unreadLen > 0) { + DynBuf_Init(&buf); + if (!DnDReadBuffer(&r, &pathLen, sizeof pathLen) || + (pathLen > r.unreadLen) || + !DynBuf_Append(&buf, r.pos, pathLen)) { + goto error; + } + + if (!DnDSlideBuffer(&r, pathLen)) { + goto error; + } + + if (!DynBufArray_Push(dynBufArray, buf)) { + goto error; + } + } + return TRUE; + +error: + DynBuf_Destroy(&buf); + + count = DynBufArray_Count(dynBufArray); + for (i = 0; i < count; i++) { + DynBuf *b = DynArray_AddressOf(dynBufArray, i); + DynBuf_Destroy(b); + } + DynBufArray_SetCount(dynBufArray, 0); + DynBufArray_Destroy(dynBufArray); + return FALSE; +} + + /* *----------------------------------------------------------------------------- * @@ -569,20 +648,18 @@ out: * Try to get last directory name from a full path name. * * Results: - * size of dirName if success, 0 otherwise. + * The allocated Unicode string, or NULL on failure. * * Side effects: - * Memory may allocated for dirName if success. + * None. * *----------------------------------------------------------------------------- */ -size_t -DnD_GetLastDirName(const char *str, // IN: can be UTF-8 - size_t strSize, // IN - char **dirName) // OUT +Unicode +DnD_GetLastDirName(ConstUnicode str) // IN { - size_t end = strSize; + size_t end = strlen(str); size_t start; size_t res = 0; @@ -606,8 +683,352 @@ DnD_GetLastDirName(const char *str, // IN: can be UTF-8 } res = end - start; - *dirName = (char *)Util_SafeMalloc(res + 1); - memcpy(*dirName, str + start, res); - (*dirName)[res] = '\0'; - return res; + return Unicode_AllocWithLength(str + start, res, STRING_ENCODING_UTF8); } + + +/* Transport layer big buffer support functions. */ + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufInit -- + * + * Initialize transport layer buffer with DnD message. + * + * Results: + * None. + * + * Side effects: + * Buffer memory is allocated. + * + *----------------------------------------------------------------------------- + */ + +void +DnD_TransportBufInit(DnDTransportBuffer *buf, // OUT + uint8 *msg, // IN + size_t msgSize, // IN + uint32 seqNum) // IN +{ + ASSERT(buf); + ASSERT(msgSize <= DNDMSG_MAX_ARGSZ); + + free(buf->buffer); + buf->buffer = Util_SafeMalloc(msgSize); + memcpy(buf->buffer, msg, msgSize); + buf->seqNum = seqNum; + buf->totalSize = msgSize; + buf->offset = 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufReset -- + * + * Reset transport layer buffer. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +DnD_TransportBufReset(DnDTransportBuffer *buf) // IN/OUT +{ + ASSERT(buf); + + free(buf->buffer); + buf->buffer = NULL; + + buf->seqNum = 0; + buf->totalSize = 0; + buf->offset = 0; + buf->lastUpdateTime = 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufGetPacket -- + * + * Get a transport layer packet from transport layer buffer. + * + * Results: + * Transport layer packet size, or 0 if failed. + * + * Side effects: + * Memory may be allocated for packet. + * + *----------------------------------------------------------------------------- + */ + +size_t +DnD_TransportBufGetPacket(DnDTransportBuffer *buf, // IN/OUT + DnDTransportPacketHeader **packet) // OUT +{ + size_t payloadSize; + + ASSERT(buf); + + if (buf->totalSize < buf->offset) { + return 0; + } + + if ((buf->totalSize - buf->offset) > DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE) { + payloadSize = DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE; + } else { + payloadSize = buf->totalSize - buf->offset; + } + + *packet = (DnDTransportPacketHeader *)Util_SafeMalloc( + payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE); + (*packet)->type = DND_TRANSPORT_PACKET_TYPE_PAYLOAD; + (*packet)->seqNum = buf->seqNum; + (*packet)->totalSize = buf->totalSize; + (*packet)->payloadSize = payloadSize; + (*packet)->offset = buf->offset; + + memcpy((*packet)->payload, + buf->buffer + buf->offset, + payloadSize); + buf->offset += payloadSize; + + /* This time is used for timeout purpose. */ + Hostinfo_GetTimeOfDay(&buf->lastUpdateTime); + + return payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufAppendPacket -- + * + * Put a received packet into transport layer buffer. + * + * Results: + * TRUE if success, FALSE otherwise. + * + * Side effects: + * Memory may be allocated for transport layer buffer. + * + *----------------------------------------------------------------------------- + */ + +Bool +DnD_TransportBufAppendPacket(DnDTransportBuffer *buf, // IN/OUT + DnDTransportPacketHeader *packet, // IN + size_t packetSize) // IN +{ + ASSERT(buf); + ASSERT(packetSize == (packet->payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE) && + packetSize <= DND_MAX_TRANSPORT_PACKET_SIZE && + (packet->payloadSize + packet->offset) <= packet->totalSize && + packet->totalSize <= DNDMSG_MAX_ARGSZ); + + if (packetSize != (packet->payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE) || + packetSize > DND_MAX_TRANSPORT_PACKET_SIZE || + (packet->payloadSize + packet->offset) > packet->totalSize || + packet->totalSize > DNDMSG_MAX_ARGSZ) { + goto error; + } + + /* + * If seqNum does not match, it means either this is the first packet, or there + * is a timeout in another side. Reset the buffer in all cases. + */ + if (buf->seqNum != packet->seqNum) { + DnD_TransportBufReset(buf); + } + + if (!buf->buffer) { + ASSERT(!packet->offset); + if (packet->offset) { + goto error; + } + buf->buffer = Util_SafeMalloc(packet->totalSize); + buf->totalSize = packet->totalSize; + buf->seqNum = packet->seqNum; + buf->offset = 0; + } + + if (buf->offset != packet->offset) { + goto error; + } + + memcpy(buf->buffer + buf->offset, + packet->payload, + packet->payloadSize); + buf->offset += packet->payloadSize; + return TRUE; + +error: + DnD_TransportBufReset(buf); + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportMsgToPacket -- + * + * Get a packet from small size message. + * + * Results: + * Transport layer packet size, or 0 if failed. + * + * Side effects: + * Memory may be allocated for packet. + * + *----------------------------------------------------------------------------- + */ + +size_t +DnD_TransportMsgToPacket(uint8 *msg, // IN + size_t msgSize, // IN + uint32 seqNum, // IN + DnDTransportPacketHeader **packet) // OUT +{ + size_t packetSize; + + ASSERT(msgSize > 0 && msgSize <= DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE); + ASSERT(msg); + ASSERT(packet); + + if (msgSize <=0 || + msgSize > DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE || + !msg || !packet) { + return 0; + } + + packetSize = msgSize + DND_TRANSPORT_PACKET_HEADER_SIZE; + + *packet = (DnDTransportPacketHeader *)Util_SafeMalloc(packetSize); + + (*packet)->type = DND_TRANSPORT_PACKET_TYPE_SINGLE; + (*packet)->seqNum = seqNum; + (*packet)->totalSize = msgSize; + (*packet)->payloadSize = msgSize; + (*packet)->offset = 0; + + memcpy((*packet)->payload, msg, msgSize); + + return packetSize; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportReqPacket -- + * + * Generate a request packet with empty payload. After got a payload, receive + * side should send a DND_TRANSPORT_PACKET_TYPE_REQUEST packet to ask for + * next payload packet. + * + * Results: + * Transport layer packet size. + * + * Side effects: + * Memory is allocated for packet. + * + *----------------------------------------------------------------------------- + */ + +size_t +DnD_TransportReqPacket(DnDTransportBuffer *buf, // IN + DnDTransportPacketHeader **packet) // OUT +{ + *packet = (DnDTransportPacketHeader *)Util_SafeMalloc( + DND_TRANSPORT_PACKET_HEADER_SIZE); + + (*packet)->type = DND_TRANSPORT_PACKET_TYPE_REQUEST; + (*packet)->seqNum = buf->seqNum; + (*packet)->totalSize = buf->totalSize; + (*packet)->payloadSize = 0; + (*packet)->offset = buf->offset; + return DND_TRANSPORT_PACKET_HEADER_SIZE; +} + + +/* + *---------------------------------------------------------------------------- + * + * DnDReadBuffer -- + * + * Copies len bytes of data from b to out. Subsequent calls to this + * function will copy data from the last unread point. + * + * Results: + * TRUE when data is successfully copies to out, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +DnDReadBuffer(BufRead *b, // IN/OUT: buffer to read from + void *out, // OUT: the output buffer + size_t len) // IN: the amount to read +{ + ASSERT(b); + ASSERT(out); + + if (len > b->unreadLen) { + return FALSE; + } + + memcpy(out, b->pos, len); + if (!DnDSlideBuffer(b, len)) { + return FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * DnDSlideBuffer -- + * + * Ignore len bytes of data in b. Subsequent calls to DnDReadBuffer will + * copy data from the last point. + * + * Results: + * TRUE when pos is successfully changed, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +DnDSlideBuffer(BufRead *b, // IN/OUT: buffer to read from + size_t len) // IN: the amount to read +{ + ASSERT(b); + + if (len > b->unreadLen) { + return FALSE; + } + + b->pos += len; + b->unreadLen -= len; + + return TRUE; +} + diff --git a/open-vm-tools/lib/dnd/dndLinux.c b/open-vm-tools/lib/dnd/dndLinux.c index 037a0e33c..d4442b308 100644 --- a/open-vm-tools/lib/dnd/dndLinux.c +++ b/open-vm-tools/lib/dnd/dndLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -31,6 +31,7 @@ #include "dndInt.h" #include "dnd.h" +#include "posix.h" #include "file.h" #include "strutil.h" #include "vm_assert.h" @@ -54,66 +55,6 @@ #endif -/* - *----------------------------------------------------------------------------- - * - * DnD_DeleteStagingFiles -- - * - * Attempts to delete all files in the filelist. - * - * Results: - * TRUE if all files were deleted. FALSE if there was an error. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -DnD_DeleteStagingFiles(ConstUnicode fileList, // IN: - Bool onReboot) // IN: unused -{ - Bool ret = TRUE; - UnicodeIndex start = 0; - - ASSERT(fileList); - - /* - * The list of files is composed of a concatination of path names, each - * ending with '|' character. Select each one and delete it. - */ - - while (TRUE) { - Unicode fileName; - UnicodeIndex index; - - index = Unicode_FindSubstrInRange(fileList, start, -1, - U("|"), 0, 1); - - if (index == UNICODE_INDEX_NOT_FOUND) { - break; - } else { - fileName = Unicode_Substr(fileList, start, index - start); - } - - if (File_IsFile(fileName)) { - File_Unlink(fileName); - } else if (File_IsDirectory(fileName)) { - File_DeleteDirectoryTree(fileName); - } else { - ret = FALSE; - } - - Unicode_Free(fileName); - - start = index + 1; - } - - return ret; -} - - /* *----------------------------------------------------------------------------- * @@ -539,9 +480,9 @@ DnD_RemoveBlock(int blockFd, // IN Bool DnDRootDirUsable(ConstUnicode pathName) // IN: { - PosixStatStruct buf; + struct stat buf; - if (FileIO_PosixStat(pathName, &buf) < 0) { + if (Posix_Stat(pathName, &buf) < 0) { return FALSE; } @@ -572,7 +513,7 @@ DnDRootDirUsable(ConstUnicode pathName) // IN: Bool DnDSetPermissionsOnRootDir(ConstUnicode pathName) // IN: { - return FileIO_PosixChmod(pathName, S_ISVTX | DND_ROOTDIR_PERMS) == 0; + return Posix_Chmod(pathName, S_ISVTX | DND_ROOTDIR_PERMS) == 0; } @@ -597,9 +538,9 @@ DnDSetPermissionsOnRootDir(ConstUnicode pathName) // IN: Bool DnDStagingDirectoryUsable(ConstUnicode pathName) // IN: { - PosixStatStruct buf; + struct stat buf; - if (FileIO_PosixStat(pathName, &buf) < 0) { + if (Posix_Stat(pathName, &buf) < 0) { return FALSE; } @@ -626,5 +567,5 @@ DnDStagingDirectoryUsable(ConstUnicode pathName) // IN: Bool DnDSetPermissionsOnStagingDir(ConstUnicode pathName) // IN: { - return FileIO_PosixChmod(pathName, DND_STAGINGDIR_PERMS) == 0; + return Posix_Chmod(pathName, DND_STAGINGDIR_PERMS) == 0; } diff --git a/open-vm-tools/lib/err/Makefile.in b/open-vm-tools/lib/err/Makefile.in index 56cd39bd2..55be3939d 100644 --- a/open-vm-tools/lib/err/Makefile.in +++ b/open-vm-tools/lib/err/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -300,8 +300,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -313,8 +313,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -324,12 +324,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/err/err.c b/open-vm-tools/lib/err/err.c index 0ffd9cca1..3388518d3 100644 --- a/open-vm-tools/lib/err/err.c +++ b/open-vm-tools/lib/err/err.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/err/errPosix.c b/open-vm-tools/lib/err/errPosix.c index 036cf5973..f26c4ebec 100644 --- a/open-vm-tools/lib/err/errPosix.c +++ b/open-vm-tools/lib/err/errPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/eventManager/Makefile.in b/open-vm-tools/lib/eventManager/Makefile.in index 75e8355df..39dab38d6 100644 --- a/open-vm-tools/lib/eventManager/Makefile.in +++ b/open-vm-tools/lib/eventManager/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/eventManager/eventManager.c b/open-vm-tools/lib/eventManager/eventManager.c index 39396a29e..9edefb95e 100644 --- a/open-vm-tools/lib/eventManager/eventManager.c +++ b/open-vm-tools/lib/eventManager/eventManager.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/file/Makefile.in b/open-vm-tools/lib/file/Makefile.in index 6a305b9e0..305e5875c 100644 --- a/open-vm-tools/lib/file/Makefile.in +++ b/open-vm-tools/lib/file/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -107,7 +107,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -119,7 +118,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -144,7 +143,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -153,6 +151,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -160,7 +160,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -307,8 +307,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -320,8 +320,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -331,12 +331,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/file/file.c b/open-vm-tools/lib/file/file.c index 08450b0c2..a06af040f 100644 --- a/open-vm-tools/lib/file/file.c +++ b/open-vm-tools/lib/file/file.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -43,6 +43,7 @@ #include "msg.h" #include "uuid.h" #include "config.h" +#include "posix.h" #include "file.h" #include "fileIO.h" #include "fileInt.h" @@ -147,36 +148,6 @@ File_IsDirectory(ConstUnicode pathName) // IN: } -/* - *---------------------------------------------------------------------------- - * - * File_IsCharDevice -- - * - * This function checks whether the given file is a char device - * and return TRUE in such case. This is often useful on Windows - * where files like COM?, LPT? must be differentiated from "normal" - * disk files. - * - * Results: - * TRUE is a character device - * FALSE is not a character device or error - * - * Side effects: - * None - * - *---------------------------------------------------------------------------- - */ - -Bool -File_IsCharDevice(ConstUnicode pathName) // IN: -{ - FileData fileData; - - return (FileAttributes(pathName, &fileData) == 0) && - (fileData.fileType == FILE_TYPE_CHARDEVICE); -} - - /* *---------------------------------------------------------------------- * @@ -210,7 +181,8 @@ File_Unlink(ConstUnicode pathName) // IN: * * File_GetModTime -- * - * Get the last modification time of a file. + * Get the last modification time of a file and return it. The time + * unit is seconds since the POSIX/UNIX/Linux epoch. * * Results: * Last modification time of file or -1 if error. @@ -224,13 +196,16 @@ File_Unlink(ConstUnicode pathName) // IN: int64 File_GetModTime(ConstUnicode pathName) // IN: { - FileData fileData; + int64 theTime; + struct stat statbuf; - if (FileAttributes(pathName, &fileData) != 0) { - return -1; + if (Posix_Stat(pathName, &statbuf) == 0) { + theTime = statbuf.st_mtime; + } else { + theTime = -1; } - return fileData.fileModificationTime; + return theTime; } @@ -928,6 +903,66 @@ File_GetPathName(ConstUnicode fullPath, // IN: } +/* + *---------------------------------------------------------------------- + * + * File_StripSlashes -- + * + * Strip trailing slashes from the end of a path. + * + * Results: + * The stripped filename. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Unicode +File_StripSlashes(ConstUnicode path) // IN +{ + Unicode volume, dir, base; + + /* + * Degenerate cases. + */ + + + /* + * SplitName handles all drive letter/UNC/whatever cases, all we + * have to do is make sure the dir part is stripped of slashes if + * there isn't a base part. + */ + + File_SplitName(path, &volume, &dir, &base); + + if (!Unicode_IsEmpty(dir) && Unicode_IsEmpty(base)) { + char *dir2 = Unicode_GetAllocBytes(dir, STRING_ENCODING_UTF8); + size_t i = strlen(dir2); + + /* + * Don't strip first slash on Windows, since we want at least + * one slash to trail a drive letter/colon or UNC specifier. + */ +#ifdef _WIN32 + while ((i > 1) && (('/' == dir2[i - 1]) || + ('\\' == dir2[i - 1]))) { +#else + while ((i > 0) && ('/' == dir2[i - 1])) { +#endif + i--; + } + + free(dir); + dir = Unicode_AllocWithLength(dir2, i, STRING_ENCODING_UTF8); + free(dir2); + } + + return Unicode_Join(volume, dir, base, NULL); +} + + /* *---------------------------------------------------------------------- * @@ -978,19 +1013,16 @@ File_MakeTempEx(ConstUnicode dir, // IN: for (var = 0; var < 0xFFFFFFFF; var++) { Unicode temp; - char string[16]; /* construct suffixed pathname to use */ Unicode_Free(path); - Str_Sprintf(string, sizeof string, "%d", var); - temp = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); + temp = Unicode_Format("%d", var); + ASSERT_MEM_ALLOC(temp); path = Unicode_Append(basePath, temp); Unicode_Free(temp); - fd = FileIO_PosixOpen(path, - O_CREAT | O_EXCL | O_BINARY | O_RDWR, - 0600); + fd = Posix_Open(path, O_CREAT | O_EXCL | O_BINARY | O_RDWR, 0600); if (fd != -1) { *presult = path; @@ -1635,7 +1667,7 @@ File_CreateDirectoryHierarchy(ConstUnicode pathName) Unicode_Free(volume); if (index >= length) { - return FALSE; + return File_IsDirectory(pathName); } /* @@ -1916,7 +1948,7 @@ File_FindFileInSearchPath(const char *fileIn, // IN * If the extension is not found the newExtension is just appended. * * Results: - * The name with newExtension added to it. The caller is resposible to + * The name with newExtension added to it. The caller is responsible to * free it when they are done with it. * * Side effects: @@ -1931,42 +1963,59 @@ File_ReplaceExtension(ConstUnicode pathName, // IN: uint32 numExtensions, // IN: ...) // IN: { + Unicode path; + Unicode base; Unicode result; va_list arguments; UnicodeIndex index; - + ASSERT(pathName); ASSERT(newExtension); ASSERT(Unicode_StartsWith(newExtension, U("."))); - index = Unicode_FindLast(pathName, U(".")); + File_GetPathName(pathName, &path, &base); - if (index == UNICODE_INDEX_NOT_FOUND) { - result = Unicode_Append(pathName, newExtension); - } else { - uint32 i; - Unicode temp; + index = Unicode_FindLast(base, U(".")); + + if (index != UNICODE_INDEX_NOT_FOUND) { + if (numExtensions) { + uint32 i; + + /* + * Only truncate the old extension from the base if it exists in + * in the valid extensions list. + */ - va_start(arguments, numExtensions); + va_start(arguments, numExtensions); - for (i = 0; i < numExtensions ; i++) { - Unicode oldExtension = va_arg(arguments, Unicode); + for (i = 0; i < numExtensions ; i++) { + Unicode oldExtension = va_arg(arguments, Unicode); - ASSERT(Unicode_StartsWith(oldExtension, U("."))); + ASSERT(Unicode_StartsWith(oldExtension, U("."))); - if (Unicode_CompareRange(pathName, index, -1, - oldExtension, 0, -1, FALSE) == 0) { - break; + if (Unicode_CompareRange(base, index, -1, + oldExtension, 0, -1, FALSE) == 0) { + base = Unicode_Truncate(base, index); // remove '.' + break; + } } - } - va_end(arguments); + va_end(arguments); + } else { + /* Always truncate the old extension. */ + base = Unicode_Truncate(base, index); // remove '.' + } + } - temp = Unicode_Substr(pathName, 0, index); - result = Unicode_Append(temp, newExtension); - Unicode_Free(temp); + if (Unicode_IsEmpty(path)) { + result = Unicode_Append(base, newExtension); + } else { + result = Unicode_Join(path, U(DIRSEPS), base, newExtension, NULL); } + Unicode_Free(path); + Unicode_Free(base); + return result; } diff --git a/open-vm-tools/lib/file/fileIO.c b/open-vm-tools/lib/file/fileIO.c index f6064987d..78b0d65be 100644 --- a/open-vm-tools/lib/file/fileIO.c +++ b/open-vm-tools/lib/file/fileIO.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,6 +34,7 @@ #include "msg.h" #include "unicodeOperations.h" + /* *---------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c index 27d8667a7..47c738f32 100644 --- a/open-vm-tools/lib/file/fileIOPosix.c +++ b/open-vm-tools/lib/file/fileIOPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,6 +35,7 @@ #include #include #include +#include #if !defined(N_PLAT_NLM) && defined(linux) /* * These headers are needed to get __USE_LARGEFILE, __USE_LARGEFILE64, @@ -59,6 +60,7 @@ #include #include #include +#include #else #if defined(__FreeBSD__) #include @@ -66,6 +68,10 @@ #else #if !defined(N_PLAT_NLM) #include +#if !defined(sun) +#include +#include +#endif #endif #endif #endif @@ -73,6 +79,7 @@ /* Check for non-matching prototypes */ #include "vmware.h" #include "str.h" +#include "posix.h" #include "file.h" #include "fileIO.h" #include "fileInt.h" @@ -85,6 +92,7 @@ #if defined(__APPLE__) #include "hostinfo.h" +#define XATTR_BACKUP_REENABLED "com.vmware.backupReenabled" #endif static const unsigned int FileIO_SeekOrigins[] = { @@ -335,49 +343,6 @@ FileIO_GetVolumeSectorSize(ConstUnicode pathName, // IN: } -/* - *---------------------------------------------------------------------- - * - * PosixOpen -- - * - * Open a file using POSIX open. - * - * Results: - * -1 error - * >= 0 success (file descriptor) - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -static int -PosixOpen(ConstUnicode pathName, // IN: - int flags, // IN: - int mode) // IN: -{ - int fd; - int err; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - fd = open(path, flags, (mode_t) mode); - - err = errno; - free(path); - errno = err; - - return fd; -} - - #if defined(__APPLE__) /* *---------------------------------------------------------------------- @@ -547,7 +512,7 @@ ProxyOpen(ConstUnicode pathName, // IN: } if (pid == 0) { /* child: use fd[0] */ - proxyFD = PosixOpen(pathName, flags, mode); + proxyFD = Posix_Open(pathName, flags, mode); ProxySendResults(fds[0], proxyFD, errno); @@ -593,14 +558,14 @@ ProxyUse(ConstUnicode pathName, // IN: Unicode path; UnicodeIndex index; struct statfs sfbuf; - PosixStatStruct statbuf; + struct stat statbuf; if (pathName == NULL) { errno = EFAULT; return -1; } - if ((FileIO_PosixLstat(pathName, &statbuf) == 0) && + if ((Posix_Lstat(pathName, &statbuf) == 0) && S_ISLNK(statbuf.st_mode)) { *useProxy = TRUE; return 0; @@ -632,7 +597,7 @@ ProxyUse(ConstUnicode pathName, // IN: * containing filePath). */ - if (FileIO_PosixStatfs(path, &sfbuf) == 0) { + if (Posix_Statfs(path, &sfbuf) == 0) { /* * The testPath exists; determine proxy usage explicitely. */ @@ -650,50 +615,44 @@ ProxyUse(ConstUnicode pathName, // IN: return 0; } -#endif /* *---------------------------------------------------------------------- * - * FileIO_PosixOpen -- + * PosixFileOpener -- * - * Open a file via POSIX open(). + * Open a file. Use a proxy when creating a file or on NFS. * - * Use a proxy when creating a file or on NFS on MacOS X. - * - * Why a proxy? The MacOS X 10.4.* NFS client interacts with our - * use of settid() and doesn't send the proper credentials on opens. - * This leads to files being written without error but containing no - * data. The proxy avoids all of this unhappiness. + * Why a proxy? The MacOS X 10.4.* NFS client interacts with our + * use of settid() and doesn't send the proper credentials on opens. + * This leads to files being written without error but containing no + * data. The proxy avoids all of this unhappiness. * * Results: - * -1 Error - * >= 0 File descriptor (success) + * -1 on error + * >= 0 on success * * Side effects: - * errno is set on error + * errno is set * *---------------------------------------------------------------------- */ int -FileIO_PosixOpen(ConstUnicode pathName, // IN: - int flags, // IN: - int mode) // IN: +PosixFileOpener(ConstUnicode pathName, // IN: + int flags, // IN: + mode_t mode) // IN: { -#if defined(__APPLE__) Bool useProxy; -#endif -#if defined(__APPLE__) if ((flags & O_ACCMODE) || (flags & O_CREAT)) { int err; /* * Open for write and/or O_CREAT. Determine proxy usage. - */ - + */ + err = ProxyUse(pathName, &useProxy); if (err != 0) { errno = err; @@ -708,250 +667,11 @@ FileIO_PosixOpen(ConstUnicode pathName, // IN: } return useProxy ? ProxyOpen(pathName, flags, mode) : - PosixOpen(pathName, flags, mode); -#else - return PosixOpen(pathName, flags, mode); -#endif -} - - -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixCreat -- - * - * Create a file via POSIX creat() - * - * Results: - * -1 Error - * >= 0 File descriptor (success) - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -int -FileIO_PosixCreat(ConstUnicode pathName, // IN: - int mode) // IN: -{ - return FileIO_PosixOpen(pathName, O_CREAT | O_WRONLY | O_TRUNC, mode); -} - - -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixFopen -- - * - * Open a file via POSIX fopen() - * - * Results: - * -1 Error - * >= 0 File descriptor (success) - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -FILE * -FileIO_PosixFopen(ConstUnicode pathName, // IN: - const char *mode) // IN: -{ - int err; - char *path; - FILE *stream; - - if (pathName == NULL) { - errno = EFAULT; - return NULL; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - stream = fopen(path, mode); - err = errno; - free(path); - errno = err; - - return stream; -} - - -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixStat -- - * - * POSIX stat() - * - * Results: - * -1 Error - * 0 Success - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -int -FileIO_PosixStat(ConstUnicode pathName, // IN: - PosixStatStruct *statbuf) // IN: -{ - int err; - int ret; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - ret = stat(path, statbuf); - - err = errno; - free(path); - errno = err; - - return ret; -} - -#if !defined(sun) && !defined(N_PLAT_NLM) -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixStatfs -- - * - * POSIX statfs() - * - * Results: - * -1 Error - * 0 Success - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -int -FileIO_PosixStatfs(ConstUnicode pathName, // IN: - struct statfs *statfsbuf) // IN: -{ - int err; - int ret; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - ret = statfs(path, statfsbuf); - - err = errno; - free(path); - errno = err; - - return ret; -} -#endif - - -#if !defined(N_PLAT_NLM) -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixLstat -- - * - * POSIX lstat() - * - * Results: - * -1 Error - * 0 Success - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -int -FileIO_PosixLstat(ConstUnicode pathName, // IN: - PosixStatStruct *statbuf) // IN: -{ - int err; - int ret; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - ret = lstat(path, statbuf); - - err = errno; - free(path); - errno = err; - - return ret; + Posix_Open(pathName, flags, mode); } #endif -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixChmod -- - * - * POSIX chmod() - * - * Results: - * -1 Error - * 0 Success - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -int -FileIO_PosixChmod(ConstUnicode pathName, // IN: - uint32 mode) // IN: -{ - int err; - int ret; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - ret = chmod(path, (mode_t) mode); - - err = errno; - free(path); - errno = err; - - return ret; -} - - /* *---------------------------------------------------------------------- * @@ -1077,12 +797,13 @@ FileIO_Create(FileIODescriptor *file, // OUT: path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - fd = FileIO_PosixOpen(path, flags + flags |= #if defined(linux) && !defined(N_PLAT_NLM) - | ((access & FILEIO_OPEN_SYNC) ? O_SYNC : 0) + ((access & FILEIO_OPEN_SYNC) ? O_SYNC : 0) | #endif - | FileIO_OpenActions[action], - mode); + FileIO_OpenActions[action]; + + fd = PosixFileOpener(path, flags, mode); error = errno; @@ -1111,10 +832,23 @@ FileIO_Create(FileIODescriptor *file, // OUT: * Time Machine backs up EVERY file unless explicitly told not to, so this * option uses the API to exclude the file that was just opened. */ - if ((access & FILEIO_OPEN_NO_TIME_MACHINE) && - !FileIO_SetExcludedFromTimeMachine(pathName, TRUE)) { - ret = FILEIO_ERROR; - goto error; + if ((access & FILEIO_OPEN_NO_TIME_MACHINE)) { + if (!FileIO_SetExcludedFromTimeMachine(pathName, TRUE)) { + ret = FILEIO_ERROR; + goto error; + } + } else { + /* + * Fix for Bug 248644: + * The issue with Time Machine that was causing hangs has been fixed in + * 10.5.2, so if the user is in 10.5.2 and the option isn't set, then + * we want to reset the exclusion of the file. + * + * Note that this call ignores errors because there are some files (like + * raw devices) that will fail checking xattrs and Time Machine Exclusion + * status, but we can't detect them at this point. + */ + FileIO_ResetExcludedFromTimeMachine(pathName); } #endif @@ -1344,7 +1078,6 @@ FileIO_Write(FileIODescriptor *fd, // IN NOT_TESTED(); continue; } - Log(LGPFX" %s failed %d.\n", __FUNCTION__, error); fret = FileIOErrno2Result(error); break; } @@ -2109,9 +1842,9 @@ int64 FileIO_GetSizeByPath(ConstUnicode pathName) // IN: { int err; - PosixStatStruct statbuf; + struct stat statbuf; - err = FileIO_PosixStat(pathName, &statbuf); + err = Posix_Stat(pathName, &statbuf); return (err == 0) ? statbuf.st_size : -1; } @@ -2139,17 +1872,11 @@ FileIOResult FileIO_Access(ConstUnicode pathName, // IN: path name to be tested int accessMode) // IN: access modes to be asserted { - int err; + FileIOResult err; int mode; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return FILEIO_ERROR; - } + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); mode = 0; - if (accessMode & FILEIO_ACCESS_READ) { mode |= R_OK; } @@ -2163,14 +1890,10 @@ FileIO_Access(ConstUnicode pathName, // IN: path name to be tested mode |= F_OK; } - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - err = (access(path, mode) == -1) ? errno : 0; + err = access(path, mode) == -1 ? FILEIO_ERROR : FILEIO_SUCCESS; free(path); - errno = err; - - return (err == 0) ? FILEIO_SUCCESS : FILEIO_ERROR; + return err; } @@ -2308,7 +2031,7 @@ FileIO_PrivilegedPosixOpen(ConstUnicode pathName, // IN: if (suNeeded) { SuperUser(TRUE); } - fd = FileIO_PosixOpen(pathName, flags, 0); + fd = Posix_Open(pathName, flags, 0); if (suNeeded) { int error = errno; @@ -2320,6 +2043,62 @@ FileIO_PrivilegedPosixOpen(ConstUnicode pathName, // IN: #if defined(__APPLE__) +/* + *----------------------------------------------------------------------------- + * + * FileIO_ResetExcludedFromTimeMachine -- + * + * Request that the given path have its time machine exclusion reset + * (turned off). We use a special xattr on the file to mark that we have + * done this so that future calls won't clear the file if the user has + * explicitly marked it themselves. + * + * Results: + * A boolean reflecting whether or not reseting the file succeeded. + * + * Side effects: + * Adds a "backup re-enabled" xattr to the file if wasn't already present + * and removing the Time Machine exclusion was successful. + * + *----------------------------------------------------------------------------- + */ + +Bool +FileIO_ResetExcludedFromTimeMachine(char const *pathName) // IN +{ + bool result = TRUE; + char xattr; + ssize_t gXattrResult = getxattr(pathName, XATTR_BACKUP_REENABLED, + &xattr, sizeof(xattr), 0, 0); + if (gXattrResult != -1) { + // We have already seen this file, don't touch it again. + goto exit; + } + if (errno != ENOATTR) { + LOG_ONCE((LGPFX" %s Couldn't get xattr on path [%s]: %s.\n", + __func__, pathName, strerror(errno))); + result = FALSE; + goto exit; + } + result = FileIO_SetExcludedFromTimeMachine(pathName, FALSE); + if (!result) { + goto exit; + } + xattr = '1'; + int sXattrResult = setxattr(pathName, XATTR_BACKUP_REENABLED, + &xattr, sizeof(xattr), 0, 0); + if (sXattrResult == -1) { + LOG_ONCE((LGPFX" %s Couldn't set xattr on path [%s]: %s.\n", + __func__, pathName, strerror(errno))); + result = FALSE; + goto exit; + } + +exit: + return result; +} + + /* *----------------------------------------------------------------------------- * @@ -2382,7 +2161,7 @@ FileIO_SetExcludedFromTimeMachine(char const *pathName, // IN goto exit; } - ret = (*backupFunc)(item, TRUE, FALSE); + ret = (*backupFunc)(item, isExcluded, FALSE); if (ret != noErr) { /* diff --git a/open-vm-tools/lib/file/fileLockPosix.c b/open-vm-tools/lib/file/fileLockPosix.c index d877164fd..374ec74a6 100644 --- a/open-vm-tools/lib/file/fileLockPosix.c +++ b/open-vm-tools/lib/file/fileLockPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -44,6 +44,7 @@ #include #include "vmware.h" +#include "posix.h" #include "file.h" #include "fileIO.h" #include "fileLock.h" @@ -331,7 +332,7 @@ GetLockFileValues(const char *lockFileName, // IN: su = IsSuperUser(); SuperUser(TRUE); - lockFile = fopen(lockFileName, "r"); + lockFile = Posix_Fopen(lockFileName, "r"); saveErrno = errno; SuperUser(su); @@ -487,8 +488,8 @@ CreateLockFile(const char *lockFileName, // IN: */ SuperUser(TRUE); - lockFD = open(lockFileName, O_CREAT | O_EXCL | O_WRONLY, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + lockFD = Posix_Open(lockFileName, O_CREAT | O_EXCL | O_WRONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); saveErrno = errno; SuperUser(su); @@ -708,7 +709,7 @@ ReadSlashProc(const char *procPath, // IN: ASSERT(buffer); ASSERT(bufferSize > 0); - fd = open(procPath, O_RDONLY); + fd = Posix_Open(procPath, O_RDONLY, 0); if (fd == -1) { return errno; @@ -929,7 +930,7 @@ FileLockOpenFile(ConstUnicode pathName, // IN: { ASSERT(pathName); - *handle = FileIO_PosixOpen(pathName, flags, 0644); + *handle = PosixFileOpener(pathName, flags, 0644); return *handle == -1 ? errno : 0; } diff --git a/open-vm-tools/lib/file/fileLockPrimitive.c b/open-vm-tools/lib/file/fileLockPrimitive.c index 45ed255b6..c1d3fbb9c 100644 --- a/open-vm-tools/lib/file/fileLockPrimitive.c +++ b/open-vm-tools/lib/file/fileLockPrimitive.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -540,8 +540,6 @@ ScanDirectory(ConstUnicode lockDir, // IN: break; } - Unicode_Free(memberValues.memberName); - /* Remove any stale locking files */ if (FileLockMachineIDMatch(myValues->machineID, memberValues.machineID) && @@ -550,6 +548,8 @@ ScanDirectory(ConstUnicode lockDir, // IN: Log(LGPFX" %s discarding %s from %s'; invalid executionID.\n", __FUNCTION__, UTF8(fileList[i]), UTF8(lockDir)); + Unicode_Free(memberValues.memberName); + err = RemoveLockingFile(lockDir, fileList[i]); if (err != 0) { break; @@ -563,6 +563,11 @@ ScanDirectory(ConstUnicode lockDir, // IN: /* Locking file looks good; see what happens */ err = (*func)(lockDir, fileList[i], ptr, myValues); + + if (ptr == &memberValues) { + Unicode_Free(memberValues.memberName); + } + if (err != 0) { break; } @@ -1079,7 +1084,6 @@ CreateEntryDirectory(const char *machineID, // IN: while (TRUE) { Unicode temp; FileData fileData; - char string[FILELOCK_OVERHEAD]; err = FileAttributes(lockDir, &fileData); if (err == 0) { @@ -1133,22 +1137,13 @@ CreateEntryDirectory(const char *machineID, // IN: /* There is a small chance of collision/failure; grab stings now */ randomNumber = SimpleRandomNumber(machineID, executionID); - Str_Sprintf(string, sizeof string, "M%05u%s", randomNumber, - FILELOCK_SUFFIX); - - *memberName = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); + *memberName = Unicode_Format("M%05u%s", randomNumber, FILELOCK_SUFFIX); - Str_Sprintf(string, sizeof string, "D%05u%s", randomNumber, - FILELOCK_SUFFIX); - - temp = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); + temp = Unicode_Format("D%05u%s", randomNumber, FILELOCK_SUFFIX); *entryDirectory = Unicode_Join(lockDir, U(DIRSEPS), temp, NULL); Unicode_Free(temp); - Str_Sprintf(string, sizeof string, "E%05u%s", randomNumber, - FILELOCK_SUFFIX); - - temp = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); + temp = Unicode_Format("E%05u%s", randomNumber, FILELOCK_SUFFIX); *entryFilePath = Unicode_Join(lockDir, U(DIRSEPS), temp, NULL); Unicode_Free(temp); diff --git a/open-vm-tools/lib/file/filePosix.c b/open-vm-tools/lib/file/filePosix.c index b3974378f..ef2734c0d 100644 --- a/open-vm-tools/lib/file/filePosix.c +++ b/open-vm-tools/lib/file/filePosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -51,6 +51,7 @@ #endif #include "vmware.h" +#include "posix.h" #include "file.h" #include "fileInt.h" #include "msg.h" @@ -110,19 +111,10 @@ static Bool FileIsGroupsMember(gid_t gid); int FileRemoveDirectory(ConstUnicode pathName) // IN: { - int err; - char *path; - - if (pathName == NULL) { - return EFAULT; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - err = (rmdir(path) == -1) ? errno : 0; + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int err = rmdir(path) == -1 ? errno : 0; free(path); - return err; } @@ -148,22 +140,12 @@ int FileRename(ConstUnicode oldName, // IN: ConstUnicode newName) // IN: { - int err; - char *newPath; - char *oldPath; - - if ((oldName == NULL) || (newName == NULL)) { - return EFAULT; - } - - newPath = Unicode_GetAllocBytes(newName, STRING_ENCODING_DEFAULT); - oldPath = Unicode_GetAllocBytes(oldName, STRING_ENCODING_DEFAULT); - - err = (rename(oldPath, newPath) == -1) ? errno : 0; + char *newPath = Unicode_GetAllocBytes(newName, STRING_ENCODING_DEFAULT); + char *oldPath = Unicode_GetAllocBytes(oldName, STRING_ENCODING_DEFAULT); + int err = rename(oldPath, newPath) == -1 ? errno : 0; free(newPath); free(oldPath); - return err; } @@ -188,16 +170,10 @@ int FileDeletion(ConstUnicode pathName, // IN: const Bool handleLink) // IN: { - char *primaryPath; - - int err = 0; + int err; char *linkPath = NULL; - - if (pathName == NULL) { - return EFAULT; - } - - primaryPath = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + char *primaryPath = Unicode_GetAllocBytes(pathName, + STRING_ENCODING_DEFAULT); if (handleLink) { struct stat statbuf; @@ -208,12 +184,7 @@ FileDeletion(ConstUnicode pathName, // IN: } if (S_ISLNK(statbuf.st_mode)) { - linkPath = malloc(statbuf.st_size + 1); - - if (linkPath == NULL) { - err = ENOMEM; - goto bail; - } + linkPath = Util_SafeMalloc(statbuf.st_size + 1); if (readlink(primaryPath, linkPath, statbuf.st_size) != statbuf.st_size) { @@ -235,10 +206,8 @@ FileDeletion(ConstUnicode pathName, // IN: err = (unlink(primaryPath) == -1) ? errno : 0; bail: - free(primaryPath); free(linkPath); - return err; } @@ -271,7 +240,7 @@ File_UnlinkDelayed(ConstUnicode pathName) // IN: * * FileAttributes -- * - * Return the attributes of a file. + * Return the attributes of a file. Time units are in OS native time. * * Results: * 0 success @@ -288,9 +257,9 @@ FileAttributes(ConstUnicode pathName, // IN: FileData *fileData) // OUT: { int err; - PosixStatStruct statbuf; + struct stat statbuf; - if (FileIO_PosixStat(pathName, &statbuf) == -1) { + if (Posix_Stat(pathName, &statbuf) == -1) { err = errno; } else { if (fileData != NULL) { @@ -377,7 +346,7 @@ File_IsRemote(ConstUnicode pathName) // IN: Path name } #endif - if (FileIO_PosixStatfs(pathName, &sfbuf) == -1) { + if (Posix_Statfs(pathName, &sfbuf) == -1) { Log(LGPFX" %s: statfs(%s) failed: %s\n", __func__, UTF8(pathName), strerror(errno)); return TRUE; @@ -418,7 +387,7 @@ File_IsSymLink(ConstUnicode pathName) // IN: { struct stat statbuf; - return (FileIO_PosixLstat(pathName, &statbuf) == 0) && + return (Posix_Lstat(pathName, &statbuf) == 0) && S_ISLNK(statbuf.st_mode); } @@ -459,6 +428,7 @@ File_Cwd(ConstUnicode drive) // IN: Msg_ErrString()); Warning(LGPFX" %s: getcwd() failed: %s\n", __FUNCTION__, Msg_ErrString()); + return NULL; }; @@ -566,22 +536,17 @@ File_FullPath(ConstUnicode pathName) // IN: } else if (File_IsFullPath(pathName)) { temp = Unicode_Duplicate(pathName); } else { - char *str; Unicode path; - char rpath[FILE_MAXPATH]; path = Unicode_Join(cwd, U(DIRSEPS), pathName, NULL); - str = Unicode_GetAllocBytes(path, STRING_ENCODING_DEFAULT); + temp = Posix_RealPath(path); - if (realpath(str, rpath) == NULL) { + if (temp == NULL) { temp = path; } else { - temp = Unicode_Alloc(rpath, STRING_ENCODING_DEFAULT); - Unicode_Free(path); + Unicode_Free(path); } - - free(str); } ret = FileStripFwdSlashes(temp); @@ -652,7 +617,7 @@ File_GetTimes(ConstUnicode pathName, // IN: *writeTime = -1; *attrChangeTime = -1; - if (FileIO_PosixLstat(pathName, &statBuf) == -1) { + if (Posix_Lstat(pathName, &statBuf) == -1) { Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__, UTF8(pathName), strerror(errno)); return FALSE; @@ -903,7 +868,7 @@ FileGetStats(ConstUnicode pathName, // IN: Bool retval = TRUE; Unicode dupPath = NULL; - while (FileIO_PosixStatfs(dupPath ? dupPath : pathName, + while (Posix_Statfs(dupPath ? dupPath : pathName, pstatfsbuf) == -1) { if (errno != ENOENT) { retval = FALSE; @@ -974,7 +939,7 @@ File_GetFreeSpace(ConstUnicode pathName) // IN: File name File_SplitName(fullPath, NULL, &directory, NULL); /* Must use an ioctl() to get free space for a VMFS file. */ ret = -1; - fd = FileIO_PosixOpen(directory, O_RDONLY, 0); + fd = Posix_Open(directory, O_RDONLY, 0); if (fd == -1) { Warning(LGPFX" %s: open of %s failed with: %s\n", __func__, UTF8(directory), Msg_ErrString()); @@ -998,8 +963,8 @@ end: return ret; } -#if defined(VMX86_SERVER) +#if defined(VMX86_SERVER) /* *---------------------------------------------------------------------- * @@ -1055,7 +1020,7 @@ File_GetVMFSAttributes(ConstUnicode pathName, // IN: File to test (*fsAttrs)->ioctlAttr.maxPartitions = FS_PLIST_DEF_MAX_PARTITIONS; (*fsAttrs)->ioctlAttr.getAttrSpec = FS_ATTR_SPEC_BASIC; - fd = FileIO_PosixOpen(parentPath, O_RDONLY, 0); + fd = Posix_Open(parentPath, O_RDONLY, 0); if (fd == -1) { Log(LGPFX" %s: could not open %s.\n", __func__, UTF8(pathName)); @@ -1078,6 +1043,7 @@ bail: return ret; } + /* *---------------------------------------------------------------------- * @@ -1117,6 +1083,7 @@ done: return ret; } + /* *---------------------------------------------------------------------- * @@ -1156,6 +1123,7 @@ done: return ret; } + /* *---------------------------------------------------------------------- * @@ -1195,10 +1163,9 @@ done: } return ret; } - - #endif + /* *---------------------------------------------------------------------- * @@ -1233,7 +1200,7 @@ File_OnVMFS(ConstUnicode pathName) * FileGetStats() to check each of the parent directories. */ - if (FileIO_PosixStatfs(pathName, &statfsbuf) == -1) { + if (Posix_Statfs(pathName, &statfsbuf) == -1) { int err; Unicode fullPath; @@ -1264,6 +1231,7 @@ end: #endif } + /* *---------------------------------------------------------------------- * @@ -1668,8 +1636,8 @@ Bool File_IsSameFile(ConstUnicode path1, // IN: ConstUnicode path2) // IN: { - PosixStatStruct st1; - PosixStatStruct st2; + struct stat st1; + struct stat st2; struct statfs stfs1; struct statfs stfs2; @@ -1718,11 +1686,11 @@ File_IsSameFile(ConstUnicode path1, // IN: return TRUE; } - if (FileIO_PosixStat(path1, &st1) == -1) { + if (Posix_Stat(path1, &st1) == -1) { return FALSE; } - if (FileIO_PosixStat(path2, &st2) == -1) { + if (Posix_Stat(path2, &st2) == -1) { return FALSE; } @@ -1730,11 +1698,11 @@ File_IsSameFile(ConstUnicode path1, // IN: return FALSE; } - if (FileIO_PosixStatfs(path1, &stfs1) != 0) { + if (Posix_Statfs(path1, &stfs1) != 0) { return FALSE; } - if (FileIO_PosixStatfs(path2, &stfs2) != 0) { + if (Posix_Statfs(path2, &stfs2) != 0) { return FALSE; } @@ -1801,12 +1769,14 @@ Bool File_Replace(ConstUnicode oldName, // IN: old file ConstUnicode newName) // IN: new file { - Bool status; + int status; + Bool result; char *newPath; char *oldPath; struct stat st; if ((oldName == NULL) || (newName == NULL)) { + errno = EFAULT; return FALSE; } @@ -1814,31 +1784,37 @@ File_Replace(ConstUnicode oldName, // IN: old file oldPath = Unicode_GetAllocBytes(oldName, STRING_ENCODING_DEFAULT); if ((stat(oldPath, &st) == 0) && (chmod(newPath, st.st_mode) == -1)) { + status = errno; + Msg_Append(MSGID(filePosix.replaceChmodFailed) "Failed to duplicate file permissions from " "\"%s\" to \"%s\": %s\n", oldPath, newPath, Msg_ErrString()); - status = FALSE; + result = FALSE; goto bail; } - if (rename(newPath, oldPath) == -1) { + status = (rename(newPath, oldPath) == -1) ? errno : 0; + + if (status != 0) { Msg_Append(MSGID(filePosix.replaceRenameFailed) "Failed to rename \"%s\" to \"%s\": %s\n", newPath, oldPath, Msg_ErrString()); - status = FALSE; + result = FALSE; goto bail; } - status = TRUE; + result = TRUE; bail: free(newPath); free(oldPath); - return status; + errno = status; + + return result; } @@ -1874,7 +1850,7 @@ FileIsVMFS(ConstUnicode pathName) // IN: file name to test } #endif - if (FileIO_PosixStatfs(pathName, &statfsbuf) == 0) { + if (Posix_Statfs(pathName, &statfsbuf) == 0) { return statfsbuf.f_type == VMFS_SUPER_MAGIC; } @@ -2138,17 +2114,18 @@ int FileCreateDirectory(ConstUnicode pathName) // IN: { int err; - char *path; if (pathName == NULL) { - return EFAULT; - } + err = errno = EFAULT; + } else { + char *path; - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - err = (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) == -1) ? errno : 0; + err = (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) == -1) ? errno : 0; - free(path); + free(path); + } return err; } @@ -2165,9 +2142,11 @@ FileCreateDirectory(ConstUnicode pathName) // IN: * Returns the number of files returned or -1 on failure. * * Side effects: - * If ids is provided and the function succeeds, memory is allocated - * and must be freed. Each unicode and the array itself must be - * freed. + * If ids is provided and the function succeeds, memory is + * allocated for both the unicode strings and the array itself + * and must be freed. (See Unicode_FreeList.) + * The memory allocated for the array may be larger than necessary. + * The caller may trim it with realloc() if it cares. * *---------------------------------------------------------------------- */ @@ -2180,24 +2159,13 @@ File_ListDirectory(ConstUnicode pathName, // IN: DIR *dir; DynBuf b; int count; - char *path; - if (pathName == NULL) { - errno = EFAULT; - return -1; - } + ASSERT(pathName != NULL); - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - errno = 0; - dir = opendir(path); - - err = errno; - free(path); - errno = err; + dir = Posix_OpenDir(pathName); if (dir == (DIR *) NULL) { - // errno is accessible, in the future, for more detail + // errno is preserved return -1; } @@ -2209,7 +2177,6 @@ File_ListDirectory(ConstUnicode pathName, // IN: errno = 0; entry = readdir(dir); - if (entry == (struct dirent *) NULL) { err = errno; break; @@ -2224,7 +2191,7 @@ File_ListDirectory(ConstUnicode pathName, // IN: /* Don't create the file list if we aren't providing it to the caller. */ if (ids) { Unicode id = Unicode_Alloc(entry->d_name, STRING_ENCODING_DEFAULT); - DynBuf_Append(&b, &id, sizeof(&id)); + DynBuf_Append(&b, &id, sizeof id); } count++; @@ -2233,13 +2200,11 @@ File_ListDirectory(ConstUnicode pathName, // IN: closedir(dir); if (ids && (err == 0)) { - *ids = DynBuf_AllocGet(&b); - ASSERT_MEM_ALLOC(*ids); + *ids = DynBuf_Detach(&b); } - DynBuf_Destroy(&b); - return (err == 0) ? count : -1; + return (errno = err) == 0 ? count : -1; } @@ -2280,7 +2245,6 @@ File_IsWritableDir(ConstUnicode dirName) // IN: err = FileAttributes(dirName, &fileData); if ((err != 0) || (fileData.fileType != FILE_TYPE_DIRECTORY)) { - errno = err; return FALSE; } @@ -2505,7 +2469,6 @@ end: Bool File_MakeCfgFileExecutable(ConstUnicode pathName) { - int err; char *path; Bool result; @@ -2522,9 +2485,7 @@ File_MakeCfgFileExecutable(ConstUnicode pathName) S_IROTH | S_IXOTH // rx by others ) == 0; - err = errno; free(path); - errno = err; return result; } @@ -2554,3 +2515,33 @@ File_GetSizeAlternate(ConstUnicode pathName) // IN: { return File_GetSize(pathName); } + + +/* + *---------------------------------------------------------------------------- + * + * File_IsCharDevice -- + * + * This function checks whether the given file is a char device + * and return TRUE in such case. This is often useful on Windows + * where files like COM?, LPT? must be differentiated from "normal" + * disk files. + * + * Results: + * TRUE is a character device + * FALSE is not a character device or error + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +File_IsCharDevice(ConstUnicode pathName) // IN: +{ + FileData fileData; + + return (FileAttributes(pathName, &fileData) == 0) && + (fileData.fileType == FILE_TYPE_CHARDEVICE); +} diff --git a/open-vm-tools/lib/foundryMsg/Makefile.in b/open-vm-tools/lib/foundryMsg/Makefile.in index 0b6f6bcc6..451bef47d 100644 --- a/open-vm-tools/lib/foundryMsg/Makefile.in +++ b/open-vm-tools/lib/foundryMsg/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -107,7 +107,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -119,7 +118,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -144,7 +143,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -153,6 +151,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -160,7 +160,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -305,8 +305,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -318,8 +318,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -329,12 +329,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/foundryMsg/foundryMsg.c b/open-vm-tools/lib/foundryMsg/foundryMsg.c index f81566b36..edee3e1f9 100644 --- a/open-vm-tools/lib/foundryMsg/foundryMsg.c +++ b/open-vm-tools/lib/foundryMsg/foundryMsg.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -406,6 +406,93 @@ VixMsg_ValidateResponseMsg(void *vMsg, // IN } // VixMsg_ValidateResponseMsg +/* + *----------------------------------------------------------------------------- + * + * VixMsg_ParseWriteVariableRequest -- + * + * Extract the value's name and the value itself from the request + * message, while validating message. + * + * The strings returned from this function just point to memory in + * the message itself, so they must not be free()'d. + * + * Results: + * VixError + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +VixError +VixMsg_ParseWriteVariableRequest(VixMsgWriteVariableRequest *msg, // IN + char **valueName, // OUT + char **value) // OUT +{ + VixError err; + char *valueNameLocal = NULL; + char *valueLocal = NULL; + uint64 headerAndBodyLength; + + if ((NULL == msg) || (NULL == valueName) || (NULL == value)) { + ASSERT(0); + err = VIX_E_FAIL; + goto abort; + } + + *valueName = NULL; + *value = NULL; + + /* + * In most cases we will have already called VixMsg_ValidateResponseMsg() + * on this request before, but call it here so that this function will + * always be sufficient to validate the request. + */ + err = VixMsg_ValidateRequestMsg(msg, + msg->header.commonHeader.totalMessageLength); + if (VIX_OK != err) { + goto abort; + } + + if (msg->header.commonHeader.totalMessageLength < sizeof *msg) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + headerAndBodyLength = (uint64) msg->header.commonHeader.headerLength + + msg->header.commonHeader.bodyLength; + + if (headerAndBodyLength < ((uint64) sizeof *msg + + msg->nameLength + 1 + + msg->valueLength + 1)) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + valueNameLocal = ((char *) msg) + sizeof(*msg); + if ('\0' != valueNameLocal[msg->nameLength]) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + valueLocal = valueNameLocal + msg->nameLength + 1; + if ('\0' != valueLocal[msg->valueLength]) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + *valueName = valueNameLocal; + *value = valueLocal; + err = VIX_OK; + +abort: + + return err; +} // VixMsg_ParseWriteVariableRequest + + /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/foundryMsg/foundryPropertyListCommon.c b/open-vm-tools/lib/foundryMsg/foundryPropertyListCommon.c index 3d86a52cf..638033c83 100644 --- a/open-vm-tools/lib/foundryMsg/foundryPropertyListCommon.c +++ b/open-vm-tools/lib/foundryMsg/foundryPropertyListCommon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -403,6 +403,16 @@ VixPropertyList_Deserialize(VixPropertyListImpl *propList, // IN pos += propertyTypeSize; lengthPtr = (int*) &(buffer[pos]); pos += propertyValueLengthSize; + + /* + * Do not allow lengths of 0 or fewer bytes. Those do not make sense, + * unless you can pass a NULL blob, which Serialize() does not allow. + * Also, make sure the value is contained within the bounds of the buffer. + */ + if ((*lengthPtr < 1) || ((*lengthPtr + pos) > bufferSize)) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } /* * Create the property if missing @@ -424,6 +434,10 @@ VixPropertyList_Deserialize(VixPropertyListImpl *propList, // IN switch(*propertyTypePtr) { //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_INTEGER: + if (PROPERTY_SIZE_INT32 != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } intPtr = (int*) &(buffer[pos]); property->value.intValue = *intPtr; break; @@ -431,18 +445,34 @@ VixPropertyList_Deserialize(VixPropertyListImpl *propList, // IN //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_STRING: strPtr = (char*) &(buffer[pos]); + /* + * The length that Serialize() generates includes the terminating + * NUL character. + */ + if (strPtr[*lengthPtr - 1] != '\0') { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } free(property->value.strValue); property->value.strValue = Util_SafeStrdup(strPtr); break; //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_BOOL: + if (PROPERTY_SIZE_BOOL != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } boolPtr = (Bool*) &(buffer[pos]); property->value.boolValue = *boolPtr; break; //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_INT64: + if (PROPERTY_SIZE_INT64 != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } int64Ptr = (int64*) &(buffer[pos]); property->value.int64Value = *int64Ptr; break; @@ -451,6 +481,16 @@ VixPropertyList_Deserialize(VixPropertyListImpl *propList, // IN case VIX_PROPERTYTYPE_BLOB: blobPtr = (unsigned char*) &(buffer[pos]); property->value.blobValue.blobSize = *lengthPtr; + /* + * Use regular malloc() when allocating amounts specified by another + * process. Admittedly we've already bounds checked it, but this is + * pretty easy to handle. + */ + property->value.blobValue.blobContents = malloc(*lengthPtr); + if (NULL == property->value.blobValue.blobContents) { + err = VIX_E_OUT_OF_MEMORY; + goto abort; + } memcpy(property->value.blobValue.blobContents, blobPtr, *lengthPtr); break; @@ -458,6 +498,10 @@ VixPropertyList_Deserialize(VixPropertyListImpl *propList, // IN case VIX_PROPERTYTYPE_POINTER: // The size may be different on different machines. // To be safe, we always use 8 bytes. + if (PROPERTY_SIZE_POINTER != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } ptrPtr = (void**) &(buffer[pos]); property->value.ptrValue = *ptrPtr; break; diff --git a/open-vm-tools/lib/foundryMsg/foundryThreads.c b/open-vm-tools/lib/foundryMsg/foundryThreads.c index 6d6286001..934cba398 100644 --- a/open-vm-tools/lib/foundryMsg/foundryThreads.c +++ b/open-vm-tools/lib/foundryMsg/foundryThreads.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/foundryMsg/vixTranslateErrOpenSource.c b/open-vm-tools/lib/foundryMsg/vixTranslateErrOpenSource.c index 1221e5a49..d1317b913 100644 --- a/open-vm-tools/lib/foundryMsg/vixTranslateErrOpenSource.c +++ b/open-vm-tools/lib/foundryMsg/vixTranslateErrOpenSource.c @@ -8,11 +8,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/ghIntegrationStub/Makefile.in b/open-vm-tools/lib/ghIntegrationStub/Makefile.in index e44c5fd08..0446dffc4 100644 --- a/open-vm-tools/lib/ghIntegrationStub/Makefile.in +++ b/open-vm-tools/lib/ghIntegrationStub/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/ghIntegrationStub/ghIntegrationStub.c b/open-vm-tools/lib/ghIntegrationStub/ghIntegrationStub.c index 9caa08a4b..eb7637a40 100644 --- a/open-vm-tools/lib/ghIntegrationStub/ghIntegrationStub.c +++ b/open-vm-tools/lib/ghIntegrationStub/ghIntegrationStub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -41,3 +41,12 @@ GHI_Cleanup(void) { } +void +GHI_RegisterCaps(void) +{ +} + +void +GHI_UnregisterCaps(void) +{ +} diff --git a/open-vm-tools/lib/guestApp/Makefile.in b/open-vm-tools/lib/guestApp/Makefile.in index d95b9db88..ee3444a5a 100644 --- a/open-vm-tools/lib/guestApp/Makefile.in +++ b/open-vm-tools/lib/guestApp/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -300,8 +300,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -313,8 +313,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -324,12 +324,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/guestApp/guestApp.c b/open-vm-tools/lib/guestApp/guestApp.c index 99e26eab2..f295ae38e 100644 --- a/open-vm-tools/lib/guestApp/guestApp.c +++ b/open-vm-tools/lib/guestApp/guestApp.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -50,6 +50,7 @@ extern "C" { #include "vmstdio.h" #include "codeset.h" #include "productState.h" +#include "posix.h" #if !defined(N_PLAT_NLM) # include "hgfs.h" @@ -62,6 +63,22 @@ extern "C" { #include #endif +/* + * For Netware/Linux/BSD/Solaris, the install path + * is the hardcoded value below. For Windows, it is + * determined dynamically in GuestApp_GetInstallPath(), + * so the empty string here is just for completeness. + * XXX. Whoever does the Mac port should do something + * intelligent for that platform as well. + */ + +#if defined(N_PLAT_NLM) +#define GUESTAPP_TOOLS_INSTALL_PATH "SYS:\\ETC\\VMWTOOL" +#elif defined(_WIN32) +#define GUESTAPP_TOOLS_INSTALL_PATH "" +#else +#define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools" +#endif /* * An option name/value pair stored locally in the guest app. @@ -84,7 +101,7 @@ struct GuestApp_Dict { /* Function pointer, used in GuestApp_GetConfPath. */ #if defined(_WIN32) -typedef HRESULT (WINAPI *PSHGETFOLDERPATH)(HWND, int, HANDLE, DWORD, LPTSTR); +typedef HRESULT (WINAPI *PSHGETFOLDERPATH)(HWND, int, HANDLE, DWORD, LPWSTR); static PSHGETFOLDERPATH pfnSHGetFolderPath = NULL; #endif @@ -766,7 +783,7 @@ GuestApp_LoadDict(GuestApp_Dict *dict) // IN/OUT ASSERT(dict); ASSERT(dict->fileName); - stream = fopen(dict->fileName, "r"); + stream = Posix_Fopen(dict->fileName, "r"); if (stream == NULL) { Debug("Unable to open \"%s\"\n", dict->fileName); @@ -851,7 +868,7 @@ GuestApp_WriteDict(GuestApp_Dict *dict) // IN/OUT ASSERT(dict); ASSERT(dict->fileName); - stream = fopen(dict->fileName, "w"); + stream = Posix_Fopen(dict->fileName, "w"); if (stream == NULL) { Warning("Unable to open \"%s\"\n", dict->fileName); @@ -888,79 +905,76 @@ GuestApp_WriteDict(GuestApp_Dict *dict) // IN/OUT * * GuestApp_GetInstallPath -- * - * Get the tools installation path. + * Get the tools installation path. The caller is responsible for + * freeing the memory allocated for the path. * * Results: - * The path. + * The path in UTF-8 if successful. + * NULL otherwise. * * Side effects: - * None. + * Allocates memory. * *---------------------------------------------------------------------- */ -const char * +char * GuestApp_GetInstallPath(void) { -#if defined(N_PLAT_NLM) - return "SYS:\\ETC\\VMWTOOL"; -#elif defined(_WIN32) + char *pathUtf8 = NULL; + +#if defined(_WIN32) LONG rv; HKEY key; DWORD type; DWORD len = MAX_PATH; - static char path[MAX_PATH] = ""; - - if (strcmp(path, "") == 0) { - const char *keyName = "Software\\VMware, Inc.\\VMware Tools"; - - rv = RegOpenKey(HKEY_LOCAL_MACHINE, keyName, &key); - - if (rv != ERROR_SUCCESS) { - Warning("Unable to open key '%s': %s\n", keyName, Msg_ErrString()); - return NULL; - } - rv = RegQueryValueEx(key, "InstallPath", 0, &type, (LPBYTE) path, &len); + size_t posLastChar; + WCHAR path[MAX_PATH] = L""; + size_t pathLen = 0; + const WCHAR *keyName = L"Software\\VMware, Inc.\\VMware Tools"; + + rv = RegOpenKeyW(HKEY_LOCAL_MACHINE, keyName, &key); + if (rv != ERROR_SUCCESS) { + Warning("%s: Unable to open product key: error: %s\n", + __FUNCTION__, Msg_ErrString()); + return NULL; + } - RegCloseKey(key); - if (rv != ERROR_SUCCESS) { - Warning("Unable to retrieve key '%s': %s\n", keyName, Msg_ErrString()); - goto error; - } + rv = RegQueryValueExW(key, L"InstallPath", 0, &type, (LPBYTE)path, &len); + RegCloseKey(key); + if (rv != ERROR_SUCCESS) { + Warning("%s: Unable to retrieve key: error: %s\n", + __FUNCTION__, Msg_ErrString()); + return NULL; } /* * Strip off the trailing backslash. This needs to be done with wchars to * ensure that we don't mess up a path that ends with the 5C character. */ - { - WCHAR pathWide[MAX_PATH]; - size_t posLastChar; - - if (!MultiByteToWideChar(CP_ACP, 0, path, -1, pathWide, sizeof pathWide)) { - ASSERT(FALSE); - goto error; - } - posLastChar = wcslen(pathWide) - 1; - if (pathWide[posLastChar] == L'\\') { - pathWide[posLastChar] = L'\0'; + pathLen = wcslen(path); + if (pathLen > 0) { + posLastChar = pathLen - 1; + if (path[posLastChar] == L'\\') { + path[posLastChar] = L'\0'; } + } - if (!WideCharToMultiByte(CP_ACP, 0, pathWide, -1, - path, sizeof path, NULL, NULL)) { - ASSERT(FALSE); - goto error; - } - return path; + /* Convert to UTF-8 before returning to the outside world. */ + if (!CodeSet_Utf16leToUtf8((const char *)path, + wcslen(path) * sizeof(WCHAR), + &pathUtf8, + NULL)) { + Warning("%s: Unable to convert to UTF-8\n", __FUNCTION__); + return NULL; } - error: - Str_Strcpy(path, "", sizeof path); - return NULL; #else - return "/etc/vmware-tools"; + pathUtf8 = Str_Asprintf(NULL, "%s", GUESTAPP_TOOLS_INSTALL_PATH); #endif + + return pathUtf8; } @@ -971,6 +985,9 @@ GuestApp_GetInstallPath(void) * * Get the path to the Tools configuration file. * + * The return conf path is a dynamically allocated UTF-8 encoded + * string that should be freed by the caller. + * * XXX: Unfortunately, much of this function is duplicated in * lib/user/win32util.c because we can't use that file inside guest * code. If we do, we'll break Win95 Tools. @@ -987,75 +1004,111 @@ GuestApp_GetInstallPath(void) * a non-root user process calls this function, the directory exists. * * Results: - * The path, or NULL on failure. + * The path in UTF-8, or NULL on failure. * * Side effects: - * None. + * Allocates memory. * *---------------------------------------------------------------------- */ -const char * +char * GuestApp_GetConfPath(void) { #if defined(_WIN32) - static char path[MAX_PATH] = ""; + char *pathUtf8 = NULL; + char *appFolderPathUtf8 = NULL; + WCHAR appFolderPath[MAX_PATH] = L""; + size_t pathUtf8Size = 0; + const char *productName; /* * XXX: This is racy. But GuestApp_GetInstallPath is racy too. Clearly * that is a good enough justification. */ - if (strcmp(path, "") == 0) { - if (!pfnSHGetFolderPath) { - HMODULE h = LoadLibrary("shfolder.dll"); - if (h) { - pfnSHGetFolderPath = (PSHGETFOLDERPATH) - GetProcAddress(h, "SHGetFolderPathA"); - } - - /* win32util.c avoids calling FreeLibrary() so we will too. */ + if (!pfnSHGetFolderPath) { + HMODULE h = LoadLibraryW(L"shfolder.dll"); + if (h) { + pfnSHGetFolderPath = (PSHGETFOLDERPATH) + GetProcAddress(h, "SHGetFolderPathW"); } + + /* win32util.c avoids calling FreeLibrary() so we will too. */ + } - /* - * Get the Common Application data folder - create if it doesn't - * exist. - */ - if (!pfnSHGetFolderPath || - FAILED(pfnSHGetFolderPath(NULL, CSIDL_COMMON_APPDATA | - CSIDL_FLAG_CREATE, NULL, 0, path))) { - return NULL; - } - - ASSERT(path[0]); - - /* Check to see if subdirectories exist. */ - Str_Strcat(path, "\\" PRODUCT_GENERIC_NAME, MAX_PATH); - if (!File_Exists(path)) { - if (!CreateDirectory(path, NULL)) { - return NULL; - } - } - - if (!File_IsDirectory(path)) { - return NULL; - } - - Str_Strcat(path, "\\", MAX_PATH); - Str_Strcat(path, ProductState_GetName(), MAX_PATH); - if (!File_Exists(path)) { - if (!CreateDirectory(path, NULL)) { - return NULL; - } + /* + * Get the Common Application data folder - create if it doesn't + * exist. + */ + + if (!pfnSHGetFolderPath || + FAILED(pfnSHGetFolderPath(NULL, CSIDL_COMMON_APPDATA | + CSIDL_FLAG_CREATE, NULL, 0, appFolderPath))) { + return NULL; + } + + ASSERT(appFolderPath[0]); + + if (!CodeSet_Utf16leToUtf8((const char *)appFolderPath, + wcslen(appFolderPath) * sizeof *appFolderPath, + &appFolderPathUtf8, + NULL)) { + return NULL; + } + + productName = ProductState_GetName(); + + /* + * Make sure there's enought space for + * appFolderPath\PRODUCT_GENERIC_NAME\PRODUCT_NAME. + */ + + pathUtf8Size = strlen(appFolderPathUtf8) + 1 + + strlen(PRODUCT_GENERIC_NAME) + 1 + + strlen(productName) + 1; + pathUtf8 = malloc(pathUtf8Size); + if (pathUtf8 == NULL) { + free(appFolderPathUtf8); + goto error; + } + + Str_Strcpy(pathUtf8, appFolderPathUtf8, pathUtf8Size); + free(appFolderPathUtf8); + + /* Check to see if subdirectories exist. */ + Str_Strcat(pathUtf8, "\\" PRODUCT_GENERIC_NAME, pathUtf8Size); + if (!File_Exists(pathUtf8)) { + if (!File_CreateDirectory(pathUtf8)) { + goto error; } - - if (!File_IsDirectory(path)) { - return NULL; + } + + if (!File_IsDirectory(pathUtf8)) { + goto error; + } + + Str_Strcat(pathUtf8, "\\", MAX_PATH); + Str_Strcat(pathUtf8, productName, pathUtf8Size); + if (!File_Exists(pathUtf8)) { + if (!File_CreateDirectory(pathUtf8)) { + goto error; } } - return path; + + if (!File_IsDirectory(pathUtf8)) { + goto error; + } + + return pathUtf8; + +error: + free(pathUtf8); + + return NULL; #else - /* Just call into GuestApp_GetInstallPath. */ + + /* Just call into GuestApp_GetInstallPath. */ return GuestApp_GetInstallPath(); #endif } @@ -1066,7 +1119,8 @@ GuestApp_GetConfPath(void) * * GuestApp_GetLogPath -- * - * Get the path that the Tools should log to. + * Get the path that the Tools should log to. The returned path + * is in UTF-8. * * Results: * Allocates the path or NULL on failure. @@ -1081,23 +1135,34 @@ char * GuestApp_GetLogPath(void) { #if defined(_WIN32) + char *bufferUtf8 = NULL; + Bool conversionRes; /* We should log to %TEMP%. */ - LPTSTR buffer = NULL; + LPWSTR buffer = NULL; DWORD bufferSize = 0, neededSize; - if ((neededSize = GetEnvironmentVariable("TEMP", buffer, bufferSize)) == 0) { + if ((neededSize = GetEnvironmentVariableW(L"TEMP", buffer, bufferSize)) == 0) { return NULL; } - buffer = malloc(neededSize); + buffer = malloc(neededSize * sizeof *buffer); if (buffer == NULL) { return NULL; } bufferSize = neededSize; - if (GetEnvironmentVariable("TEMP", buffer, bufferSize) != neededSize) { + if (GetEnvironmentVariableW(L"TEMP", buffer, bufferSize) != neededSize) { free(buffer); return NULL; } - return buffer; + + conversionRes = CodeSet_Utf16leToUtf8((const char *)buffer, + wcslen(buffer) * sizeof(WCHAR), + &bufferUtf8, + NULL); + free(buffer); + if (!conversionRes) { + return NULL; + } + return bufferUtf8; #else /* XXX: Is this safe for EVERYONE who isn't Windows? */ return strdup("/var/log"); @@ -1134,12 +1199,7 @@ GuestApp_GetCmdOutput(const char *cmd) // IN DynBuf_Init(&db); -#ifndef _WIN32 - stream = popen(cmd, "r"); -#else - stream = _popen(cmd, "r"); -#endif - + stream = Posix_Popen(cmd, "r"); if (stream == NULL) { Debug("Unable to get output of command \"%s\"\n", cmd); diff --git a/open-vm-tools/lib/guestApp/guestAppPosix.c b/open-vm-tools/lib/guestApp/guestAppPosix.c index 5d0f65dd7..c4d8370af 100644 --- a/open-vm-tools/lib/guestApp/guestAppPosix.c +++ b/open-vm-tools/lib/guestApp/guestAppPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/guestInfo/Makefile.am b/open-vm-tools/lib/guestInfo/Makefile.am index 6abe0734a..f27d06bc2 100644 --- a/open-vm-tools/lib/guestInfo/Makefile.am +++ b/open-vm-tools/lib/guestInfo/Makefile.am @@ -20,7 +20,9 @@ noinst_LIBRARIES = libGuestInfo.a libGuestInfo_a_SOURCES = libGuestInfo_a_SOURCES += guestInfoServer.c libGuestInfo_a_SOURCES += guestInfoPosix.c +libGuestInfo_a_SOURCES += guestInfoPerfMonLinux.c AM_CFLAGS = AM_CFLAGS += @COMMON_CFLAGS@ AM_CFLAGS += $(DNET_CFLAGS) +AM_CFLAGS += $(PROCPS_CFLAGS) \ No newline at end of file diff --git a/open-vm-tools/lib/guestInfo/Makefile.in b/open-vm-tools/lib/guestInfo/Makefile.in index dc8cbab53..9f8fead3c 100644 --- a/open-vm-tools/lib/guestInfo/Makefile.in +++ b/open-vm-tools/lib/guestInfo/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -62,7 +62,7 @@ ARFLAGS = cru libGuestInfo_a_AR = $(AR) $(ARFLAGS) libGuestInfo_a_LIBADD = am_libGuestInfo_a_OBJECTS = guestInfoServer.$(OBJEXT) \ - guestInfoPosix.$(OBJEXT) + guestInfoPosix.$(OBJEXT) guestInfoPerfMonLinux.$(OBJEXT) libGuestInfo_a_OBJECTS = $(am_libGuestInfo_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -217,8 +217,9 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libGuestInfo.a -libGuestInfo_a_SOURCES = guestInfoServer.c guestInfoPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ $(DNET_CFLAGS) +libGuestInfo_a_SOURCES = guestInfoServer.c guestInfoPosix.c \ + guestInfoPerfMonLinux.c +AM_CFLAGS = @COMMON_CFLAGS@ $(DNET_CFLAGS) $(PROCPS_CFLAGS) all: all-am .SUFFIXES: @@ -266,6 +267,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfoPerfMonLinux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfoPosix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfoServer.Po@am__quote@ @@ -301,8 +303,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -314,8 +316,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -325,12 +327,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/guestInfo/guestInfoPerfMonLinux.c b/open-vm-tools/lib/guestInfo/guestInfoPerfMonLinux.c new file mode 100644 index 000000000..097e40d76 --- /dev/null +++ b/open-vm-tools/lib/guestInfo/guestInfoPerfMonLinux.c @@ -0,0 +1,209 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +/* + * This file gathers the virtual memory stats from Linux guest to be + * passed on to the vmx. + */ + +#include +#include +#include +#include +#include +#include +#ifndef NO_PROCPS +# include +#endif + +#include "vmware.h" +#include "guestInfo.h" +#include "strutil.h" +#include "debug.h" + +#ifndef NO_PROCPS +static void GuestInfoMonitorGetStat(MemInfo *vmStats); +static Bool GuestInfoMonitorReadMeminfo(MemInfo *vmStats); +#endif + +#define LINUX_MEMINFO_FLAGS (MEMINFO_MEMTOTAL | MEMINFO_MEMFREE | MEMINFO_MEMBUFF |\ + MEMINFO_MEMCACHE | MEMINFO_MEMACTIVE | MEMINFO_MEMINACTIVE |\ + MEMINFO_SWAPINRATE | MEMINFO_SWAPOUTRATE |\ + MEMINFO_IOINRATE | MEMINFO_IOOUTRATE) + +/* + *---------------------------------------------------------------------- + * + * GuestInfo_PerfMon -- + * + * Gather performance stats. + * + * Results: + * Gathered stats. Returns FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +GuestInfo_PerfMon(MemInfo *vmStats) // OUT: filled vmstats +{ +#ifndef NO_PROCPS + ASSERT(vmStats); + GuestInfoMonitorGetStat(vmStats); + if (GuestInfoMonitorReadMeminfo(vmStats)) { + vmStats->flags = LINUX_MEMINFO_FLAGS; + return TRUE; + } +#endif + return FALSE; +} + + +#ifndef NO_PROCPS +/* + *---------------------------------------------------------------------- + * + * GuestInfoMonitorGetStat -- + * + * Calls getstat() to gather memory stats. + * + * Results: + * Gathered stats in vmStats. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +GuestInfoMonitorGetStat(MemInfo *vmStats) // OUT: filled vmstats +{ + uint32 hz = Hertz; + uint32 dummy; + jiff cpuUse[2]; + jiff cpuNic[2]; + jiff cpuSys[2]; + jiff cpuIdl[2]; + jiff cpuIow[2]; + jiff cpuXxx[2]; + jiff cpuYyy[2]; + jiff cpuZzz[2]; + jiff cpuTotal; + jiff cpuHalf; + unsigned long pageIn[2]; + unsigned long pageOut[2]; + unsigned long swapIn[2]; + unsigned long swapOut[2]; + unsigned int dummy2[2]; + unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul; + + meminfo(); + getstat(cpuUse, cpuNic, cpuSys, cpuIdl, cpuIow, cpuXxx, cpuYyy, cpuZzz, + pageIn, pageOut, swapIn, swapOut, dummy2, dummy2, &dummy, &dummy, + &dummy, &dummy); + + cpuTotal = *cpuUse + *cpuNic + *cpuSys + *cpuXxx + + *cpuYyy + *cpuIdl + *cpuIow + *cpuZzz; + cpuHalf = cpuTotal / 2UL; + + vmStats->memFree = kb_main_free; + vmStats->memBuff = kb_main_buffers; + vmStats->memCache = kb_main_cached, + vmStats->memInactive = kb_inactive; + vmStats->memActive = kb_active; + + vmStats->swapInRate = (uint64)((*swapIn * kb_per_page * hz + cpuHalf) / cpuTotal); + vmStats->swapOutRate = (uint64)((*swapOut * kb_per_page * hz + cpuHalf) / cpuTotal); + vmStats->ioInRate = (uint64)((*pageIn * hz + cpuHalf) / cpuTotal); + vmStats->ioOutRate = (uint64)((*pageOut * hz + cpuHalf) / cpuTotal); + + + Debug("GuestInfoMonitorGetStat: MemInfo: total: %"FMT64"u free: %"FMT64"u"\ + "buff: %"FMT64"u cache: %"FMT64"u swapin: %"FMT64"u swapout: %"FMT64"u ioin:"\ + "%"FMT64"u ioout: %"FMT64"u inactive: %"FMT64"u active: %"FMT64"u"\ + "hugetotal: %"FMT64"u hugefree: %"FMT64"u\n", vmStats->memTotal, + vmStats->memFree, vmStats->memBuff, vmStats->memCache, vmStats->swapInRate, + vmStats->swapOutRate, vmStats->ioInRate, vmStats->ioOutRate, + vmStats->memInactive, vmStats->memActive, vmStats->hugePagesTotal, + vmStats->hugePagesFree); +} + + +/* + *---------------------------------------------------------------------- + * + * GuestInfoMonitorReadMeminfo -- + * + * Reads /proc/meminfo to gather phsycial memory and huge page stats. + * + * Results: + * Read /proc/meminfo for total physical memory and huge pages info. + * Returns FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static Bool +GuestInfoMonitorReadMeminfo(MemInfo *vmStats) // OUT: filled vmstats +{ + char buf[512]; + uint64 value; + FILE *fp; + + /* Get the total memory, and huge page info from /proc/meminfo. */ + fp = fopen("/proc/meminfo", "r"); + if (!fp) { + Log("GuestInfoMonitorReadMeminfo: Error opening /proc/meminfo.\n"); + return FALSE; + } + + while(!feof(fp)) { + fscanf(fp, "%s %"FMT64"u", buf, &value); + if (StrUtil_StartsWith(buf, "MemTotal")) { + vmStats->memTotal = value; + } + if (StrUtil_StartsWith(buf, "HugePages_Total")) { + vmStats->hugePagesTotal = value; + vmStats->flags |= MEMINFO_HUGEPAGESTOTAL; + } + if (StrUtil_StartsWith(buf, "HugePages_Free")) { + vmStats->hugePagesFree = value; + vmStats->flags |= MEMINFO_HUGEPAGESFREE; + } + } + fclose(fp); + + Debug("GuestInfoMonitorReadMeminfo: MemInfo: total: %"FMT64"u free: %"FMT64"u"\ + "buff: %"FMT64"u cache: %"FMT64"u swapin: %"FMT64"u swapout: %"FMT64"u ioin:"\ + "%"FMT64"u ioout: %"FMT64"u inactive: %"FMT64"u active: %"FMT64"u"\ + "hugetotal: %"FMT64"u hugefree: %"FMT64"u\n", vmStats->memTotal, + vmStats->memFree, vmStats->memBuff, vmStats->memCache, vmStats->swapInRate, + vmStats->swapOutRate, vmStats->ioInRate, vmStats->ioOutRate, + vmStats->memInactive, vmStats->memActive, vmStats->hugePagesTotal, + vmStats->hugePagesFree); + + return TRUE; +} +#endif diff --git a/open-vm-tools/lib/guestInfo/guestInfoPosix.c b/open-vm-tools/lib/guestInfo/guestInfoPosix.c index dfe417c51..1053e1bff 100644 --- a/open-vm-tools/lib/guestInfo/guestInfoPosix.c +++ b/open-vm-tools/lib/guestInfo/guestInfoPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,9 +34,7 @@ #include #include #ifdef sun -# include # include -# include #endif #include #include @@ -44,17 +42,17 @@ #include #include #ifdef __FreeBSD__ -# include -# include -# include # include #endif +#ifndef NO_DNET +# ifdef DNET_IS_DUMBNET +# include +# else +# include +# endif +#endif #include "util.h" -#include "arpa/inet.h" #include "sys/utsname.h" -#include "net/if_arp.h" -#include "net/if.h" -#include "netdb.h" #include "sys/ioctl.h" #include "vmware.h" #include "guestInfoInt.h" @@ -169,282 +167,131 @@ GuestInfoGetFqdn(int outBufLen, // IN: length of output buffer } +#ifndef NO_DNET /* *----------------------------------------------------------------------------- * - * GuestInfoGetNicInfo -- + * ReadInterfaceDetails -- * - * Return MAC addresses of all the NICs in the guest and their - * corresponding IP addresses. + * Callback function called by libdnet when iterating over all the + * NICs on the host. * * Return value: - * Returns TRUE on success and FALSE on failure. - * Return MAC addresses of all NICs and their corresponding IPs. + * Returns 0 on success and -1 on failure. + * Adds the MAC addresses of all NICs and their corresponding IPs. * * Side effects: * Memory is allocated for each NIC, as well as IP addresses of all NICs * on successful return. * *----------------------------------------------------------------------------- - */ + */ -#if defined(__FreeBSD__) -Bool -GuestInfoGetNicInfo(NicInfo *nicInfo) // OUT +int +ReadInterfaceDetails(const struct intf_entry *entry, // IN: current interface entry + void *arg) // IN: Pointer to the NicInfo { - struct ifaddrs *ifaces; - struct ifaddrs *cur; - typedef struct IfNameNicMap { // linked list to remember interface names - char *name; - NicEntry *nicEntry; // point to the NIC entry of the interface - DblLnkLst_Links links; - } IfNameNicMap; - IfNameNicMap *ifNamesCur; - DblLnkLst_Links ifNameList; - DblLnkLst_Links *sCurrent; - DblLnkLst_Links *sNext; - DblLnkLst_Links *linkIfName; - - ASSERT(nicInfo); - memset(nicInfo, 0, sizeof *nicInfo); - DblLnkLst_Init(&nicInfo->nicList); - DblLnkLst_Init(&ifNameList); - - if (getifaddrs(&ifaces) < 0) { - Debug("GuestInfo: Error, failed to call getifaddrs(3)\n"); - return FALSE; - } - - /* - * First pass: identify all interfaces with MAC addresses. As we add each - * MAC address to nicInfo, we also track the interface name tied to that - * address. This is because we must later use the interface name to find - * the appropriate MAC given a pair of {name,IP}. - */ - for (cur = ifaces; cur != NULL; cur = cur->ifa_next) { - if (cur->ifa_addr->sa_family == AF_LINK) { - NicEntry *nicEntryCur; - unsigned char tempMacAddress[6]; - char macAddress[MAC_ADDR_SIZE]; - struct sockaddr_dl *sdl = (struct sockaddr_dl *)cur->ifa_addr; - - /* - * By ensuring the address length is 6, we implicitly ignore all - * non-Ethernet addresses (such as loopback). - */ - if (sdl->sdl_alen != sizeof tempMacAddress) { - Debug("GuestInfo: Unexpected length for MAC address, skipping " - "interface\n"); - continue; - } + int i; - /* - * insert the new entry to the end of the nicList - */ - - memcpy(tempMacAddress, LLADDR(sdl), sdl->sdl_alen); - Str_Sprintf(macAddress, - sizeof macAddress, - "%02x:%02x:%02x:%02x:%02x:%02x", - tempMacAddress[0], tempMacAddress[1], tempMacAddress[2], - tempMacAddress[3], tempMacAddress[4], tempMacAddress[5]); + NicInfo *nicInfo = (NicInfo *)arg; - nicEntryCur = NicInfo_AddNicEntry(nicInfo, macAddress); - - /* - * Make interface name link list - */ - ifNamesCur = Util_SafeCalloc(1, sizeof *ifNamesCur); - ifNamesCur->name = cur->ifa_name; - ifNamesCur->nicEntry = nicEntryCur; - DblLnkLst_Init(&ifNamesCur->links); - DblLnkLst_LinkLast(&ifNameList, &ifNamesCur->links); - } - } - - /* Second pass: tie each IP address to its MAC address. */ - for (cur = ifaces; cur != NULL; cur = cur->ifa_next) { - if (cur->ifa_addr->sa_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *)cur->ifa_addr; + if ((entry->intf_type & INTF_TYPE_ETH) == INTF_TYPE_ETH) { + NicEntry *nicEntryCur; + char macAddress[MAC_ADDR_SIZE]; + char ipAddress[IP_ADDR_SIZE_V2]; - /* - * This is tedious but necessary. We iterate over the stored interface - * names looking for the one tied to this IP address. Then we convert - * the IP address to a string and store it in the nicInfo struct. - */ + Str_Sprintf(macAddress, sizeof macAddress, + addr_ntoa(&entry->intf_link_addr)); + nicEntryCur = GuestInfoAddNicEntry(nicInfo, macAddress); + if (nicEntryCur == NULL) { + return -1; + } - DblLnkLst_ForEach(linkIfName, &ifNameList) { - ifNamesCur = DblLnkLst_Container(linkIfName, IfNameNicMap, links); - if (strcmp(ifNamesCur->name, cur->ifa_name) == 0) { - VmIpAddressEntry *ipAddressCur; - NicEntry *entry = ifNamesCur->nicEntry; - char ipAddress[IP_ADDR_SIZE]; - - if (!inet_ntop(AF_INET, - &sin->sin_addr, - ipAddress, - sizeof ipAddress)) { - Debug("GuestInfo: Could not convert IP address, skipping " - "IP\n"); - break; + if (entry->intf_addr.addr_type == ADDR_TYPE_IP) { + VmIpAddressEntry *ipAddressEntry = NULL; + /* Use ip_ntop instead of addr_ntop since we don't want the netmask bits. */ + ip_ntop(&entry->intf_addr.addr_ip, ipAddress, sizeof ipAddress); + ipAddressEntry = GuestInfoAddIpAddress(nicEntryCur, + ipAddress, + INFO_IP_ADDRESS_FAMILY_IPV4); + if (ipAddressEntry) { + GuestInfoAddSubnetMask(ipAddressEntry, entry->intf_addr.addr_bits); + } + /* Walk the list of alias's and add those that are IPV4 or IPV6 */ + for (i = 0; i < entry->intf_alias_num; i++) { + if (entry->intf_alias_addrs[i].addr_type == ADDR_TYPE_IP) { + ip_ntop(&entry->intf_alias_addrs[i].addr_ip, + ipAddress, + sizeof ipAddress); + ipAddressEntry = GuestInfoAddIpAddress(nicEntryCur, + ipAddress, + INFO_IP_ADDRESS_FAMILY_IPV4); + if (ipAddressEntry) { + GuestInfoAddSubnetMask(ipAddressEntry, + entry->intf_addr.addr_bits); } - - ipAddressCur = NicEntry_AddIpAddress(entry, - ipAddress, - 0); /* not used */ - break; + } else if (entry->intf_alias_addrs[i].addr_type == ADDR_TYPE_IP6) { + memcpy(ipAddress, + addr_ntoa(&entry->intf_alias_addrs[i]), + sizeof ipAddress); + GuestInfoAddIpAddress(nicEntryCur, + ipAddress, + INFO_IP_ADDRESS_FAMILY_IPV6); } - } - } - } - - freeifaddrs(ifaces); - - /* free alllocated temp memory */ - DblLnkLst_ForEachSafe(sCurrent, sNext, &ifNameList) { - DblLnkLst_Unlink1(sCurrent); - free(DblLnkLst_Container(sCurrent, IfNameNicMap, links)); + } + } } - return TRUE; + return 0; } +#endif -#else /* FreeBSD */ +/* + *----------------------------------------------------------------------------- + * + * GuestInfoGetNicInfo -- + * + * Return MAC addresses of all the NICs in the guest and their + * corresponding IP addresses. + * + * Return value: + * Returns TRUE on success and FALSE on failure. + * Return MAC addresses of all NICs and their corresponding IPs. + * + * Side effects: + * Memory is allocated for each NIC, as well as IP addresses of all NICs + * on successful return. + * + *----------------------------------------------------------------------------- + */ Bool GuestInfoGetNicInfo(NicInfo *nicInfo) // OUT { - Bool retVal = FALSE; - int sockfd; - struct ifconf ifc; - struct ifreq *ifr; - unsigned int numReqs = 30; /* Initial estimate of number of ifreqs. */ - unsigned int i; - char ipAddress[IP_ADDR_SIZE]; - char macAddress[MAC_ADDR_SIZE]; - - ASSERT(nicInfo); - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { - Debug("GuestInfo: Error, could not create socket\n"); - return FALSE; - } +#ifndef NO_DNET + intf_t *intf; memset(nicInfo, 0, sizeof *nicInfo); DblLnkLst_Init(&nicInfo->nicList); - ifc.ifc_buf = NULL; - - /* Get all the interface entries for this machine. */ - for (;;) { - void *tmp = ifc.ifc_buf; - ifc.ifc_len = (sizeof *ifr) * numReqs; - if (!(ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len))) { - Debug("GuestInfo: Error, failed to allocate ifconf\n"); - free(tmp); - goto out; - } - - if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { - Debug("GuestInfo: SIOCGIFCONF failed\n"); - goto out; - } - if (ifc.ifc_len == (sizeof *ifr) * numReqs) { - /* assume it overflowed and try again */ - numReqs += 10; - continue; - } - break; - } - - /* Get the IP and MAC address for each of these interfaces. */ - ifr = ifc.ifc_req; - - for (i = 0; i * (sizeof *ifr) < ifc.ifc_len; i++, ifr++) { - unsigned char *ptr = NULL; - VmIpAddressEntry *ipAddressCur; - NicEntry *macNicEntry; -# ifdef sun - eth_t *device; - eth_addr_t addr; -# endif - - Debug("%s\n", ifr->ifr_name); - - /* - * Get the mac address for this interface. Some interfaces (like the - * loopback interface) have no MAC address, and we skip them. - */ -# ifndef sun - if (ioctl(sockfd, SIOCGIFHWADDR, ifr) < 0) { - Debug("GuestInfo: Failed to get MAC address, skipping interface\n"); - continue; - } - - ptr = &ifr->ifr_hwaddr.sa_data[0]; -# else - /* libdnet's eth_* interface gets the ethernet address for us. */ - device = eth_open(ifr->ifr_name); - if (!device) { - Debug("GuestInfo: Failed to open device, skipping interface\n"); - continue; - } - - if (eth_get(device, &addr) != 0) { - eth_close(device); - Debug("GuestInfo: Failed to get MAC address, skipping interface\n"); - continue; - } - - eth_close(device); - ptr = &addr.data[0]; -#endif - - - /* Get the corresponding IP address. */ - ifr->ifr_addr.sa_family = AF_INET; - if (ioctl(sockfd, SIOCGIFADDR, ifr) < 0) { - Debug("GuestInfo: Failed to get ip address, skipping interface\n"); - continue; - } - - /* Convert IP to a string. */ - if (!inet_ntop(AF_INET, - &((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr, - ipAddress, sizeof ipAddress)) { - Debug("GuestInfo: Failed in inet_ntop, skipping interface\n"); - continue; - } - Str_Sprintf(macAddress, sizeof macAddress, - "%02x:%02x:%02x:%02x:%02x:%02x", - *ptr, *(ptr + 1), *(ptr + 2), - *(ptr + 3), *(ptr + 4), *(ptr + 5)); - - /* Which entry in nic info corresponds to this MAC address? */ - macNicEntry = NicInfo_FindMacAddress(nicInfo, macAddress); - if (NULL == macNicEntry) { - /* This mac address has not been added to nicInfo, get a new entry. */ - macNicEntry = NicInfo_AddNicEntry(nicInfo, - macAddress); - } - - ipAddressCur = NicEntry_AddIpAddress(macNicEntry, ipAddress, 0); + /* Get a handle to read the network interface configuration details. */ + if ((intf = intf_open()) == NULL) { + Debug("GuestInfo: Error, failed NULL result from intf_open()\n"); + return FALSE; } - retVal = TRUE; - -out: - if (close(sockfd) == -1) { - Debug("GuestInfo: Close socket failed\n"); - retVal = FALSE; + if (intf_loop(intf, ReadInterfaceDetails, nicInfo) < 0) { + intf_close(intf); + Debug("GuestInfo: Error, negative result from intf_loop\n"); + return FALSE; } - if (ifc.ifc_buf) { - free(ifc.ifc_buf); - } - return retVal; -} + intf_close(intf); + return TRUE; +#else + return FALSE; #endif - +} /* *----------------------------------------------------------------------------- diff --git a/open-vm-tools/lib/guestInfo/guestInfoServer.c b/open-vm-tools/lib/guestInfo/guestInfoServer.c index 6c6bca65c..6dbbc2521 100644 --- a/open-vm-tools/lib/guestInfo/guestInfoServer.c +++ b/open-vm-tools/lib/guestInfo/guestInfoServer.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -256,7 +256,7 @@ GuestInfoServer_Init(DblLnkLst_Links *eventQueue) // IN: queue for event loop * This value should however be made configurable. */ - gTimerInterval = 3000; /* 30 seconds. */ + gTimerInterval = GUESTINFO_TIME_INTERVAL_MSEC; /* Add the first timer event. */ if (!EventManager_Add(gGuestInfoEventQueue, gTimerInterval, GuestInfoGather, NULL)) { @@ -406,7 +406,10 @@ GuestInfoGather(void *clientData) // IN: unused char osName[MAX_VALUE_LEN]; NicInfo nicInfo; DiskInfo diskInfo; - +#if defined(_WIN32) || defined(linux) + MemInfo vmStats = {0}; +#endif + Debug("Entered guest info gather.\n"); memset(&nicInfo, 0, sizeof nicInfo); @@ -432,7 +435,7 @@ GuestInfoGather(void *clientData) // IN: unused Debug("Failed to update VMDB\n"); } } - + if (!gDisableQueryDiskInfo) { if (!GuestInfoGetDiskInfo(&diskInfo)) { Debug("Failed to get disk info.\n"); @@ -470,6 +473,19 @@ GuestInfoGather(void *clientData) // IN: unused Debug("Failed to update VMDB with uptime.\n"); } +#if defined(_WIN32) || defined(linux) + /* Send the vmstats to the VMX. */ + + if (!GuestInfo_PerfMon(&vmStats)) { + Debug("Failed to get vmstats.\n"); + } else { + vmStats.version = 1; + if (!GuestInfoUpdateVmdb(INFO_MEMORY, &vmStats)) { + Debug("Failed to send vmstats.\n"); + } + } +#endif + /* * Even if one of the updates was unsuccessfull, * we still add the next timer event. This way @@ -528,7 +544,7 @@ GuestInfoConvertNicInfoToNicInfoV1(NicInfo *info, // IN DblLnkLst_ForEach(nicEntryLink, &info->nicList) { uint32 ipIndex = 0; uint32 maxIPs; - VmIpAddressEntry *ipAddressList; + VmIpAddressEntry *ipAddressCur; DblLnkLst_Links *ipAddrLink; if (nicIndex >= maxNics) { @@ -557,16 +573,17 @@ GuestInfoConvertNicInfoToNicInfoV1(NicInfo *info, // IN break; } - ipAddressList = DblLnkLst_Container(nicEntryCur -> ipAddressList.next, + ipAddressCur = DblLnkLst_Container(ipAddrLink, VmIpAddressEntry, links); - if (NULL == ipAddressList) { + if (NULL == ipAddressCur) { return FALSE; } strcpy(infoV1->nicList[nicIndex].ipAddress[ipIndex], - ipAddressList->ipEntryProto.ipAddress); + ipAddressCur->ipEntryProto.ipAddress); ipIndex++; + infoV1->nicList[nicIndex].numIPs = ipIndex; } nicIndex++; @@ -680,28 +697,28 @@ GuestInfoUpdateVmdb(GuestInfoType infoType, // IN: guest information type * Could be that we are talking to the old protocol that NicInfo is * still fixed size. Another try to send the fixed sized Nic info. */ - char requestFixedSize[sizeof (NicInfoV1) + sizeof GUEST_INFO_COMMAND + - 2 + /* 2 bytes are for digits of infotype. */ - 3 * sizeof (char)]; /* 3 spaces */ + char request[sizeof (NicInfoV1) + sizeof GUEST_INFO_COMMAND + + 2 + /* 2 bytes are for digits of infotype. */ + 3 * sizeof (char)]; /* 3 spaces */ NicInfoV1 nicInfo; free(reply); reply = NULL; - Str_Sprintf(requestFixedSize, - sizeof requestFixedSize, + Str_Sprintf(request, + sizeof request, "%s %d ", GUEST_INFO_COMMAND, INFO_IPADDRESS); if (GuestInfoConvertNicInfoToNicInfoV1(info, &nicInfo)) { - memcpy(requestFixedSize + strlen(requestFixedSize), + memcpy(request + strlen(request), &nicInfo, sizeof(NicInfoV1)); Debug("GuestInfo: Sending nic info message.\n"); /* Send all the information in the message. */ - status = RpcOut_SendOneRaw(requestFixedSize, - sizeof requestFixedSize, + status = RpcOut_SendOneRaw(request, + sizeof request, &reply, &replyLen); @@ -744,6 +761,33 @@ GuestInfoUpdateVmdb(GuestInfoType infoType, // IN: guest information type } break; + case INFO_MEMORY: + { + char request[sizeof(MemInfo) + sizeof GUEST_INFO_COMMAND + + 2 + /* 2 bytes are for digits of infotype. */ + 3 * sizeof (char)]; /* 3 spaces */ + Bool status; + + Debug("GuestInfo: Sending MemInfo message.\n"); + Str_Sprintf(request, + sizeof request, + "%s %d ", + GUEST_INFO_COMMAND, + INFO_MEMORY); + memcpy(request + strlen(request), + info, sizeof(MemInfo)); + + /* Send all the information in the message. */ + status = RpcOut_SendOneRaw(request, sizeof(request), + NULL, NULL); + if (!status) { + Debug("Error sending MemInfo.\n"); + return FALSE; + } + Debug("MemInfo sent successfully.\n"); + break; + } + case INFO_DISK_FREE_SPACE: { /* @@ -898,7 +942,7 @@ SetGuestInfo(GuestInfoType key, // IN: the VMDB key to set /* *----------------------------------------------------------------------------- * - * NicInfo_FindMacAddress -- + * GuestInfoFindMacAddress -- * * Locates a MAC address in the NIC info structure. * @@ -913,7 +957,7 @@ SetGuestInfo(GuestInfoType key, // IN: the VMDB key to set */ NicEntry * -NicInfo_FindMacAddress(NicInfo *nicInfo, const char *macAddress) +GuestInfoFindMacAddress(NicInfo *nicInfo, const char *macAddress) { NicEntry *nicEntry; DblLnkLst_Links *sCurrent; @@ -980,11 +1024,10 @@ NicInfoChanged(NicInfo *nicInfo) // IN: currentMac = cachedNic->nicEntryProto.macAddress; /* Find the corresponding nic in the new nic info. */ - matchedNIC = NicInfo_FindMacAddress(nicInfo, currentMac); + matchedNIC = GuestInfoFindMacAddress(nicInfo, currentMac); if (NULL == matchedNIC) { /* This mac address has been deleted. */ - Debug("GuestInfo: mac address %s deleted\n", currentMac); return TRUE; } @@ -997,12 +1040,12 @@ NicInfoChanged(NicInfo *nicInfo) // IN: /* Which IP addresses have been modified for this NIC? */ DblLnkLst_ForEach(curCachedIpLink, &cachedNic->ipAddressList) { char *currentCachedIp; - VmIpAddressEntry *cachedIpAddress; + VmIpAddressEntry *cachedIpAddress; DblLnkLst_Links * matchedIpAddressLink; Bool foundIP = FALSE; - - cachedIpAddress = DblLnkLst_Container(curCachedIpLink, - VmIpAddressEntry, + + cachedIpAddress = DblLnkLst_Container(curCachedIpLink, + VmIpAddressEntry, links); if (cachedIpAddress) { @@ -1010,17 +1053,17 @@ NicInfoChanged(NicInfo *nicInfo) // IN: } else { break; } - + DblLnkLst_ForEach(matchedIpAddressLink, &matchedNIC->ipAddressList) { - VmIpAddressEntry *matchedIpAddressEntry = + VmIpAddressEntry *matchedIpAddressEntry = DblLnkLst_Container(matchedIpAddressLink, - VmIpAddressEntry, + VmIpAddressEntry, links); if (matchedIpAddressEntry) { - if (strncmp(matchedIpAddressEntry->ipEntryProto.ipAddress, - currentCachedIp, - IP_ADDR_SIZE) == 0) { + if (strncmp(matchedIpAddressEntry->ipEntryProto.ipAddress, + currentCachedIp, + IP_ADDR_SIZE_V2) == 0) { foundIP = TRUE; break; } @@ -1522,7 +1565,7 @@ GuestInfoServer_SendUptime(void) /* *---------------------------------------------------------------------- * - * NicInfo_AddNicEntry -- + * GuestInfoAddNicEntry -- * * Add a Nic entry into NicInfo. macAddress of the NicEntry is * initialized with the input parameter @@ -1537,11 +1580,11 @@ GuestInfoServer_SendUptime(void) */ NicEntry * -NicInfo_AddNicEntry(NicInfo *nicInfo, // IN/OUT - const char macAddress[MAC_ADDR_SIZE]) // IN +GuestInfoAddNicEntry(NicInfo *nicInfo, // IN/OUT + const char macAddress[MAC_ADDR_SIZE]) // IN { NicEntry *nicEntryCur = NULL; - + nicEntryCur = Util_SafeCalloc(1, sizeof(*nicEntryCur)); DblLnkLst_Init(&nicEntryCur->ipAddressList); DblLnkLst_Init(&nicEntryCur->links); @@ -1557,7 +1600,7 @@ NicInfo_AddNicEntry(NicInfo *nicInfo, // IN/OUT /* *---------------------------------------------------------------------- * - * NicEntry_AddIpAddress -- + * GuestInfoAddIpAddress -- * * Add an IP address entry into NicEntry * @@ -1571,17 +1614,18 @@ NicInfo_AddNicEntry(NicInfo *nicInfo, // IN/OUT *---------------------------------------------------------------------- */ -VmIpAddressEntry * -NicEntry_AddIpAddress(NicEntry *nicEntry, // IN/OUT +VmIpAddressEntry * +GuestInfoAddIpAddress(NicEntry *nicEntry, // IN/OUT const char *ipAddr, // IN const uint32 af_type) // IN { VmIpAddressEntry *ipAddressCur; - ipAddressCur = Util_SafeCalloc(1, sizeof *ipAddressCur); + ipAddressCur = Util_SafeCalloc(1, sizeof *ipAddressCur); DblLnkLst_Init(&ipAddressCur->links); DblLnkLst_LinkLast(&nicEntry->ipAddressList, &ipAddressCur->links); - memcpy(ipAddressCur->ipEntryProto.ipAddress, ipAddr, IP_ADDR_SIZE); + memcpy(ipAddressCur->ipEntryProto.ipAddress, ipAddr, IP_ADDR_SIZE_V2); + ipAddressCur->ipEntryProto.addressFamily = af_type; nicEntry->nicEntryProto.numIPs++; @@ -1589,6 +1633,50 @@ NicEntry_AddIpAddress(NicEntry *nicEntry, // IN/OUT } +/* + *---------------------------------------------------------------------- + * + * GuestInfoAddSubnetMask -- + * + * Add an IPV4 subnet mask to the IpAddressEntry in ASCII form + * + * Results: + * The 'n' bits subnet mask is converted to an ASCII string as a + * hexadecimal number (0xffffff00) and added to the IPAddressEntry + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +GuestInfoAddSubnetMask(VmIpAddressEntry *ipAddressEntry, // IN/OUT + const uint32 subnetMaskBits) // IN +{ + int i; + uint32 subnetMask = 0; + + ASSERT(ipAddressEntry); + ASSERT(subnetMaskBits <= 32); + + /* + * Convert the subnet mask from a number of bits (ie. '24') to + * hexadecimal notation such 0xffffff00 + */ + for (i = 0; i < subnetMaskBits; i++) { + subnetMask |= (0x80000000 >> i); + } + + // Convert the hexadecimal value to a string and add to the IpAddress Entry + Str_Sprintf(ipAddressEntry->ipEntryProto.subnetMask, + sizeof ipAddressEntry->ipEntryProto.subnetMask, + "0x%x", subnetMask); + + return; +} + + #if defined(N_PLAT_NLM) /* *---------------------------------------------------------------------------- diff --git a/open-vm-tools/lib/hgfs/Makefile.in b/open-vm-tools/lib/hgfs/Makefile.in index 86871b7d8..3b06f6d36 100644 --- a/open-vm-tools/lib/hgfs/Makefile.in +++ b/open-vm-tools/lib/hgfs/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -108,7 +108,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -120,7 +119,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -145,7 +144,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -154,6 +152,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -161,7 +161,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -309,8 +309,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -322,8 +322,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -333,12 +333,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/hgfs/cpName.c b/open-vm-tools/lib/hgfs/cpName.c index 46c250cc4..eea225374 100644 --- a/open-vm-tools/lib/hgfs/cpName.c +++ b/open-vm-tools/lib/hgfs/cpName.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/cpNameLinux.c b/open-vm-tools/lib/hgfs/cpNameLinux.c index 8216a70f5..4e72e4a2e 100644 --- a/open-vm-tools/lib/hgfs/cpNameLinux.c +++ b/open-vm-tools/lib/hgfs/cpNameLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/cpNameLite.c b/open-vm-tools/lib/hgfs/cpNameLite.c index e4f4acf12..84e0c8b06 100644 --- a/open-vm-tools/lib/hgfs/cpNameLite.c +++ b/open-vm-tools/lib/hgfs/cpNameLite.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/cpNameUtil.c b/open-vm-tools/lib/hgfs/cpNameUtil.c index 647092f4a..e0a54e7a2 100644 --- a/open-vm-tools/lib/hgfs/cpNameUtil.c +++ b/open-vm-tools/lib/hgfs/cpNameUtil.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/cpNameUtilInt.h b/open-vm-tools/lib/hgfs/cpNameUtilInt.h index a404f5602..1fbde2e97 100644 --- a/open-vm-tools/lib/hgfs/cpNameUtilInt.h +++ b/open-vm-tools/lib/hgfs/cpNameUtilInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/cpNameUtilLinux.c b/open-vm-tools/lib/hgfs/cpNameUtilLinux.c index 463862cae..4312ea643 100644 --- a/open-vm-tools/lib/hgfs/cpNameUtilLinux.c +++ b/open-vm-tools/lib/hgfs/cpNameUtilLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/hgfsUtil.c b/open-vm-tools/lib/hgfs/hgfsUtil.c index 5d0450860..d2c740bb2 100644 --- a/open-vm-tools/lib/hgfs/hgfsUtil.c +++ b/open-vm-tools/lib/hgfs/hgfsUtil.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfs/staticEscape.c b/open-vm-tools/lib/hgfs/staticEscape.c index f53912929..e53227889 100644 --- a/open-vm-tools/lib/hgfs/staticEscape.c +++ b/open-vm-tools/lib/hgfs/staticEscape.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfsBd/Makefile.in b/open-vm-tools/lib/hgfsBd/Makefile.in index b5b274de5..71b6cd409 100644 --- a/open-vm-tools/lib/hgfsBd/Makefile.in +++ b/open-vm-tools/lib/hgfsBd/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/hgfsBd/hgfsBd.c b/open-vm-tools/lib/hgfsBd/hgfsBd.c index 20bfbdbd3..0691f3d11 100644 --- a/open-vm-tools/lib/hgfsBd/hgfsBd.c +++ b/open-vm-tools/lib/hgfsBd/hgfsBd.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfsServer/Makefile.in b/open-vm-tools/lib/hgfsServer/Makefile.in index cf92ef5dc..2c9f3836d 100644 --- a/open-vm-tools/lib/hgfsServer/Makefile.in +++ b/open-vm-tools/lib/hgfsServer/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -301,8 +301,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -314,8 +314,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -325,12 +325,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 5d3b006a5..1f8f6b6bd 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -304,7 +304,7 @@ HgfsHandle2AppendFlag(HgfsHandle handle, // IN: Hgfs file handle goto exit; } - *appendFlag = fileNode->appendFlag; + *appendFlag = fileNode->flags & FILE_NODE_APPEND_FL; found = TRUE; exit: @@ -653,11 +653,9 @@ HgfsGetNodeCopy(HgfsHandle handle, // IN: Hgfs file handle copy->fileDesc = original->fileDesc; copy->mode = original->mode; copy->shareAccess = original->shareAccess; - copy->appendFlag = original->appendFlag; + copy->flags = original->flags; copy->state = original->state; - copy->sequentialOpen = original->sequentialOpen; copy->handle = original->handle; - copy->sharedFolderOpen = original->sharedFolderOpen; found = TRUE; exit: @@ -698,7 +696,7 @@ HgfsHandleIsSequentialOpen(HgfsHandle handle, // IN: Hgfs file handle goto exit; } - *sequentialOpen = node->sequentialOpen; + *sequentialOpen = node->flags & FILE_NODE_SEQUENTIAL_FL; success = TRUE; exit: @@ -739,7 +737,7 @@ HgfsHandleIsSharedFolderOpen(HgfsHandle handle, // IN: Hgfs file handle goto exit; } - *sharedFolderOpen = node->sharedFolderOpen; + *sharedFolderOpen = node->flags & FILE_NODE_SHARED_FOLDER_OPEN_FL; success = TRUE; exit: @@ -861,7 +859,9 @@ HgfsUpdateNodeAppendFlag(HgfsHandle handle, // IN: Hgfs file handle goto exit; } - node->appendFlag = appendFlag; + if (appendFlag) { + node->flags |= FILE_NODE_APPEND_FL; + } updated = TRUE; exit: @@ -1199,16 +1199,23 @@ HgfsAddNewFileNode(HgfsFileOpenInfo *openInfo, // IN: open info struct newNode->utf8Name[newNode->utf8NameLen] = '\0'; newNode->handle = hgfsHandleCounter++; - newNode->sequentialOpen = - HGFS_OPEN_MODE_FLAGS(openInfo->mode) & HGFS_OPEN_SEQUENTIAL; newNode->localId = *localId; newNode->fileDesc = fileDesc; newNode->shareAccess = (openInfo->mask & HGFS_OPEN_VALID_SHARE_ACCESS) ? openInfo->shareAccess : HGFS_DEFAULT_SHARE_ACCESS; - newNode->appendFlag = append; + newNode->flags = 0; + if (append) { + newNode->flags |= FILE_NODE_APPEND_FL; + } + if (sharedFolderOpen) { + newNode->flags |= FILE_NODE_SHARED_FOLDER_OPEN_FL; + } + if (HGFS_OPEN_MODE_FLAGS(openInfo->mode) & HGFS_OPEN_SEQUENTIAL) { + newNode->flags |= FILE_NODE_SEQUENTIAL_FL; + } + newNode->serverLock = openInfo->acquiredLock; newNode->state = FILENODE_STATE_IN_USE_NOT_CACHED; - newNode->sharedFolderOpen = sharedFolderOpen; LOG(4, ("HgfsAddNewFileNode: got new node, handle %u\n", HgfsFileNode2Handle(newNode))); @@ -2071,20 +2078,39 @@ static struct { { HgfsServerDeleteDir, sizeof (HgfsRequestDelete) }, { HgfsServerRename, sizeof (HgfsRequestRename) }, { HgfsServerQueryVolume, sizeof (HgfsRequestQueryVolume) }, + { HgfsServerOpen, sizeof (HgfsRequestOpenV2) }, { HgfsServerGetattr, sizeof (HgfsRequestGetattrV2) }, - { HgfsServerSetattr, sizeof (HgfsRequestSetattrV2), }, - { HgfsServerSearchRead, sizeof (HgfsRequestSearchReadV2), }, - { HgfsServerSymlinkCreate, sizeof (HgfsRequestSymlinkCreate), }, - { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange), }, - { HgfsServerCreateDir, sizeof (HgfsRequestCreateDirV2), }, - { HgfsServerDeleteFile, sizeof (HgfsRequestDeleteV2) }, - { HgfsServerDeleteDir, sizeof (HgfsRequestDeleteV2) }, - { HgfsServerRename, sizeof (HgfsRequestRenameV2) }, + { HgfsServerSetattr, sizeof (HgfsRequestSetattrV2) }, + { HgfsServerSearchRead, sizeof (HgfsRequestSearchReadV2) }, + { HgfsServerSymlinkCreate, sizeof (HgfsRequestSymlinkCreate) }, + { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange) }, + { HgfsServerCreateDir, sizeof (HgfsRequestCreateDirV2) }, + { HgfsServerDeleteFile, sizeof (HgfsRequestDeleteV2) }, + { HgfsServerDeleteDir, sizeof (HgfsRequestDeleteV2) }, + { HgfsServerRename, sizeof (HgfsRequestRenameV2) }, + + { HgfsServerOpen, (sizeof (HgfsRequestOpenV3) + sizeof (HgfsRequest)) }, + { HgfsServerRead, (sizeof (HgfsRequestReadV3) + sizeof (HgfsRequest)) }, + { HgfsServerWrite, (sizeof (HgfsRequestWriteV3) + sizeof (HgfsRequest)) }, + { HgfsServerClose, (sizeof (HgfsRequestCloseV3) + sizeof (HgfsRequest)) }, + { HgfsServerSearchOpen, (sizeof (HgfsRequestSearchOpenV3) + sizeof (HgfsRequest)) }, + { HgfsServerSearchRead, (sizeof (HgfsRequestSearchReadV3) + sizeof (HgfsRequest)) }, + { HgfsServerSearchClose, (sizeof (HgfsRequestSearchCloseV3) + sizeof (HgfsRequest)) }, + { HgfsServerGetattr, (sizeof (HgfsRequestGetattrV3) + sizeof (HgfsRequest)) }, + { HgfsServerSetattr, (sizeof (HgfsRequestSetattrV3) + sizeof (HgfsRequest)) }, + { HgfsServerCreateDir, (sizeof (HgfsRequestCreateDirV3) + sizeof (HgfsRequest)) }, + { HgfsServerDeleteFile, (sizeof (HgfsRequestDeleteV3) + sizeof (HgfsRequest)) }, + { HgfsServerDeleteDir, (sizeof (HgfsRequestDeleteV3) + sizeof (HgfsRequest)) }, + { HgfsServerRename, (sizeof (HgfsRequestRenameV3) + sizeof (HgfsRequest)) }, + { HgfsServerQueryVolume, (sizeof (HgfsRequestQueryVolumeV3) + sizeof (HgfsRequest)) }, + { HgfsServerSymlinkCreate, (sizeof (HgfsRequestSymlinkCreateV3) + sizeof (HgfsRequest)) }, + { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange) }, }; + /* *----------------------------------------------------------------------------- * @@ -2376,16 +2402,18 @@ HgfsServerStatFs(const char *pathName, // IN: Path we're interested in */ HgfsNameStatus -HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check - size_t cpNameSize, // IN: Size of name cpName - HgfsOpenMode mode, // IN: Requested access mode - char **bufOut, // OUT: File name in local fs - size_t *outLen) // OUT: Length of name out +HgfsServerGetAccess(char *cpName, // IN: Cross-platform filename to check + size_t cpNameSize, // IN: Size of name cpName + HgfsOpenMode mode, // IN: Requested access mode + uint32 caseFlags, // IN: Case-sensitivity flags + char **bufOut, // OUT: File name in local fs + size_t *outLen, // OUT: Length of name out + HgfsSharedFolder **hgfsShare) // OUT: Share { HgfsNameStatus nameStatus; char const *sharePath; char const *inEnd; - char const *next; + char *next; char *myBufOut; char *myBufOutCurrent; char *out; @@ -2400,6 +2428,7 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check size_t ansiLen; Bool result; char *savedPathSepPos; + HgfsSharedFolder *share; uint32 startIndex = 0; ASSERT(cpName); @@ -2412,7 +2441,7 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check * function so we'll have more control over the illegal characters, which, * for the share name, should be none. */ - len = CPName_GetComponentGeneric(cpName, inEnd, "", &next); + len = CPName_GetComponentGeneric(cpName, inEnd, "", (char const **) &next); if (len < 0) { LOG(4, ("HgfsServerGetAccess: get first component failed\n")); return HGFS_NAME_STATUS_FAILURE; @@ -2441,7 +2470,8 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check ansiLen, mode, &sharePathLen, - &sharePath); + &sharePath, + &share); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerGetAccess: No such share (%s) or access denied\n", ansiName)); @@ -2481,7 +2511,7 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check */ tempSize = sizeof tempBuf; tempPtr = tempBuf; - nameStatus = CPName_ConvertFromRoot(&cpName, + nameStatus = CPName_ConvertFromRoot((char const **) &cpName, &cpNameSize, &tempSize, &tempPtr); @@ -2536,7 +2566,7 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check tempSize = sizeof tempBuf; tempPtr = tempBuf; - if (CPName_ConvertFrom(&cpName, + if (CPName_ConvertFrom((char const **) &cpName, &cpNameSize, &tempSize, &tempPtr) < 0) { @@ -2569,6 +2599,10 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check out += pathNameLen; *out = 0; + /* Convert file name to proper case as per the policy. */ + LOG(4, ("HgfsServerGetAccess: %u\n", caseFlags)); + HgfsServerConvertCase(share, caseFlags, myBufOut); + /* * Verify that our path has no symlinks. We will only check up to the * parent, because some ops that call us expect to operate on a symlink @@ -2660,6 +2694,9 @@ HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check LOG(4, ("HgfsServerGetAccess: name is \"%s\"\n", myBufOut)); + if (hgfsShare) { + *hgfsShare = share; + } *bufOut = myBufOut; return HGFS_NAME_STATUS_COMPLETE; @@ -3326,8 +3363,56 @@ HgfsUnpackOpenRequest(char const *packetIn, // IN: request packet request = (HgfsRequest *)packetIn; openInfo->requestType = request->op; + openInfo->caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (openInfo->requestType) { + case HGFS_OP_OPEN_V3: + { + HgfsRequestOpenV3 *requestV3 = + (HgfsRequestOpenV3 *)(packetIn + sizeof *request); + LOG(4, ("HgfsUnpackOpenRequest: HGFS_OP_OPEN_V3\n")); + + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *requestV3 + sizeof *request); + extra = packetSize - sizeof *requestV3 - sizeof *request; + + if (!(requestV3->mask & HGFS_OPEN_VALID_FILE_NAME)) { + /* We do not support open requests without a valid file name. */ + return FALSE; + } + + /* + * requestV3->fileName.length is user-provided, so this test must be + * carefully written to prevent wraparounds. + */ + if (requestV3->fileName.length > extra) { + /* The input packet is smaller than the request. */ + return FALSE; + } + + /* + * Copy all the fields into our carrier struct. Some will probably be + * garbage, but it's simpler to copy everything now and check the + * valid bits before reading later. + */ + openInfo->mask = requestV3->mask; + openInfo->mode = requestV3->mode; + openInfo->cpName = requestV3->fileName.name; + openInfo->cpNameSize = requestV3->fileName.length; + openInfo->caseFlags = requestV3->fileName.flags; + openInfo->flags = requestV3->flags; + openInfo->specialPerms = requestV3->specialPerms; + openInfo->ownerPerms = requestV3->ownerPerms; + openInfo->groupPerms = requestV3->groupPerms; + openInfo->otherPerms = requestV3->otherPerms; + openInfo->attr = requestV3->attr; + openInfo->allocationSize = requestV3->allocationSize; + openInfo->desiredAccess = requestV3->desiredAccess; + openInfo->shareAccess = requestV3->shareAccess; + openInfo->desiredLock = requestV3->desiredLock; + break; + } case HGFS_OP_OPEN_V2: { HgfsRequestOpenV2 *requestV2 = @@ -3436,17 +3521,18 @@ HgfsPackOpenReply(HgfsFileOpenInfo *openInfo, // IN: open info struct ASSERT(packetSize); ASSERT(openInfo); - if (openInfo->requestType == HGFS_OP_OPEN_V2) { + if (openInfo->requestType == HGFS_OP_OPEN) { + HgfsReplyOpen *reply = (HgfsReplyOpen *)packetOut; + reply->file = openInfo->file; + *packetSize = sizeof *reply; + } else { + /* Identical reply packet for V2 and V3. */ HgfsReplyOpenV2 *reply = (HgfsReplyOpenV2 *)packetOut; reply->file = openInfo->file; if (openInfo->mask & HGFS_OPEN_VALID_SERVER_LOCK) { reply->acquiredLock = openInfo->acquiredLock; } *packetSize = sizeof *reply; - } else { - HgfsReplyOpen *reply = (HgfsReplyOpen *)packetOut; - reply->file = openInfo->file; - *packetSize = sizeof *reply; } return TRUE; @@ -3483,10 +3569,9 @@ HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints - HgfsHandle *file) // OUT: file handle + HgfsHandle *file, // OUT: file handle + uint32 *caseFlags) // OUT: case-sensitivity flags { - HgfsRequestDelete *requestV1; - HgfsRequestDeleteV2 *requestV2; HgfsRequest *request; size_t extra; @@ -3495,12 +3580,53 @@ HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet ASSERT(cpNameSize); ASSERT(file); ASSERT(hints); + ASSERT(caseFlags); request = (HgfsRequest *)packetIn; + *caseFlags = HGFS_FILE_NAME_CASE_SENSITIVE; switch (request->op) { + case HGFS_OP_DELETE_FILE_V3: + case HGFS_OP_DELETE_DIR_V3: { + HgfsRequestDeleteV3 *requestV3; + + requestV3 = (HgfsRequestDeleteV3 *)(packetIn + sizeof *request); + LOG(4, ("HgfsUnpackDeleteRequest: HGFS_OP_DELETE_DIR_V3\n")); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *requestV3 + sizeof *request); + + *file = HGFS_INVALID_HANDLE; + *hints = requestV3->hints; + + /* + * If we've been asked to reuse a handle, we don't need to look at, let + * alone test the filename or its length. + */ + if (*hints & HGFS_DELETE_HINT_USE_FILE_DESC) { + *file = requestV3->file; + *cpName = NULL; + *cpNameSize = 0; + } else { + extra = packetSize - sizeof *requestV3 - sizeof *request; + + /* + * request->fileName.length is user-provided, so this test must be + * carefully written to prevent wraparounds. + */ + if (requestV3->fileName.length > extra) { + /* The input packet is smaller than the request */ + return FALSE; + } + *cpName = requestV3->fileName.name; + *cpNameSize = requestV3->fileName.length; + *caseFlags = requestV3->fileName.flags; + } + break; + } case HGFS_OP_DELETE_FILE_V2: - case HGFS_OP_DELETE_DIR_V2: + case HGFS_OP_DELETE_DIR_V2: { + HgfsRequestDeleteV2 *requestV2; requestV2 = (HgfsRequestDeleteV2 *)packetIn; /* Enforced by the dispatch function. */ @@ -3532,9 +3658,11 @@ HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet *cpNameSize = requestV2->fileName.length; } break; - + } case HGFS_OP_DELETE_FILE: - case HGFS_OP_DELETE_DIR: + case HGFS_OP_DELETE_DIR: { + HgfsRequestDelete *requestV1; + requestV1 = (HgfsRequestDelete *)packetIn; /* Enforced by the dispatch function. */ @@ -3553,7 +3681,7 @@ HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet *cpName = requestV1->fileName.name; *cpNameSize = requestV1->fileName.length; break; - + } default: return FALSE; break; @@ -3628,10 +3756,13 @@ HgfsUnpackRenameRequest(char const *packetIn, // IN: request packet uint32 *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle - HgfsHandle *targetFile) // OUT: target file handle + HgfsHandle *targetFile, // OUT: target file handle + uint32 *oldCaseFlags, // OUT: source case-sensitivity flags + uint32 *newCaseFlags) // OUT: dest. case-sensitivity flags { HgfsRequestRename *requestV1; HgfsRequestRenameV2 *requestV2; + HgfsRequestRenameV3 *requestV3; HgfsRequest *request; HgfsFileName *newName; size_t extra; @@ -3644,6 +3775,8 @@ HgfsUnpackRenameRequest(char const *packetIn, // IN: request packet ASSERT(srcFile); ASSERT(targetFile); ASSERT(hints); + ASSERT(oldCaseFlags); + ASSERT(newCaseFlags); request = (HgfsRequest *)packetIn; @@ -3660,6 +3793,64 @@ HgfsUnpackRenameRequest(char const *packetIn, // IN: request packet */ switch (request->op) { + case HGFS_OP_RENAME_V3: + requestV3 = (HgfsRequestRenameV3 *)packetIn; + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *requestV3); + extra = packetSize - sizeof *requestV3; + + *hints = requestV3->hints; + + /* + * If we've been asked to reuse a handle, we don't need to look at, let + * alone test the filename or its length. This applies to the source + * and the target. + */ + if (*hints & HGFS_RENAME_HINT_USE_SRCFILE_DESC) { + *srcFile = requestV3->srcFile; + *cpOldName = NULL; + *cpOldNameLen = 0; + *oldCaseFlags = 0; + } else { + + /* + * request->fileName.length is user-provided, so this test must be + * carefully written to prevent wraparounds. + */ + if (requestV3->oldName.length > extra) { + /* The input packet is smaller than the request */ + return FALSE; + } + + /* It is now safe to use the old file name. */ + *cpOldName = requestV3->oldName.name; + *cpOldNameLen = requestV3->oldName.length; + *oldCaseFlags = requestV3->oldName.flags; + } + extra -= *cpOldNameLen; + + if (*hints & HGFS_RENAME_HINT_USE_TARGETFILE_DESC) { + *targetFile = requestV3->targetFile; + *cpNewName = NULL; + *cpNewNameLen = 0; + *newCaseFlags = 0; + } else { + + newName = (HgfsFileName *)((char *)(&requestV3->oldName + 1) + + *cpOldNameLen); + if (newName->length > extra) { + /* The input packet is smaller than the request */ + return FALSE; + } + + /* It is now safe to use the new file name. */ + *cpNewName = newName->name; + *cpNewNameLen = newName->length; + *newCaseFlags = requestV3->newName.flags; + } + break; + case HGFS_OP_RENAME_V2: requestV2 = (HgfsRequestRenameV2 *)packetIn; @@ -3827,10 +4018,12 @@ HgfsUnpackGetattrRequest(char const *packetIn, // IN: request packet HgfsAttrHint *hints, // OUT: getattr hints char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file) // OUT: file handle + HgfsHandle *file, // OUT: file handle + uint32 *caseFlags) // OUT: case-sensitivity flags { HgfsRequestGetattr *requestV1; HgfsRequestGetattrV2 *requestV2; + HgfsRequestGetattrV3 *requestV3; HgfsRequest *request; size_t extra; @@ -3839,11 +4032,47 @@ HgfsUnpackGetattrRequest(char const *packetIn, // IN: request packet ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); + ASSERT(caseFlags); request = (HgfsRequest *)packetIn; attrInfo->requestType = request->op; + *caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (request->op) { + case HGFS_OP_GETATTR_V3: + requestV3 = (HgfsRequestGetattrV3 *)(packetIn + sizeof(struct HgfsRequest)); + LOG(4, ("HgfsUnpackGetattrRequest: HGFS_OP_GETATTR_V3\n")); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *requestV3 + sizeof(struct HgfsRequest)); + + /* + * If we've been asked to reuse a handle, we don't need to look at, let + * alone test the filename or its length. + */ + *hints = requestV3->hints; + if (*hints & HGFS_ATTR_HINT_USE_FILE_DESC) { + *file = requestV3->file; + *cpName = NULL; + *cpNameSize = 0; + } else { + extra = packetSize - sizeof *requestV3 - sizeof(struct HgfsRequest); + + /* + * request->fileName.length is user-provided, so this test must be + * carefully written to prevent wraparounds. + */ + if (requestV3->fileName.length > extra) { + /* The input packet is smaller than the request */ + return FALSE; + } + *cpName = requestV3->fileName.name; + *cpNameSize = requestV3->fileName.length; + *caseFlags = requestV3->fileName.flags; + LOG(4, ("HgfsUnpackGetattrRequest: HGFS_OP_GETATTR_V3: %u\n", *caseFlags)); + } + break; + case HGFS_OP_GETATTR_V2: requestV2 = (HgfsRequestGetattrV2 *)packetIn; @@ -3951,7 +4180,51 @@ HgfsPackGetattrReply(HgfsFileAttrInfo *attr, // IN: attr stucture ASSERT(packetSize); ASSERT(attr); - if (attr->requestType == HGFS_OP_GETATTR_V2) { + if (attr->requestType == HGFS_OP_GETATTR_V3) { + HgfsReplyGetattrV3 *reply = (HgfsReplyGetattrV3 *)(packetOut + + sizeof(struct HgfsRequest)); + reply->attr.mask = attr->mask; + reply->attr.type = attr->type; + + /* + * Is there enough space in the request packet for the utf8 name? + * Our goal is to write the entire name, with nul terminator, into + * the buffer, but set the length to not include the nul termination. + * This is what clients expect. + * + * Also keep in mind that sizeof *reply already contains one character, + * which we'll consider the nul terminator. + */ + if (utf8TargetNameLen > HGFS_PACKET_MAX - sizeof *reply - sizeof(struct HgfsReply)) { + return FALSE; + } + if (utf8TargetName) { + memcpy(reply->symlinkTarget.name, utf8TargetName, utf8TargetNameLen); + CPNameLite_ConvertTo(reply->symlinkTarget.name, utf8TargetNameLen, + DIRSEPC); + } else { + ASSERT(utf8TargetNameLen == 0); + } + reply->symlinkTarget.length = utf8TargetNameLen; + reply->symlinkTarget.name[utf8TargetNameLen] = '\0'; + reply->symlinkTarget.flags = HGFS_FILE_NAME_DEFAULT_CASE; + + reply->attr.size = attr->size; + reply->attr.creationTime = attr->creationTime; + reply->attr.accessTime = attr->accessTime; + reply->attr.writeTime = attr->writeTime; + reply->attr.attrChangeTime = attr->attrChangeTime; + reply->attr.specialPerms = attr->specialPerms; + reply->attr.ownerPerms = attr->ownerPerms; + reply->attr.groupPerms = attr->groupPerms; + reply->attr.otherPerms = attr->otherPerms; + reply->attr.flags = attr->flags; + reply->attr.allocationSize = attr->allocationSize; + reply->attr.userId = attr->userId; + reply->attr.groupId = attr->groupId; + reply->attr.hostFileId = attr->hostFileId; + *packetSize = sizeof *reply + utf8TargetNameLen + sizeof(struct HgfsReply); + } else if (attr->requestType == HGFS_OP_GETATTR_V2) { HgfsReplyGetattrV2 *reply = (HgfsReplyGetattrV2 *)packetOut; reply->attr.mask = attr->mask; reply->attr.type = attr->type; @@ -4053,6 +4326,7 @@ HgfsUnpackSearchReadRequest(const char *packetIn, // IN: request packet ASSERT(hgfsSearchHandle); ASSERT(offset); + /* XXX: Changes required for VMCI. */ request = (HgfsRequestSearchRead *)packetIn; /* Enforced by the dispatch function. */ @@ -4064,6 +4338,10 @@ HgfsUnpackSearchReadRequest(const char *packetIn, // IN: request packet /* Initialize the rest of the fields. */ attr->requestType = request->header.op; + if (request->header.op == HGFS_OP_SEARCH_READ_V3) { + LOG(4, ("HgfsUnpackSearchReadRequest: HGFS_OP_SEARCH_READ_V3\n")); + } + attr->mask = HGFS_ATTR_VALID_NONE; attr->type = 0; attr->size = 0; @@ -4109,7 +4387,57 @@ HgfsPackSearchReadReply(const char *utf8Name, // IN: file name char *packetOut, // IN/OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { + if (attr->requestType == HGFS_OP_SEARCH_READ_V3) { + HgfsReplySearchReadV3 *reply = (HgfsReplySearchReadV3 *)packetOut + + sizeof(struct HgfsRequest); + HgfsDirEntry *dirent = (HgfsDirEntry *)reply->payload; + + /* + * Is there enough space in the request packet for the utf8 name? + * Our goal is to write the entire name, with nul terminator, into + * the buffer, but set the length to not include the nul termination. + * This is what clients expect. + * + * Also keep in mind that sizeof *reply already contains one character, + * which we'll consider the nul terminator. + */ + if (utf8NameLen > HGFS_PACKET_MAX - sizeof *reply - sizeof(struct HgfsReply) + - sizeof(struct HgfsDirEntry)) { + return FALSE; + } + + *packetSize = sizeof *reply + utf8NameLen + sizeof(struct HgfsReply) + + sizeof(struct HgfsDirEntry); + reply->count = 1; + dirent->fileName.length = (uint32)utf8NameLen; + dirent->fileName.flags = HGFS_FILE_NAME_DEFAULT_CASE; + dirent->nextEntry = 0; + + if (utf8NameLen == 0) { + /* No entry. */ + return TRUE; + } + + memcpy(dirent->fileName.name, utf8Name, utf8NameLen); + dirent->fileName.name[utf8NameLen] = 0; + + dirent->attr.mask = attr->mask; + dirent->attr.type = attr->type; + dirent->attr.size = attr->size; + dirent->attr.creationTime = attr->creationTime; + dirent->attr.accessTime = attr->accessTime; + dirent->attr.writeTime = attr->writeTime; + dirent->attr.attrChangeTime = attr->attrChangeTime; + dirent->attr.specialPerms = attr->specialPerms; + dirent->attr.ownerPerms = attr->ownerPerms; + dirent->attr.groupPerms = attr->groupPerms; + dirent->attr.otherPerms = attr->otherPerms; + dirent->attr.flags = attr->flags; + dirent->attr.allocationSize = attr->allocationSize; + dirent->attr.userId = attr->userId; + dirent->attr.groupId = attr->groupId; + dirent->attr.hostFileId = attr->hostFileId; + } else if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { HgfsReplySearchReadV2 *reply = (HgfsReplySearchReadV2 *)packetOut; /* @@ -4152,6 +4480,7 @@ HgfsPackSearchReadReply(const char *utf8Name, // IN: file name reply->attr.userId = attr->userId; reply->attr.groupId = attr->groupId; reply->attr.hostFileId = attr->hostFileId; + } else { HgfsReplySearchRead *reply = (HgfsReplySearchRead *)packetOut; @@ -4222,7 +4551,8 @@ HgfsUnpackSetattrRequest(char const *packetIn, // IN: request packet HgfsAttrHint *hints, // OUT: setattr hints char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file) // OUT: server file ID + HgfsHandle *file, // OUT: server file ID + uint32 *caseFlags) // OUT: case-sensitivity flags { HgfsRequest *request; size_t extra; @@ -4232,6 +4562,7 @@ HgfsUnpackSetattrRequest(char const *packetIn, // IN: request packet ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); + ASSERT(caseFlags); request = (HgfsRequest *)packetIn; @@ -4239,6 +4570,58 @@ HgfsUnpackSetattrRequest(char const *packetIn, // IN: request packet attr->requestType = request->op; switch (attr->requestType) { + case HGFS_OP_SETATTR_V3: + { + HgfsRequestSetattrV3 *requestV3 = + (HgfsRequestSetattrV3 *)(packetIn + sizeof(struct HgfsRequest)); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *requestV3 + sizeof(struct HgfsRequest)); + + attr->mask = requestV3->attr.mask; + attr->type = requestV3->attr.type; + attr->size = requestV3->attr.size; + attr->creationTime = requestV3->attr.creationTime; + attr->accessTime = requestV3->attr.accessTime; + attr->writeTime = requestV3->attr.writeTime; + attr->attrChangeTime = requestV3->attr.attrChangeTime; + attr->specialPerms = requestV3->attr.specialPerms; + attr->ownerPerms = requestV3->attr.ownerPerms; + attr->groupPerms = requestV3->attr.groupPerms; + attr->otherPerms = requestV3->attr.otherPerms; + attr->flags = requestV3->attr.flags; + attr->allocationSize = requestV3->attr.allocationSize; + attr->userId = requestV3->attr.userId; + attr->groupId = requestV3->attr.groupId; + attr->hostFileId = requestV3->attr.hostFileId; + + *hints = requestV3->hints; + + /* + * If we've been asked to reuse a handle, we don't need to look at, + * let alone test the filename or its length. + */ + if (*hints & HGFS_ATTR_HINT_USE_FILE_DESC) { + *file = requestV3->file; + *cpName = NULL; + *cpNameSize = 0; + *caseFlags = 0; + } else { + extra = packetSize - sizeof *requestV3 - sizeof(struct HgfsRequest); + + if (requestV3->fileName.length > extra) { + /* The input packet is smaller than the request. */ + return FALSE; + } + /* It is now safe to read the file name. */ + *cpName = requestV3->fileName.name; + *cpNameSize = requestV3->fileName.length; + *caseFlags = requestV3->fileName.flags; + } + LOG(4, ("HgfsUnpackSetattrRequest: unpacking HGFS_OP_SETATTR_V3, %u\n", *caseFlags)); + break; + } + case HGFS_OP_SETATTR_V2: { HgfsRequestSetattrV2 *requestV2 = @@ -4433,8 +4816,48 @@ HgfsUnpackCreateDirRequest(char const *packetIn, // IN: incoming packet request = (HgfsRequest *)packetIn; info->requestType = request->op; + info->caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (info->requestType) { + case HGFS_OP_CREATE_DIR_V3: + { + HgfsRequestCreateDirV3 *requestV3 = + (HgfsRequestCreateDirV3 *)(packetIn + sizeof *request); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *requestV3 + sizeof *request); + extra = packetSize - sizeof *requestV3 - sizeof *request; + + if (!(requestV3->mask & HGFS_CREATE_DIR_VALID_FILE_NAME)) { + /* We do not support requests without a valid file name. */ + return FALSE; + } + + /* + * requestV3->fileName.length is user-provided, so this test must be + * carefully written to prevent wraparounds. + */ + if (requestV3->fileName.length > extra) { + /* The input packet is smaller than the request. */ + return FALSE; + } + + /* + * Copy all the fields into our carrier struct. Some will probably be + * garbage, but it's simpler to copy everything now and check the + * valid bits before reading later. + */ + info->mask = requestV3->mask; + info->cpName = requestV3->fileName.name; + info->cpNameSize = requestV3->fileName.length; + info->caseFlags = requestV3->fileName.flags; + info->specialPerms = requestV3->specialPerms; + info->ownerPerms = requestV3->ownerPerms; + info->groupPerms = requestV3->groupPerms; + info->otherPerms = requestV3->otherPerms; + LOG(4, ("HgfsUnpackCreateDirRequest: HGFS_OP_CREATE_DIR_V3\n")); + break; + } case HGFS_OP_CREATE_DIR_V2: { HgfsRequestCreateDirV2 *requestV2 = diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c index df3d889de..23ba68baa 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,6 +37,13 @@ #include // for utimes(2) #include #include +#include +#include + +#ifndef __FreeBSD__ +# include +# include +#endif #include "vmware.h" #include "hgfsServerPolicy.h" // for security policy @@ -44,6 +51,7 @@ #include "str.h" #include "cpNameLite.h" #include "hgfsUtil.h" // for cross-platform time conversion +#include "posix.h" #include "file.h" #include "util.h" #include "syncMutex.h" @@ -253,7 +261,9 @@ static HgfsInternalStatus HgfsConvertFromNameStatus(HgfsNameStatus status); static HgfsInternalStatus HgfsGetattrResolveAlias(char const *fileName, char **targetName); -static HgfsInternalStatus HgfsGetattrFromName(char const *fileName, +static HgfsInternalStatus HgfsGetattrFromName(char *fileName, + HgfsSharedFolder *share, + uint32 caseFlags, HgfsFileAttrInfo *attr, char **targetName); @@ -263,6 +273,24 @@ static HgfsInternalStatus HgfsGetattrFromFd(int fd, static void HgfsStat(struct stat *stats, HgfsFileAttrInfo *attr); +static int HgfsStatFromName(char *fileName, + HgfsSharedFolder *share, + uint32 caseFlags, + struct stat *stats); + +#ifndef __FreeBSD__ +static int HgfsCaseInsensitiveLookup(char *fileName, + char *shareName); + +#if 0 +static int HgfsToUpper(char *src, + char *dst); +#endif + +static int HgfsToLower(char *src, + char *dst); +#endif + static Bool HgfsSetattrMode(struct stat *statBuf, HgfsFileAttrInfo *attr, mode_t *newPermissions); @@ -285,8 +313,8 @@ static HgfsInternalStatus HgfsSetattrFromFd(HgfsHandle file, static HgfsInternalStatus HgfsSetattrFromName(char *cpName, size_t cpNameSize, HgfsFileAttrInfo *attr, - HgfsAttrHint hints); - + HgfsAttrHint hints, + uint32 caseFlags); #ifdef HGFS_OPLOCKS /* @@ -774,7 +802,7 @@ HgfsGetFd(HgfsHandle hgfsHandle, // IN: HGFS file handle * in append mode. If not, close the file and reopen it in append * mode. */ - if (append && !node.appendFlag) { + if (append && !(node.flags & FILE_NODE_APPEND_FL)) { status = HgfsCloseFile(node.fileDesc); if (status != 0) { LOG(4, ("HgfsGetFd: Couldn't close file \"%s\" for reopening\n", @@ -1241,6 +1269,313 @@ HgfsGetHiddenAttr(char const *fileName, // IN: Input filename } +#ifndef __FreeBSD__ +/* + *----------------------------------------------------------------------------- + * + * HgfsToLower -- + * + * Convert string to lower-case independent of the locale. + * + * NOTE: fileName needs to be of size PATH_MAX. + * + * Results: + * 0 on Success, -1 otherwise. + * String str converted to lower-case and placed in dst. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +HgfsToLower(char *src, // IN: Input filename + char *dst) // OUT: converted filename +{ + char *end = src + strlen(src); + wchar_t wc; + mbstate_t mbs1, mbs2; + size_t ret; + + memset(&mbs1, 0, sizeof(mbstate_t)); + memset(&mbs2, 0, sizeof(mbstate_t)); + while (src < end) { + ret = mbrtowc(&wc, src, end - src, &mbs1); + if (ret == 0) { + *dst++ = '\0'; + src++; + continue; + } + if (ret == (size_t) -2) { + LOG(4, ("%s: mbrtowc failed: %d: %s\n", __FUNCTION__, (int)ret, strerror(errno))); + return -1; + } + if (ret == (size_t) -1) { + LOG(4, ("%s: mbrtowc failed: %d\n", __FUNCTION__, (int)ret)); + return -1; + } + src += ret; + wc = towlower(wc); + ret = wcrtomb(dst, wc, &mbs2); + dst += ret; + } + *dst++ = '\0'; + return 0; +} + +#if 0 + +/* + *----------------------------------------------------------------------------- + * + * HgfsToUpper -- + * + * Convert string to upper-case independent of the locale. + * + * NOTE: fileName needs to be of size PATH_MAX. + * + * Results: + * 0 on Success, -1 otherwise. + * String str converted to upper-case and placed in dst. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +HgfsToUpper(char *src, // IN: Input filename + char *dst) // OUT: converted filename +{ + char *end = src + strlen(src); + wchar_t wc; + mbstate_t mbs1, mbs2; + size_t ret; + + memset(&mbs1, 0, sizeof(mbstate_t)); + memset(&mbs2, 0, sizeof(mbstate_t)); + while (src < end) { + ret = mbrtowc(&wc, src, end - src, &mbs1); + if (ret == 0) { + *dst++ = '\0'; + src++; + continue; + } + if (ret == (size_t) -2) { + LOG(4, ("%s: mbrtowc failed: %d: %s\n", __FUNCTION__, ret, strerror(errno))); + return -1; + } + if (ret == (size_t) -1) { + LOG(4, ("%s: mbrtowc failed: %d\n", __FUNCTION__, ret)); + return -1; + } + src += ret; + wc = towupper(wc); + ret = wcrtomb(dst, wc, &mbs2); + dst += ret; + } + *dst++ = '\0'; + return 0; +} + +#endif + + +/* + *----------------------------------------------------------------------------- + * + * HgfsCaseInsensitiveLookup -- + * + * Do case insensitivie lookup for fileName. Each component past shareName is + * looked-up case-insensitively. Expensive! + * + * NOTE: fileName needs to be of size PATH_MAX. + * + * Results: + * Returns 0 if successful and resolved path for fileName is over-written. + * Otherwise returns non-zero errno without affecting fileName. + * + * Side effects: + * fileName over-written with resolved path when successful. + * + *----------------------------------------------------------------------------- + */ + +static int +HgfsCaseInsensitiveLookup(char *fileName, // IN / OUT + char *shareName) // IN +{ + char *fileSuffix = fileName + strlen(shareName) + 1; + char curDir[PATH_MAX]; + char convertedFileName[PATH_MAX]; + char convertedComponent[PATH_MAX]; + struct dirent *dirent; + DIR *dir; + char *ptr; + int error; + + strcpy(curDir, shareName); + +again: + dir = opendir(curDir); + if (!dir) { + return ENOENT; + } + + ptr = strchr(fileSuffix, DIRSEPC); + if (ptr) { + *ptr = '\0'; + } + + error = HgfsToLower(fileSuffix, convertedComponent); + if (error) { + if (ptr) { + *ptr = DIRSEPC; + } + closedir(dir); + return ENOENT; + } + + while ((dirent = readdir(dir))) { + error = HgfsToLower(dirent->d_name, convertedFileName); + if (error) { + continue; + } + if (!strcmp(convertedComponent, convertedFileName)) { + /* Match found. */ + strcat(curDir, "/"); + strcat(curDir, dirent->d_name); + fileSuffix = ptr + 1; + closedir(dir); + if (!ptr) { + strcpy(fileName, curDir); + return 0; + } + *ptr = DIRSEPC; + goto again; + } + } + + /* Match not found. */ + if (ptr) { + *ptr = DIRSEPC; + } + closedir(dir); + return ENOENT; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * HgfsServerConvertCase -- + * + * Converts the fileName to appropriate case depending upon flags. + * + * NOTE: fileName needs to be of size PATH_MAX. + * + * Results: + * Returns 0 if successful and converted path for fileName is over-written. + * Otherwise returns non-zero integer without affecting fileName. + * + * Side effects: + * fileName over-written with the converted path when successful. + * + *----------------------------------------------------------------------------- + */ + +int +HgfsServerConvertCase(HgfsSharedFolder *share, // IN + uint32 caseFlags, // IN + char *fileName) // IN / OUT +{ +#ifndef __FreeBSD__ + int error; + char *fileBaseName; + + ASSERT(fileName); + + LOG(4, ("%s: fileName: #%s# %u, %d\n", __FUNCTION__, fileName, caseFlags, (int)caseFlags)); + if (!share) { + return -1; + } + + /* fileBaseName is the relative path of the file. */ + fileBaseName = fileName + share->pathLen; + + if (caseFlags == HGFS_FILE_NAME_CASE_INSENSITIVE) { + LOG(4, ("%s: %u, %d\n", __FUNCTION__, caseFlags, (int)caseFlags)); + error = HgfsCaseInsensitiveLookup(fileName, share->path); + return error; + } +#endif + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsStatFromName -- + * + * lstat(2) for the file name taking the case-sensitivity options into account. + * + * NOTE: fileName needs to be of size PATH_MAX. + * + * Results: + * 0 when successful, non-zero otherwise. + * + * Side effects: + * Converts fileName to appropriate case. + * + *----------------------------------------------------------------------------- + */ + +static int +HgfsStatFromName(char *fileName, // IN: filename + HgfsSharedFolder *share, // IN: share + uint32 caseFlags, // IN: case-sensitivity flags + struct stat *stats) // OUT: file stats +{ + int error; + + /* Simple case - plain lookup. */ + errno = 0; + error = lstat(fileName, stats); + if (!error || errno != ENOENT) { + return errno; + } + + if (!share) { + return ENOENT; + } + + if (!strncmp(fileName, share->path, strlen(fileName))) { + return EACCES; + } + + if (Str_Strncmp(share->path, fileName, share->pathLen)) { + return ENOENT; + } + + LOG(4, ("%s: caseFlags: %u\n", __FUNCTION__, caseFlags)); + error = HgfsServerConvertCase(share, caseFlags, fileName); + if (error) { + return error; + } + + LOG(4, ("%s: stating %s\n", __FUNCTION__, fileName)); + error = lstat(fileName, stats); + if (error < 0) { + return errno; + } + return 0; +} + + /* *----------------------------------------------------------------------------- * @@ -1263,7 +1598,9 @@ HgfsGetHiddenAttr(char const *fileName, // IN: Input filename */ static HgfsInternalStatus -HgfsGetattrFromName(char const *fileName, // IN: Input filename +HgfsGetattrFromName(char *fileName, // IN / OUT: Input filename + HgfsSharedFolder *share, // IN: Share + uint32 caseFlags, // IN: case-sensitivity flags HgfsFileAttrInfo *attr, // OUT: Struct to copy into char **targetName) // OUT: Symlink target filename { @@ -1274,9 +1611,8 @@ HgfsGetattrFromName(char const *fileName, // IN: Input filename ASSERT(attr); LOG(4, ("HgfsGetattrFromName: getting attrs for \"%s\"\n", fileName)); - error = lstat(fileName, &stats); - if (error < 0) { - error = errno; + error = HgfsStatFromName(fileName, share, caseFlags, &stats); + if (error) { LOG(4, ("HgfsGetattrFromName: error stating file: %s\n", strerror(error))); status = error; @@ -1301,16 +1637,9 @@ HgfsGetattrFromName(char const *fileName, // IN: Input filename */ if (targetName != NULL) { char *myTargetName; - /* st_size does not include the nul. */ - myTargetName = malloc(stats.st_size + 1); - if (myTargetName == NULL) { - LOG(4, ("HgfsGetattrFromName: ran out of memory when allocating " - "space for symlink target name.\n")); - status = ENOMEM; - goto exit; - } - if (readlink(fileName, myTargetName, stats.st_size) != stats.st_size) { + myTargetName = Posix_ReadLink(fileName); + if (myTargetName == NULL) { error = errno; LOG(4, ("HgfsGetattrFromName: readlink returned wrong size\n")); free(myTargetName); @@ -1324,8 +1653,6 @@ HgfsGetattrFromName(char const *fileName, // IN: Input filename status = error ? error : ENOMEM; goto exit; } - /* readlink() does not nul terminate. */ - myTargetName[stats.st_size] = '\0'; *targetName = myTargetName; } } else { @@ -2038,7 +2365,8 @@ static HgfsInternalStatus HgfsSetattrFromName(char *cpName, // IN: Name size_t cpNameSize, // IN: Name length HgfsFileAttrInfo *attr, // IN: attrs to set - HgfsAttrHint hints) // IN: attr hints + HgfsAttrHint hints, // IN: attr hints + uint32 caseFlags) // IN: case-sensitivity flags { HgfsInternalStatus status = 0, timesStatus; HgfsNameStatus nameStatus; @@ -2057,7 +2385,9 @@ HgfsSetattrFromName(char *cpName, // IN: Name nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + caseFlags, &localName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsSetattrFromName: access check failed\n")); @@ -2390,7 +2720,9 @@ HgfsServerOpen(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(openInfo.cpName, openInfo.cpNameSize, openInfo.mode, + openInfo.caseFlags, &localName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerOpen: access check failed\n")); @@ -2751,41 +3083,70 @@ HgfsServerSearchOpen(char const *packetIn, // IN: incoming packet char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestSearchOpen *request; - HgfsReplySearchOpen *reply; + HgfsRequest *header; + HgfsHandle *replySearch; uint32 extra; size_t baseDirLen; char *baseDir; HgfsHandle handle; HgfsInternalStatus status; HgfsNameStatus nameStatus; + char *dirName; + uint32 dirNameLength; + uint32 caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; - request = (HgfsRequestSearchOpen *)packetIn; - ASSERT(request); - reply = (HgfsReplySearchOpen *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); - - /* Enforced by the dispatch function */ - ASSERT(*packetSize >= sizeof *request); - extra = *packetSize - sizeof *request; + header = (HgfsRequest *)packetIn; + + if (header->op == HGFS_OP_SEARCH_OPEN_V3) { + HgfsRequestSearchOpenV3 *requestV3; + + requestV3 = (HgfsRequestSearchOpenV3 *)(packetIn + sizeof *header); + /* Enforced by the dispatch function */ + ASSERT(*packetSize >= sizeof *requestV3 + sizeof *header); + extra = *packetSize - sizeof *requestV3 - sizeof *header; + + caseFlags = requestV3->dirName.flags; + dirName = requestV3->dirName.name; + dirNameLength = requestV3->dirName.length; + replySearch = &((HgfsReplySearchOpenV3 *)(packetOut + + sizeof(struct HgfsReply)))->search; + *packetSize = sizeof(struct HgfsReplySearchOpen) + sizeof(struct HgfsReply); + LOG(4, ("HgfsServerSearchOpen: HGFS_OP_SEARCH_OPEN_V3\n")); + } else { + HgfsRequestSearchOpen *request; + + request = (HgfsRequestSearchOpen *)packetIn; + /* Enforced by the dispatch function */ + ASSERT(*packetSize >= sizeof *request); + extra = *packetSize - sizeof *request; + + dirName = request->dirName.name; + dirNameLength = request->dirName.length; + replySearch = &((HgfsReplySearchOpen *)packetOut)->search; + *packetSize = sizeof(struct HgfsReplySearchOpen); + } /* * request->dirName.length is user-provided, so this test must be carefully * written to prevent wraparounds. */ - if (request->dirName.length > extra) { + if (dirNameLength > extra) { /* The input packet is smaller than the request */ status = EPROTO; goto exit; } /* It is now safe to read the dirName */ - nameStatus = HgfsServerGetAccess(request->dirName.name, - request->dirName.length, + nameStatus = HgfsServerGetAccess(dirName, + dirNameLength, HGFS_OPEN_MODE_READ_ONLY, + caseFlags, &baseDir, - &baseDirLen); + &baseDirLen, + NULL); switch (nameStatus) { case HGFS_NAME_STATUS_COMPLETE: ASSERT(baseDir); @@ -2833,8 +3194,7 @@ HgfsServerSearchOpen(char const *packetIn, // IN: incoming packet * Return handle to the search object as the reply to the search * open. */ - reply->search = handle; - *packetSize = sizeof *reply; + *replySearch = handle; exit: return status; } @@ -2869,6 +3229,7 @@ HgfsServerSearchRead(char const *packetIn, // IN: incoming packet HgfsHandle hgfsSearchHandle; DirectoryEntry *dent; HgfsSearch search; + HgfsSharedFolder *share; ASSERT(packetSize); @@ -2893,7 +3254,7 @@ HgfsServerSearchRead(char const *packetIn, // IN: incoming packet requestedOffset, FALSE)) != NULL) { unsigned int length; char *fullName; - char const *sharePath; + char *sharePath; size_t sharePathLen; size_t fullNameLen; @@ -2921,7 +3282,8 @@ HgfsServerSearchRead(char const *packetIn, // IN: incoming packet memcpy(&fullName[search.utf8DirLen + 1], dent->d_name, length + 1); LOG(4, ("HgfsServerSearchRead: about to stat \"%s\"\n", fullName)); - status = HgfsGetattrFromName(fullName, &attr, NULL); + status = HgfsGetattrFromName(fullName, NULL, HGFS_FILE_NAME_DEFAULT_CASE, + &attr, NULL); free(fullName); if (status != 0) { @@ -2951,14 +3313,16 @@ HgfsServerSearchRead(char const *packetIn, // IN: incoming packet length, HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, - &sharePath); + (char const **)&sharePath, + &share); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerSearchRead: No such share or access denied\n")); free(dent); free(search.utf8Dir); return HgfsConvertFromNameStatus(nameStatus); } - status = HgfsGetattrFromName(sharePath, &attr, NULL); + status = HgfsGetattrFromName(sharePath, share, HGFS_FILE_NAME_DEFAULT_CASE, + &attr, NULL); if (status != 0) { /* * The dent no longer exists. Remove it from the search and get @@ -3079,6 +3443,8 @@ HgfsServerGetattr(char const *packetIn, // IN: incoming packet char *targetName = NULL; uint32 targetNameLen; HgfsHandle file = HGFS_INVALID_HANDLE; /* file handle from driver */ + HgfsSharedFolder *share; + uint32 caseFlags = 0; ASSERT(packetSize); @@ -3088,7 +3454,8 @@ HgfsServerGetattr(char const *packetIn, // IN: incoming packet &hints, &cpName, &cpNameSize, - &file)) { + &file, + &caseFlags)) { status = EPROTO; goto exit; } @@ -3113,8 +3480,10 @@ HgfsServerGetattr(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_READ_ONLY, + caseFlags, &localName, - NULL); + NULL, + &share); switch (nameStatus) { case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* @@ -3129,7 +3498,7 @@ HgfsServerGetattr(char const *packetIn, // IN: incoming packet /* This is a regular lookup; proceed as usual */ ASSERT(localName); - status = HgfsGetattrFromName(localName, &attr, &targetName); + status = HgfsGetattrFromName(localName, share, caseFlags, &attr, &targetName); free(localName); if (status != 0) { goto exit; @@ -3179,6 +3548,7 @@ HgfsServerSetattr(char const *packetIn, // IN: incoming packet size_t cpNameSize = 0; HgfsAttrHint hints = 0; HgfsHandle file = HGFS_INVALID_HANDLE; + uint32 caseFlags = 0; ASSERT(packetSize); @@ -3188,7 +3558,8 @@ HgfsServerSetattr(char const *packetIn, // IN: incoming packet &hints, &cpName, &cpNameSize, - &file)) { + &file, + &caseFlags)) { status = EPROTO; goto exit; } @@ -3199,7 +3570,8 @@ HgfsServerSetattr(char const *packetIn, // IN: incoming packet status = HgfsSetattrFromName(cpName, cpNameSize, &attr, - hints); + hints, + caseFlags); } if (!HgfsPackSetattrReply(packetOut, packetSize)) { status = EPROTO; @@ -3249,7 +3621,9 @@ HgfsServerCreateDir(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(info.cpName, info.cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + info.caseFlags, &localName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerCreateDir: access check failed\n")); @@ -3326,6 +3700,7 @@ HgfsServerDeleteFile(char const *packetIn, // IN: incoming packet HgfsDeleteHint hints = 0; char *cpName; size_t cpNameSize; + uint32 caseFlags; request = (HgfsRequestDelete *)packetIn; ASSERT(request); @@ -3338,7 +3713,8 @@ HgfsServerDeleteFile(char const *packetIn, // IN: incoming packet &cpName, &cpNameSize, &hints, - &file)) { + &file, + &caseFlags)) { return EPROTO; } @@ -3354,7 +3730,9 @@ HgfsServerDeleteFile(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + caseFlags, &localName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerDeleteFile: access check failed\n")); @@ -3411,6 +3789,7 @@ HgfsServerDeleteDir(char const *packetIn, // IN: incoming packet HgfsDeleteHint hints = 0; char *cpName; size_t cpNameSize; + uint32 caseFlags; request = (HgfsRequestDelete *)packetIn; ASSERT(request); @@ -3423,7 +3802,8 @@ HgfsServerDeleteDir(char const *packetIn, // IN: incoming packet &cpName, &cpNameSize, &hints, - &file)) { + &file, + &caseFlags)) { return EPROTO; } @@ -3439,7 +3819,9 @@ HgfsServerDeleteDir(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + caseFlags, &localName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerDeleteDir: access check failed\n")); @@ -3508,6 +3890,9 @@ HgfsServerRename(char const *packetIn, // IN: incoming packet int error; HgfsInternalStatus status; Bool sharedFolderOpen = FALSE; + HgfsSharedFolder *share = NULL; + uint32 oldCaseFlags = 0; + uint32 newCaseFlags = 0; ASSERT(packetSize); @@ -3519,7 +3904,9 @@ HgfsServerRename(char const *packetIn, // IN: incoming packet &cpNewNameLen, &hints, &srcFile, - &targetFile)) { + &targetFile, + &oldCaseFlags, + &newCaseFlags)) { return EPROTO; } @@ -3544,7 +3931,9 @@ HgfsServerRename(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(cpOldName, cpOldNameLen, HGFS_OPEN_MODE_READ_WRITE, + oldCaseFlags, &localOldName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerRename: old name access check failed\n")); @@ -3582,7 +3971,9 @@ HgfsServerRename(char const *packetIn, // IN: incoming packet nameStatus = HgfsServerGetAccess(cpNewName, cpNewNameLen, HGFS_OPEN_MODE_WRITE_ONLY, + newCaseFlags, &localNewName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerRename: new name access check failed\n")); @@ -3600,7 +3991,7 @@ HgfsServerRename(char const *packetIn, // IN: incoming packet * We are not being asked to replace an existing * file so fail if the target exists. */ - status = HgfsGetattrFromName(localNewName, &attr, NULL); + status = HgfsGetattrFromName(localNewName, share, newCaseFlags, &attr, NULL); if (status == 0) { /* The target exists, and so must fail the rename. */ LOG(4, ("HgfsServerRename: error: target %s exists\n", localNewName)); @@ -3665,8 +4056,7 @@ HgfsServerQueryVolume(char const *packetIn, // IN: incoming packet char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestQueryVolume *request; - HgfsReplyQueryVolume *reply; + HgfsRequest *header; uint32 extra; char *utf8Name = NULL; size_t utf8NameLen; @@ -3683,32 +4073,65 @@ HgfsServerQueryVolume(char const *packetIn, // IN: incoming packet size_t failed = 0; size_t shares = 0; HgfsInternalStatus firstErr = 0; + char *fileName; + uint32 fileNameLength; + uint32 caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + uint64 *freeBytes; + uint64 *totalBytes; - request = (HgfsRequestQueryVolume *)packetIn; - ASSERT(request); - reply = (HgfsReplyQueryVolume *)packetOut; - ASSERT(reply); - ASSERT(packetSize); + ASSERT(packetIn); + ASSERT(packetOut); + header = (HgfsRequest *)packetIn; - /* Enforced by the dispatch function. */ - ASSERT(*packetSize >= sizeof *request); - extra = *packetSize - sizeof *request; + ASSERT(packetSize); + if (header->op == HGFS_OP_QUERY_VOLUME_INFO_V3) { + HgfsRequestQueryVolumeV3 *requestV3; + + requestV3 = (HgfsRequestQueryVolumeV3 *)(packetIn + sizeof *header); + freeBytes = &((HgfsReplyQueryVolumeV3 *)(packetOut + sizeof(struct HgfsReply)))->freeBytes; + totalBytes = &((HgfsReplyQueryVolumeV3 *)(packetOut + sizeof(struct HgfsReply)))->totalBytes; + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= sizeof *requestV3 + sizeof *header); + extra = *packetSize - sizeof *requestV3 - sizeof *header; + + caseFlags = requestV3->fileName.flags; + fileName = requestV3->fileName.name; + fileNameLength = requestV3->fileName.length; + *packetSize = sizeof(struct HgfsReplyQueryVolumeV3) + sizeof(struct HgfsReply); + LOG(4, ("HgfsServerSearchOpen: HGFS_OP_SEARCH_OPEN_V3\n")); + } else { + HgfsRequestQueryVolume *request; + request = (HgfsRequestQueryVolume *)packetIn; + freeBytes = &((HgfsReplyQueryVolume *)packetOut)->freeBytes; + totalBytes = &((HgfsReplyQueryVolume *)packetOut)->totalBytes; + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= sizeof *request); + extra = *packetSize - sizeof *request; + + fileName = request->fileName.name; + fileNameLength = request->fileName.length; + *packetSize = sizeof(struct HgfsReplyQueryVolume); + } /* * request->fileName.length is user-provided, so this test must be carefully * written to prevent wraparounds. */ - if (request->fileName.length > extra) { + if (fileNameLength > extra) { /* The input packet is smaller than the request. */ return EPROTO; } /* It is now safe to read the file name field. */ - nameStatus = HgfsServerGetAccess(request->fileName.name, - request->fileName.length, + nameStatus = HgfsServerGetAccess(fileName, + fileNameLength, HGFS_OPEN_MODE_READ_WRITE, + caseFlags, &utf8Name, - &utf8NameLen); + &utf8NameLen, + NULL); switch (nameStatus) { case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* @@ -3785,7 +4208,8 @@ HgfsServerQueryVolume(char const *packetIn, // IN: incoming packet length, HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, - &sharePath); + &sharePath, + NULL); free(dent); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerQueryVolume: No such share or access " @@ -3857,10 +4281,9 @@ HgfsServerQueryVolume(char const *packetIn, // IN: incoming packet return HgfsConvertFromNameStatus(nameStatus); } - reply->freeBytes = outFreeBytes; - reply->totalBytes = outTotalBytes; + *freeBytes = outFreeBytes; + *totalBytes = outTotalBytes; - *packetSize = sizeof *reply; return 0; } @@ -3887,41 +4310,72 @@ HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestSymlinkCreate *request; - HgfsReplySymlinkCreate *reply; + HgfsRequest *header; uint32 extra; char *localSymlinkName; - HgfsFileName *targetName; char localTargetName[HGFS_PACKET_MAX]; int error; HgfsNameStatus nameStatus; - - request = (HgfsRequestSymlinkCreate *)packetIn; - ASSERT(request); - reply = (HgfsReplySymlinkCreate *)packetOut; - ASSERT(reply); + uint32 caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + char *symlinkName; + uint32 symlinkNameLength; + char *targetName; + uint32 targetNameLength; + + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); + header = (HgfsRequest *)packetIn; - /* Enforced by the dispatch function */ - ASSERT(*packetSize >= sizeof *request); - extra = *packetSize - sizeof *request; + if (header->op == HGFS_OP_CREATE_SYMLINK_V3) { + HgfsRequestSymlinkCreateV3 *requestV3; + HgfsFileNameV3 *targetNameP; + requestV3 = (HgfsRequestSymlinkCreateV3 *)(packetIn + sizeof *header); + LOG(4, ("HgfsServerSymlinkCreate: HGFS_OP_CREATE_SYMLINK_V3\n")); - /* - * Get the symlink and target filenames from the request. - * - * Getting the new filename is somewhat inconvenient, because we - * don't know where request->targetName actually starts, thanks to the - * fact that request->symlinkName is of variable length. We get around - * this by using an HgfsFileName*, assigning it to the correct address - * just after request->symlinkName ends, and using that to access the - * new name. - */ + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= sizeof *requestV3 + sizeof *header); + extra = *packetSize - sizeof *requestV3 - sizeof *header; + + caseFlags = requestV3->symlinkName.flags; + symlinkName = requestV3->symlinkName.name; + symlinkNameLength = requestV3->symlinkName.length; + + /* + * targetName starts after symlinkName + the variable length array + * in symlinkName. + */ + targetNameP = (HgfsFileNameV3 *)(symlinkName + 1 + symlinkNameLength); + targetName = targetNameP->name; + targetNameLength = targetNameP->length; + *packetSize = sizeof(struct HgfsReplySymlinkCreateV3) + sizeof(struct HgfsReply); + } else { + HgfsRequestSymlinkCreate *request; + HgfsFileName *targetNameP; + request = (HgfsRequestSymlinkCreate *)packetIn; + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= sizeof *request); + extra = *packetSize - sizeof *request; + + symlinkName = request->symlinkName.name; + symlinkNameLength = request->symlinkName.length; + + /* + * targetName starts after symlinkName + the variable length array + * in symlinkName. + */ + targetNameP = (HgfsFileName *)(symlinkName + 1 + symlinkNameLength); + targetName = targetNameP->name; + targetNameLength = targetNameP->length; + *packetSize = sizeof(struct HgfsReplySymlinkCreate); + } /* * request->symlinkName.length is user-provided, so this test must * be carefully written to prevent wraparounds. */ - if (request->symlinkName.length > extra) { + if (symlinkNameLength > extra) { /* The input packet is smaller than the request */ return EPROTO; } @@ -3930,10 +4384,12 @@ HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet * "targetName" field */ - nameStatus = HgfsServerGetAccess(request->symlinkName.name, - request->symlinkName.length, + nameStatus = HgfsServerGetAccess(symlinkName, + symlinkNameLength, HGFS_OPEN_MODE_READ_WRITE, + caseFlags, &localSymlinkName, + NULL, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerSymlinkCreate: symlink name access check failed\n")); @@ -3941,16 +4397,13 @@ HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet } ASSERT(localSymlinkName); - - extra -= request->symlinkName.length; - targetName = (HgfsFileName *)( (char *)(&request->symlinkName + 1) - + request->symlinkName.length); + extra -= symlinkNameLength; /* - * targetName->length is user-provided, so this test must be carefully + * targetNameLength is user-provided, so this test must be carefully * written to prevent wraparounds. */ - if (targetName->length > extra) { + if (targetNameLength > extra) { /* The input packet is smaller than the request */ free(localSymlinkName); return EPROTO; @@ -3959,13 +4412,14 @@ HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet /* It is now safe to read the target file name */ /* Convert from CPName-lite to normal and NUL-terminate. */ - memcpy(localTargetName, targetName->name, targetName->length); - CPNameLite_ConvertFrom(localTargetName, targetName->length, DIRSEPC); - localTargetName[targetName->length] = '\0'; + memcpy(localTargetName, targetName, targetNameLength); + CPNameLite_ConvertFrom(localTargetName, targetNameLength, DIRSEPC); + localTargetName[targetNameLength] = '\0'; LOG(4, ("HgfsServerSymlinkCreate: creating \"%s\" linked to \"%s\"\n", localSymlinkName, localTargetName)); + /* XXX: Should make use of targetNameP->flags? */ error = symlink(localTargetName, localSymlinkName); free(localSymlinkName); if (error) { @@ -3974,7 +4428,6 @@ HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet return error; } - *packetSize = sizeof *reply; return 0; } @@ -4010,20 +4463,12 @@ HgfsServerHasSymlink(const char *fileName, // IN const char *sharePath) // IN { char *path; - char *fullSharePath = NULL; char *pathSep; - size_t shareLen = 1; + size_t shareLen = 0; size_t pathLen; Bool found = FALSE; - /* Resolve full path for the share to compare with fileName. */ ASSERT(sharePath); - fullSharePath = File_FullPath(sharePath); - if (!fullSharePath) { - LOG(4, ("HgfsServerHasSymlink: File_FullPath failed on sharePath %s\n", sharePath)); - return FALSE; - } - shareLen = strlen(fullSharePath); path = File_FullPath(fileName); if (!path) { @@ -4031,10 +4476,32 @@ HgfsServerHasSymlink(const char *fileName, // IN } pathLen = strlen(path); - LOG(4, ("%s: fileName: %s, sharePath: %s, path: %s, fullSharePath: %s\n", - __FUNCTION__, fileName, sharePath, path, fullSharePath)); + /* + * Resolve full path for the share to compare with fileName. + * This sharePath can be equal to "" (special case root share that + * allows access to the whole host). Normally, we check to ensure that the share + * passed in is a prefix of the fileName path. However, that check is meaningless + * in the case of the special root share. Only perform the check if sharePath + * is non-empty. + */ + if (strcmp(sharePath, "") != 0) { + char *fullSharePath; + fullSharePath = File_FullPath(sharePath); + if (!fullSharePath) { + LOG(4, ("HgfsServerHasSymlink: File_FullPath failed on sharePath %s\n", + sharePath)); + return FALSE; + } + shareLen = strlen(fullSharePath); + + LOG(4, ("%s: fileName: %s, sharePath: %s, path: %s, fullSharePath: %s\n", + __FUNCTION__, fileName, sharePath, path, fullSharePath)); + + ASSERT(Str_Strncmp(path, fullSharePath, shareLen < pathLen ? + shareLen : pathLen) == 0); + free(fullSharePath); + } - ASSERT(Str_Strncmp(path, fullSharePath, shareLen < pathLen ? shareLen : pathLen) == 0); /* If fileName is prefix of sharePath, ignore symlinks. */ if (shareLen > pathLen) { goto out; @@ -4054,7 +4521,7 @@ HgfsServerHasSymlink(const char *fileName, // IN *pathSep++ = DIRSEPC; } - /* + /* * We've checked up until every path separator. Now check the last * component. */ @@ -4062,9 +4529,6 @@ HgfsServerHasSymlink(const char *fileName, // IN found = TRUE; } out: - if (fullSharePath) { - free(fullSharePath); - } free(path); return found; } @@ -4157,4 +4621,3 @@ HgfsAckOplockBreak(ServerLockData *lockData, // IN: server lock info } #endif - diff --git a/open-vm-tools/lib/hgfsServerManagerGuest/Makefile.in b/open-vm-tools/lib/hgfsServerManagerGuest/Makefile.in index da67252f3..146910c82 100644 --- a/open-vm-tools/lib/hgfsServerManagerGuest/Makefile.in +++ b/open-vm-tools/lib/hgfsServerManagerGuest/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -107,7 +107,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -119,7 +118,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -144,7 +143,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -153,6 +151,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -160,7 +160,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -301,8 +301,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -314,8 +314,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -325,12 +325,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c b/open-vm-tools/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c index 8fb36a179..5e8bc0a5d 100644 --- a/open-vm-tools/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c +++ b/open-vm-tools/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/hgfsServerPolicyGuest/Makefile.in b/open-vm-tools/lib/hgfsServerPolicyGuest/Makefile.in index 506601e98..968c597d6 100644 --- a/open-vm-tools/lib/hgfsServerPolicyGuest/Makefile.in +++ b/open-vm-tools/lib/hgfsServerPolicyGuest/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -107,7 +107,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -119,7 +118,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -144,7 +143,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -153,6 +151,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -160,7 +160,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -301,8 +301,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -314,8 +314,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -325,12 +325,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c b/open-vm-tools/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c index 8ef77c490..23714dc84 100644 --- a/open-vm-tools/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c +++ b/open-vm-tools/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -427,16 +427,17 @@ HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: Name to check size_t nameInLen, // IN: Length of nameIn HgfsOpenMode mode, // IN: Requested access mode size_t *sharePathLen, // OUT: Length of share path - char const **sharePath) // OUT: Share path + char const **sharePath, // OUT: Share path + HgfsSharedFolder **share) // OUT: Share { - HgfsSharedFolder *share; + HgfsSharedFolder *myShare; ASSERT(nameIn); ASSERT(sharePathLen); ASSERT(sharePath); - share = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); - if (!share) { + myShare = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); + if (!myShare) { LOG(4, ("HgfsServerPolicy_GetSharePath: No matching share name\n")); return HGFS_NAME_STATUS_DOES_NOT_EXIST; } @@ -449,21 +450,21 @@ HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: Name to check */ switch (HGFS_OPEN_MODE_ACCMODE(mode)) { case HGFS_OPEN_MODE_READ_ONLY: - if (!share->readAccess) { + if (!myShare->readAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Read access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } break; case HGFS_OPEN_MODE_WRITE_ONLY: - if (!share->writeAccess) { + if (!myShare->writeAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Write access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } break; case HGFS_OPEN_MODE_READ_WRITE: - if (!share->readAccess || !share->writeAccess) { + if (!myShare->readAccess || !myShare->writeAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Read/write access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } @@ -475,8 +476,11 @@ HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: Name to check break; } - *sharePathLen = share->pathLen; - *sharePath = share->path; + *sharePathLen = myShare->pathLen; + *sharePath = myShare->path; + if (share) { + *share = myShare; + } return HGFS_NAME_STATUS_COMPLETE; } diff --git a/open-vm-tools/lib/impersonate/Makefile.in b/open-vm-tools/lib/impersonate/Makefile.in index dbb1b8cd1..a8669b337 100644 --- a/open-vm-tools/lib/impersonate/Makefile.in +++ b/open-vm-tools/lib/impersonate/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -301,8 +301,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -314,8 +314,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -325,12 +325,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/impersonate/impersonate.c b/open-vm-tools/lib/impersonate/impersonate.c index 9274cc4de..a509cbb2a 100644 --- a/open-vm-tools/lib/impersonate/impersonate.c +++ b/open-vm-tools/lib/impersonate/impersonate.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/impersonate/impersonatePosix.c b/open-vm-tools/lib/impersonate/impersonatePosix.c index 80b3d1191..23b4f81d4 100644 --- a/open-vm-tools/lib/impersonate/impersonatePosix.c +++ b/open-vm-tools/lib/impersonate/impersonatePosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -38,6 +38,7 @@ #include "impersonateInt.h" #include "su.h" +#include "posix.h" #if !defined(VMX86_TOOLS) static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; @@ -431,7 +432,7 @@ ImpersonateDo(const char *user, // IN struct passwd *ppw = &pw; int error; - if ((error = getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { + if ((error = Posix_Getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } diff --git a/open-vm-tools/lib/include/SLPv2.h b/open-vm-tools/lib/include/SLPv2.h index e83c8547a..422c94dd2 100644 --- a/open-vm-tools/lib/include/SLPv2.h +++ b/open-vm-tools/lib/include/SLPv2.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/SLPv2Private.h b/open-vm-tools/lib/include/SLPv2Private.h index 853c4c704..3cd1dcc7c 100644 --- a/open-vm-tools/lib/include/SLPv2Private.h +++ b/open-vm-tools/lib/include/SLPv2Private.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/auth.h b/open-vm-tools/lib/include/auth.h index 11b797757..16a747cf7 100644 --- a/open-vm-tools/lib/include/auth.h +++ b/open-vm-tools/lib/include/auth.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,6 +26,7 @@ */ #include "vm_basic_types.h" +#include "unicodeTypes.h" #if _WIN32 # include @@ -60,7 +61,7 @@ uint32 Auth_RetrieveAccountInformationForVM(const char *filename, uint32 *attrib #endif -AuthToken Auth_AuthenticateUser(const char *user, const char *pass); +AuthToken Auth_AuthenticateUser(ConstUnicode user, ConstUnicode pass); void Auth_CloseToken(AuthToken token); diff --git a/open-vm-tools/lib/include/backdoor.h b/open-vm-tools/lib/include/backdoor.h index b3c5a4550..eb790a9ca 100644 --- a/open-vm-tools/lib/include/backdoor.h +++ b/open-vm-tools/lib/include/backdoor.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/backdoorInt.h b/open-vm-tools/lib/include/backdoorInt.h index 4fd97cff6..cd0620e8b 100644 --- a/open-vm-tools/lib/include/backdoorInt.h +++ b/open-vm-tools/lib/include/backdoorInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/backdoor_def.h b/open-vm-tools/lib/include/backdoor_def.h index 8464082f6..d9ea22676 100644 --- a/open-vm-tools/lib/include/backdoor_def.h +++ b/open-vm-tools/lib/include/backdoor_def.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -110,7 +110,8 @@ #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 #define BDOOR_CMD_VASSERT 51 -#define BDOOR_CMD_MAX 52 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_MAX 53 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, diff --git a/open-vm-tools/lib/include/backdoor_types.h b/open-vm-tools/lib/include/backdoor_types.h index 23940a453..925d6ace2 100644 --- a/open-vm-tools/lib/include/backdoor_types.h +++ b/open-vm-tools/lib/include/backdoor_types.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/base64.h b/open-vm-tools/lib/include/base64.h index 901482243..95e8f9451 100644 --- a/open-vm-tools/lib/include/base64.h +++ b/open-vm-tools/lib/include/base64.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/bsd_output.h b/open-vm-tools/lib/include/bsd_output.h index e4db150de..238c0e67d 100644 --- a/open-vm-tools/lib/include/bsd_output.h +++ b/open-vm-tools/lib/include/bsd_output.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/bsd_output_int.h b/open-vm-tools/lib/include/bsd_output_int.h index ad92cb1fb..fa339f8ba 100644 --- a/open-vm-tools/lib/include/bsd_output_int.h +++ b/open-vm-tools/lib/include/bsd_output_int.h @@ -48,31 +48,7 @@ #include "includeCheck.h" #include "bsd_output.h" - -#ifdef _WIN32 // { - -#pragma warning(disable : 4018 4047 4101 4102 4146 4244 4267) - -#define INTMAX_MAX 9223372036854775807i64 - -typedef unsigned int u_int; -typedef unsigned long u_long; -typedef unsigned short u_short; -typedef unsigned char u_char; -typedef __int64 intmax_t; -typedef unsigned __int64 uintmax_t; -typedef intptr_t ptrdiff_t; - -#endif // } - -#define MAXEXPDIG 6 - -/* For u_int and u_long, and other types we might want. */ -#ifndef _WIN32 -#include -#include -#include -#endif +#include "bsdfmt.h" union arg { int intarg; @@ -114,36 +90,6 @@ enum typeid { T_DOUBLE, T_LONG_DOUBLE, T_WINT, TP_WCHAR }; -/* - * I/O descriptors for __sfvwrite(). - */ -struct __siov { - void *iov_base; - size_t iov_len; -}; -struct __suio { - struct __siov *uio_iov; - int uio_iovcnt; - int uio_resid; -}; - -#ifndef NO_FLOATING_POINT - -#include -#include - -#define DEFPREC 6 - -extern char * dtoa(double d, int mode, int prec, int *expOut, - int *sign, char **strEnd); - -extern char * ldtoa(long double *ld, int mode, int prec, int *expOut, - int *sign, char **strEnd); - -extern void freedtoa(void *mem); - -#endif /* !NO_FLOATING_POINT */ - #if defined _MSC_VER && _MSC_VER < 1400 /* VC80 has an internal wmemchr */ extern const wchar_t *wmemchr( diff --git a/open-vm-tools/lib/include/bsdfmt.h b/open-vm-tools/lib/include/bsdfmt.h new file mode 100644 index 000000000..5f2295b5f --- /dev/null +++ b/open-vm-tools/lib/include/bsdfmt.h @@ -0,0 +1,208 @@ +/* ********************************************************** + * Copyright 2008 VMware, Inc. All rights reserved. + * **********************************************************/ + +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * bsdfmt.h -- + * + * BSD-derived formatter (sprintf, etc.) support. + * + * Most of this code came from bsd_vsnprintf.c and bsd_output_int.h, + * which in turn came from vfprintf.c in the FreeBSD distribution. + * See bsd_vsnprintf.c for more details. + */ + +#ifndef _BSDFMT_H_ +#define _BSDFMT_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#include "includeCheck.h" + + +#ifdef _WIN32 // { + +#pragma warning(disable : 4018 4047 4101 4102 4146 4244 4267) + +#define INTMAX_MAX MAX_INT64 + +typedef unsigned int u_int; +typedef unsigned long u_long; +typedef unsigned short u_short; +typedef unsigned char u_char; +typedef __int64 intmax_t; +typedef unsigned __int64 uintmax_t; +typedef intptr_t ptrdiff_t; + +#else // } { + +/* For u_int and u_long, and other types we might want. */ +#include +#include +#include + +#endif // } + +/* + * I/O descriptors for BSDFmt_sfvwrite(). + */ + +typedef struct BSDFmt_IOV { + void *iov_base; + size_t iov_len; +} BSDFmt_IOV; + +typedef struct BSDFmt_UIO { + BSDFmt_IOV *uio_iov; + int uio_iovcnt; + int uio_resid; +} BSDFmt_UIO; + +#define BSDFMT_NIOV 8 + +typedef struct BSDFmt_StrBuf { + Bool alloc; + Bool error; + char *buf; + size_t size; + size_t index; +} BSDFmt_StrBuf; + +int BSDFmt_SFVWrite(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio); +int BSDFmt_SPrint(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio); + + +/* + * Conversion functions + */ + +char *BSDFmt_WCSConv(wchar_t *, int); +char *BSDFmt_UJToA(uintmax_t, char *, int, int, const char *, int, char, + const char *); + + +/* + * Pretend to have wcsrtombs() and wcrtomb(). + * Don't use typedef for mbstate_t because it's actually defined + * in VS2003/VC7/include/wchar.h, but the functions don't exist. + * I don't know why, nor do I care. -- edward + */ + +#ifdef _WIN32 +#define mbstate_t int +#define wcsrtombs(dest, srcp, n, state) wcstombs(dest, *(srcp), n) +#define wcrtomb(dest, wc, state) wctomb(dest, wc) +#endif + + +/* + * Macros for converting digits to letters and vice versa + */ + +#define to_digit(c) ((c) - '0') +#define is_digit(c) ((unsigned)to_digit(c) <= 9) +#define to_char(n) ((n) + '0') + + +/* + * Floating point + */ + +#ifndef NO_FLOATING_POINT // { + +#include +#include + +#define MAXEXPDIG 6 +#define DEFPREC 6 + +int BSDFmt_Exponent(char *, int, int); + +extern char *dtoa(double d, int mode, int prec, int *expOut, + int *sign, char **strEnd); +extern char *ldtoa(long double *ld, int mode, int prec, int *expOut, + int *sign, char **strEnd); +extern void freedtoa(void *mem); + +#endif // } + + +/* + * The size of the buffer we use as scratch space for integer + * conversions, among other things. Technically, we would need the + * most space for base 10 conversions with thousands' grouping + * characters between each pair of digits. 100 bytes is a + * conservative overestimate even for a 128-bit uintmax_t. + */ + +#define INT_CONV_BUF 100 + +#define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ + +/* + * Flags used during conversion. + */ + +#define ALT 0x001 /* alternate form */ +#define LADJUST 0x004 /* left adjustment */ +#define LONGINT 0x010 /* long integer */ +#define LLONGINT 0x020 /* long long integer */ +#define SHORTINT 0x040 /* short integer */ +#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ +#define FPT 0x100 /* Floating point number */ +#define GROUPING 0x200 /* use grouping ("'" flag) */ +/* C99 additional size modifiers: */ +#define SIZET 0x400 /* size_t */ +#define PTRDIFFT 0x800 /* ptrdiff_t */ +#define INTMAXT 0x1000 /* intmax_t */ +#define CHARINT 0x2000 /* print char using int format */ + +#define INTMAX_SIZE (INTMAXT|SIZET|PTRDIFFT|LLONGINT) + + +/* + * Choose PADSIZE to trade efficiency vs. size. If larger printf + * fields occur frequently, increase PADSIZE and make the initialisers + * below longer. + */ + +#define PADSIZE 16 /* pad chunk size */ +extern char blanks[PADSIZE]; +extern char zeroes[PADSIZE]; + +extern const char xdigs_lower[17]; +extern const char xdigs_upper[17]; + + +#endif // ifndef _BSDFMT_H_ diff --git a/open-vm-tools/lib/include/buildNumber.h b/open-vm-tools/lib/include/buildNumber.h index d22419074..6f1838f89 100644 --- a/open-vm-tools/lib/include/buildNumber.h +++ b/open-vm-tools/lib/include/buildNumber.h @@ -1,12 +1,12 @@ #define BUILD_NUMBER \ - "build-77928" + "build-87182" #define BUILD_NUMBER_NUMERIC \ - 77928 + 87182 #define BUILD_NUMBER_NUMERIC_STRING \ - "77928" + "87182" #define PRODUCT_BUILD_NUMBER \ - "product-build-104" + "product-build-163" #define PRODUCT_BUILD_NUMBER_NUMERIC \ - 104 + 163 #define PRODUCT_BUILD_NUMBER_NUMERIC_STRING \ - "104" + "163" diff --git a/open-vm-tools/lib/include/circList.h b/open-vm-tools/lib/include/circList.h index 3c53be05f..5f16c7783 100644 --- a/open-vm-tools/lib/include/circList.h +++ b/open-vm-tools/lib/include/circList.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/codeset.h b/open-vm-tools/lib/include/codeset.h index f38870307..a9107ec15 100644 --- a/open-vm-tools/lib/include/codeset.h +++ b/open-vm-tools/lib/include/codeset.h @@ -1,35 +1,228 @@ -/********************************************************* - * Copyright (C) 1998 VMware, Inc. All rights reserved. +/* ********************************************************** + * Copyright 2007 VMware, Inc. All rights reserved. + * **********************************************************/ + +/* + * codeset.h -- * - * 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. + * UTF-16 handling macros. Based on utf16.h from ICU 1.8.1. * - * 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 GNU General Public License - * for more details. + * ICU 1.8.1 license follows: * - * You should have received a copy of the GNU 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. + * ICU License - ICU 1.8.1 and later * - *********************************************************/ - -/* - * codeset.h -- + * COPYRIGHT AND PERMISSION NOTICE + * + * Copyright (c) 1995-2006 International Business Machines Corporation + * and others * - * Character set and encoding conversion functions --hpreg + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any + * person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software + * without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all + * copies of the Software and that both the above copyright + * notice(s) and this permission notice appear in supporting + * documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT + * SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE + * BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 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. + * + * Except as contained in this notice, the name of a + * copyright holder shall not be used in advertising or otherwise + * to promote the sale, use or other dealings in this Software + * without prior written authorization of the copyright holder. */ - #ifndef __CODESET_H__ # define __CODESET_H__ #include "vm_basic_types.h" +#include "vm_assert.h" #include "dynbuf.h" +/** + * Is this code point a surrogate (U+d800..U+dfff)? + * @param c 32-bit code point + * @return TRUE or FALSE + * @stable ICU 2.4 + */ +#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800) + +/** + * Does this code unit alone encode a code point (BMP, not a surrogate)? + * @param c 16-bit code unit + * @return TRUE or FALSE + * @stable ICU 2.4 + */ +#define U16_IS_SINGLE(c) (!U_IS_SURROGATE(c)) + +/** + * Is this code unit a lead surrogate (U+d800..U+dbff)? + * @param c 16-bit code unit + * @return TRUE or FALSE + * @stable ICU 2.4 + */ +#define U16_IS_LEAD(c) (((c)&0xfffffc00)==0xd800) + +/** + * Is this code unit a trail surrogate (U+dc00..U+dfff)? + * @param c 16-bit code unit + * @return TRUE or FALSE + * @stable ICU 2.4 + */ +#define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00) + +/** + * Is this code unit a surrogate (U+d800..U+dfff)? + * @param c 16-bit code unit + * @return TRUE or FALSE + * @stable ICU 2.4 + */ +#define U16_IS_SURROGATE(c) U_IS_SURROGATE(c) + +/** + * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), + * is it a lead surrogate? + * @param c 16-bit code unit + * @return TRUE or FALSE + * @stable ICU 2.4 + */ +#define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0) + +/** + * Helper constant for U16_GET_SUPPLEMENTARY. + * @internal + */ +#define U16_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000) + +/** + * Get a supplementary code point value (U+10000..U+10ffff) + * from its lead and trail surrogates. + * The result is undefined if the input values are not + * lead and trail surrogates. + * + * @param lead lead surrogate (U+d800..U+dbff) + * @param trail trail surrogate (U+dc00..U+dfff) + * @return supplementary code point (U+10000..U+10ffff) + * @stable ICU 2.4 + */ +#define U16_GET_SUPPLEMENTARY(lead, trail) \ + (((uint32)(lead)<<10UL)+(uint32)(trail)-U16_SURROGATE_OFFSET) + + +/** + * Get the lead surrogate (0xd800..0xdbff) for a + * supplementary code point (0x10000..0x10ffff). + * @param supplementary 32-bit code point (U+10000..U+10ffff) + * @return lead surrogate (U+d800..U+dbff) for supplementary + * @stable ICU 2.4 + */ +#define U16_LEAD(supplementary) ((utf16_t)(((supplementary)>>10)+0xd7c0)) + +/** + * Get the trail surrogate (0xdc00..0xdfff) for a + * supplementary code point (0x10000..0x10ffff). + * @param supplementary 32-bit code point (U+10000..U+10ffff) + * @return trail surrogate (U+dc00..U+dfff) for supplementary + * @stable ICU 2.4 + */ +#define U16_TRAIL(supplementary) ((utf16_t)(((supplementary)&0x3ff)|0xdc00)) + +/** + * How many 16-bit code units are used to encode this Unicode code point? (1 or 2) + * The result is not defined if c is not a Unicode code point (U+0000..U+10ffff). + * @param c 32-bit code point + * @return 1 or 2 + * @stable ICU 2.4 + */ +#define U16_LENGTH(c) ((uint32)(c)<=0xffff ? 1 : 2) + +/** + * The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff). + * @return 2 + * @stable ICU 2.4 + */ +#define U16_MAX_LENGTH 2 + +/** + * Get a code point from a string at a code point boundary offset, + * and advance the offset to the next code point boundary. + * (Post-incrementing forward iteration.) + * "Safe" macro, handles unpaired surrogates and checks for string boundaries. + * + * The offset may point to the lead surrogate unit + * for a supplementary code point, in which case the macro will read + * the following trail surrogate as well. + * If the offset points to a trail surrogate or + * to a single, unpaired lead surrogate, then that itself + * will be returned as the code point. + * + * @param s const utf16_t * string + * @param i string offset, must be i(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ + --(i); \ + (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ + } \ + } \ + } + + Bool CodeSet_Utf8ToCurrent(char const *bufIn, // IN size_t sizeIn, // IN @@ -95,4 +288,199 @@ CodeSet_Utf8FormCToUtf8FormD(char const *bufIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT +const char * +CodeSet_GetCurrentCodeSet(void); + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_Utf8ToUtf16 -- + * + * A convenience wrapper that accepts a NUL-terminated UTF-8 string + * and returns an allocated UTF-16 (LE) string. ASSERTs on failure. + * + * Results: + * The allocted UTF-16 (LE) string, free with free(). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE utf16_t * +CodeSet_Utf8ToUtf16(const char *str) // IN: +{ + utf16_t *strW; + + if (!CodeSet_Utf8ToUtf16le(str, strlen(str), (char **)(char*) &strW, NULL)) { + ASSERT_NOT_IMPLEMENTED(0); + } + + return strW; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_Utf16ToUtf8 -- + * + * A convenience wrapper that accepts a NUL-terminated UTF-16 (LE) + * string and returns an allocated UTF-8 string. ASSERTs on failure. + * + * Results: + * The allocted UTF-8 string, free with free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE char * +CodeSet_Utf16ToUtf8(const utf16_t *strW) // IN: +{ + char *str; + size_t len; + + for (len = 0; strW[len]; len++) + ; + + if (!CodeSet_Utf16leToUtf8((const char *) strW, len * sizeof strW[0], + (char **) &str, NULL)) { + ASSERT_NOT_IMPLEMENTED(0); + } + + return str; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_Utf8FindCodePointBoundary + * + * Determine if buf[offset] is a valid UTF-8 code point boundary + * and find the previous boundary if it is not. The contents of + * buf[offset] need not be defined, only data prior to this + * location is examined. Useful for finding a suitable place to + * put a NUL terminator. + * + * Results: + * + * Returns the offset of the byte immediately following the last + * complete UTF-8 code point in buf that is entirely within the + * range [0, offset-1]. Note that if the final UTF-8 code point + * is complete, the input offset will be returned unchanged. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE size_t +CodeSet_Utf8FindCodePointBoundary(const char *buf, // IN + size_t offset) // IN +{ + size_t origOffset = offset; + signed char c; + + if (offset > 0) { + + /* + * Back up 1 byte and then find the start of the UTF-8 code + * point occupying that location. + */ + + offset--; + while (offset > 0 && (buf[offset] & 0xc0) == 0x80) { + offset--; + } + + /* + * Maximum UTF-8 code point length is 4 + */ + + ASSERT(origOffset - offset <= 4); + + c = buf[offset]; + + /* + * The first byte of a UTF-8 code point needs to be one of + * 0b0XXXXXXX, 0b110XXXXX, 0b1110XXXX, 0b11110XXX + */ + + ASSERT(c >= 0 || (c >> 5) == -2 || (c >> 4) == -2 || (c >> 3) == -2); + + /* + * offset now points to the start of a UTF-8 code point. If it + * is a single byte or if the length, as encoded in the first + * byte, matches the number of bytes we have backed up, then the + * entire code point is present, so the original offset is a + * valid code point starting offset. + * + * Length is encoded as + * 2 bytes: 0b110XXXXX + * 3 bytes: 0b1110XXXX + * 4 bytes: 0b11110XXX + * Thus the first byte is -2 when shifted right (signed) by + * (7 - length). + */ + + if (c >= 0 || (c >> (7 - origOffset + offset)) == -2) { + return origOffset; + } + + /* + * Else we truncated a code point. Return its starting point. + */ + } + return offset; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_Utf16FindCodePointBoundary + * + * Determine if buf[offset] is a valid UTF-16 code point boundary + * and find the previous boundary if it is not. The contents of + * buf[offset] need not be defined, only data prior to this + * location is examined. Useful for finding a suitable place to + * put a NUL terminator. + * + * Results: + * + * Returns the offset of the byte immediately following the last + * complete UTF-16 code point in buf that is entirely within the + * range [0, offset-1]. Note that if the final UTF-16 code point + * is complete, the input offset will be returned unchanged. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE size_t +CodeSet_Utf16FindCodePointBoundary(const char *buf, // IN + size_t offset) // IN +{ + size_t origOffset; + const utf16_t *utf16Buf = (const utf16_t *)buf; + + origOffset = offset / 2; + offset = origOffset - 1; + + if (origOffset > 0 && U16_IS_LEAD(utf16Buf[offset])) { + return offset * 2; + } + + return origOffset * 2; +} + #endif /* __CODESET_H__ */ diff --git a/open-vm-tools/lib/include/compat/compat_stdarg.h b/open-vm-tools/lib/include/compat/compat_stdarg.h index 6729ff8c5..ebd5a28f0 100644 --- a/open-vm-tools/lib/include/compat/compat_stdarg.h +++ b/open-vm-tools/lib/include/compat/compat_stdarg.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/conf.h b/open-vm-tools/lib/include/conf.h index 81eb0a64e..92d78099e 100644 --- a/open-vm-tools/lib/include/conf.h +++ b/open-vm-tools/lib/include/conf.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/config.h b/open-vm-tools/lib/include/config.h index 30bd7c5ab..d52f30d37 100644 --- a/open-vm-tools/lib/include/config.h +++ b/open-vm-tools/lib/include/config.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/cpName.h b/open-vm-tools/lib/include/cpName.h index e8b718f7f..145573f0f 100644 --- a/open-vm-tools/lib/include/cpName.h +++ b/open-vm-tools/lib/include/cpName.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/cpNameInt.h b/open-vm-tools/lib/include/cpNameInt.h index fbcc6b846..9f7bc06d5 100644 --- a/open-vm-tools/lib/include/cpNameInt.h +++ b/open-vm-tools/lib/include/cpNameInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/cpNameLite.h b/open-vm-tools/lib/include/cpNameLite.h index 411787b6c..e5e83c9db 100644 --- a/open-vm-tools/lib/include/cpNameLite.h +++ b/open-vm-tools/lib/include/cpNameLite.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/cpNameUtil.h b/open-vm-tools/lib/include/cpNameUtil.h index 35806fb97..9b3fc27e5 100644 --- a/open-vm-tools/lib/include/cpNameUtil.h +++ b/open-vm-tools/lib/include/cpNameUtil.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/cpuid_info.h b/open-vm-tools/lib/include/cpuid_info.h index c5c3301aa..950500c5c 100644 --- a/open-vm-tools/lib/include/cpuid_info.h +++ b/open-vm-tools/lib/include/cpuid_info.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/cryptoError.h b/open-vm-tools/lib/include/cryptoError.h index 89a778ae7..a5c9480e9 100644 --- a/open-vm-tools/lib/include/cryptoError.h +++ b/open-vm-tools/lib/include/cryptoError.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/dbllnklst.h b/open-vm-tools/lib/include/dbllnklst.h index 36417033f..df68a863c 100644 --- a/open-vm-tools/lib/include/dbllnklst.h +++ b/open-vm-tools/lib/include/dbllnklst.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/debug.h b/open-vm-tools/lib/include/debug.h index 1b83a1980..1033e74a6 100644 --- a/open-vm-tools/lib/include/debug.h +++ b/open-vm-tools/lib/include/debug.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/deployPkg.h b/open-vm-tools/lib/include/deployPkg.h index 7d84771fa..84a60a799 100644 --- a/open-vm-tools/lib/include/deployPkg.h +++ b/open-vm-tools/lib/include/deployPkg.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/deployPkgLog.h b/open-vm-tools/lib/include/deployPkgLog.h index 15a0c8cf8..1fe58a0b9 100644 --- a/open-vm-tools/lib/include/deployPkgLog.h +++ b/open-vm-tools/lib/include/deployPkgLog.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/dictll.h b/open-vm-tools/lib/include/dictll.h index d1f387cae..136bc3b4c 100644 --- a/open-vm-tools/lib/include/dictll.h +++ b/open-vm-tools/lib/include/dictll.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/dnd.h b/open-vm-tools/lib/include/dnd.h index 20e770bee..c9db1d694 100644 --- a/open-vm-tools/lib/include/dnd.h +++ b/open-vm-tools/lib/include/dnd.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -36,6 +36,7 @@ #include "includeCheck.h" #include "vm_basic_types.h" #include "unicodeTypes.h" +#include "dynarray.h" /* Error value returned when data contains illegal characters */ #define DND_ILLEGAL_CHARACTERS "data contains illegal characters" @@ -46,6 +47,13 @@ */ #define DND_MAX_PATH 6144 +#define DNDMSG_HEADERSIZE_V3 ((3 * sizeof (uint32)) + (1 * sizeof (uint8))) +/* Hard limits we never want to exceed */ +/* The maximum size of a serializied DnDMsg. Close to 4M. */ +#define DNDMSG_MAX_ARGSZ ((1 << 22) - DNDMSG_HEADERSIZE_V3) +/* The maximum number of arguments we can hold */ +#define DNDMSG_MAX_ARGS 64 + /* Strings used for formatting various types of data */ #define DND_URI_LIST_PRE "file://" #define DND_URI_LIST_PRE_KDE "file:" @@ -57,12 +65,17 @@ #define FCP_GNOME_LIST_PRE "file://" #define FCP_GNOME_LIST_POST "\n" +/* Guest detection window width and height. */ +#define DRAG_DET_WINDOW_WIDTH 15 + typedef enum { CPFORMAT_UNKNOWN = 0, - CPFORMAT_TEXT, + CPFORMAT_TEXT, /* NUL terminated UTF-8. */ CPFORMAT_FILELIST, + CPFORMAT_MAX, } DND_CPFORMAT; + enum DND_DROPEFFECT { DROP_UNKNOWN = 1<<31, @@ -72,24 +85,73 @@ enum DND_DROPEFFECT DROP_LINK = 1<<2, }; +/* Clipboard item. */ +typedef struct CPClipItem { + void *buf; + uint32 size; + Bool exists; +} CPClipItem; + +/* + * Cross platform clipboard. The native UI will convert host clipboard content + * into cross platform clipboards. + */ +typedef struct { + CPClipItem items[CPFORMAT_MAX - 1]; +} CPClipboard; + +/* Definitions for transport layer big buffer support (>= V3). */ +typedef enum +{ + DND_TRANSPORT_PACKET_TYPE_UNKNOWN = 0, + DND_TRANSPORT_PACKET_TYPE_SINGLE, + DND_TRANSPORT_PACKET_TYPE_REQUEST, + DND_TRANSPORT_PACKET_TYPE_PAYLOAD, +} DND_TRANSPORT_PACKET_TYPE; + +typedef +#include "vmware_pack_begin.h" +struct DnDTransportPacketHeader { + uint32 type; + uint32 seqNum; + uint32 totalSize; + uint32 payloadSize; + uint32 offset; + uint8 payload[1]; +} +#include "vmware_pack_end.h" +DnDTransportPacketHeader; + +typedef struct DnDTransportBuffer { + size_t seqNum; + uint8 *buffer; + size_t totalSize; + size_t offset; + VmTimeType lastUpdateTime; +} DnDTransportBuffer; + +#define DND_TRANSPORT_PACKET_HEADER_SIZE (5 * sizeof(uint32)) +/* Close to 64k (maximum guestRpc message size). Leave some space for guestRpc header. */ +#define DND_MAX_TRANSPORT_PACKET_SIZE ((1 << 16) - 100) +#define DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE (DND_MAX_TRANSPORT_PACKET_SIZE - \ + DND_TRANSPORT_PACKET_HEADER_SIZE) +#define DND_MAX_TRANSPORT_LATENCY_TIME 3 * 1000000 /* 3 seconds. */ + #ifdef _WIN32 /* * Windows-specific functions */ -EXTERN uint32 DnD_GetClipboardFormatFromName(LPCSTR pFormatName); -EXTERN size_t DnD_GetClipboardFormatName(UINT cf, - char *pFormatName, - DWORD dwBufSize); -EXTERN HGLOBAL DnD_CopyStringToGlobal(LPSTR pszString); +EXTERN uint32 DnD_GetClipboardFormatFromName(ConstUnicode pFormatName); +EXTERN Unicode DnD_GetClipboardFormatName(UINT cf); +EXTERN HGLOBAL DnD_CopyStringToGlobal(ConstUnicode str); EXTERN HGLOBAL DnD_CopyDWORDToGlobal(DWORD *pDWORD); -EXTERN HGLOBAL DnD_CreateHDrop(const char *path, const char *fileList); -EXTERN HGLOBAL DnD_CreateHDropForGuest(const char *path, - const char *fileList); -EXTERN DWORD DnD_CalcDirectorySize(const char *dir); +EXTERN HGLOBAL DnD_CreateHDrop(ConstUnicode path, ConstUnicode fileList); +EXTERN HGLOBAL DnD_CreateHDropForGuest(ConstUnicode path, + ConstUnicode fileList); EXTERN Bool DnD_FakeMouseEvent(DWORD flag); EXTERN Bool DnD_FakeMouseState(DWORD key, Bool isDown); EXTERN Bool DnD_FakeEscapeKey(void); -EXTERN Bool DnD_DeleteLocalDirectory(const char *localDir); +EXTERN Bool DnD_DeleteLocalDirectory(ConstUnicode localDir); EXTERN Bool DnD_SetClipboard(UINT format, char *buffer, int len); EXTERN Bool DnD_GetFileList(HDROP hDrop, char **remoteFiles, @@ -112,15 +174,17 @@ EXTERN char *DnD_UriListGetNextFile(char const *uriList, */ ConstUnicode DnD_GetFileRoot(void); char *DnD_CreateStagingDirectory(void); -Bool DnD_DeleteStagingFiles(const char *fileList, Bool onReboot); +Bool DnD_DeleteStagingFiles(ConstUnicode fileList, Bool onReboot); Bool DnD_DataContainsIllegalCharacters(const char *data, const size_t dataSize); -Bool DnD_PrependFileRoot(const char *fileRoot, char **src, size_t *srcSize); -char *DnD_UTF8Asprintf(unsigned int outBufSize, const char *format, ...); +Bool DnD_PrependFileRoot(ConstUnicode fileRoot, char **src, size_t *srcSize); int DnD_LegacyConvertToCPName(const char *nameIn, size_t bufOutSize, char *bufOut); -size_t DnD_GetLastDirName(const char *str, size_t strSize, char **dirName); +Bool DnD_CPNameListToDynBufArray(char *fileList, + size_t listSize, + DynBufArray *dynBufArray); +Unicode DnD_GetLastDirName(const char *str); /* vmblock support functions. */ int DnD_InitializeBlocking(void); @@ -128,4 +192,22 @@ Bool DnD_UninitializeBlocking(int blockFd); Bool DnD_AddBlock(int blockFd, const char *blockPath); Bool DnD_RemoveBlock(int blockFd, const char *blockedPath); +/* Transport layer big buffer support functions. */ +void DnD_TransportBufInit(DnDTransportBuffer *buf, + uint8 *msg, + size_t msgSize, + uint32 seqNum); +void DnD_TransportBufReset(DnDTransportBuffer *buf); +size_t DnD_TransportBufGetPacket(DnDTransportBuffer *buf, + DnDTransportPacketHeader **packet); +Bool DnD_TransportBufAppendPacket(DnDTransportBuffer *buf, + DnDTransportPacketHeader *packet, + size_t packetSize); +size_t DnD_TransportMsgToPacket(uint8 *msg, + size_t msgSize, + uint32 seqNum, + DnDTransportPacketHeader **packet); +size_t DnD_TransportReqPacket(DnDTransportBuffer *buf, + DnDTransportPacketHeader **packet); + #endif // _DND_H_ diff --git a/open-vm-tools/lib/include/dndInt.h b/open-vm-tools/lib/include/dndInt.h index aa6ed81bb..f24af6029 100644 --- a/open-vm-tools/lib/include/dndInt.h +++ b/open-vm-tools/lib/include/dndInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,12 +28,17 @@ #include "vm_basic_types.h" #include "unicodeTypes.h" +typedef struct { + uint8 *pos; + size_t unreadLen; +} BufRead; + Bool DnDDataContainsIllegalCharacters(const char *data, const size_t dataSize, const char *illegalChars); -Bool DnDPrependFileRoot(const char *fileRoot, - const char delimiter, +Bool DnDPrependFileRoot(ConstUnicode fileRoot, + char delimiter, char **src, size_t *srcSize); @@ -45,4 +50,8 @@ Bool DnDStagingDirectoryUsable(ConstUnicode pathName); Bool DnDSetPermissionsOnStagingDir(ConstUnicode pathName); +Bool DnDReadBuffer(BufRead *b, void *out, size_t len); + +Bool DnDSlideBuffer(BufRead *b, size_t len); + #endif /* __DND_INT_H__ */ diff --git a/open-vm-tools/lib/include/dynarray.h b/open-vm-tools/lib/include/dynarray.h new file mode 100644 index 000000000..41e536175 --- /dev/null +++ b/open-vm-tools/lib/include/dynarray.h @@ -0,0 +1,186 @@ +/********************************************************* + * 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. + * + *********************************************************/ + +/* + * dynarray.h -- + * + * Dynamic array of objects. + * + * Use a DynArray to hold a dynamically resizable array + * of objects with a fixed width. + */ + +#ifndef _DYNARRAY_H_ +#define _DYNARRAY_H_ + +#include "dynbuf.h" + +typedef struct DynArray { + DynBuf buf; + size_t width; +} DynArray; + +/* + * The SVGA drivers require the __cdecl calling convention. + * The qsort comparison function is compiled with the __stdecl + * convention by default, so if we are compiling SVGA (which defines + * STD_CALL) we need to explicitly declare the function with __cdecl. + */ +#if defined(STD_CALL) +#define CDECLCONV __cdecl +#else +#define CDECLCONV +#endif + +typedef int (CDECLCONV *DynArrayCmp)(const void *, const void *); + +Bool +DynArray_Init(DynArray *a, unsigned int count, size_t width); + +void +DynArray_Destroy(DynArray *a); + +void * +DynArray_AddressOf(const DynArray *a, unsigned int i); + +unsigned int +DynArray_Count(const DynArray *a); + +Bool +DynArray_SetCount(DynArray *a, unsigned int c); + +unsigned int +DynArray_AllocCount(const DynArray *a); + +Bool +DynArray_Trim(DynArray *a); + +void +DynArray_QSort(DynArray *a, DynArrayCmp compare); + +Bool +DynArray_Copy(DynArray *src, DynArray *dest); + +/* + * Use the following macros to define your own DynArray type to + * make its usage less cumbersome. You also get type-checking + * for free, as demonstrated by this example: + * + * Assume: + * + * typedef struct { int n, d; } Fraction; + * typedef struct { float r, i; } Complex; + * + * Without DEFINE_DYNARRAY_TYPE: + * + * DynArray a1, a2; + * DynArray_Init(&a1, 4, sizeof(Fraction)); + * DynArray_Init(&a2, 16, sizeof(Complex)); + * + * Fraction *f2 = (Fraction *)DynArray_AddressOf(&a2, 3); // Runtime Error + * + * + * With DEFINE_DYNARRAY_TYPE: + * + * DEFINE_DYNARRAY_TYPE(Fraction) + * DEFINE_DYNARRAY_TYPE(Complex) + * FractionArray a1; + * ComplexArray a2; + * FractionArray_Init(&a1, 4); + * ComplexArray_Init(&a2, 16); + * + * Fraction *f2 = FractionArray_AddressOf(&a2, 3); // Compile Error + * + * Yes, it's a poor man's template (but better than nothing). + * + */ + +#define DEFINE_DYNARRAY_TYPE(T) DEFINE_DYNARRAY_NAMED_TYPE(T, T) + +#define DEFINE_DYNARRAY_NAMED_TYPE(T, TYPE) \ + \ + typedef int (CDECLCONV *DynArray##T##Cmp)(const TYPE *, \ + const TYPE *); \ + typedef DynArray T##Array; \ + \ + static INLINE void \ + T##Array_Init(T##Array *a, unsigned int count) \ + { \ + DynArray_Init((DynArray *)a, count, sizeof(TYPE)); \ + } \ + \ + static INLINE void \ + T##Array_Destroy(T##Array *a) \ + { \ + DynArray_Destroy((DynArray *)a); \ + } \ + \ + static INLINE TYPE* \ + T##Array_AddressOf(T##Array *a, unsigned int i) \ + { \ + return (TYPE*)DynArray_AddressOf((DynArray *)a, i); \ + } \ + \ + static INLINE unsigned int \ + T##Array_Count(T##Array *a) \ + { \ + return DynArray_Count((DynArray *)a); \ + } \ + \ + static INLINE Bool \ + T##Array_SetCount(T##Array *a, unsigned int c) \ + { \ + return DynArray_SetCount((DynArray *)a, c); \ + } \ + \ + static INLINE Bool \ + T##Array_Push(T##Array *a, TYPE val) \ + { \ + unsigned int count = T##Array_Count(a); \ + if (!T##Array_SetCount(a, count + 1)) { \ + return FALSE; \ + } \ + *T##Array_AddressOf(a, count) = val; \ + return TRUE; \ + } \ + \ + static INLINE unsigned int \ + T##Array_AllocCount(T##Array *a) \ + { \ + return DynArray_AllocCount((DynArray *)a); \ + } \ + \ + static INLINE Bool \ + T##Array_Trim(T##Array *a) \ + { \ + return DynArray_Trim((DynArray *)a); \ + } \ + static INLINE void \ + T##Array_QSort(T##Array *a, DynArray##T##Cmp compare) \ + { \ + DynArray_QSort((DynArray *)a, (DynArrayCmp)compare); \ + } \ + static INLINE Bool \ + T##Array_Copy(T##Array *src, T##Array *dest) \ + { \ + return DynArray_Copy((DynArray *)src, (DynArray *)dest); \ + } +/* Define DynArray of DynBuf. */ +DEFINE_DYNARRAY_TYPE(DynBuf) + +#endif /* _DYNARRAY_H_ */ diff --git a/open-vm-tools/lib/include/dynbuf.h b/open-vm-tools/lib/include/dynbuf.h index c24bab2e2..ebe0b7b1a 100644 --- a/open-vm-tools/lib/include/dynbuf.h +++ b/open-vm-tools/lib/include/dynbuf.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/embed_version.h b/open-vm-tools/lib/include/embed_version.h index e69df5f3e..e61983f22 100644 --- a/open-vm-tools/lib/include/embed_version.h +++ b/open-vm-tools/lib/include/embed_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/err.h b/open-vm-tools/lib/include/err.h index 80b5e2c63..f16f2c038 100644 --- a/open-vm-tools/lib/include/err.h +++ b/open-vm-tools/lib/include/err.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/escBitvector.h b/open-vm-tools/lib/include/escBitvector.h index beeca272b..ba52e224a 100644 --- a/open-vm-tools/lib/include/escBitvector.h +++ b/open-vm-tools/lib/include/escBitvector.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/escape.h b/open-vm-tools/lib/include/escape.h index 67cf4544d..cb4a7d8e7 100644 --- a/open-vm-tools/lib/include/escape.h +++ b/open-vm-tools/lib/include/escape.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/eventManager.h b/open-vm-tools/lib/include/eventManager.h index c5ab69ebd..5f726f8d6 100644 --- a/open-vm-tools/lib/include/eventManager.h +++ b/open-vm-tools/lib/include/eventManager.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/file.h b/open-vm-tools/lib/include/file.h index be6599e26..775e93bb8 100644 --- a/open-vm-tools/lib/include/file.h +++ b/open-vm-tools/lib/include/file.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -88,6 +88,8 @@ EXTERN void File_GetPathName(ConstUnicode fullPath, Unicode *pathName, Unicode *base); +EXTERN Unicode File_StripSlashes(ConstUnicode path); + EXTERN Bool File_CreateDirectory(ConstUnicode pathName); EXTERN Bool File_EnsureDirectory(ConstUnicode pathName); diff --git a/open-vm-tools/lib/include/fileIO.h b/open-vm-tools/lib/include/fileIO.h index 6bfbd293a..4fd661ff8 100644 --- a/open-vm-tools/lib/include/fileIO.h +++ b/open-vm-tools/lib/include/fileIO.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -42,6 +42,10 @@ #include #include +#if !defined(_WIN32) +#include +#include +#endif #include "vm_basic_types.h" #include "unicodeTypes.h" @@ -354,49 +358,18 @@ const char *FileIO_ErrorEnglish(FileIOResult status); void FileIO_OptionalSafeInitialize(void); -int FileIO_PosixCreat(ConstUnicode pathName, - int mode); - -int FileIO_PosixOpen(ConstUnicode pathName, - int flags, - int mode); - -FILE *FileIO_PosixFopen(ConstUnicode pathName, - const char *mode); - #if defined(_WIN32) FileIODescriptor FileIO_CreateFDWin32(HANDLE win32, DWORD access, DWORD attributes); - -struct _stat; -typedef struct _stat PosixStatStruct; - #else FileIODescriptor FileIO_CreateFDPosix(int posix, int flags); int FileIO_PrivilegedPosixOpen(ConstUnicode pathName, int flags); - -int FileIO_PosixChmod(ConstUnicode pathName, - uint32 mode); - -struct stat; -typedef struct stat PosixStatStruct; - -int FileIO_PosixLstat(ConstUnicode pathName, - PosixStatStruct *statbuf); - -struct statfs; - -int FileIO_PosixStatfs(ConstUnicode pathName, - struct statfs *statfsbuf); #endif -int FileIO_PosixStat(ConstUnicode pathName, - PosixStatStruct *statbuf); - /* *------------------------------------------------------------------------- @@ -431,6 +404,7 @@ Bool FileIO_IsSuccess(FileIOResult res); #endif #if defined(__APPLE__) +EXTERN Bool FileIO_ResetExcludedFromTimeMachine(char const *pathName); EXTERN Bool FileIO_SetExcludedFromTimeMachine(char const *pathName, Bool isExcluded); #endif diff --git a/open-vm-tools/lib/include/fileInt.h b/open-vm-tools/lib/include/fileInt.h index cbaafeea9..90df84e25 100644 --- a/open-vm-tools/lib/include/fileInt.h +++ b/open-vm-tools/lib/include/fileInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,6 +27,8 @@ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" +#include "posix.h" +#include "fileIO.h" #include "fileLock.h" #include "unicodeTypes.h" @@ -71,7 +73,9 @@ #define FILE_TYPE_BLOCKDEVICE 2 #define FILE_TYPE_CHARDEVICE 3 #define FILE_TYPE_SYMLINK 4 -#define FILE_TYPE_UNCERTAIN 5 +#define FILE_TYPE_FIFO 5 +#define FILE_TYPE_SOCKET 6 +#define FILE_TYPE_UNCERTAIN 7 typedef struct FileData { uint64 fileAccessTime; @@ -188,4 +192,12 @@ EXTERN Bool FileLockValidOwner(const char *executionID, EXTERN Bool FileLockValidName(ConstUnicode fileName); +#if defined(__APPLE__) +EXTERN int PosixFileOpener(ConstUnicode pathName, + int flags, + mode_t mode); +#else +#define PosixFileOpener(a, b, c) Posix_Open(a, b, c); +#endif + #endif diff --git a/open-vm-tools/lib/include/fileLock.h b/open-vm-tools/lib/include/fileLock.h index 068396e29..4f9bb5298 100644 --- a/open-vm-tools/lib/include/fileLock.h +++ b/open-vm-tools/lib/include/fileLock.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/file_extensions.h b/open-vm-tools/lib/include/file_extensions.h index 1b79f5dcb..31dc578b7 100644 --- a/open-vm-tools/lib/include/file_extensions.h +++ b/open-vm-tools/lib/include/file_extensions.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -79,6 +79,7 @@ #define VIRTUALPC_EXTENSION "vmc" #define SYMANTEC_LIVESTATE_EXTENSION "sv2i" #define STORAGECRAFT_SHADOWSTOR_EXTENSION "spf" +#define ACRONIS_EXTENSION "tib" // "xvm" // VMware console configuration file /* diff --git a/open-vm-tools/lib/include/foundryThreads.h b/open-vm-tools/lib/include/foundryThreads.h index 5ab5bd8b7..7ad190cbd 100644 --- a/open-vm-tools/lib/include/foundryThreads.h +++ b/open-vm-tools/lib/include/foundryThreads.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/ghIntegration.h b/open-vm-tools/lib/include/ghIntegration.h index 1bde0943c..e28459db2 100644 --- a/open-vm-tools/lib/include/ghIntegration.h +++ b/open-vm-tools/lib/include/ghIntegration.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,50 +27,31 @@ #include "dbllnklst.h" -typedef -#include "vmware_pack_begin.h" -struct _UnityIconEntry { - uint32 width; - uint32 height; - uint32 dataLength; - unsigned char *dataRGBA; -} -#include "vmware_pack_end.h" -UnityIconEntry; - -typedef -#include "vmware_pack_begin.h" -struct _UnityIconInfo { - uint32 numEntries; - UnityIconEntry *iconList; -} -#include "vmware_pack_end.h" -UnityIconInfo; DblLnkLst_Links launchMenu; /* - * If other libraries want to use dynamic adding/removing of event monitoring - * to VMWareUserLoop then following definitions need to move to a header - * file, which is shared by all the libraries. To make such a move simple, following + * If other libraries want to use dynamic adding/removing of event monitoring + * to VMWareUserLoop then following definitions need to move to a header + * file, which is shared by all the libraries. To make such a move simple, following * definitions do not have GHI prefix, rather it has VMU (aka VMwareUser) - * prefix. - */ + * prefix. + */ #ifdef _WIN32 typedef HANDLE VMU_EVENT; -#else +#else typedef int VMU_EVENT; #endif typedef enum VmuCallbackAction { - VMU_CALLBACK_ACTION_SUCCESS, - VMU_CALLBACK_ACTION_ABORT + VMU_CALLBACK_ACTION_SUCCESS, + VMU_CALLBACK_ACTION_ABORT } VmuCallbackAction; -typedef VmuCallbackAction VMU_EventHandler(void *ctx, VMU_EVENT event); +typedef VmuCallbackAction VMU_EventHandler(void *ctx, VMU_EVENT event); typedef enum VmuControllerAction { - VMU_CONTROLLER_CB_ADD_EVENT = 1, + VMU_CONTROLLER_CB_ADD_EVENT = 1, VMU_CONTROLLER_CB_REMOVE_EVENT } VmuControllerAction; typedef Bool (VMU_ControllerCB)(void *ctx, @@ -83,6 +64,8 @@ Bool GHI_IsSupported(void); void GHI_Init(VMU_ControllerCB *vmuControllerCB, void *ctx); void GHI_Cleanup(void); void GHI_InitBackdoor(struct RpcIn *rpcIn); +void GHI_RegisterCaps(void); +void GHI_UnregisterCaps(void); #endif diff --git a/open-vm-tools/lib/include/guestApp.h b/open-vm-tools/lib/include/guestApp.h index 948c10561..a5b5ea86a 100644 --- a/open-vm-tools/lib/include/guestApp.h +++ b/open-vm-tools/lib/include/guestApp.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,7 +34,7 @@ extern "C" { # include "vm_basic_types.h" # include "removable_device.h" -#define ALLOW_TOOLS_IN_FOREIGN_VM 1 +//#define ALLOW_TOOLS_IN_FOREIGN_VM 0 extern Bool runningInForeignVM; typedef struct GuestApp_Dict GuestApp_Dict; @@ -106,10 +106,10 @@ GuestApp_Log(const char *s); // IN uint32 GuestApp_GetCurrentVersion(void); -const char * +char * GuestApp_GetInstallPath(void); -const char * +char * GuestApp_GetConfPath(void); char * diff --git a/open-vm-tools/lib/include/guestInfo.h b/open-vm-tools/lib/include/guestInfo.h index 03ced3435..d401348de 100644 --- a/open-vm-tools/lib/include/guestInfo.h +++ b/open-vm-tools/lib/include/guestInfo.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,7 +39,9 @@ #define MAX_IPS 8 // Max number of IP addresses for a single NIC #define MAC_ADDR_SIZE 19 #define IP_ADDR_SIZE 16 +#define IP_ADDR_SIZE_V2 48 // 40 bytes for address + 3 for netmask + 5 padding #define PARTITION_NAME_SIZE MAX_VALUE_LEN +#define GUESTINFO_TIME_INTERVAL_MSEC 3000 /* time interval in msec */ typedef enum { INFO_ERROR, /* Zero is unused so that errors in atoi can be caught. */ @@ -50,9 +52,15 @@ typedef enum { INFO_OS_NAME_FULL, INFO_OS_NAME, INFO_UPTIME, + INFO_MEMORY, INFO_MAX } GuestInfoType; +typedef enum { + INFO_IP_ADDRESS_FAMILY_IPV4, + INFO_IP_ADDRESS_FAMILY_IPV6 +} GuestInfoIPAddressFamilyType; + /* * For backward compatibility's sake over wire (from Tools to VMX), new fields * in this struct must be added at the end. THis is the part that goes over wire. @@ -65,8 +73,8 @@ typedef struct VmIpAddressEntryProtocol { uint32 dhcpEnabled; /* This is a boolean. However we need it to be */ /* multiple of 4 bytes, in order to be the same */ /* on different hardware architecture */ - char ipAddress[IP_ADDR_SIZE]; - char subnetMask[IP_ADDR_SIZE]; + char ipAddress[IP_ADDR_SIZE_V2]; + char subnetMask[IP_ADDR_SIZE_V2]; uint32 totalIpEntrySizeOnWire; } VmIpAddressEntryProtocol; @@ -138,13 +146,42 @@ typedef struct _DiskInfo { PPartitionEntry partitionList; } DiskInfo, *PDiskInfo; - -NicEntry *NicInfo_AddNicEntry(NicInfo *nicInfo, const char macAddress[MAC_ADDR_SIZE]); -VmIpAddressEntry *NicEntry_AddIpAddress(NicEntry *nicEntry, - const char *ipAddr, - const uint32 af_type); - -NicEntry *NicInfo_FindMacAddress(NicInfo *nicInfo, const char *macAddress); +typedef +#include "vmware_pack_begin.h" +struct MemInfo { + uint32 version; /* MemInfo structure version. */ + uint32 flags; /* Indicates which stats are valid. */ + uint64 memTotal; /* Total physical memory in Kb. */ + uint64 memFree; /* Physical memory available in Kb. */ + uint64 memBuff; /* Physical memory used as buffer cache in Kb. */ + uint64 memCache; /* Physical memory used as cache in Kb. */ + uint64 memActive; /* Physical memory actively in use in Kb (working set) */ + uint64 memInactive; /* Physical memory inactive in Kb (cold pages) */ + uint64 swapInRate; /* Memory swapped out in Kb / sec. */ + uint64 swapOutRate; /* Memory swapped out in Kb / sec. */ + uint64 ioInRate; /* Amount of I/O in in blocks / sec. */ + uint64 ioOutRate; /* Amount of I/O out in blocks / sec. */ + uint64 hugePagesTotal; /* Total number of huge pages. */ + uint64 hugePagesFree; /* Available number of huge pages. */ + uint64 memPinned; /* Unreclaimable physical memory in 4K page size. */ +} +#include "vmware_pack_end.h" +MemInfo; + +/* Flags for MemInfo. */ +#define MEMINFO_MEMTOTAL (1 << 0) +#define MEMINFO_MEMFREE (1 << 1) +#define MEMINFO_MEMBUFF (1 << 2) +#define MEMINFO_MEMCACHE (1 << 3) +#define MEMINFO_MEMACTIVE (1 << 4) +#define MEMINFO_MEMINACTIVE (1 << 5) +#define MEMINFO_SWAPINRATE (1 << 6) +#define MEMINFO_SWAPOUTRATE (1 << 7) +#define MEMINFO_IOINRATE (1 << 8) +#define MEMINFO_IOOUTRATE (1 << 9) +#define MEMINFO_HUGEPAGESTOTAL (1 << 10) +#define MEMINFO_HUGEPAGESFREE (1 << 11) +#define MEMINFO_MEMPINNED (1 << 12) /* *---------------------------------------------------------------------- diff --git a/open-vm-tools/lib/include/guestInfoInt.h b/open-vm-tools/lib/include/guestInfoInt.h index 7ddbd303f..ef8949005 100644 --- a/open-vm-tools/lib/include/guestInfoInt.h +++ b/open-vm-tools/lib/include/guestInfoInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,5 +37,16 @@ Bool GuestInfoGetDiskInfo(PDiskInfo di); Bool GuestInfoGetOSName(unsigned int outBufFullLen, unsigned int outBufLen, char *osNameFull, char *osName); int GuestInfo_GetSystemBitness(void); +Bool GuestInfo_PerfMon(struct MemInfo *vmStats); + +NicEntry *GuestInfoAddNicEntry(NicInfo *nicInfo, const char macAddress[MAC_ADDR_SIZE]); +VmIpAddressEntry *GuestInfoAddIpAddress(NicEntry *nicEntry, + const char *ipAddr, + const uint32 af_type); +void GuestInfoAddSubnetMask(VmIpAddressEntry *ipAddressEntry, + const uint32 subnetMaskBits); + +NicEntry *GuestInfoFindMacAddress(NicInfo *nicInfo, const char *macAddress); + #endif diff --git a/open-vm-tools/lib/include/guestInfoServer.h b/open-vm-tools/lib/include/guestInfoServer.h index 6e9082000..88447dc2d 100644 --- a/open-vm-tools/lib/include/guestInfoServer.h +++ b/open-vm-tools/lib/include/guestInfoServer.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/guest_msg_def.h b/open-vm-tools/lib/include/guest_msg_def.h index 009fa6e37..c855b1862 100644 --- a/open-vm-tools/lib/include/guest_msg_def.h +++ b/open-vm-tools/lib/include/guest_msg_def.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/guest_os.h b/open-vm-tools/lib/include/guest_os.h index ceb96afb9..5758ab943 100644 --- a/open-vm-tools/lib/include/guest_os.h +++ b/open-vm-tools/lib/include/guest_os.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hashTable.h b/open-vm-tools/lib/include/hashTable.h index 692d02302..715278bb7 100644 --- a/open-vm-tools/lib/include/hashTable.h +++ b/open-vm-tools/lib/include/hashTable.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,6 +29,8 @@ #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" +#include "vm_atomic.h" + typedef struct HashTable HashTable; typedef void (*HashTableFreeEntryFn)(void *clientData); @@ -39,9 +41,22 @@ typedef int (*HashTableForEachCallback)(const char *key, void *value, #define HASH_ISTRING_KEY 1 // case-insensitive string key #define HASH_INT_KEY 2 // uintptr_t or pointer key +/* + * The atmic bit is ored into the type field. + * Atomic hash tables only support insert and lookup. + */ + +#define HASH_FLAG_MASK (~7) +#define HASH_FLAG_ATOMIC 0x08 // thread-safe hash table +#define HASH_FLAG_COPYKEY 0x10 // copy string key + HashTable * HashTable_Alloc(uint32 numEntries, int keyType, HashTableFreeEntryFn fn); +HashTable * +HashTable_AllocOnce(Atomic_Ptr *var, uint32 numEntries, int keyType, + HashTableFreeEntryFn fn); + void HashTable_Free(HashTable *hashTable); @@ -55,6 +70,16 @@ HashTable_Lookup(HashTable *hashTable, const char *keyStr, void **clientData); +void * +HashTable_LookupOrInsert(HashTable *hashTable, + const char *keyStr, + void *clientData); + +Bool +HashTable_ReplaceOrInsert(HashTable *hashTable, + const char *keyStr, + void *clientData); + Bool HashTable_Delete(HashTable *hashTable, const char *keyStr); diff --git a/open-vm-tools/lib/include/hgfs.h b/open-vm-tools/lib/include/hgfs.h index c1cdb879d..cd8e177ac 100644 --- a/open-vm-tools/lib/include/hgfs.h +++ b/open-vm-tools/lib/include/hgfs.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -175,41 +175,6 @@ typedef enum { #define HGFS_SYNC_REQREP_CLIENT_CMD HGFS_SYNC_REQREP_CMD " " #define HGFS_SYNC_REQREP_CLIENT_CMD_LEN (sizeof HGFS_SYNC_REQREP_CLIENT_CMD - 1) -/* - * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be - * asynchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and asynchronously returned from the - * guest. - * - * In short, an endpoint sending this command is sending a request whose reply - * should be returned asynchronously. - */ -#define HGFS_ASYNC_REQUEST_CMD "g" -#define HGFS_ASYNC_REQUEST_CLIENT_CMD HGFS_ASYNC_REQUEST_CMD " " -#define HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REQUEST_CLIENT_CMD - 1) - -/* - * An endpoint sending this command is sending an asynchronous HGFS reply to a - * request sent by the HGFS_ASYNC_REQUEST command. - */ -#define HGFS_ASYNC_REPLY_CMD "h" -#define HGFS_ASYNC_REPLY_CLIENT_CMD HGFS_ASYNC_REPLY_CMD " " -#define HGFS_ASYNC_REPLY_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REPLY_CLIENT_CMD - 1) - -/* - * Ensuring that all commands are the same length eases the implementation of - * HGFS client code. - */ -MY_ASSERTS(HGFS_CMD_LENGTHS, - ASSERT_ON_COMPILE(HGFS_SYNC_REQREP_CLIENT_CMD_LEN == - HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN); - ASSERT_ON_COMPILE(HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN == - HGFS_ASYNC_REPLY_CLIENT_CMD_LEN); -) - /* * This is just for the sake of macro naming. Since we are guaranteed * equal command lengths, defining command length via a generalized macro name diff --git a/open-vm-tools/lib/include/hgfsBd.h b/open-vm-tools/lib/include/hgfsBd.h index 84dc6367c..5a94d6c13 100644 --- a/open-vm-tools/lib/include/hgfsBd.h +++ b/open-vm-tools/lib/include/hgfsBd.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hgfsDevLinux.h b/open-vm-tools/lib/include/hgfsDevLinux.h index 50b93cdf9..326c45942 100644 --- a/open-vm-tools/lib/include/hgfsDevLinux.h +++ b/open-vm-tools/lib/include/hgfsDevLinux.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hgfsProto.h b/open-vm-tools/lib/include/hgfsProto.h index b75c87f32..861dd9192 100644 --- a/open-vm-tools/lib/include/hgfsProto.h +++ b/open-vm-tools/lib/include/hgfsProto.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -79,14 +79,39 @@ typedef enum { HGFS_OP_CREATE_SYMLINK, /* Create a symlink */ HGFS_OP_SERVER_LOCK_CHANGE, /* Change the oplock on a file */ HGFS_OP_CREATE_DIR_V2, /* Create a directory */ - HGFS_OP_DELETE_FILE_V2, /* Delete a file */ - HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ - HGFS_OP_RENAME_V2, /* Rename a file or directory */ + HGFS_OP_DELETE_FILE_V2, /* Delete a file */ + HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ + HGFS_OP_RENAME_V2, /* Rename a file or directory */ - HGFS_OP_MAX, /* Dummy op, must be last in enum */ + /* + * Operations for version 3. + */ + + HGFS_OP_OPEN_V3, /* Open file */ + HGFS_OP_READ_V3, /* Read from file */ + HGFS_OP_WRITE_V3, /* Write to file */ + HGFS_OP_CLOSE_V3, /* Close file */ + HGFS_OP_SEARCH_OPEN_V3, /* Start new search */ + HGFS_OP_SEARCH_READ_V3, /* Start new search */ + HGFS_OP_SEARCH_CLOSE_V3, /* End a search */ + HGFS_OP_GETATTR_V3, /* Get file attributes */ + HGFS_OP_SETATTR_V3, /* Set file attributes */ + HGFS_OP_CREATE_DIR_V3, /* Create new directory */ + HGFS_OP_DELETE_FILE_V3, /* Delete a file */ + HGFS_OP_DELETE_DIR_V3, /* Delete a directory */ + HGFS_OP_RENAME_V3, /* Rename a file or directory */ + HGFS_OP_QUERY_VOLUME_INFO_V3, /* Query volume information */ + HGFS_OP_CREATE_SYMLINK_V3, /* Create a symlink */ + HGFS_OP_SERVER_LOCK_CHANGE_V3, /* Change the oplock on a file */ + + HGFS_OP_MAX, /* Dummy op, must be last in enum */ } HgfsOp; +/* HGFS protocol versions. */ +#define HGFS_VERSION_OLD (1 << 0) +#define HGFS_VERSION_3 (1 << 1) + /* * File types, used in HgfsAttr. We support regular files, * directories, and symlinks. @@ -411,7 +436,7 @@ HgfsAttrV2; * Precomposed (normal form C) versus Decomposed (normal form D) * ------------------------------------------------------------- * Certain Unicode characters can be encoded in more than one way. - * For example, an Á (A acute) can be encoded either precomposed, + * For example, an (A acute) can be encoded either precomposed, * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, * as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). * Precomposed characters are more common in the Windows world, @@ -430,6 +455,33 @@ struct HgfsFileName { HgfsFileName; +/* + * HgfsFileNameV3 - new header to incorporate case-sensitivity flags along with + * Hgfs file handle. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsFileNameV3 { + uint32 length; /* Does NOT include terminating NUL */ + uint32 flags; /* Flags describe below. */ + HgfsHandle fid; + char name[1]; +} +#include "vmware_pack_end.h" +HgfsFileNameV3; + + +/* + * HgfsFileNameV3 flags. Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ +#define HGFS_FILE_NAME_USE_FILE_DESC (1 << 0) /* Other flags ignored if set. */ +#define HGFS_FILE_NAME_CASE_SENSITIVE (1 << 1) +#define HGFS_FILE_NAME_CASE_INSENSITIVE (1 << 2) +#define HGFS_FILE_NAME_DEFAULT_CASE (1 << 3) /* Default host case. */ + + /* * Request/reply structs. These are the first members of all * operation request and reply messages, respectively. @@ -500,6 +552,31 @@ struct HgfsRequestOpenV2 { HgfsRequestOpenV2; +/* Version 3 of HgfsRequestOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestOpenV3 { + HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ + HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ + HgfsOpenFlags flags; /* Which flags to open the file with */ + HgfsPermissions specialPerms; /* Desired 'special' permissions for file creation */ + HgfsPermissions ownerPerms; /* Desired 'owner' permissions for file creation */ + HgfsPermissions groupPerms; /* Desired 'group' permissions for file creation */ + HgfsPermissions otherPerms; /* Desired 'other' permissions for file creation */ + HgfsAttrFlags attr; /* Attributes, if any, for file creation */ + uint64 allocationSize; /* How much space to pre-allocate during creation */ + uint32 desiredAccess; /* Extended support for windows access modes */ + uint32 shareAccess; /* Windows only, share access modes */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + uint64 reserved1; /* Reserved for future use */ + uint64 reserved2; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV3; + + /* Deprecated */ typedef @@ -525,6 +602,21 @@ struct HgfsReplyOpenV2 { HgfsReplyOpenV2; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyOpenV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestRead { @@ -536,6 +628,7 @@ struct HgfsRequestRead { #include "vmware_pack_end.h" HgfsRequestRead; +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -548,6 +641,32 @@ struct HgfsReplyRead { HgfsReplyRead; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestReadV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestReadV3; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyReadV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsReplyReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestWrite { @@ -562,6 +681,8 @@ struct HgfsRequestWrite { HgfsRequestWrite; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyWrite { @@ -571,6 +692,31 @@ struct HgfsReplyWrite { #include "vmware_pack_end.h" HgfsReplyWrite; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestWriteV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsRequestWriteV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyWriteV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyWriteV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -582,6 +728,8 @@ struct HgfsRequestClose { HgfsRequestClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyClose { @@ -591,6 +739,27 @@ struct HgfsReplyClose { HgfsReplyClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCloseV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyCloseV3 { + uint64 reserved; +} +#include "vmware_pack_end.h" +HgfsReplyCloseV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestSearchOpen { @@ -601,6 +770,18 @@ struct HgfsRequestSearchOpen { HgfsRequestSearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchOpenV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 dirName; +} +#include "vmware_pack_end.h" +HgfsRequestSearchOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchOpen { @@ -611,6 +792,16 @@ struct HgfsReplySearchOpen { HgfsReplySearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchOpenV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchOpenV3; + + /* Deprecated */ typedef @@ -636,6 +827,17 @@ struct HgfsRequestSearchReadV2 { #include "vmware_pack_end.h" HgfsRequestSearchReadV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchReadV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint32 offset; /* The first result is offset 0 */ + uint32 flags; /* Reserved for reading multiple directory entries. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchReadV3; + /* Deprecated */ @@ -655,21 +857,48 @@ HgfsReplySearchRead; typedef #include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { - HgfsReply header; +struct HgfsReplySearchReadV2 { + HgfsReply header; HgfsAttrV2 attr; - + /* * fileName.length = 0 means "no entry at this offset" * If the file is a symlink (as specified in attr) * this name is the name of the symlink, not the target. - */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" + */ + HgfsFileName fileName; +} +#include "vmware_pack_end.h" HgfsReplySearchReadV2; +/* Directory entry structure. */ + +typedef struct HgfsDirEntry { + uint32 nextEntry; + HgfsAttrV2 attr; + + /* + * fileName.length = 0 means "no entry at this offset" + * If the file is a symlink (as specified in attr) + * this name is the name of the symlink, not the target. + */ + HgfsFileNameV3 fileName; +} HgfsDirEntry; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchReadV3 { + uint64 count; /* Number of directory entries. */ + uint64 reserved; /* Reserved for future use. */ + char payload[1]; /* Directory entries. */ +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestSearchClose { @@ -680,6 +909,8 @@ struct HgfsRequestSearchClose { HgfsRequestSearchClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchClose { @@ -689,6 +920,25 @@ struct HgfsReplySearchClose { HgfsReplySearchClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchCloseV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchCloseV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchCloseV3; + + /* Deprecated */ typedef @@ -715,6 +965,18 @@ struct HgfsRequestGetattrV2 { HgfsRequestGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestGetattrV3 { + HgfsAttrHint hints; /* Flags for file handle valid. */ + HgfsHandle file; /* Opaque file ID used by the server. */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestGetattrV3; + + /* Deprecated */ typedef @@ -748,6 +1010,25 @@ struct HgfsReplyGetattrV2 { HgfsReplyGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyGetattrV3 { + HgfsAttrV2 attr; + + /* + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should + * be ignored. + * + * This filename is in "CPNameLite" format. See CPNameLite.c for details. + */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkTarget; +} +#include "vmware_pack_end.h" +HgfsReplyGetattrV3; + + /* Deprecated */ typedef @@ -777,6 +1058,18 @@ struct HgfsRequestSetattrV2 { HgfsRequestSetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSetattrV3 { + HgfsAttrHint hints; + HgfsAttrV2 attr; + HgfsHandle file; /* Opaque file ID used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestSetattrV3; + /* Deprecated */ typedef @@ -798,6 +1091,27 @@ struct HgfsReplySetattrV2 { #include "vmware_pack_end.h" HgfsReplySetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySetattrV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySetattrV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDir { + HgfsRequest header; + HgfsPermissions permissions; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDir; + /* Version 2 of HgfsRequestCreateDir */ @@ -816,17 +1130,32 @@ struct HgfsRequestCreateDirV2 { HgfsRequestCreateDirV2; +/* Version 3 of HgfsRequestCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDirV3 { + HgfsCreateDirValid mask; + HgfsPermissions specialPerms; + HgfsPermissions ownerPerms; + HgfsPermissions groupPerms; + HgfsPermissions otherPerms; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDirV3; + + /* Deprecated */ typedef #include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { - HgfsRequest header; - HgfsPermissions permissions; - HgfsFileName fileName; +struct HgfsReplyCreateDir { + HgfsReply header; } #include "vmware_pack_end.h" -HgfsRequestCreateDir; +HgfsReplyCreateDir; /* Version 2 of HgfsReplyCreateDir */ @@ -840,17 +1169,19 @@ struct HgfsReplyCreateDirV2 { HgfsReplyCreateDirV2; -/* Deprecated */ +/* Version 3 of HgfsReplyCreateDir */ typedef #include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { - HgfsReply header; +struct HgfsReplyCreateDirV3 { + uint64 reserved; /* Reserved for future use */ } #include "vmware_pack_end.h" -HgfsReplyCreateDir; +HgfsReplyCreateDirV3; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDelete { @@ -860,6 +1191,9 @@ struct HgfsRequestDelete { #include "vmware_pack_end.h" HgfsRequestDelete; + +/* Version 2 of HgfsReplyCreateDir */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDeleteV2 { @@ -871,6 +1205,23 @@ struct HgfsRequestDeleteV2 { #include "vmware_pack_end.h" HgfsRequestDeleteV2; + +/* Version 3 of HgfsReplyCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestDeleteV3 { + HgfsDeleteHint hints; + HgfsHandle file; /* Opaque file ID used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ +} +#include "vmware_pack_end.h" +HgfsRequestDeleteV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyDelete { @@ -889,6 +1240,18 @@ struct HgfsReplyDeleteV2 { #include "vmware_pack_end.h" HgfsReplyDeleteV2; + +/* Version 2 of HgfsReplyDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyDeleteV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyDeleteV3; + + /* * The size of the HgfsFileName struct is variable depending on the * length of the name, so you can't use request->newName to get the @@ -942,6 +1305,31 @@ struct HgfsReplyRenameV2 { HgfsReplyRenameV2; +/* HgfsRequestRename and HgfsReplyRename for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestRenameV3 { + HgfsRenameHint hints; + HgfsHandle srcFile; /* Opaque file ID to "old name" used by the server. */ + HgfsHandle targetFile; /* Opaque file ID to "old name" used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 oldName; + HgfsFileNameV3 newName; +} +#include "vmware_pack_end.h" +HgfsRequestRenameV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyRenameV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyRenameV3; + + typedef #include "vmware_pack_begin.h" struct HgfsRequestQueryVolume { @@ -963,6 +1351,30 @@ struct HgfsReplyQueryVolume { HgfsReplyQueryVolume; +/* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestQueryVolumeV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestQueryVolumeV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyQueryVolumeV3 { + uint64 freeBytes; + uint64 totalBytes; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyQueryVolumeV3; + + + /* New operations for Version 2 */ typedef @@ -1008,4 +1420,28 @@ struct HgfsReplySymlinkCreate { HgfsReplySymlinkCreate; +/* HgfsRequestServerLockChange and HgfsReplyServerLockChange for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkName; + + /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ + HgfsFileNameV3 targetName; +} +#include "vmware_pack_end.h" +HgfsRequestSymlinkCreateV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySymlinkCreateV3; + + #endif /* _HGFS_PROTO_H_ */ diff --git a/open-vm-tools/lib/include/hgfsServer.h b/open-vm-tools/lib/include/hgfsServer.h index 90f9618a5..ef18a4e60 100644 --- a/open-vm-tools/lib/include/hgfsServer.h +++ b/open-vm-tools/lib/include/hgfsServer.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hgfsServerInt.h b/open-vm-tools/lib/include/hgfsServerInt.h index 003dc6fc8..ea0e54351 100644 --- a/open-vm-tools/lib/include/hgfsServerInt.h +++ b/open-vm-tools/lib/include/hgfsServerInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -121,12 +121,8 @@ typedef enum { * to have a single macro for accessing it. */ #ifdef _WIN32 -# ifdef HGFS_OLDER_NT -# define HGFS_DEFAULT_SHARE_ACCESS (FILE_SHARE_READ | FILE_SHARE_WRITE) -# else -# define HGFS_DEFAULT_SHARE_ACCESS (FILE_SHARE_READ | FILE_SHARE_WRITE | \ - FILE_SHARE_DELETE) -# endif // HGFS_OLDER_NT +# define HGFS_DEFAULT_SHARE_ACCESS (FILE_SHARE_READ | FILE_SHARE_WRITE | \ + FILE_SHARE_DELETE) #else # define HGFS_DEFAULT_SHARE_ACCESS 0 #endif // _WIN32 @@ -174,23 +170,26 @@ typedef struct HgfsFileNode { /* Share access to open with (Windows only) */ uint32 shareAccess; - /* TRUE if opened in append mode */ - Bool appendFlag; - /* The server lock that the node currently has. */ HgfsServerLock serverLock; /* File node state on lists */ FileNodeState state; - /* Whether this file was opened in sequential mode. */ - Bool sequentialOpen; - - /* Whether this a shared folder open. */ - Bool sharedFolderOpen; + /* File flags - see below. */ + uint32 flags; } HgfsFileNode; +/* HGFSFileNode flags. */ + +/* TRUE if opened in append mode */ +#define FILE_NODE_APPEND_FL (1 << 0) +/* Whether this file was opened in sequential mode. */ +#define FILE_NODE_SEQUENTIAL_FL (1 << 1) +/* Whether this a shared folder open. */ +#define FILE_NODE_SHARED_FOLDER_OPEN_FL (1 << 2) + /* * This struct represents a file search that a client initiated. * @@ -255,6 +254,7 @@ typedef struct HgfsFileOpenInfo { uint32 cpNameSize; char *cpName; char *utf8Name; + uint32 caseFlags; /* Case-sensitivity flags. */ } HgfsFileOpenInfo; typedef struct HgfsFileAttrInfo { @@ -287,6 +287,7 @@ typedef struct HgfsCreateDirInfo { HgfsPermissions otherPerms; /* Other permissions bits. Ignored by Windows */ uint32 cpNameSize; char *cpName; + uint32 caseFlags; /* Case-sensitivity flags. */ } HgfsCreateDirInfo; @@ -332,11 +333,13 @@ HgfsServerStatFs(const char *pathName, // IN: Path we're interested in uint64 *totalBytes); // OUT: Total bytes on volume HgfsNameStatus -HgfsServerGetAccess(char const *in, // IN: CP filename to check - size_t inSize, // IN: Size of name in - HgfsOpenMode mode, // IN: Requested access mode - char **bufOut, // OUT: File name in local fs - size_t *outLen); // OUT: Length of name out +HgfsServerGetAccess(char *in, // IN: CP filename to check + size_t inSize, // IN: Size of name in + HgfsOpenMode mode, // IN: Requested access mode + uint32 caseFlags, // IN: Case-sensitivity flags + char **bufOut, // OUT: File name in local fs + size_t *outLen, // OUT: Length of name out + HgfsSharedFolder **share); // OUT: Length of name out Bool HgfsServerIsSharedFolderOnly(char const *in, // IN: CP filename to check @@ -454,7 +457,8 @@ HgfsUnpackGetattrRequest(char const *packetIn, // IN: request packet HgfsAttrHint *hints, // OUT: getattr hints char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file); // OUT: file handle + HgfsHandle *file, // OUT: file handle + uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet @@ -462,7 +466,8 @@ HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints - HgfsHandle *file); // OUT: file handle + HgfsHandle *file, // OUT: file handle + uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsPackDeleteReply(char *packetOut, // IN/OUT: outgoing packet @@ -477,7 +482,9 @@ HgfsUnpackRenameRequest(char const *packetIn, // IN: request packet uint32 *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle - HgfsHandle *targetFile); // OUT: target file handle + HgfsHandle *targetFile, // OUT: target file handle + uint32 *oldCaseFlags, // OUT: old case-sensitivity flags + uint32 *newCaseFlags); // OUT: new case-sensitivity flags Bool HgfsPackRenameReply(char *packetOut, // IN/OUT: outgoing packet @@ -511,7 +518,8 @@ HgfsUnpackSetattrRequest(char const *packetIn, // IN: request packet HgfsAttrHint *hints, // OUT: setattr hints char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file); // OUT: server file ID + HgfsHandle *file, // OUT: server file ID + uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsPackSetattrReply(char *packetOut, // IN/OUT: outgoing packet @@ -624,6 +632,11 @@ Bool HgfsServerHasSymlink(const char *fileName, // IN const char *sharePath); // IN +int +HgfsServerConvertCase(HgfsSharedFolder *share, // IN + uint32 caseFlags, // IN + char *fileName); // IN / OUT + /* All oplock-specific functionality is defined here. */ #ifdef HGFS_OPLOCKS void diff --git a/open-vm-tools/lib/include/hgfsServerManager.h b/open-vm-tools/lib/include/hgfsServerManager.h index 57a4820c0..b0e16b7d1 100644 --- a/open-vm-tools/lib/include/hgfsServerManager.h +++ b/open-vm-tools/lib/include/hgfsServerManager.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hgfsServerPolicy.h b/open-vm-tools/lib/include/hgfsServerPolicy.h index 978e911b9..1312802df 100644 --- a/open-vm-tools/lib/include/hgfsServerPolicy.h +++ b/open-vm-tools/lib/include/hgfsServerPolicy.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -64,7 +64,8 @@ HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: size_t nameInLen, // IN: HgfsOpenMode mode, // IN: size_t *sharePathLen, // OUT: - char const **sharePath); // OUT: + char const **sharePath, // OUT: + HgfsSharedFolder **share); // OUT: HgfsNameStatus HgfsServerPolicy_GetShareMode(char const *nameIn, // IN: Share name to retrieve size_t nameInLen, // IN: Length of Share name diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h index 3b94aa76a..0d61eaed4 100644 --- a/open-vm-tools/lib/include/hgfsUtil.h +++ b/open-vm-tools/lib/include/hgfsUtil.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -89,6 +89,7 @@ struct timespec { #endif #define HGFS_NAME_BUFFER_SIZE(request) (HGFS_PACKET_MAX - (sizeof *request - 1)) +#define HGFS_NAME_BUFFER_SIZET(sizet) (HGFS_PACKET_MAX - (sizet) - 1) #ifndef _WIN32 /* @@ -114,3 +115,4 @@ int HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT HgfsStatus HgfsConvertFromInternalStatus(HgfsInternalStatus status); // IN #endif /* _HGFSUTIL_H_ */ + diff --git a/open-vm-tools/lib/include/hgfsVirtualDir.h b/open-vm-tools/lib/include/hgfsVirtualDir.h index 0bf46a2be..23a26b5e6 100644 --- a/open-vm-tools/lib/include/hgfsVirtualDir.h +++ b/open-vm-tools/lib/include/hgfsVirtualDir.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hostType.h b/open-vm-tools/lib/include/hostType.h index 51c9e49a0..93204aaab 100644 --- a/open-vm-tools/lib/include/hostType.h +++ b/open-vm-tools/lib/include/hostType.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/hostinfo.h b/open-vm-tools/lib/include/hostinfo.h index 0b9f27429..bb24df1e3 100644 --- a/open-vm-tools/lib/include/hostinfo.h +++ b/open-vm-tools/lib/include/hostinfo.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -32,9 +32,10 @@ #include "vm_basic_types.h" #include "x86cpuid.h" +#include "unicodeTypes.h" -extern const char *Hostinfo_NameGet(void); /* don't free result */ -extern const char *Hostinfo_HostName(void); /* free result */ +extern Unicode Hostinfo_NameGet(void); /* don't free result */ +extern Unicode Hostinfo_HostName(void); /* free result */ extern void Hostinfo_MachineID(uint32 *hostNameHash, uint64 *hostHardwareID); @@ -57,7 +58,10 @@ extern Bool Hostinfo_OSIsWow64(void); #endif extern Bool Hostinfo_TouchBackDoor(void); extern Bool Hostinfo_TouchXen(void); -extern char *Hostinfo_GetModulePath(void); + +#define HGMP_PRIVILEGE 0 +#define HGMP_NO_PRIVILEGE 1 +extern Unicode Hostinfo_GetModulePath(uint32 priv); #if !defined(_WIN32) @@ -66,7 +70,7 @@ extern int Hostinfo_Execute(const char *command, char * const *args, Bool wait); #endif -extern char *Hostinfo_GetUser(void); +extern Unicode Hostinfo_GetUser(void); extern void Hostinfo_LogMemUsage(void); diff --git a/open-vm-tools/lib/include/impersonate.h b/open-vm-tools/lib/include/impersonate.h index 29ed8a2d3..8d90d12db 100644 --- a/open-vm-tools/lib/include/impersonate.h +++ b/open-vm-tools/lib/include/impersonate.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/impersonateInt.h b/open-vm-tools/lib/include/impersonateInt.h index 53ca799f6..4e7fbdb93 100644 --- a/open-vm-tools/lib/include/impersonateInt.h +++ b/open-vm-tools/lib/include/impersonateInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/includeCheck.h b/open-vm-tools/lib/include/includeCheck.h index d406d82aa..75cf5a1eb 100644 --- a/open-vm-tools/lib/include/includeCheck.h +++ b/open-vm-tools/lib/include/includeCheck.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/iovector.h b/open-vm-tools/lib/include/iovector.h index b9dcd6ebe..ef95db614 100644 --- a/open-vm-tools/lib/include/iovector.h +++ b/open-vm-tools/lib/include/iovector.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/localconfig.h b/open-vm-tools/lib/include/localconfig.h index e7809f15d..d11b69d1a 100644 --- a/open-vm-tools/lib/include/localconfig.h +++ b/open-vm-tools/lib/include/localconfig.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/log.h b/open-vm-tools/lib/include/log.h index d4bfd2a04..3c17f6472 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/loglevel_defs.h b/open-vm-tools/lib/include/loglevel_defs.h index cabb2c204..23de41375 100644 --- a/open-vm-tools/lib/include/loglevel_defs.h +++ b/open-vm-tools/lib/include/loglevel_defs.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/loglevel_user.h b/open-vm-tools/lib/include/loglevel_user.h index de0bbc371..e40d1e873 100644 --- a/open-vm-tools/lib/include/loglevel_user.h +++ b/open-vm-tools/lib/include/loglevel_user.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -76,7 +76,6 @@ LOGLEVEL_VAR(pcibridge), \ LOGLEVEL_VAR(vide), \ LOGLEVEL_VAR(hostonly), \ - LOGLEVEL_VAR(timeTracker), \ LOGLEVEL_VAR(backdoorAbsMouse), \ LOGLEVEL_VAR(oprom), \ LOGLEVEL_VAR(http), \ @@ -92,6 +91,7 @@ LOGLEVEL_VAR(aioWin32Completion), \ LOGLEVEL_VAR(aioLinux), \ LOGLEVEL_VAR(aioGeneric), \ + LOGLEVEL_VAR(aioHttp), \ LOGLEVEL_VAR(cdrom), \ LOGLEVEL_VAR(checksum), \ \ @@ -182,9 +182,10 @@ LOGLEVEL_VAR(automation), \ LOGLEVEL_VAR(oemDevice), \ LOGLEVEL_VAR(cptOps), \ - LOGLEVEL_VAR(vprobeExec), \ - LOGLEVEL_VAR(vp), \ + LOGLEVEL_VAR(VProbeExec), \ + LOGLEVEL_VAR(VProbeVP), \ LOGLEVEL_VAR(devicePowerOn), \ + LOGLEVEL_VAR(vmxvmdbCallbacks), \ LOGLEVEL_EXTENSION_DECLARE(LOGLEVEL_USER); diff --git a/open-vm-tools/lib/include/message.h b/open-vm-tools/lib/include/message.h index e6db3cf4f..25e53da91 100644 --- a/open-vm-tools/lib/include/message.h +++ b/open-vm-tools/lib/include/message.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/miscSolaris.h b/open-vm-tools/lib/include/miscSolaris.h index 728d28223..c3a54237c 100644 --- a/open-vm-tools/lib/include/miscSolaris.h +++ b/open-vm-tools/lib/include/miscSolaris.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/mntinfo.h b/open-vm-tools/lib/include/mntinfo.h index a88af56f1..9611f1a69 100644 --- a/open-vm-tools/lib/include/mntinfo.h +++ b/open-vm-tools/lib/include/mntinfo.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/msg.h b/open-vm-tools/lib/include/msg.h index e066f987e..724fc841f 100644 --- a/open-vm-tools/lib/include/msg.h +++ b/open-vm-tools/lib/include/msg.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -33,9 +33,7 @@ #include #include "err.h" #include "vm_basic_types.h" -#ifndef NO_MSGFMT #include "msgfmt.h" -#endif /* * Message ID macros @@ -61,7 +59,7 @@ #define MSGID(id) MSG_MAGIC "(msg." #id ")" #define BUTTONID(id) MSG_MAGIC "(button." #id ")" -#define INVALID_MSG_CODE -1 +#define INVALID_MSG_CODE (-1) /* * Data structures, types, and constants @@ -95,7 +93,6 @@ typedef enum HintOptions { HINT_OKCANCEL } HintOptions; -#ifndef NO_MSGFMT typedef struct Msg_List Msg_List; struct Msg_List { Msg_List *next; @@ -104,7 +101,6 @@ struct Msg_List { MsgFmt_Arg *args; int numArgs; }; -#endif typedef struct MsgCallback { void (*post)(MsgSeverity severity, const char *msgID, const char *message); @@ -119,19 +115,17 @@ typedef struct MsgCallback { void (*lazyProgress)(void *handle, int percent); void (*lazyProgressEnd)(void *handle); -#ifndef NO_MSGFMT void (*postList)(MsgSeverity severity, Msg_List *messages); int (*questionList)(const Msg_String *buttons, int defaultAnswer, Msg_List *messages); int (*progressList)(Msg_List *messages, int percent, Bool cancelButton); HintResult (*hintList)(HintOptions options, Msg_List *messages); void *(*lazyProgressStartList)(Msg_List *messages); -#endif } MsgCallback; #define MSG_QUESTION_MAX_BUTTONS 10 -#define MSG_PROGRESS_START -1 +#define MSG_PROGRESS_START (-1) #define MSG_PROGRESS_STOP 101 EXTERN Msg_String const Msg_YesNoButtons[]; @@ -157,10 +151,10 @@ EXTERN char *Msg_VFormat(const char *idFmt, va_list arguments); EXTERN unsigned Msg_Question(Msg_String const *buttons, int defaultAnswer, const char *idFmt, ...) PRINTF_DECL(3, 4); -EXTERN char *Msg_ChooseFile(const char *idTitle, const char *defaultName); -#ifdef VMX86_SERVER -EXTERN void Msg_AppendVob(void *vobBuf, int bytes); -#endif +EXTERN void Msg_AppendMsgList(char* id, + char* fmt, + MsgFmt_Arg *args, + int numArgs); /* * Unfortunately, gcc warns about both NULL and "" being passed as format @@ -185,7 +179,7 @@ EXTERN int Msg_CompareAnswer(Msg_String const *buttons, unsigned answer, const char *string); EXTERN char *Msg_GetString(const char *idString); EXTERN char *Msg_GetStringSafe(const char *idString); -EXTERN char *Msg_GetUtf8String(const char *idString); +EXTERN char *Msg_GetPlainButtonText(const char *idString); EXTERN const char *Msg_GetLocale(void); EXTERN void Msg_SetLocale(const char *locale, const char *binaryName); EXTERN char *Msg_GetMessageFilePath(const char *locale, const char *binaryName, @@ -201,12 +195,10 @@ EXTERN Bool Msg_LoadMessageFile(const char *locale, const char *fileName); EXTERN const char *Msg_GetMessages(void); EXTERN const char *Msg_GetMessagesAndReset(void); -#ifndef NO_MSGFMT EXTERN Msg_List *Msg_GetMsgList(void); EXTERN Msg_List *Msg_GetMsgListAndReset(void); EXTERN void Msg_FreeMsgList(Msg_List *messages); EXTERN char *Msg_LocalizeList(Msg_List *messages); -#endif EXTERN void Msg_Reset(Bool log); EXTERN Bool Msg_Present(void); EXTERN void Msg_Exit(void); diff --git a/open-vm-tools/lib/include/msgfmt.h b/open-vm-tools/lib/include/msgfmt.h index 3a67d58d8..004d00d33 100644 --- a/open-vm-tools/lib/include/msgfmt.h +++ b/open-vm-tools/lib/include/msgfmt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -128,9 +128,15 @@ Bool MsgFmt_GetArgs(const char *fmt, va_list va, MsgFmt_Arg **args, int *numArgs, char **error); Bool MsgFmt_GetArgsWithBuf(const char *fmt, va_list va, MsgFmt_Arg **args, int *numArgs, char **error, - void *buf, size_t bufSize); + void *buf, size_t *bufSize); void MsgFmt_FreeArgs(MsgFmt_Arg *args, int numArgs); +void MsgFmt_SwizzleArgs(MsgFmt_Arg *args, + int numArgs); +void MsgFmt_UnswizzleArgs(MsgFmt_Arg *args, + int numArgs); +MsgFmt_Arg* MsgFmt_CopyArgs(MsgFmt_Arg* copyArgs, + int numArgs); #ifdef HAS_BSD_PRINTF int MsgFmt_Snprintf(char *buf, size_t size, const char *format, const MsgFmt_Arg *args, int numArgs); diff --git a/open-vm-tools/lib/include/netutil.h b/open-vm-tools/lib/include/netutil.h index 95c9dfbb9..b28e5e898 100644 --- a/open-vm-tools/lib/include/netutil.h +++ b/open-vm-tools/lib/include/netutil.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -36,6 +36,15 @@ #include #endif + +/* + * Modified from iptypes.h... + */ +#if (NTDDI_VERSION < NTDDI_WIN2KSP1) +typedef FIXED_INFO_W2KSP1 FIXED_INFO; +typedef FIXED_INFO_W2KSP1 *PFIXED_INFO; +#endif + char *NetUtil_GetPrimaryIP(void); NicEntry *NetUtil_GetPrimaryNicEntry(void); diff --git a/open-vm-tools/lib/include/panic.h b/open-vm-tools/lib/include/panic.h index 51cbcfa7d..72466f947 100644 --- a/open-vm-tools/lib/include/panic.h +++ b/open-vm-tools/lib/include/panic.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/posix.h b/open-vm-tools/lib/include/posix.h new file mode 100644 index 000000000..41112f114 --- /dev/null +++ b/open-vm-tools/lib/include/posix.h @@ -0,0 +1,184 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +#ifndef _POSIX_H_ +#define _POSIX_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMNIXMOD +#include "includeCheck.h" + +#include +#include +#if !defined(_WIN32) +#include +#include +#endif + +#include "vm_basic_types.h" +#include "unicodeTypes.h" + +/* + * Force all users of these wrappers to use the LFS (large file) interface + * versions of the functions wrapper therein. If we don't do this the + * wrappers may be built with the LFS versions and the callers might not + * leading to a (potentially undetected) mismatch. + */ + +#if defined(linux) && !defined(N_PLAT_NLM) && \ + (!defined(_LARGEFILE64_SOURCE) || _FILE_OFFSET_BITS != 64) +#error LFS support is not enabled! +#endif + +struct stat; + +#if defined(_WIN32) +typedef int mode_t; +#else +struct statfs; +struct utimbuf; +struct timeval; +struct passwd; +struct mntent; +#endif + + +int Posix_Creat(ConstUnicode pathName, mode_t mode); +int Posix_Open(ConstUnicode pathName, int flags, ...); +FILE *Posix_Fopen(ConstUnicode pathName, const char *mode); +FILE *Posix_Popen(ConstUnicode pathName, const char *mode); +int Posix_Rename(ConstUnicode fromPathName, ConstUnicode toPathName); +int Posix_Rmdir(ConstUnicode pathName); +int Posix_Unlink(ConstUnicode pathName); +FILE *Posix_Freopen(ConstUnicode pathName, const char *mode, FILE *stream); +int Posix_Access(ConstUnicode pathName, int mode); +int Posix_Stat(ConstUnicode pathName, struct stat *statbuf); +int Posix_Mkdir(ConstUnicode pathName, mode_t mode); +int Posix_Chdir(ConstUnicode pathName); +int Posix_Chmod(ConstUnicode pathName, mode_t mode); + + +#if !defined(_WIN32) +void *Posix_Dlopen(ConstUnicode pathName, int flags); + +int Posix_Utime(ConstUnicode pathName, const struct utimbuf *times); + +#if !defined(N_PLAT_NLM) +int Posix_Mknod(ConstUnicode pathName, mode_t mode, dev_t dev); +int Posix_Chown(ConstUnicode pathName, uid_t owner, gid_t group); +int Posix_Lchown(ConstUnicode pathName, uid_t owner, gid_t group); +int Posix_Link(ConstUnicode pathName1, ConstUnicode pathName2); +int Posix_Symlink(ConstUnicode pathName1, ConstUnicode pathName2); +int Posix_Mkfifo(ConstUnicode pathName, mode_t mode); +int Posix_Truncate(ConstUnicode pathName, off_t length); +int Posix_Utimes(ConstUnicode pathName, const struct timeval *time); +int Posix_Execl(ConstUnicode pathName, ConstUnicode arg0, ...); +int Posix_Execv(ConstUnicode pathName, Unicode const argVal[]); +int Posix_Execvp(ConstUnicode fileName, Unicode const argVal[]); +int Posix_Lstat(ConstUnicode pathName, struct stat *statbuf); +DIR *Posix_OpenDir(ConstUnicode pathName); +Unicode Posix_Getenv(ConstUnicode name); +int Posix_Setenv(ConstUnicode name, ConstUnicode value, int overWrite); + + +/* + * These functions return dynamically allocated stings that have to be + * freed by the caller so they must be used in the ESX environment. They + * are different than their POSIX "base" functions. + */ +Unicode Posix_RealPath(ConstUnicode pathName); +Unicode Posix_ReadLink(ConstUnicode pathName); + +#if !defined(sun) +int Posix_Statfs(ConstUnicode pathName, struct statfs *statfsbuf); + + +#if !defined(__FreeBSD__) +/* + * These functions have Unicode strings embedded in their return values + * so they must be used in the ESX environment. + */ +struct passwd *Posix_Getpwnam(ConstUnicode name); +int Posix_Getpwnam_r(ConstUnicode name, struct passwd *pw, + char *buf, size_t size, struct passwd **ppw); +struct passwd *Posix_Getpwuid(uid_t uid); +int Posix_Getpwuid_r(uid_t uid, struct passwd *pw, + char *buf, size_t size, struct passwd **ppw); + + +#if !defined(__APPLE__) +FILE *Posix_Setmntent(ConstUnicode pathName, const char *mode); +/* + * These functions have Unicode strings embedded in their return values + * so they must be used in the ESX environment. + */ +struct mntent *Posix_Getmntent(FILE *fp); +struct mntent *Posix_Getmntent_r(FILE *fp, struct mntent *m, + char *buf, int size); +#endif // !defined(__APPLE__) +#endif // !defined(__FreeBSD__) +#endif // !defined(sun) +#endif // !defined(N_PLAT_NLM) +#endif // !define(_WIN32) + + +#if defined(VMX86_SERVER) && !defined(UNICODE_BUILDING_POSIX_WRAPPERS) +/* + * ESX is a UTF-8 environment so these functions can be "defined away" - + * the POSIX wrapper call can be directly mapped to the POSIX function + * avoiding unneccesary (call and handling) overhead. + * + * NOTE: PLEASE KEEP THESE IN SORTED ORDER + */ +#define Posix_Access access +#define Posix_Chdir chdir +#define Posix_Chmod chmod +#define Posix_Chown chown +#define Posix_Creat creat +#define Posix_Dlopen dlopen +#define Posix_Execl execl +#define Posix_Execv execv +#define Posix_Execvp execvp +#define Posix_Fopen fopen +#define Posix_Freopen freopen +#define Posix_Getenv getenv +#define Posix_Lchown lchown +#define Posix_Link link +#define Posix_Lstat lstat +#define Posix_Mkdir mkdir +#define Posix_Mkfifo mkfifo +#define Posix_Mknod mknod +#define Posix_Open open +#define Posix_OpenDir opendir +#define Posix_Popen popen +#define Posix_Rename rename +#define Posix_Rmdir rmdir +#define Posix_Setenv setenv +#define Posix_Setmntent setmntent +#define Posix_Stat stat +#define Posix_Statfs statfs +#define Posix_Symlink symlink +#define Posix_Truncate truncate +#define Posix_Unlink unlink +#define Posix_Utime utime +#define Posix_Utimes utimes +#endif + +#endif // _POSIX_H_ diff --git a/open-vm-tools/lib/include/preference.h b/open-vm-tools/lib/include/preference.h index b8eb1c299..04dba88cb 100644 --- a/open-vm-tools/lib/include/preference.h +++ b/open-vm-tools/lib/include/preference.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/printer.h b/open-vm-tools/lib/include/printer.h index df7cc13aa..b9fe3a80d 100644 --- a/open-vm-tools/lib/include/printer.h +++ b/open-vm-tools/lib/include/printer.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/procMgr.h b/open-vm-tools/lib/include/procMgr.h index 7b9094b94..641dd3f27 100644 --- a/open-vm-tools/lib/include/procMgr.h +++ b/open-vm-tools/lib/include/procMgr.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,7 +28,6 @@ #ifndef __PROCMGR_H__ # define __PROCMGR_H__ - #include "vm_basic_types.h" #if !defined(N_PLAT_NLM) #include "auth.h" @@ -60,8 +59,8 @@ typedef struct ProcMgr_ProcList { size_t procCount; ProcMgr_Pid *procIdList; - char **procCmdList; - char **procOwnerList; + char **procCmdList; // UTF-8 + char **procOwnerList; // UTF-8 #if defined(_WIN32) Bool *procDebugged; #endif @@ -103,13 +102,13 @@ typedef struct ProcMgr_ProcList { typedef struct ProcMgr_ProcArgs { HANDLE hToken; - LPCTSTR lpApplicationName; + LPCWSTR lpApplicationName; LPSECURITY_ATTRIBUTES lpProcessAttributes; LPSECURITY_ATTRIBUTES lpThreadAttributes; BOOL bInheritHandles; DWORD dwCreationFlags; LPVOID lpEnvironment; - LPCTSTR lpCurrentDirectory; + LPCWSTR lpCurrentDirectory; LPSTARTUPINFO lpStartupInfo; } ProcMgr_ProcArgs; #else @@ -130,8 +129,11 @@ ProcMgr_ProcList *ProcMgr_ListProcesses(void); void ProcMgr_FreeProcList(ProcMgr_ProcList *procList); Bool ProcMgr_KillByPid(ProcMgr_Pid procId); -Bool ProcMgr_ExecSync(char const *cmd, ProcMgr_ProcArgs *userArgs); -ProcMgr_AsyncProc *ProcMgr_ExecAsync(char const *cmd, ProcMgr_ProcArgs *userArgs); + +Bool ProcMgr_ExecSync(char const *cmd, // UTF-8 + ProcMgr_ProcArgs *userArgs); +ProcMgr_AsyncProc *ProcMgr_ExecAsync(char const *cmd, // UTF-8 + ProcMgr_ProcArgs *userArgs); void ProcMgr_Kill(ProcMgr_AsyncProc *asyncProc); Bool ProcMgr_GetAsyncStatus(ProcMgr_AsyncProc *asyncProc, Bool *status); Selectable ProcMgr_GetAsyncProcSelectable(ProcMgr_AsyncProc *asyncProc); @@ -139,10 +141,10 @@ ProcMgr_Pid ProcMgr_GetPid(ProcMgr_AsyncProc *asyncProc); Bool ProcMgr_IsAsyncProcRunning(ProcMgr_AsyncProc *asyncProc); int ProcMgr_GetExitCode(ProcMgr_AsyncProc *asyncProc, int *result); void ProcMgr_Free(ProcMgr_AsyncProc *asyncProc); -#if !defined(N_PLAT_NLM) -Bool ProcMgr_ImpersonateUserStart(const char *user, AuthToken token); +#if !defined(N_PLAT_NLM) && !defined(_WIN32) +Bool ProcMgr_ImpersonateUserStart(const char *user, // UTF-8 + AuthToken token); Bool ProcMgr_ImpersonateUserStop(void); #endif - #endif /* __PROCMGR_H__ */ diff --git a/open-vm-tools/lib/include/productState.h b/open-vm-tools/lib/include/productState.h index 24da77686..60173434f 100644 --- a/open-vm-tools/lib/include/productState.h +++ b/open-vm-tools/lib/include/productState.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/random.h b/open-vm-tools/lib/include/random.h index eb5f49a64..c3cf0578b 100644 --- a/open-vm-tools/lib/include/random.h +++ b/open-vm-tools/lib/include/random.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/removable_device.h b/open-vm-tools/lib/include/removable_device.h index 64b149fd4..ec8ece4d9 100644 --- a/open-vm-tools/lib/include/removable_device.h +++ b/open-vm-tools/lib/include/removable_device.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/rpcin.h b/open-vm-tools/lib/include/rpcin.h index 9c75e468b..1a8d9ca73 100644 --- a/open-vm-tools/lib/include/rpcin.h +++ b/open-vm-tools/lib/include/rpcin.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/rpcout.h b/open-vm-tools/lib/include/rpcout.h index 30c048a8d..c1ca549f7 100644 --- a/open-vm-tools/lib/include/rpcout.h +++ b/open-vm-tools/lib/include/rpcout.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/rpcvmx.h b/open-vm-tools/lib/include/rpcvmx.h index 3323d75fc..17f4549d2 100644 --- a/open-vm-tools/lib/include/rpcvmx.h +++ b/open-vm-tools/lib/include/rpcvmx.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/runDeployPkgInt.h b/open-vm-tools/lib/include/runDeployPkgInt.h index b219c3040..d676d3a51 100644 --- a/open-vm-tools/lib/include/runDeployPkgInt.h +++ b/open-vm-tools/lib/include/runDeployPkgInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/safetime.h b/open-vm-tools/lib/include/safetime.h index 498b2d8f7..6caa5e98d 100644 --- a/open-vm-tools/lib/include/safetime.h +++ b/open-vm-tools/lib/include/safetime.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/socketMgr.h b/open-vm-tools/lib/include/socketMgr.h index d0a7975fa..343bd3717 100644 --- a/open-vm-tools/lib/include/socketMgr.h +++ b/open-vm-tools/lib/include/socketMgr.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/staticEscape.h b/open-vm-tools/lib/include/staticEscape.h index 447255b8c..4a7967df0 100644 --- a/open-vm-tools/lib/include/staticEscape.h +++ b/open-vm-tools/lib/include/staticEscape.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/stats_file.h b/open-vm-tools/lib/include/stats_file.h index f76a6fce0..f5d9047b0 100644 --- a/open-vm-tools/lib/include/stats_file.h +++ b/open-vm-tools/lib/include/stats_file.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/stats_user_defs.h b/open-vm-tools/lib/include/stats_user_defs.h index 5d91df611..30d527d75 100644 --- a/open-vm-tools/lib/include/stats_user_defs.h +++ b/open-vm-tools/lib/include/stats_user_defs.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/stats_user_setup.h b/open-vm-tools/lib/include/stats_user_setup.h index 890feee30..0f9e25003 100644 --- a/open-vm-tools/lib/include/stats_user_setup.h +++ b/open-vm-tools/lib/include/stats_user_setup.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/str.h b/open-vm-tools/lib/include/str.h index 8699ab004..aaba7c491 100644 --- a/open-vm-tools/lib/include/str.h +++ b/open-vm-tools/lib/include/str.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -64,6 +64,9 @@ * ASCII/UTF-8 versions * * NOTE: All size_t arguments and integer returns values are in bytes. + * + * NOTE: Str_Asprintf/Str_Vasprintf return NULL on failure, while + * Str_SafeAsprintf/Str_SafeVasprintf ASSERT_NOT_IMPLEMENTED. */ EXTERN int Str_Sprintf(char *buf, size_t max, @@ -76,18 +79,26 @@ EXTERN char *Str_Strnstr(const char *src, const char *sub, size_t n); EXTERN char *Str_Strcpy(char *dst, const char *src, size_t maxLen); EXTERN char *Str_Strcat(char *dst, const char *src, size_t maxLen); EXTERN char *Str_Strncat(char *buf, size_t bufSize, const char *src, size_t n); + EXTERN char *Str_Asprintf(size_t *length, const char *format, ...) PRINTF_DECL(2, 3); EXTERN char *Str_Vasprintf(size_t *length, const char *format, va_list arguments); +EXTERN char *Str_SafeAsprintf(size_t *length, + const char *format, ...) PRINTF_DECL(2, 3); +EXTERN char *Str_SafeVasprintf(size_t *length, const char *format, + va_list arguments); -#if defined(_WIN32) || defined(GLIBC_VERSION_22) +#if defined(_WIN32) || defined(GLIBC_VERSION_22) // { /* * wchar_t versions * * NOTE: All size_t arguments and integer return values are in * wchar_ts, not bytes. + * + * NOTE: Str_Aswprintf/Str_Vaswprintf return NULL on failure, while + * Str_SafeAswprintf/Str_SafeVaswprintf ASSERT_NOT_IMPLEMENTED. */ EXTERN int Str_Swprintf(wchar_t *buf, size_t max, @@ -100,150 +111,81 @@ EXTERN wchar_t *Str_Wcscpy(wchar_t *dst, const wchar_t *src, size_t maxLen); EXTERN wchar_t *Str_Wcscat(wchar_t *dst, const wchar_t *src, size_t maxLen); EXTERN wchar_t *Str_Wcsncat(wchar_t *buf, size_t bufSize, const wchar_t *src, size_t n); + EXTERN wchar_t *Str_Aswprintf(size_t *length, const wchar_t *format, ...); EXTERN wchar_t *Str_Vaswprintf(size_t *length, const wchar_t *format, va_list arguments); +EXTERN wchar_t *Str_SafeAswprintf(size_t *length, + const wchar_t *format, ...); +EXTERN wchar_t *Str_SafeVaswprintf(size_t *length, const wchar_t *format, + va_list arguments); + +unsigned char *Str_Mbscpy(char *buf, const char *src, + size_t maxSize); +unsigned char *Str_Mbscat(char *buf, const char *src, + size_t maxSize); + +/* + * These are handly for Windows programmers. They are like + * the _tcs functions, but with Str_Strcpy-style bounds checking. + * + * We don't have Str_Mbsncat() because it has some odd semantic + * ambiguity (whether to truncate in the middle of a multibyte + * sequence) that I want to stay away from. -- edward + */ #ifdef _WIN32 #ifdef UNICODE - #define Str_Stprintf Str_Swprintf - #define Str_Sntprintf Str_Snwprintf - #define Str_Vsntprintf Str_Vsnwprintf - #define Str_Tcscpy Str_Wcscpy - #define Str_Tcscat Str_Wcscat - #define Str_Tcsncat Str_Wcsncat - #define Str_Astprintf Str_Aswprintf - #define Str_Vastprintf Str_Vaswprintf + #define Str_Tcscpy(s1, s2, n) Str_Wcscpy(s1, s2, n) + #define Str_Tcscat(s1, s2, n) Str_Wcscat(s1, s2, n) #else - #define Str_Stprintf Str_Sprintf - #define Str_Sntprintf Str_Snprintf - #define Str_Vsntprintf Str_Vsnprintf - #define Str_Tcscpy Str_Strcpy - #define Str_Tcscat Str_Strcat - #define Str_Tcsncat Str_Strncat - #define Str_Astprintf Str_Asprintf - #define Str_Vastprintf Str_Vasprintf + #define Str_Tcscpy(s1, s2, n) Str_Mbscpy(s1, s2, n) + #define Str_Tcscat(s1, s2, n) Str_Mbscat(s1, s2, n) #endif #endif -#endif // defined(_WIN32) || defined(GLIBC_VERSION_22) +#endif // } defined(_WIN32) || defined(GLIBC_VERSION_22) /* - * MsgFmt version of vsnprintf + * Wrappers for standard string functions + * + * These are either for Windows-Posix compatibility, + * or just gratuitous wrapping for consistency. */ -#ifdef HAS_BSD_PRINTF -struct MsgFmt_Arg; -int Str_MsgFmtSnprintfWork(char **outbuf, size_t bufSize, const char *fmt0, - const struct MsgFmt_Arg *args, int numArgs); -#endif +#define Str_Strcmp(s1, s2) strcmp(s1, s2) +#define Str_Strncmp(s1, s2, n) strncmp(s1, s2, n) +#define Str_Strchr(s, c) strchr(s, c) +#define Str_Strrchr(s, c) strrchr(s, c) +#define Str_Strspn(s1, s2) strspn(s1, s2) +#define Str_Strcspn(s1, s2) strcspn(s1, s2) -/* - *---------------------------------------------------------------------- - * - * Str_Strchr -- - * Str_Strrchr -- - * Str_Strspn -- - * Str_Strcspn -- - * - * Str_Strchr, Str_Strrchr: - * const char *str - null-terminated string to search - * int c - character to be located - * Str_Strspn, Str_Strcspn: - * const char *str1 - null-terminated string to search - * const char *str2 - null-terminated string of chars to search for - * - * Macros for MBCS implementation. - * - * All Str_xxxx functions work exactly the same way as the - * corresponding run-time library strxxxx functions. - * - * For Windows implementation, they are mapped to the generic international - * string function names, so that they are compiled with multi-byte (MBCS). - * The inline functions here are necessary for the type-casting. We are unable to - * call those MBCS functions directly due to type mismatch. - * - * When SUPPORT_UNICODE is on, we need to make those functionS back to ASCII version, - * so that they won't screw up the UTF-8 encoding. - * - * The reason for this work is to mainly take care of filename parsing - * involving DBCS, especially in cases where a DBCS consists of the - * backslash '\' as the 2nd character. - * - * '.' & '/' characters are not affected in DBCS parsing because they - * are defined to be illegal 2nd byte character. - * - *---------------------------------------------------------------------- - */ -#if _WIN32 - #ifdef SUPPORT_UNICODE - #define Str_Strchr(str, c) strchr(str, c) - #define Str_Strrchr(str, c) strrchr(str, c) - #define Str_Strspn(str1, str2) strspn(str1, str2) - #define Str_Strcspn(str1, str2) strcspn(str1, str2) - #define Str_ToUpper(str) _strupr(str) - #define Str_ToLower(str) _strlwr(str) - #else - #include - - __inline char *Str_Strchr(const char *_s1, unsigned int _c) - { - return (char *)_mbschr((const unsigned char *)_s1, _c); - } - - __inline char *Str_Strrchr(const char *_s1, unsigned int _c) - { - return (char *)_mbsrchr((const unsigned char *)_s1, _c); - } - - __inline size_t Str_Strspn(const char *_s1, const char *_s2) - { - return _mbsspn((const unsigned char *)_s1, (const unsigned char *)_s2); - } - - __inline size_t Str_Strcspn(const char *_s1, const char *_s2) - { - return _mbscspn((const unsigned char *)_s1, (const unsigned char *)_s2); - } - - __inline char *Str_ToUpper(char *_String) - { - #pragma warning(push) - #pragma warning(disable:4996) - return (char *)_mbsupr((unsigned char *)_String); - #pragma warning(pop) - } - - __inline char *Str_ToLower(char *_String) - { - #pragma warning(push) - #pragma warning(disable:4996) - return (char *)_mbslwr((unsigned char *)_String); - #pragma warning(pop) - } - #endif - - // To-do: These functions should be MBCS aware too when SUPPORT_UNICODE is not defined. - #define Str_Strcasecmp(_s1,_s2) _stricmp((_s1),(_s2)) - #define Str_Strncasecmp(_s1,_s2,_n) _strnicmp((_s1),(_s2),(_n)) - #define Str_Strncmp(_s1,_s2,_n) strncmp((_s1),(_s2),(_n)) +#ifdef _WIN32 + #define Str_Strcasecmp(s1, s2) _stricmp(s1, s2) + #define Str_Strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) + #define Str_ToUpper(s) _strupr(s) + #define Str_ToLower(s) _strlwr(s) #else - #define Str_Strchr(str, c) strchr(str, c) - #define Str_Strrchr(str, c) strrchr(str, c) - #define Str_Strspn(str1, str2) strspn(str1, str2) - #define Str_Strcspn(str1, str2) strcspn(str1, str2) - #define Str_Strcasecmp(_s1,_s2) strcasecmp((_s1),(_s2)) - #define Str_Strncasecmp(_s1,_s2,_n) strncasecmp((_s1),(_s2),(_n)) - #define Str_Strncmp(_s1,_s2,_n) strncmp((_s1),(_s2),(_n)) - - EXTERN char * _Str_ToUpper(char *str); - #define Str_ToUpper(str) _Str_ToUpper((str)) - - EXTERN char * _Str_ToLower(char *str); - #define Str_ToLower(str) _Str_ToLower((str)) -#endif // _WIN32 + #define Str_Strcasecmp(s1, s2) strcasecmp(s1, s2) + #define Str_Strncasecmp(s1, s2, n) strncasecmp(s1, s2, n) + char *Str_ToUpper(char *string); + char *Str_ToLower(char *string); +#endif + +#ifdef _WIN32 + #define Str_Tcscmp(s1, s2) _tcscmp(s1, s2) + #define Str_Tcsncmp(s1, s2, n) _tcsncmp(s1, s2, n) + #define Str_Tcsicmp(s1, s2) _tcsicmp(s1, s2) + #define Str_Tcsnicmp(s1, s2, n) _tcsnicmp(s1, s2, n) + #define Str_Tcschr(s, c) _tcschr(s, c) + #define Str_Tcsrchr(s, c) _tcsrchr(s, c) + #define Str_Tcsspn(s1, s2) _tcsspn(s1, s2) + #define Str_Tcscspn(s1, s2) _tcscspn(s1, s2) + #define Str_Tcsupr(s) _tcsupr(s) + #define Str_Tcslwr(s) _tcslwr(s) +#endif #endif /* _STR_H_ */ diff --git a/open-vm-tools/lib/include/strutil.h b/open-vm-tools/lib/include/strutil.h index 79eaf53b1..2c053d351 100644 --- a/open-vm-tools/lib/include/strutil.h +++ b/open-vm-tools/lib/include/strutil.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,6 +39,7 @@ Bool StrUtil_GetNextInt64Token(int64 *out, unsigned int *index, const char *str, Bool StrUtil_StrToInt(int32 *out, const char *str); Bool StrUtil_StrToUint(uint32 *out, const char *str); Bool StrUtil_StrToInt64(int64 *out, const char *str); +Bool StrUtil_StrToSizet(size_t *out, const char *str); Bool StrUtil_DecimalStrToUint(unsigned int *out, const char **str); char * StrUtil_FormatSizeInBytesUnlocalized(uint64 size); diff --git a/open-vm-tools/lib/include/su.h b/open-vm-tools/lib/include/su.h index 47af8b484..775da73a8 100644 --- a/open-vm-tools/lib/include/su.h +++ b/open-vm-tools/lib/include/su.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/syncDriver.h b/open-vm-tools/lib/include/syncDriver.h index aa027051a..48cdd74ac 100644 --- a/open-vm-tools/lib/include/syncDriver.h +++ b/open-vm-tools/lib/include/syncDriver.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/syncDriverIoc.h b/open-vm-tools/lib/include/syncDriverIoc.h index 0ed4733c6..6f2f417f2 100644 --- a/open-vm-tools/lib/include/syncDriverIoc.h +++ b/open-vm-tools/lib/include/syncDriverIoc.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/syncEvent.h b/open-vm-tools/lib/include/syncEvent.h index 87a47b973..67e44d9df 100644 --- a/open-vm-tools/lib/include/syncEvent.h +++ b/open-vm-tools/lib/include/syncEvent.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/syncMutex.h b/open-vm-tools/lib/include/syncMutex.h index 59e9bff49..98966c222 100644 --- a/open-vm-tools/lib/include/syncMutex.h +++ b/open-vm-tools/lib/include/syncMutex.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -69,6 +69,10 @@ void SyncMutex_Destroy(SyncMutex *that); Bool SyncMutex_Lock(SyncMutex *that); Bool SyncMutex_Unlock(SyncMutex *that); +#if !defined(N_PLAT_NLM) +Bool SyncMutex_Trylock(SyncMutex *that); +#endif + SyncMutex *SyncMutex_CreateSingleton(Atomic_Ptr *lckStorage); #endif // #ifndef _SYNC_MUTEX_H_ diff --git a/open-vm-tools/lib/include/syncWaitQ.h b/open-vm-tools/lib/include/syncWaitQ.h index 290ea6af0..cb4d8fc3c 100644 --- a/open-vm-tools/lib/include/syncWaitQ.h +++ b/open-vm-tools/lib/include/syncWaitQ.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/system.h b/open-vm-tools/lib/include/system.h index 63dc7f2b9..7c2bf1dc2 100644 --- a/open-vm-tools/lib/include/system.h +++ b/open-vm-tools/lib/include/system.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,11 +29,13 @@ # define __SYSTEM_H__ #include "vm_basic_types.h" +#include "unicode.h" uint64 System_Uptime(void); Bool System_GetCurrentTime(int64 *secs, int64 *usecs); Bool System_AddToCurrentTime(int64 deltaSecs, int64 deltaUsecs); +Unicode System_GetTimeAsString(void); Bool System_IsACPI(void); void System_Shutdown(Bool reboot); Bool System_IsUserAdmin(void); diff --git a/open-vm-tools/lib/include/timeutil.h b/open-vm-tools/lib/include/timeutil.h index dac6bb613..bc049aec8 100644 --- a/open-vm-tools/lib/include/timeutil.h +++ b/open-vm-tools/lib/include/timeutil.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/toolsDeployPkg.h b/open-vm-tools/lib/include/toolsDeployPkg.h index 65d02a178..ea14f7881 100644 --- a/open-vm-tools/lib/include/toolsDeployPkg.h +++ b/open-vm-tools/lib/include/toolsDeployPkg.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/toolsLogger.h b/open-vm-tools/lib/include/toolsLogger.h index 54711d75e..9545c2482 100644 --- a/open-vm-tools/lib/include/toolsLogger.h +++ b/open-vm-tools/lib/include/toolsLogger.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/toolsLoggerInt.h b/open-vm-tools/lib/include/toolsLoggerInt.h index bd7700847..258f41b8e 100644 --- a/open-vm-tools/lib/include/toolsLoggerInt.h +++ b/open-vm-tools/lib/include/toolsLoggerInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/unicode.h b/open-vm-tools/lib/include/unicode.h index 3a9c711c9..8aa910715 100644 --- a/open-vm-tools/lib/include/unicode.h +++ b/open-vm-tools/lib/include/unicode.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -40,4 +40,9 @@ // Character transformations: upper/lower/title case, case folding, etc. #include "unicodeTransforms.h" +#ifdef USE_ICU +// Unicode functionality depending on the third-party ICU library. +#include "unicodeICU.h" +#endif // USE_ICU + #endif // _UNICODE_H_ diff --git a/open-vm-tools/lib/include/unicodeBase.h b/open-vm-tools/lib/include/unicodeBase.h index f61d01d8f..10eb1957b 100644 --- a/open-vm-tools/lib/include/unicodeBase.h +++ b/open-vm-tools/lib/include/unicodeBase.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -94,15 +94,14 @@ Unicode Unicode_AllocWithLength(const void *buffer, * Allocates a new Unicode string given a NUL-terminated buffer * of bytes in the specified string encoding. * + * If buffer is NULL, then NULL is returned. + * * Note that regardless of the encoding of the buffer passed to this * function, the returned string can hold any Unicode characters. * - * If the buffer contains an invalid sequence of the specified - * encoding or memory could not be allocated, returns NULL. - * * Results: * An allocated Unicode string containing the decoded characters - * in buffer, or NULL on failure. Caller must pass to + * in buffer, or NULL if input is NULL. Caller must pass to * Unicode_Free to free. * * Side effects: @@ -126,12 +125,11 @@ Unicode_Alloc(const void *buffer, // IN * * Allocates a new Unicode string given a NUL-terminated UTF-8 string. * - * If the input contains an invalid UTF-8 byte sequence or memory could - * not be allocated, returns NULL. + * If utf8String is NULL, then NULL is returned. * * Results: * An allocated Unicode string containing the characters in - * utf8String, or NULL on failure. Caller must pass to + * utf8String, or NULL if utf8String is NULL. Caller must pass to * Unicode_Free to free. * * Side effects: @@ -155,12 +153,11 @@ Unicode_AllocWithUTF8(const char *utf8String) // IN * Allocates a new Unicode string given a NUL-terminated UTF-16 * string in host-endian order. * - * If the input contains an invalid UTF-16 sequence or memory could - * not be allocated, returns NULL. + * If utf16String is NULL, then NULL is returned. * * Results: * An allocated Unicode string containing the characters in - * utf16String, or NULL on failure. Caller must pass to + * utf16String, or NULL if utf16String is NULL. Caller must pass to * Unicode_Free to free. * * Side effects: @@ -179,55 +176,56 @@ Unicode_AllocWithUTF16(const utf16_t *utf16String) // IN Unicode Unicode_Duplicate(ConstUnicode str); void Unicode_Free(Unicode str); + +Unicode *Unicode_AllocList(char **srcList, ssize_t length, + StringEncoding encoding); + /* - * Accessors for NUL-terminated UTF-8 and UTF-16 host-endian - * representations of this Unicode string. + *----------------------------------------------------------------------------- * - * Memory is managed inside this string, so callers do not need to - * free. + * Unicode_AllocListWithUTF16 -- + * + * Allocates a list (actually a vector) of Unicode strings from a list + * (vector) of UTF-16 strings. The input list has a specified length or + * can be an argv-style NULL-terminated list (if length is negative). + * + * Results: + * An allocated list (vector) of Unicode strings. + * The result must be freed with Unicode_FreeList. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- */ -const char *Unicode_GetUTF8(ConstUnicode str); -const utf16_t *Unicode_GetUTF16(ConstUnicode str); -static INLINE const char * -UTF8(ConstUnicode str) +static INLINE Unicode * +Unicode_AllocListWithUTF16(utf16_t **utf16list, // IN: + ssize_t length) // IN: { - const char *result; - - int errP = errno; -#if defined(_WIN32) - DWORD errW = GetLastError(); -#endif - - result = Unicode_GetUTF8(str); - -#if defined(_WIN32) - SetLastError(errW); -#endif - errno = errP; - - return result; + return Unicode_AllocList((char **) utf16list, length, + STRING_ENCODING_UTF16); } -static INLINE const utf16_t * -UTF16(ConstUnicode str) -{ - const utf16_t *result; - - int errP = errno; -#if defined(_WIN32) - DWORD errW = GetLastError(); -#endif +void Unicode_FreeList(Unicode *list, ssize_t length); - result = Unicode_GetUTF16(str); - -#if defined(_WIN32) - SetLastError(errW); -#endif - errno = errP; +/* + * Accessor for the NUL-terminated UTF-8 representation of this + * Unicode string. + * + * Memory is managed inside this string, so callers do not need to + * free. + */ +const char *Unicode_GetUTF8(ConstUnicode str); - return result; +/* + * Convenience wrapper with a short name for this often-used function. + */ +static INLINE const char * +UTF8(ConstUnicode str) +{ + return Unicode_GetUTF8(str); } /* @@ -235,6 +233,11 @@ UTF16(ConstUnicode str) */ ssize_t Unicode_UTF16Strlen(const utf16_t *utf16); +/* + * Duplicates a UTF-16 string. + */ +utf16_t *Unicode_UTF16Strdup(const utf16_t *utf16); + /* * Tests if the buffer's bytes are valid in the specified encoding. */ @@ -242,6 +245,21 @@ Bool Unicode_IsBufferValid(const void *buffer, ssize_t lengthInBytes, StringEncoding encoding); +/* + * Tests if the buffer's unicode contents can be converted to the + * specified encoding. + */ +Bool Unicode_CanGetBytesWithEncoding(ConstUnicode ustr, + StringEncoding encoding); + +/* + * Escape non-printable bytes of the buffer with \xAB, where 0xAB + * is the non-printable byte value. + */ +char *Unicode_EscapeBuffer(const void *buffer, + ssize_t lengthInBytes, + StringEncoding encoding); + /* * Returns the length in number of native code units (UTF-8 bytes or * UTF-16 words) of the string. @@ -281,13 +299,17 @@ size_t Unicode_BytesRequired(ConstUnicode str, /* * Extracts the contents of the Unicode string into a NUL-terminated - * buffer using the specified encoding. Returns -1 if - * maxLengthInBytes isn't enough to hold the encoded string. + * buffer using the specified encoding. Copies at most + * maxLengthInBytes including NUL termination. Returns FALSE if + * truncation occurred, TRUE otherwise. If retLength is not NULL, + * *retLength holds the number of bytes actually copied, not including + * the NUL termination, upon return. */ -ssize_t Unicode_CopyBytes(ConstUnicode str, - void *buffer, - size_t maxLengthInBytes, - StringEncoding encoding); +Bool Unicode_CopyBytes(void *destBuffer, + ConstUnicode srcBuffer, + size_t maxLengthInBytes, + size_t *retLength, + StringEncoding encoding); /* @@ -301,9 +323,13 @@ ssize_t Unicode_CopyBytes(ConstUnicode str, * NOTE: The length of the NUL can depend on the encoding. * UTF-16 NUL is "\0\0"; UTF-32 NUL is "\0\0\0\0". * + * NULL is returned for NULL argument. + * * Results: - * Pointer to the dynamically allocated memory. The caller is - * responsible to free the memory allocated by this routine. + * Pointer to the dynamically allocated memory, + * or NULL on NULL argument. + * The caller is responsible to free the memory allocated + * by this routine. * * Side effects: * None @@ -316,15 +342,19 @@ Unicode_GetAllocBytes(ConstUnicode str, // IN: StringEncoding encoding) // IN: { void *memory; - ssize_t result; + Bool success; + size_t length; - size_t length = Unicode_BytesRequired(str, encoding); + if (str == NULL) { + return NULL; + } - memory = Util_SafeMalloc(length); + length = Unicode_BytesRequired(str, encoding); - result = Unicode_CopyBytes(str, memory, length, encoding); + memory = Util_SafeMalloc(length); - ASSERT_NOT_IMPLEMENTED(result != -1); + success = Unicode_CopyBytes(memory, str, length, NULL, encoding); + ASSERT(success); return memory; } @@ -337,13 +367,13 @@ Unicode_GetAllocBytes(ConstUnicode str, // IN: * * Allocates and returns a NUL terminated buffer into which the contents * of the unicode string are extracted using the (host native) UTF-16 - * encoding. + * encoding. (Note that UTF-16 NUL is two bytes: "\0\0".) * - * NOTE: The length of the NUL can depend on the encoding. - * UTF-16 NUL is "\0\0"; UTF-32 NUL is "\0\0\0\0". + * NULL is returned for NULL argument. * * Results: - * Pointer to the dynamically allocated memory or NULL on failure. + * Pointer to the dynamically allocated memory, + * or NULL on NULL argument. * * Caller is responsible to free the memory allocated by this routine. * @@ -367,23 +397,22 @@ Unicode_GetAllocUTF16(ConstUnicode str) // IN: ConstUnicode Unicode_GetStatic(const char *asciiBytes, Bool unescape); - /* - * XXX Helper macros for win32 Unicode string transition stage. - * Those macros should be removed after we turn on SUPPORT_UNICODE. - * We need to call free() when !SUPPORT_UNICODE because Unicode_GetAllocUTF16() - * creates a new copy of 's' in UTF-16. But when SUPPORT_UNICODE, Unicode_GetUTF16() - * just returns a const representation of the string 's'. + * Helper macros for Win32 Unicode string transition. + * + * Eventually, when the Unicode type becomes opaque + * (SUPPORT_UNICODE_OPAQUE), we can store UTF-16 directly inside + * it, which is a huge optimization for Win32 programmers. + * + * At that point, UNICODE_GET_UTF16/UNICODE_RELEASE_UTF16 can become + * constant-time operations. + * + * Until then, Win32 programmers need to alloc and free the UTF-16 + * representation of the Unicode string. */ - #if defined(_WIN32) - #if defined(SUPPORT_UNICODE) - #define UNICODE_GET_UTF16(s) Unicode_GetUTF16(s) - #define UNICODE_RELEASE_UTF16(s) - #else - #define UNICODE_GET_UTF16(s) Unicode_GetAllocUTF16(s) - #define UNICODE_RELEASE_UTF16(s) free((utf16_t *)s) - #endif + #define UNICODE_GET_UTF16(s) Unicode_GetAllocUTF16(s) + #define UNICODE_RELEASE_UTF16(s) free((utf16_t *)s) #endif #ifdef __cplusplus diff --git a/open-vm-tools/lib/include/unicodeInt.h b/open-vm-tools/lib/include/unicodeInt.h index 0b1876f3d..0a00a3a82 100644 --- a/open-vm-tools/lib/include/unicodeInt.h +++ b/open-vm-tools/lib/include/unicodeInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/unicodeOperations.h b/open-vm-tools/lib/include/unicodeOperations.h index 3332c7157..8b8be3866 100644 --- a/open-vm-tools/lib/include/unicodeOperations.h +++ b/open-vm-tools/lib/include/unicodeOperations.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -93,6 +93,8 @@ Unicode Unicode_ReplaceRange(ConstUnicode destination, Unicode Unicode_Join(ConstUnicode first, ...); +Unicode Unicode_Format(const char *fmt, ...); + /* * Other operations, each based upon calls to primitives. @@ -161,36 +163,6 @@ Unicode_AppendRange(ConstUnicode destination, // IN } -#ifdef SUPPORT_UNICODE - -typedef enum { - UNICODE_COMPARE_DEFAULT = 0, - UNICODE_COMPARE_IGNORE_ACCENTS, - UNICODE_COMPARE_IGNORE_CASE, - UNICODE_COMPARE_IGNORE_PUNCTUATION -} UnicodeCompareOption; - - -/* - * Different languages and cultures have unique rules for how strings - * are compared and sorted. For example: - * - * Swedish: z < "o with umlaut" - * German: "o with umlaut" < z - * - * When producing a result visible to the user (like a sorted list of - * virtual machine names) string comparsion must obey the rules set by - * the user's language and culture, collectively called the "locale". - */ - -int Unicode_CompareWithLocale(ConstUnicode str1, - ConstUnicode str2, - const char *locale, - UnicodeCompareOption compareOption); - -#endif - - /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/include/unicodeTransforms.h b/open-vm-tools/lib/include/unicodeTransforms.h index 170e26b4a..dfd026940 100644 --- a/open-vm-tools/lib/include/unicodeTransforms.h +++ b/open-vm-tools/lib/include/unicodeTransforms.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -51,38 +51,8 @@ Unicode Unicode_FoldCase(ConstUnicode str); * Trims whitespace from either side of the string. */ Unicode Unicode_Trim(ConstUnicode str); - -/* - * The following APIs require IBM's ICU library. - */ - -#ifdef SUPPORT_UNICODE - -/* - * Transforms the case of the string using the given locale's rules. - * - * Pass in a NULL locale to use the process's default locale. - * - * Changing the case of a string can change its length, so don't - * assume the string is the same length after calling these functions. - */ -Unicode Unicode_ToLower(ConstUnicode str, const char *locale); -Unicode Unicode_ToUpper(ConstUnicode str, const char *locale); -Unicode Unicode_ToTitle(ConstUnicode str, const char *locale); - -typedef enum { - UNICODE_NORMAL_FORM_C, // "e with acute accent" -> U+00E9 - UNICODE_NORMAL_FORM_D // "e with acute accent" -> U+0065 U+0302 -} UnicodeNormalizationForm; - -/* - * Normalizes Unicode characters composed of multiple parts into a - * standard form. - */ -Unicode Unicode_Normalize(ConstUnicode str, - UnicodeNormalizationForm form); - -#endif +Unicode Unicode_TrimLeft(ConstUnicode str); +Unicode Unicode_TrimRight(ConstUnicode str); #ifdef __cplusplus } diff --git a/open-vm-tools/lib/include/unicodeTypes.h b/open-vm-tools/lib/include/unicodeTypes.h index 7d32e4e7e..e47faef80 100644 --- a/open-vm-tools/lib/include/unicodeTypes.h +++ b/open-vm-tools/lib/include/unicodeTypes.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -33,35 +33,33 @@ #include "vm_basic_types.h" -#if defined(SUPPORT_UNICODE) +#if defined(SUPPORT_UNICODE_OPAQUE) + /* - * When Unicode support is turned on, the types become opaque containers. + * To assist with finding code that hasn't been internationalized, we + * support building with an opaque Unicode type. This catches users + * passing a char * of unknown encoding to Unicode functions, and + * assigning a Unicode to a char *. */ + typedef struct UnicodeImpl UnicodeImpl; typedef UnicodeImpl * Unicode; typedef const UnicodeImpl * ConstUnicode; + #else + /* - * As a short-term development tactic to prevent code churn while the + * As a transitionary development tactic to prevent code churn while the * Unicode libraries are being developed, we'll start with a simple * implementation of Unicode as UTF-8 char *. */ typedef char * Unicode; typedef const char * ConstUnicode; + #endif typedef ssize_t UnicodeIndex; -/* - * include windows.h or other appropriate include files before this one - */ - -#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) -typedef wchar_t utf16_t; -#else -typedef uint16 utf16_t; -#endif - /* * Special UnicodeIndex value returned when a string is not found. */ @@ -112,7 +110,7 @@ typedef enum { STRING_ENCODING_ISO_8859_8, STRING_ENCODING_ISO_8859_9, STRING_ENCODING_ISO_8859_10, - STRING_ENCODING_ISO_8859_11, + // ISO-8859-11 is unused. // Oddly, there is no ISO-8859-12. STRING_ENCODING_ISO_8859_13, STRING_ENCODING_ISO_8859_14, @@ -170,5 +168,7 @@ typedef enum { const char *Unicode_EncodingEnumToName(StringEncoding encoding); StringEncoding Unicode_EncodingNameToEnum(const char *encodingName); +StringEncoding Unicode_GetCurrentEncoding(void); +Bool Unicode_IsEncodingSupported(StringEncoding encoding); #endif // _UNICODE_TYPES_H_ diff --git a/open-vm-tools/lib/include/unity.h b/open-vm-tools/lib/include/unity.h index d4f8c71f3..fcc64ac16 100644 --- a/open-vm-tools/lib/include/unity.h +++ b/open-vm-tools/lib/include/unity.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -30,14 +30,20 @@ #include "guestApp.h" #include "dynbuf.h" #include "str.h" +#include "rpcin.h" /* * In Unity mode, all our DnD detection windows will be ignored and not displayed - * on host desktop. Right now we have 2 DnD detection window. + * on host desktop. Right now we have 4 DnD detection window. 2 for DnD version 2 + * or older, 2 for DnD version 3 or newer. */ -#define UNITY_BLOCKED_WND_DND_FULL_DET 0 -#define UNITY_BLOCKED_WND_DND_DET 1 -#define UNITY_BLOCKED_WND_MAX 2 +enum{ + UNITY_BLOCKED_WND_DND_FULL_DET_V2 = 0, + UNITY_BLOCKED_WND_DND_DET_V2 = 1, + UNITY_BLOCKED_WND_DND_FULL_DET_V3 = 2, + UNITY_BLOCKED_WND_DND_DET_V3 = 3, + UNITY_BLOCKED_WND_MAX = 4, +}; /* * Maximum number of virtual desktops supported. @@ -68,6 +74,7 @@ typedef struct UnityVirtualDesktopArray { void Unity_Init(GuestApp_Dict *conf, int* blockedWnd); void Unity_InitBackdoor(struct RpcIn *rpcIn); Bool Unity_IsSupported(void); +void Unity_SetActiveDnDDetWnd(int detWnd); void Unity_Exit(void); void Unity_Cleanup(void); void Unity_RegisterCaps(void); diff --git a/open-vm-tools/lib/include/util.h b/open-vm-tools/lib/include/util.h index 9093ab2f0..b0126e2f9 100644 --- a/open-vm-tools/lib/include/util.h +++ b/open-vm-tools/lib/include/util.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -72,8 +72,8 @@ EXTERN uint32 CRC_Compute(uint8 *buf, int len); EXTERN uint32 Util_Checksum32(uint32 *buf, int len); EXTERN uint32 Util_Checksum(uint8 *buf, int len); EXTERN uint32 Util_Checksumv(void *iov, int numEntries); -EXTERN void Util_ShortenPath(char *dst, const char *src, int maxLen); -EXTERN char *Util_ExpandString(const char *fileName); +EXTERN Unicode Util_ExpandString(ConstUnicode fileName); +EXTERN Unicode Util_GetEnv(ConstUnicode name); EXTERN void Util_ExitThread(int); EXTERN NORETURN void Util_ExitProcessAbruptly(int); EXTERN int Util_HasAdminPriv(void); @@ -282,7 +282,7 @@ UtilSafeMallocInternal(int bugNumber, size_t size, char *file, int lineno) { void *result = malloc(size); - if (result == NULL) { + if (result == NULL && size != 0) { if (bugNumber == -1) { Panic("Unrecoverable memory allocation failure at %s:%d\n", file, lineno); @@ -318,7 +318,7 @@ UtilSafeCallocInternal(int bugNumber, size_t nmemb, size_t size, { void *result = calloc(nmemb, size); - if (result == NULL) { + if (result == NULL && nmemb != 0 && size != 0) { if (bugNumber == -1) { Panic("Unrecoverable memory allocation failure at %s:%d\n", file, lineno); @@ -520,4 +520,33 @@ Util_ZeroFreeString(char *str) // IN } } + +#ifdef _WIN32 +/* + *----------------------------------------------------------------------------- + * + * Util_ZeroFreeStringW -- + * + * Zeros out a NUL-terminated wide-character string, and then frees it. + * NULL is legal. + * + * Results: + * None. + * + * Side effects: + * str is zeroed, and then free() is called on it. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Util_ZeroFreeStringW(wchar_t *str) // IN +{ + if (str != NULL) { + Util_Zero(str, wcslen(str) * sizeof(wchar_t)); + free(str); + } +} +#endif // _WIN32 + #endif /* UTIL_H */ diff --git a/open-vm-tools/lib/include/util_shared.h b/open-vm-tools/lib/include/util_shared.h index c7f6c0cec..172610b60 100644 --- a/open-vm-tools/lib/include/util_shared.h +++ b/open-vm-tools/lib/include/util_shared.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/uuid.h b/open-vm-tools/lib/include/uuid.h index 8eb809e34..b4b31afef 100644 --- a/open-vm-tools/lib/include/uuid.h +++ b/open-vm-tools/lib/include/uuid.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vix.h b/open-vm-tools/lib/include/vix.h index f2d9b4890..c1287dd69 100644 --- a/open-vm-tools/lib/include/vix.h +++ b/open-vm-tools/lib/include/vix.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2007 VMware, Inc. All rights reserved. + * Copyright (C) 2004-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -101,6 +101,9 @@ enum { VIX_E_FILE_NAME_INVALID = 22, VIX_E_ALREADY_EXISTS = 23, VIX_E_BUFFER_TOOSMALL = 24, + VIX_E_OBJECT_NOT_FOUND = 25, + VIX_E_HOST_NOT_CONNECTED = 26, + /* Handle Errors */ VIX_E_INVALID_HANDLE = 1000, @@ -143,6 +146,8 @@ enum { VIX_E_OPERATION_NOT_ALLOWED_FOR_LOGIN_TYPE = 3031, VIX_E_LOGIN_TYPE_NOT_SUPPORTED = 3032, VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST = 3033, + VIX_E_INTERACTIVE_SESSION_NOT_PRESENT = 3034, + VIX_E_INTERACTIVE_SESSION_USER_MISMATCH = 3035, /* VM Errors */ VIX_E_VM_NOT_FOUND = 4000, @@ -157,6 +162,7 @@ enum { VIX_E_INVALID_PROPERTY_VALUE = 6001, VIX_E_READ_ONLY_PROPERTY = 6002, VIX_E_MISSING_REQUIRED_PROPERTY = 6003, + VIX_E_INVALID_SERIALIZED_DATA = 6004, /* Completion Errors */ VIX_E_BAD_VM_INDEX = 8000, @@ -184,6 +190,9 @@ enum { VIX_E_SNAPSHOT_DUPLICATEDDISK = 13015, VIX_E_SNAPSHOT_INDEPENDENTDISK = 13016, VIX_E_SNAPSHOT_NONUNIQUE_NAME = 13017, + VIX_E_SNAPSHOT_MEMORY_ON_INDEPENDENT_DISK = 13018, + VIX_E_SNAPSHOT_ENCODING = 13033, + /* Host Errors */ VIX_E_HOST_DISK_INVALID_VALUE = 14003, @@ -227,6 +236,7 @@ enum { VIX_E_DISK_KEY_NOTFOUND = 16052, // metadata key is not found VIX_E_DISK_SUBSYSTEM_INIT_FAIL = 16053, VIX_E_DISK_INVALID_CONNECTION = 16054, + VIX_E_DISK_ENCODING = 16061, /* Crypto Library Errors */ VIX_E_CRYPTO_UNKNOWN_ALGORITHM = 17000, @@ -333,6 +343,8 @@ enum { VIX_PROPERTY_JOB_RESULT_PROCESS_START_TIME = 3055, VIX_PROPERTY_JOB_RESULT_VM_VARIABLE_STRING = 3056, VIX_PROPERTY_JOB_RESULT_PROCESS_BEING_DEBUGGED = 3057, + VIX_PROPERTY_JOB_RESULT_FILE_SIZE = 3061, + VIX_PROPERTY_JOB_RESULT_FILE_MOD_TIME = 3062, /* Event properties; these are sent in the moreEventInfo for some events. */ VIX_PROPERTY_FOUND_ITEM_LOCATION = 4010, @@ -616,8 +628,16 @@ enum { */ #define VIX_ANONYMOUS_USER_NAME "__VMware_Vix_Guest_User_Anonymous__" -#define VIX_ADMINISTRATOR_USER_NAME "__VMware_Vix_Guest_User_Admin__" -#define VIX_CONSOLE_USER_NAME "__VMware_Vix_Guest_Console_User__" + +/* + * VIX_ADMINISTRATOR_USER_NAME and VIX_CONSOLE_USER_NAME are no longer + * supported. If your code includes references to these constants please + * update your code to use a valid guest username and password when calling + * VixVM_LoginInGuest(). + */ + +//#define VIX_ADMINISTRATOR_USER_NAME "__VMware_Vix_Guest_User_Admin__" +//#define VIX_CONSOLE_USER_NAME "__VMware_Vix_Guest_Console_User__" /* diff --git a/open-vm-tools/lib/include/vixCommands.h b/open-vm-tools/lib/include/vixCommands.h index b5f789efb..c9dcaac0e 100644 --- a/open-vm-tools/lib/include/vixCommands.h +++ b/open-vm-tools/lib/include/vixCommands.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -58,6 +58,7 @@ #define VIX_USER_CREDENTIAL_CONSOLE_USER 5 #define VIX_USER_CREDENTIAL_HOST_CONFIG_SECRET 6 #define VIX_USER_CREDENTIAL_HOST_CONFIG_HASHED_SECRET 7 +#define VIX_USER_CREDENTIAL_NAMED_INTERACTIVE_USER 8 #define VIX_SHARED_SECRET_CONFIG_USER_NAME "__VMware_Vix_Shared_Secret_1__" @@ -91,7 +92,8 @@ enum VixCommonCommandOptionValues { enum { VIX_REQUESTMSG_ONLY_RELOAD_NETWORKS = 0x01, VIX_REQUESTMSG_RETURN_ON_INITIATING_TOOLS_UPGRADE = 0x02, - VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE = 0x04 + VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE = 0x04, + VIX_REQUESTMSG_REQUIRES_INTERACTIVE_ENVIRONMENT = 0x08, }; @@ -260,8 +262,8 @@ VixMsgProgressEvent; typedef #include "vmware_pack_begin.h" struct VixCommandNamePassword { - int32 nameLength; - int32 passwordLength; + uint32 nameLength; + uint32 passwordLength; } #include "vmware_pack_end.h" VixCommandNamePassword; @@ -278,8 +280,8 @@ typedef struct VixMsgVMOpenRequest { VixCommandRequestHeader header; int32 options; //options for VM_Open or CreateWorkingCopy - int32 xmlPathNameSize; - int32 vmxPathNameSize; + uint32 xmlPathNameSize; + uint32 vmxPathNameSize; //this is followed by the xml pathname and the vmx pathname } #include "vmware_pack_end.h" @@ -290,7 +292,7 @@ typedef struct VixMsgVMOpenResponse { VixCommandResponseHeader header; int32 vmPowerState; - int32 vmxPathNameSize; + uint32 vmxPathNameSize; } #include "vmware_pack_end.h" VixMsgVMOpenResponse; @@ -364,7 +366,7 @@ typedef #include "vmware_pack_begin.h" struct VixMsgGetVMStateResponse { VixCommandResponseHeader header; - int32 bufferSize; + uint32 bufferSize; // This is followed by the buffer of serialized properties } #include "vmware_pack_end.h" @@ -375,7 +377,7 @@ typedef #include "vmware_pack_begin.h" struct VixMsgSetVMStateRequest { VixCommandRequestHeader header; - int32 bufferSize; + uint32 bufferSize; // This is followed by the buffer of serialized properties } #include "vmware_pack_end.h" @@ -412,7 +414,7 @@ typedef #include "vmware_pack_begin.h" struct VixMsgConfigurationObjectType { int32 configurationType; - int32 objectSize; + uint32 objectSize; } #include "vmware_pack_end.h" VixMsgConfigurationObjectType; @@ -443,7 +445,28 @@ enum VixMsgConfigObjectType { VIX_LAN_SEGMENT_SETTING_CONFIG = 1, }; +/* + * Commands related to Record|Replay State. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgRecordReplayStateCommandRequest { + VixCommandRequestHeader header; + + int32 options; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgRecordReplayStateCommandRequest; +typedef +#include "vmware_pack_begin.h" +struct VixMsgRecordReplayStateCommandResponse { + VixCommandResponseHeader header; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgRecordReplayStateCommandResponse; /* @@ -473,8 +496,8 @@ struct VixMsgRunProgramRequest { VixCommandRequestHeader header; int32 runProgramOptions; - int32 programNameLength; - int32 commandLineArgsLength; + uint32 programNameLength; + uint32 commandLineArgsLength; } #include "vmware_pack_end.h" VixMsgRunProgramRequest; @@ -501,8 +524,8 @@ struct VixMsgRunProgramResponse { VmTimeType deltaTime; int64 pid; - int32 stdOutLength; - int32 stdErrLength; + uint32 stdOutLength; + uint32 stdErrLength; } #include "vmware_pack_end.h" VixMsgRunProgramResponse; @@ -518,7 +541,7 @@ struct VixMsgInstallToolsRequest { VixCommandRequestHeader header; int32 installOptions; - int32 commandLineArgsLength; + uint32 commandLineArgsLength; } #include "vmware_pack_end.h" VixMsgInstallToolsRequest; @@ -570,7 +593,7 @@ struct VixMsgSendKeyStrokesRequest { int32 options; int64 targetPid; int32 numKeyStrokes; - int32 windowNameLength; + uint32 windowNameLength; } #include "vmware_pack_end.h" VixMsgSendKeyStrokesRequest; @@ -604,9 +627,9 @@ typedef struct VixMsgRegistryRequest { VixCommandRequestHeader header; - int32 registryKeyLength; + uint32 registryKeyLength; int32 expectedRegistryKeyType; - int32 dataToWriteSize; + uint32 dataToWriteSize; } #include "vmware_pack_end.h" VixMsgRegistryRequest; @@ -623,9 +646,9 @@ struct VixCommandRenameFileRequest { VixCommandRequestHeader header; int32 copyFileOptions; - int32 oldPathNameLength; - int32 newPathNameLength; - int32 filePropertiesLength; + uint32 oldPathNameLength; + uint32 newPathNameLength; + uint32 filePropertiesLength; } #include "vmware_pack_end.h" VixCommandRenameFileRequest; @@ -635,7 +658,7 @@ typedef struct VixCommandHgfsSendPacket { VixCommandRequestHeader header; - int32 hgfsPacketSize; + uint32 hgfsPacketSize; int32 timeout; } #include "vmware_pack_end.h" @@ -653,7 +676,7 @@ struct VixMsgSimpleFileRequest { VixCommandRequestHeader header; int32 fileOptions; - int32 guestPathNameLength; + uint32 guestPathNameLength; } #include "vmware_pack_end.h" VixMsgSimpleFileRequest; @@ -664,7 +687,7 @@ struct VixMsgListDirectoryRequest { VixCommandRequestHeader header; int32 fileOptions; - int32 guestPathNameLength; + uint32 guestPathNameLength; int64 offset; } #include "vmware_pack_end.h" @@ -700,8 +723,8 @@ struct VixMsgCreateFileRequest { VixCommandRequestHeader header; int32 fileOptions; - int32 guestPathNameLength; - int32 filePropertiesLength; + uint32 guestPathNameLength; + uint32 filePropertiesLength; } #include "vmware_pack_end.h" VixMsgCreateFileRequest; @@ -716,11 +739,11 @@ typedef struct VixMsgHotDiskRequest { VixCommandRequestHeader header; int32 hotDiskOptions; - int32 adapterTypeLength; - int32 typeLength; - int32 nameLength; - int32 modeLength; - int32 deviceTypeLength; + uint32 adapterTypeLength; + uint32 typeLength; + uint32 nameLength; + uint32 modeLength; + uint32 deviceTypeLength; int32 adapterNum; int32 targetNum; } @@ -737,10 +760,10 @@ typedef struct VixMsgHotExtendDiskRequest { VixCommandRequestHeader header; int32 hotDiskOptions; - int32 typeLength; + uint32 typeLength; int32 adapterNum; int32 targetNum; - uint64 newNumSectors; + uint64 newNumSectors; } #include "vmware_pack_end.h" VixMsgHotExtendDiskRequest; @@ -783,13 +806,23 @@ typedef struct VixMsgHotAddDeviceRequest { VixCommandRequestHeader header; int32 deviceType; - int32 devicePropsBufferSize; + uint32 devicePropsBufferSize; int32 backingType; - int32 backingPropsBufferSize; + uint32 backingPropsBufferSize; } #include "vmware_pack_end.h" VixMsgHotAddDeviceRequest; +typedef +#include "vmware_pack_begin.h" +struct VixMsgHotAddDeviceResponse { + VixCommandResponseHeader header; + int32 adapterNum; + int32 targetNum; +} +#include "vmware_pack_end.h" +VixMsgHotAddDeviceResponse; + /* * ********************************************************** @@ -800,7 +833,7 @@ typedef struct VixMsgHotRemoveDeviceRequest { VixCommandRequestHeader header; int32 deviceType; - int32 devicePropsBufferSize; + uint32 devicePropsBufferSize; } #include "vmware_pack_end.h" VixMsgHotRemoveDeviceRequest; @@ -820,8 +853,8 @@ struct VixMsgCreateSnapshotRequest { Bool powerOff; Bool saveDeviceState; - int32 nameLength; - int32 descriptionLength; + uint32 nameLength; + uint32 descriptionLength; } #include "vmware_pack_end.h" VixMsgCreateSnapshotRequest; @@ -851,6 +884,20 @@ struct VixMsgSnapshotRequest { #include "vmware_pack_end.h" VixMsgSnapshotRequest; +typedef +#include "vmware_pack_begin.h" +struct VixMsgSnapshotUpdateEvent { + VixMsgEventHeader eventHeader; + + int32 options; + uint32 propertyListLength; + /* + * This is followed by a serialized property list. + */ +} +#include "vmware_pack_end.h" +VixMsgSnapshotUpdateEvent; + /* * Fork a running VM. @@ -863,8 +910,8 @@ struct VixMsgVMForkRequest { int32 options; Bool disconnectRemovable; - int32 cfgFileNameLen; - int32 displayNameLen; + uint32 cfgFileNameLen; + uint32 displayNameLen; } #include "vmware_pack_end.h" VixMsgVMForkRequest; @@ -963,7 +1010,7 @@ struct VixMsgFaultToleranceControlRequest { int32 command; char uuid[48]; - int32 vmxPathLen; + uint32 vmxPathLen; char vmxFilePath[1]; } #include "vmware_pack_end.h" @@ -982,8 +1029,8 @@ struct VixMsgSharedFolderRequest { int32 options; int32 index; - int32 shareNameLength; - int32 hostPathNameLength; + uint32 shareNameLength; + uint32 hostPathNameLength; } #include "vmware_pack_end.h" VixMsgSharedFolderRequest; @@ -1004,8 +1051,8 @@ typedef struct VixMsgGetSharedFolderInfoResponse { VixCommandResponseHeader header; - int32 shareNameLength; - int32 hostPathNameLength; + uint32 shareNameLength; + uint32 hostPathNameLength; int32 sharedFolderFlags; } #include "vmware_pack_end.h" @@ -1021,8 +1068,8 @@ struct VixMsgSetSharedFolderRequest { VixCommandRequestHeader header; int32 options; - int32 shareNameLength; - int32 hostPathNameLength; + uint32 shareNameLength; + uint32 hostPathNameLength; } #include "vmware_pack_end.h" VixMsgSetSharedFolderRequest; @@ -1039,7 +1086,7 @@ struct VixMsgGetDiskPropertiesRequest { VixCommandRequestHeader header; int32 options; - int32 diskPathNameLength; + uint32 diskPathNameLength; } #include "vmware_pack_end.h" VixMsgGetDiskPropertiesRequest; @@ -1052,7 +1099,7 @@ struct VixMsgGetDiskPropertiesResponse { int64 capacity; int64 spaceUsed; int32 diskLibDiskType; - int32 physicalPathLength; + uint32 physicalPathLength; } #include "vmware_pack_end.h" VixMsgGetDiskPropertiesResponse; @@ -1098,7 +1145,7 @@ struct VixMsgCaptureScreenResponse { VixCommandResponseHeader header; int32 format; // Format of the data in the response. - int32 dataOffset; // Relative to the address of this struct. + uint32 dataOffset; // Relative to the address of this struct. } #include "vmware_pack_end.h" VixMsgCaptureScreenResponse; @@ -1114,9 +1161,9 @@ struct VixMsgRunScriptRequest { int32 scriptOptions; - int32 interpreterNameLength; - int32 scriptLength; - int32 propertiesLength; + uint32 interpreterNameLength; + uint32 scriptLength; + uint32 propertiesLength; } #include "vmware_pack_end.h" VixMsgRunScriptRequest; @@ -1148,7 +1195,7 @@ struct VixCommandMakeSessionKeyRequest { int32 keyOptions; int32 timeout; - int32 responseKeyLength; + uint32 responseKeyLength; int32 responseKeyCypherType; int32 cypherType; } @@ -1163,7 +1210,7 @@ struct VixCommandMakeSessionKeyResponse { int32 keyOptions; int32 timeout; - int32 keyLength; + uint32 keyLength; int32 cypherType; } #include "vmware_pack_end.h" @@ -1193,39 +1240,6 @@ struct VixCommandKillProcessRequest { VixCommandKillProcessRequest; - -/* - * ********************************************************** - * Manage a socket connection between the host and guest. - */ - -typedef -#include "vmware_pack_begin.h" -struct VixCommandGuestSocketRequest { - VixCommandRequestHeader header; - - int64 socket; - unsigned short port; - uint32 timeoutMS; - uint32 backlog; - uint32 dataLen; -} -#include "vmware_pack_end.h" -VixCommandGuestSocketRequest; - -typedef -#include "vmware_pack_begin.h" -struct VixCommandGuestSocketResponse { - VixCommandResponseHeader header; - - int64 socket; - uint32 dataLen; -} -#include "vmware_pack_end.h" -VixCommandGuestSocketResponse; - - - /* * ********************************************************** * Read and write variables like guest variables and config values. @@ -1237,7 +1251,7 @@ struct VixMsgReadVariableRequest { int32 variableType; int32 options; - int32 nameLength; + uint32 nameLength; } #include "vmware_pack_end.h" VixMsgReadVariableRequest; @@ -1250,7 +1264,7 @@ struct VixMsgReadVariableResponse { int32 valueType; int32 valueProperties; - int32 valueLength; + uint32 valueLength; } #include "vmware_pack_end.h" VixMsgReadVariableResponse; @@ -1267,8 +1281,8 @@ struct VixMsgWriteVariableRequest { int32 variableType; int32 options; - int32 nameLength; - int32 valueLength; + uint32 nameLength; + uint32 valueLength; } #include "vmware_pack_end.h" VixMsgWriteVariableRequest; @@ -1287,9 +1301,9 @@ struct VixMsgCreateTempFileRequest { VixCommandRequestHeader header; int32 options; - int32 propertyNameLength; - int32 filePrefixLength; - int32 fileSuffixLength; + uint32 propertyNameLength; + uint32 filePrefixLength; + uint32 fileSuffixLength; } #include "vmware_pack_end.h" VixMsgCreateTempFileRequest; @@ -1306,7 +1320,7 @@ struct VixMsgConnectDeviceRequest { VixCommandRequestHeader header; int32 options; Bool connected; - int32 nameLength; + uint32 nameLength; } #include "vmware_pack_end.h" VixMsgConnectDeviceRequest; @@ -1360,7 +1374,7 @@ struct VixMsgGetDeviceStateRequest { VixCommandRequestHeader header; int32 options; - int32 nameLength; + uint32 nameLength; } #include "vmware_pack_end.h" VixMsgGetDeviceStateRequest; @@ -1417,7 +1431,7 @@ struct VixMsgMountHGFSRequest { int32 mountType; /* The str path list has the form "host1\0dest1\0host2\0dest2\0host3\0dest3\0\0" */ - int32 pathListLength; + uint32 pathListLength; } #include "vmware_pack_end.h" VixMsgMountHGFSRequest; @@ -1454,9 +1468,9 @@ struct VixMsgGetUSBDeviceListResponse { VixCommandResponseHeader header; int32 numRunningDevices; - int32 runningDeviceListLength; + uint32 runningDeviceListLength; - int32 patternListLength; + uint32 patternListLength; } #include "vmware_pack_end.h" VixMsgGetUSBDeviceListResponse; @@ -1512,7 +1526,7 @@ typedef #include "vmware_pack_begin.h" struct VixMsgGetPerformanceDataResponse { VixCommandResponseHeader header; - int32 bufferSize; + uint32 bufferSize; // This is followed by the buffer of serialized properties } #include "vmware_pack_end.h" @@ -1545,7 +1559,7 @@ struct VixMsgSampleCommandRequest { VixCommandRequestHeader header; int32 intArg; - int32 strArgLength; + uint32 strArgLength; } #include "vmware_pack_end.h" VixMsgSampleCommandRequest; @@ -1556,7 +1570,7 @@ struct VixMsgSampleCommandResponse { VixCommandResponseHeader header; int32 intResult; - int32 strResultLength; + uint32 strResultLength; } #include "vmware_pack_end.h" VixMsgSampleCommandResponse; @@ -1584,6 +1598,7 @@ struct VixMsgOpenMsgPostEvent { int32 dialogType; uint64 dialogCookie; + int32 dialogOptions; int32 severity; int32 defaultAnswer; @@ -1591,11 +1606,13 @@ struct VixMsgOpenMsgPostEvent { int32 cancelButton; int32 hintOptions; + uint32 localeStrLength; int32 numMessages; int32 numButtons; /* * Followed by: + * A locale string (a null-terminated string) * A list of messages, each is stored in one VixMsgDialogStr. * A list of button strings (each is a null-terminated string. */ @@ -1603,6 +1620,13 @@ struct VixMsgOpenMsgPostEvent { #include "vmware_pack_end.h" VixMsgOpenMsgPostEvent; +/* + * These are the flags set in the dialogOptions field. + */ +enum VixMsgPostStateValues { + VIX_COMMAND_DIALOG_OPTIONS_VMX_IS_BLOCKED = 0x01, +}; + /* * This is one string in the message. It corresponds to a @@ -1611,8 +1635,8 @@ VixMsgOpenMsgPostEvent; typedef #include "vmware_pack_begin.h" struct VixMsgDialogStr { - int32 idLength; - int32 formatLength; + uint32 idLength; + uint32 formatLength; int32 numArgs; /* * Followed by: @@ -1633,7 +1657,7 @@ typedef #include "vmware_pack_begin.h" struct VixMsgDialogStrArg { int32 argType; - int32 argSize; + uint32 argSize; /* * Followed by the actual argument data. */ @@ -1642,44 +1666,6 @@ struct VixMsgDialogStrArg { VixMsgDialogStrArg; -/* - * Vix_WaitForUserActionInGuest Request - * VIX_COMMAND_WAIT_FOR_USER_ACTION_IN_GUEST - */ - -enum { - // userType - VIX_USERTYPE_ANY = 0, -}; - -enum { - // userAction - VIX_USERACTION_UNKNOWN = -1, - VIX_USERACTION_LOGIN = 0, -}; - -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForUserActionRequest { - VixCommandResponseHeader header; - - int32 userType; - int32 userAction; - - int32 timeoutInSeconds; - int32 options; - - int32 userNameLength; - int32 propertyBufferSize; - - // This is followed by: - // userName - // buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgWaitForUserActionRequest; - - /* * This is used to report a MsgPost is closing. */ @@ -1700,59 +1686,6 @@ struct VixMsgCloseUIDialogEvent { VixMsgCloseUIDialogEvent; -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForUserActionResponse { - VixCommandRequestHeader header; - - Bool actionHappened; - - int32 bufferSize; - // This is followed by the buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgWaitForUserActionResponse; - - - - - - -/* - * This is used to report a MsgPost is opening. - * This is the localized version. It passes the localized message. - * - * See VixMsgOpenMsgPostEvent for the non-localized version. - */ -typedef -#include "vmware_pack_begin.h" -struct VixMsgOpenMsgPostEventLocalized { - VixMsgEventHeader eventHeader; - - int32 dialogType; - uint64 dialogCookie; - - int32 severity; - int32 defaultAnswer; - int32 percent; - int32 cancelButton; - int32 hintOptions; - - int32 localeStrLength; - int32 numMessages; - int32 numButtons; - - /* - * Followed by: - * A locale string (a null-terminated string) - * A list of localized message strings (each is a null-terminated string). - * A list of localized button strings (each is a null-terminated string). - */ -} -#include "vmware_pack_end.h" -VixMsgOpenMsgPostEventLocalized; - - /* * Answer a Msg_Post post/hint/question */ @@ -1770,6 +1703,12 @@ struct VixMsgAnswerMsgPost { uint32 idStrSize; uint32 propertyListBufferSize; + + /* + * Followed by: + * msgIdStr. + * The serialized properties + */ } #include "vmware_pack_end.h" VixMsgAnswerMsgPost; @@ -1783,7 +1722,7 @@ struct VixMsgSetLocaleRequest { int32 localeOptions; - int32 localeStrLength; + uint32 localeStrLength; char localeStr[1]; // This is followed by the country code string. } @@ -1807,9 +1746,12 @@ struct VixMsgLazyProgressEvent { VixMsgLazyProgressEvent; + /* + * ********************************************************** * Debugger related commands. */ + typedef #include "vmware_pack_begin.h" struct VixMsgAttachDebuggerRequest { @@ -1873,6 +1815,56 @@ struct VixMsgDetachDebuggerResponse { VixMsgDetachDebuggerResponse; + + +/* + * ********************************************************** + * Wait for a user action, such as a user logging into the guest. + */ + +/* + * Vix_WaitForUserActionInGuest Request + * VIX_COMMAND_WAIT_FOR_USER_ACTION_IN_GUEST + */ + +typedef +#include "vmware_pack_begin.h" +struct VixMsgWaitForUserActionRequest { + VixCommandResponseHeader header; + + int32 userType; + int32 userAction; + + int32 timeoutInSeconds; + int32 options; + + uint32 userNameLength; + uint32 propertyBufferSize; + + // This is followed by: + // userName + // buffer of serialized properties +} +#include "vmware_pack_end.h" +VixMsgWaitForUserActionRequest; + + +typedef +#include "vmware_pack_begin.h" +struct VixMsgWaitForUserActionResponse { + VixCommandRequestHeader header; + + Bool actionHappened; + + uint32 bufferSize; + // This is followed by the buffer of serialized properties +} +#include "vmware_pack_end.h" +VixMsgWaitForUserActionResponse; + + + + /* * These are values we use to discover hosts and guests through SLPv2. */ @@ -1954,12 +1946,6 @@ enum { VIX_COMMAND_SET_VMDB_VALUES = 60, VIX_COMMAND_READ_XML_FILE = 61, VIX_COMMAND_GET_TOOLS_STATE = 62, - VIX_COMMAND_GUEST_SOCKET_CONNECT = 63, - VIX_COMMAND_GUEST_SOCKET_LISTEN = 64, - VIX_COMMAND_GUEST_SOCKET_ACCEPT = 65, - VIX_COMMAND_GUEST_SOCKET_RECEIVE = 66, - VIX_COMMAND_GUEST_SOCKET_SEND = 67, - VIX_COMMAND_GUEST_SOCKET_CLOSE = 68, VIX_COMMAND_CHANGE_SCREEN_RESOLUTION = 69, VIX_COMMAND_DIRECTORY_EXISTS = 70, VIX_COMMAND_DELETE_GUEST_REGISTRY_KEY = 71, @@ -2043,18 +2029,28 @@ enum { VIX_COMMAND_VMDB_END_TRANSACTION = 133, VIX_COMMAND_VMDB_SET = 134, + VIX_COMMAND_CHANGE_VIRTUAL_HARDWARE = 135, - - VIX_COMMAND_LAST_NORMAL_COMMAND = 134, VIX_COMMAND_HOT_PLUG_CPU = 136, VIX_COMMAND_HOT_PLUG_MEMORY = 137, VIX_COMMAND_HOT_ADD_DEVICE = 138, VIX_COMMAND_HOT_REMOVE_DEVICE = 139, + VIX_COMMAND_DEBUGGER_ATTACH = 140, VIX_COMMAND_DEBUGGER_DETACH = 141, VIX_COMMAND_DEBUGGER_SEND_COMMAND = 142, + VIX_COMMAND_GET_RECORD_STATE = 143, + VIX_COMMAND_SET_RECORD_STATE = 144, + VIX_COMMAND_REMOVE_RECORD_STATE = 145, + VIX_COMMAND_GET_REPLAY_STATE = 146, + VIX_COMMAND_SET_REPLAY_STATE = 147, + VIX_COMMAND_REMOVE_REPLAY_STATE = 148, + + VIX_COMMAND_CANCEL_USER_PROGRESS_MESSAGE = 150, + + VIX_COMMAND_LAST_NORMAL_COMMAND = 151, VIX_TEST_UNSUPPORTED_TOOLS_OPCODE_COMMAND = 998, VIX_TEST_UNSUPPORTED_VMX_OPCODE_COMMAND = 999, }; @@ -2108,7 +2104,6 @@ enum { * to the VMX. */ #define VIX_BACKDOORCOMMAND_RUN_PROGRAM_DONE "Run_Program_Done" -#define VIX_BACKDOORCOMMAND_TOOLS_CMD_DONE "Tools_Command_Done" #define VIX_BACKDOORCOMMAND_PROXY_MESSAGE "VIX_Proxy_Msg" @@ -2175,6 +2170,10 @@ VixError VixMsg_ValidateRequestMsg(void *vMsg, size_t msgLength); VixError VixMsg_ValidateResponseMsg(void *vMsg, size_t msgLength); +VixError VixMsg_ParseWriteVariableRequest(VixMsgWriteVariableRequest *msg, + char **valueName, + char **value); + char *VixMsg_ObfuscateNamePassword(const char *userName, const char *password); diff --git a/open-vm-tools/lib/include/vixOpenSource.h b/open-vm-tools/lib/include/vixOpenSource.h index 708efa85c..6d7512b9e 100644 --- a/open-vm-tools/lib/include/vixOpenSource.h +++ b/open-vm-tools/lib/include/vixOpenSource.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -88,6 +88,17 @@ VixError Vix_TranslateCryptoError(CryptoError cryptoError); VixError Vix_TranslateCOMError(HRESULT comError); #endif +/* + * This defines additional error codes. + * The public error codes are defined in vix.h + * These error codes are in addition to those. + */ +enum { + VIX_E_OP_NOT_SUPPORTED_ON_NON_VMWARE_VM = 3038 + + /* WARNING. Do not exceed 2**16 */ +}; + #endif // VIX_HIDE_BORA_DEPENDENCIES @@ -346,6 +357,16 @@ enum { VIX_VMDB_VARIABLE = 5, }; +/* + * Options for RunProgramInGuest(). + */ +enum { + //VIX_RUNPROGRAM_RETURN_IMMEDIATELY = 0x0001, + //VIX_RUNPROGRAM_ACTIVATE_WINDOW = 0x0002, + /* DEPRECATED VIX_RUNPROGRAM_USE_INTERACTIVE_SESSION = 0x0004, */ + VIX_RUNPROGRAM_RUN_AS_LOCAL_SYSTEM = 0x0008, +}; + /* *----------------------------------------------------------------------------- diff --git a/open-vm-tools/lib/include/vixTools.h b/open-vm-tools/lib/include/vixTools.h index 9c025c3f9..f4c5e61e3 100644 --- a/open-vm-tools/lib/include/vixTools.h +++ b/open-vm-tools/lib/include/vixTools.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -76,9 +76,13 @@ void VixToolsUnimpersonateUser(void *userToken); void VixToolsLogoutUser(void *userToken); +#ifdef _WIN32 VixError VixToolsGetUserTmpDir(void *userToken, char **tmpDirPath); +Bool VixToolsUserIsMemberOfAdministratorGroup(VixCommandRequestHeader *requestMsg); +#endif // _WIN32 + #if IMPLEMENT_SOCKET_MGR VixError VixToolsSocketConnect(VixCommandRequestHeader *requestMsg, char **result); diff --git a/open-vm-tools/lib/include/vmBackup.h b/open-vm-tools/lib/include/vmBackup.h index eb4080bae..7fee6f6d5 100644 --- a/open-vm-tools/lib/include/vmBackup.h +++ b/open-vm-tools/lib/include/vmBackup.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -31,10 +31,14 @@ #include "vmbackup_def.h" #include "dbllnklst.h" +#include "dynarray.h" #include "eventManager.h" #include "rpcin.h" #include "str.h" +#include "unicode.h" +typedef char *Target; +DEFINE_DYNARRAY_TYPE(Target); typedef enum { VMBACKUP_STATUS_PENDING, @@ -85,6 +89,9 @@ typedef struct VmBackupState { Bool generateManifests; Bool clientAborted; intptr_t clientData; + void *scripts; + TargetArray disabledTargets; + ssize_t currentScript; } VmBackupState; typedef Bool (*VmBackupCallback)(VmBackupState *); diff --git a/open-vm-tools/lib/include/vmGuestLib.h b/open-vm-tools/lib/include/vmGuestLib.h index b1ae93a55..20c240474 100644 --- a/open-vm-tools/lib/include/vmGuestLib.h +++ b/open-vm-tools/lib/include/vmGuestLib.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2007 VMware, Inc. All rights reserved. + * Copyright (C) 2003-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmSessionId.h b/open-vm-tools/lib/include/vmSessionId.h index c056cd8ed..9cdeb2d76 100644 --- a/open-vm-tools/lib/include/vmSessionId.h +++ b/open-vm-tools/lib/include/vmSessionId.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vm_app.h b/open-vm-tools/lib/include/vm_app.h index 12fbd1d18..3dfcc8ed4 100644 --- a/open-vm-tools/lib/include/vm_app.h +++ b/open-vm-tools/lib/include/vm_app.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -77,6 +77,8 @@ typedef struct GuestOsStateChangeCmd { #define TOOLSOPTION_SYNCTIME_PERIOD "synctime.period" #define TOOLSOPTION_SYNCTIME_ENABLE "time.synchronize.tools.enable" #define TOOLSOPTION_SYNCTIME_STARTUP "time.synchronize.tools.startup" +#define TOOLSOPTION_MAP_ROOT_HGFS_SHARE "mapRootHgfsShare" +#define TOOLSOPTION_LINK_ROOT_HGFS_SHARE "linkRootHgfsShare" /* * The max selection buffer length has to be less than the diff --git a/open-vm-tools/lib/include/vm_assert.h b/open-vm-tools/lib/include/vm_assert.h index 22beb1db0..68e70c9d1 100644 --- a/open-vm-tools/lib/include/vm_assert.h +++ b/open-vm-tools/lib/include/vm_assert.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -98,8 +98,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/lib/include/vm_atomic.h b/open-vm-tools/lib/include/vm_atomic.h index a1b66d3ef..5cdf7618c 100644 --- a/open-vm-tools/lib/include/vm_atomic.h +++ b/open-vm-tools/lib/include/vm_atomic.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -38,7 +38,6 @@ #define INCLUDE_ALLOW_VMIROM #include "includeCheck.h" - #include "vm_basic_types.h" @@ -117,19 +116,68 @@ Atomic_VolatileToAtomic(volatile uint32 *var) return (Atomic_uint32 *)var; } -EXTERN Bool AtomicUseFence; - - /* - *---------------------------------------------------------------------- + *----------------------------------------------------------------------------- * - * Atomic_SetFence -- + * Atomic_Init, Atomic_SetFence, AtomicUseFence -- * - * Control the use of lfence after an atomic operation + * Determine whether an lfence intruction is executed after + * every locked instruction. * - *---------------------------------------------------------------------- + * Certain AMD processes have a bug (see bug 107024) that + * requires an lfence after every locked instruction. + * + * The global variable AtomicUseFence controls whether lfence + * is used (see AtomicEpilogue). + * + * Atomic_SetFence sets AtomicUseFence to the given value. + * + * Atomic_Init computes and sets AtomicUseFence. + * It does not take into account the number of processors. + * + * The rationale for all this complexity is that Atomic_Init + * is the easy-to-use interface. It can be called a number + * of times cheaply, and does not depend on other libraries. + * However, because the number of CPUs is difficult to compute, + * it does without it and always assumes there are more than one. + * + * For programs that care or have special requirements, + * Atomic_SetFence can be called directly, in addition to Atomic_Init. + * It overrides the effect of Atomic_Init, and can be called + * before, after, or between calls to Atomic_Init. + * + *----------------------------------------------------------------------------- */ +// The freebsd assembler doesn't know the lfence instruction +#if defined(__GNUC__) && \ + __GNUC__ >= 3 && \ + !defined(BSD_VERSION) && \ + (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \ + !defined(__APPLE__) /* PR136775 */ +#define ATOMIC_USE_FENCE +#endif + +#if defined(VMATOMIC_IMPORT_DLLDATA) +VMX86_EXTERN_DATA Bool AtomicUseFence; +#else +EXTERN Bool AtomicUseFence; +#endif + +EXTERN Bool atomicFenceInitialized; + +void AtomicInitFence(void); + +static INLINE void +Atomic_Init(void) +{ +#ifdef ATOMIC_USE_FENCE + if (!atomicFenceInitialized) { + AtomicInitFence(); + } +#endif +} + static INLINE void Atomic_SetFence(Bool fenceAfterLock) /* IN: TRUE to enable lfence */ /* FALSE to disable. */ @@ -139,35 +187,22 @@ Atomic_SetFence(Bool fenceAfterLock) /* IN: TRUE to enable lfence */ extern void Atomic_SetFenceVMKAPI(Bool fenceAfterLock); Atomic_SetFenceVMKAPI(fenceAfterLock); #endif + atomicFenceInitialized = TRUE; } -/* - * Atomic_Init() is a #define instead of a function in lib/atomic to - * avoid lib/user symbol conflicts with stub code in bora_vmsoft - */ -#define Atomic_Init() \ -do { \ - HostinfoCpuIdInfo info; \ - Atomic_SetFence(Hostinfo_GetCpuid(&info) && (info.numLogCPUs > 1) && \ - CPUID_RequiresFence(info.vendor, info.version)); \ -} while (0); /* Conditionally execute fence after interlocked instruction. */ static INLINE void AtomicEpilogue(void) { -// The freebsd assembler doesn't know the lfence instruction -#if defined(__GNUC__) && \ - __GNUC__ >= 3 && \ - !defined(BSD_VERSION) && \ - (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \ - !defined(__APPLE__) /* PR136775 */ +#ifdef ATOMIC_USE_FENCE if (UNLIKELY(AtomicUseFence)) { asm volatile ("lfence" ::: "memory"); } #endif } + /* * All the assembly code is tricky and written conservatively. * For example, to make sure gcc won't introduce copies, @@ -1803,15 +1838,26 @@ Atomic_Write64(Atomic_uint64 *var, // IN } -/* Template code for the Atomic_ type and its operators. --hpreg */ -#define MAKE_ATOMIC_TYPE(name, size, in, out) \ +/* + * Template code for the Atomic_ type and its operators. + * + * The cast argument is an intermedia type cast to make some + * compilers stop complaining about casting uint32 <-> void *, + * even though we only do it in the 32-bit case so they are always + * the same size. So for val of type uint32, instead of + * (void *)val, we have (void *)(uintptr_t)val. + * The specific problem case is the Windows ddk compiler + * (as used by the SVGA driver). -- edward + */ + +#define MAKE_ATOMIC_TYPE(name, size, in, out, cast) \ typedef Atomic_uint ## size Atomic_ ## name; \ \ \ static INLINE out \ Atomic_Read ## name(Atomic_ ## name const *var) \ { \ - return (out)Atomic_Read ## size(var); \ + return (out)(cast)Atomic_Read ## size(var); \ } \ \ \ @@ -1819,7 +1865,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_Write ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Write ## size(var, (uint ## size)val); \ + Atomic_Write ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1827,7 +1873,8 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_ReadWrite ## name(Atomic_ ## name *var, \ in val) \ { \ - return (out)Atomic_ReadWrite ## size(var, (uint ## size)val); \ + return (out)(cast)Atomic_ReadWrite ## size(var, \ + (uint ## size)(cast)val); \ } \ \ \ @@ -1836,8 +1883,8 @@ Atomic_Write64(Atomic_uint64 *var, // IN in oldVal, \ in newVal) \ { \ - return (out)Atomic_ReadIfEqualWrite ## size(var, \ - (uint ## size)oldVal, (uint ## size)newVal); \ + return (out)(cast)Atomic_ReadIfEqualWrite ## size(var, \ + (uint ## size)(cast)oldVal, (uint ## size)(cast)newVal); \ } \ \ \ @@ -1845,7 +1892,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_And ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_And ## size(var, (uint ## size)val); \ + Atomic_And ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1853,7 +1900,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_Or ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Or ## size(var, (uint ## size)val); \ + Atomic_Or ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1861,7 +1908,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_Xor ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Xor ## size(var, (uint ## size)val); \ + Atomic_Xor ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1869,7 +1916,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_Add ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Add ## size(var, (uint ## size)val); \ + Atomic_Add ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1877,7 +1924,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_Sub ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Sub ## size(var, (uint ## size)val); \ + Atomic_Sub ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1899,7 +1946,7 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_ReadOr ## name(Atomic_ ## name *var, \ in val) \ { \ - return (out)Atomic_ReadOr ## size(var, (uint ## size)val); \ + return (out)(cast)Atomic_ReadOr ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1907,21 +1954,21 @@ Atomic_Write64(Atomic_uint64 *var, // IN Atomic_ReadAdd ## name(Atomic_ ## name *var, \ in val) \ { \ - return (out)Atomic_ReadAdd ## size(var, (uint ## size)val); \ + return (out)(cast)Atomic_ReadAdd ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE out \ Atomic_ReadInc ## name(Atomic_ ## name *var) \ { \ - return (out)Atomic_ReadInc ## size(var); \ + return (out)(cast)Atomic_ReadInc ## size(var); \ } \ \ \ static INLINE out \ Atomic_ReadDec ## name(Atomic_ ## name *var) \ { \ - return (out)Atomic_ReadDec ## size(var); \ + return (out)(cast)Atomic_ReadDec ## size(var); \ } @@ -1964,11 +2011,11 @@ Atomic_Write64(Atomic_uint64 *var, // IN * Atomic_ReadDecInt -- */ #if defined(__x86_64__) -MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *) -MAKE_ATOMIC_TYPE(Int, 64, int, int) +MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 64, int, int, int) #else -MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *) -MAKE_ATOMIC_TYPE(Int, 32, int, int) +MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 32, int, int, int) #endif diff --git a/open-vm-tools/lib/include/vm_basic_asm.h b/open-vm-tools/lib/include/vm_basic_asm.h index 898134ef7..64ec425e9 100644 --- a/open-vm-tools/lib/include/vm_basic_asm.h +++ b/open-vm-tools/lib/include/vm_basic_asm.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -413,12 +413,21 @@ __GET_CPUID(int input, CPUIDRegs *regs) #endif } +#ifdef VM_X86_64 + +/* + * No inline assembly in Win64. Implemented in bora/lib/user in + * cpuidMasm64.asm. + */ + +extern void +__GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs); + +#else // VM_X86_64 + static INLINE void __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) { -#ifdef VM_X86_64 - *(int*)0 = 0; // NOT_IMPLEMENTED(); -#else __asm push esi __asm push ebx __asm push ecx @@ -437,8 +446,8 @@ __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) __asm pop ecx __asm pop ebx __asm pop esi -#endif } +#endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) diff --git a/open-vm-tools/lib/include/vm_basic_asm_x86.h b/open-vm-tools/lib/include/vm_basic_asm_x86.h index 598acfad2..27918bcf5 100644 --- a/open-vm-tools/lib/include/vm_basic_asm_x86.h +++ b/open-vm-tools/lib/include/vm_basic_asm_x86.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -100,16 +100,13 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0\n" : "=m" (*save)); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*load)); } static INLINE void @@ -117,7 +114,8 @@ FXRSTOR_AMD_ES0(const uint8 *load) { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __asm__ __volatile__ + ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap @@ -130,8 +128,7 @@ FXRSTOR_AMD_ES0(const uint8 *load) : "m" (dummy), "m" (*load) : "ax"); } - -#endif +#endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- diff --git a/open-vm-tools/lib/include/vm_basic_asm_x86_64.h b/open-vm-tools/lib/include/vm_basic_asm_x86_64.h index a5cbd1ea5..e7006f7b6 100644 --- a/open-vm-tools/lib/include/vm_basic_asm_x86_64.h +++ b/open-vm-tools/lib/include/vm_basic_asm_x86_64.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -84,31 +84,25 @@ uint64 __shiftright128(uint64 lowPart, uint64 highPart, uint8 shift); static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsaveq %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsaveq %0 \n" : "=m" (*save)); } static INLINE void FXSAVE_COMPAT_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0 \n" : "=m" (*save)); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstorq %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstorq %0 \n" : : "m" (*load)); } static INLINE void FXRSTOR_COMPAT_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0 \n" : : "m" (*load)); } static INLINE void @@ -116,7 +110,8 @@ FXRSTOR_AMD_ES0(const uint8 *load) { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __asm__ __volatile__ + ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap @@ -130,7 +125,7 @@ FXRSTOR_AMD_ES0(const uint8 *load) : "ax"); } -#endif +#endif /* __GNUC__ */ /* diff --git a/open-vm-tools/lib/include/vm_basic_defs.h b/open-vm-tools/lib/include/vm_basic_defs.h index 3a7305684..05674b8c5 100644 --- a/open-vm-tools/lib/include/vm_basic_defs.h +++ b/open-vm-tools/lib/include/vm_basic_defs.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -108,6 +108,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -543,14 +545,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/lib/include/vm_basic_types.h b/open-vm-tools/lib/include/vm_basic_types.h index cc4074407..5e35a1500 100644 --- a/open-vm-tools/lib/include/vm_basic_types.h +++ b/open-vm-tools/lib/include/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/lib/include/vm_ctype.h b/open-vm-tools/lib/include/vm_ctype.h index 5a9c4db89..ccb1b5b19 100644 --- a/open-vm-tools/lib/include/vm_ctype.h +++ b/open-vm-tools/lib/include/vm_ctype.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vm_legal.h b/open-vm-tools/lib/include/vm_legal.h index b0b7e7ba6..8f5409017 100644 --- a/open-vm-tools/lib/include/vm_legal.h +++ b/open-vm-tools/lib/include/vm_legal.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vm_product.h b/open-vm-tools/lib/include/vm_product.h index 719a434f3..ade5afb4b 100644 --- a/open-vm-tools/lib/include/vm_product.h +++ b/open-vm-tools/lib/include/vm_product.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -126,20 +126,63 @@ #define PRODUCT_DDK_NAME MAKE_NAME("ESX DDK") +#define PRODUCT_VDM_SHORT_NAME "VDM" +#define PRODUCT_VDM_NAME MAKE_NAME("Virtual Desktop Manager") + // XXX VMvisor is the underlying technology for possibly several products, // XXX not the product. Fix when names are decided. #define PRODUCT_VMVISOR_NAME MAKE_NAME("VMvisor") +/* + * VMware Remote Console version definitions + */ + #define PRODUCT_VMRC_SHORT_NAME "VMRC" -#define PRODUCT_VMRC_NAME MAKE_NAME("Virtual Machine Remote Console") +#define PRODUCT_VMRC_NAME MAKE_NAME("Remote Console") #define PRODUCT_VMRC_PLUGIN_NAME PRODUCT_VMRC_NAME " Plug-in" #define PRODUCT_VMRC_DESCRIPTION "Enables remote interaction with virtual machines." #ifdef _WIN32 #define PRODUCT_VMRC_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-vmrc.exe" +#define PRODUCT_VMRC_MIMETYPE_SEPARATOR "|" +#define PRODUCT_VMRC_MIMETYPE_TERMINATOR "" #else #define PRODUCT_VMRC_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-vmrc" +#define PRODUCT_VMRC_MIMETYPE_SEPARATOR "::" PRODUCT_VMRC_PLUGIN_NAME ";" +#define PRODUCT_VMRC_MIMETYPE_TERMINATOR "::" PRODUCT_VMRC_PLUGIN_NAME ";" #endif +/* + * current Gecko/WebKit plugin mimetype + */ + +#define PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE \ + "application/x-vmware-vmrc;version=" \ + VMRC_PLUGIN_VERSION "." BUILD_NUMBER_NUMERIC_STRING PRODUCT_VMRC_MIMETYPE_SEPARATOR + +/* + * previously shipped plugin mimetypes (updated as we ship them) + */ +#define PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES \ + "application/x-vmware-vmrc;version=2.5.0.0" \ + PRODUCT_VMRC_MIMETYPE_TERMINATOR + +/* + * legacy plugin mimetypes + */ +#define PRODUCT_VMRC_PLUGIN_LEGACY_MIMETYPES \ + "application/x-vmware-mks;version=2.5.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + "application/x-vmware-mks;version=2.1.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + "application/x-vmware-mks;version=2.0.1.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + "application/x-vmware-mks;version=2.0.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR + +/* + * All plugin mimetypes + */ +#define PRODUCT_VMRC_PLUGIN_MIMETYPES \ + PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE \ + PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES \ + // PRODUCT_VMRC_PLUGIN_LEGACY_MIMETYPES /* Legacy support disabled */ + /* * TODO: This properly lives in productState, but we need it here to * define DEFAULT_LIBDIRECTORY. If that can be moved to productState, diff --git a/open-vm-tools/lib/include/vm_tools_version.h b/open-vm-tools/lib/include/vm_tools_version.h index b97a3ad59..bd6a8cf57 100644 --- a/open-vm-tools/lib/include/vm_tools_version.h +++ b/open-vm-tools/lib/include/vm_tools_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -690,6 +690,13 @@ typedef uint32 ToolsVersion; #define TOOLS_VERSION_ESX310_RELEASE_V_MNR 4 #define TOOLS_VERSION_ESX310_RELEASE_V_BASE 3 +#ifndef RC_INVOKED +#define TOOLS_VERSION_ESX310_UPDATE1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_ESX310_UPDATE1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_ESX310_UPDATE1_V_MJR 7 +#define TOOLS_VERSION_ESX310_UPDATE1_V_MNR 4 +#define TOOLS_VERSION_ESX310_UPDATE1_V_BASE 4 + #ifndef RC_INVOKED #define TOOLS_VERSION_SERVER20_FF TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_FF_V) #endif /* RC_INVOKED */ @@ -725,9 +732,16 @@ typedef uint32 ToolsVersion; #define TOOLS_VERSION_SERVER20_BETA1_V_MNR 7 #define TOOLS_VERSION_SERVER20_BETA1_V_BASE 0 -#define TOOLS_VERSION_CURRENT TOOLS_VERSION_SERVER20_BETA1 -#define TOOLS_VERSION_CURRENT_STR TOOLS_VERSION_TO_STR(TOOLS_VERSION_SERVER20_BETA1) -#define TOOLS_VERSION_CURRENT_CSV TOOLS_VERSION_TO_CSV(TOOLS_VERSION_SERVER20_BETA1) +#ifndef RC_INVOKED +#define TOOLS_VERSION_SERVER20_BETA2 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_BETA2_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_SERVER20_BETA2_V_MJR 7 +#define TOOLS_VERSION_SERVER20_BETA2_V_MNR 7 +#define TOOLS_VERSION_SERVER20_BETA2_V_BASE 1 + +#define TOOLS_VERSION_CURRENT TOOLS_VERSION_SERVER20_BETA2 +#define TOOLS_VERSION_CURRENT_STR TOOLS_VERSION_TO_STR(TOOLS_VERSION_SERVER20_BETA2) +#define TOOLS_VERSION_CURRENT_CSV TOOLS_VERSION_TO_CSV(TOOLS_VERSION_SERVER20_BETA2) /* * The extended Tools version is the current Tools version with the diff --git a/open-vm-tools/lib/include/vm_version.h b/open-vm-tools/lib/include/vm_version.h index 412884af0..d7f639b9e 100644 --- a/open-vm-tools/lib/include/vm_version.h +++ b/open-vm-tools/lib/include/vm_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -210,7 +210,18 @@ #define VIM_API_VERSION "2.5.0" #define VIPERL_VERSION "1.1.0" #define RCLI_VERSION "1.5.0" -#define TOOLS_VERSION "2008.02.13" + +// VMRC_PLUGIN_VERSION should match PLAYER_VERSION but can't be e.x.p +#define VMRC_PLUGIN_VERSION "2.5.0" +#define VMRC_PLUGIN_VERSION_COMMAS 2,5,0,PRODUCT_BUILD_NUMBER_NUMERIC + +/* + * When setting the Tools product version, please use the string corresponding + * to TOOLS_VERSION_CURRENT_STR from vm_tools_version.h. + * + * XXX: The extract-macro script should be updated to handle this special case. + */ +#define TOOLS_VERSION "2008.04.14" #ifdef VMX86_VPX #define VIM_API_TYPE "VirtualCenter" @@ -325,7 +336,6 @@ #define ACE_MGMT_SERVER_VERSION_STRING_FOR_LICENSE "2.0" - /* * The configuration file version string should be changed * whenever we make incompatible changes to the config file @@ -355,6 +365,7 @@ #define CONFIG_VERSION_UNDOPOINT "7" /* Undopoint paradigm (WS40) */ #define CONFIG_VERSION_WS4 "7" /* config version of WS4.0.x */ #define CONFIG_VERSION_MSNAP "8" /* Multiple Snapshots */ +#define CONFIG_VERSION_WS5 "8" /* WS5.0 */ #define VMVISOR_VERSION "99.99.99" diff --git a/open-vm-tools/lib/include/vmbackup_def.h b/open-vm-tools/lib/include/vmbackup_def.h index b28b8bcf4..69b3b382e 100644 --- a/open-vm-tools/lib/include/vmbackup_def.h +++ b/open-vm-tools/lib/include/vmbackup_def.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmblock.h b/open-vm-tools/lib/include/vmblock.h index 255a0a77e..fe58c02ec 100644 --- a/open-vm-tools/lib/include/vmblock.h +++ b/open-vm-tools/lib/include/vmblock.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmcheck.h b/open-vm-tools/lib/include/vmcheck.h index b34d798d8..2deb404d0 100644 --- a/open-vm-tools/lib/include/vmcheck.h +++ b/open-vm-tools/lib/include/vmcheck.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmsignal.h b/open-vm-tools/lib/include/vmsignal.h index cf6486c80..ec25a9cd3 100644 --- a/open-vm-tools/lib/include/vmsignal.h +++ b/open-vm-tools/lib/include/vmsignal.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmstdio.h b/open-vm-tools/lib/include/vmstdio.h index baed3294f..36ec8be8d 100644 --- a/open-vm-tools/lib/include/vmstdio.h +++ b/open-vm-tools/lib/include/vmstdio.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmware.h b/open-vm-tools/lib/include/vmware.h index bea3930bf..7045899ad 100644 --- a/open-vm-tools/lib/include/vmware.h +++ b/open-vm-tools/lib/include/vmware.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmware_pack_begin.h b/open-vm-tools/lib/include/vmware_pack_begin.h index fed515047..3f901103c 100644 --- a/open-vm-tools/lib/include/vmware_pack_begin.h +++ b/open-vm-tools/lib/include/vmware_pack_begin.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmware_pack_end.h b/open-vm-tools/lib/include/vmware_pack_end.h index f4476f7f1..14a59b448 100644 --- a/open-vm-tools/lib/include/vmware_pack_end.h +++ b/open-vm-tools/lib/include/vmware_pack_end.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/vmware_pack_init.h b/open-vm-tools/lib/include/vmware_pack_init.h index 029f4bd6a..32ed3873b 100644 --- a/open-vm-tools/lib/include/vmware_pack_init.h +++ b/open-vm-tools/lib/include/vmware_pack_init.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/win32util.h b/open-vm-tools/lib/include/win32util.h new file mode 100644 index 000000000..4439e8be3 --- /dev/null +++ b/open-vm-tools/lib/include/win32util.h @@ -0,0 +1,206 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * Win32Util.h -- + * + * misc Windows utilities + */ + +#ifndef WIN32UTIL_H_ +#define WIN32UTIL_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#include "includeCheck.h" + +#include "vm_basic_types.h" +#include "unicodeTypes.h" + +#ifdef _WIN32 + +#include + +/* Type definitions */ + +typedef enum AutorunState { + AUTORUN_UNDEFINED, + AUTORUN_ON, + AUTORUN_OFF +} AutorunState; + +/* Defines */ +#define VMX_SHUTDOWN_ORDER 0x100 // Application reserved last shutdown range. +#define UI_SHUTDOWN_ORDER 0x300 // Application reserved first shutdown range. + +/* Function declarations */ + +Unicode W32Util_GetInstallPath(void); +Unicode W32Util_GetInstallPath64(void); + +/* + * The string returned is allocated on the heap and must be freed by the + * calling routine. + */ + + +Unicode W32Util_GetAppDataFilePath(ConstUnicode fileName); +Unicode W32Util_GetLocalAppDataFilePath(ConstUnicode fileName); + +Unicode W32Util_GetCommonAppDataFilePath(ConstUnicode fileName); +Unicode W32Util_GetVmwareCommonAppDataFilePath(ConstUnicode fileName); + +Unicode W32Util_GetMyDocumentPath(void); +Unicode W32Util_GetMyVideoPath(BOOL myDocumentsOnFail); + +Unicode W32Util_GetDefaultVMPath(ConstUnicode pref); +Unicode W32Util_GetInstalledFilePath(ConstUnicode fileName); +Unicode W32Util_GetInstalledFilePath64(ConstUnicode fileName); + +HKEY W32Util_OpenProductRegKey(REGSAM access); +HKEY W32Util_OpenUserRegKey(REGSAM access); + +LPTOP_LEVEL_EXCEPTION_FILTER W32Util_SetUnhandledExceptionFilter(void); + +/* + * Duplicated from util.h, including this header introduces + * other problems such as dependencies on vm_assert.h, as well + * as redefining Windows macros in windows-specific files. + * So we define it here also. + */ + +void W32Util_SplitCommandLine(char *commandLine, + int maxArgs, + char *progName, + int *argc, + char **argv); + +BOOL W32Util_ReadFileTimeout(HANDLE hFile, // handle of file to read + LPVOID lpBuffer, // pointer to buffer that receives data + DWORD nNumberOfBytesToRead, // number of bytes to read + LPDWORD lpNumberOfBytesRead, // pointer to number of bytes read + DWORD msTimeout); // timeout in milliseconds + +BOOL W32Util_WriteFileTimeout(HANDLE hFile, // handle to file to write to + LPCVOID lpBuffer, // pointer to data to write to file + DWORD nNumberOfBytesToWrite, // number of bytes to write + LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written + DWORD msTimeout); // timeout in milliseconds + +Unicode W32Util_RealPath(ConstUnicode path); + +BOOL W32Util_CheckForPrivilegeHeld(HANDLE token, LPCTSTR priv); + +typedef BOOL (*SidFilterFunction)(PSID psid, void *cbData); +BOOL W32Util_GetEffectiveRightsForName(ConstUnicode user, + ConstUnicode path, + DWORD *rights); +BOOL W32Util_GetEffectiveRightsForSid(PSID psid, + ConstUnicode path, + DWORD *rights); + +BOOL W32Util_ModifyRights(PSID psid, + ConstUnicode path, + DWORD rights, + BOOL isAllow); +void W32Util_FreeSids(PSID *sidList); +BOOL W32Util_GetMatchingSids(ConstUnicode path, + PSID **psidList, + SidFilterFunction matchCb, + void *cbData); + +LPSTR W32Util_WideStrToAsciiStr(LPCWSTR wideStr); +LPWSTR W32Util_AsciiStrToWideStr(LPCSTR multiStr); +LPSTR W32Util_WideStrToMultiByteStr(LPCWSTR wideStr, UINT codePage); +LPWSTR W32Util_MultiByteStrToWideStr(LPCSTR multiStr, UINT codePage); + +BOOL W32Util_WinSockAddReference(void); +BOOL W32Util_WinSockDereference(void); + +Bool W32Util_RegisterService(Bool bRegister, + ConstUnicode name, + ConstUnicode displayName, + ConstUnicode description, + ConstUnicode binaryPath, + Unicode *errString); + +Bool W32Util_DebugService(ConstUnicode dbgFile); + +Bool W32Util_RegisterEventLog(ConstUnicode serviceName, + DWORD typesSupported, + ConstUnicode eventMsgFile, + ConstUnicode categoryMsgFile, + DWORD categoryCount, + ConstUnicode paramMsgFile); +Bool W32Util_UnregisterEventLog(ConstUnicode serviceName); + +Bool W32Util_SetSDWithVmGroupPriv(PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD accessType, PACL *pAcl, + Unicode *errString); + +Bool W32Util_SetSDWithVmGroupPrivEx(PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD accessType, Bool addCurrentUser, + PACL *pAcl, Unicode *errString); + +BOOL W32Util_SetSecurityDescriptorW(PSECURITY_DESCRIPTOR pSecurityDescriptor, + ConstUnicode Owner, PACL *pAcl); +BOOL W32Util_SetSecurityDescriptorSid(PSECURITY_DESCRIPTOR sd, PSID sid, + PACL *pAcl); +BOOL W32Util_GetThreadHandle(HANDLE *handle); + +#ifdef VMX86_DEVEL +BOOL W32Util_HookImportedFunction(HMODULE hModule, + LPCSTR szImportMod, + LPCSTR szFuncToHook, + FARPROC newProc, + FARPROC *pOrigFunc); +#endif + +Bool W32Util_AccessCheck(HANDLE token, + PSECURITY_DESCRIPTOR pSecurityDescriptor, + int desiredAccess); + +Bool W32Util_HasAccessToFile(ConstUnicode filename, ACCESS_MASK desiredAccess, + HANDLE token); + +Bool W32Util_GetSecurityDescriptor(ConstUnicode path, + PSECURITY_DESCRIPTOR *ppSecurityDescriptor); + +void W32Util_InitStdioConsole(void); +void W32Util_ExitStdioConsole(void); + +Bool W32Util_CreateWellKnownSid(WELL_KNOWN_SID_TYPE wsdType, + PSID domainSid, + PSID *pSid); + +Bool W32Util_GetCurrentUserSid(PSID *pSid); +Bool W32Util_GetLocalAdminGroupSid(PSID *pSid); +Bool W32Util_GetLocalAdminGroupSid(PSID *pSid); +Bool W32Util_MakeSafeDirectory(ConstUnicode path); +Bool W32Util_IsDirectorySafe(ConstUnicode path); +Bool W32Util_DoesVolumeSupportAcls(ConstUnicode path); + +Bool W32Util_GetRegistryAutorun(AutorunState* state); +Bool W32Util_SetRegistryAutorun(const AutorunState state); + +Bool W32Util_AllowAdminCOM(void); + +Unicode W32Util_GetAppDataPath(void); +Unicode W32Util_RobustGetLongPath(ConstUnicode path); + +#endif // _WIN32 +#endif // WIN32UTIL_H_ diff --git a/open-vm-tools/lib/include/wiper.h b/open-vm-tools/lib/include/wiper.h index 97bf4ab0d..1a70f8e49 100644 --- a/open-vm-tools/lib/include/wiper.h +++ b/open-vm-tools/lib/include/wiper.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/include/x86cpuid.h b/open-vm-tools/lib/include/x86cpuid.h index 32f76ec73..45729115e 100644 --- a/open-vm-tools/lib/include/x86cpuid.h +++ b/open-vm-tools/lib/include/x86cpuid.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -92,6 +92,8 @@ typedef struct CPUIDResult { #define CPUID_UNCACHED_LEVELS \ CPUIDLEVEL(FALSE, 4, 4) \ + CPUIDLEVEL(FALSE, 5, 5) \ + CPUIDLEVEL(FALSE, 6, 6) \ CPUIDLEVEL(FALSE, A, 0xA) \ CPUIDLEVEL(FALSE, 86, 0x80000006) \ CPUIDLEVEL(FALSE, 87, 0x80000007) \ @@ -248,6 +250,8 @@ FLAGDEF( 1, ECX, INTEL, 21, 1, X2APIC, MASK, 0, FALSE) FLAGDEF( 1, ECX, INTEL, 22, 1, MOVBE, RSVD, 0, TRUE) \ FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, HOST, 0, TRUE, POPCNT) \ FLAGDEF( 1, ECX, INTEL, 24, 1, ULE, RSVD, 0, TRUE) \ +FLAGDEF( 1, ECX, INTEL, 26, 1, XSAVE, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 27, 1, OSXSAVE, RSVD, 0, TRUE) \ FLAGDEFA( 1, ECX, COMMON, 31, 1, HYPERVISOR, IGNORE, 0, FALSE, HYPERVISOR)\ FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, HOST, 0, TRUE, FPU) \ FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, HOST, 0, FALSE, VME) \ @@ -290,6 +294,25 @@ FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, IGNORE, 0, FALSE) FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, IGNORE, 0, FALSE) \ FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, IGNORE, 0, FALSE) +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_5 \ +FIELDDEF( 5, EAX, COMMON, 0, 16, MWAIT_MIN_SIZE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EBX, COMMON, 0, 16, MWAIT_MAX_SIZE, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 0, 1, MWAIT_EXTENSIONS, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 1, 1, MWAIT_INTR_BREAK, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 0, 4, MWAIT_C0_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 4, 4, MWAIT_C1_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 8, 4, MWAIT_C2_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 12, 4, MWAIT_C3_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 16, 4, MWAIT_C4_SUBSTATE, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_6 \ +FLAGDEF( 6, EAX, INTEL, 0, 1, THERMAL_SENSOR, IGNORE, 0, FALSE) \ +FLAGDEF( 6, EAX, INTEL, 1, 1, TURBO_MODE, IGNORE, 0, FALSE) \ +FIELDDEF( 6, EBX, INTEL, 0, 4, NUM_INTR_THRESHOLDS, IGNORE, 0, FALSE) \ +FLAGDEF( 6, ECX, INTEL, 0, 1, HW_COORD_FEEDBACK, IGNORE, 0, FALSE) + /* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_A \ FIELDDEF( A, EAX, INTEL, 0, 8, PMC_VERSION, IGNORE, 0, FALSE) \ @@ -371,6 +394,14 @@ FIELDDEF( 86, ECX, AMD, 0, 8, CACHE_LINE, IGNORE, 0, FALSE) FIELDDEF( 86, ECX, AMD, 8, 4, CACHE_LINE_PER_TAG, IGNORE, 0, FALSE) \ FIELDDEF( 86, ECX, AMD, 12, 4, CACHE_WAYS, IGNORE, 0, FALSE) \ FIELDDEF( 86, ECX, AMD, 16, 16, CACHE_SIZE, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 0, 1, TS, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 1, 1, FID, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 2, 1, VID, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 3, 1, TTP, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 4, 1, TM, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 5, 1, STC, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 6, 1, 100MHZSTEPS, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 7, 1, HWPSTATE, IGNORE, 0, FALSE) \ FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, IGNORE, 0, FALSE) \ FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, IGNORE, 0, FALSE, PHYS_BITS) \ FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, IGNORE, 0, FALSE, VIRT_BITS) \ @@ -391,6 +422,8 @@ FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, MASK, 0, FALSE) CPUID_FIELD_DATA_LEVEL_0 \ CPUID_FIELD_DATA_LEVEL_1 \ CPUID_FIELD_DATA_LEVEL_4 \ + CPUID_FIELD_DATA_LEVEL_5 \ + CPUID_FIELD_DATA_LEVEL_6 \ CPUID_FIELD_DATA_LEVEL_A \ CPUID_FIELD_DATA_LEVEL_80 \ CPUID_FIELD_DATA_LEVEL_81 \ @@ -519,6 +552,13 @@ FIELD_FUNC(AMD_CORE_COUNT, CPUID_AMD_ID88ECX_CORE_COUNT) FIELD_FUNC(AMD_APICID_COREID_SIZE, CPUID_AMD_ID88ECX_APICID_COREID_SIZE) FIELD_FUNC(AMD_EXTAPICSPC, CPUID_AMD_ID81ECX_EXTAPICSPC) FIELD_FUNC(NUM_PMCS, CPUID_INTEL_IDAEAX_NUM_PMCS) +FIELD_FUNC(MWAIT_MIN_SIZE, CPUID_COMMON_ID5EAX_MWAIT_MIN_SIZE) +FIELD_FUNC(MWAIT_MAX_SIZE, CPUID_COMMON_ID5EBX_MWAIT_MAX_SIZE) +FIELD_FUNC(MWAIT_C0_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C0_SUBSTATE) +FIELD_FUNC(MWAIT_C1_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C1_SUBSTATE) +FIELD_FUNC(MWAIT_C2_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C2_SUBSTATE) +FIELD_FUNC(MWAIT_C3_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C3_SUBSTATE) +FIELD_FUNC(MWAIT_C4_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C4_SUBSTATE) #undef FIELD_FUNC @@ -706,19 +746,52 @@ CPUID_FullyWritableTSC(Bool isIntel, // IN CPUID_FAMILY(v) < CPUID_FAMILY_K8)); } + /* * For certain AMD processors, an lfence instruction is necessary at various * places to ensure ordering. */ + +static INLINE Bool +CPUID_VendorRequiresFence(CpuidVendors vendor) +{ + return vendor == CPUID_VENDOR_AMD; +} + +static INLINE Bool +CPUID_VersionRequiresFence(uint32 version) +{ + return CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8 && + CPUID_EFFECTIVE_MODEL(version) < 0x40; +} + +static INLINE Bool +CPUID_ID0RequiresFence(CPUIDRegs *id0) +{ + if (id0->eax == 0) { + return FALSE; + } + // hard to get strcmp() in some environments, so do it in the raw + return (id0->ebx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 0) && + id0->ecx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 4) && + id0->edx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 8)); +} + +static INLINE Bool +CPUID_ID1RequiresFence(CPUIDRegs *id1) +{ + return CPUID_VersionRequiresFence(id1->eax); +} + static INLINE Bool CPUID_RequiresFence(CpuidVendors vendor, // IN uint32 version) // IN: %eax from CPUID with %eax=1. { - return ((vendor == CPUID_VENDOR_AMD) && - (CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8) && - (CPUID_EFFECTIVE_MODEL(version) < 0x40)); + return CPUID_VendorRequiresFence(vendor) && + CPUID_VersionRequiresFence(version); } + /* * The following low-level functions compute the number of * cores per cpu. They should be used cautiously because diff --git a/open-vm-tools/lib/message/Makefile.in b/open-vm-tools/lib/message/Makefile.in index 395b0e4f9..620cd4f22 100644 --- a/open-vm-tools/lib/message/Makefile.in +++ b/open-vm-tools/lib/message/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -116,7 +116,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -128,7 +127,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -153,7 +152,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -162,6 +160,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -169,7 +169,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -383,8 +383,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -409,8 +409,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -420,12 +420,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/message/message.c b/open-vm-tools/lib/message/message.c index ec837394e..66d1d69c9 100644 --- a/open-vm-tools/lib/message/message.c +++ b/open-vm-tools/lib/message/message.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/message/messageBackdoor.c b/open-vm-tools/lib/message/messageBackdoor.c index 2f0bb2f13..4276d2360 100644 --- a/open-vm-tools/lib/message/messageBackdoor.c +++ b/open-vm-tools/lib/message/messageBackdoor.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/message/messageStub.c b/open-vm-tools/lib/message/messageStub.c index ea96d4a7b..dea541ff9 100644 --- a/open-vm-tools/lib/message/messageStub.c +++ b/open-vm-tools/lib/message/messageStub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/message/shared/Makefile.in b/open-vm-tools/lib/message/shared/Makefile.in index 8ce6bf570..95d91549c 100644 --- a/open-vm-tools/lib/message/shared/Makefile.in +++ b/open-vm-tools/lib/message/shared/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -104,7 +104,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -116,7 +115,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -141,7 +140,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,6 +148,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -157,7 +157,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -326,8 +326,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -339,8 +339,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -350,12 +350,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/misc/Makefile.am b/open-vm-tools/lib/misc/Makefile.am index ea3607e7a..1a178521b 100644 --- a/open-vm-tools/lib/misc/Makefile.am +++ b/open-vm-tools/lib/misc/Makefile.am @@ -18,9 +18,11 @@ noinst_LIBRARIES = libMisc.a libMisc_a_SOURCES = +libMisc_a_SOURCES += atomic.c libMisc_a_SOURCES += base64.c libMisc_a_SOURCES += codeset.c libMisc_a_SOURCES += dbllnklst.c +libMisc_a_SOURCES += dynarray.c libMisc_a_SOURCES += dynbuf.c libMisc_a_SOURCES += escape.c libMisc_a_SOURCES += hashTable.c @@ -34,6 +36,8 @@ libMisc_a_SOURCES += random.c libMisc_a_SOURCES += timeutil.c libMisc_a_SOURCES += util_misc.c libMisc_a_SOURCES += vmstdio.c +libMisc_a_SOURCES += posixPosix.c +libMisc_a_SOURCES += posixDlopen.c AM_CFLAGS = AM_CFLAGS += @COMMON_CFLAGS@ diff --git a/open-vm-tools/lib/misc/Makefile.in b/open-vm-tools/lib/misc/Makefile.in index 210cd2abc..134181754 100644 --- a/open-vm-tools/lib/misc/Makefile.in +++ b/open-vm-tools/lib/misc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -61,12 +61,13 @@ LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libMisc_a_AR = $(AR) $(ARFLAGS) libMisc_a_LIBADD = -am_libMisc_a_OBJECTS = base64.$(OBJEXT) codeset.$(OBJEXT) \ - dbllnklst.$(OBJEXT) dynbuf.$(OBJEXT) escape.$(OBJEXT) \ - hashTable.$(OBJEXT) hostinfo_misc.$(OBJEXT) hostname.$(OBJEXT) \ - idLinux.$(OBJEXT) iovector.$(OBJEXT) machineID.$(OBJEXT) \ - miscSolaris.$(OBJEXT) random.$(OBJEXT) timeutil.$(OBJEXT) \ - util_misc.$(OBJEXT) vmstdio.$(OBJEXT) +am_libMisc_a_OBJECTS = atomic.$(OBJEXT) base64.$(OBJEXT) \ + codeset.$(OBJEXT) dbllnklst.$(OBJEXT) dynarray.$(OBJEXT) \ + dynbuf.$(OBJEXT) escape.$(OBJEXT) hashTable.$(OBJEXT) \ + hostinfo_misc.$(OBJEXT) hostname.$(OBJEXT) idLinux.$(OBJEXT) \ + iovector.$(OBJEXT) machineID.$(OBJEXT) miscSolaris.$(OBJEXT) \ + random.$(OBJEXT) timeutil.$(OBJEXT) util_misc.$(OBJEXT) \ + vmstdio.$(OBJEXT) posixPosix.$(OBJEXT) posixDlopen.$(OBJEXT) libMisc_a_OBJECTS = $(am_libMisc_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -120,7 +121,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -132,7 +132,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -157,7 +157,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -166,6 +165,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -173,7 +174,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -231,10 +232,10 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libMisc.a -libMisc_a_SOURCES = base64.c codeset.c dbllnklst.c dynbuf.c escape.c \ - hashTable.c hostinfo_misc.c hostname.c idLinux.c iovector.c \ - machineID.c miscSolaris.c random.c timeutil.c util_misc.c \ - vmstdio.c +libMisc_a_SOURCES = atomic.c base64.c codeset.c dbllnklst.c dynarray.c \ + dynbuf.c escape.c hashTable.c hostinfo_misc.c hostname.c \ + idLinux.c iovector.c machineID.c miscSolaris.c random.c \ + timeutil.c util_misc.c vmstdio.c posixPosix.c posixDlopen.c AM_CFLAGS = @COMMON_CFLAGS@ @LIB_MISC_CFLAGS@ SUBDIRS = shared all: all-recursive @@ -284,9 +285,11 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codeset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbllnklst.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynarray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashTable.Po@am__quote@ @@ -296,6 +299,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iovector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machineID.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscSolaris.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixDlopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixPosix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util_misc.Po@am__quote@ @@ -403,8 +408,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -429,8 +434,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -440,12 +445,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/misc/atomic.c b/open-vm-tools/lib/misc/atomic.c new file mode 100644 index 000000000..6170dacef --- /dev/null +++ b/open-vm-tools/lib/misc/atomic.c @@ -0,0 +1,81 @@ +/********************************************************* + * Copyright (C) 2006 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. + * + *********************************************************/ + +/* + * atomic.c -- + * + * Support for atomic instructions. + * + * This is the user-level version. + * The monitor-only version is in vmcore/vmm/main. + */ + +#include "vmware.h" +#include "vm_atomic.h" +#include "x86cpuid.h" +#include "vm_basic_asm.h" + + +Bool AtomicUseFence; + +Bool atomicFenceInitialized; + + +/* + *----------------------------------------------------------------------------- + * + * AtomicInitFence -- + * + * Compute AtomicUseFence. + * + * This version of fence initialization doesn't take into account + * the number of CPUs. Code that cares uses Atomic_SetFence() directly. + * See Atomic_Init in vm_atomic.h. + * + * This code is rather weird because while the logic belongs + * in x86cpuid.h, it's almost impossible to put this whole function + * there, so here it is. -- edward + * + * Results: + * None. + * + * Side effects: + * As described. + * + *----------------------------------------------------------------------------- + */ + +void +AtomicInitFence(void) +{ + CPUIDRegs regs; + Bool needFence; + + ASSERT(!atomicFenceInitialized); + + needFence = FALSE; + __GET_CPUID(0, ®s); + if (CPUID_ID0RequiresFence(®s)) { + __GET_CPUID(1, ®s); + if (CPUID_ID1RequiresFence(®s)) { + needFence = TRUE; + } + } + + Atomic_SetFence(needFence); +} diff --git a/open-vm-tools/lib/misc/codeset.c b/open-vm-tools/lib/misc/codeset.c index 56202c0e7..747f2a059 100644 --- a/open-vm-tools/lib/misc/codeset.c +++ b/open-vm-tools/lib/misc/codeset.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -33,6 +33,7 @@ #if defined(_WIN32) # include # include +# include #else # include # include @@ -622,8 +623,6 @@ exit: #endif /* defined(__APPLE__) */ -#ifdef USE_ICONV - /* * Linux-specific remarks: * @@ -639,14 +638,14 @@ exit: /* *----------------------------------------------------------------------------- * - * CodeSetGetCurrentCodeSet -- + * CodeSet_GetCurrentCodeSet -- * * Return currently active code set - always UTF-8 on Apple (and old Linux), * and reported by nl_langinfo on Linux & Solaris. * * Results: - * TRUE on success - * FALSE on failure + * The name of the current code set on success + * * * Side effects: * None @@ -654,8 +653,8 @@ exit: *----------------------------------------------------------------------------- */ -static INLINE const char * -CodeSetGetCurrentCodeSet(void) +const char * +CodeSet_GetCurrentCodeSet(void) { #if defined(CURRENT_IS_UTF8) /* @@ -668,6 +667,12 @@ CodeSetGetCurrentCodeSet(void) */ return "UTF-8"; +#elif defined(_WIN32) + static char ret[20]; // max is "windows-4294967296" + + Str_Sprintf(ret, sizeof(ret), "windows-%u", GetACP()); + + return ret; #else return nl_langinfo(CODESET); #endif @@ -857,7 +862,6 @@ error: return FALSE; } #endif -#endif /* @@ -937,7 +941,7 @@ CodeSet_Utf8ToCurrent(char const *bufIn, // IN DynBuf_Init(&db); ok = CodeSetGenericToGeneric("UTF-8", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, CSGTG_NORMAL); + CodeSet_GetCurrentCodeSet(), &db, CSGTG_NORMAL); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #elif defined(_WIN32) char *buf; @@ -1002,7 +1006,7 @@ CodeSet_Utf8ToCurrentTranslit(char const *bufIn, // IN DynBuf_Init(&db); ok = CodeSetGenericToGeneric("UTF-8", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, + CodeSet_GetCurrentCodeSet(), &db, CSGTG_TRANSLIT | CSGTG_IGNORE); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #elif defined(_WIN32) @@ -1065,7 +1069,7 @@ CodeSet_CurrentToUtf8(char const *bufIn, // IN Bool ok; DynBuf_Init(&db); - ok = CodeSetGenericToGeneric(CodeSetGetCurrentCodeSet(), bufIn, sizeIn, + ok = CodeSetGenericToGeneric(CodeSet_GetCurrentCodeSet(), bufIn, sizeIn, "UTF-8", &db, CSGTG_NORMAL); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #elif defined(_WIN32) @@ -1422,7 +1426,7 @@ CodeSet_CurrentToUtf16le(char const *bufIn, // IN #if defined(CURRENT_IS_UTF8) ok = CodeSetUtf8ToUtf16le(bufIn, sizeIn, &db); #elif defined(USE_ICONV) - ok = CodeSetGenericToGeneric(CodeSetGetCurrentCodeSet(), bufIn, sizeIn, + ok = CodeSetGenericToGeneric(CodeSet_GetCurrentCodeSet(), bufIn, sizeIn, "UTF-16LE", &db, CSGTG_NORMAL); #elif defined(_WIN32) /* XXX We should probably use CP_THREAD_ACP on Windows 2000/XP. */ @@ -1466,7 +1470,7 @@ CodeSet_Utf16leToCurrent(char const *bufIn, // IN DynBuf_Init(&db); ok = CodeSetGenericToGeneric("UTF-16LE", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, CSGTG_NORMAL); + CodeSet_GetCurrentCodeSet(), &db, CSGTG_NORMAL); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #elif defined(_WIN32) return CodeSetUtf16leToCurrent(bufIn, sizeIn, bufOut, sizeOut); @@ -1508,7 +1512,7 @@ CodeSet_Utf16beToCurrent(char const *bufIn, // IN DynBuf_Init(&db); ok = CodeSetGenericToGeneric("UTF-16BE", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, CSGTG_NORMAL); + CodeSet_GetCurrentCodeSet(), &db, CSGTG_NORMAL); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #elif defined(_WIN32) char c; diff --git a/open-vm-tools/lib/misc/dbllnklst.c b/open-vm-tools/lib/misc/dbllnklst.c index 5e0b9c877..1d17a4ec8 100644 --- a/open-vm-tools/lib/misc/dbllnklst.c +++ b/open-vm-tools/lib/misc/dbllnklst.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/dynarray.c b/open-vm-tools/lib/misc/dynarray.c new file mode 100644 index 000000000..02b73155b --- /dev/null +++ b/open-vm-tools/lib/misc/dynarray.c @@ -0,0 +1,298 @@ +/********************************************************* + * 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. + * + *********************************************************/ + +/* + * dynarray.c -- + * + * Dynamic array of objects -- tonyc + */ + +#include + +#include "vmware.h" +#include "dynarray.h" + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Init -- + * + * Initialize the dynamic array + * + * Results: + * TRUE on success. FALSE on failure. + * + * Side effects: + * See above + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_Init(DynArray *a, // IN/OUT + unsigned int count, // IN + size_t width) // IN +{ + ASSERT(a); + + DynBuf_Init(&a->buf); + a->width = width; + return DynArray_SetCount(a, count); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Destroy -- + * + * Destroy the array + * + * Results: + * None + * + * Side effects: + * See above + * + *----------------------------------------------------------------------------- + */ + +void +DynArray_Destroy(DynArray *a) // IN/OUT +{ + ASSERT(a); + + DynBuf_Destroy(&a->buf); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_AddressOf -- + * + * Fetch a pointer to the address of the ith element. + * + * Results: + * The pointer to the ith element or NULL if the index is out of + * bounds. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void * +DynArray_AddressOf(const DynArray *a, // IN + unsigned int i) // IN +{ + uint8 *result = NULL; + + ASSERT(a); + + if (i < DynArray_Count(a)) { + result = ((uint8 *)DynBuf_Get(&a->buf)) + (i * a->width); + } + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Count -- + * + * Returns the number of elements in the array. + * + * Results: + * See above. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +unsigned int +DynArray_Count(const DynArray *a) // IN +{ + ASSERT(a); + + return (unsigned int) (DynBuf_GetSize(&a->buf) / a->width); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_SetCount -- + * + * Sets the number of elements in the array. This may enlarge + * the size of the array. + * + * Results: + * TRUE on success + * FALSE on failure (not enough memory) + * + * Side effects: + * May resize the array + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_SetCount(DynArray *a, // IN/OUT + unsigned int c) // IN +{ + size_t needed, allocated; + + ASSERT(a); + + needed = c * a->width; + allocated = DynBuf_GetAllocatedSize(&a->buf); + + if (allocated < needed) { + if (!DynBuf_Enlarge(&a->buf, needed)) { + return FALSE; + } + } + DynBuf_SetSize(&a->buf, needed); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_AllocCount -- + * + * Returns the actual size of the array. If you want the effective + * size, use DynArray_Count. Technically, you don't need this API + * unless you're doing trimming (i.e. Don't bother trimming if + * DynArray_AllocCount is within some threshold of DynArray_Count. + * It won't buy you much). + * + * Results: + * See above. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +unsigned int +DynArray_AllocCount(const DynArray *a) // IN +{ + ASSERT(a); + + return (unsigned int) (DynBuf_GetAllocatedSize(&a->buf) / a->width); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Trim -- + * + * Resize the array to fit exactly DynArray_Count() elements. + * + * Results: + * TRUE on success + * FALSE on failure (why? who knows...) + * + * Side effects: + * Resizes the array + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_Trim(DynArray *a) // IN/OUT +{ + ASSERT(a); + + return DynBuf_Trim(&a->buf); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_QSort -- + * + * A wrapper for the quicksort function. Sorts the DynArray + * according to the provided comparison function. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +DynArray_QSort(DynArray *a, // IN/OUT + DynArrayCmp compare) // IN +{ + uint8 *arrayBuf; + + ASSERT(a); + ASSERT(compare); + + arrayBuf = DynBuf_Get(&a->buf); + qsort(arrayBuf, DynArray_Count(a), a->width, compare); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Copy -- + * + * Copies all data and metadata from src Dynarray to dest DynArray. + * + * Dest should be an initialized DynArray of size zero. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_Copy(DynArray *src, // IN + DynArray *dest) // OUT +{ + ASSERT(src); + ASSERT(dest); + ASSERT(dest->width); + ASSERT(dest->width == src->width); + ASSERT(DynArray_AllocCount(dest) == 0); + + return DynBuf_Copy(&src->buf, &dest->buf); +} + diff --git a/open-vm-tools/lib/misc/dynbuf.c b/open-vm-tools/lib/misc/dynbuf.c index 0ab44b9af..e3074f175 100644 --- a/open-vm-tools/lib/misc/dynbuf.c +++ b/open-vm-tools/lib/misc/dynbuf.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/escape.c b/open-vm-tools/lib/misc/escape.c index 89ba2df8f..bbad998ac 100644 --- a/open-vm-tools/lib/misc/escape.c +++ b/open-vm-tools/lib/misc/escape.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/hashTable.c b/open-vm-tools/lib/misc/hashTable.c index f2513dc21..2d834a971 100644 --- a/open-vm-tools/lib/misc/hashTable.c +++ b/open-vm-tools/lib/misc/hashTable.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -30,32 +30,58 @@ #include "vmware.h" #include "hashTable.h" -#include "dbllnklst.h" #include "vm_basic_asm.h" +#include "util.h" +#include "str.h" +#include "vm_atomic.h" #define HASH_ROTATE 5 /* - * An entry in the hashtable. Provides two client datas - * for ease of use. + * Pointer to hash table entry + * + * The assumption is that Atomic_ReadPtr() and Atomic_WritePtr() + * are cheap, so can be used with nonatomic hash tables. + * SETENTRYATOMIC() sets a link to point to a new entry + * if the current value is the same as the old entry. + * It returns TRUE on success. + */ + +typedef Atomic_Ptr HashTableLink; + +#define ENTRY(l) ((HashTableEntry *) Atomic_ReadPtr(&(l))) +#define SETENTRY(l, e) Atomic_WritePtr(&(l), e) +#ifdef NO_ATOMIC_HASHTABLE +#define SETENTRYATOMIC(l, old, new) (Atomic_WritePtr(&(l), new), TRUE) +#else +#define SETENTRYATOMIC(l, old, new) \ + (Atomic_ReadIfEqualWritePtr(&(l), old, new) == (old)) +#endif + +/* + * An entry in the hashtable. */ + typedef struct HashTableEntry { - DblLnkLst_Links l; + HashTableLink next; const char *keyStr; - void *clientData; + Atomic_Ptr clientData; } HashTableEntry; /* * The hashtable structure. */ + struct HashTable { uint32 numEntries; uint32 numBits; int keyType; + Bool atomic; + Bool copyKey; HashTableFreeEntryFn freeEntryFn; - DblLnkLst_Links *buckets; + HashTableLink *buckets; size_t numElements; }; @@ -67,6 +93,8 @@ struct HashTable { static HashTableEntry *HashTableLookup(HashTable *ht, const char *keyStr, uint32 hash); +HashTableEntry *HashTableLookupOrInsert(HashTable *ht, const char *keyStr, + void *clientData); /* @@ -185,10 +213,10 @@ HashTableEqualKeys(HashTable *ht, // IN: hash table { switch (ht->keyType) { case HASH_STRING_KEY: - return strcmp(key1, key2) == 0; + return Str_Strcmp(key1, key2) == 0; case HASH_ISTRING_KEY: - return strcasecmp(key1, key2) == 0; + return Str_Strcasecmp(key1, key2) == 0; default: return key1 == key2; @@ -218,29 +246,81 @@ HashTable_Alloc(uint32 numEntries, // IN: must be a power of 2 HashTableFreeEntryFn fn) // IN: free entry function { HashTable *ht; - uint32 i; ASSERT(numEntries > 0); if ((numEntries & (numEntries - 1)) != 0) { Panic("%s only takes powers of 2 \n", __FUNCTION__); } +#ifdef NO_ATOMIC_HASHTABLE + ASSERT_NOT_IMPLEMENTED((keyType & HASH_FLAG_ATOMIC) == 0); +#endif + ASSERT(((keyType & ~HASH_FLAG_MASK) != HASH_STRING_KEY && + (keyType & ~HASH_FLAG_MASK) != HASH_ISTRING_KEY) || + (keyType & HASH_FLAG_COPYKEY) == 0); - ht = (HashTable *) malloc(sizeof(HashTable)); + ht = Util_SafeMalloc(sizeof *ht); ASSERT_MEM_ALLOC(ht); ht->numBits = ffs(numEntries) - 1; ht->numEntries = numEntries; - ht->keyType = keyType; + ht->keyType = keyType & ~HASH_FLAG_MASK; + ht->atomic = (keyType & HASH_FLAG_ATOMIC) != 0; + ht->copyKey = (keyType & HASH_FLAG_COPYKEY) != 0; ht->freeEntryFn = fn; - ht->buckets = (DblLnkLst_Links *) malloc(ht->numEntries * - sizeof(DblLnkLst_Links)); - ASSERT_MEM_ALLOC(ht->buckets); + ht->buckets = Util_SafeCalloc(ht->numEntries, sizeof *ht->buckets); + ht->numElements = 0; - for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Init(&ht->buckets[i]); +#ifndef NO_ATOMIC_HASHTABLE + if (ht->atomic) { + Atomic_Init(); } +#endif - ht->numElements = 0; + return ht; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_AllocOnce -- + * + * Create a hash table and store it in the supplied Atomic_Ptr, + * unless it's already been created. + * + * Results: + * The new (or existing) hashtable. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +HashTable * +HashTable_AllocOnce(Atomic_Ptr *var, // IN/OUT: the atomic var + uint32 numEntries, // IN: must be a power of 2 + int keyType, // IN: whether keys are strings + HashTableFreeEntryFn fn) // IN: free entry function +{ + HashTable *ht; + + if ((ht = Atomic_ReadPtr(var)) == NULL) { + HashTable *new = HashTable_Alloc(numEntries, keyType, fn); +#ifdef NO_ATOMIC_HASHTABLE + Atomic_WritePtr(var, new); +#else + Atomic_Init(); + ht = Atomic_ReadIfEqualWritePtr(var, NULL, new); +#endif + if (ht == NULL) { + ht = new; + } else { + new->atomic = FALSE; + HashTable_Free(new); + } + } + ASSERT(ht == Atomic_ReadPtr(var)); return ht; } @@ -266,6 +346,7 @@ void HashTable_Free(HashTable *ht) // IN/OUT { ASSERT(ht); + ASSERT(!ht->atomic); HashTable_Clear(ht); @@ -296,24 +377,20 @@ HashTable_Clear(HashTable *ht) // IN/OUT int i; ASSERT(ht); + ASSERT(!ht->atomic); ht->numElements = 0; for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head; - DblLnkLst_Links *cur; - DblLnkLst_Links *next = NULL; - - head = &ht->buckets[i]; - for (cur = head->next; cur != head; cur = next) { - HashTableEntry *entry = DblLnkLst_Container(cur, HashTableEntry, l); - - ASSERT(entry); + HashTableEntry *entry; + while ((entry = ENTRY(ht->buckets[i])) != NULL) { + SETENTRY(ht->buckets[i], ENTRY(entry->next)); + if (ht->copyKey) { + free((char *) entry->keyStr); + } if (ht->freeEntryFn) { - ht->freeEntryFn(entry->clientData); + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); } - next = cur->next; - DblLnkLst_Unlink1(cur); free(entry); } } @@ -341,15 +418,11 @@ HashTableLookup(HashTable *ht, // IN const char *keyStr, // IN uint32 hash) // IN { - DblLnkLst_Links *cur, *head; - - head = &ht->buckets[hash]; - for (cur = head->next; cur != head; cur = cur->next) { - HashTableEntry *entry; - - entry = DblLnkLst_Container(cur, HashTableEntry, l); - ASSERT(entry); + HashTableEntry *entry; + for (entry = ENTRY(ht->buckets[hash]); + entry != NULL; + entry = ENTRY(entry->next)) { if (HashTableEqualKeys(ht, entry->keyStr, keyStr)) { return entry; } @@ -381,20 +454,17 @@ HashTable_Lookup(HashTable *ht, // IN const char *keyStr, // IN void **clientData) // OUT { - HashTableEntry *entry; uint32 hash = HashTableComputeHash(ht, keyStr); - - entry = HashTableLookup(ht, keyStr, hash); + HashTableEntry *entry = HashTableLookup(ht, keyStr, hash); if (entry == NULL) { return FALSE; - } else { - if (clientData) { - *clientData = entry->clientData; - } + } - return TRUE; + if (clientData) { + *clientData = Atomic_ReadPtr(&entry->clientData); } + return TRUE; } @@ -419,22 +489,25 @@ Bool HashTable_Delete(HashTable *ht, // IN/OUT: the hash table const char *keyStr) // IN: key for the element to remove { - DblLnkLst_Links *head, *cur, *next = NULL; uint32 hash = HashTableComputeHash(ht, keyStr); + HashTableLink *linkp; + HashTableEntry *entry; - head = &ht->buckets[hash]; - for (cur = head->next; cur != head; cur = next) { - HashTableEntry *entry = DblLnkLst_Container(cur, HashTableEntry, l); - ASSERT(entry); + ASSERT(!ht->atomic); - next = cur->next; + for (linkp = &ht->buckets[hash]; + (entry = ENTRY(*linkp)) != NULL; + linkp = &entry->next) { if (HashTableEqualKeys(ht, entry->keyStr, keyStr)) { + SETENTRY(*linkp, ENTRY(entry->next)); + ht->numElements--; + if (ht->copyKey) { + free((char *) entry->keyStr); + } if (ht->freeEntryFn) { - ht->freeEntryFn(entry->clientData); + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); } - DblLnkLst_Unlink1(cur); - free(DblLnkLst_Container(cur, HashTableEntry, l)); - ht->numElements--; + free(entry); return TRUE; } } @@ -447,9 +520,11 @@ HashTable_Delete(HashTable *ht, // IN/OUT: the hash table * * HashTable_Insert -- * - * Insert an element into the hashtable. The string key is - * not duplicated & thus cannot be free until there is no - * more need for the hashtable. + * Insert an element into the hashtable. + * + * Unless the hash table was created with HASH_FLAG_COPYKEY, + * the string key is not duplicated and thus cannot be freed until + * the entry is deleted or the hash table is cleared or freed. * * Results: * FALSE if item already exists. @@ -465,22 +540,150 @@ HashTable_Insert(HashTable *ht, // IN/OUT const char *keyStr, // IN void *clientData) // IN { - HashTableEntry *entry; - uint32 hash = HashTableComputeHash(ht, keyStr); + return HashTableLookupOrInsert(ht, keyStr, clientData) == NULL; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_LookupOrInsert -- + * + * Look up an a key, return the element if found. + * Otherwise, insert it into the hashtable and return it. + * + * Unless the hash table was created with HASH_FLAG_COPYKEY, + * the string key is not duplicated and thus cannot be freed until + * the entry is deleted or the hash table is cleared or freed. + * + * Results: + * Old element or new one. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void * +HashTable_LookupOrInsert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + HashTableEntry *entry = HashTableLookupOrInsert(ht, keyStr, clientData); + + return entry == NULL ? clientData : Atomic_ReadPtr(&entry->clientData); +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_ReplaceOrInsert -- + * + * Look up an a key. If found, replace the existing clientData + * and return TRUE. + * Otherwise, insert new entry and return FALSE. + * + * Unless the hash table was created with HASH_FLAG_COPYKEY, + * the string key is not duplicated and thus cannot be freed until + * the entry is deleted or the hash table is cleared or freed. + * + * Results: + * TRUE if replaced, FALSE if inserted. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +HashTable_ReplaceOrInsert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + HashTableEntry *entry = HashTableLookupOrInsert(ht, keyStr, clientData); - if (HashTableLookup(ht, keyStr, hash) != NULL) { + if (entry == NULL) { return FALSE; } - entry = (HashTableEntry *) malloc(sizeof(HashTableEntry)); - ASSERT_MEM_ALLOC(entry); - entry->keyStr = keyStr; - entry->clientData = clientData; - DblLnkLst_Init(&entry->l); +#ifndef NO_ATOMIC_HASHTABLE + if (ht->atomic && ht->freeEntryFn) { + void *old = Atomic_ReadWritePtr(&entry->clientData, clientData); + ht->freeEntryFn(old); + } else +#endif + { + if (ht->freeEntryFn) { + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); + } + Atomic_WritePtr(&entry->clientData, clientData); + } + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTableLookupOrInsert -- + * + * Look up an a key, return the entry if found. + * Otherwise, insert it into the hashtable and return NULL. + * + * Results: + * Old HashTableEntry or NULL. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +HashTableEntry * +HashTableLookupOrInsert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + uint32 hash = HashTableComputeHash(ht, keyStr); + HashTableEntry *entry = NULL; + HashTableEntry *oldEntry = NULL; + HashTableEntry *head; + +again: + head = ENTRY(ht->buckets[hash]); + + oldEntry = HashTableLookup(ht, keyStr, hash); + if (oldEntry != NULL) { + if (ht->copyKey) { + free((char *) entry->keyStr); + } + free(entry); + return oldEntry; + } + + if (entry == NULL) { + entry = Util_SafeMalloc(sizeof *entry); + if (ht->copyKey) { + entry->keyStr = Util_SafeStrdup(keyStr); + } else { + entry->keyStr = keyStr; + } + Atomic_WritePtr(&entry->clientData, clientData); + } + SETENTRY(entry->next, head); + if (ht->atomic) { + if (!SETENTRYATOMIC(ht->buckets[hash], head, entry)) { + goto again; + } + } else { + SETENTRY(ht->buckets[hash], entry); + } - DblLnkLst_LinkLast(&ht->buckets[hash], &entry->l); ht->numElements++; - return TRUE; + return NULL; } @@ -491,6 +694,10 @@ HashTable_Insert(HashTable *ht, // IN/OUT * * Get the number of elements in the hash table. * + * Atomic hash tables do not support this function because + * the numElements field is not modified atomically so may be + * incorrect. + * * Results: * The number of elements. * @@ -503,6 +710,9 @@ HashTable_Insert(HashTable *ht, // IN/OUT size_t HashTable_GetNumElements(const HashTable *ht) // IN: { + ASSERT(ht); + ASSERT(!ht->atomic); + return ht->numElements; } @@ -537,6 +747,8 @@ HashTable_ToArray(const HashTable *ht, // IN ASSERT(clientDatas); ASSERT(size); + ASSERT(!ht->atomic); + *clientDatas = NULL; *size = HashTable_GetNumElements(ht); @@ -545,22 +757,15 @@ HashTable_ToArray(const HashTable *ht, // IN } /* alloc array */ - *clientDatas = malloc(*size * sizeof(void *)); - ASSERT_MEM_ALLOC(*clientDatas); + *clientDatas = Util_SafeMalloc(*size * sizeof **clientDatas); /* fill array */ for (i = 0, j = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head; - DblLnkLst_Links *cur; - DblLnkLst_Links *next = NULL; - - head = &ht->buckets[i]; - for (cur = head->next; cur != head; cur = next) { - HashTableEntry *entry = DblLnkLst_Container(cur, HashTableEntry, l); - ASSERT(entry); - - (*clientDatas)[j++] = entry->clientData; - next = cur->next; + HashTableEntry *entry; + for (entry = ENTRY(ht->buckets[i]); + entry != NULL; + entry = ENTRY(entry->next)) { + (*clientDatas)[j++] = Atomic_ReadPtr(&entry->clientData); } } } @@ -596,15 +801,12 @@ HashTable_ForEach(const HashTable *ht, // IN ASSERT(cb); for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head, *cur; - - head = &ht->buckets[i]; - for (cur = head->next; cur != head; cur = cur->next) { - int result; - HashTableEntry *entry = DblLnkLst_Container(cur, HashTableEntry, l); - - ASSERT(entry); - result = (*cb)(entry->keyStr, entry->clientData, clientData); + HashTableEntry *entry; + for (entry = ENTRY(ht->buckets[i]); + entry != NULL; + entry = ENTRY(entry->next)) { + int result = (*cb)(entry->keyStr, Atomic_ReadPtr(&entry->clientData), + clientData); if (result) { return result; } @@ -637,21 +839,17 @@ HashPrint(HashTable *ht) // IN int i; for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head, *cur; + HashTableEntry *entry; - head = &ht->buckets[i]; - if (head->next == head) { + if (ht->buckets[i] == NULL) { continue; } printf("%4d: \n", i); - for (cur = head->next; cur != head; cur = cur->next) { - HashTableEntry *entry; - - entry = DblLnkLst_Container(cur, HashTableEntry, l); - ASSERT(entry); - + for (entry = ENTRY(ht->buckets[i]); + entry != NULL; + entry = ENTRY(entry->next)) { if (ht->keyType == HASH_INT_KEY) { printf("\t%p\n", entry->keyStr); } else { diff --git a/open-vm-tools/lib/misc/hostinfo_misc.c b/open-vm-tools/lib/misc/hostinfo_misc.c index f10656ead..d8fbea6f0 100644 --- a/open-vm-tools/lib/misc/hostinfo_misc.c +++ b/open-vm-tools/lib/misc/hostinfo_misc.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/hostname.c b/open-vm-tools/lib/misc/hostname.c index 66c089e95..351d7e6d5 100644 --- a/open-vm-tools/lib/misc/hostname.c +++ b/open-vm-tools/lib/misc/hostname.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,8 +23,6 @@ */ #if defined(_WIN32) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 #include #include @@ -39,6 +37,10 @@ #include "str.h" #include "log.h" #include "hostinfo.h" +#if defined(_WIN32) // Windows +#include "win32u.h" +#endif +#include "unicode.h" #if defined(_WIN32) // Windows /* @@ -48,15 +50,6 @@ * * Return the fully qualified host name of the host. * - * Note: GetComputerNameExA is broken on multibyte encodings that - * use more than one byte per characters. The function calls - * GetComputerNameExW, then calls WideCharToMultiByte assuming, it - * seems, that the number of characters returned from - * GetComputerNameW is the required buffer size for the multibyte - * conversion. So instead of calling GetComputerNameExA we will call - * the wide version and do the conversion ourselves. - * - * * Results: * The host name on success; must be freed * NULL if unable to determine the name @@ -67,59 +60,24 @@ *---------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { - HMODULE dllHandle; + Unicode result; + HMODULE dllHandle; struct hostent *myHostEnt; struct hostent *(WINAPI *GetHostByNameFn)(char *hostName); int (WINAPI *GetHostNameFn)(char *hostName, int size); - BOOL (WINAPI *GetComputerNameExWFn)(COMPUTER_NAME_FORMAT nameType, - LPWSTR lpBuffer, - LPDWORD lpnSize); - char hostName[1024] = { '\0' }; - wchar_t wHostName[1024] = { L'\0' }; - DWORD size = sizeof wHostName; - dllHandle = GetModuleHandleA("kernel32"); + char hostName[1024] = { '\0' }; - if (!dllHandle) { - Warning("%s GetModuleHandle on kernel32 failed\n", __FUNCTION__); + result = Win32U_GetComputerNameEx(ComputerNamePhysicalDnsFullyQualified); - return NULL; + if (result != NULL) { + return result; } - GetComputerNameExWFn = (void *) GetProcAddress(dllHandle, - "GetComputerNameExW"); - - if ((NULL != GetComputerNameExWFn) && - ((*GetComputerNameExWFn)(ComputerNamePhysicalDnsFullyQualified, - wHostName, &size) != 0)) { - int bytesConverted; - /* - * The call to WideCharToMultiByte with the following parameters - * might cause the system to drop/change some of the wide chars - * in wHostName if an equivalent cannot be found in the locale. - * However, this is the way GetComputerNameExA calls this - * function, and we are trying to mimic it. - */ - bytesConverted = WideCharToMultiByte(CP_ACP, 0, wHostName, size + 1, - hostName, sizeof hostName, - NULL, NULL); - if (bytesConverted > 0) { - char *dupStr = NULL; - dupStr = strdup(hostName); - ASSERT_MEM_ALLOC(dupStr); - return dupStr; - } else { - DWORD err = GetLastError(); - Warning("%s %s failed: %d\n", __FUNCTION__, "WideCharToMultiByte", - err); - } - } else if (NULL != GetComputerNameExWFn) { - DWORD err = GetLastError(); - Warning("%s %s failed: %d\n", __FUNCTION__, "GetComputerNameExW", err); - } + Warning("%s GetComputerNameEx failed: %d\n", __FUNCTION__, GetLastError()); dllHandle = LoadLibraryA("ws2_32"); @@ -153,7 +111,7 @@ Hostinfo_HostName(void) if (!GetHostByNameFn) { Warning("%s Failed to find gethostbyname.\n", __FUNCTION__); FreeLibrary(dllHandle); - return strdup(hostName); + return Unicode_Alloc(hostName, STRING_ENCODING_US_ASCII); } myHostEnt = (*GetHostByNameFn)(hostName); @@ -166,7 +124,7 @@ Hostinfo_HostName(void) Str_Strcpy(hostName, myHostEnt->h_name, sizeof hostName); } - return strdup(hostName); + return Unicode_Alloc(hostName, STRING_ENCODING_US_ASCII); } #elif defined(__APPLE__) // MacOS X #define SYS_NMLN _SYS_NAMELEN @@ -194,16 +152,16 @@ Hostinfo_HostName(void) *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { struct utsname un; - char *result = (char *) NULL; + Unicode result = NULL; if ((uname(&un) == 0) && (*un.nodename != '\0')) { /* 'un.nodename' is already fully qualified. */ - result = strdup(un.nodename); + result = Unicode_Alloc(un.nodename, STRING_ENCODING_US_ASCII); } return result; @@ -230,17 +188,18 @@ Hostinfo_HostName(void) *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { struct utsname un; - char *result = (char *) NULL; + Unicode result = NULL; if ((uname(&un) == 0) && (*un.nodename != '\0')) { + char *p; + int error; struct hostent he; - int error; - char buffer[1024]; + char buffer[1024]; struct hostent *phe = &he; @@ -250,14 +209,14 @@ Hostinfo_HostName(void) * 139607 will occur. */ - result = un.nodename; + p = un.nodename; - if ((gethostbyname_r(result, &he, buffer, sizeof buffer, + if ((gethostbyname_r(p, &he, buffer, sizeof buffer, &phe, &error) == 0) && phe) { - result = phe->h_name; + p = phe->h_name; } - result = strdup(result); + result = Unicode_Alloc(p, STRING_ENCODING_US_ASCII); } return result; @@ -283,14 +242,9 @@ Hostinfo_HostName(void) *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { - char string[128]; - - Str_Sprintf(string, sizeof string, "%s unimplemented for OS", - __FUNCTION__); - - return strdup(string); + return Unicode_Format("%s: unimplemented for OS", __FUNCTION__); } #endif diff --git a/open-vm-tools/lib/misc/idLinux.c b/open-vm-tools/lib/misc/idLinux.c index a113b3443..9910deb57 100644 --- a/open-vm-tools/lib/misc/idLinux.c +++ b/open-vm-tools/lib/misc/idLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/iovector.c b/open-vm-tools/lib/misc/iovector.c index e1cf22ef6..ca879e69d 100644 --- a/open-vm-tools/lib/misc/iovector.c +++ b/open-vm-tools/lib/misc/iovector.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/machineID.c b/open-vm-tools/lib/misc/machineID.c index 4b2c59e6c..ca4b7b16a 100644 --- a/open-vm-tools/lib/misc/machineID.c +++ b/open-vm-tools/lib/misc/machineID.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/miscSolaris.c b/open-vm-tools/lib/misc/miscSolaris.c index 92481013b..0f578f822 100644 --- a/open-vm-tools/lib/misc/miscSolaris.c +++ b/open-vm-tools/lib/misc/miscSolaris.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/posixDlopen.c b/open-vm-tools/lib/misc/posixDlopen.c new file mode 100644 index 000000000..2a1f696fc --- /dev/null +++ b/open-vm-tools/lib/misc/posixDlopen.c @@ -0,0 +1,61 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +#define UNICODE_BUILDING_POSIX_WRAPPERS +#include +#include + +#if defined(__APPLE__) || defined(linux) +#include +#endif + +#include "vmware.h" +#include "str.h" +#include "posix.h" +#include "unicode.h" + + +#if defined(__APPLE__) || defined(linux) +/* + *---------------------------------------------------------------------- + * + * FileIO_Dlopen -- + * + * POSIX dlopen() + * + * Results: + * NULL Error + * !NULL Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +void * +Posix_Dlopen(ConstUnicode pathName, // IN: + int flag) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + void *ret = dlopen(path, flag); + + free(path); + return ret; +} +#endif diff --git a/open-vm-tools/lib/misc/posixPosix.c b/open-vm-tools/lib/misc/posixPosix.c new file mode 100644 index 000000000..737393f87 --- /dev/null +++ b/open-vm-tools/lib/misc/posixPosix.c @@ -0,0 +1,1744 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +#define UNICODE_BUILDING_POSIX_WRAPPERS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "su.h" +#include +#include +#include + +#if defined(__APPLE__) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#else +#if defined(__FreeBSD__) +#include +#include +#else +#if !defined(N_PLAT_NLM) +#include +#if !defined(sun) +#include +#include +#endif +#endif +#endif +#endif + +# if defined(__FreeBSD__) && BSD_VERSION >= 53 +# include // PATH_MAX +# else +# include // PATH_MAX +# endif + +#include "vmware.h" +#include "str.h" +#include "posix.h" +#include "unicode.h" +#if !defined(N_PLAT_NLM) +#include "hashTable.h" +#include "vm_atomic.h" +#endif + + +#if !defined(N_PLAT_NLM) && !defined(__FreeBSD__) && !defined(sun) +static struct passwd *GetpwInternal(struct passwd *pw); +static int GetpwInternal_r(struct passwd *pw, char *buf, size_t size, + struct passwd **ppw); +#endif + + +/* + *---------------------------------------------------------------------- + * + * Posix_Open -- + * + * Open a file using POSIX open. + * + * Results: + * -1 error + * >= 0 success (file descriptor) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Open(ConstUnicode pathName, // IN: + int flags, // IN: + ...) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + mode_t mode = 0; + int fd; + + if ((flags & O_CREAT) != 0) { + va_list a; + + /* + * The FreeBSD tools compiler + * (toolchain/lin32/gcc-4.1.2-5/bin/i686-freebsd5.0-gcc) + * wants us to use va_arg(a, int) instead of va_arg(a, mode_t), + * so oblige. -- edward + */ + + va_start(a, flags); + ASSERT_ON_COMPILE(sizeof (int) >= sizeof(mode_t)); + mode = va_arg(a, int); + va_end(a); + } + + fd = open(path, flags, mode); + + free(path); + return fd; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Creat -- + * + * Create a file via POSIX creat() + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Creat(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + return Posix_Open(pathName, O_CREAT | O_WRONLY | O_TRUNC, mode); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Fopen -- + * + * Open a file via POSIX fopen() + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Fopen(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + FILE *stream; + + ASSERT(mode); + + stream = fopen(path, mode); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Stat -- + * + * POSIX stat() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Stat(ConstUnicode pathName, // IN: + struct stat *statbuf) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = stat(path, statbuf); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chmod -- + * + * POSIX chmod() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chmod(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = chmod(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Rename -- + * + * POSIX rename(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Rename(ConstUnicode fromPathName, // IN: + ConstUnicode toPathName) // IN: +{ + char *toPath = Unicode_GetAllocBytes(toPathName, STRING_ENCODING_DEFAULT); + char *fromPath = Unicode_GetAllocBytes(fromPathName, + STRING_ENCODING_DEFAULT); + int result = rename(fromPath, toPath); + + free(toPath); + free(fromPath); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Unlink -- + * + * POSIX unlink(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Unlink(ConstUnicode pathName) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = unlink(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Rmdir -- + * + * POSIX rmdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Rmdir(ConstUnicode pathName) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = rmdir(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Freopen -- + * + * Open a file via POSIX freopen() + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Freopen(ConstUnicode pathName, // IN: + const char *mode, // IN: + FILE *input_stream) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + FILE *stream; + + ASSERT(mode); + + stream = freopen(path, mode, input_stream); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Access -- + * + * POSIX access(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Access(ConstUnicode pathName, // IN: + int mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = access(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Utime -- + * + * POSIX utime(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Utime(ConstUnicode pathName, // IN: + const struct utimbuf *times) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = utime(path, times); + + free(path); + return ret; +} + + +#if !defined(N_PLAT_NLM) // { +/* + *---------------------------------------------------------------------- + * + * Posix_Popen -- + * + * Open a file using POSIX popen(). + * + * Results: + * -1 error + * >= 0 success (file descriptor) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Popen(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + FILE *stream; + + ASSERT(mode); + + stream = popen(path, mode); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mknod -- + * + * POSIX mknod(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mknod(ConstUnicode pathName, // IN: + mode_t mode, // IN: + dev_t dev) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = mknod(path, mode, dev); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chown -- + * + * POSIX chown(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chown(ConstUnicode pathName, // IN: + uid_t owner, // IN: + gid_t group) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = chown(path, owner, group); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Lchown -- + * + * POSIX lchown(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Lchown(ConstUnicode pathName, // IN: + uid_t owner, // IN: + gid_t group) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = lchown(path, owner, group); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Link -- + * + * POSIX link(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Link(ConstUnicode pathName1, // IN: + ConstUnicode pathName2) // IN: +{ + char *path1 = Unicode_GetAllocBytes(pathName1, STRING_ENCODING_DEFAULT); + char *path2 = Unicode_GetAllocBytes(pathName2, STRING_ENCODING_DEFAULT); + int ret = link(path1, path2); + + free(path1); + free(path2); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Symlink -- + * + * POSIX symlink(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Symlink(ConstUnicode pathName1, // IN: + ConstUnicode pathName2) // IN: +{ + char *path1 = Unicode_GetAllocBytes(pathName1, STRING_ENCODING_DEFAULT); + char *path2 = Unicode_GetAllocBytes(pathName2, STRING_ENCODING_DEFAULT); + int ret = symlink(path1, path2); + + free(path1); + free(path2); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mkfifo -- + * + * POSIX mkfifo(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mkfifo(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = mkfifo(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Truncate -- + * + * POSIX truncate(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Truncate(ConstUnicode pathName, // IN: + off_t length) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = truncate(path, length); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Utimes -- + * + * POSIX utimes(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Utimes(ConstUnicode pathName, // IN: + const struct timeval *times) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = utimes(path, times); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execl -- + * + * POSIX execl(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execl(ConstUnicode pathName, // IN: + ConstUnicode arg0, ...) // IN: +{ + int ret = -1; + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + va_list vl; + char **argv = NULL; + int i, count = 0; + + if (arg0) { + count = 1; + va_start(vl, arg0); + while (va_arg(vl, char *)) { + count ++; + } + va_end(vl); + } + + argv = (char **) malloc(sizeof(char *) * (count + 1)); + if (argv) { + if (count > 0) { + argv[0] = Unicode_GetAllocBytes(arg0, STRING_ENCODING_DEFAULT); + va_start(vl, arg0); + for (i = 1; i < count; i++) { + argv[i] = Unicode_GetAllocBytes(va_arg(vl, char *), + STRING_ENCODING_DEFAULT); + } + va_end(vl); + } + argv[count] = NULL; + } else { + errno = ENOMEM; + goto exit; + } + + ret = execv(path, argv); + +exit: + if (argv) { + for (i = 0; i < count; i++) { + free(argv[i]); + } + free(argv); + } + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execv -- + * + * POSIX execv(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execv(ConstUnicode pathName, // IN: + Unicode const argVal[]) // IN: +{ + int ret = -1; + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + char **argv = NULL; + int i, count = 0; + + if (argVal) { + while (argVal[count]) { + count++; + } + argv = (char **) malloc(sizeof(char *) * (count + 1)); + if (argv) { + for (i = 0; i < count; i++) { + argv[i] = Unicode_GetAllocBytes(argVal[i], + STRING_ENCODING_DEFAULT); + } + argv[count] = NULL; + } else { + errno = ENOMEM; + goto exit; + } + } + + ret = execv(path, argv); + +exit: + if (argv) { + for (i = 0; i < count; i++) { + free(argv[i]); + } + free(argv); + } + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execvp -- + * + * POSIX execvp(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execvp(ConstUnicode fileName, // IN: + Unicode const argVal[]) // IN: +{ + int ret = -1; + char *file = Unicode_GetAllocBytes(fileName, STRING_ENCODING_DEFAULT); + char **argv = NULL; + int i, count = 0; + + if (argVal) { + while (argVal[count]) { + count++; + } + argv = (char **) malloc(sizeof(char *) * (count + 1)); + if (argv) { + for (i = 0; i < count; i++) { + argv[i] = Unicode_GetAllocBytes(argVal[i], + STRING_ENCODING_DEFAULT); + } + argv[count] = NULL; + } else { + errno = ENOMEM; + goto exit; + } + } + + ret = execvp(file, argv); + +exit: + if (argv) { + for (i = 0; i < count; i++) { + free(argv[i]); + } + free(argv); + } + free(file); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mkdir -- + * + * POSIX mkdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mkdir(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = mkdir(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chdir -- + * + * POSIX chdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chdir(ConstUnicode pathName) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = chdir(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_RealPath -- + * + * POSIX realpath(). + * + * Results: + * NULL Error + * !NULL Success (result must be freed by the caller) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +Unicode +Posix_RealPath(ConstUnicode pathName) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + char rpath[PATH_MAX]; + char *p = realpath(path, rpath); + + free(path); + return p == NULL ? NULL : Unicode_Alloc(rpath, STRING_ENCODING_DEFAULT); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_ReadLink -- + * + * POSIX readlink(). + * + * Results: + * NULL Error + * !NULL Success (result must be freed by the caller) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +Unicode +Posix_ReadLink(ConstUnicode pathName) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + ssize_t bytes; + Unicode result = NULL; + char link[PATH_MAX]; + + bytes = readlink(path, link, sizeof link); + ASSERT_NOT_IMPLEMENTED(bytes < (ssize_t) sizeof link); + + free(path); + + if (bytes != -1) { + /* add the missing NUL character to path */ + link[bytes] = '\0'; + result = Unicode_Alloc(link, STRING_ENCODING_DEFAULT); + } + + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Lstat -- + * + * POSIX lstat() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Lstat(ConstUnicode pathName, // IN: + struct stat *statbuf) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = lstat(path, statbuf); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_OpenDir -- + * + * POSIX opendir() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +DIR * +Posix_OpenDir(ConstUnicode pathName) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + DIR *ret = opendir(path); + + free(path); + return ret; +} + + +#if !defined(sun) // { +/* + *---------------------------------------------------------------------- + * + * Posix_Getenv -- + * + * POSIX getenv(). + * + * Results: + * NULL The name was not found or an error occurred + * !NULL The value associated with the name in UTF8. This does not + * need to be freed. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +PosixEnvFree(void *v) // IN: +{ + Unicode_Free((Unicode) v); +} + +Unicode +Posix_Getenv(ConstUnicode name) // IN: +{ + char *rawData; + char *rawName; + Unicode newValue; + HashTable *posixHashTable; + + static Atomic_Ptr posixEnvPtr; // Implicitly initialized to NULL. --mbellon + + posixHashTable = HashTable_AllocOnce(&posixEnvPtr, 128, + HASH_FLAG_ATOMIC | HASH_STRING_KEY, + PosixEnvFree); + + rawName = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + rawData = getenv(rawName); + free(rawName); + + if (rawData == NULL) { + return NULL; + } + + newValue = Unicode_Alloc(rawData, STRING_ENCODING_DEFAULT); + + if (newValue != NULL) { + HashTable_ReplaceOrInsert(posixHashTable, name, newValue); + } + + return newValue; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Setenv -- + * + * POSIX setenv(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * Environment may be changed. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Setenv(ConstUnicode name, // IN: + ConstUnicode value, // IN: + int overWrite) // IN: +{ + int res; + char *rawData; + char *rawName; + + rawData = Unicode_GetAllocBytes(value, STRING_ENCODING_DEFAULT); + rawName = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + + res = setenv(rawName, rawData, overWrite); + + free(rawData); + free(rawName); + + return res; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Statfs -- + * + * POSIX statfs() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Statfs(ConstUnicode pathName, // IN: + struct statfs *statfsbuf) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + int ret = statfs(path, statfsbuf); + + free(path); + return ret; +} + + +#if !defined(__FreeBSD__) // { + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwnam -- + * + * POSIX getpwnam() + * + * Results: + * Pointer to updated passwd struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct passwd * +Posix_Getpwnam(ConstUnicode name) // IN: +{ + struct passwd *pw; + char *tmpname; + + tmpname = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + pw = getpwnam(tmpname); + free(tmpname); + + return GetpwInternal(pw); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwuid -- + * + * POSIX getpwuid() + * + * Results: + * Pointer to updated passwd struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct passwd * +Posix_Getpwuid(uid_t uid) // IN: +{ + struct passwd *pw; + + pw = getpwuid(uid); + return GetpwInternal(pw); +} + + +/* + *---------------------------------------------------------------------- + * + * GetpwInternal -- + * + * Helper function for Posix_Getpwnam and Posix_Getpwuid + * + * Results: + * Pointer to updated passwd struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +static struct passwd * +GetpwInternal(struct passwd *pw) // IN: +{ + int ret; + static struct passwd spw = {0}; + + if (!pw) { + return NULL; + } + + /* Free static structure string pointers before reuse. */ + free(spw.pw_passwd); + spw.pw_passwd = NULL; + free(spw.pw_dir); + spw.pw_dir = NULL; + free(spw.pw_name); + spw.pw_name = NULL; + free(spw.pw_gecos); + spw.pw_gecos = NULL; + free(spw.pw_shell); + spw.pw_shell = NULL; + + /* Fill out structure with new values. */ + spw.pw_uid = pw->pw_uid; + spw.pw_gid = pw->pw_gid; + + ret = ENOMEM; + if (pw->pw_passwd && + (spw.pw_passwd = Unicode_Alloc(pw->pw_passwd, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_dir && + (spw.pw_dir = Unicode_Alloc(pw->pw_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_name && + (spw.pw_name = Unicode_Alloc(pw->pw_name, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_gecos && + (spw.pw_gecos = Unicode_Alloc(pw->pw_gecos, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_shell && + (spw.pw_shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + ret = 0; + +exit: + if (ret != 0) { + errno = ret; + return NULL; + } + return &spw; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwnam_r -- + * + * POSIX getpwnam_r() + * + * Results: + * Returns 0 with success and pointer to updated passwd struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Getpwnam_r(ConstUnicode name, // IN: + struct passwd *pw, // IN: + char *buf, // IN: + size_t size, // IN: + struct passwd **ppw) // OUT: +{ + int ret; + char *tmpname; + + tmpname = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + ret = getpwnam_r(tmpname, pw, buf, size, ppw); + free(tmpname); + + if (ret != 0) { + return ret; + } + + return GetpwInternal_r(pw, buf, size, ppw); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwuid_r -- + * + * POSIX getpwuid_r() + * + * Results: + * Returns 0 with success and pointer to updated passwd struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Getpwuid_r(uid_t uid, // IN: + struct passwd *pw, // IN: + char *buf, // IN: + size_t size, // IN: + struct passwd **ppw) // OUT: +{ + int ret; + + ret = getpwuid_r(uid, pw, buf, size, ppw); + if (ret != 0) { + return ret; + } + + return GetpwInternal_r(pw, buf, size, ppw); +} + + +/* + *---------------------------------------------------------------------- + * + * GetpwInternal_r -- + * + * Helper function for Posix_Getpwnam_r and Posix_Getpwuid_r + * + * Results: + * Returns 0 with success and pointer to updated passwd struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static int +GetpwInternal_r(struct passwd *pw, // IN: + char *buf, // IN: + size_t size, // IN: + struct passwd **ppw) // OUT: +{ + int ret; + char *pwname = NULL; + char *passwd = NULL; + char *gecos = NULL; + char *dir = NULL; + char *shell = NULL; + char *p; + + /* + * Maybe getpwnam_r didn't use supplied struct, but we don't care. + * We just fix up the one it gives us. + */ + + pw = *ppw; + + /* + * Convert strings to UTF-8 + */ + + ret = ENOMEM; + if (pw->pw_name && + (pwname = Unicode_Alloc(pw->pw_name, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_passwd && + (passwd = Unicode_Alloc(pw->pw_passwd, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_gecos && + (gecos = Unicode_Alloc(pw->pw_gecos, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_dir && + (dir = Unicode_Alloc(pw->pw_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_shell && + (shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + + /* + * Put UTF-8 strings into the structure. + */ + + ret = ERANGE; + p = buf; + + if (pwname) { + size_t len = strlen(pwname) + 1; + if (p + len > buf + size) { + goto exit; + } + pw->pw_name = memcpy(p, pwname, len); + p += len; + } + + if (passwd != NULL) { + size_t len = strlen(passwd) + 1; + if (p + len > buf + size) { + goto exit; + } + pw->pw_passwd = memcpy(p, passwd, len); + p += len; + } + + if (gecos) { + size_t len = strlen(gecos) + 1; + if (p + len > buf + size) { + goto exit; + } + pw->pw_gecos = memcpy(p, gecos, len); + p += len; + } + + if (dir) { + size_t len = strlen(dir) + 1; + if (p + len > buf + size) { + goto exit; + } + pw->pw_dir = memcpy(p, dir, len); + p += len; + } + + if (shell) { + size_t len = strlen(shell) + 1; + if (p + len > buf + size) { + goto exit; + } + pw->pw_shell = memcpy(p, shell, len); + p += len; + } + ret = 0; + +exit: + free(passwd); + free(dir); + free(pwname); + free(gecos); + free(shell); + return ret; +} + + +#if !defined(__APPLE__) // { + +/* + *---------------------------------------------------------------------- + * + * Posix_Setmntent -- + * + * Open a file via POSIX setmntent() + * + * Results: + * NULL Error + * !NULL File stream + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Setmntent(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + char *path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + FILE *stream; + + ASSERT(mode != NULL); + + stream = setmntent(path, mode); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getmntent -- + * + * POSIX getmntent() + * + * Results: + * Pointer to updated mntent struct or NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct mntent * +Posix_Getmntent(FILE *fp) // IN: +{ + int ret; + struct mntent *m; + static struct mntent sm = {0}; + + m = getmntent(fp); + if (!m) { + return NULL; + } + + /* Free static structure string pointers before reuse. */ + free(sm.mnt_fsname); + sm.mnt_fsname = NULL; + free(sm.mnt_dir); + sm.mnt_dir = NULL; + free(sm.mnt_type); + sm.mnt_type = NULL; + free(sm.mnt_opts); + sm.mnt_opts = NULL; + + /* Fill out structure with new values. */ + sm.mnt_freq = m->mnt_freq; + sm.mnt_passno = m->mnt_passno; + + ret = ENOMEM; + if (m->mnt_fsname && + (sm.mnt_fsname = Unicode_Alloc(m->mnt_fsname, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_dir && + (sm.mnt_dir = Unicode_Alloc(m->mnt_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_type && + (sm.mnt_type = Unicode_Alloc(m->mnt_type, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_opts && + (sm.mnt_opts = Unicode_Alloc(m->mnt_opts, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + ret = 0; + +exit: + if (ret != 0) { + errno = ret; + return NULL; + } + return &sm; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getmntent_r -- + * + * POSIX getmntent_r() + * + * Results: + * Pointer to updated mntent struct or NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct mntent * +Posix_Getmntent_r(FILE *fp, // IN: + struct mntent *m, // IN: + char *buf, // IN: + int size) // IN: +{ + int ret; + char *fsname = NULL; + char *dir = NULL; + char *type = NULL; + char *opts = NULL; + char *p; + + if (!getmntent_r(fp, m, buf, size)) { + return NULL; + } + + /* + * Convert strings to UTF-8 + */ + + ret = ENOMEM; + if (m->mnt_fsname && + (fsname = Unicode_Alloc(m->mnt_fsname, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_dir && + (dir = Unicode_Alloc(m->mnt_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_type && + (type = Unicode_Alloc(m->mnt_type, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_opts && + (opts = Unicode_Alloc(m->mnt_opts, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + + /* + * Put UTF-8 strings into the structure. + */ + + ret = ERANGE; + p = buf; + + if (fsname) { + int len = strlen(fsname) + 1; + if (p + len > buf + size) { + goto exit; + } + m->mnt_fsname = memcpy(p, fsname, len); + p += len; + } + + if (dir != NULL) { + int len = strlen(dir) + 1; + if (p + len > buf + size) { + goto exit; + } + m->mnt_dir = memcpy(p, dir, len); + p += len; + } + + if (type) { + int len = strlen(type) + 1; + if (p + len > buf + size) { + goto exit; + } + m->mnt_type = memcpy(p, type, len); + p += len; + } + + if (opts) { + size_t len = strlen(opts) + 1; + if (p + len > buf + size) { + goto exit; + } + m->mnt_opts = memcpy(p, opts, len); + p += len; + } + ret = 0; + +exit: + + free(fsname); + free(dir); + free(type); + free(opts); + + if (ret != 0) { + errno = ret; + return NULL; + } + return m; +} + +#endif // } !defined(__APPLE__) +#endif // } !defined(__FreeBSD__) +#endif // } !defined(sun) +#endif // } !defined(N_PLAT_NLM) diff --git a/open-vm-tools/lib/misc/posixWin32.c b/open-vm-tools/lib/misc/posixWin32.c new file mode 100644 index 000000000..992a045d4 --- /dev/null +++ b/open-vm-tools/lib/misc/posixWin32.c @@ -0,0 +1,693 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vmware.h" +#include "posix.h" +#include "str.h" +#include "hashTable.h" +#include "vm_atomic.h" +#include "unicode.h" + + +/* + *---------------------------------------------------------------------- + * + * Posix_Open -- + * + * Open a file via POSIX open(). + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Open(ConstUnicode pathName, // IN: + int flags, // IN: + ...) // IN: +{ + const utf16_t *path = UNICODE_GET_UTF16(pathName); + mode_t mode = 0; + int fd; + + if ((flags & O_CREAT) != 0) { + va_list a; + va_start(a, flags); + mode = va_arg(a, mode_t); + va_end(a); + } + + fd = _wopen(path, flags, mode); + + UNICODE_RELEASE_UTF16(path); + return fd; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Creat -- + * + * Create a file via POSIX creat(). + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Creat(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + return Posix_Open(pathName, O_CREAT | O_WRONLY | O_TRUNC, mode); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Fopen -- + * + * Open a file via POSIX fopen(). + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Fopen(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + const utf16_t *path; + const utf16_t *modeString; + FILE *stream; + + ASSERT(mode); + + path = UNICODE_GET_UTF16(pathName); + modeString = UNICODE_GET_UTF16(mode); + + stream = _wfopen(path, modeString); + + UNICODE_RELEASE_UTF16(path); + UNICODE_RELEASE_UTF16(modeString); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Popen -- + * + * Open a file via POSIX popen(). + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Popen(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + const utf16_t *path; + const utf16_t *modeString; + FILE *stream; + + ASSERT(mode); + + path = UNICODE_GET_UTF16(pathName); + modeString = UNICODE_GET_UTF16(mode); + + stream = _wpopen(path, modeString); + + UNICODE_RELEASE_UTF16(path); + UNICODE_RELEASE_UTF16(modeString); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chdir -- + * + * POSIX chdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chdir(ConstUnicode pathName) // IN: +{ + const utf16_t *path = UNICODE_GET_UTF16(pathName); + int result = _wchdir(path); + + UNICODE_RELEASE_UTF16(path); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mkdir -- + * + * POSIX mkdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mkdir(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + const utf16_t *path = UNICODE_GET_UTF16(pathName); + int result = _wmkdir(path); + + UNICODE_RELEASE_UTF16(path); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Stat -- + * + * POSIX stat(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Stat(ConstUnicode pathName, // IN: + struct stat *statbuf) // IN: +{ + struct _stat _statbuf; + const utf16_t *path = UNICODE_GET_UTF16(pathName); + int ret = _wstat(path, &_statbuf); + UNICODE_RELEASE_UTF16(path); + + if (ret == 0) { + statbuf->st_dev = _statbuf.st_dev; + statbuf->st_ino = _statbuf.st_ino; + statbuf->st_mode = _statbuf.st_mode; + statbuf->st_nlink = _statbuf.st_nlink; + statbuf->st_uid = _statbuf.st_uid; + statbuf->st_gid = _statbuf.st_gid; + statbuf->st_rdev = _statbuf.st_rdev; + statbuf->st_size = _statbuf.st_size; + statbuf->st_atime = _statbuf.st_atime; + statbuf->st_mtime = _statbuf.st_mtime; + statbuf->st_ctime = _statbuf.st_ctime; + } + + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Rename -- + * + * POSIX rename(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Rename(ConstUnicode fromPathName, // IN: + ConstUnicode toPathName) // IN: +{ + utf16_t *fromPath = UNICODE_GET_UTF16(fromPathName); + utf16_t *toPath = UNICODE_GET_UTF16(toPathName); + int result = _wrename(fromPath, toPath); + + UNICODE_RELEASE_UTF16(fromPath); + UNICODE_RELEASE_UTF16(toPath); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Unlink -- + * + * POSIX unlink(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Unlink(ConstUnicode pathName) // IN: +{ + const utf16_t *path = UNICODE_GET_UTF16(pathName); + int result = _wunlink(path); + + UNICODE_RELEASE_UTF16(path); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Rmdir -- + * + * POSIX rmdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Rmdir(ConstUnicode pathName) // IN: +{ + const utf16_t *path = UNICODE_GET_UTF16(pathName); + int result = _wrmdir(path); + + UNICODE_RELEASE_UTF16(path); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chmod -- + * + * POSIX chmod(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chmod(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + const utf16_t *path = UNICODE_GET_UTF16(pathName); + int result = _wchmod(path, mode); + + UNICODE_RELEASE_UTF16(path); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Freopen -- + * + * Open a file via POSIX freopen(). + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Freopen(ConstUnicode pathName, // IN: + const char *mode, // IN: + FILE *input_stream) // IN: +{ + const utf16_t *path; + const utf16_t *modeString; + FILE *stream; + + path = UNICODE_GET_UTF16(pathName); + modeString = UNICODE_GET_UTF16(mode); + + stream = _wfreopen(path, modeString, input_stream); + + UNICODE_RELEASE_UTF16(path); + UNICODE_RELEASE_UTF16(modeString); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Access -- + * + * POSIX access(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Access(ConstUnicode pathName, // IN: + int mode) // IN: +{ + utf16_t *path = UNICODE_GET_UTF16(pathName); + int ret = _waccess(path, mode); + + UNICODE_RELEASE_UTF16(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execl -- + * + * POSIX execl(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execl(ConstUnicode pathName, // IN: + ConstUnicode arg0, ...) // IN: +{ + int ret = -1; + utf16_t *path = UNICODE_GET_UTF16(pathName); + utf16_t **argv = NULL; + va_list vl; + int i, count = 0; + + if (arg0) { + count = 1; + va_start(vl, arg0); + while(va_arg(vl, utf16_t *)) { + count ++; + } + va_end(vl); + } + + argv = (utf16_t **)malloc(sizeof(utf16_t *) * (count + 1)); + if (argv) { + if (count > 0) { + argv[0] = UNICODE_GET_UTF16(arg0); + va_start(vl, arg0); + for (i = 1; i < count; i++) { + argv[i] = UNICODE_GET_UTF16(va_arg(vl, char *)); + } + va_end(vl); + } + argv[count] = NULL; + } else { + errno = ENOMEM; + goto exit; + } + + ret = _wexecv(path, argv); + +exit: + if (argv) { + for (i = 0; i < count; i++) { + UNICODE_RELEASE_UTF16(argv[i]); + } + free(argv); + } + UNICODE_RELEASE_UTF16(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execv -- + * + * POSIX execv(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execv(ConstUnicode pathName, // IN: + Unicode const argVal[]) // IN: +{ + int ret = -1; + utf16_t *path = UNICODE_GET_UTF16(pathName); + utf16_t **argv = NULL; + int i, count = 0; + + if (argVal) { + while (argVal[count]) { + count++; + } + argv = (utf16_t **)malloc(sizeof(utf16_t *) * (count + 1)); + if (argv) { + for (i = 0; i < count; i++) { + argv[i] = UNICODE_GET_UTF16(argVal[i]); + } + argv[count] = NULL; + } else { + errno = ENOMEM; + goto exit; + } + } + + ret = _wexecv(path, argv); + +exit: + if (argv) { + for (i = 0; i < count; i++) { + UNICODE_RELEASE_UTF16(argv[i]); + } + free(argv); + } + UNICODE_RELEASE_UTF16(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execvp -- + * + * POSIX execvp(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execvp(ConstUnicode fileName, // IN: + Unicode const argVal[]) // IN: +{ + int ret = -1; + utf16_t *file = UNICODE_GET_UTF16(fileName); + utf16_t **argv = NULL; + int i, count = 0; + + if (argVal) { + while (argVal[count]) { + count++; + } + argv = (utf16_t **)malloc(sizeof(utf16_t *) * (count + 1)); + if (argv) { + for (i = 0; i < count; i++) { + argv[i] = UNICODE_GET_UTF16(argVal[i]); + } + argv[count] = NULL; + } else { + errno = ENOMEM; + goto exit; + } + } + + ret = _wexecvp(file, argv); + +exit: + if (argv) { + for (i = 0; i < count; i++) { + UNICODE_RELEASE_UTF16(argv[i]); + } + free(argv); + } + UNICODE_RELEASE_UTF16(file); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getenv -- + * + * POSIX getenv(). + * + * Results: + * NULL The name was not found or an error occurred + * !NULL The value associated with the name in UTF8. This does not + * need to be freed. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +static void +PosixEnvFree(void *v) // IN: +{ + Unicode_Free((Unicode) v); +} + +Unicode +Posix_Getenv(ConstUnicode name) // IN: +{ + utf16_t *rawData; + utf16_t *rawName; + Unicode newValue; + HashTable *posixHashTable; + + static Atomic_Ptr posixEnvPtr; // Implicitly initialized to NULL. --mbellon + + posixHashTable = HashTable_AllocOnce(&posixEnvPtr, 128, + HASH_FLAG_ATOMIC | HASH_STRING_KEY, + PosixEnvFree); + + rawName = UNICODE_GET_UTF16(name); + rawData = _wgetenv(rawName); + UNICODE_RELEASE_UTF16(rawName); + + if (rawData == NULL) { + return NULL; + } + + newValue = Unicode_AllocWithUTF16(rawData); + + if (newValue != NULL) { + HashTable_ReplaceOrInsert(posixHashTable, name, newValue); + } + + return newValue; +} diff --git a/open-vm-tools/lib/misc/random.c b/open-vm-tools/lib/misc/random.c index 30343f733..492b4e15d 100644 --- a/open-vm-tools/lib/misc/random.c +++ b/open-vm-tools/lib/misc/random.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/shared/Makefile.am b/open-vm-tools/lib/misc/shared/Makefile.am index a68db23d1..03af173b8 100644 --- a/open-vm-tools/lib/misc/shared/Makefile.am +++ b/open-vm-tools/lib/misc/shared/Makefile.am @@ -18,9 +18,11 @@ noinst_LTLIBRARIES = libMisc.la libMisc_la_SOURCES = +libMisc_la_SOURCES += ../atomic.c libMisc_la_SOURCES += ../base64.c libMisc_la_SOURCES += ../codeset.c libMisc_la_SOURCES += ../dbllnklst.c +libMisc_la_SOURCES += ../dynarray.c libMisc_la_SOURCES += ../dynbuf.c libMisc_la_SOURCES += ../escape.c libMisc_la_SOURCES += ../hashTable.c diff --git a/open-vm-tools/lib/misc/shared/Makefile.in b/open-vm-tools/lib/misc/shared/Makefile.in index 51d37fab4..c334dd9ba 100644 --- a/open-vm-tools/lib/misc/shared/Makefile.in +++ b/open-vm-tools/lib/misc/shared/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -59,10 +59,10 @@ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libMisc_la_LIBADD = -am_libMisc_la_OBJECTS = base64.lo codeset.lo dbllnklst.lo dynbuf.lo \ - escape.lo hashTable.lo hostinfo_misc.lo hostname.lo idLinux.lo \ - iovector.lo machineID.lo miscSolaris.lo random.lo timeutil.lo \ - util_misc.lo vmstdio.lo +am_libMisc_la_OBJECTS = atomic.lo base64.lo codeset.lo dbllnklst.lo \ + dynarray.lo dynbuf.lo escape.lo hashTable.lo hostinfo_misc.lo \ + hostname.lo idLinux.lo iovector.lo machineID.lo miscSolaris.lo \ + random.lo timeutil.lo util_misc.lo vmstdio.lo libMisc_la_OBJECTS = $(am_libMisc_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -217,11 +217,11 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libMisc.la -libMisc_la_SOURCES = ../base64.c ../codeset.c ../dbllnklst.c \ - ../dynbuf.c ../escape.c ../hashTable.c ../hostinfo_misc.c \ - ../hostname.c ../idLinux.c ../iovector.c ../machineID.c \ - ../miscSolaris.c ../random.c ../timeutil.c ../util_misc.c \ - ../vmstdio.c +libMisc_la_SOURCES = ../atomic.c ../base64.c ../codeset.c \ + ../dbllnklst.c ../dynarray.c ../dynbuf.c ../escape.c \ + ../hashTable.c ../hostinfo_misc.c ../hostname.c ../idLinux.c \ + ../iovector.c ../machineID.c ../miscSolaris.c ../random.c \ + ../timeutil.c ../util_misc.c ../vmstdio.c AM_CFLAGS = @COMMON_CFLAGS@ @LIB_MISC_CFLAGS@ all: all-am @@ -274,9 +274,11 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codeset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbllnklst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynarray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynbuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashTable.Plo@am__quote@ @@ -312,6 +314,13 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +atomic.lo: ../atomic.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT atomic.lo -MD -MP -MF $(DEPDIR)/atomic.Tpo -c -o atomic.lo `test -f '../atomic.c' || echo '$(srcdir)/'`../atomic.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/atomic.Tpo $(DEPDIR)/atomic.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../atomic.c' object='atomic.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o atomic.lo `test -f '../atomic.c' || echo '$(srcdir)/'`../atomic.c + base64.lo: ../base64.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT base64.lo -MD -MP -MF $(DEPDIR)/base64.Tpo -c -o base64.lo `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/base64.Tpo $(DEPDIR)/base64.Plo @@ -333,6 +342,13 @@ dbllnklst.lo: ../dbllnklst.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbllnklst.lo `test -f '../dbllnklst.c' || echo '$(srcdir)/'`../dbllnklst.c +dynarray.lo: ../dynarray.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynarray.lo -MD -MP -MF $(DEPDIR)/dynarray.Tpo -c -o dynarray.lo `test -f '../dynarray.c' || echo '$(srcdir)/'`../dynarray.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dynarray.Tpo $(DEPDIR)/dynarray.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../dynarray.c' object='dynarray.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynarray.lo `test -f '../dynarray.c' || echo '$(srcdir)/'`../dynarray.c + dynbuf.lo: ../dynbuf.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynbuf.lo -MD -MP -MF $(DEPDIR)/dynbuf.Tpo -c -o dynbuf.lo `test -f '../dynbuf.c' || echo '$(srcdir)/'`../dynbuf.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dynbuf.Tpo $(DEPDIR)/dynbuf.Plo @@ -435,8 +451,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -448,8 +464,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -459,12 +475,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/misc/timeutil.c b/open-vm-tools/lib/misc/timeutil.c index 5a7d7504c..f97b69e14 100644 --- a/open-vm-tools/lib/misc/timeutil.c +++ b/open-vm-tools/lib/misc/timeutil.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/misc/util_misc.c b/open-vm-tools/lib/misc/util_misc.c index c9b479ce4..5e1f23b21 100644 --- a/open-vm-tools/lib/misc/util_misc.c +++ b/open-vm-tools/lib/misc/util_misc.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,7 +26,6 @@ #include // also includes windows.h #include #include -#include "win32util.h" #endif #include "vm_ctype.h" @@ -60,7 +59,12 @@ #include "vm_version.h" #include "su.h" #include "escape.h" +#include "posix.h" +#if defined(_WIN32) +#include "win32u.h" +#include "win32util.h" +#endif /* * ESX with userworld VMX */ @@ -90,12 +94,7 @@ Util_GetCanonicalPath(const char *path) // IN { char *canonicalPath = NULL; #if defined(__linux__) || defined(__APPLE__) - char longpath[PATH_MAX]; - - if (realpath(path, longpath) == NULL) { - return NULL; - } - canonicalPath = strdup(longpath); + canonicalPath = Posix_RealPath(path); #elif defined(_WIN32) char driveSpec[4]; Bool remoteDrive = FALSE; @@ -125,7 +124,7 @@ Util_GetCanonicalPath(const char *path) // IN if (remoteDrive) { canonicalPath = strdup(path); } else { - canonicalPath = W32Util_GetLongPathName(path); + canonicalPath = W32Util_RobustGetLongPath(path); } #else diff --git a/open-vm-tools/lib/misc/vmstdio.c b/open-vm-tools/lib/misc/vmstdio.c index 299838374..4417680a2 100644 --- a/open-vm-tools/lib/misc/vmstdio.c +++ b/open-vm-tools/lib/misc/vmstdio.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/netUtil/Makefile.in b/open-vm-tools/lib/netUtil/Makefile.in index ea1e2a88b..3aadc5d05 100644 --- a/open-vm-tools/lib/netUtil/Makefile.in +++ b/open-vm-tools/lib/netUtil/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/netUtil/netUtilLinux.c b/open-vm-tools/lib/netUtil/netUtilLinux.c index df705b471..d48f85fc0 100644 --- a/open-vm-tools/lib/netUtil/netUtilLinux.c +++ b/open-vm-tools/lib/netUtil/netUtilLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/panic/Makefile.in b/open-vm-tools/lib/panic/Makefile.in index 2b699537c..8d97bf994 100644 --- a/open-vm-tools/lib/panic/Makefile.in +++ b/open-vm-tools/lib/panic/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/panic/panic.c b/open-vm-tools/lib/panic/panic.c index 700bfe60c..d6d19a4fd 100644 --- a/open-vm-tools/lib/panic/panic.c +++ b/open-vm-tools/lib/panic/panic.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/panicDefault/Makefile.in b/open-vm-tools/lib/panicDefault/Makefile.in index 7b81346b5..3dda4d1f1 100644 --- a/open-vm-tools/lib/panicDefault/Makefile.in +++ b/open-vm-tools/lib/panicDefault/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/panicDefault/panic.c b/open-vm-tools/lib/panicDefault/panic.c index f28038922..77794b844 100644 --- a/open-vm-tools/lib/panicDefault/panic.c +++ b/open-vm-tools/lib/panicDefault/panic.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/printer/Makefile.in b/open-vm-tools/lib/printer/Makefile.in index ed53551fb..1c198604d 100644 --- a/open-vm-tools/lib/printer/Makefile.in +++ b/open-vm-tools/lib/printer/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/printer/printer.c b/open-vm-tools/lib/printer/printer.c index f0c4797bd..b91f56d83 100644 --- a/open-vm-tools/lib/printer/printer.c +++ b/open-vm-tools/lib/printer/printer.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/procMgr/Makefile.in b/open-vm-tools/lib/procMgr/Makefile.in index 8b19d197f..d22b30969 100644 --- a/open-vm-tools/lib/procMgr/Makefile.in +++ b/open-vm-tools/lib/procMgr/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/procMgr/procMgrPosix.c b/open-vm-tools/lib/procMgr/procMgrPosix.c index e1179bf47..9d97cddc5 100644 --- a/open-vm-tools/lib/procMgr/procMgrPosix.c +++ b/open-vm-tools/lib/procMgr/procMgrPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -68,6 +68,7 @@ #include "su.h" #include "str.h" #include "fileIO.h" +#include "codeset.h" /* @@ -129,7 +130,8 @@ _syscall3(int, setresgid, * ProcMgr_ListProcesses -- * * List all the processes that the calling client has privilege to - * enumerate. + * enumerate. The strings in the returned structure should be all + * UTF-8 encoded, although we do not enforce it right now. * * Results: * @@ -488,7 +490,7 @@ ProcMgr_FreeProcList(ProcMgr_ProcList *procList) * * ProcMgr_ExecSync -- * - * Synchronously execute a command. + * Synchronously execute a command. The command is UTF-8 encoded. * * Results: * TRUE on success (the program had an exit code of 0) @@ -501,7 +503,7 @@ ProcMgr_FreeProcList(ProcMgr_ProcList *procList) */ Bool -ProcMgr_ExecSync(char const *cmd, // IN: Command line +ProcMgr_ExecSync(char const *cmd, // IN: UTF-8 command line ProcMgr_ProcArgs *userArgs) // IN: Unused { pid_t pid; @@ -536,35 +538,43 @@ ProcMgr_ExecSync(char const *cmd, // IN: Command line */ static pid_t -ProcMgrStartProcess(char const *cmd) // IN +ProcMgrStartProcess(char const *cmd) // IN: UTF-8 encoded cmd { pid_t pid; + char *cmdCurrent = NULL; if (cmd == NULL) { ASSERT(FALSE); return -1; } + if (!CodeSet_Utf8ToCurrent(cmd, strlen(cmd), &cmdCurrent, NULL)) { + Warning("Could not convert from UTF-8 to current\n"); + return -1; + } + pid = fork(); - + if (pid == -1) { Warning("Unable to fork: %s.\n\n", strerror(errno)); } else if (pid == 0) { + /* * Child */ - - execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); - + + execl("/bin/sh", "sh", "-c", cmdCurrent, (char *)NULL); + /* Failure */ Panic("Unable to execute the \"%s\" shell command: %s.\n\n", - cmd, strerror(errno)); + cmdCurrent, strerror(errno)); } /* * Parent */ + free(cmdCurrent); return pid; } @@ -652,7 +662,7 @@ ProcMgrWaitForProcCompletion(pid_t pid, // IN */ ProcMgr_AsyncProc * -ProcMgr_ExecAsync(char const *cmd, // IN: Command line +ProcMgr_ExecAsync(char const *cmd, // IN: UTF-8 command line ProcMgr_ProcArgs *userArgs) // IN: Unused { ProcMgr_AsyncProc *asyncProc = NULL; @@ -1269,6 +1279,8 @@ ProcMgr_Free(ProcMgr_AsyncProc *asyncProc) // IN * Impersonate a user. Much like bora/lib/impersonate, but * changes the real and saved uid as well, to work with syscalls * (access() and kill()) that look at real UID instead of effective. + * The user name should be UTF-8 encoded, although we do not enforce + * it right now. * * Assumes it will be called as root. * @@ -1283,8 +1295,8 @@ ProcMgr_Free(ProcMgr_AsyncProc *asyncProc) // IN */ Bool -ProcMgr_ImpersonateUserStart(const char *user, // IN - AuthToken token) // IN +ProcMgr_ImpersonateUserStart(const char *user, // IN: UTF-8 encoded user name + AuthToken token) // IN { char buffer[BUFSIZ]; struct passwd pw; diff --git a/open-vm-tools/lib/rpcIn/Makefile.in b/open-vm-tools/lib/rpcIn/Makefile.in index 8e7cf87b2..e12992b27 100644 --- a/open-vm-tools/lib/rpcIn/Makefile.in +++ b/open-vm-tools/lib/rpcIn/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/rpcIn/rpcin.c b/open-vm-tools/lib/rpcIn/rpcin.c index 8efc500c4..1c243ca62 100644 --- a/open-vm-tools/lib/rpcIn/rpcin.c +++ b/open-vm-tools/lib/rpcIn/rpcin.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/rpcOut/Makefile.in b/open-vm-tools/lib/rpcOut/Makefile.in index b944cece0..12f89eba5 100644 --- a/open-vm-tools/lib/rpcOut/Makefile.in +++ b/open-vm-tools/lib/rpcOut/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -115,7 +115,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -127,7 +126,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -152,7 +151,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -161,6 +159,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -168,7 +168,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -380,8 +380,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -406,8 +406,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -417,12 +417,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/rpcOut/rpcout.c b/open-vm-tools/lib/rpcOut/rpcout.c index 368f6727d..2a6bc5b00 100644 --- a/open-vm-tools/lib/rpcOut/rpcout.c +++ b/open-vm-tools/lib/rpcOut/rpcout.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/rpcOut/shared/Makefile.in b/open-vm-tools/lib/rpcOut/shared/Makefile.in index ea729b94d..080190118 100644 --- a/open-vm-tools/lib/rpcOut/shared/Makefile.in +++ b/open-vm-tools/lib/rpcOut/shared/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -103,7 +103,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -115,7 +114,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -140,7 +139,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,6 +147,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -156,7 +156,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -308,8 +308,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -321,8 +321,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -332,12 +332,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/rpcVmx/Makefile.in b/open-vm-tools/lib/rpcVmx/Makefile.in index 486d8d4fa..b9a05d7a7 100644 --- a/open-vm-tools/lib/rpcVmx/Makefile.in +++ b/open-vm-tools/lib/rpcVmx/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/rpcVmx/rpcvmx.c b/open-vm-tools/lib/rpcVmx/rpcvmx.c index 58e7d41f5..6e911ec9c 100644 --- a/open-vm-tools/lib/rpcVmx/rpcvmx.c +++ b/open-vm-tools/lib/rpcVmx/rpcvmx.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/socketMgr/Makefile.in b/open-vm-tools/lib/socketMgr/Makefile.in index 829954b71..b474eca58 100644 --- a/open-vm-tools/lib/socketMgr/Makefile.in +++ b/open-vm-tools/lib/socketMgr/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/socketMgr/socketMgr.c b/open-vm-tools/lib/socketMgr/socketMgr.c index 9f538288d..cc152cff3 100644 --- a/open-vm-tools/lib/socketMgr/socketMgr.c +++ b/open-vm-tools/lib/socketMgr/socketMgr.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/strUtil/Makefile.in b/open-vm-tools/lib/strUtil/Makefile.in index 0b519d9e7..7ec8e02c8 100644 --- a/open-vm-tools/lib/strUtil/Makefile.in +++ b/open-vm-tools/lib/strUtil/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/strUtil/strutil.c b/open-vm-tools/lib/strUtil/strutil.c index 3fbfc5ae8..40c025f95 100644 --- a/open-vm-tools/lib/strUtil/strutil.c +++ b/open-vm-tools/lib/strUtil/strutil.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -206,7 +206,7 @@ StrUtil_GetNextUintToken(uint32 *out, // OUT : parsed int */ Bool -StrUtil_GetNextInt64Token(int64 *out, // OUT: The output value +StrUtil_GetNextInt64Token(int64 *out, // OUT: The output value unsigned int *index, // IN/OUT: Index to start at const char *str, // IN : String to parse const char *delimiters) // IN : Chars separating tokens @@ -364,7 +364,7 @@ StrUtil_StrToUint(uint32 *out, // OUT */ Bool -StrUtil_StrToInt64(int64 *out, // OUT: The output value +StrUtil_StrToInt64(int64 *out, // OUT: The output value const char *str) // IN : String to parse { char *ptr; @@ -375,20 +375,69 @@ StrUtil_StrToInt64(int64 *out, // OUT: The output value errno = 0; #if defined(_WIN32) - *out= _strtoi64(str, &ptr, 0); + *out = _strtoi64(str, &ptr, 0); #elif defined(__FreeBSD__) - *out= strtoq(str, &ptr, 0); + *out = strtoq(str, &ptr, 0); #elif defined(N_PLAT_NLM) /* Works for small values of str... */ - *out= (int64)strtol(str, &ptr, 0); + *out = (int64)strtol(str, &ptr, 0); #else - *out= strtoll(str, &ptr, 0); + *out = strtoll(str, &ptr, 0); #endif return ptr[0] == '\0' && errno != ERANGE; } +/* + *----------------------------------------------------------------------------- + * + * StrUtil_StrToSizet -- + * + * Convert a string into an unsigned integer that is either 32-bits or + * 64-bits long, depending on the underlying architecture. + * + * Results: + * TRUE if conversion was successful, FALSE otherwise. + * Value is stored in 'out', which is left undefined in the FALSE case. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_StrToSizet(size_t *out, // OUT: The output value + const char *str) // IN : String to parse +{ + char *ptr; + + ASSERT(out); + ASSERT(str); + + errno = 0; +#if defined VM_X86_64 + ASSERT_ON_COMPILE(sizeof *out == sizeof(uint64)); +# if defined(_WIN32) + *out = _strtoui64(str, &ptr, 0); +# elif defined(__FreeBSD__) + *out = strtouq(str, &ptr, 0); +# elif defined(N_PLAT_NLM) + /* Works for small values of str... */ + *out = strtoul(str, &ptr, 0); +# else + *out = strtoull(str, &ptr, 0); +# endif +#else + ASSERT_ON_COMPILE(sizeof *out == sizeof(uint32)); + *out = strtoul(str, &ptr, 0); +#endif + + return *ptr == '\0' && errno != ERANGE; +} + + /* *----------------------------------------------------------------------------- * @@ -621,5 +670,5 @@ StrUtil_EndsWith(const char *s, // IN return FALSE; } - return strcmp(s + slen - suffixlen, s) == 0; + return strcmp(s + slen - suffixlen, suffix) == 0; } diff --git a/open-vm-tools/lib/string/Makefile.in b/open-vm-tools/lib/string/Makefile.in index 622ef8722..b85f01dcd 100644 --- a/open-vm-tools/lib/string/Makefile.in +++ b/open-vm-tools/lib/string/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -116,7 +116,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -128,7 +127,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -153,7 +152,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -162,6 +160,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -169,7 +169,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -385,8 +385,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -411,8 +411,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -422,12 +422,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/string/bsd_output_shared.c b/open-vm-tools/lib/string/bsd_output_shared.c index 7a0e5ea65..3616947c3 100644 --- a/open-vm-tools/lib/string/bsd_output_shared.c +++ b/open-vm-tools/lib/string/bsd_output_shared.c @@ -74,8 +74,8 @@ * return an ASCII character string representation of this number - * just digits, no sign, decimal point, or exponent symbol. * - * If 'mode' is 2, then 'prec' limits the number of digits after the - * decimal point, if 'mode' is 3, then total digits. + * If 'mode' is 3, then 'prec' limits the number of digits after the + * decimal point, if 'mode' is 2, then total digits. * * The base-10 exponent of the number is returned in 'expOut'. * @@ -111,7 +111,58 @@ dtoa(double d, // IN str = strdup(ecvt(d, prec, &dec, sign)); } else { ASSERT(3 == mode); + +#ifdef __APPLE__ + /* + * The Mac fcvt() returns "" when prec is 0, so we have to + * compensate. See bug 233530. + * While it is conceivable that fcvt(round(d), 1) can return + * a string that doesn't end in 0, it doesn't seem to happen + * in practice (on the Mac). The problematic case that we + * want to avoid is a last digit greater than 4, which requires + * rounding up, which we don't want to do, which is why we're + * doing the rounding on the number instead of after fcvt() + * in the first place. + * -- edward + */ + + if (prec == 0) { + size_t l; + str = strdup(fcvt(round(d), 1, &dec, sign)); + if (str == NULL) { + goto exit; + } + l = strlen(str); + ASSERT(l > 0); + l--; + ASSERT(str[l] == '0'); + str[l] = '\0'; + } else +#endif + str = strdup(fcvt(d, prec, &dec, sign)); + +#ifdef _WIN32 + /* + * When the value is not zero but rounds to zero at prec digits, + * the Windows fcvt() sometimes return the empty string and + * a negative dec that goes too far (as in -dec > prec). + * For example, converting 0.001 with prec 1 results in + * the empty string and dec -2. (See bug 253674.) + * + * We just clamp dec to -prec when this happens. + * + * While this may appear to be a safe and good thing to + * do in general. It really only works when the result is + * all zeros or empty. Since checking for all zeros is + * expensive, we only check for empty string, which works + * for this bug. + */ + + if (*str == '\0' && dec < 0 && dec < -prec) { + dec = -prec; + } +#endif } if (!str) { diff --git a/open-vm-tools/lib/string/bsd_vsnprintf.c b/open-vm-tools/lib/string/bsd_vsnprintf.c index 1de1d314b..d758459c5 100644 --- a/open-vm-tools/lib/string/bsd_vsnprintf.c +++ b/open-vm-tools/lib/string/bsd_vsnprintf.c @@ -69,43 +69,26 @@ #include "vmware.h" #include "bsd_output_int.h" -#include "msgfmt.h" - -typedef struct StrBuf { - Bool alloc; - Bool error; - char *buf; - size_t size; - size_t index; -} StrBuf; - -static int __sprint(StrBuf *sbuf, struct __suio *); -static char *__ujtoa(uintmax_t, char *, int, int, const char *, int, char, - const char *); +#include "codeset.h" + static char *__ultoa(u_long, char *, int, int, const char *, int, char, const char *); -static char *__wcsconv(wchar_t *, int); static void __find_arguments(const char *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); -/* - * Pretend to have wcsrtombs() and wcrtomb(). - * Don't use typedef for mbstate_t because it's actually defined - * in VS2003/VC7/include/wchar.h, but the functions don't exist. - * I don't know why, nor do I care. -- edward - */ +char blanks[PADSIZE] = + {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; +char zeroes[PADSIZE] = + {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; -#ifdef _WIN32 -#define mbstate_t int -#define wcsrtombs(dest, srcp, n, state) wcstombs(dest, *(srcp), n) -#define wcrtomb(dest, wc, state) wctomb(dest, wc) -#endif +const char xdigs_lower[17] = "0123456789abcdef?"; +const char xdigs_upper[17] = "0123456789ABCDEF?"; -static int -__sfvwrite(StrBuf *sbuf, struct __suio *uio) +int +BSDFmt_SFVWrite(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio) { int i; - struct __siov *siov; + BSDFmt_IOV *siov; /* * If asprintf(), then grow the buffer as necessary. @@ -153,8 +136,8 @@ __sfvwrite(StrBuf *sbuf, struct __suio *uio) * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. */ -static int -__sprint(StrBuf *sbuf, struct __suio *uio) +int +BSDFmt_SPrint(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio) { int err; @@ -162,19 +145,12 @@ __sprint(StrBuf *sbuf, struct __suio *uio) uio->uio_iovcnt = 0; return (0); } - err = __sfvwrite(sbuf, uio); + err = BSDFmt_SFVWrite(sbuf, uio); uio->uio_resid = 0; uio->uio_iovcnt = 0; return err; } -/* - * Macros for converting digits to letters and vice versa - */ -#define to_digit(c) ((c) - '0') -#define is_digit(c) ((unsigned)to_digit(c) <= 9) -#define to_char(n) ((n) + '0') - /* * Convert an unsigned long to ASCII for printf purposes, returning * a pointer to the first character of the string representation. @@ -258,9 +234,9 @@ __ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs, } /* Identical to __ultoa, but for intmax_t. */ -static char * -__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) +char * +BSDFmt_UJToA(uintmax_t val, char *endp, int base, int octzero, + const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; intmax_t sval; @@ -335,8 +311,8 @@ __ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, * bytes to output, and also means that we can't assume that the wide char. * string ends is null-terminated. */ -static char * -__wcsconv(wchar_t *wcsarg, int prec) +char * +BSDFmt_WCSConv(wchar_t *wcsarg, int prec) { static const mbstate_t initial; mbstate_t mbs; @@ -388,59 +364,6 @@ __wcsconv(wchar_t *wcsarg, int prec) return (convbuf); } -#ifndef NO_FLOATING_POINT - -static int exponent(char *, int, int); - -#endif /* !NO_FLOATING_POINT */ - -/* - * The size of the buffer we use as scratch space for integer - * conversions, among other things. Technically, we would need the - * most space for base 10 conversions with thousands' grouping - * characters between each pair of digits. 100 bytes is a - * conservative overestimate even for a 128-bit uintmax_t. - */ -#define BUF 100 - -#define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ - -/* - * Flags used during conversion. - */ -#define ALT 0x001 /* alternate form */ -#define LADJUST 0x004 /* left adjustment */ -#define LONGINT 0x010 /* long integer */ -#define LLONGINT 0x020 /* long long integer */ -#define SHORTINT 0x040 /* short integer */ -#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ -#define FPT 0x100 /* Floating point number */ -#define GROUPING 0x200 /* use grouping ("'" flag) */ -/* C99 additional size modifiers: */ -#define SIZET 0x400 /* size_t */ -#define PTRDIFFT 0x800 /* ptrdiff_t */ -#define INTMAXT 0x1000 /* intmax_t */ -#define CHARINT 0x2000 /* print char using int format */ - -#define INTMAX_SIZE (INTMAXT|SIZET|PTRDIFFT|LLONGINT) - -#define NIOV 8 - -/* - * Choose PADSIZE to trade efficiency vs. size. If larger printf - * fields occur frequently, increase PADSIZE and make the initialisers - * below longer. - */ - -#define PADSIZE 16 /* pad chunk size */ -static char blanks[PADSIZE] = - {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; -static char zeroes[PADSIZE] = - {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; - -static const char xdigs_lower[17] = "0123456789abcdef?"; -static const char xdigs_upper[17] = "0123456789ABCDEF?"; - int bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) @@ -449,7 +372,7 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) int ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ char *cp; /* handy char pointer (short term usage) */ - struct __siov *iovp; /* for PRINT macro */ + BSDFmt_IOV *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ @@ -498,9 +421,9 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for %[xX] conversion */ - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* buffer with space for digits of uintmax_t */ + BSDFmt_UIO uio; /* output information: summary */ + BSDFmt_IOV iov[BSDFMT_NIOV]; /* ... and individual io vectors */ + char buf[INT_CONV_BUF]; /* buffer with space for digits of uintmax_t */ char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; @@ -509,7 +432,7 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) va_list orgap; /* original argument pointer */ #endif char *convbuf; /* wide to multibyte conversion result */ - StrBuf sbuf; + BSDFmt_StrBuf sbuf; /* * BEWARE, these `goto error' on error, and PAD uses `n'. @@ -519,8 +442,8 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) iovp->iov_len = (len) * sizeof (char); \ uio.uio_resid += (len) * sizeof (char); \ iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ - if (__sprint(&sbuf, &uio)) \ + if (++uio.uio_iovcnt >= BSDFMT_NIOV) { \ + if (BSDFmt_SPrint(&sbuf, &uio)) \ goto error; \ iovp = iov; \ } \ @@ -543,7 +466,7 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ } while(0) #define FLUSH() { \ - if (uio.uio_resid && __sprint(&sbuf, &uio)) \ + if (uio.uio_resid && BSDFmt_SPrint(&sbuf, &uio)) \ goto error; \ uio.uio_iovcnt = 0; \ iovp = iov; \ @@ -937,7 +860,7 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) } } if (expchar) { - expsize = exponent(expstr, expt - 1, expchar); + expsize = BSDFmt_Exponent(expstr, expt - 1, expchar); size = expsize + prec; if (prec > 1 || flags & ALT) ++size; @@ -1034,7 +957,7 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) if ((wcp = GETARG(wchar_t *)) == NULL) cp = "(null)"; else { - convbuf = __wcsconv(wcp, prec); + convbuf = BSDFmt_WCSConv(wcp, prec); if (convbuf == NULL) { sbuf.error = TRUE; goto error; @@ -1060,6 +983,7 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) size = prec; } else size = prec; + size = CodeSet_Utf8FindCodePointBoundary(cp, size); } else size = strlen(cp); sign = '\0'; @@ -1110,14 +1034,14 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) * printf("%#.0o", 0) should print 0.'' * -- Defect Report #151 */ - cp = buf + BUF; + cp = buf + INT_CONV_BUF; if (flags & INTMAX_SIZE) { if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) - cp = __ujtoa(ujval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); + cp = BSDFmt_UJToA(ujval, cp, base, + flags & ALT, xdigs, + flags & GROUPING, thousands_sep, + grouping); } else { if (ulval != 0 || prec != 0 || (flags & ALT && base == 8)) @@ -1126,8 +1050,8 @@ bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) flags & GROUPING, thousands_sep, grouping); } - size = buf + BUF - cp; - if (size > BUF) /* should never happen */ + size = buf + INT_CONV_BUF - cp; + if (size > INT_CONV_BUF) /* should never happen */ abort(); break; default: /* "%?" prints ?, unless ? is NUL */ @@ -1682,863 +1606,10 @@ __grow_type_table (int nextarg, enum typeid **typetable, int *tablesize) } -int -Str_MsgFmtSnprintfWork(char **outbuf, size_t bufSize, const char *fmt0, - const MsgFmt_Arg *args, int numArgs) -{ - char *fmt; /* format string */ - int ch; /* character from fmt */ - int n; /* handy integer (short term usage) */ - char *cp; /* handy char pointer (short term usage) */ - struct __siov *iovp; /* for PRINT macro */ - int flags; /* flags as above */ - int ret; /* return value accumulator */ - int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format; <0 for N/A */ - char sign; /* sign prefix (' ', '+', '-', or \0) */ - char thousands_sep; /* locale specific thousands separator */ - const char *grouping; /* locale specific numeric grouping rules */ - -#ifndef NO_FLOATING_POINT - /* - * We can decompose the printed representation of floating - * point numbers into several parts, some of which may be empty: - * - * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ - * A B ---C--- D E F - * - * A: 'sign' holds this value if present; '\0' otherwise - * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal - * C: cp points to the string MMMNNN. Leading and trailing - * zeros are not in the string and must be added. - * D: expchar holds this character; '\0' if no exponent, e.g. %f - * F: at least two digits for decimal, at least one digit for hex - */ - char *decimal_point; /* locale specific decimal point */ - int signflag; /* true if float is negative */ - union { /* floating point arguments %[aAeEfFgG] */ - double dbl; - long double ldbl; - } fparg; - int expt; /* integer value of exponent */ - char expchar; /* exponent character: [eEpP\0] */ - char *dtoaend; /* pointer to end of converted digits */ - int expsize; /* character count for expstr */ - int lead; /* sig figs before decimal or group sep */ - int ndig; /* actual number of digits returned by dtoa */ - char expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ - char *dtoaresult; /* buffer allocated by dtoa */ - int nseps; /* number of group separators with ' */ - int nrepeats; /* number of repeats of the last group */ -#endif - uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ - int base; /* base for [diouxX] conversion */ - int dprec; /* a copy of prec if [diouxX], 0 otherwise */ - int realsz; /* field size expanded by dprec, sign, etc */ - int size; /* size of converted field or string */ - int prsize; /* max size of printed field */ - const char *xdigs; /* digits for %[xX] conversion */ - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* buffer with space for digits of uintmax_t */ - char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ - int nextarg; /* 1-based argument index */ - const MsgFmt_Arg *a; - char *convbuf; /* wide to multibyte conversion result */ - StrBuf sbuf; - - /* - * BEWARE, these `goto error' on error, and PAD uses `n'. - */ -#define PRINT(ptr, len) { \ - iovp->iov_base = (ptr); \ - iovp->iov_len = (len); \ - uio.uio_resid += (len); \ - iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ - if (__sprint(&sbuf, &uio)) \ - goto error; \ - iovp = iov; \ - } \ - } -#define PAD(howmany, with) { \ - if ((n = (howmany)) > 0) { \ - while (n > PADSIZE) { \ - PRINT(with, PADSIZE); \ - n -= PADSIZE; \ - } \ - PRINT(with, n); \ - } \ - } -#define PRINTANDPAD(p, ep, len, with) do { \ - int n2 = (ep) - (p); \ - if (n2 > (len)) \ - n2 = (len); \ - if (n2 > 0) \ - PRINT((p), n2); \ - PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ - } while(0) -#define FLUSH() { \ - if (uio.uio_resid && __sprint(&sbuf, &uio)) \ - goto error; \ - uio.uio_iovcnt = 0; \ - iovp = iov; \ - } - -#define FETCHARG(a, i) do { \ - int ii = (i) - 1; \ - if (ii >= numArgs) { \ - sbuf.error = TRUE; \ - goto error; \ - } \ - (a) = args + ii; \ -} while (FALSE) - - /* - * Get * arguments, including the form *nn$. - */ -#define GETASTER(val) do { \ - int n2 = 0; \ - char *cp = fmt; \ - const MsgFmt_Arg *a; \ - while (is_digit(*cp)) { \ - n2 = 10 * n2 + to_digit(*cp); \ - cp++; \ - } \ - if (*cp == '$') { \ - FETCHARG(a, n2); \ - fmt = cp + 1; \ - } else { \ - FETCHARG(a, nextarg++); \ - } \ - if (a->type != MSGFMT_ARG_INT32) { \ - sbuf.error = TRUE; \ - goto error; \ - } \ - val = a->v.signed32; \ -} while (FALSE) - - xdigs = xdigs_lower; - thousands_sep = '\0'; - grouping = NULL; - convbuf = NULL; -#ifndef NO_FLOATING_POINT - dtoaresult = NULL; - decimal_point = localeconv()->decimal_point; -#endif - - fmt = (char *)fmt0; - nextarg = 1; - uio.uio_iov = iovp = iov; - uio.uio_resid = 0; - uio.uio_iovcnt = 0; - ret = 0; - - /* - * Set up output string buffer structure. - */ - - sbuf.alloc = *outbuf == NULL; - sbuf.error = FALSE; - sbuf.buf = *outbuf; - sbuf.size = bufSize; - sbuf.index = 0; - - /* - * If asprintf(), allocate initial buffer based on format length. - * Empty format only needs one byte. - * Otherwise, round up to multiple of 64. - */ - - if (sbuf.alloc) { - size_t n = strlen(fmt0) + 1; // +1 for \0 - if (n > 1) { - n = ROUNDUP(n, 64); - } - if ((sbuf.buf = malloc(n * sizeof (char))) == NULL) { - sbuf.error = TRUE; - goto error; - } - sbuf.size = n; - } - - // shut compile up #ifndef NO_FLOATING_POINT - expchar = 0; - expsize = 0; - lead = 0; - ndig = 0; - nseps = 0; - nrepeats = 0; -#endif - ujval = 0; - - /* - * Scan the format for conversions (`%' character). - */ - for (;;) { - for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) - /* void */; - if ((n = fmt - cp) != 0) { - if ((unsigned)ret + n > INT_MAX) { - ret = EOF; - goto error; - } - PRINT(cp, n); - ret += n; - } - if (ch == '\0') - goto done; - fmt++; /* skip over '%' */ - flags = 0; - dprec = 0; - width = 0; - prec = -1; - sign = '\0'; - ox[1] = '\0'; - - rflag: ch = *fmt++; - reswitch: switch (ch) { - case ' ': - /*- - * ``If the space and + flags both appear, the space - * flag will be ignored.'' - * -- ANSI X3J11 - */ - if (!sign) - sign = ' '; - goto rflag; - case '#': - flags |= ALT; - goto rflag; - case '*': - /*- - * ``A negative field width argument is taken as a - * - flag followed by a positive field width.'' - * -- ANSI X3J11 - * They don't exclude field widths read from args. - */ - GETASTER (width); - if (width >= 0) - goto rflag; - width = -width; - /* FALLTHROUGH */ - case '-': - flags |= LADJUST; - goto rflag; - case '+': - sign = '+'; - goto rflag; - case '\'': - flags |= GROUPING; - thousands_sep = *(localeconv()->thousands_sep); - grouping = localeconv()->grouping; - goto rflag; - case '.': - if ((ch = *fmt++) == '*') { - GETASTER (prec); - goto rflag; - } - prec = 0; - while (is_digit(ch)) { - prec = 10 * prec + to_digit(ch); - ch = *fmt++; - } - goto reswitch; - case '0': - /*- - * ``Note that 0 is taken as a flag, not as the - * beginning of a field width.'' - * -- ANSI X3J11 - */ - flags |= ZEROPAD; - goto rflag; - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - n = 0; - do { - n = 10 * n + to_digit(ch); - ch = *fmt++; - } while (is_digit(ch)); - if (ch == '$') { - nextarg = n; - goto rflag; - } - width = n; - goto reswitch; - case 'h': - if (flags & SHORTINT) { - flags &= ~SHORTINT; - flags |= CHARINT; - } else - flags |= SHORTINT; - goto rflag; - case 'j': - flags |= INTMAXT; - goto rflag; - case 'I': - /* could be I64 - long long int is 64bit */ - if (fmt[0] == '6' && fmt[1] == '4') { - fmt += 2; - flags |= LLONGINT; - goto rflag; - } - /* could be I32 - normal int is 32bit */ - if (fmt[0] == '3' && fmt[1] == '2') { - fmt += 2; - /* flags |= normal integer - it is 32bit for all our targets */ - goto rflag; - } - /* - * I alone - use Microsoft's semantic as size_t modifier. We do - * not support glibc's semantic to use alternative digits. - */ - flags |= SIZET; - goto rflag; - case 'l': - if (flags & LONGINT) { - flags &= ~LONGINT; - flags |= LLONGINT; - } else - flags |= LONGINT; - goto rflag; - case 'L': - case 'q': - flags |= LLONGINT; /* not necessarily */ - goto rflag; - case 't': - flags |= PTRDIFFT; - goto rflag; - case 'Z': - case 'z': - flags |= SIZET; - goto rflag; - case 'C': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'c': - FETCHARG(a, nextarg++); - if (a->type != MSGFMT_ARG_INT32) { - sbuf.error = TRUE; - goto error; - } - if (flags & LONGINT) { - static const mbstate_t initial; - mbstate_t mbs; - size_t mbseqlen; - - mbs = initial; - // XXX must deal with mismatch between wchar_t size - mbseqlen = wcrtomb(cp = buf, (wchar_t)a->v.signed32, &mbs); - if (mbseqlen == (size_t)-1) { - sbuf.error = TRUE; - goto error; - } - size = (int)mbseqlen; - } else { - *(cp = buf) = a->v.signed32; - size = 1; - } - sign = '\0'; - break; - case 'D': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'd': - case 'i': - FETCHARG(a, nextarg++); - if ((flags & (INTMAXT|LLONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.signed64; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & (SIZET|PTRDIFFT|LONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.signed64; - } else if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & SHORTINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (short) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & CHARINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (signed char) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } else { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } - if ((intmax_t)ujval < 0) { - ujval = -ujval; - sign = '-'; - } - base = 10; - goto number; -#ifndef NO_FLOATING_POINT - case 'e': - case 'E': - expchar = ch; - if (prec < 0) /* account for digit before decpt */ - prec = DEFPREC + 1; - else - prec++; - goto fp_begin; - case 'f': - case 'F': - expchar = '\0'; - goto fp_begin; - case 'g': - case 'G': - expchar = ch - ('g' - 'e'); - if (prec == 0) - prec = 1; - fp_begin: - if (flags & LLONGINT) { - sbuf.error = TRUE; - goto error; - } - if (prec < 0) - prec = DEFPREC; - if (dtoaresult != NULL) - freedtoa(dtoaresult); - FETCHARG(a, nextarg++); - if (a->type != MSGFMT_ARG_FLOAT64) { - sbuf.error = TRUE; - goto error; - } - fparg.dbl = a->v.float64; - dtoaresult = cp = - dtoa(fparg.dbl, expchar ? 2 : 3, prec, - &expt, &signflag, &dtoaend); - if (expt == 9999) - expt = INT_MAX; - if (signflag) - sign = '-'; - if (expt == INT_MAX) { /* inf or nan */ - if (*cp == 'N') { - cp = (ch >= 'a') ? "nan" : "NAN"; - sign = '\0'; - } else - cp = (ch >= 'a') ? "inf" : "INF"; - size = 3; - break; - } - flags |= FPT; - ndig = dtoaend - cp; - if (ch == 'g' || ch == 'G') { - if (expt > -4 && expt <= prec) { - /* Make %[gG] smell like %[fF] */ - expchar = '\0'; - if (flags & ALT) - prec -= expt; - else - prec = ndig - expt; - if (prec < 0) - prec = 0; - } else { - /* - * Make %[gG] smell like %[eE], but - * trim trailing zeroes if no # flag. - */ - if (!(flags & ALT)) - prec = ndig; - } - } - if (expchar) { - expsize = exponent(expstr, expt - 1, expchar); - size = expsize + prec; - if (prec > 1 || flags & ALT) - ++size; - } else { - /* space for digits before decimal point */ - if (expt > 0) - size = expt; - else /* "0" */ - size = 1; - /* space for decimal pt and following digits */ - if (prec || flags & ALT) - size += prec + 1; - if (grouping && expt > 0) { - /* space for thousands' grouping */ - nseps = nrepeats = 0; - lead = expt; - while (*grouping != CHAR_MAX) { - if (lead <= *grouping) - break; - lead -= *grouping; - if (*(grouping+1)) { - nseps++; - grouping++; - } else - nrepeats++; - } - size += nseps + nrepeats; - } else - lead = expt; - } - break; -#endif /* !NO_FLOATING_POINT */ - case 'n': - sbuf.error = TRUE; - goto error; - case 'O': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'o': - base = 8; - goto get_unsigned; - case 'p': - /*- - * ``The argument shall be a pointer to void. The - * value of the pointer is converted to a sequence - * of printable characters, in an implementation- - * defined manner.'' - * -- ANSI X3J11 - */ - FETCHARG(a, nextarg++); - if (a->type == MSGFMT_ARG_PTR32) { - ujval = a->v.unsigned32; - } else if (a->type == MSGFMT_ARG_PTR64) { - ujval = a->v.unsigned64; - } else { - sbuf.error = TRUE; - goto error; - } - base = 16; - xdigs = xdigs_upper; - flags = flags | INTMAXT; - /* - * PR 103201 - * VisualC sscanf doesn't grok '0x', so prefix zeroes. - */ -// ox[1] = 'x'; - goto nosign; - case 'S': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 's': - FETCHARG(a, nextarg++); - if (flags & LONGINT) { - wchar_t *wcp; - - ASSERT_ON_COMPILE(sizeof (wchar_t) == 2 || sizeof (wchar_t) == 4); - if (sizeof (wchar_t) == 2 ? - a->type != MSGFMT_ARG_STRING16 : - a->type != MSGFMT_ARG_STRING32) { - sbuf.error = TRUE; - goto error; - } - if (convbuf != NULL) - free(convbuf); - if ((wcp = (wchar_t *) a->v.ptr) == NULL) - cp = "(null)"; - else { - convbuf = __wcsconv(wcp, prec); - if (convbuf == NULL) { - sbuf.error = TRUE; - goto error; - } - cp = convbuf; - } - } else if ((cp = a->v.string8) == NULL) - cp = "(null)"; - if (prec >= 0) { - /* - * can't use strlen; can only look for the - * NUL in the first `prec' characters, and - * strlen() will go further. - */ - char *p = memchr(cp, 0, (size_t)prec); - - if (p != NULL) { - size = p - cp; - if (size > prec) - size = prec; - } else - size = prec; - } else - size = strlen(cp); - sign = '\0'; - break; - case 'U': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'u': - base = 10; - goto get_unsigned; - case 'X': - xdigs = xdigs_upper; - goto hex; - case 'x': - xdigs = xdigs_lower; - hex: - base = 16; - if (flags & ALT) - ox[1] = ch; - flags &= ~GROUPING; - - get_unsigned: - FETCHARG(a, nextarg++); - if ((flags & (INTMAXT|LLONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.unsigned64; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & (SIZET|PTRDIFFT|LONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.unsigned64; - } else if (a->type == MSGFMT_ARG_INT32) { - ujval = (uintmax_t) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & SHORTINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (unsigned short) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & CHARINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (unsigned char) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } else { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } - if (ujval == 0) /* squash 0x/X if zero */ - ox[1] = '\0'; - - /* unsigned conversions */ - nosign: - sign = '\0'; - /*- - * ``... diouXx conversions ... if a precision is - * specified, the 0 flag will be ignored.'' - * -- ANSI X3J11 - */ - number: - if ((dprec = prec) >= 0) - flags &= ~ZEROPAD; - - /*- - * ``The result of converting a zero value with an - * explicit precision of zero is no characters.'' - * -- ANSI X3J11 - * - * ``The C Standard is clear enough as is. The call - * printf("%#.0o", 0) should print 0.'' - * -- Defect Report #151 - */ - cp = buf + BUF; - if (ujval != 0 || prec != 0 || - (flags & ALT && base == 8)) - cp = __ujtoa(ujval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); - size = buf + BUF - cp; - if (size > BUF) /* should never happen */ - abort(); - break; - default: /* "%?" prints ?, unless ? is NUL */ - if (ch == '\0') - goto done; - /* pretend it was %c with argument ch */ - cp = buf; - *cp = ch; - size = 1; - sign = '\0'; - break; - } - - /* - * All reasonable formats wind up here. At this point, `cp' - * points to a string which (if not flags&LADJUST) should be - * padded out to `width' places. If flags&ZEROPAD, it should - * first be prefixed by any sign or other prefix; otherwise, - * it should be blank padded before the prefix is emitted. - * After any left-hand padding and prefixing, emit zeroes - * required by a decimal [diouxX] precision, then print the - * string proper, then emit zeroes required by any leftover - * floating precision; finally, if LADJUST, pad with blanks. - * - * Compute actual size, so we know how much to pad. - * size excludes decimal prec; realsz includes it. - */ - realsz = dprec > size ? dprec : size; - if (sign) - realsz++; - if (ox[1]) - realsz += 2; - - prsize = width > realsz ? width : realsz; - if ((unsigned)ret + prsize > INT_MAX) { - ret = EOF; - goto error; - } - - /* right-adjusting blank padding */ - if ((flags & (LADJUST|ZEROPAD)) == 0) - PAD(width - realsz, blanks); - - /* prefix */ - if (sign) - PRINT(&sign, 1); - - if (ox[1]) { /* ox[1] is either x, X, or \0 */ - ox[0] = '0'; - PRINT(ox, 2); - } - - /* right-adjusting zero padding */ - if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) - PAD(width - realsz, zeroes); - - /* leading zeroes from decimal precision */ - PAD(dprec - size, zeroes); - - /* the string or number proper */ -#ifndef NO_FLOATING_POINT - if ((flags & FPT) == 0) { - PRINT(cp, size); - } else { /* glue together f_p fragments */ - if (!expchar) { /* %[fF] or sufficiently short %[gG] */ - if (expt <= 0) { - PRINT(zeroes, 1); - if (prec || flags & ALT) - PRINT(decimal_point, 1); - PAD(-expt, zeroes); - /* already handled initial 0's */ - prec += expt; - } else { - PRINTANDPAD(cp, dtoaend, lead, zeroes); - cp += lead; - if (grouping) { - while (nseps>0 || nrepeats>0) { - if (nrepeats > 0) - nrepeats--; - else { - grouping--; - nseps--; - } - PRINT(&thousands_sep, - 1); - PRINTANDPAD(cp,dtoaend, - *grouping, zeroes); - cp += *grouping; - } - if (cp > dtoaend) - cp = dtoaend; - } - if (prec || flags & ALT) - PRINT(decimal_point,1); - } - PRINTANDPAD(cp, dtoaend, prec, zeroes); - } else { /* %[eE] or sufficiently long %[gG] */ - if (prec > 1 || flags & ALT) { - buf[0] = *cp++; - buf[1] = *decimal_point; - PRINT(buf, 2); - PRINT(cp, ndig-1); - PAD(prec - ndig, zeroes); - } else /* XeYYY */ - PRINT(cp, 1); - PRINT(expstr, expsize); - } - } -#else - PRINT(cp, size); -#endif - /* left-adjusting padding (always blank) */ - if (flags & LADJUST) - PAD(width - realsz, blanks); - - /* finally, adjust ret */ - ret += prsize; - - FLUSH(); /* copy out the I/O vectors */ - } -done: - FLUSH(); - - /* - * Always null terminate, unless buffer is size 0. - */ - - ASSERT(!sbuf.error && ret >= 0); - if (sbuf.size <= 0) { - ASSERT(!sbuf.alloc); - } else { - ASSERT(sbuf.index < sbuf.size); - sbuf.buf[sbuf.index] = '\0'; - } - -error: -#ifndef NO_FLOATING_POINT - if (dtoaresult != NULL) - freedtoa(dtoaresult); -#endif - if (convbuf != NULL) - free(convbuf); - if (sbuf.error) { - ret = EOF; - } - - // return allocated buffer on success, free it on failure - if (sbuf.alloc) { - if (ret < 0) { - free(sbuf.buf); - } else { - *outbuf = sbuf.buf; - } - } - - return (ret); - /* NOTREACHED */ - -#undef PRINT -#undef PAD -#undef PRINTANDPAD -#undef FLUSH -#undef FETCHARG -#undef GETASTER -} - - -#ifndef NO_FLOATING_POINT - -static int -exponent(char *p0, int exp, int fmtch) +int +BSDFmt_Exponent(char *p0, int exp, int fmtch) { char *p, *t; char expbuf[MAXEXPDIG]; diff --git a/open-vm-tools/lib/string/bsd_vsnwprintf.c b/open-vm-tools/lib/string/bsd_vsnwprintf.c index 49b6c2af6..43a19dd39 100644 --- a/open-vm-tools/lib/string/bsd_vsnwprintf.c +++ b/open-vm-tools/lib/string/bsd_vsnwprintf.c @@ -72,8 +72,8 @@ typedef struct StrBuf { size_t index; } StrBuf; -static int __sfvwrite(StrBuf *sbuf, struct __suio *uio); -static int __sprint(StrBuf *sbuf, struct __suio *uio); +static int __sfvwrite(StrBuf *sbuf, BSDFmt_UIO *uio); +static int __sprint(StrBuf *sbuf, BSDFmt_UIO *uio); static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const char *, int, char, const char *); static wchar_t *__ultoa(u_long, wchar_t *, int, int, const char *, int, @@ -89,10 +89,10 @@ static void __grow_type_table(int, enum typeid **, int *); #endif static int -__sfvwrite(StrBuf *sbuf, struct __suio *uio) +__sfvwrite(StrBuf *sbuf, BSDFmt_UIO *uio) { int i; - struct __siov *siov; + BSDFmt_IOV *siov; /* * If aswprintf(), then grow the buffer as necessary. @@ -141,7 +141,7 @@ __sfvwrite(StrBuf *sbuf, struct __suio *uio) * then reset it so that it can be reused. */ static int -__sprint(StrBuf *sbuf, struct __suio *uio) +__sprint(StrBuf *sbuf, BSDFmt_UIO *uio) { int err; @@ -155,13 +155,6 @@ __sprint(StrBuf *sbuf, struct __suio *uio) return err; } -/* - * Macros for converting digits to letters and vice versa - */ -#define to_digit(c) ((c) - '0') -#define is_digit(c) ((unsigned)to_digit(c) <= 9) -#define to_char(n) ((n) + '0') - /* * Convert an unsigned long to ASCII for printf purposes, returning * a pointer to the first character of the string representation. @@ -386,36 +379,6 @@ static int exponent(wchar_t *, int, wchar_t); #endif /* !NO_FLOATING_POINT */ -/* - * The size of the buffer we use as scratch space for integer - * conversions, among other things. Technically, we would need the - * most space for base 10 conversions with thousands' grouping - * characters between each pair of digits. 100 bytes is a - * conservative overestimate even for a 128-bit uintmax_t. - */ -#define BUF 100 - -#define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ - -/* - * Flags used during conversion. - */ -#define ALT 0x001 /* alternate form */ -#define LADJUST 0x004 /* left adjustment */ -#define LONGINT 0x010 /* long integer */ -#define LLONGINT 0x020 /* long long integer */ -#define SHORTINT 0x040 /* short integer */ -#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ -#define FPT 0x100 /* Floating point number */ -#define GROUPING 0x200 /* use grouping ("'" flag) */ -/* C99 additional size modifiers: */ -#define SIZET 0x400 /* size_t */ -#define PTRDIFFT 0x800 /* ptrdiff_t */ -#define INTMAXT 0x1000 /* intmax_t */ -#define CHARINT 0x2000 /* print char using int format */ - -#define NIOV 8 - int bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, va_list ap) @@ -424,7 +387,7 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, wchar_t ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ - struct __siov *iovp; /* for PRINT macro */ + BSDFmt_IOV *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ @@ -472,9 +435,9 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for [xX] conversion */ - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV]; /* ... and individual io vectors */ - wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ + BSDFmt_UIO uio; /* output information: summary */ + BSDFmt_IOV iov[BSDFMT_NIOV]; /* ... and individual io vectors */ + wchar_t buf[INT_CONV_BUF]; /* buffer with space for digits of uintmax_t */ wchar_t ox[2]; /* space for 0x hex-prefix */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; @@ -511,7 +474,7 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, iovp->iov_len = len; \ uio.uio_resid += len; \ iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ + if (++uio.uio_iovcnt >= BSDFMT_NIOV) { \ if (__sprint(&sbuf, &uio)) \ goto error; \ iovp = iov; \ @@ -1096,7 +1059,7 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, * printf("%#.0o", 0) should print 0.'' * -- Defect Report #151 */ - cp = buf + BUF; + cp = buf + INT_CONV_BUF; if (flags & INTMAX_SIZE) { if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) @@ -1112,8 +1075,8 @@ bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, flags & GROUPING, thousands_sep, grouping); } - size = buf + BUF - cp; - if (size > BUF) /* should never happen */ + size = buf + INT_CONV_BUF - cp; + if (size > INT_CONV_BUF) /* should never happen */ abort(); break; default: /* "%?" prints ?, unless ? is NUL */ diff --git a/open-vm-tools/lib/string/shared/Makefile.in b/open-vm-tools/lib/string/shared/Makefile.in index 128cac5b4..0ce093ccc 100644 --- a/open-vm-tools/lib/string/shared/Makefile.in +++ b/open-vm-tools/lib/string/shared/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -104,7 +104,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -116,7 +115,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -141,7 +140,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,6 +148,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -157,7 +157,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -334,8 +334,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -347,8 +347,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -358,12 +358,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/string/str.c b/open-vm-tools/lib/string/str.c index 2a3c96e81..4bfafddff 100644 --- a/open-vm-tools/lib/string/str.c +++ b/open-vm-tools/lib/string/str.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,6 +35,7 @@ #ifdef HAS_BSD_PRINTF #include "bsd_output.h" #endif +#include "codeset.h" #if defined _WIN32 && !defined HAS_BSD_PRINTF #define vsnprintf _vsnprintf @@ -99,7 +100,8 @@ Str_Sprintf(char *buf, // OUT * terminate character), -1 on overflow (insufficient space for * null terminate is considered overflow) * - * NB: on overflow the buffer WILL be null terminated + * NB: on overflow the buffer WILL be null terminated at the last + * UTF-8 code point boundary within the buffer's bounds. * * Side effects: * None @@ -140,11 +142,11 @@ Str_Vsnprintf(char *str, // OUT * those cases. */ -#if defined _WIN32 && !defined HAS_BSD_PRINTF if ((retval < 0 || retval >= size) && size > 0) { - str[size - 1] = '\0'; + /* Find UTF-8 code point boundary and place NUL termination there */ + int trunc = CodeSet_Utf8FindCodePointBoundary(str, size - 1); + str[trunc] = '\0'; } -#endif if (retval >= size) { return -1; } @@ -397,7 +399,39 @@ Str_Asprintf(size_t *length, // OUT /* *----------------------------------------------------------------------------- * - * Str_Vasprintf -- + * Str_SafeAsprintf -- + * + * Same as Str_SafeVasprintf(), but parameters are passed inline + * + * Results: + * Same as Str_SafeVasprintf() + * + * Side effects: + * Same as Str_SafeVasprintf() + * + *----------------------------------------------------------------------------- + */ + +char * +Str_SafeAsprintf(size_t *length, // OUT + const char *format, // IN + ...) // IN +{ + va_list arguments; + char *result; + + va_start(arguments, format); + result = Str_SafeVasprintf(length, format, arguments); + va_end(arguments); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrVasprintf_Internal -- * * Allocate and format a string, using the GNU libc way to specify the * format (i.e. optionally allow the use of positional parameters) @@ -405,8 +439,10 @@ Str_Asprintf(size_t *length, // OUT * Results: * * The allocated string on success (if 'length' is not NULL, *length - * is set to the length of the allocated string) - * NULL on failure + * is set to the length of the allocated string). + * + * ASSERTs or returns NULL on failure, depending on the value of + * 'assertOnFailure'. * * Side effects: * None @@ -414,16 +450,16 @@ Str_Asprintf(size_t *length, // OUT *----------------------------------------------------------------------------- */ -char * -Str_Vasprintf(size_t *length, // OUT - const char *format, // IN - va_list arguments) // IN +static char * +StrVasprintf_Internal(size_t *length, // OUT + const char *format, // IN + va_list arguments, // IN + Bool assertOnFailure) // IN { - char *buf; + char *buf = NULL; int ret; #ifdef HAS_BSD_PRINTF - buf = NULL; #ifdef __linux__ { va_list aq; @@ -444,10 +480,7 @@ Str_Vasprintf(size_t *length, // OUT * but not vasprintf (e.g. in Win32 or in drivers). We just fallback * to vsnprintf, doubling if we didn't have enough space. */ - size_t bufSize; - - bufSize = strlen(format); - buf = NULL; + size_t bufSize = strlen(format); do { /* @@ -459,10 +492,10 @@ Str_Vasprintf(size_t *length, // OUT bufSize *= 2; newBuf = realloc(buf, bufSize); - if (!newBuf) { free(buf); - return NULL; + buf = NULL; + goto exit; } buf = newBuf; @@ -471,15 +504,72 @@ Str_Vasprintf(size_t *length, // OUT #endif if (ret < 0) { - return NULL; + buf = NULL; + goto exit; } if (length != NULL) { *length = ret; } + + exit: + if (assertOnFailure) { + ASSERT_NOT_IMPLEMENTED(buf); + } return buf; } +/* + *----------------------------------------------------------------------------- + * + * Str_Vasprintf -- + * + * See StrVasprintf_Internal. + * + * Results: + * See StrVasprintf_Internal. + * Returns NULL on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +Str_Vasprintf(size_t *length, // OUT + const char *format, // IN + va_list arguments) // IN +{ + return StrVasprintf_Internal(length, format, arguments, FALSE); +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_SafeVasprintf -- + * + * See StrVasprintf_Internal. + * + * Results: + * See StrVasprintf_Internal. + * Calls ASSERT_NOT_IMPLEMENTED on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +Str_SafeVasprintf(size_t *length, // OUT + const char *format, // IN + va_list arguments) // IN +{ + return StrVasprintf_Internal(length, format, arguments, TRUE); +} + #if defined(_WIN32) || defined(GLIBC_VERSION_22) /* @@ -748,48 +838,92 @@ Str_Wcsncat(wchar_t *buf, // IN-OUT /* - *----------------------------------------------------------------------------- + *---------------------------------------------------------------------- * - * Str_Aswprintf -- + * Str_Mbscpy-- * - * Same as Str_Vaswprintf(), but parameters are passed inline + * Wrapper for _mbscpy that checks for buffer overruns. * * Results: - * Same as Str_Vaswprintf() + * Same as strcpy. * * Side effects: - * Same as Str_Vaswprintf() + * None. * - *----------------------------------------------------------------------------- + *---------------------------------------------------------------------- */ -wchar_t * -Str_Aswprintf(size_t *length, // OUT - const wchar_t *format, // IN - ...) // IN +unsigned char * +Str_Mbscpy(char *buf, // OUT + const char *src, // IN + size_t maxSize) // IN { - va_list arguments; - wchar_t *result; - - va_start(arguments, format); - result = Str_Vaswprintf(length, format, arguments); - va_end(arguments); + uint32 *stack = (uint32 *)&buf; + size_t len; - return result; + len = strlen((const char *) src); + if (len >= maxSize) { + Panic("%s:%d Buffer too small 0x%x\n", __FILE__, __LINE__, stack[-1]); + } + return memcpy(buf, src, len + 1); +} + + +/* + *---------------------------------------------------------------------- + * + * Str_Mbscat -- + * + * Wrapper for _mbscat that checks for buffer overruns. + * + * The Microsoft _mbscat may or may not deal with tailing + * partial multibyte sequence in buf. We don't. + * + * Results: + * Same as strcat. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +unsigned char * +Str_Mbscat(char *buf, // IN-OUT + const char *src, // IN + size_t maxSize) // IN +{ + uint32 *stack = (uint32 *)&buf; + size_t bufLen; + size_t srcLen; + + bufLen = strlen((const char *) buf); + srcLen = strlen((const char *) src); + + /* The first comparison checks for numeric overflow */ + if (bufLen + srcLen < srcLen || bufLen + srcLen >= maxSize) { + Panic("%s:%d Buffer too small 0x%x\n", __FILE__, __LINE__, stack[-1]); + } + + memcpy(buf + bufLen, src, srcLen + 1); + + return (unsigned char *)buf; } /* *----------------------------------------------------------------------------- * - * Str_Vaswprintf -- + * StrVaswprintf_Internal -- * * Allocate and format a string. * * Results: * The allocated string on success (if 'length' is not NULL, *length - * is set to the length of the allocated string, in wchat_ts) - * NULL on failure + * is set to the length of the allocated string, in wchat_ts) + * + * ASSERTs or returns NULL on failure, depending on the value of + * 'assertOnFailure'. * * Side effects: * None @@ -797,17 +931,17 @@ Str_Aswprintf(size_t *length, // OUT *----------------------------------------------------------------------------- */ -wchar_t * -Str_Vaswprintf(size_t *length, // OUT - const wchar_t *format, // IN - va_list arguments) // IN +static wchar_t * +StrVaswprintf_Internal(size_t *length, // OUT + const wchar_t *format, // IN + va_list arguments, // IN + Bool assertOnFailure) // IN { size_t bufSize; - wchar_t *buf; + wchar_t *buf = NULL; int retval; bufSize = wcslen(format); - buf = NULL; do { /* @@ -819,10 +953,10 @@ Str_Vaswprintf(size_t *length, // OUT bufSize *= 2; newBuf = realloc(buf, bufSize*sizeof(wchar_t)); - if (!newBuf) { free(buf); - return NULL; + buf = NULL; + goto exit; } buf = newBuf; @@ -837,9 +971,130 @@ Str_Vaswprintf(size_t *length, // OUT /* * Try to trim the buffer here to save memory? */ + + exit: + if (assertOnFailure) { + ASSERT_NOT_IMPLEMENTED(buf); + } return buf; } + +/* + *----------------------------------------------------------------------------- + * + * Str_Aswprintf -- + * + * Same as Str_Vaswprintf(), but parameters are passed inline. + * + * Results: + * Same as Str_Vaswprintf() + * + * Side effects: + * Same as Str_Vaswprintf() + * + *----------------------------------------------------------------------------- + */ + +wchar_t * +Str_Aswprintf(size_t *length, // OUT + const wchar_t *format, // IN + ...) // IN +{ + va_list arguments; + wchar_t *result; + + va_start(arguments, format); + result = Str_Vaswprintf(length, format, arguments); + va_end(arguments); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_Vaswprintf -- + * + * See StrVaswprintf_Internal. + * + * Results: + * See StrVaswprintf_Internal. + * Returns NULL on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +wchar_t * +Str_Vaswprintf(size_t *length, // OUT + const wchar_t *format, // IN + va_list arguments) // IN +{ + return StrVaswprintf_Internal(length, format, arguments, FALSE); +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_SafeAswprintf -- + * + * Same as Str_SafeVaswprintf(), but parameters are passed inline. + * + * Results: + * Same as Str_SafeVaswprintf() + * + * Side effects: + * Same as Str_SafeVaswprintf() + * + *----------------------------------------------------------------------------- + */ + +wchar_t * +Str_SafeAswprintf(size_t *length, // OUT + const wchar_t *format, // IN + ...) // IN +{ + va_list arguments; + wchar_t *result; + + va_start(arguments, format); + result = Str_SafeVaswprintf(length, format, arguments); + va_end(arguments); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_SafeVaswprintf -- + * + * See StrVaswprintf_Internal. + * + * Results: + * See StrVaswprintf_Internal. + * Calls ASSERT_NOT_IMPLEMENTED on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +wchar_t * +Str_SafeVaswprintf(size_t *length, // OUT + const wchar_t *format, // IN + va_list arguments) // IN +{ + return StrVaswprintf_Internal(length, format, arguments, TRUE); +} + #endif // defined(_WIN32) || defined(GLIBC_VERSION_22) #ifndef _WIN32 @@ -847,7 +1102,7 @@ Str_Vaswprintf(size_t *length, // OUT /* *----------------------------------------------------------------------------- * - * _Str_ToLower -- + * Str_ToLower -- * * Convert a string to lowercase, in-place. Hand-rolled, for non-WIN32. * @@ -863,7 +1118,7 @@ Str_Vaswprintf(size_t *length, // OUT */ char * -_Str_ToLower(char *string) // IN +Str_ToLower(char *string) // IN { char *c = string; @@ -879,7 +1134,7 @@ _Str_ToLower(char *string) // IN /* *----------------------------------------------------------------------------- * - * _Str_ToUpper -- + * Str_ToUpper -- * * Convert a string to uppercase, in-place. Hand-rolled, for non-WIN32. * @@ -895,7 +1150,7 @@ _Str_ToLower(char *string) // IN */ char * -_Str_ToUpper(char *string) // IN +Str_ToUpper(char *string) // IN { char *c = string; diff --git a/open-vm-tools/lib/sync/Makefile.in b/open-vm-tools/lib/sync/Makefile.in index b7df2d6be..7dabb0447 100644 --- a/open-vm-tools/lib/sync/Makefile.in +++ b/open-vm-tools/lib/sync/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -115,7 +115,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -127,7 +126,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -152,7 +151,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -161,6 +159,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -168,7 +168,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -381,8 +381,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -407,8 +407,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -418,12 +418,13 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/sync/shared/Makefile.in b/open-vm-tools/lib/sync/shared/Makefile.in index fe3329e57..62d3b74b1 100644 --- a/open-vm-tools/lib/sync/shared/Makefile.in +++ b/open-vm-tools/lib/sync/shared/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -103,7 +103,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -115,7 +114,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -140,7 +139,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,6 +147,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -156,7 +156,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -316,8 +316,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -329,8 +329,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -340,12 +340,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/sync/syncMutex.c b/open-vm-tools/lib/sync/syncMutex.c index d27019f45..295d26faf 100644 --- a/open-vm-tools/lib/sync/syncMutex.c +++ b/open-vm-tools/lib/sync/syncMutex.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -263,3 +263,31 @@ SyncMutex_CreateSingleton(Atomic_Ptr *lckStorage) // IN return lck; } + + +#if !defined(N_PLAT_NLM) +/* + *----------------------------------------------------------------------------- + * + * SyncMutex_Trylock -- + * + * Tries to lock the mutex. Returns without blocking. + * + * Results: + * TRUE if the mutex was locked, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +SyncMutex_Trylock(SyncMutex *that) +{ + ASSERT(that); + + return Atomic_ReadIfEqualWrite(&that->unlocked, TRUE, FALSE); +} +#endif + diff --git a/open-vm-tools/lib/sync/syncWaitQPosix.c b/open-vm-tools/lib/sync/syncWaitQPosix.c index 7ed8c09dc..f8d58df7b 100644 --- a/open-vm-tools/lib/sync/syncWaitQPosix.c +++ b/open-vm-tools/lib/sync/syncWaitQPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/syncDriver/Makefile.in b/open-vm-tools/lib/syncDriver/Makefile.in index 262740576..fe9c899a4 100644 --- a/open-vm-tools/lib/syncDriver/Makefile.in +++ b/open-vm-tools/lib/syncDriver/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/syncDriver/syncDriverPosix.c b/open-vm-tools/lib/syncDriver/syncDriverPosix.c index 0ce2a2238..f6a553494 100644 --- a/open-vm-tools/lib/syncDriver/syncDriverPosix.c +++ b/open-vm-tools/lib/syncDriver/syncDriverPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -175,14 +175,12 @@ SyncDriver_DrivesAreFrozen(void) file = open(SYNC_PROC_PATH, O_RDONLY); if (file == -1) { - SyncDriverDebug("can't open driver proc node"); return FALSE; } ret = ioctl(file, SYNC_IOC_QUERY, &active); if (ret == -1) { active = 0; - SyncDriverDebug("SYNC_IOC_QUERY ioctl failed"); } close(file); diff --git a/open-vm-tools/lib/system/Makefile.in b/open-vm-tools/lib/system/Makefile.in index 7b230f6b2..5dfd018b6 100644 --- a/open-vm-tools/lib/system/Makefile.in +++ b/open-vm-tools/lib/system/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/system/systemLinux.c b/open-vm-tools/lib/system/systemLinux.c index e4e0b46b7..5efd85434 100644 --- a/open-vm-tools/lib/system/systemLinux.c +++ b/open-vm-tools/lib/system/systemLinux.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,11 +26,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) # error This file should not be compiled #endif @@ -41,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -65,6 +61,7 @@ #include "vm_assert.h" #include "system.h" #include "debug.h" +#include "unicode.h" #define MAX_IFACES 4 #define LOOPBACK "lo" @@ -225,6 +222,82 @@ System_AddToCurrentTime(int64 deltaSecs, // IN } +/* + *----------------------------------------------------------------------------- + * + * System_GetTimeAsString -- + * + * Returns the current time as a formatted string, useful for prepending + * to debugging output. + * + * For example: "Oct 05 18:03:24.948: " + * + * Results: + * On success, allocates and returns a string containing the formatted + * time. + * On failure, returns NULL. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Unicode +System_GetTimeAsString(void) +{ + struct timeval tv; + time_t sec; + int msec; + size_t charsWritten; + size_t bufSize = 8; // Multiplied by 2 for the initial allocation. + char *buf = NULL; + Unicode dateTime = NULL; + Unicode output = NULL; + + if (gettimeofday(&tv, NULL)) { + goto out; + } + sec = tv.tv_sec; + msec = tv.tv_usec / 1000; + + /* + * Loop repeatedly trying to format the time into a buffer, doubling the + * buffer with each failure. This should be safe as the manpage for + * strftime(3) seems to suggest that it only fails if the buffer isn't large + * enough. + * + * The resultant string is encoded according to the current locale. + */ + do { + char *newBuf; + bufSize *= 2; + + newBuf = realloc(buf, bufSize); + if (newBuf == NULL) { + goto out; + } + buf = newBuf; + charsWritten = strftime(buf, bufSize, "%b %d %H:%M:%S", localtime(&sec)); + } while (charsWritten == 0); + + /* + * Append the milliseconds field, but only after converting the date/time + * string from encoding specified in the current locale to an opaque type. + */ + dateTime = Unicode_Alloc(buf, STRING_ENCODING_DEFAULT); + if (dateTime == NULL) { + goto out; + } + output = Unicode_Format("%s.%03d: ", dateTime, msec); + + out: + free(buf); + Unicode_Free(dateTime); + return output; +} + + /* *---------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/toolsLogger/Makefile.in b/open-vm-tools/lib/toolsLogger/Makefile.in index f2ba4b2e6..1ec273693 100644 --- a/open-vm-tools/lib/toolsLogger/Makefile.in +++ b/open-vm-tools/lib/toolsLogger/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/toolsLogger/logger.c b/open-vm-tools/lib/toolsLogger/logger.c index 752b5de9f..361b685d4 100644 --- a/open-vm-tools/lib/toolsLogger/logger.c +++ b/open-vm-tools/lib/toolsLogger/logger.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/unicode/Makefile.in b/open-vm-tools/lib/unicode/Makefile.in index 4320326a4..749bf1296 100644 --- a/open-vm-tools/lib/unicode/Makefile.in +++ b/open-vm-tools/lib/unicode/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -108,7 +108,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -120,7 +119,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -145,7 +144,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -154,6 +152,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -161,7 +161,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -311,8 +311,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -324,8 +324,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -335,12 +335,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/unicode/unicodeCommon.c b/open-vm-tools/lib/unicode/unicodeCommon.c index f0b0d0fd3..2c5cb9bc8 100644 --- a/open-vm-tools/lib/unicode/unicodeCommon.c +++ b/open-vm-tools/lib/unicode/unicodeCommon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -55,9 +55,9 @@ static const int NonPrintableBytesToEscape[256] = { }; -static char * UnicodeEscapeBuffer(const void *buffer, - ssize_t lengthInBytes, - StringEncoding encoding); +char * Unicode_EscapeBuffer(const void *buffer, + ssize_t lengthInBytes, + StringEncoding encoding); static Bool UnicodeSanityCheck(const void *buffer, ssize_t lengthInBytes, StringEncoding encoding); @@ -65,7 +65,7 @@ static Bool UnicodeSanityCheck(const void *buffer, /* *----------------------------------------------------------------------------- * - * UnicodeEscapeBuffer -- + * Unicode_EscapeBuffer -- * * Escape non-printable bytes of the buffer with \xAB, where 0xAB * is the non-printable byte value. @@ -81,9 +81,9 @@ static Bool UnicodeSanityCheck(const void *buffer, */ char * -UnicodeEscapeBuffer(const void *buffer, // IN - ssize_t lengthInBytes, // IN - StringEncoding encoding) // IN +Unicode_EscapeBuffer(const void *buffer, // IN + ssize_t lengthInBytes, // IN + StringEncoding encoding) // IN { if (lengthInBytes == -1) { switch (encoding) { @@ -249,6 +249,43 @@ Unicode_UTF16Strlen(const utf16_t *utf16) // IN } +/* + *----------------------------------------------------------------------------- + * + * Unicode_UTF16Strdup -- + * + * Duplicates a UTF-16 string. + * + * Results: + * Returns an allocated copy of the input UTF-16 string. The caller + * is responsible for freeing it. + * + * Panics on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +utf16_t * +Unicode_UTF16Strdup(const utf16_t *utf16) // IN: May be NULL. +{ + ssize_t numBytes; + utf16_t *copy; + + // Follow Util_SafeStrdup semantics. + if (utf16 == NULL) { + return NULL; + } + + numBytes = (Unicode_UTF16Strlen(utf16) + 1 /* NUL */) * sizeof *copy; + copy = Util_SafeMalloc(numBytes); + memcpy(copy, utf16, numBytes); + return copy; +} + + /* *----------------------------------------------------------------------------- * @@ -261,17 +298,21 @@ Unicode_UTF16Strlen(const utf16_t *utf16) // IN * Otherwise, buffer must be of the specified length, but does * not need to be NUL-terminated. * + * If buffer is NULL, then NULL is returned. + * In this case, lengthInBytes must be 0 or -1, consistent with + * an empty string. + * * Note that regardless of the encoding of the buffer passed to this * function, the returned string can hold any Unicode characters. * * If the buffer contains an invalid sequence of the specified * encoding or memory could not be allocated, logs the buffer, - * ASSERTs and returns NULL (for non-debug builds). + * and panics. * * Results: * An allocated Unicode string containing the decoded characters - * in buffer, or NULL on failure. Caller must pass the string to - * Unicode_Free to free. + * in buffer, or NULL if input is NULL. + * Caller must pass the string to Unicode_Free to free. * * Side effects: * None @@ -284,44 +325,34 @@ Unicode_AllocWithLength(const void *buffer, // IN ssize_t lengthInBytes, // IN StringEncoding encoding) // IN { - Unicode result = NULL; char *escapedBuffer; ASSERT(lengthInBytes >= 0 || lengthInBytes == -1); - if (lengthInBytes < 0 && lengthInBytes != -1) { + if (buffer == NULL) { + ASSERT(lengthInBytes <= 0); return NULL; } if (UnicodeSanityCheck(buffer, lengthInBytes, encoding)) { - result = UnicodeAllocInternal(buffer, lengthInBytes, encoding); - } - - if (result) { - // Success! We've allocated the Unicode string and can return. - return result; + Unicode result = UnicodeAllocInternal(buffer, lengthInBytes, encoding); + if (result != NULL) { + return result; + } } - // Failure. Log the buffer, ASSERT, and return (in non-debug builds). - escapedBuffer = UnicodeEscapeBuffer(buffer, - lengthInBytes, - encoding); + /* + * Log and panic on failure. + */ - Log("%s: Error: Couldn't convert invalid buffer [%s] from %s to Unicode.\n", + escapedBuffer = Unicode_EscapeBuffer(buffer, lengthInBytes, encoding); + Log("%s: Error: Couldn't convert invalid buffer [%s] " + "from %s to Unicode.\n", __FUNCTION__, escapedBuffer ? escapedBuffer : "(couldn't escape bytes)", Unicode_EncodingEnumToName(encoding)); - free(escapedBuffer); - - /* - * Invalid input bytes are fatal in debug builds. If you need - * to sanity check an input array for validity, call - * Unicode_IsBufferValid() before allocating this string. - */ - ASSERT(FALSE); - - return NULL; + PANIC(); } @@ -332,6 +363,10 @@ Unicode_AllocWithLength(const void *buffer, // IN * * Tests if the given buffer is valid in the specified encoding. * + * If lengthInBytes is -1, then buffer must be NUL-terminated. + * Otherwise, buffer must be of the specified length, but does + * not need to be NUL-terminated. + * * Results: * TRUE if the buffer is valid, FALSE if it's not. * @@ -361,3 +396,34 @@ Unicode_IsBufferValid(const void *buffer, // IN return TRUE; } } + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_CanGetBytesWithEncoding -- + * + * Tests if the given Unicode string can be converted + * losslessly to the specified encoding. + * + * Results: + * TRUE if the string can be converted, FALSE if it cannot. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Unicode_CanGetBytesWithEncoding(ConstUnicode ustr, // IN + StringEncoding encoding) // IN +{ + char *tmp; + + if ((tmp = Unicode_GetAllocBytes(ustr, encoding)) == NULL) { + return FALSE; + } + free(tmp); + return TRUE; +} diff --git a/open-vm-tools/lib/unicode/unicodeInt.h b/open-vm-tools/lib/unicode/unicodeInt.h index 0b1876f3d..0a00a3a82 100644 --- a/open-vm-tools/lib/unicode/unicodeInt.h +++ b/open-vm-tools/lib/unicode/unicodeInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/unicode/unicodeSimpleBase.c b/open-vm-tools/lib/unicode/unicodeSimpleBase.c index 46fbfb706..7646df27f 100644 --- a/open-vm-tools/lib/unicode/unicodeSimpleBase.c +++ b/open-vm-tools/lib/unicode/unicodeSimpleBase.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,17 +23,7 @@ * containing NUL-terminated UTF-8 bytes as the typedef for * Unicode. * - * This implementation is a short-term shim to start work on the - * Unicode development project, and to introduce people to the - * lib/unicode interface without requiring them to change all - * layers of calling code. - * - * It does not generically handle all encodings; if an encoding - * that is not US-ASCII, UTF-8, UTF-16, or UTF-16 LE is passed to - * any function, then the process-default encoding is used instead. - * - * Basic Unicode string creation, encoding conversion, and - * access to cached UTF-8 and UTF-16 representations. + * Basic Unicode string creation and encoding conversion. * * The thread-safety of ConstUnicode functions is the same as * that for standard const char * functions: multiple threads can @@ -48,15 +38,9 @@ #include "util.h" #include "codeset.h" -#include "hashTable.h" #include "str.h" -#include "syncMutex.h" #include "unicodeBase.h" #include "unicodeInt.h" -#include "unicodeSimpleUTF16.h" - -// Initial number of buckets for the UTF-16 hash table. -static const uint32 UNICODE_UTF16_STRING_TABLE_BUCKETS = 4096; /* * Padding for initial and final bytes used by an encoding. The value @@ -65,10 +49,6 @@ static const uint32 UNICODE_UTF16_STRING_TABLE_BUCKETS = 4096; */ static const size_t UNICODE_UTF16_CODE_UNITS_PADDING = 10; -static HashTable *UnicodeUTF16StringTable; -static Atomic_Ptr UnicodeUTF16StringTableLockStorage; - - /* *----------------------------------------------------------------------------- * @@ -207,7 +187,7 @@ Unicode_Duplicate(ConstUnicode str) // IN * None * * Side effects: - * Deletes the cached UTF-16 representation of the string if it's set. + * None * *----------------------------------------------------------------------------- */ @@ -215,37 +195,73 @@ Unicode_Duplicate(ConstUnicode str) // IN void Unicode_Free(Unicode str) // IN { - char *utf8String = (char *)str; - SyncMutex *lck; + free(str); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_AllocList -- + * + * Allocates a list (actually a vector) of Unicode strings from a list + * (vector) of strings of specified encoding. + * The input list has a specified length or can be an argv-style + * NULL-terminated list (if length is negative). + * + * Results: + * An allocated list (vector) of Unicode strings. + * The result must be freed with Unicode_FreeList. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode * +Unicode_AllocList(char **srcList, // IN: list of strings + ssize_t length, // IN: list + StringEncoding encoding) // IN: +{ + Unicode *dstList = NULL; + ssize_t i; - lck = SyncMutex_CreateSingleton(&UnicodeUTF16StringTableLockStorage); - SyncMutex_Lock(lck); + ASSERT(srcList != NULL); - if (UnicodeUTF16StringTable) { - HashTable_Delete(UnicodeUTF16StringTable, utf8String); + if (length < 0) { + length = 0; + while (srcList[length] != NULL) { + length++; + } + + /* Include the sentinel element. */ + length++; } - SyncMutex_Unlock(lck); + dstList = Util_SafeMalloc(length * sizeof *dstList); - free(utf8String); + for (i = 0; i < length; i++) { + dstList[i] = Unicode_Alloc(srcList[i], encoding); + } + + return dstList; } /* *----------------------------------------------------------------------------- * - * Unicode_GetUTF8 -- + * Unicode_FreeList -- * - * Returns the contents of the string encoded as a NUL-terminated UTF-8 - * byte array. + * Free a list (actually a vector) of Unicode strings. + * The list (vector) itself is also freed. * - * Results: - * A NUL-terminated UTF-8 string; lifetime is valid until the next - * non-const Unicode function is called on the string. Caller should - * strdup if storing the return value long-term. + * The list either has a specified length or is + * argv-style NULL terminated (if length is negative). * - * Caller does not need to free; the memory is managed inside the - * Unicode object. + * Results: + * None * * Side effects: * None @@ -253,88 +269,53 @@ Unicode_Free(Unicode str) // IN *----------------------------------------------------------------------------- */ -const char * -Unicode_GetUTF8(ConstUnicode str) // IN +void +Unicode_FreeList(Unicode *list, // IN: the list to free + ssize_t length) // IN: the length { - return (const char *)str; + if (length >= 0) { + ssize_t i; + for (i = 0; i < length; i++) { + Unicode_Free(list[i]); + DEBUG_ONLY(list[i] = NULL); + } + } else { + Unicode *s; + for (s = list; *s != NULL; s++) { + Unicode_Free(*s); + DEBUG_ONLY(*s = NULL); + } + } + free(list); } /* *----------------------------------------------------------------------------- * - * Unicode_GetUTF16 -- + * Unicode_GetUTF8 -- * - * Returns the contents of the string encoded as a NUL-terminated - * UTF-16 array in host byte order. + * Returns the contents of the string encoded as a NUL-terminated UTF-8 + * byte array. * * Results: - * A NUL-terminated UTF-16 string in host byte order; lifetime is - * valid until the next non-const Unicode function is called on - * the string. Caller should duplicate if storing the return value - * long-term. + * A NUL-terminated UTF-8 string; lifetime is valid until the next + * non-const Unicode function is called on the string. Caller should + * strdup if storing the return value long-term. * * Caller does not need to free; the memory is managed inside the * Unicode object. * * Side effects: - * Creates UnicodeUTF16StringTable if it doesn't yet exist. - * If the string hasn't yet been converted to UTF-16, converts - * the string to UTF-16 and stores the result in - * UnicodeUTF16StringTable. + * None * *----------------------------------------------------------------------------- */ -const utf16_t * -Unicode_GetUTF16(ConstUnicode str) // IN +const char * +Unicode_GetUTF8(ConstUnicode str) // IN { - const char *utf8Str = (const char *)str; - utf16_t *utf16Str = NULL; - SyncMutex *lck; - - lck = SyncMutex_CreateSingleton(&UnicodeUTF16StringTableLockStorage); - SyncMutex_Lock(lck); - - if (!UnicodeUTF16StringTable) { - /* - * We use HASH_INT_KEY so we can hash on the pointer value - * rather than the contents of the string. (This lets us simply - * delete the hashtable entry in Unicode_Free() without affecting - * other strings with the same content). - * - * If we want to consolidate all UTF-16 representations of - * identical strings that might have different pointer values, - * we can use a struct rather than storing utf16Str in the hash - * directly, and reference count the UTF-16 representations, - * freeing when the last reference is gone. - */ - UnicodeUTF16StringTable = - HashTable_Alloc(UNICODE_UTF16_STRING_TABLE_BUCKETS, - HASH_INT_KEY, - (HashTableFreeEntryFn)free); - } - - /* - * TODO: In the current implementation (where Unicode is char *), - * we have no way of ensuring the caller doesn't manipulate the - * bytes in the input value after creating it. - * - * Until we make the type opaque, we must recreate the UTF-16 cache - * each time it's asked for. - */ - HashTable_Delete(UnicodeUTF16StringTable, utf8Str); - - if (CodeSet_Utf8ToUtf16le(utf8Str, - strlen(utf8Str), - (char **)&utf16Str, - NULL)) { - HashTable_Insert(UnicodeUTF16StringTable, utf8Str, utf16Str); - } - - SyncMutex_Unlock(lck); - - return utf16Str; + return (const char *)str; } @@ -386,48 +367,87 @@ size_t Unicode_BytesRequired(ConstUnicode str, // IN StringEncoding encoding) // IN { - const utf16_t *utf16; - size_t maxUTF16CodeUnitSize; + const uint8 *utf8 = (const uint8 *)str; + + // Number of bytes needed for a code point [U+0000, U+FFFF]. + size_t basicCodePointSize; + + // Number of bytes needed for a code point [U+10000, U+10FFFF]. + size_t supplementaryCodePointSize; + + size_t result = 0; switch (encoding) { + case STRING_ENCODING_UTF8: + return strlen(utf8) + 1; case STRING_ENCODING_US_ASCII: case STRING_ENCODING_ISO_8859_1: case STRING_ENCODING_WINDOWS_1252: // TODO: Lots more encodings can be added here. - maxUTF16CodeUnitSize = 1; - break; - case STRING_ENCODING_UTF8: - /* - * One UTF-16 code unit takes 3 bytes of UTF-8. Unicode code - * points > U+FFFF are encoded in two UTF-16 code units, and 4 - * bytes of UTF-8. 2*3 = 6 > 4, which gives us more than enough - * space to encode such a code point. - */ - maxUTF16CodeUnitSize = 3; + basicCodePointSize = supplementaryCodePointSize = 1; break; case STRING_ENCODING_UTF16: case STRING_ENCODING_UTF16_LE: case STRING_ENCODING_UTF16_BE: - maxUTF16CodeUnitSize = 2; + basicCodePointSize = 2; + supplementaryCodePointSize = 4; break; case STRING_ENCODING_UTF32: case STRING_ENCODING_UTF32_LE: case STRING_ENCODING_UTF32_BE: - maxUTF16CodeUnitSize = 4; + basicCodePointSize = 4; + supplementaryCodePointSize = 4; break; default: /* - * Assume the worst: ISO-2022-JP takes up to 7 bytes per UTF-16 - * code unit. + * Assume the worst: ISO-2022-JP takes up to 7 bytes per code point. */ - maxUTF16CodeUnitSize = 7; + basicCodePointSize = 7; + supplementaryCodePointSize = 7; break; } - // Accounts for leading and trailing bytes and NUL. - utf16 = Unicode_GetUTF16(str); - return (Unicode_UTF16Strlen(utf16) + UNICODE_UTF16_CODE_UNITS_PADDING) * - maxUTF16CodeUnitSize; + /* + * Do a simple check of how many bytes are needed to convert the + * UTF-8 to the target encoding. This doesn't do UTF-8 validity + * checking, but will not overrun the end of the buffer. + */ + while (*utf8) { + size_t utf8NumBytesRemaining; + + // Advance one code point forward in the UTF-8 input. + if (*utf8 <= 0x7F) { + utf8NumBytesRemaining = 1; + result += basicCodePointSize; + } else if (*utf8 & 0xC0) { + utf8NumBytesRemaining = 2; + result += basicCodePointSize; + } else if (*utf8 & 0xE0) { + utf8NumBytesRemaining = 3; + result += basicCodePointSize; + } else if (*utf8 & 0xF0) { + utf8NumBytesRemaining = 4; + result += supplementaryCodePointSize; + } else { + // Invalid input; nothing we can do. + break; + } + + while (*utf8 && utf8NumBytesRemaining) { + utf8NumBytesRemaining--; + utf8++; + } + + if (utf8NumBytesRemaining > 0) { + // Invalid input; nothing we can do. + break; + } + } + + // Add enough for NUL expressed in the target encoding. + result += UNICODE_UTF16_CODE_UNITS_PADDING * basicCodePointSize; + + return result; } @@ -441,13 +461,13 @@ Unicode_BytesRequired(ConstUnicode str, // IN * maxLengthInBytes bytes in total to the buffer. * * Results: - * Returns -1 if the Unicode string requires more than + * Returns FALSE if the Unicode string requires more than * maxLengthInBytes bytes to be encoded in the specified - * encoding, including NUL termination. (Call - * Unicode_BytesRequired(str, encoding) to get the correct length.) - * - * Otherwise, returns the number of bytes written to buffer, not - * including the NUL termination. + * encoding, including NUL termination. (Call + * Unicode_BytesRequired(str, encoding) to get the correct + * length.). Returns TRUE if no truncation was required. In + * either case, if retLength is not NULL, *retLength contains the + * number of bytes actually written to the buffer upon return. * * Side effects: * None @@ -455,62 +475,106 @@ Unicode_BytesRequired(ConstUnicode str, // IN *----------------------------------------------------------------------------- */ -ssize_t -Unicode_CopyBytes(ConstUnicode str, // IN - void *buffer, // OUT +Bool +Unicode_CopyBytes(void *destBuffer, // OUT + ConstUnicode srcBuffer, // IN size_t maxLengthInBytes, // IN + size_t *retLength, // OUT StringEncoding encoding) // IN { - const char *utf8Str = (const char *)str; - ssize_t ret = -1; + const char *utf8Str = (const char *)srcBuffer; + Bool notTruncated = TRUE; + size_t copyBytes = 0; switch (encoding) { case STRING_ENCODING_US_ASCII: case STRING_ENCODING_UTF8: - Str_Strcpy((char *) buffer, utf8Str, maxLengthInBytes); - ret = strlen((const char *)buffer); + { + size_t len = strlen(utf8Str); + copyBytes = MIN(len, maxLengthInBytes - 1); + memcpy(destBuffer, utf8Str, copyBytes); + + /* + * If we truncated, force a null termination in a UTF-8 safe + * manner. + */ + if (copyBytes < len) { + notTruncated = FALSE; + if (encoding == STRING_ENCODING_UTF8) { + copyBytes = + CodeSet_Utf8FindCodePointBoundary(destBuffer, copyBytes); + } + } + + ((char*)destBuffer)[copyBytes] = '\0'; + } break; case STRING_ENCODING_UTF16: case STRING_ENCODING_UTF16_LE: { - size_t bytesNeeded; - const utf16_t *utf16; - UnicodeIndex length; - - utf16 = Unicode_GetUTF16(str); - length = Unicode_UTF16Strlen(utf16); - // Add 1 for NUL. - bytesNeeded = (length + 1) * 2; - - if (bytesNeeded <= maxLengthInBytes) { - memcpy(buffer, utf16, bytesNeeded); - ret = bytesNeeded; + char *utf16Buf; + size_t utf16BufLen; + + if (!CodeSet_Utf8ToUtf16le(utf8Str, + strlen(utf8Str), + &utf16Buf, + &utf16BufLen)) { + break; + } + copyBytes = MIN(utf16BufLen, maxLengthInBytes - 2); + memcpy(destBuffer, utf16Buf, copyBytes); + copyBytes = CodeSet_Utf16FindCodePointBoundary(destBuffer, copyBytes); + ((utf16_t*)destBuffer)[copyBytes / 2] = 0; + free(utf16Buf); + + if (copyBytes < utf16BufLen) { + notTruncated = FALSE; } + break; } - default: + case STRING_ENCODING_DEFAULT: + defaultEncoding: { - // XXX TODO: This is not correct; it's just a stopgap measure. char *currentBuf; size_t currentBufSize; - if (CodeSet_Utf8ToCurrent(utf8Str, - strlen(utf8Str), - ¤tBuf, - ¤tBufSize)) { - if (currentBufSize < maxLengthInBytes) { - // TODO: NUL is not necessarily 1 byte in all encodings. - memcpy(buffer, currentBuf, currentBufSize + 1); - ret = currentBufSize; - free(currentBuf); - } - } else { - // XXX: What to do here? + if (!CodeSet_Utf8ToCurrent(utf8Str, + strlen(utf8Str), + ¤tBuf, + ¤tBufSize)) { + break; + } + copyBytes = MIN(currentBufSize, maxLengthInBytes - 1); + memcpy(destBuffer, currentBuf, copyBytes); + free(currentBuf); + + /* + * XXX this isn't quite correct, we still need to truncate on + * a code point boundary, based on the current encoding type, + * rather than just null terminate blindly. + */ + + ((char*)destBuffer)[copyBytes] = 0; + + if (copyBytes < currentBufSize) { + notTruncated = FALSE; } + break; } + default: + /* + * XXX TODO: We need CodeSet_Utf8ToGeneric() to implement this. + */ + goto defaultEncoding; // XXX - for [254880] fix this when ICU + // converter work is finished. + break; } - return ret; + if (retLength) { + *retLength = copyBytes; + } + return notTruncated; } diff --git a/open-vm-tools/lib/unicode/unicodeSimpleOperations.c b/open-vm-tools/lib/unicode/unicodeSimpleOperations.c index e1f98a4b4..301555a8e 100644 --- a/open-vm-tools/lib/unicode/unicodeSimpleOperations.c +++ b/open-vm-tools/lib/unicode/unicodeSimpleOperations.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,7 +29,7 @@ #include "unicodeBase.h" #include "unicodeInt.h" #include "unicodeOperations.h" -#include "unicodeSimpleUTF16.h" +#include "codeset.h" /* @@ -78,8 +78,8 @@ Unicode_CompareRange(ConstUnicode str1, // IN int result = -1; Unicode substr1 = NULL; Unicode substr2 = NULL; - const utf16_t *substr1UTF16; - const utf16_t *substr2UTF16; + utf16_t *substr1UTF16 = NULL; + utf16_t *substr2UTF16 = NULL; UnicodeIndex i = 0; UnicodeIndex utf16Index; utf16_t codeUnit1; @@ -108,12 +108,12 @@ Unicode_CompareRange(ConstUnicode str1, // IN /* * XXX TODO: Need to normalize the incoming strings to NFC or NFD. */ - substr1UTF16 = Unicode_GetUTF16(substr1); + substr1UTF16 = Unicode_GetAllocUTF16(substr1); if (!substr1UTF16) { goto out; } - substr2UTF16 = Unicode_GetUTF16(substr2); + substr2UTF16 = Unicode_GetAllocUTF16(substr2); if (!substr2UTF16) { goto out; } @@ -191,13 +191,11 @@ Unicode_CompareRange(ConstUnicode str1, // IN } out: - if (substr1) { - Unicode_Free(substr1); - } + free(substr1UTF16); + free(substr2UTF16); - if (substr2) { - Unicode_Free(substr2); - } + Unicode_Free(substr1); + Unicode_Free(substr2); return result; } @@ -519,3 +517,34 @@ Unicode_Join(ConstUnicode first, // IN: return result; } + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_Format -- + * + * Format a Unicode string (roughly equivalent to Str_Asprintf()). + * + * Results: + * The formatted string. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_Format(const char *fmt, // IN: the format + ...) // IN: the arguments +{ + va_list args; + char *p; + + va_start(args, fmt); + p = Str_Vasprintf(NULL, fmt, args); + va_end(args); + + return p; +} diff --git a/open-vm-tools/lib/unicode/unicodeSimpleTransforms.c b/open-vm-tools/lib/unicode/unicodeSimpleTransforms.c index aae46f13f..14a164f6e 100644 --- a/open-vm-tools/lib/unicode/unicodeSimpleTransforms.c +++ b/open-vm-tools/lib/unicode/unicodeSimpleTransforms.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -259,6 +259,12 @@ static const Bool *whitespacePages[256] = NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; +typedef enum { + UNICODE_TRIMLEFT = 0x1, + UNICODE_TRIMRIGHT = 0x2, + UNICODE_TRIMBOTH = (UNICODE_TRIMLEFT | UNICODE_TRIMRIGHT), +} UnicodeTrimSide; + /* *----------------------------------------------------------------------------- @@ -334,10 +340,10 @@ Unicode_FoldCase(ConstUnicode str) // IN /* *----------------------------------------------------------------------------- * - * Unicode_Trim -- + * UnicodeTrimInternal -- * * Creates a Unicode string by trimming whitespace from the beginning - * and end of the input string. + * and/or end of the input string, depending on the input parameter "side". * * Results: * The allocated Unicode string. Caller must free with Unicode_Free(). @@ -348,8 +354,9 @@ Unicode_FoldCase(ConstUnicode str) // IN *----------------------------------------------------------------------------- */ -Unicode -Unicode_Trim(ConstUnicode str) // IN +static Unicode +UnicodeTrimInternal(ConstUnicode str, // IN + UnicodeTrimSide side) // IN { Unicode trimmed; utf16_t *utf16; @@ -362,12 +369,16 @@ Unicode_Trim(ConstUnicode str) // IN utf16Start = utf16; utf16End = utf16 + Unicode_UTF16Strlen(utf16); - while (utf16Start != utf16End && UnicodeSimpleIsWhiteSpace(*utf16Start)) { - utf16Start++; + if (side & UNICODE_TRIMLEFT) { + while (utf16Start != utf16End && UnicodeSimpleIsWhiteSpace(*utf16Start)) { + utf16Start++; + } } - while (utf16End != utf16Start && UnicodeSimpleIsWhiteSpace(*(utf16End - 1))) { - utf16End--; + if (side & UNICODE_TRIMRIGHT) { + while (utf16End != utf16Start && UnicodeSimpleIsWhiteSpace(*(utf16End - 1))) { + utf16End--; + } } *utf16End = 0; @@ -377,3 +388,75 @@ Unicode_Trim(ConstUnicode str) // IN return trimmed; } + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_Trim -- + * + * Creates a Unicode string by trimming whitespace from the beginning + * and end of the input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_Trim(ConstUnicode str) // IN +{ + return UnicodeTrimInternal(str, UNICODE_TRIMBOTH); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_TrimLeft -- + * + * Creates a Unicode string by trimming whitespace from the beginning of the + * input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_TrimLeft(ConstUnicode str) // IN +{ + return UnicodeTrimInternal(str, UNICODE_TRIMLEFT); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_TrimRight -- + * + * Creates a Unicode string by trimming whitespace from the end of the + * input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_TrimRight(ConstUnicode str) // IN +{ + return UnicodeTrimInternal(str, UNICODE_TRIMRIGHT); +} diff --git a/open-vm-tools/lib/unicode/unicodeSimpleTypes.c b/open-vm-tools/lib/unicode/unicodeSimpleTypes.c index 55ce41c3a..a3e80e270 100644 --- a/open-vm-tools/lib/unicode/unicodeSimpleTypes.c +++ b/open-vm-tools/lib/unicode/unicodeSimpleTypes.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,12 +28,2129 @@ #include "unicodeBase.h" #include "unicodeInt.h" +#include "codeset.h" #include "vm_assert.h" #include "util.h" static char *UnicodeNormalizeEncodingName(const char *encoding); +/* + * Cross reference of IANA character set names, windows code pages + * and ICU encodings + * + * See: http://www.iana.org/assignments/character-sets + * http://msdn2.microsoft.com/en-us/library/ms776446(VS.85).aspx + * + * If you add new supported StringEncodings to this table, you must + * keep SIMPLE_ENCODING_LIST[] (see below) and the StringEncoding + * enum in lib/public/unicodeTypes.h in sync! + */ + +#define MAXCHARSETNAMES 12 +#define MIBUNDEF -1 +#define WINUNDEF -1 + +static struct xRef { + int MIBenum; // Assigned by IANA + int winACP; // Windows code page from GetACP() + StringEncoding encoding; // ICU encoding enum + int preferredMime; // Index of preferred MIME name + char *names[MAXCHARSETNAMES]; // Encoding name and aliases +} xRef[] = { + /* + * Source: ECMA registry + */ + { 3, 20127, STRING_ENCODING_US_ASCII, 4, + { "ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", + "ASCII", "ISO646-US", "US-ASCII", "us", "IBM367", "cp367", "csASCII", + NULL } + }, + /* + * Source: ECMA registry + */ + { 4, 28591, STRING_ENCODING_ISO_8859_1, 3, + { "ISO_8859-1:1987", "iso-ir-100", "ISO_8859-1", "ISO-8859-1", "latin1", + "l1", "IBM819", "CP819", "csISOLatin1", NULL } + }, + /* + * Source: ECMA registry + */ + { 5, 28592, STRING_ENCODING_ISO_8859_2, 3, + { "ISO_8859-2:1987", "iso-ir-101", "ISO_8859-2", "ISO-8859-2", "latin2", + "l2", "csISOLatin2", NULL } + }, + /* + * Source: ECMA registry + */ + { 6, 28593, STRING_ENCODING_ISO_8859_3, 3, + { "ISO_8859-3:1988", "iso-ir-109", "ISO_8859-3", "ISO-8859-3", "latin3", + "l3", "csISOLatin3", NULL } + }, + /* + * Source: ECMA registry + */ + { 7, 28594, STRING_ENCODING_ISO_8859_4, 3, + { "ISO_8859-4:1988", "iso-ir-110", "ISO_8859-4", "ISO-8859-4", "latin4", + "l4", "csISOLatin4", NULL } + }, + /* + * Source: ECMA registry + */ + { 8, 28595, STRING_ENCODING_ISO_8859_5, 3, + { "ISO_8859-5:1988", "iso-ir-144", "ISO_8859-5", "ISO-8859-5", "cyrillic", + "csISOLatinCyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 9, 28596, STRING_ENCODING_ISO_8859_6, 3, + { "ISO_8859-6:1987", "iso-ir-127", "ISO_8859-6", "ISO-8859-6", "ECMA-114", + "ASMO-708", "arabic", "csISOLatinArabic", NULL } + }, + /* + * Source: Windows duplicate of ISO-8859-6 + */ + { 9, 708, STRING_ENCODING_ISO_8859_6, 0, + { "ASMO-708", NULL } + }, + /* + * Source: ECMA registry + */ + { 10, 28597, STRING_ENCODING_ISO_8859_7, 3, + { "ISO_8859-7:1987", "iso-ir-126", "ISO_8859-7", "ISO-8859-7", "ELOT_928", + "ECMA-118", "greek", "greek8", "csISOLatinGreek", NULL } + }, + /* + * Source: ECMA registry + */ + { 11, 28598, STRING_ENCODING_ISO_8859_8, 3, + { "ISO_8859-8:1988", "iso-ir-138", "ISO_8859-8", "ISO-8859-8", "hebrew", + "csISOLatinHebrew", NULL } + }, + /* + * Source: ECMA registry + */ + { 12, 28599, STRING_ENCODING_ISO_8859_9, 3, + { "ISO_8859-9:1989", "iso-ir-148", "ISO_8859-9", "ISO-8859-9", "latin5", + "l5", "csISOLatin5", NULL } + }, + /* + * Source: ECMA registry + */ + { 13, WINUNDEF, STRING_ENCODING_ISO_8859_10, 0, + { "ISO-8859-10", "iso-ir-157", "l6", "ISO_8859-10:1992", "csISOLatin6", + "latin6", NULL } + }, + /* + * Source: ECMA registry and ISO 6937-2:1983 + */ + { 14, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_6937-2-add", "iso-ir-142", "csISOTextComm", NULL } + }, + /* + * Source: JIS X 0201-1976. One byte only, this is equivalent to + * JIS/Roman (similar to ASCII) plus eight-bit half-width + * Katakana + */ + { 15, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_X0201", "X0201", "csHalfWidthKatakana", NULL } + }, + /* + * Source: JIS X 0202-1991. Uses ISO 2022 escape sequences to + * shift code sets as documented in JIS X 0202-1991. + */ + { 16, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_Encoding", "csJISEncoding", NULL } + }, + /* + * Source: This charset is an extension of csHalfWidthKatakana by + * adding graphic characters in JIS X 0208. The CCS's are + * JIS X0201:1997 and JIS X0208:1997. The + * complete definition is shown in Appendix 1 of JIS + * X0208:1997. + * This charset can be used for the top-level media type "text". + */ + { 17, 932, STRING_ENCODING_SHIFT_JIS, 0, + { "Shift_JIS", "MS_Kanji", "csShiftJIS", NULL } + }, + /* + * Source: Standardized by OSF, UNIX International, and UNIX Systems + * Laboratories Pacific. Uses ISO 2022 rules to select + * code set 0: US-ASCII (a single 7-bit byte set) + * code set 1: JIS X0208-1990 (a double 8-bit byte set) + * restricted to A0-FF in both bytes + * code set 2: Half Width Katakana (a single 7-bit byte set) + * requiring SS2 as the character prefix + * code set 3: JIS X0212-1990 (a double 7-bit byte set) + * restricted to A0-FF in both bytes + * requiring SS3 as the character prefix + */ + { 18, 20932, STRING_ENCODING_EUC_JP, 2, + { "Extended_UNIX_Code_Packed_Format_for_Japanese", "csEUCPkdFmtJapanese", + "EUC-JP", NULL } + }, + /* + * Windows duplicate of EUC-JP + */ + { 18, 51932, STRING_ENCODING_EUC_JP, 2, + { "Extended_UNIX_Code_Packed_Format_for_Japanese", "csEUCPkdFmtJapanese", + "EUC-JP", NULL } + }, + /* + * Source: Used in Japan. Each character is 2 octets. + * code set 0: US-ASCII (a single 7-bit byte set) + * 1st byte = 00 + * 2nd byte = 20-7E + * code set 1: JIS X0208-1990 (a double 7-bit byte set) + * restricted to A0-FF in both bytes + * code set 2: Half Width Katakana (a single 7-bit byte set) + * 1st byte = 00 + * 2nd byte = A0-FF + * code set 3: JIS X0212-1990 (a double 7-bit byte set) + * restricted to A0-FF in + * the first byte + * and 21-7E in the second byte + */ + { 19, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Extended_UNIX_Code_Fixed_Width_for_Japanese", "csEUCFixWidJapanese", + NULL } + }, + /* + * Source: ECMA registry + */ + { 20, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "BS_4730", "iso-ir-4", "ISO646-GB", "gb", "uk", "csISO4UnitedKingdom", + NULL } + }, + /* + * Source: ECMA registry + */ + { 21, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "SEN_850200_C", "iso-ir-11", "ISO646-SE2", "se2", + "csISO11SwedishForNames", NULL } + }, + /* + * Source: ECMA registry + */ + { 22, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IT", "iso-ir-15", "ISO646-IT", "csISO15Italian", NULL } + }, + /* + * Source: ECMA registry + */ + { 23, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ES", "iso-ir-17", "ISO646-ES", "csISO17Spanish", NULL } + }, + /* + * Source: ECMA registry + */ + { 24, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "DIN_66003", "iso-ir-21", "de", "ISO646-DE", "csISO21German", NULL } + }, + /* + * Source: ECMA registry + */ + { 25, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NS_4551-1", "iso-ir-60", "ISO646-NO", "no", "csISO60DanishNorwegian", + "csISO60Norwegian1", NULL } + }, + /* + * Source: ECMA registry + */ + { 26, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NF_Z_62-010", "iso-ir-69", "ISO646-FR", "fr", "csISO69French", NULL } + }, + /* + * Source: Universal Transfer Format (1), this is the multibyte + * encoding, that subsets ASCII-7. It does not have byte + * ordering issues. + */ + { 27, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-10646-UTF-1", "csISO10646UTF1", NULL } + }, + /* + * Source: ECMA registry + */ + { 28, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_646.basic:1983", "ref", "csISO646basic1983", NULL } + }, + { 29, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "INVARIANT", "csINVARIANT", NULL } + }, + /* + * Source: ECMA registry + */ + { 30, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_646.irv:1983", "iso-ir-2", "irv", "csISO2IntlRefVersion", NULL } + }, + /* + * Source: ECMA registry + */ + { 31, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NATS-SEFI", "iso-ir-8-1", "csNATSSEFI", NULL } + }, + /* + * Source: ECMA registry + */ + { 32, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NATS-SEFI-ADD", "iso-ir-8-2", "csNATSSEFIADD", NULL } + }, + /* + * Source: ECMA registry + */ + { 33, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NATS-DANO", "iso-ir-9-1", "csNATSDANO", NULL } + }, + /* + * Source: ECMA registry + */ + { 34, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NATS-DANO-ADD", "iso-ir-9-2", "csNATSDANOADD", NULL } + }, + /* + * Source: ECMA registry + */ + { 35, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "SEN_850200_B", "iso-ir-10", "FI", "ISO646-FI", "ISO646-SE", "se", + "csISO10Swedish", NULL } + }, + /* + * Source: ECMA registry + */ + { 36, 949, STRING_ENCODING_UNKNOWN, 0, + { "KS_C_5601-1987", "iso-ir-149", "KS_C_5601-1989", "KSC_5601", "korean", + "csKSC56011987", NULL } + }, + /* + * Source: RFC-1557 (see also KS_C_5601-1987) + */ + { 37, 50225, STRING_ENCODING_ISO_2022_KR, 0, + { "ISO-2022-KR", "csISO2022KR", NULL } + }, + /* + * Source: RFC-1557 (see also KS_C_5861-1992) + */ + { 38, 51949, STRING_ENCODING_EUC_KR, 0, + { "EUC-KR", "csEUCKR", NULL } + }, + /* + * Source: RFC-1468 (see also RFC-2237) + */ + { 39, 50220, STRING_ENCODING_ISO_2022_JP, 0, + { "ISO-2022-JP", "csISO2022JP", NULL } + }, + /* + * Source: VMware + */ + { MIBUNDEF, WINUNDEF, STRING_ENCODING_ISO_2022_JP_1, 0, + { "ISO-2022-JP-1", NULL } + }, + /* + * Source: RFC-1554 + */ + { 40, WINUNDEF, STRING_ENCODING_ISO_2022_JP_2, 0, + { "ISO-2022-JP-2", "csISO2022JP2", NULL } + }, + /* + * Source: ECMA registry + */ + { 41, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6220-1969-jp", "JIS_C6220-1969", "iso-ir-13", "katakana", + "x0201-7", "csISO13JISC6220jp", NULL } + }, + /* + * Source: ECMA registry + */ + { 42, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6220-1969-ro", "iso-ir-14", "jp", "ISO646-JP", + "csISO14JISC6220ro", NULL } + }, + /* + * Source: ECMA registry + */ + { 43, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "PT", "iso-ir-16", "ISO646-PT", "csISO16Portuguese", NULL } + }, + /* + * Source: ECMA registry + */ + { 44, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "greek7-old", "iso-ir-18", "csISO18Greek7Old", NULL } + }, + /* + * Source: ECMA registry + */ + { 45, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "latin-greek", "iso-ir-19", "csISO19LatinGreek", NULL } + }, + /* + * Source: ECMA registry + */ + { 46, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NF_Z_62-010_(1973)", "iso-ir-25", "ISO646-FR1", "csISO25French", + NULL } + }, + /* + * Source: ECMA registry + */ + { 47, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Latin-greek-1", "iso-ir-27", "csISO27LatinGreek1", NULL } + }, + /* + * Source: ECMA registry + */ + { 48, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_5427", "iso-ir-37", "csISO5427Cyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 49, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6226-1978", "iso-ir-42", "csISO42JISC62261978", NULL } + }, + /* + * Source: ECMA registry + */ + { 50, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "BS_viewdata", "iso-ir-47", "csISO47BSViewdata", NULL } + }, + /* + * Source: ECMA registry + */ + { 51, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "INIS", "iso-ir-49", "csISO49INIS", NULL } + }, + /* + * Source: ECMA registry + */ + { 52, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "INIS-8", "iso-ir-50", "csISO50INIS8", NULL } + }, + /* + * Source: ECMA registry + */ + { 53, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "INIS-cyrillic", "iso-ir-51", "csISO51INISCyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 54, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_5427:1981", "iso-ir-54", "ISO5427Cyrillic1981", NULL } + }, + /* + * Source: ECMA registry + */ + { 55, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_5428:1980", "iso-ir-55", "csISO5428Greek", NULL } + }, + /* + * Source: ECMA registry + */ + { 56, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "GB_1988-80", "iso-ir-57", "cn", "ISO646-CN", "csISO57GB1988", NULL } + }, + /* + * Source: ECMA registry + */ + { 57, 20936, STRING_ENCODING_UNKNOWN, 0, + { "GB_2312-80", "iso-ir-58", "chinese", "csISO58GB231280", NULL } + }, + /* + * Source: ECMA registry + */ + { 58, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NS_4551-2", "ISO646-NO2", "iso-ir-61", "no2", "csISO61Norwegian2", + NULL } + }, + /* + * Source: ECMA registry + */ + { 59, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "videotex-suppl", "iso-ir-70", "csISO70VideotexSupp1", NULL } + }, + /* + * Source: ECMA registry + */ + { 60, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "PT2", "iso-ir-84", "ISO646-PT2", "csISO84Portuguese2", NULL } + }, + /* + * Source: ECMA registry + */ + { 61, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ES2", "iso-ir-85", "ISO646-ES2", "csISO85Spanish2", NULL } + }, + /* + * Source: ECMA registry + */ + { 62, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "MSZ_7795.3", "iso-ir-86", "ISO646-HU", "hu", "csISO86Hungarian", + NULL } + }, + /* + * Source: ECMA registry + */ + { 63, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6226-1983", "iso-ir-87", "x0208", "JIS_X0208-1983", + "csISO87JISX0208", NULL } + }, + /* + * Source: ECMA registry + */ + { 64, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "greek7", "iso-ir-88", "csISO88Greek7", NULL } + }, + /* + * Source: ECMA registry + */ + { 65, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ASMO_449", "ISO_9036", "arabic7", "iso-ir-89", "csISO89ASMO449", + NULL } + }, + /* + * Source: ECMA registry + */ + { 66, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "iso-ir-90", "csISO90", NULL } + }, + /* + * Source: ECMA registry + */ + { 67, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6229-1984-a", "iso-ir-91", "jp-ocr-a", "csISO91JISC62291984a", + NULL } + }, + /* + * Source: ECMA registry + */ + { 68, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6229-1984-b", "iso-ir-92", "ISO646-JP-OCR-B", "jp-ocr-b", + "csISO92JISC62991984b", NULL } + }, + /* + * Source: ECMA registry + */ + { 69, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6229-1984-b-add", "iso-ir-93", "jp-ocr-b-add", + "csISO93JIS62291984badd", NULL } + }, + /* + * Source: ECMA registry + */ + { 70, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6229-1984-hand", "iso-ir-94", "jp-ocr-hand", + "csISO94JIS62291984hand", NULL } + }, + /* + * Source: ECMA registry + */ + { 71, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6229-1984-hand-add", "iso-ir-95", "jp-ocr-hand-add", + "csISO95JIS62291984handadd", NULL } + }, + /* + * Source: ECMA registry + */ + { 72, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_C6229-1984-kana", "iso-ir-96", "csISO96JISC62291984kana", NULL } + }, + /* + * Source: ECMA registry + */ + { 73, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_2033-1983", "iso-ir-98", "e13b", "csISO2033", NULL } + }, + /* + * Source: ECMA registry + */ + { 74, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ANSI_X3.110-1983", "iso-ir-99", "CSA_T500-1983", "NAPLPS", + "csISO99NAPLPS", NULL } + }, + /* + * Source: ECMA registry + */ + { 75, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "T.61-7bit", "iso-ir-102", "csISO102T617bit", NULL } + }, + /* + * Source: ECMA registry + */ + { 76, 20261, STRING_ENCODING_UNKNOWN, 0, + { "T.61-8bit", "T.61", "iso-ir-103", "csISO103T618bit", NULL } + }, + /* + * Source: ISO registry (formerly ECMA registry) + * http://www.itscj.ipsj.jp/ISO-IR/111.pdf + */ + { 77, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ECMA-cyrillic", "iso-ir-111", "KOI8-E", "csISO111ECMACyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 78, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "CSA_Z243.4-1985-1", "iso-ir-121", "ISO646-CA", "csa7-1", "ca", + "csISO121Canadian1", NULL } + }, + /* + * Source: ECMA registry + */ + { 79, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "CSA_Z243.4-1985-2", "iso-ir-122", "ISO646-CA2", "csa7-2", + "csISO122Canadian2", NULL } + }, + /* + * Source: ECMA registry + */ + { 80, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "CSA_Z243.4-1985-gr", "iso-ir-123", "csISO123CSAZ24341985gr", NULL } + }, + /* + * Source: RFC1556 + */ + { 81, WINUNDEF, STRING_ENCODING_UNKNOWN, 2, + { "ISO_8859-6-E", "csISO88596E", "ISO-8859-6-E", NULL } + }, + /* + * Source: RFC1556 + */ + { 82, WINUNDEF, STRING_ENCODING_UNKNOWN, 2, + { "ISO_8859-6-I", "csISO88596I", "ISO-8859-6-I", NULL } + }, + /* + * Source: ECMA registry + */ + { 83, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "T.101-G2", "iso-ir-128", "csISO128T101G2", NULL } + }, + /* + * Source: RFC1556 + */ + { 84, WINUNDEF, STRING_ENCODING_UNKNOWN, 2, + { "ISO_8859-8-E", "csISO88598E", "ISO-8859-8-E", NULL } + }, + /* + * Source: RFC1556 + */ + { 85, WINUNDEF, STRING_ENCODING_UNKNOWN, 2, + { "ISO_8859-8-I", "csISO88598I", "ISO-8859-8-I", NULL } + }, + /* + * Source: ECMA registry + */ + { 86, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "CSN_369103", "iso-ir-139", "csISO139CSN369103", NULL } + }, + /* + * Source: ECMA registry + */ + { 87, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JUS_I.B1.002", "iso-ir-141", "ISO646-YU", "js", "yu", + "csISO141JUSIB1002", NULL } + }, + /* + * Source: ECMA registry + */ + { 88, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IEC_P27-1", "iso-ir-143", "csISO143IECP271", NULL } + }, + /* + * Source: ECMA registry + */ + { 89, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JUS_I.B1.003-serb", "iso-ir-146", "serbian", "csISO146Serbian", NULL } + }, + /* + * Source: ECMA registry + */ + { 90, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JUS_I.B1.003-mac", "macedonian", "iso-ir-147", "csISO147Macedonian", + NULL } + }, + /* + * Source: ECMA registry + */ + { 91, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "greek-ccitt", "iso-ir-150", "csISO150", "csISO150GreekCCITT", NULL } + }, + /* + * Source: ECMA registry + */ + { 92, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "NC_NC00-10:81", "cuba", "iso-ir-151", "ISO646-CU", "csISO151Cuba", + NULL } + }, + /* + * Source: ECMA registry + */ + { 93, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_6937-2-25", "iso-ir-152", "csISO6937Add", NULL } + }, + /* + * Source: ECMA registry + */ + { 94, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "GOST_19768-74", "ST_SEV_358-88", "iso-ir-153", "csISO153GOST1976874", + NULL } + }, + /* + * Source: ECMA registry + */ + { 95, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_8859-supp", "iso-ir-154", "latin1-2-5", "csISO8859Supp", NULL } + }, + /* + * Source: ECMA registry + */ + { 96, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO_10367-box", "iso-ir-155", "csISO10367Box", NULL } + }, + /* + * Source: ECMA registry + */ + { 97, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "latin-lap", "lap", "iso-ir-158", "csISO158Lap", NULL } + }, + /* + * Source: ECMA registry + */ + { 98, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "JIS_X0212-1990", "x0212", "iso-ir-159", "csISO159JISX02121990", NULL } + }, + /* + * Source: Danish Standard, DS 2089, February 1974 + */ + { 99, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "DS_2089", "DS2089", "ISO646-DK", "dk", "csISO646Danish", NULL } + }, + { 100, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "us-dk", "csUSDK", NULL } + }, + { 101, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "dk-us", "csDKUS", NULL } + }, + { 102, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "KSC5636", "ISO646-KR", "csKSC5636", NULL } + }, + /* + * Source: RFC 1642 + */ + { 103, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "UNICODE-1-1-UTF-7", "csUnicode11UTF7", NULL } + }, + /* + * Source: RFC-1922 + */ + { 104, 50227, STRING_ENCODING_ISO_2022_CN, 0, + { "ISO-2022-CN", NULL } + }, + /* + * Source: RFC-1922 + */ + { 105, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-2022-CN-EXT", NULL } + }, + /* + * Source: RFC 3629 + */ + { 106, 65001, STRING_ENCODING_UTF8, 0, + { "UTF-8", NULL } + }, + /* + * Source: ISO See + * (http://www.iana.org/assignments/charset-reg/ISO-8859-13)[Tumasonis] + */ + { 109, 28603, STRING_ENCODING_ISO_8859_13, 0, + { "ISO-8859-13", NULL } + }, + /* + * Source: ISO See + * (http://www.iana.org/assignments/charset-reg/ISO-8859-14) [Simonsen] + */ + { 110, WINUNDEF, STRING_ENCODING_ISO_8859_14, 0, + { "ISO-8859-14", "iso-ir-199", "ISO_8859-14:1998", "ISO_8859-14", + "latin8", "iso-celtic", "l8", NULL } + }, + /* + * Source: ISO + * Please see: + */ + { 111, 28605, STRING_ENCODING_ISO_8859_15, 0, + { "ISO-8859-15", "ISO_8859-15", "Latin-9", NULL } + }, + /* + * Windows duplicate of ISO-8859-15 + * windows-874: ANSI/OEM Thai (same as 28605, ISO 8859-15) + */ + { 111, 874, STRING_ENCODING_ISO_8859_15, 0, + { "ISO-8859-15", "ISO_8859-15", "Latin-9", NULL } + }, + /* + * Source: ISO + */ + { 112, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-8859-16", "iso-ir-226", "ISO_8859-16:2001", "ISO_8859-16", + "latin10", "l10", NULL } + }, + /* + * Source: Chinese IT Standardization Technical Committee + * Please see: + */ + { 113, WINUNDEF, STRING_ENCODING_GBK, 0, + { "GBK", "CP936", "MS936", "windows-936", NULL } + }, + /* + * Source: Chinese IT Standardization Technical Committee + * Please see: + */ + { 114, 54936, STRING_ENCODING_GB_18030, 0, + { "GB18030", NULL } + }, + /* + * Source: Fujitsu-Siemens standard mainframe EBCDIC encoding + * Please see: + + */ + { 115, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "OSD_EBCDIC_DF04_15", NULL } + }, + /* + * Source: Fujitsu-Siemens standard mainframe EBCDIC encoding + * Please see: + * + */ + { 116, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "OSD_EBCDIC_DF03_IRV", NULL } + }, + /* + * Source: Fujitsu-Siemens standard mainframe EBCDIC encoding + * Please see: + * + */ + { 117, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "OSD_EBCDIC_DF04_1", NULL } + }, + /* + * Source: See + * [Thibault] + */ + { 118, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-11548-1", "ISO_11548-1", "ISO_TR_11548-1", "csISO115481", NULL } + }, + /* + * Source: See + * [Veremeev, Kikkarin] + */ + { 119, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "KZ-1048", "STRK1048-2002", "RK1048", "csKZ1048", NULL } + }, + /* + * Source: the 2-octet Basic Multilingual Plane, aka Unicode + * this needs to specify network byte order: the standard + * does not specify (it is a 16-bit integer space) + */ + { 1000, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-10646-UCS-2", "csUnicode", NULL } + }, + /* + * Source: the full code space. (same comment about byte order, + * these are 31-bit numbers. + */ + { 1001, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-10646-UCS-4", "csUCS4", NULL } + }, + /* + * Source: ASCII subset of Unicode. Basic Latin = collection 1 + * See ISO 10646, Appendix A + */ + { 1002, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-10646-UCS-Basic", "csUnicodeASCII", NULL } + }, + /* + * Source: ISO Latin-1 subset of Unicode. Basic Latin and Latin-1 + * Supplement = collections 1 and 2. See ISO 10646, + * Appendix A. See RFC 1815. + */ + { 1003, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-10646-Unicode-Latin1", "csUnicodeLatin1", "ISO-10646", NULL } + }, + /* + * Source: ISO 10646 Japanese, see RFC 1815. + */ + { MIBUNDEF, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-10646-J-1", NULL } + }, + /* + * Source: IBM Latin-2, -3, -5, Extended Presentation Set, GCSGID: 1261 + */ + { 1005, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-Unicode-IBM-1261", "csUnicodeIBM1261", NULL } + }, + /* + * Source: IBM Latin-4 Extended Presentation Set, GCSGID: 1268 + */ + { 1006, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-Unicode-IBM-1268", "csUnicodeIBM1268", NULL } + }, + /* + * Source: IBM Cyrillic Greek Extended Presentation Set, GCSGID: 1276 + */ + { 1007, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-Unicode-IBM-1276", "csUnicodeIBM1276", NULL } + }, + /* + * Source: IBM Arabic Presentation Set, GCSGID: 1264 + */ + { 1008, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-Unicode-IBM-1264", "csUnicodeIBM1264", NULL } + }, + /* + * Source: IBM Hebrew Presentation Set, GCSGID: 1265 + */ + { 1009, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-Unicode-IBM-1265", "csUnicodeIBM1265", NULL } + }, + /* + * Source: RFC 1641 + */ + { 1010, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "UNICODE-1-1", "csUnicode11", NULL } + }, + /* + * Source: SCSU See (http://www.iana.org/assignments/charset-reg/SCSU) + * [Scherer] + */ + { 1011, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "SCSU", NULL } + }, + /* + * Source: RFC 2152 + */ + { 1012, 65000, STRING_ENCODING_UNKNOWN, 0, + { "UTF-7", NULL } + }, + /* + * Source: RFC 2781 + */ + { 1013, 1201, STRING_ENCODING_UTF16_BE, 0, + { "UTF-16BE", NULL } + }, + /* + * Source: RFC 2781 + */ + { 1015, 1200, STRING_ENCODING_UTF16, 0, + { "UTF-16", NULL } + }, + /* + * Source: RFC 2781 + * + * UTF-16LE is after UTF16 so windows code page 1200 matches UTF16 first + */ + { 1014, 1200, STRING_ENCODING_UTF16_LE, 0, + { "UTF-16LE", NULL } + }, + /* + * Source: + */ + { 1016, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "CESU-8", "csCESU-8", NULL } + }, + /* + * Source: + */ + { 1017, 12000, STRING_ENCODING_UTF32, 0, + { "UTF-32", NULL } + }, + /* + * Source: + */ + { 1018, 12001, STRING_ENCODING_UTF32_BE, 0, + { "UTF-32BE", NULL } + }, + /* + * Source: + */ + { 1019, 12000, STRING_ENCODING_UTF32_LE, 0, + { "UTF-32LE", NULL } + }, + /* + * Source: http://www.unicode.org/notes/tn6/ + */ + { 1020, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "BOCU-1", "csBOCU-1", NULL } + }, + /* + * Source: Extended ISO 8859-1 Latin-1 for Windows 3.0. + * PCL Symbol Set id: 9U + */ + { 2000, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-8859-1-Windows-3.0-Latin-1", "csWindows30Latin1", NULL } + }, + /* + * Source: Extended ISO 8859-1 Latin-1 for Windows 3.1. + * PCL Symbol Set id: 19U + */ + { 2001, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-8859-1-Windows-3.1-Latin-1", "csWindows31Latin1", NULL } + }, + /* + * Source: Extended ISO 8859-2. Latin-2 for Windows 3.1. + * PCL Symbol Set id: 9E + */ + { 2002, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-8859-2-Windows-Latin-2", "csWindows31Latin2", NULL } + }, + /* + * Source: Extended ISO 8859-9. Latin-5 for Windows 3.1 + * PCL Symbol Set id: 5T + */ + { 2003, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "ISO-8859-9-Windows-Latin-5", "csWindows31Latin5", NULL } + }, + /* + * Source: LaserJet IIP Printer User's Manual, + * HP part no 33471-90901, Hewlet-Packard, June 1989. + */ + { 2004, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "hp-roman8", "roman8", "r8", "csHPRoman8", NULL } + }, + /* + * Source: PostScript Language Reference Manual + * PCL Symbol Set id: 10J + */ + { 2005, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Adobe-Standard-Encoding", "csAdobeStandardEncoding", NULL } + }, + /* + * Source: Ventura US. ASCII plus characters typically used in + * publishing, like pilcrow, copyright, registered, trade mark, + * section, dagger, and double dagger in the range A0 (hex) + * to FF (hex). + * PCL Symbol Set id: 14J + */ + { 2006, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Ventura-US", "csVenturaUS", NULL } + }, + /* + * Source: Ventura International. ASCII plus coded characters similar + * to Roman8. + * PCL Symbol Set id: 13J + */ + { 2007, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Ventura-International", "csVenturaInternational", NULL } + }, + /* + * Source: VAX/VMS User's Manual, + * Order Number: AI-Y517A-TE, April 1986. + */ + { 2008, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "DEC-MCS", "dec", "csDECMCS", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2009, 850, STRING_ENCODING_UNKNOWN, 0, + { "IBM850", "cp850", "850", "csPC850Multilingual", NULL } + }, + /* + * Source: PC Danish Norwegian + * 8-bit PC set for Danish Norwegian + * PCL Symbol Set id: 11U + */ + { 2012, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "PC8-Danish-Norwegian", "csPC8DanishNorwegian", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2013, 862, STRING_ENCODING_UNKNOWN, 0, + { "IBM862", "cp862", "862", "csPC862LatinHebrew", NULL } + }, + /* + * Source: PC Latin Turkish. PCL Symbol Set id: 9T + */ + { 2014, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "PC8-Turkish", "csPC8Turkish", NULL } + }, + /* + * Source: Presentation Set, CPGID: 259 + */ + { 2015, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM-Symbols", "csIBMSymbols", NULL } + }, + /* + * Source: Presentation Set, CPGID: 838 + */ + { 2016, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM-Thai", "csIBMThai", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 1U + */ + { 2017, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "HP-Legal", "csHPLegal", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 15U + */ + { 2018, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "HP-Pi-font", "csHPPiFont", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 8M + */ + { 2019, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "HP-Math8", "csHPMath8", NULL } + }, + /* + * Source: PostScript Language Reference Manual + * PCL Symbol Set id: 5M + */ + { 2020, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Adobe-Symbol-Encoding", "csHPPSMath", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 7J + */ + { 2021, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "HP-DeskTop", "csHPDesktop", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 6M + */ + { 2022, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Ventura-Math", "csVenturaMath", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 6J + */ + { 2023, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Microsoft-Publishing", "csMicrosoftPublishing", NULL } + }, + /* + * Source: Windows Japanese. A further extension of Shift_JIS + * to include NEC special characters (Row 13), NEC + * selection of IBM extensions (Rows 89 to 92), and IBM + * extensions (Rows 115 to 119). The CCS's are + * JIS X0201:1997, JIS X0208:1997, and these extensions. + * This charset can be used for the top-level media type "text", + * but it is of limited or specialized use (see RFC2278). + * PCL Symbol Set id: 19K + */ + { 2024, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Windows-31J", "csWindows31J", NULL } + }, + /* + * Source: Chinese for People's Republic of China (PRC) mixed one byte, + * two byte set: + * 20-7E = one byte ASCII + * A1-FE = two byte PRC Kanji + * See GB 2312-80 + * PCL Symbol Set Id: 18C + */ + { 2025, 936, STRING_ENCODING_GB_2312, 0, + { "GB2312", "csGB2312", NULL } + }, + /* + * Source: Chinese for Taiwan Multi-byte set. + * PCL Symbol Set Id: 18T + */ + { 2026, 950, STRING_ENCODING_BIG_5, 0, + { "Big5", "csBig5", NULL } + }, + /* + * Source: The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991 + */ + { 2027, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "macintosh", "mac", "csMacintosh", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2028, 37, STRING_ENCODING_UNKNOWN, 0, + { "IBM037", "cp037", "ebcdic-cp-us", "ebcdic-cp-ca", "ebcdic-cp-wt", + "ebcdic-cp-nl", "csIBM037", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2029, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM038", "EBCDIC-INT", "cp038", "csIBM038", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2030, 20273, STRING_ENCODING_UNKNOWN, 0, + { "IBM273", "CP273", "csIBM273", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2031, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM274", "EBCDIC-BE", "CP274", "csIBM274", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2032, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM275", "EBCDIC-BR", "cp275", "csIBM275", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2033, 20277, STRING_ENCODING_UNKNOWN, 0, + { "IBM277", "EBCDIC-CP-DK", "EBCDIC-CP-NO", "csIBM277", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2034, 20278, STRING_ENCODING_UNKNOWN, 0, + { "IBM278", "CP278", "ebcdic-cp-fi", "ebcdic-cp-se", "csIBM278", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2035, 20280, STRING_ENCODING_UNKNOWN, 0, + { "IBM280", "CP280", "ebcdic-cp-it", "csIBM280", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2036, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM281", "EBCDIC-JP-E", "cp281", "csIBM281", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2037, 20284, STRING_ENCODING_UNKNOWN, 0, + { "IBM284", "CP284", "ebcdic-cp-es", "csIBM284", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2038, 20285, STRING_ENCODING_UNKNOWN, 0, + { "IBM285", "CP285", "ebcdic-cp-gb", "csIBM285", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2039, 20290, STRING_ENCODING_UNKNOWN, 0, + { "IBM290", "cp290", "EBCDIC-JP-kana", "csIBM290", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2040, 20297, STRING_ENCODING_UNKNOWN, 0, + { "IBM297", "cp297", "ebcdic-cp-fr", "csIBM297", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990, + * IBM NLS RM p 11-11 + */ + { 2041, 20420, STRING_ENCODING_UNKNOWN, 0, + { "IBM420", "cp420", "ebcdic-cp-ar1", "csIBM420", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2042, 20423, STRING_ENCODING_UNKNOWN, 0, + { "IBM423", "cp423", "ebcdic-cp-gr", "csIBM423", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2043, 20424, STRING_ENCODING_UNKNOWN, 0, + { "IBM424", "cp424", "ebcdic-cp-he", "csIBM424", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2011, 437, STRING_ENCODING_UNKNOWN, 0, + { "IBM437", "cp437", "437", "csPC8CodePage437", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2044, 500, STRING_ENCODING_UNKNOWN, 0, + { "IBM500", "CP500", "ebcdic-cp-be", "ebcdic-cp-ch", "csIBM500", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2045, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM851", "cp851", "851", "csIBM851", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2010, 852, STRING_ENCODING_UNKNOWN, 0, + { "IBM852", "cp852", "852", "csPCp852", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2046, 855, STRING_ENCODING_UNKNOWN, 0, + { "IBM855", "cp855", "855", "csIBM855", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2047, 857, STRING_ENCODING_UNKNOWN, 0, + { "IBM857", "cp857", "857", "csIBM857", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2048, 860, STRING_ENCODING_UNKNOWN, 0, + { "IBM860", "cp860", "860", "csIBM860", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2049, 861, STRING_ENCODING_UNKNOWN, 0, + { "IBM861", "cp861", "861", "cp-is", "csIBM861", NULL } + }, + /* + * Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 + */ + { 2050, 863, STRING_ENCODING_UNKNOWN, 0, + { "IBM863", "cp863", "863", "csIBM863", NULL } + }, + /* + * Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 + */ + { 2051, 864, STRING_ENCODING_UNKNOWN, 0, + { "IBM864", "cp864", "csIBM864", NULL } + }, + /* + * Source: IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987) + */ + { 2052, 865, STRING_ENCODING_UNKNOWN, 0, + { "IBM865", "cp865", "865", "csIBM865", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2053, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM868", "CP868", "cp-ar", "csIBM868", NULL } + }, + /* + * Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 + */ + { 2054, 869, STRING_ENCODING_UNKNOWN, 0, + { "IBM869", "cp869", "869", "cp-gr", "csIBM869", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2055, 870, STRING_ENCODING_UNKNOWN, 0, + { "IBM870", "CP870", "ebcdic-cp-roece", "ebcdic-cp-yu", "csIBM870", + NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2056, 20871, STRING_ENCODING_UNKNOWN, 0, + { "IBM871", "CP871", "ebcdic-cp-is", "csIBM871", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2057, 20880, STRING_ENCODING_UNKNOWN, 0, + { "IBM880", "cp880", "EBCDIC-Cyrillic", "csIBM880", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2058, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM891", "cp891", "csIBM891", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2059, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM903", "cp903", "csIBM903", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2060, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM904", "cp904", "904", "csIBBM904", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2061, 20905, STRING_ENCODING_UNKNOWN, 0, + { "IBM905", "CP905", "ebcdic-cp-tr", "csIBM905", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2062, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "IBM918", "CP918", "ebcdic-cp-ar2", "csIBM918", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2063, 1026, STRING_ENCODING_UNKNOWN, 0, + { "IBM1026", "CP1026", "csIBM1026", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2064, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-AT-DE", "csIBMEBCDICATDE", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2065, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-AT-DE-A", "csEBCDICATDEA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2066, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-CA-FR", "csEBCDICCAFR", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2067, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-DK-NO", "csEBCDICDKNO", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2068, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-DK-NO-A", "csEBCDICDKNOA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2069, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-FI-SE", "csEBCDICFISE", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2070, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-FI-SE-A", "csEBCDICFISEA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2071, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-FR", "csEBCDICFR", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2072, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-IT", "csEBCDICIT", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2073, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-PT", "csEBCDICPT", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2074, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-ES", "csEBCDICES", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2075, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-ES-A", "csEBCDICESA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2076, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-ES-S", "csEBCDICESS", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2077, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-UK", "csEBCDICUK", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2078, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "EBCDIC-US", "csEBCDICUS", NULL } + }, + { 2079, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "UNKNOWN-8BIT", "csUnknown8BiT", NULL } + }, + /* + * Source: RFC 1345, also known as "mnemonic+ascii+38" + */ + { 2080, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "MNEMONIC", "csMnemonic", NULL } + }, + /* + * Source: RFC 1345, also known as "mnemonic+ascii+8200" + */ + { 2081, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "MNEM", "csMnem", NULL } + }, + /* + * Source: RFC 1456 + */ + { 2082, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "VISCII", "csVISCII", NULL } + }, + /* + * Source: RFC 1456 + */ + { 2083, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "VIQR", "csVIQR", NULL } + }, + /* + * Source: RFC 1489, based on GOST-19768-74, ISO-6937/8, + * INIS-Cyrillic, ISO-5427. + */ + { 2084, 20866, STRING_ENCODING_UNKNOWN, 0, + { "KOI8-R", "csKOI8R", NULL } + }, + /* + * Source: RFC 1842, RFC 1843 [RFC1842, RFC1843] + */ + { 2085, 52936, STRING_ENCODING_UNKNOWN, 0, + { "HZ-GB-2312", NULL } + }, + /* + * Source: IBM NLDG Volume 2 (SE09-8002-03) August 1994 + */ + { 2086, 866, STRING_ENCODING_UNKNOWN, 0, + { "IBM866", "cp866", "866", "csIBM866", NULL } + }, + /* + * Source: HP PCL 5 Comparison Guide (P/N 5021-0329) pp B-13, 1996 + */ + { 2087, 775, STRING_ENCODING_UNKNOWN, 0, + { "IBM775", "cp775", "csPC775Baltic", NULL } + }, + /* + * Source: RFC 2319 + */ + { 2088, 21866, STRING_ENCODING_UNKNOWN, 0, + { "KOI8-U", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00858) + * [Mahdi] + */ + { 2089, 858, STRING_ENCODING_UNKNOWN, 0, + { "IBM00858", "CCSID00858", "CP00858", "PC-Multilingual-850+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00924)i + [Mahdi] + */ + { 2090, 20924, STRING_ENCODING_UNKNOWN, 0, + { "IBM00924", "CCSID00924", "CP00924", "ebcdic-Latin9--euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01140) + * [Mahdi] + */ + { 2091, 1140, STRING_ENCODING_UNKNOWN, 0, + { "IBM01140", "CCSID01140", "CP01140", "ebcdic-us-37+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01141) + [Mahdi] + */ + { 2092, 1141, STRING_ENCODING_UNKNOWN, 0, + { "IBM01141", "CCSID01141", "CP01141", "ebcdic-de-273+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01142) + * [Mahdi] + */ + { 2093, 1142, STRING_ENCODING_UNKNOWN, 0, + { "IBM01142", "CCSID01142", "CP01142", "ebcdic-dk-277+euro", + "ebcdic-no-277+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01143) + * [Mahdi] + */ + { 2094, 1143, STRING_ENCODING_UNKNOWN, 0, + { "IBM01143", "CCSID01143", "CP01143", "ebcdic-fi-278+euro", + "ebcdic-se-278+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01144) + * [Mahdi] + */ + { 2095, 1144, STRING_ENCODING_UNKNOWN, 0, + { "IBM01144", "CCSID01144", "CP01144", "ebcdic-it-280+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01145) + * [Mahdi] + */ + { 2096, 1145, STRING_ENCODING_UNKNOWN, 0, + { "IBM01145", "CCSID01145", "CP01145", "ebcdic-es-284+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01146) + * [Mahdi] + */ + { 2097, 1146, STRING_ENCODING_UNKNOWN, 0, + { "IBM01146", "CCSID01146", "CP01146", "ebcdic-gb-285+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01147) + * [Mahdi] + */ + { 2098, 1147, STRING_ENCODING_UNKNOWN, 0, + { "IBM01147", "CCSID01147", "CP01147", "ebcdic-fr-297+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01148)i + * [Mahdi] + */ + { 2099, 1148, STRING_ENCODING_UNKNOWN, 0, + { "IBM01148", "CCSID01148", "CP01148", "ebcdic-international-500+euro", + NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01149)i + * [Mahdi] + */ + { 2100, 1149, STRING_ENCODING_UNKNOWN, 0, + { "IBM01149", "CCSID01149", "CP01149", "ebcdic-is-871+euro", NULL } + }, + /* + * Source: See (http://www.iana.org/assignments/charset-reg/Big5-HKSCS) + */ + { 2101, WINUNDEF, STRING_ENCODING_BIG_5_HK, 0, + { "Big5-HKSCS", NULL } + }, + /* + * Source: IBM1047 (EBCDIC Latin 1/Open Systems) + * http://www-1.ibm.com/servers/eserver/iseries/software/globalization/ + * pdf/cp01047z.pdf + */ + { 2102, 1047, STRING_ENCODING_UNKNOWN, 0, + { "IBM1047", "IBM-1047", NULL } + }, + /* + * Source: See (http://www.iana.org/assignments/charset-reg/PTCP154) + */ + { 2103, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "PTCP154", "csPTCP154", "PT154", "CP154", "Cyrillic-Asian", NULL } + }, + /* + * Source: See (http://www.amiga.ultranet.ru/Amiga-1251.html) + */ + { 2104, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "Amiga-1251", "Ami1251", "Amiga1251", "Ami-1251", NULL } + }, + /* + * Source: See + * Aliases: None + */ + { 2105, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "KOI7-switched", NULL } + }, + /* + * Source: See [Thibault] + */ + { 2106, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "BRF", "csBRF", NULL } + }, + /* + * Source: See [Kalyanasundaram] + */ + { 2107, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "TSCII", "csTSCII", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1250) [Lazhintseva] + */ + { 2250, 1250, STRING_ENCODING_WINDOWS_1250, 0, + { "windows-1250", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1251) [Lazhintseva] + */ + { 2251, 1251, STRING_ENCODING_WINDOWS_1251, 0, + { "windows-1251", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1252) [Wendt] + */ + { 2252, 1252, STRING_ENCODING_WINDOWS_1252, 0, + { "windows-1252", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1253) [Lazhintseva] + */ + { 2253, 1253, STRING_ENCODING_WINDOWS_1253, 0, + { "windows-1253", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1254) [Lazhintseva] + */ + { 2254, 1254, STRING_ENCODING_WINDOWS_1254, 0, + { "windows-1254", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1255) [Lazhintseva] + */ + { 2255, 1255, STRING_ENCODING_WINDOWS_1255, 0, + { "windows-1255", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1256) [Lazhintseva] + */ + { 2256, 1256, STRING_ENCODING_WINDOWS_1256, 0, + { "windows-1256", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1257) [Lazhintseva] + */ + { 2257, 1257, STRING_ENCODING_WINDOWS_1257, 0, + { "windows-1257", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1258) [Lazhintseva] + */ + { 2258, 1258, STRING_ENCODING_WINDOWS_1258, 0, + { "windows-1258", NULL } + }, + /* + * Source: Thai Industrial Standards Institute (TISI) [Tantsetthi] + */ + { 2259, WINUNDEF, STRING_ENCODING_UNKNOWN, 0, + { "TIS-620", NULL } + }, + /* + * Windows specific entries for which there is no corresponding iana mapping + */ + + /* + * Windows-709: Arabic (ASMO-449+, BCON V4) + */ + { MIBUNDEF, 709, STRING_ENCODING_UNKNOWN, 0, + { "Windows-709", "ASMO-449+", "BCON_V4", NULL } + }, + /* + * Windows-710: Arabic - Transparent Arabic + */ + { MIBUNDEF, 710, STRING_ENCODING_UNKNOWN, 0, + { "Windows-710", NULL } + }, + /* + * DOS-720: Arabic (Transparent ASMO); Arabic (DOS) + */ + { MIBUNDEF, 720, STRING_ENCODING_UNKNOWN, 0, + { "Windows-720", "DOS-720", "DOS_720", NULL } + }, + /* + * ibm737: OEM Greek (formerly 437G); Greek (DOS) + */ + { MIBUNDEF, 737, STRING_ENCODING_UNKNOWN, 0, + { "Windows-737", "IBM737", NULL } + }, + /* + * ibm775: OEM Baltic; Baltic (DOS) + */ + { MIBUNDEF, 775, STRING_ENCODING_UNKNOWN, 0, + { "Windows-775", "IBM775", NULL } + }, + /* + * cp875: IBM EBCDIC Greek Modern + */ + { MIBUNDEF, 875, STRING_ENCODING_UNKNOWN, 0, + { "Windows-875", "cp875", NULL } + }, + /* + * Johab: Korean (Johab) + */ + { MIBUNDEF, 1361, STRING_ENCODING_UNKNOWN, 0, + { "Windows-1361", "Johab", NULL } + }, + /* + * macintosh: MAC Roman; Western European (Mac) + * using the encoding names "mac" and "macintosh" + * is probably a bad idea here + */ + { MIBUNDEF, 10000, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10000", NULL } + }, + /* + * x-mac-japanese: Japanese (Mac) + */ + { MIBUNDEF, 10001, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10001", "x-mac-japanese", NULL } + }, + /* + * x-mac-chinesetrad: MAC Traditional Chinese (Big5); + * Chinese Traditional (Mac) + */ + { MIBUNDEF, 10002, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10002", "x-mac-chinesetrad", NULL } + }, + /* + * x-mac-korean: Korean (Mac) + */ + { MIBUNDEF, 10003, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10003", "x-mac-korean", NULL } + }, + /* + * x-mac-arabic: Arabic (Mac) + */ + { MIBUNDEF, 10004, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10004", "x-mac-arabic", NULL } + }, + /* + * x-mac-hebrew: Hebrew (Mac) + */ + { MIBUNDEF, 10005, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10005", "x-mac-hebrew", NULL } + }, + /* + * x-mac-greek: Greek (Mac) + */ + { MIBUNDEF, 10006, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10006", "x-mac-greek", NULL } + }, + /* + * x-mac-cyrillic: Cyrillic (Mac) + */ + { MIBUNDEF, 10007, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10007", "x-mac-cyrillic", NULL } + }, + /* + * x-mac-chinesesimp: MAC Simplified Chinese (GB 2312); + * Chinese Simplified (Mac) + */ + { MIBUNDEF, 10008, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10008", "x-mac-chinesesimp", NULL } + }, + /* + * x-mac-romanian: Romanian (Mac) + */ + { MIBUNDEF, 10010, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10010", "x-mac-romanian", NULL } + }, + /* + * x-mac-ukrainian: Ukrainian (Mac) + */ + { MIBUNDEF, 10017, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10017", "x-mac-ukrainian", NULL } + }, + /* + * x-mac-thai: Thai (Mac) + */ + { MIBUNDEF, 10021, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10021", "x-mac-thai", NULL } + }, + /* + * x-mac-ce: MAC Latin 2; Central European (Mac) + */ + { MIBUNDEF, 10029, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10029", "x-mac-ce", NULL } + }, + /* + * x-mac-icelandic: Icelandic (Mac) + */ + { MIBUNDEF, 10079, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10079", "x-mac-icelandic", NULL } + }, + /* + * x-mac-turkish: Turkish (Mac) + */ + { MIBUNDEF, 10081, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10081", "x-mac-turkish", NULL } + }, + /* + * x-mac-croatian: Croatian (Mac) + */ + { MIBUNDEF, 10082, STRING_ENCODING_UNKNOWN, 0, + { "Windows-10082", "x-mac-croatian", NULL } + }, + /* + * x-Chinese_CNS: CNS Taiwan; Chinese Traditional (CNS) + */ + { MIBUNDEF, 20000, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20000", "x-Chinese_CNS", NULL } + }, + /* + * x-cp20001: TCA Taiwan + */ + { MIBUNDEF, 20001, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20001", "x-cp20001", NULL } + }, + /* + * x_Chinese-Eten: Eten Taiwan; Chinese Traditional (Eten) + */ + { MIBUNDEF, 20002, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20002", "x_Chinese-Eten", NULL } + }, + /* + * x-cp20003: IBM5550 Taiwan + */ + { MIBUNDEF, 20003, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20003", "x-cp20003", NULL } + }, + /* + * x-cp20004: TeleText Taiwan + */ + { MIBUNDEF, 20004, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20004", "x-cp20004", NULL } + }, + /* + * x-cp20005: Wang Taiwan + */ + { MIBUNDEF, 20005, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20005", "x-cp20005", NULL } + }, + /* + * x-IA5: IA5 (IRV International Alphabet No. 5, 7-bit); + * Western European (IA5) + */ + { MIBUNDEF, 20105, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20105", "x-IA5", NULL } + }, + /* + * x-IA5-German: IA5 German (7-bit) + */ + { MIBUNDEF, 20106, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20106", "x-IA5-German", NULL } + }, + /* + * x-IA5-Swedish: IA5 Swedish (7-bit) + */ + { MIBUNDEF, 20107, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20107", "x-IA5-Swedish", NULL } + }, + /* + * x-IA5-Norwegian: IA5 Norwegian (7-bit) + */ + { MIBUNDEF, 20108, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20108", "x-IA5-Norwegian", NULL } + }, + /* + * x-cp20269: ISO 6937 Non-Spacing Accent + */ + { MIBUNDEF, 20269, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20269", "x-cp20269", NULL } + }, + /* + * x-EBCDIC-KoreanExtended: IBM EBCDIC Korean Extended + */ + { MIBUNDEF, 20833, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20833", "x-EBCDIC-KoreanExtended", NULL } + }, + /* + * IBM-Thai: IBM EBCDIC Thai + */ + { MIBUNDEF, 20838, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20838", "IBM-Thai", NULL } + }, + /* + * x-cp20949: Korean Wansung + */ + { MIBUNDEF, 20949, STRING_ENCODING_UNKNOWN, 0, + { "Windows-20949", "x-cp20949", NULL } + }, + /* + * cp1025: IBM EBCDIC Cyrillic Serbian-Bulgarian + */ + { MIBUNDEF, 21025, STRING_ENCODING_UNKNOWN, 0, + { "Windows-21025", "cp1025", NULL } + }, + /* + * Windows-21027: (deprecated) + */ + { MIBUNDEF, 21027, STRING_ENCODING_UNKNOWN, 0, + { "Windows-21027", NULL } + }, + /* + * x-Europa: Europa 3 + */ + { MIBUNDEF, 29001, STRING_ENCODING_UNKNOWN, 0, + { "Windows-29001", "x-Europa", NULL } + }, + /* + * iso-8859-8-i: ISO 8859-8 Hebrew; Hebrew (ISO-Logical) + */ + { MIBUNDEF, 38598, STRING_ENCODING_UNKNOWN, 0, + { "Windows-38598", "iso-8859-8-i", NULL } + }, + /* + * csISO2022JP: ISO 2022 Japanese with halfwidth Katakana; + * Japanese (JIS-Allow 1 byte Kana) + */ + { MIBUNDEF, 50221, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50221", "csISO2022JP", NULL } + }, + /* + * iso-2022-jp: ISO 2022 Japanese JIS X 0201-1989; + * Japanese (JIS-Allow 1 byte Kana - SO/SI) + */ + { MIBUNDEF, 50222, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50222", "iso-2022-jp", NULL } + }, + /* + * Windows-50229: ISO 2022 Traditional Chinese + */ + { MIBUNDEF, 50229, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50229", NULL } + }, + /* + * Windows-50930: EBCDIC Japanese (Katakana) Extended + */ + { MIBUNDEF, 50930, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50930", NULL } + }, + /* + * Windows-50931: EBCDIC US-Canada and Japanese + */ + { MIBUNDEF, 50931, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50931", NULL } + }, + /* + * Windows-50933: EBCDIC Korean Extended and Korean + */ + { MIBUNDEF, 50933, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50933", NULL } + }, + /* + * Windows-50935: EBCDIC Simplified Chinese Extended and Simplified Chinese + */ + { MIBUNDEF, 50935, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50935", NULL } + }, + /* + * Windows-50936: EBCDIC Simplified Chinese + */ + { MIBUNDEF, 50936, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50936", NULL } + }, + /* + * Windows-50937: EBCDIC US-Canada and Traditional Chinese + */ + { MIBUNDEF, 50937, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50937", NULL } + }, + /* + * Windows-50939: EBCDIC Japanese (Latin) Extended and Japanese + */ + { MIBUNDEF, 50939, STRING_ENCODING_UNKNOWN, 0, + { "Windows-50939", NULL } + }, + /* + * EUC-CN: EUC Simplified Chinese; Chinese Simplified (EUC) + */ + { MIBUNDEF, 51936, STRING_ENCODING_UNKNOWN, 0, + { "Windows-51936", "EUC-CN", NULL } + }, + /* + * Windows-51950: EUC Traditional Chinese + */ + { MIBUNDEF, 51950, STRING_ENCODING_UNKNOWN, 0, + { "Windows-51950", NULL } + }, + /* + * x-iscii-de: ISCII Devanagari + */ + { MIBUNDEF, 57002, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57002", "x-iscii-de", NULL } + }, + /* + * x-iscii-be: ISCII Bengali + */ + { MIBUNDEF, 57003, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57003", "x-iscii-be", NULL } + }, + /* + * x-iscii-ta: ISCII Tamil + */ + { MIBUNDEF, 57004, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57004", "x-iscii-ta", NULL } + }, + /* + * x-iscii-te: ISCII Telugu + */ + { MIBUNDEF, 57005, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57005", "x-iscii-te", NULL } + }, + /* + * x-iscii-as: ISCII Assamese + */ + { MIBUNDEF, 57006, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57006", "x-iscii-as", NULL } + }, + /* + * x-iscii-or: ISCII Oriya + */ + { MIBUNDEF, 57007, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57007", "x-iscii-or", NULL } + }, + /* + * x-iscii-ka: ISCII Kannada + */ + { MIBUNDEF, 57008, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57008", "x-iscii-ka", NULL } + }, + /* + * x-iscii-ma: ISCII Malayalam + */ + { MIBUNDEF, 57009, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57009", "x-iscii-ma", NULL } + }, + /* + * x-iscii-gu: ISCII Gujarati + */ + { MIBUNDEF, 57010, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57010", "x-iscii-gu", NULL } + }, + /* + * x-iscii-pa: ISCII Punjabi + */ + { MIBUNDEF, 57011, STRING_ENCODING_UNKNOWN, 0, + { "Windows-57011", "x-iscii-pa", NULL } + }, +}; + + /* * Table generated from selected encodings supported by ICU: * @@ -73,7 +2190,7 @@ static const char *SIMPLE_ENCODING_LIST[STRING_ENCODING_MAX_SPECIFIED] = { "ISO-8859-8", // STRING_ENCODING_ISO_8859_8 "ISO-8859-9", // STRING_ENCODING_ISO_8859_9 "ISO-8859-10", // STRING_ENCODING_ISO_8859_10 - "ISO-8859-11", // STRING_ENCODING_ISO_8859_11 + // ISO-8859-11 is unused // Oddly, there is no ISO-8859-12. "ISO-8859-13", // STRING_ENCODING_ISO_8859_13 "ISO-8859-14", // STRING_ENCODING_ISO_8859_14 @@ -161,6 +2278,120 @@ UnicodeNormalizeEncodingName(const char *encodingName) // IN } +/* + *----------------------------------------------------------------------------- + * + * UnicodeIANALookup -- + * + * Lookup an encoding name in the IANA cross reference table. + * + * Results: + * The index of the encoding within the table + * -1 if the encoding is not found + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static int +UnicodeIANALookup(const char *encodingName) // IN +{ + char *name; + char *candidate = NULL; + const char *p; + int i; + int j; + int acp; + + name = UnicodeNormalizeEncodingName(encodingName); + + /* + * check for Windows-xxxx encoding names generated from GetACP() + * code page numbers, see: CodeSet_GetCurrentCodeSet() + */ + if (!strncmp(encodingName, "windows", strlen("windows"))) { + p = encodingName + strlen("windows") + 1; + acp = 0; + while (*p && isdigit((int)*p)) { + acp *= 10; + acp += *p - '0'; + p++; + } + if (!*p) { + for (i = 0; i < ARRAYSIZE(xRef); i++) { + if (xRef[i].winACP == acp) { + goto done; + } + } + } + } + + for (i = 0; i < ARRAYSIZE(xRef); i++) { + for (j = 0; (p = xRef[i].names[j]) != NULL; j++) { + candidate = UnicodeNormalizeEncodingName(p); + if (!strcmp(name, candidate)) { + goto done; + } + free(candidate); + } + } + free(name); + + /* + * Did not find a matching name. Don't validate encoding names + * here, unrecognized encoding will be caught when converting + * from name to enum. + */ + Log("%s: Did not find an IANA match for encoding \"%s\"\n", + __FUNCTION__, encodingName); + return -1; + +done: + free(name); + free(candidate); + return i; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnicodeIANANameLookup -- + * + * Lookup an encoding name in the IANA cross reference table. + * + * Results: + * The IANA preferred Mime name for the encoding in NUL-terminated + * US-ASCII bytes or the argument if no match is found. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static const char * +UnicodeIANANameLookup(const char *encodingName) // IN +{ + int pref; + int idx; + + idx = UnicodeIANALookup(encodingName); + if (idx < 0) { + /* + * Did not find a matching name. Don't validate encoding names + * here, unrecognized encodings will be caught when converting + * from name to enum. + */ + return encodingName; + } + pref = xRef[idx].preferredMime; + return xRef[idx].names[pref]; +} + + /* *----------------------------------------------------------------------------- * @@ -193,15 +2424,10 @@ Unicode_EncodingEnumToName(StringEncoding encoding) // IN * the process-default encoding name. */ case STRING_ENCODING_DEFAULT: - /* - * XXX TODO: Need CodeSetGetCurrentCodeSet() from lib/misc/codeset.c, - * and need to extend with Win32 implementation. - */ - return "UTF-8"; + return UnicodeIANANameLookup(CodeSet_GetCurrentCodeSet()); break; default: - ASSERT(encoding >= STRING_ENCODING_FIRST); - ASSERT(encoding < STRING_ENCODING_MAX_SPECIFIED); + ASSERT(Unicode_IsEncodingSupported(encoding)); if ( encoding < STRING_ENCODING_FIRST || encoding >= STRING_ENCODING_MAX_SPECIFIED) { @@ -237,39 +2463,59 @@ Unicode_EncodingEnumToName(StringEncoding encoding) // IN StringEncoding Unicode_EncodingNameToEnum(const char *encodingName) // IN { - StringEncoding result = STRING_ENCODING_UNKNOWN; - char *normalizedEncodingName; - size_t encoding; + int idx; - normalizedEncodingName = UnicodeNormalizeEncodingName(encodingName); - - for (encoding = STRING_ENCODING_FIRST; - encoding < STRING_ENCODING_MAX_SPECIFIED; - encoding++) { - char *normalizedEncodingListEntry; - - ASSERT(SIMPLE_ENCODING_LIST[encoding]); + idx = UnicodeIANALookup(encodingName); + if (idx < 0) { + return STRING_ENCODING_UNKNOWN; + } + return xRef[idx].encoding; +} - /* - * TODO: We can optimize this by pulling this code out into - * a once-on-startup initialization, where we generate and - * cache the normalized encoding name list upon first use. - */ - normalizedEncodingListEntry = - UnicodeNormalizeEncodingName(SIMPLE_ENCODING_LIST[encoding]); - if (0 == strcmp(normalizedEncodingName, normalizedEncodingListEntry)) { - result = (StringEncoding)encoding; - } +/* + *----------------------------------------------------------------------------- + * + * Unicode_GetCurrentEncoding -- + * + * Calls CodeSet_GetCurrentCodeSet() and returns the corresponding + * encoding. + * + * Results: + * StringEncoding if we support it or STRING_ENCODING_UNKNOWN. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ - free(normalizedEncodingListEntry); +StringEncoding +Unicode_GetCurrentEncoding(void) // IN +{ + return Unicode_EncodingNameToEnum(CodeSet_GetCurrentCodeSet()); +} - if (result != STRING_ENCODING_UNKNOWN) { - break; - } - } - free(normalizedEncodingName); +/* + *----------------------------------------------------------------------------- + * + * Unicode_IsEncodingSupported -- + * + * Checks whether we support the given encoding. + * + * Results: + * TRUE if supported, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ - return result; +Bool +Unicode_IsEncodingSupported(StringEncoding encoding) // IN +{ + return encoding >= STRING_ENCODING_FIRST && + encoding < STRING_ENCODING_MAX_SPECIFIED; } diff --git a/open-vm-tools/lib/unicode/unicodeStatic.c b/open-vm-tools/lib/unicode/unicodeStatic.c index 67aa73781..76368df3f 100644 --- a/open-vm-tools/lib/unicode/unicodeStatic.c +++ b/open-vm-tools/lib/unicode/unicodeStatic.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/unityStub/Makefile.in b/open-vm-tools/lib/unityStub/Makefile.in index 19193b0dd..a7b6bd2da 100644 --- a/open-vm-tools/lib/unityStub/Makefile.in +++ b/open-vm-tools/lib/unityStub/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/unityStub/unityStub.c b/open-vm-tools/lib/unityStub/unityStub.c index e0903841e..b31e74f0a 100644 --- a/open-vm-tools/lib/unityStub/unityStub.c +++ b/open-vm-tools/lib/unityStub/unityStub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -59,6 +59,11 @@ Unity_IsSupported(void) return FALSE; } +void +Unity_SetActiveDnDDetWnd(int detWnd) +{ +} + void Unity_Exit(void) { diff --git a/open-vm-tools/lib/user/Makefile.in b/open-vm-tools/lib/user/Makefile.in index 0cb56aeb9..e19ce4d44 100644 --- a/open-vm-tools/lib/user/Makefile.in +++ b/open-vm-tools/lib/user/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -303,8 +303,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -316,8 +316,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -327,12 +327,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/user/hostinfo.c b/open-vm-tools/lib/user/hostinfo.c index 527576d68..886738055 100644 --- a/open-vm-tools/lib/user/hostinfo.c +++ b/open-vm-tools/lib/user/hostinfo.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/user/hostinfoPosix.c b/open-vm-tools/lib/user/hostinfoPosix.c index c0ee44996..809406b24 100644 --- a/open-vm-tools/lib/user/hostinfoPosix.c +++ b/open-vm-tools/lib/user/hostinfoPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -75,6 +75,7 @@ #include "str.h" #include "msg.h" #include "log.h" +#include "posix.h" #include "file.h" #include "backdoor_def.h" #include "util.h" @@ -83,6 +84,7 @@ #include "vm_atomic.h" #include "x86cpuid.h" #include "syncMutex.h" +#include "unicode.h" #ifdef VMX86_SERVER #include "uwvmkAPI.h" @@ -494,24 +496,24 @@ Hostinfo_SystemUpTime(void) *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_NameGet(void) { - char *result; + Unicode result; static Atomic_Ptr state; /* Implicitly initialized to NULL. --hpreg */ result = Atomic_ReadPtr(&state); if (UNLIKELY(result == NULL)) { - char *before; + Unicode before; - result = (char *) Hostinfo_HostName(); + result = Hostinfo_HostName(); before = Atomic_ReadIfEqualWritePtr(&state, NULL, result); if (before) { - free((void *) result); + Unicode_Free(result); result = before; } @@ -1262,6 +1264,18 @@ Hostinfo_ResetProcessState(const int *keepFds, // IN: uid_t euid; #endif + /* + * Disable itimers before resetting the signal handlers. + * Otherwise, the process may still receive timer signals: + * SIGALRM, SIGVTARLM, or SIGPROF. + */ + struct itimerval it; + it.it_value.tv_sec = it.it_value.tv_usec = 0; + it.it_interval.tv_sec = it.it_interval.tv_usec = 0; + setitimer(ITIMER_REAL, &it, NULL); + setitimer(ITIMER_VIRTUAL, &it, NULL); + setitimer(ITIMER_PROF, &it, NULL); + for (s = 1; s <= NSIG; s++) { sa.sa_handler = SIG_DFL; sigfillset(&sa.sa_mask); @@ -1419,22 +1433,32 @@ Hostinfo_OSIsSMP(void) *----------------------------------------------------------------------------- */ -char * -Hostinfo_GetModulePath(void) +Unicode +Hostinfo_GetModulePath(uint32 priv) { - char buf[FILE_MAXPATH]; + Unicode path; + #if defined(__APPLE__) - uint32_t bufSize = sizeof buf; + uint32_t pathSize = FILE_MAXPATH; +#else + Bool isSuper = FALSE; +#endif - if (_NSGetExecutablePath(buf, &bufSize)) { + if ((priv != HGMP_PRIVILEGE) && (priv != HGMP_NO_PRIVILEGE)) { + Warning("%s: invalid privilege parameter\n", __FUNCTION__); + return NULL; + } + +#if defined(__APPLE__) + path = Util_SafeMalloc(pathSize); + if (_NSGetExecutablePath(path, &pathSize)) { Warning(LGPFX" %s: _NSGetExecutablePath failed.\n", __FUNCTION__); + free(path); return NULL; } -#else - int retval; - Bool isSuper; -#ifdef VMX86_SERVER +#else +#if defined(VMX86_SERVER) if (HostType_OSIsPureVMK()) { return NULL; } @@ -1443,20 +1467,24 @@ Hostinfo_GetModulePath(void) // "/proc/self/exe" only exists on Linux 2.2+. ASSERT(Hostinfo_OSVersion(0) >= 2 && Hostinfo_OSVersion(1) >= 2); - /* Readlink does not NULL terminate the string. */ - memset(buf, 0, sizeof buf); - isSuper = IsSuperUser(); - SuperUser(TRUE); - retval = readlink("/proc/self/exe", buf, sizeof buf - 1); - SuperUser(isSuper); - if (retval < 0) { + if (priv == HGMP_PRIVILEGE) { + isSuper = IsSuperUser(); + SuperUser(TRUE); + } + + path = Posix_ReadLink(U("/proc/self/exe")); + + if (priv == HGMP_PRIVILEGE) { + SuperUser(isSuper); + } + + if (path == NULL) { Warning(LGPFX" %s: readlink failed: %s\n", __FUNCTION__, Err_ErrString()); - return NULL; } #endif - return strdup(buf); + return path; } @@ -1542,27 +1570,31 @@ Hostinfo_TouchBackDoor(void) *----------------------------------------------------------------------------- */ -char * +Unicode Hostinfo_GetUser() { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; - char const *name = NULL; + char *env = NULL; + Unicode name = NULL; if ((getpwuid_r(getuid(), &pw, buffer, sizeof buffer, &ppw) == 0) && (ppw != NULL)) { - name = pw.pw_name; + if (pw.pw_name) { + name = Unicode_Alloc(pw.pw_name, STRING_ENCODING_DEFAULT); + } } if (!name) { - name = getenv("USER"); + env = getenv("USER"); + if (env) { + name = Unicode_Alloc(env, STRING_ENCODING_DEFAULT); + } } - - return name ? strdup(name) : NULL; + return name; } - /* *----------------------------------------------------------------------------- * diff --git a/open-vm-tools/lib/user/util.c b/open-vm-tools/lib/user/util.c index 6f5b54efa..a4bb4ed55 100644 --- a/open-vm-tools/lib/user/util.c +++ b/open-vm-tools/lib/user/util.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -57,6 +57,7 @@ #include "util_shared.h" #include "escape.h" #include "base64.h" +#include "unicode.h" #ifndef O_BINARY #define O_BINARY 0 @@ -100,6 +101,12 @@ struct UtilBacktraceToBufferData { }; #endif /* UTIL_BACKTRACE_USE_UNWIND */ +#if !defined(_WIN32) && !defined(N_PLAT_NLM) +static Unicode GetHomeDirectory(ConstUnicode name); +static Unicode GetLoginName(int uid); +#endif +static Bool IsAlphaOrNum(char ch); + /* *---------------------------------------------------------------------- @@ -236,33 +243,6 @@ Util_Checksumv(void *iov, // IN } -/* - *---------------------------------------------------------------------- - * - * Util_ShortenPath -- - * - * Check the input path length agains the maxLength parameter. If - * the path is too long, prepend "..." and shorten it to the - * appropriate length. - * - *---------------------------------------------------------------------- - */ - -void -Util_ShortenPath(char *dst, // OUT - const char *src, // IN - int maxLength) // IN -{ - if (strlen(src) >= maxLength - 4) { - Str_Strcpy(dst, "...", maxLength); - Str_Strcat(dst, - src + strlen(src) - maxLength + 4, - maxLength); - } else { - Str_Strcpy(dst, src, maxLength); - } -} - /* *----------------------------------------------------------------------------- * @@ -618,34 +598,20 @@ Util_BacktraceWithFunc(int bugNr, Util_OutputFunc outFunc, void *outFuncData) *---------------------------------------------------------------------- */ -static char * -UtilDoTildeSubst(char *user) // IN - name of user +static Unicode +UtilDoTildeSubst(Unicode user) // IN - name of user { - char *dir; - char *str = NULL; + Unicode str = NULL; if (*user == '\0') { - dir = getenv("HOME"); - if (dir == NULL) { + str = Util_GetEnv(U("HOME")); + if (str == NULL) { Log("Could not expand environment variable HOME.\n"); - } else { - str = strdup(dir); - if (str == NULL) { - MSG_POST_NOMEM(); - } } } else { - struct passwd *pwPtr; - pwPtr = getpwnam(user); - if (pwPtr == NULL) { - endpwent(); - Log("Could not get information for user '%s'.\n",user); - } else { - str = strdup(pwPtr->pw_dir); - if (str == NULL) { - MSG_POST_NOMEM(); - } - endpwent(); + str = GetHomeDirectory(user); + if (str == NULL) { + Log("Could not get information for user '%s'.\n", user); } } return str; @@ -683,11 +649,11 @@ UtilDoTildeSubst(char *user) // IN - name of user #define UTIL_MAX_PATH_CHUNKS 100 -char * -Util_ExpandString(const char *fileName) +Unicode +Util_ExpandString(ConstUnicode fileName) // IN file path to expand { - char *copy = NULL; - char *result = NULL; + Unicode copy = NULL; + Unicode result = NULL; int nchunk = 0; char *chunks[UTIL_MAX_PATH_CHUNKS]; int chunkSize[UTIL_MAX_PATH_CHUNKS]; @@ -697,21 +663,23 @@ Util_ExpandString(const char *fileName) ASSERT(fileName); - copy = strdup(fileName); - if (copy == NULL) { - Msg_Append(MSGID(util.ExpandStringNoMemForCopy) - "Cannot allocate memory to expand \"%s\".\n", fileName); - goto out; - } + copy = Unicode_Duplicate(fileName); /* * quick exit */ - - if (fileName[0] != '~' && Str_Strchr(fileName, '$') == NULL) { + if (!Unicode_StartsWith(fileName, U("~")) && + Unicode_Find(fileName, U("$")) == UNICODE_INDEX_NOT_FOUND) { return copy; } + /* + * XXX Because the rest part of code depends pretty heavily from character + * pointer operations we want to leave it as-is and don't want to re-work + * it with using unicode library. However it's acceptable only until our + * Unicode type is utf-8 and until code below works correctly with utf-8. + */ + /* * Break string into nice chunks for separate expansion. * @@ -723,7 +691,7 @@ Util_ExpandString(const char *fileName) size_t len; if (*cp == '$') { char *p; - for (p = cp + 1; isalnum(*p & 0xFF) || *p == '_'; p++) { + for (p = cp + 1; IsAlphaOrNum(*p) || *p == '_'; p++) { } len = p - cp; #if !defined(_WIN32) @@ -736,7 +704,7 @@ Util_ExpandString(const char *fileName) if (nchunk >= UTIL_MAX_PATH_CHUNKS) { Msg_Append(MSGID(util.expandStringTooManyChunks) "Filename \"%s\" has too many chunks.\n", - fileName); + UTF8(fileName)); goto out; } chunks[nchunk] = cp; @@ -774,9 +742,11 @@ Util_ExpandString(const char *fileName) for (i = 0; i < nchunk; i++) { char save; - char *expand; + Unicode expand = NULL; char buf[100]; - +#if defined(_WIN32) + utf16_t bufW[100]; +#endif cp = chunks[i]; if (*cp != '$' || chunkSize[i] == 1) { @@ -797,26 +767,23 @@ Util_ExpandString(const char *fileName) * Others are just getenv(). */ - expand = getenv(cp + 1); + expand = Util_GetEnv(cp + 1); if (expand != NULL) { } else if (strcasecmp(cp + 1, "PID") == 0) { Str_Snprintf(buf, sizeof buf, "%"FMTPID, getpid()); - expand = buf; + expand = Util_SafeStrdup(buf); } else if (strcasecmp(cp + 1, "USER") == 0) { #if !defined(_WIN32) int uid = getuid(); - struct passwd *p = getpwuid(uid); - if (p != NULL) { - expand = p->pw_name; - } + expand = GetLoginName(uid); #else - int n = sizeof buf; - if (GetUserName(buf, &n)) { - expand = buf; + DWORD n = ARRAYSIZE(bufW); + if (GetUserNameW(bufW, &n)) { + expand = Unicode_AllocWithUTF16(bufW); } #endif - else { - expand = "unknown"; + if (expand == NULL) { + expand = Unicode_Duplicate(U("unknown")); } } else { Warning("Environment variable '%s' not defined in '%s'.\n", @@ -826,7 +793,7 @@ Util_ExpandString(const char *fileName) * Strip off the env variable string from the pathname. */ - expand = ""; + expand = Unicode_Duplicate(U("")); #else // _WIN32 @@ -844,7 +811,7 @@ Util_ExpandString(const char *fileName) */ Str_Strcpy(buf, cp, 100); - expand = buf; + expand = Unicode_AllocWithUTF8(buf); #endif } @@ -852,11 +819,11 @@ Util_ExpandString(const char *fileName) ASSERT(expand != NULL); ASSERT(!freeChunk[i]); - chunks[i] = strdup(expand); + chunks[i] = expand; if (chunks[i] == NULL) { Msg_Append(MSGID(util.ExpandStringNoMemForChunk) "Cannot allocate memory to expand \"%s\" in \"%s\".\n", - expand, fileName); + expand, UTF8(fileName)); goto out; } chunkSize[i] = strlen(expand); @@ -877,7 +844,7 @@ Util_ExpandString(const char *fileName) if (result == NULL) { Msg_Append(MSGID(util.expandStringNoMemForResult) "Cannot allocate memory for the expansion of \"%s\".\n", - fileName); + UTF8(fileName)); goto out; } cp = result; @@ -1440,12 +1407,6 @@ Util_DeriveFileName(const char *source, // IN: path to dict file (incl filename) return NULL; } File_GetPathName(source, &path, &base); - if (path == NULL || base == NULL) { - Warning("Util_DeriveFileName couldn't get path/base\n"); - free(path); - free(base); - goto end; - } /* If replacing name and extension */ if (name != NULL) { @@ -1513,7 +1474,6 @@ Util_DeriveFileName(const char *source, // IN: path to dict file (incl filename) } free(path); free(base); -end: return returnResult; } @@ -1647,5 +1607,140 @@ Util_SeparateStrings(char *source, // IN return stringVector; } - #endif /* !defined(N_PLAT_NLM) */ + + +/* + *----------------------------------------------------------------------------- + * + * Util_GetEnv -- + * + * Unicode wrapper for posix getenv call. + * + * Results: + * Returns value of an environment variable or NULL if it fails. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Unicode +Util_GetEnv(ConstUnicode name) // IN: environment variable name +{ + char *tmpname = NULL; + char *envnam = NULL; + + tmpname = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + + envnam = getenv(tmpname); + free(tmpname); + + if (!envnam) { + return NULL; + } + return Unicode_Alloc(envnam, STRING_ENCODING_DEFAULT); +} + + +#if !defined(_WIN32) && !defined(N_PLAT_NLM) + +/* + *----------------------------------------------------------------------------- + * + * GetHomeDirectory -- + * + * Unicode wrapper for posix getpwnam call for working directory. + * + * Results: + * Returns initial working directory or NULL if it fails. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Unicode +GetHomeDirectory(ConstUnicode name) // IN: user name +{ + char *tmpname = NULL; + struct passwd *pw; + Unicode ret = NULL; + + tmpname = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + + pw = getpwnam(tmpname); + free(tmpname); + + if (!pw || (pw && !pw->pw_dir)) { + endpwent(); + return NULL; + } + ret = Unicode_Alloc(pw->pw_dir, STRING_ENCODING_DEFAULT); + endpwent(); + return ret; +} + + +/* + *----------------------------------------------------------------------------- + * + * GetLoginName -- + * + * Unicode wrapper for posix getpwnam call for working directory. + * + * Results: + * Returns user's login name or NULL if it fails. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Unicode +GetLoginName(int uid) //IN: user id +{ + struct passwd *pw = NULL; + + pw = getpwuid(uid); + + if (!pw || (pw && !pw->pw_name)) { + return NULL; + } + return Unicode_Alloc(pw->pw_name, STRING_ENCODING_DEFAULT); +} + +#endif + + +/* + *----------------------------------------------------------------------------- + * + * IsAlphaOrNum -- + * + * Checks if character is a numeric digit or a letter of the + * english alphabet. + * + * Results: + * Returns TRUE if character is a digit or a letter, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +IsAlphaOrNum(char ch) //IN +{ + if ((ch >= '0' && ch <= '9') || + (ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z')) { + return TRUE; + } else { + return FALSE; + } +} diff --git a/open-vm-tools/lib/user/utilPosix.c b/open-vm-tools/lib/user/utilPosix.c index 3cb668de2..d085c1a55 100644 --- a/open-vm-tools/lib/user/utilPosix.c +++ b/open-vm-tools/lib/user/utilPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -382,15 +382,16 @@ UtilAcceptableSafeTmpDir(const char *dirname, // IN *----------------------------------------------------------------------------- */ -static char * +static Unicode UtilFindExistingSafeTmpDir(uid_t userId, // IN const char * userName, // IN const char * baseTmpDir) // IN { - DIR* dir; - char* pattern; - size_t patlen; - char* tmpDir = NULL; + int i; + int numFiles; + Unicode pattern; + Unicode tmpDir = NULL; + Unicode *fileList = NULL; /* * We always use the pattern PRODUCT-USER-xxxx when creating @@ -398,51 +399,36 @@ UtilFindExistingSafeTmpDir(uid_t userId, // IN * those names and the appropriate permissions. */ - pattern = Str_Asprintf(&patlen, "%s-%s-", - PRODUCT_GENERIC_NAME_LOWER, userName); - if (!pattern) { - Warning("%s: Out of memory error.\n", __FUNCTION__); - goto exit; + pattern = Unicode_Format("%s-%s-", PRODUCT_GENERIC_NAME_LOWER, userName); + if (pattern == NULL) { + return NULL; } - - dir = opendir(baseTmpDir); - - if (dir) { - struct dirent *direntry; - - /* - * If we get any errors during the directory iteration, we - * will just bail out and try to create a new temporary - * directory. - */ - while ((direntry = readdir(dir)) != NULL) { - - if ((direntry->d_type == DT_DIR) && - (strncmp(direntry->d_name, pattern, patlen) == 0)) { - - tmpDir = Str_Asprintf(NULL, "%s"DIRSEPS"%s", - baseTmpDir, - direntry->d_name); - - if (!tmpDir) { - Warning("%s: Out of memory error.\n", __FUNCTION__); - break; - } - - if (UtilAcceptableSafeTmpDir(tmpDir, userId)) { - break; - } - - free(tmpDir); - } - } - - closedir(dir); + + numFiles = File_ListDirectory(baseTmpDir, &fileList); + + if (numFiles == -1) { + Unicode_Free(pattern); + return NULL; } - - free(pattern); - exit: + for (i = 0; i < numFiles; i++) { + if (Unicode_StartsWith(fileList[i], pattern)) { + Unicode path = Unicode_Join(baseTmpDir, U(DIRSEPS), fileList[i], + NULL); + + if (File_IsDirectory(path) && + UtilAcceptableSafeTmpDir(path, userId)) { + tmpDir = path; + break; + } + + Unicode_Free(path); + } + } + + Unicode_FreeList(fileList, numFiles); + Unicode_Free(pattern); + return tmpDir; } diff --git a/open-vm-tools/lib/vixTools/Makefile.in b/open-vm-tools/lib/vixTools/Makefile.in index 544c00ef5..3b48d2210 100644 --- a/open-vm-tools/lib/vixTools/Makefile.in +++ b/open-vm-tools/lib/vixTools/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/vixTools/vixTools.c b/open-vm-tools/lib/vixTools/vixTools.c index 480fa7ee9..f8124f12a 100644 --- a/open-vm-tools/lib/vixTools/vixTools.c +++ b/open-vm-tools/lib/vixTools/vixTools.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,10 +29,6 @@ #include #include -#if !defined(__FreeBSD__) && !defined(sun) -#define IMPLEMENT_SOCKET_MGR 0 -#endif - #ifdef _WIN32 #include #include @@ -69,15 +65,14 @@ #include "hgfs.h" #include "system.h" #include "codeset.h" +#include "unicode.h" -#ifndef __FreeBSD__ +#if defined(linux) || defined(_WIN32) #include "netutil.h" #endif -/* Stub out impersonation functions for these platforms. */ -#if defined(__FreeBSD__) || defined(sun) || defined(N_PLAT_NLM) -Bool Impersonate_Undo(void) { return FALSE; } -#else +/* Only Windows and Linux use impersonation functions. */ +#if !defined(__FreeBSD__) && !defined(sun) #include "impersonate.h" #endif @@ -209,6 +204,17 @@ static HRESULT VixToolsEnableStaticOnPrimary(const char *ipAddr, const char *subnetMask); #endif +static VixError VixToolsImpersonateUserImplEx(char const *credentialTypeStr, + int credentialType, + char const *obfuscatedNamePassword, + void **userToken); + +#if defined(_WIN32) || defined(linux) +static char *ToolsDaemonGetCurrentUser(void); +#endif + +static Bool VixToolsPidRefersToThisProcess(ProcMgr_Pid pid); + /* *----------------------------------------------------------------------------- @@ -334,9 +340,18 @@ VixTools_RunProgram(VixCommandRequestHeader *requestMsg, // IN + runProgramRequest->programNameLength + 1; } - // runProgramRequest->runProgramOptions; - if (thisProcessRunsAsRoot) { +#ifdef _WIN32 + if (runProgramRequest->runProgramOptions & VIX_RUNPROGRAM_RUN_AS_LOCAL_SYSTEM) { + if (!VixToolsUserIsMemberOfAdministratorGroup(requestMsg)) { + err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + userToken = PROCESS_CREATOR_USER_TOKEN; + } +#endif + + if (NULL == userToken) { err = VixToolsImpersonateUser(requestMsg, &userToken); if (VIX_OK != err) { goto abort; @@ -397,10 +412,8 @@ VixToolsRunProgramImpl(char *requestName, // IN char *stopProgramFileName; Bool programExists; Bool programIsExecutable; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) - Bool forcedRoot = FALSE; -#endif #if defined(_WIN32) + Bool forcedRoot = FALSE; ProcMgr_ProcArgs procArgs; STARTUPINFO si; #endif @@ -484,13 +497,11 @@ VixToolsRunProgramImpl(char *requestName, // IN asyncState->requestName = Util_SafeStrdup(requestName); asyncState->runProgramOptions = runProgramOptions; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (PROCESS_CREATOR_USER_TOKEN != userToken) { forcedRoot = Impersonate_ForceRoot(); } -#endif -#if defined(_WIN32) memset(&procArgs, 0, sizeof procArgs); memset(&si, 0, sizeof si); procArgs.hToken = (PROCESS_CREATOR_USER_TOKEN == userToken) ? NULL : userToken; @@ -505,7 +516,7 @@ VixToolsRunProgramImpl(char *requestName, // IN asyncState->procState = ProcMgr_ExecAsync(fullCommandLine, NULL); #endif -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (forcedRoot) { Impersonate_UnforceRoot(); } @@ -1050,13 +1061,11 @@ VixToolsReadRegistry(VixCommandRequestHeader *requestMsg, // IN goto abort; } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (VIX_PROPERTYTYPE_INTEGER == registryRequest->expectedRegistryKeyType) { errResult = Registry_ReadInteger(registryPathName, &valueInt); @@ -1140,13 +1149,11 @@ VixToolsWriteRegistry(VixCommandRequestHeader *requestMsg) // IN } registryData = registryPathName + registryRequest->registryKeyLength + 1; - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (VIX_PROPERTYTYPE_INTEGER == registryRequest->expectedRegistryKeyType) { intValue = *((int *) registryData); @@ -1221,13 +1228,11 @@ VixToolsDeleteObject(VixCommandRequestHeader *requestMsg) // IN goto abort; } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /////////////////////////////////////////// if (VIX_COMMAND_DELETE_GUEST_FILE == requestMsg->opCode) { @@ -1347,13 +1352,11 @@ VixToolsObjectExists(VixCommandRequestHeader *requestMsg, // IN goto abort; } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /* * Do the action appropriate for this type of object. @@ -1430,13 +1433,11 @@ VixToolsOpenUrl(VixCommandRequestHeader *requestMsg) // IN openUrlRequest = (VixMsgOpenUrlRequest *) requestMsg; url = ((char *) openUrlRequest) + sizeof(*openUrlRequest); - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /* Actually open the URL. */ if (!GuestApp_OpenUrl(url, strcmp(windowState, "maximize") == 0)) { @@ -1485,13 +1486,11 @@ VixToolsCreateTempFile(VixCommandRequestHeader *requestMsg, // IN makeTempFileRequest = (VixMsgCreateTempFileRequest *) requestMsg; - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; err = VixToolsGetTempFile("vmware", userToken, &filePathName, &fd); if (VIX_FAILED(err)) { @@ -1552,13 +1551,11 @@ VixToolsReadVariable(VixCommandRequestHeader *requestMsg, // IN readRequest = (VixMsgReadVariableRequest *) requestMsg; valueName = ((char *) readRequest) + sizeof(*readRequest); - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; switch (readRequest->variableType) { case VIX_GUEST_ENVIRONMENT_VARIABLE: @@ -1622,16 +1619,16 @@ VixToolsWriteVariable(VixCommandRequestHeader *requestMsg) // IN int result; writeRequest = (VixMsgWriteVariableRequest *) requestMsg; - valueName = ((char *) writeRequest) + sizeof(*writeRequest); - value = valueName + writeRequest->nameLength + 1; + err = VixMsg_ParseWriteVariableRequest(writeRequest, &valueName, &value); + if (VIX_OK != err) { + goto abort; + } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; switch (writeRequest->variableType) { case VIX_GUEST_ENVIRONMENT_VARIABLE: @@ -1711,13 +1708,11 @@ VixToolsMoveFile(VixCommandRequestHeader *requestMsg) // IN goto abort; } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /* * Be careful. Renaming a file to itself can cause it to be deleted. @@ -1816,13 +1811,11 @@ VixToolsListProcesses(VixCommandRequestHeader *requestMsg, // IN destPtr = resultBuffer; *destPtr = 0; - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; procList = ProcMgr_ListProcesses(); if (NULL == procList) { @@ -1890,15 +1883,30 @@ VixToolsKillProcess(VixCommandRequestHeader *requestMsg) // IN void *userToken = NULL; VixCommandKillProcessRequest *killProcessRequest; - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; killProcessRequest = (VixCommandKillProcessRequest *) requestMsg; + + /* + * This is here for two reasons: + * 1) If you kill this process, then it cannot report back to + * you that the command succeeded. + * 2) On Linux, you can either always send a signal to youself, + * or it just compares the source and destination real, effective, + * and saved UIDs. Anyway, no matter who guestd is impersonating, + * this will succeed. However, normally a regular user cannot + * kill guestd, and should not be able to because of an implementation + * detail. + */ + if (VixToolsPidRefersToThisProcess(killProcessRequest->pid)) { + err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + if (!ProcMgr_KillByPid(killProcessRequest->pid)) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -1945,13 +1953,11 @@ VixToolsCreateDirectory(VixCommandRequestHeader *requestMsg) // IN goto abort; } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (File_Exists(dirPathName)) { err = VIX_E_FILE_ALREADY_EXISTS; @@ -2038,13 +2044,11 @@ VixToolsListDirectory(VixCommandRequestHeader *requestMsg, // IN goto abort; } - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (!(File_IsDirectory(dirPathName))) { err = VIX_E_NOT_A_DIRECTORY; @@ -2187,14 +2191,12 @@ VixToolsGetFileInfo(VixCommandRequestHeader *requestMsg, // IN err = VIX_E_INVALID_ARG; goto abort; } - - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (!(File_Exists(filePathName))) { err = VIX_E_FILE_NOT_FOUND; @@ -2303,13 +2305,11 @@ VixToolsCheckUserAccount(VixCommandRequestHeader *requestMsg) // IN Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; abort: if (impersonatingVMWareUser) { @@ -2359,12 +2359,10 @@ VixToolsRunScript(VixCommandRequestHeader *requestMsg, // IN Bool programIsExecutable; int64 pid = (int64) -1; static char resultBuffer[32]; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) - Bool forcedRoot = FALSE; -#endif VixMsgRunScriptRequest *scriptRequest; const char *interpreterFlags = ""; #if defined(_WIN32) + Bool forcedRoot = FALSE; ProcMgr_ProcArgs procArgs; #endif @@ -2373,13 +2371,12 @@ VixToolsRunScript(VixCommandRequestHeader *requestMsg, // IN propertiesString = interpreterName + scriptRequest->interpreterNameLength + 1; script = propertiesString + scriptRequest->propertiesLength + 1; - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; + if (0 == *interpreterName) { #ifdef _WIN32 @@ -2542,13 +2539,10 @@ if (0 == *interpreterName) { asyncState->requestName = Util_SafeStrdup(requestName); asyncState->runProgramOptions = scriptRequest->scriptOptions; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (PROCESS_CREATOR_USER_TOKEN != userToken) { forcedRoot = Impersonate_ForceRoot(); } -#endif - -#if defined(_WIN32) memset(&procArgs, 0, sizeof procArgs); procArgs.hToken = (PROCESS_CREATOR_USER_TOKEN == userToken) ? NULL : userToken; procArgs.bInheritHandles = TRUE; @@ -2557,7 +2551,7 @@ if (0 == *interpreterName) { asyncState->procState = ProcMgr_ExecAsync(fullCommandLine, NULL); #endif -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (forcedRoot) { Impersonate_UnforceRoot(); } @@ -2617,8 +2611,7 @@ abort: * VixToolsImpersonateUser -- * * Return value: - * TRUE on success - * FALSE on failure + * VixError * * Side effects: * None @@ -2631,7 +2624,6 @@ VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, // IN void **userToken) // OUT { VixError err = VIX_OK; - Bool success = FALSE; char *credentialField; VixCommandNamePassword *namePasswordStruct; @@ -2642,12 +2634,11 @@ VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, // IN namePasswordStruct = (VixCommandNamePassword *) credentialField; credentialField += sizeof(VixCommandNamePassword); - success = VixToolsImpersonateUserImpl(NULL, - requestMsg->userCredentialType, - credentialField, - userToken); - if (!success) { - err = VIX_E_GUEST_USER_PERMISSIONS; + err = VixToolsImpersonateUserImplEx(NULL, + requestMsg->userCredentialType, + credentialField, + userToken); + if (VIX_OK != err) { /* * Windows does not allow you to login with an empty password. Only * the console allows this login, which means the console does not @@ -2662,17 +2653,46 @@ VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, // IN err = VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST; } #endif - } // if (!success) + } return(err); } // VixToolsImpersonateUser - + /* *----------------------------------------------------------------------------- * * VixToolsImpersonateUserImpl -- * + * Little compatability wrapper for legacy Foundry Tools implementations. + * + * Return value: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN + int credentialType, // IN + char const *obfuscatedNamePassword, // IN + void **userToken) // OUT +{ + return(VIX_OK == VixToolsImpersonateUserImplEx(credentialTypeStr, + credentialType, + obfuscatedNamePassword, + userToken)); +} // VixToolsImpersonateUserImpl + + +/* + *----------------------------------------------------------------------------- + * + * VixToolsImpersonateUserImplEx -- * * On Windows: * To retrieve the security context of another user @@ -2685,8 +2705,7 @@ VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, // IN * Run RegEdt32 to load the registry hive of the impersonated user manually. * * Return value: - * TRUE on success - * FALSE on failure + * VIX_OK on success, or an appropriate error code on failure. * * Side effects: * None @@ -2694,13 +2713,13 @@ VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, // IN *----------------------------------------------------------------------------- */ -Bool -VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN - int credentialType, // IN - char const *obfuscatedNamePassword, // IN - void **userToken) // OUT +VixError +VixToolsImpersonateUserImplEx(char const *credentialTypeStr, // IN + int credentialType, // IN + char const *obfuscatedNamePassword, // IN + void **userToken) // OUT { - Bool success = FALSE; + VixError err = VIX_E_GUEST_USER_PERMISSIONS; if (NULL != userToken) { *userToken = NULL; @@ -2708,26 +2727,21 @@ VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN /////////////////////////////////////////////////////////////////////// #if defined(__FreeBSD__) || defined(sun) - success = FALSE; -/////////////////////////////////////////////////////////////////////// -#elif defined(WIN9XCOMPAT) - /* - * Win9x doesn't have real user model or an API for impersonation. - * If you can do anything, then you can do everything, so there's - * no reason to pretend otherwise. - */ - success = TRUE; + err = VIX_E_NOT_SUPPORTED; /////////////////////////////////////////////////////////////////////// #elif defined(_WIN32) || defined(linux) { + Bool success = FALSE; AuthToken authToken; - Bool singleStepSuccess; char *unobfuscatedUserName = NULL; char *unobfuscatedPassword = NULL; if (NULL != credentialTypeStr) { if (!StrUtil_StrToInt(&credentialType, credentialTypeStr)) { - success = FALSE; + /* + * This is an internal error, since the VMX supplies this string. + */ + err = VIX_E_FAIL; goto abort; } } @@ -2742,7 +2756,7 @@ VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN if (NULL != userToken) { *userToken = PROCESS_CREATOR_USER_TOKEN; } - success = TRUE; + err = VIX_OK; goto abort; } @@ -2756,10 +2770,83 @@ VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN if (NULL != userToken) { *userToken = PROCESS_CREATOR_USER_TOKEN; } - success = TRUE; + err = VIX_OK; goto abort; } + /* + * If the VMX asks us to run commands in the context of the current + * user, make sure that the user who requested the command is the + * same as the current user. + * Also, make sure that the password is valid. But we need not + * impersonate, since we are already running as that user. + */ + if (VIX_USER_CREDENTIAL_NAMED_INTERACTIVE_USER == credentialType) { + if (!thisProcessRunsAsRoot) { + Unicode currentUser; + int cmpResult; + + success = VixMsg_DeObfuscateNamePassword(obfuscatedNamePassword, + &unobfuscatedUserName, + &unobfuscatedPassword); + if (!success) { + err = VIX_E_FAIL; + goto abort; + } + + /* + * Check if this is a valid account on the guest. + */ + authToken = Auth_AuthenticateUser(unobfuscatedUserName, unobfuscatedPassword); + if (NULL == authToken) { + err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + + Auth_CloseToken(authToken); + + /* + * Make sure that the user who requested the command is the + * current user. + */ + currentUser = ToolsDaemonGetCurrentUser(); + if (NULL == currentUser) { + err = VIX_E_FAIL; + goto abort; + } + + /* + * Windows is case-insensitive about usernames, Linux is not. + */ +#ifdef _WIN32 + cmpResult = Str_Strcasecmp(unobfuscatedUserName, UTF8(currentUser)); +#else + cmpResult = strcmp(unobfuscatedUserName, UTF8(currentUser)); +#endif + Unicode_Free(currentUser); + + if (0 != cmpResult) { + err = VIX_E_INTERACTIVE_SESSION_USER_MISMATCH; + goto abort; + } + + if (NULL != userToken) { + *userToken = PROCESS_CREATOR_USER_TOKEN; + } + + err = VIX_OK; + goto abort; + } else { + /* + * This should only be sent to vmware-user, not guestd. + * Something is wrong. + */ + ASSERT(0); + err = VIX_E_FAIL; + goto abort; + } + } + /* * Other credential types, like guest, are all turned into a name/password * by the VMX. If this is something else, then we are talking to a newer @@ -2767,20 +2854,21 @@ VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN */ if ((VIX_USER_CREDENTIAL_NAME_PASSWORD != credentialType) && (VIX_USER_CREDENTIAL_NAME_PASSWORD_OBFUSCATED != credentialType)) { - success = FALSE; + err = VIX_E_NOT_SUPPORTED; goto abort; } - singleStepSuccess = VixMsg_DeObfuscateNamePassword(obfuscatedNamePassword, - &unobfuscatedUserName, - &unobfuscatedPassword); - if (!singleStepSuccess) { - success = FALSE; + success = VixMsg_DeObfuscateNamePassword(obfuscatedNamePassword, + &unobfuscatedUserName, + &unobfuscatedPassword); + if (!success) { + err = VIX_E_FAIL; goto abort; } authToken = Auth_AuthenticateUser(unobfuscatedUserName, unobfuscatedPassword); if (NULL == authToken) { + err = VIX_E_GUEST_USER_PERMISSIONS; goto abort; } if (NULL != userToken) { @@ -2796,6 +2884,12 @@ VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN */ success = ProcMgr_ImpersonateUserStart(unobfuscatedUserName, authToken); #endif + if (!success) { + err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + + err = VIX_OK; abort: free(unobfuscatedUserName); @@ -2803,11 +2897,11 @@ abort: } #else - success = FALSE; + err = VIX_E_NOT_SUPPORTED; #endif // else linux - return success; -} // VixToolsImpersonateUserImpl + return err; +} // VixToolsImpersonateUserImplEx /* @@ -2828,12 +2922,10 @@ void VixToolsUnimpersonateUser(void *userToken) { if (PROCESS_CREATOR_USER_TOKEN != userToken) { -#ifdef _WIN32 +#if defined(_WIN32) Impersonate_Undo(); -#else -#ifdef linux +#elif defined(linux) ProcMgr_ImpersonateUserStop(); -#endif #endif } } // VixToolsUnimpersonateUser @@ -2860,7 +2952,7 @@ VixToolsLogoutUser(void *userToken) // IN return; } -#if !defined(__FreeBSD__) && !defined(sun) && !defined(WIN9XCOMPAT) +#if !defined(__FreeBSD__) && !defined(sun) if (NULL != userToken) { AuthToken authToken = (AuthToken) userToken; Auth_CloseToken(authToken); @@ -3041,15 +3133,13 @@ VixToolsProcessHgfsPacket(VixCommandHgfsSendPacket *requestMsg, // IN err = VIX_E_FAIL; goto abort; } - - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser((VixCommandRequestHeader *) requestMsg, - &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + + err = VixToolsImpersonateUser((VixCommandRequestHeader *) requestMsg, + &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; hgfsPacket = ((char *) requestMsg) + sizeof(*requestMsg); hgfsPacketSize = requestMsg->hgfsPacketSize; @@ -3214,14 +3304,12 @@ VixToolsSetGuestNetworkingConfig(VixCommandRequestHeader *requestMsg) // IN ipAddr[0] = '\0'; subnetMask[0] = '\0'; - - if (thisProcessRunsAsRoot) { - err = VixToolsImpersonateUser(requestMsg, &userToken); - if (VIX_OK != err) { - goto abort; - } - impersonatingVMWareUser = TRUE; + + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; setGuestNetworkingConfigRequest = (VixMsgSetGuestNetworkingConfigRequest *)requestMsg; messageBody = (char *) requestMsg + sizeof(*setGuestNetworkingConfigRequest); @@ -3315,6 +3403,127 @@ abort: #endif +#if defined(_WIN32) || defined(linux) +/* + *----------------------------------------------------------------------------- + * + * ToolsDaemonGetCurrentUser -- + * + * Get the name of the user whom the process is running as. + * + * Return value: + * A unicode string containing the name of the current user, or NULL on + * failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Unicode +ToolsDaemonGetCurrentUser(void) +{ + Unicode currentUser = NULL; + +#ifdef _WIN32 + wchar_t *buffer = NULL; + DWORD bufferSize = 0; + + /* + * Call the function with a NULL buffer, fail for lack of space, + * use the returned size to allocate a buffer and call again. + * This uses GetUserNameA() to keep things simple and ASCII for now. + */ + if (!GetUserNameW(buffer, &bufferSize)) { + if (ERROR_INSUFFICIENT_BUFFER != GetLastError()) { + goto abort; + } + + buffer = Util_SafeMalloc(bufferSize * sizeof *buffer); + + if (!GetUserNameW(buffer, &bufferSize)) { + goto abort; + } + } + + currentUser = Unicode_AllocWithUTF16(buffer); + +#else /* Below is the POSIX case. */ + uid_t currentUid; + struct passwd pwd; + struct passwd *ppwd = &pwd; + char *buffer = NULL; // a pool of memory for getpwuid_r() to use. + size_t bufferSize; + + /* + * Get the maximum size buffer needed by getpwuid_r. + */ + bufferSize = (size_t) sysconf(_SC_GETPW_R_SIZE_MAX); + + buffer = Util_SafeMalloc(bufferSize); + + /* + * In the Windows version, GetUserNameW() returns the name of the + * user the thread is impersonating (if it is impersonating someone), + * so geteuid() seems to be the moral equivalent. + */ + currentUid = geteuid(); + + if (getpwuid_r(currentUid, &pwd, buffer, bufferSize, &ppwd) != 0 || + NULL == ppwd) { + Warning("Unable to get the username for uid %d.\n", currentUid); + goto abort; + } + + currentUser = Unicode_Alloc(pwd.pw_name, STRING_ENCODING_DEFAULT); +#endif + + abort: + + free(buffer); + + return currentUser; +} +#endif // #if defined(_WIN32) || defined(linux) + + +/* + *----------------------------------------------------------------------------- + * + * VixToolsPidRefersToThisProcess -- + * + * Determines if the given pid refers to the current process, in + * that if it passed to the appropriate OS-specific process killing + * function, will this process get killed. + * + * Return value: + * TRUE if killing pid kills us, FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +VixToolsPidRefersToThisProcess(ProcMgr_Pid pid) // IN +{ +#ifdef _WIN32 + return (GetCurrentProcessId() == pid); +#else + /* + * POSIX is complicated. Pid could refer to this process directly, + * be 0 which kills all processes in this process's group, be -1 + * which kill everything to which it can send a signal, or be -1 times + * the process group ID of this process. + */ + return ((getpid() == pid) || (0 == pid) || (-1 == pid) || + ((pid < -1) && (getpgrp() == (pid * -1)))); +#endif +} + + /* *----------------------------------------------------------------------------- * @@ -3535,40 +3744,6 @@ VixTools_ProcessVixCommand(VixCommandRequestHeader *requestMsg, // IN break; #endif -#if IMPLEMENT_SOCKET_MGR - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_CONNECT: - err = VixToolsSocketConnect(requestMsg, &resultValue); - // resultValue is static. Do not free it. - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_LISTEN: - err = VixToolsSocketListen(requestMsg, &resultValue); - // resultValue is static. Do not free it. - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_ACCEPT: - err = VixToolsSocketAccept(requestMsg, Util_SafeStrdup(requestName)); - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_RECEIVE: - err = VixToolsSocketRecv(requestMsg, Util_SafeStrdup(requestName)); - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_SEND: - err = VixToolsSocketSend(requestMsg, Util_SafeStrdup(requestName)); - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_CLOSE: - err = VixToolsSocketClose(requestMsg); - break; -#endif // IMPLEMENT_SOCKET_MGR - //////////////////////////////////// default: break; diff --git a/open-vm-tools/lib/vmBackupLib/Makefile.in b/open-vm-tools/lib/vmBackupLib/Makefile.in index 0104926a0..2374163df 100644 --- a/open-vm-tools/lib/vmBackupLib/Makefile.in +++ b/open-vm-tools/lib/vmBackupLib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -106,7 +106,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -118,7 +117,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -143,7 +142,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -152,6 +150,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -159,7 +159,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -302,8 +302,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -315,8 +315,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -326,12 +326,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/vmBackupLib/scriptOps.c b/open-vm-tools/lib/vmBackupLib/scriptOps.c index e9940f39a..69716a847 100644 --- a/open-vm-tools/lib/vmBackupLib/scriptOps.c +++ b/open-vm-tools/lib/vmBackupLib/scriptOps.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,24 +23,21 @@ */ #include "vmBackup.h" +#include "vmBackupInt.h" #include #include #include "vm_basic_defs.h" #include "debug.h" -#include "dynbuf.h" #include "file.h" #include "guestApp.h" #include "procMgr.h" -#include "syncDriver.h" #include "str.h" #include "util.h" +#include "codeset.h" -/* Totally arbitrary limit. */ -#define MAX_SCRIPTS 256 - typedef struct VmBackupScript { char *path; ProcMgr_AsyncProc *proc; @@ -49,9 +46,10 @@ typedef struct VmBackupScript { typedef struct VmBackupScriptOp { VmBackupOp callbacks; - VmBackupScript scripts[MAX_SCRIPTS]; - unsigned int current; Bool canceled; + Bool thawFailed; + VmBackupScriptType type; + VmBackupState *state; } VmBackupScriptOp; @@ -66,25 +64,107 @@ typedef struct VmBackupScriptOp { * A string with the requested path. * * Side effects: - * None. + * Allocates memory for the path. * *----------------------------------------------------------------------------- */ -static const char * +char * VmBackupGetScriptPath(void) { - static char scriptPath[FILE_MAXPATH] = { '\0' }; - - if (*scriptPath == '\0') { - const char *installPath; - installPath = GuestApp_GetInstallPath(); - Str_Strcat(scriptPath, installPath, sizeof scriptPath); - Str_Strcat(scriptPath, DIRSEPS, sizeof scriptPath); - Str_Strcat(scriptPath, "backupScripts.d", sizeof scriptPath); + char *scriptPath = NULL; + char *installPath = GuestApp_GetInstallPath(); + + if (installPath == NULL) { + return NULL; + } + + scriptPath = Str_Asprintf(NULL, "%s%s%s", installPath, DIRSEPS, "backupScripts.d"); + free(installPath); + + return scriptPath; +} + + +/* + *----------------------------------------------------------------------------- + * + * VmBackupRunNextScript -- + * + * Runs the next script for the given operation. If thawing (or running + * scripts after a failure), this function will try as much as possible + * to start a script, meaning that if it fails to start a script it will + * try to start the preceding one until one script is run, or it runs out + * of scripts to try. + * + * Results: + * -1: an error occurred. + * 0: no more scripts to run. + * 1: script was started. + * + * Side effects: + * Increments (or decrements) the "current script" index in the backup state. + * + *----------------------------------------------------------------------------- + */ + +static int +VmBackupRunNextScript(VmBackupScriptOp *op) // IN/OUT +{ + const char *scriptOp; + int ret = 0; + ssize_t index; + VmBackupScript *scripts = op->state->scripts; + + switch (op->type) { + case VMBACKUP_SCRIPT_FREEZE: + index = ++op->state->currentScript; + scriptOp = "freeze"; + break; + + case VMBACKUP_SCRIPT_FREEZE_FAIL: + index = --op->state->currentScript; + scriptOp = "freezeFail"; + break; + + case VMBACKUP_SCRIPT_THAW: + index = --op->state->currentScript; + scriptOp = "thaw"; + break; + + default: + NOT_REACHED(); + } + + while (index >= 0 && scripts[index].path != NULL) { + char *cmd; + + cmd = Str_Asprintf(NULL, "\"%s\" %s", scripts[index].path, scriptOp); + if (cmd == NULL) { + index = --op->state->currentScript; + op->thawFailed = TRUE; + } + + if ((scripts[index].proc = ProcMgr_ExecAsync(cmd, NULL)) == NULL) { + if (op->type == VMBACKUP_SCRIPT_FREEZE) { + ret = -1; + break; + } else { + index = --op->state->currentScript; + op->thawFailed = TRUE; + } + } else { + ret = 1; + break; + } } - return (*scriptPath != '\0') ? scriptPath : NULL; + /* This happens if all thaw/fail scripts failed to start. */ + if (index == -1 && scripts[0].proc == NULL) { + ret = -1; + } + + return ret; } @@ -93,10 +173,10 @@ VmBackupGetScriptPath(void) * * VmBackupStringCompare -- * - * Comparison function used to sort the script list. + * Comparison function used to sort the script list in ascending order. * * Result - * The result of strcmp() on the strings. + * The result of strcmp(str1, str2). * * Side effects: * None. @@ -135,12 +215,17 @@ VmBackupScriptOpQuery(VmBackupOp *_op) // IN { VmBackupOpStatus ret = VMBACKUP_STATUS_PENDING; VmBackupScriptOp *op = (VmBackupScriptOp *) _op; - VmBackupScript *currScript = &(op->scripts[op->current]); + VmBackupScript *scripts = op->state->scripts; + VmBackupScript *currScript = NULL; + + if (scripts != NULL) { + currScript = &scripts[op->state->currentScript]; + } if (op->canceled) { ret = VMBACKUP_STATUS_CANCELED; goto exit; - } else if (currScript->proc == NULL) { + } else if (scripts == NULL || currScript->proc == NULL) { ret = VMBACKUP_STATUS_FINISHED; goto exit; } @@ -148,30 +233,34 @@ VmBackupScriptOpQuery(VmBackupOp *_op) // IN if (!ProcMgr_IsAsyncProcRunning(currScript->proc)) { int exitCode; + /* + * If thaw scripts fail, keep running and only notify the failure after + * all others have run. + */ if (ProcMgr_GetExitCode(currScript->proc, &exitCode) != 0 || exitCode != 0) { - // XXX: log error. - ret = VMBACKUP_STATUS_ERROR; - goto exit; + if (op->type == VMBACKUP_SCRIPT_FREEZE) { + ret = VMBACKUP_STATUS_ERROR; + goto exit; + } else if (op->type == VMBACKUP_SCRIPT_THAW) { + op->thawFailed = TRUE; + } } ProcMgr_Free(currScript->proc); currScript->proc = NULL; - /* - * If there's another script to execute, start it. Otherwise, just - * say we're finished. - */ - if (op->current < MAX_SCRIPTS - 1 && op->scripts[op->current+1].path != NULL) { - op->current += 1; - currScript = &(op->scripts[op->current]); - currScript->proc = ProcMgr_ExecAsync(currScript->path, NULL); - if (currScript->proc == NULL) { - // XXX : log error - ret = VMBACKUP_STATUS_ERROR; - } - } else { - ret = VMBACKUP_STATUS_FINISHED; + switch (VmBackupRunNextScript(op)) { + case -1: + ret = VMBACKUP_STATUS_ERROR; + break; + + case 0: + ret = op->thawFailed ? VMBACKUP_STATUS_ERROR : VMBACKUP_STATUS_FINISHED; + break; + + default: + break; } } @@ -201,14 +290,20 @@ exit: static void VmBackupScriptOpRelease(VmBackupOp *_op) // IN { - int i; + size_t i; VmBackupScriptOp *op = (VmBackupScriptOp *) _op; - for (i = 0; i < MAX_SCRIPTS && op->scripts[i].path != NULL; i++) { - free(op->scripts[i].path); - if (op->scripts[i].proc != NULL) { - ProcMgr_Free(op->scripts[i].proc); + if (op->type != VMBACKUP_SCRIPT_FREEZE && op->state->scripts != NULL) { + VmBackupScript *scripts = op->state->scripts; + for (i = 0; scripts[i].path != NULL; i++) { + free(scripts[i].path); + if (scripts[i].proc != NULL) { + ProcMgr_Free(scripts[i].proc); + } } + free(op->state->scripts); + op->state->scripts = NULL; + op->state->currentScript = 0; } free(op); @@ -236,17 +331,21 @@ static void VmBackupScriptOpCancel(VmBackupOp *_op) // IN { VmBackupScriptOp *op = (VmBackupScriptOp *) _op; - VmBackupScript *currScript = &(op->scripts[op->current]); + VmBackupScript *scripts = op->state->scripts; + VmBackupScript *currScript = NULL; ProcMgr_Pid pid; - ASSERT(currScript->proc != NULL); + if (scripts != NULL) { + currScript = &scripts[op->state->currentScript]; + ASSERT(currScript->proc != NULL); - pid = ProcMgr_GetPid(currScript->proc); - if (!ProcMgr_KillByPid(pid)) { - // XXX: what to do in this situation? other than log and cry? - } else { - int exitCode; - ProcMgr_GetExitCode(currScript->proc, &exitCode); + pid = ProcMgr_GetPid(currScript->proc); + if (!ProcMgr_KillByPid(pid)) { + // XXX: what to do in this situation? other than log and cry? + } else { + int exitCode; + ProcMgr_GetExitCode(currScript->proc, &exitCode); + } } op->canceled = TRUE; @@ -259,9 +358,14 @@ VmBackupScriptOpCancel(VmBackupOp *_op) // IN * VmBackupNewScriptOp -- * * Creates a new state object to monitor the execution of OnFreeze or - * OnThaw scripts. This will identify all the scripts in the given + * OnThaw scripts. This will identify all the scripts in the backup scripts * directory and add them to an execution queue. * + * Note: there is some state created when instantianting the "OnFreeze" + * scripts which is only released after the "OnThaw" scripts are run. So + * the caller has to make sure that thaw (or fail) scripts are run every + * time the freeze scripts are run. + * * Result * A pointer to the operation state, or NULL on failure. * @@ -271,123 +375,106 @@ VmBackupScriptOpCancel(VmBackupOp *_op) // IN *----------------------------------------------------------------------------- */ -static VmBackupOp * -VmBackupNewScriptOp(const char *scriptDir, Bool freeze) // IN +VmBackupOp * +VmBackupNewScriptOp(VmBackupScriptType type, // IN + VmBackupState *state) // IN { + Bool fail = FALSE; + char **fileList = NULL; + char *scriptDir = NULL; + int numFiles = 0; + size_t i; VmBackupScriptOp *op = NULL; - op = Util_SafeMalloc(sizeof *op); - memset(op, 0, sizeof *op); + scriptDir = VmBackupGetScriptPath(); + if (scriptDir == NULL) { + goto exit; + } + + op = calloc(1, sizeof *op); + if (op == NULL) { + goto exit; + } + op->state = state; + op->type = type; op->callbacks.queryFn = VmBackupScriptOpQuery; op->callbacks.cancelFn = VmBackupScriptOpCancel; op->callbacks.releaseFn = VmBackupScriptOpRelease; Debug("Trying to run scripts from %s\n", scriptDir); - if (File_IsDirectory(scriptDir)) { - int i, cnt, numFiles; - char **fileList = NULL; - + /* + * Load the list of scripts to run when freezing. The same list will be + * used later in case of failure, or when thawing, in reverse order. + * + * This logic won't recurse into directories, so only files directly under + * the script dir will be considered. + */ + if (type == VMBACKUP_SCRIPT_FREEZE && File_IsDirectory(scriptDir)) { + size_t scriptCount = 0; + + state->scripts = NULL; + state->currentScript = 0; numFiles = File_ListDirectory(scriptDir, &fileList); - if (numFiles > 1) { - qsort(fileList, (size_t) numFiles, sizeof *fileList, VmBackupStringCompare); - } + if (numFiles > 0) { + VmBackupScript *scripts; - cnt = 0; - for (i = 0; i < numFiles && cnt < MAX_SCRIPTS; i++) { - /* Just run files in the scripts dir. Don't recurse into directories. */ - char script[FILE_MAXPATH + sizeof " freeze"]; - Str_Sprintf(script, sizeof script, "%s%c%s", - scriptDir, DIRSEPC, fileList[i]); - if (File_IsFile(script)) { - char *escaped; - - Debug("adding script for execution: %s\n", fileList[i]); - - escaped = Str_Asprintf(NULL, "\"%s\" %s", - script, (freeze) ? " freeze" : " thaw"); - ASSERT_MEM_ALLOC(escaped); - op->scripts[cnt++].path = escaped; - } else { - Debug("ignoring non-file entry: %s\n", fileList[i]); + scripts = calloc(1, (numFiles + 1) * sizeof *scripts); + if (scripts == NULL) { + fail = TRUE; + goto exit; } - free(fileList[i]); - } - free(fileList); - if (cnt >= MAX_SCRIPTS) { - Debug("Too many scripts to run, ignoring past %d.\n", MAX_SCRIPTS); - } + state->scripts = scripts; + /* + * VmBackupRunNextScript increments the index, so need to make it point + * to "before the first script". + */ + state->currentScript = -1; + + if (numFiles > 1) { + qsort(fileList, (size_t) numFiles, sizeof *fileList, VmBackupStringCompare); + } - /* Start the first script if there are scripts to be executed. */ - if (cnt > 0) { - op->scripts[0].proc = ProcMgr_ExecAsync(op->scripts[0].path, NULL); - if (op->scripts[0].proc == NULL) { - // XXX : log error - VmBackup_Release((VmBackupOp *) op); - op = NULL; + for (i = 0; i < numFiles; i++) { + char *script; + + script = Str_Asprintf(NULL, "%s%c%s", scriptDir, DIRSEPC, fileList[i]); + if (script == NULL) { + fail = TRUE; + goto exit; + } else if (File_IsFile(script)) { + scripts[scriptCount++].path = script; + } else { + free(script); + } } } - } else { - Debug("Cannot find script directory.\n"); } - return (VmBackupOp *) op; -} - - -/* - *----------------------------------------------------------------------------- - * - * VmBackupOnFreezeScripts -- - * - * Run the "on freeze" scripts available in the configuration directory. - * - * Result - * An object that can be used to track the progress of the operation, - * or NULL if an error happened. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -VmBackupOp * -VmBackupOnFreezeScripts(void) -{ - const char *scriptDir; - - scriptDir = VmBackupGetScriptPath(); - return (scriptDir != NULL) ? VmBackupNewScriptOp(scriptDir, TRUE) : NULL; -} - + /* + * If there are any scripts to be executed, start the first one. If we get to + * this point, we won't free the scripts array until VmBackupScriptOpRelease + * is called after thawing (or after the sync provider failed and the "fail" + * scripts are run). + */ + fail = (state->scripts != NULL && VmBackupRunNextScript(op) == -1); -/* - *----------------------------------------------------------------------------- - * - * VmBackupOnThawScripts -- - * - * Run the "on thaw" scripts available in the configuration directory. - * - * Result - * An object that can be used to track the progress of the operation. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -VmBackupOp * -VmBackupOnThawScripts(void) -{ - const char *scriptDir; +exit: + /* Free the file list. */ + for (i = 0; i < numFiles; i++) { + free(fileList[i]); + } + free(fileList); - scriptDir = VmBackupGetScriptPath(); - return (scriptDir != NULL) ? VmBackupNewScriptOp(scriptDir, FALSE) : NULL; + if (fail && op != NULL) { + VmBackup_Release((VmBackupOp *) op); + op = NULL; + } + free(scriptDir); + return (VmBackupOp *) op; } diff --git a/open-vm-tools/lib/vmBackupLib/stateMachine.c b/open-vm-tools/lib/vmBackupLib/stateMachine.c index 5706bed72..301521703 100644 --- a/open-vm-tools/lib/vmBackupLib/stateMachine.c +++ b/open-vm-tools/lib/vmBackupLib/stateMachine.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -36,8 +36,10 @@ */ #include "vmBackup.h" +#include "vmBackupInt.h" #include "vmbackup_def.h" +#include #include #include "vm_basic_defs.h" @@ -45,11 +47,17 @@ #include "debug.h" #include "eventManager.h" +#include "posix.h" +#include "file.h" +#include "fileIO.h" +#include "guestApp.h" #include "rpcin.h" #include "rpcout.h" #include "str.h" #include "strutil.h" +#include "unicode.h" #include "util.h" +#include "vmstdio.h" typedef enum { VMBACKUP_SUCCESS = 0, @@ -69,9 +77,6 @@ typedef enum { ASSERT_MEM_ALLOC(gBackupState->timerEvent); \ } -extern VmBackupOp *VmBackupOnFreezeScripts(void); -extern VmBackupOp *VmBackupOnThawScripts(void); - static DblLnkLst_Links *gEventQueue = NULL; static VmBackupState *gBackupState = NULL; static VmBackupSyncProvider *gSyncProvider = NULL; @@ -103,6 +108,103 @@ VmBackupKeepAliveCallback(void *clientData) // IN } +/* + *----------------------------------------------------------------------------- + * + * VmBackupReadConfig -- + * + * Reads the vmbackup config file. This file should contain the names of + * resources that will not be quiesced during the backup (for example, + * paths to be ignored by the sync driver or writers to be ignored by + * VSS). Each non-empty line not starting with a '#' character is + * considered an entry. + * + * The contents are stored in an array in the backup state structure. + * The data is expected to be in UTF-8 format. + * + * Note: currently, only the VSS subsystem uses this data. + * + * Results: + * TRUE on success, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +VmBackupReadConfig(VmBackupState *state) // OUT +{ + Bool ret = TRUE; + char *configDir; + char *cfgPath; + + ASSERT(state != NULL); + + configDir = GuestApp_GetConfPath(); + if (configDir == NULL) { + return FALSE; + } + + cfgPath = Str_Asprintf(NULL, "%s%c%s", configDir, DIRSEPC, "vmbackup.conf"); + free(configDir); + if (cfgPath == NULL) { + return FALSE; + } + + if (File_IsFile(cfgPath)) { + FILE *file; + StdIO_Status status; + + file = Posix_Fopen(cfgPath, "r"); + if (file == NULL) { + Debug("Can't open cfg file: %s\n", strerror(errno)); + ret = FALSE; + goto exit; + } + + while (TRUE) { + Bool skip = TRUE; + char *line; + char *c; + + status = StdIO_ReadNextLine(file, &line, 0, NULL); + if (status != StdIO_Success) { + break; + } + + /* Check if the line is empty or a comment. */ + for (c = line; *c != '\0'; c++) { + if (*c != ' ' && *c != '\t') { + skip = (*c == '#'); + break; + } + } + + if (!skip && !TargetArray_Push(&state->disabledTargets, line)) { + free(line); + break; + } + } + + ret = (ret && (status == StdIO_EOF)); + fclose(file); + } + +exit: + if (!ret) { + size_t i; + for (i = 0; i < TargetArray_Count(&state->disabledTargets); i++) { + free(*TargetArray_AddressOf(&state->disabledTargets, i)); + } + TargetArray_Destroy(&state->disabledTargets); + TargetArray_Init(&gBackupState->disabledTargets, 0); + } + return ret; +} + + /* *----------------------------------------------------------------------------- * @@ -169,6 +271,8 @@ VmBackupSendEvent(const char *event, // IN: event name static void VmBackupFinalize(void) { + size_t i; + ASSERT(gBackupState != NULL); Debug("*** %s\n", __FUNCTION__); @@ -187,6 +291,11 @@ VmBackupFinalize(void) EventManager_Remove(gBackupState->keepAlive); } + for (i = 0; i < TargetArray_Count(&gBackupState->disabledTargets); i++) { + free(*TargetArray_AddressOf(&gBackupState->disabledTargets, i)); + } + TargetArray_Destroy(&gBackupState->disabledTargets); + free(gBackupState->volumes); free(gBackupState); gBackupState = NULL; @@ -196,9 +305,9 @@ VmBackupFinalize(void) /* *----------------------------------------------------------------------------- * - * VmBackupThaw -- + * VmBackupStartScripts -- * - * Starts the execution of the "on thaw" scripts. + * Starts the execution of the scripts for the given action type. * * Result * TRUE, unless starting the scripts fails for some reason. @@ -210,16 +319,36 @@ VmBackupFinalize(void) */ static Bool -VmBackupThaw(void) +VmBackupStartScripts(VmBackupScriptType type, // IN + VmBackupCallback callback) // IN { + const char *opName; Debug("*** %s\n", __FUNCTION__); + + switch (type) { + case VMBACKUP_SCRIPT_FREEZE: + opName = "VmBackupOnFreeze"; + break; + + case VMBACKUP_SCRIPT_FREEZE_FAIL: + opName = "VmBackupOnFreezeFail"; + break; + + case VMBACKUP_SCRIPT_THAW: + opName = "VmBackupOnThaw"; + break; + + default: + NOT_REACHED(); + } + if (!VmBackup_SetCurrentOp(gBackupState, - VmBackupOnThawScripts(), - NULL, - __FUNCTION__)) { + VmBackupNewScriptOp(type, gBackupState), + callback, + opName)) { gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, VMBACKUP_SCRIPT_ERROR, - "Error when starting OnThaw scripts."); + "Error when starting backup scripts."); return FALSE; } @@ -273,18 +402,33 @@ VmBackupAsyncCallback(void *clientData) // IN default: { + Bool freeMsg = TRUE; char *errMsg = Str_Asprintf(NULL, "Asynchronous operation failed: %s\n", gBackupState->currentOpName); - ASSERT_MEM_ALLOC(errMsg); + if (errMsg == NULL) { + freeMsg = FALSE; + errMsg = "Asynchronous operation failed."; + } gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, VMBACKUP_UNEXPECTED_ERROR, errMsg); - free(errMsg); + if (freeMsg) { + free(errMsg); + } VmBackup_Release(gBackupState->currentOp); gBackupState->currentOp = NULL; - finalize = TRUE; + + /* + * If we get an error when running the freeze scripts, we want to + * schedule the "fail" scripts to run. + */ + if (!gBackupState->syncProviderRunning && + gBackupState->scripts != NULL) { + gBackupState->callback = NULL; + finalize = !VmBackupStartScripts(VMBACKUP_SCRIPT_FREEZE_FAIL, NULL); + } goto exit; } } @@ -329,9 +473,11 @@ VmBackupAsyncCallback(void *clientData) // IN gBackupState->callback == NULL) { gBackupState->syncProviderRunning = FALSE; gBackupState->pollPeriod = 100; - finalize = (gBackupState->syncProviderFailed || - gBackupState->clientAborted || - !VmBackupThaw()); + if (gBackupState->syncProviderFailed || gBackupState->clientAborted) { + finalize = !VmBackupStartScripts(VMBACKUP_SCRIPT_FREEZE_FAIL, NULL); + } else { + finalize = !VmBackupStartScripts(VMBACKUP_SCRIPT_THAW, NULL); + } goto exit; } @@ -418,9 +564,10 @@ VmBackupStart(char const **result, // OUT { Debug("*** %s\n", __FUNCTION__); if (gBackupState != NULL) { - gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, - VMBACKUP_INVALID_STATE, - "Another backup operation is in progress."); + return RpcIn_SetRetVals(result, + resultLen, + "Backup operation already in progress.", + FALSE); } gBackupState = Util_SafeMalloc(sizeof *gBackupState); @@ -428,6 +575,7 @@ VmBackupStart(char const **result, // OUT gBackupState->SendEvent = VmBackupSendEvent; gBackupState->pollPeriod = 100; + TargetArray_Init(&gBackupState->disabledTargets, 0); if (argsSize > 0) { int generateManifests = 0; @@ -442,18 +590,24 @@ VmBackupStart(char const **result, // OUT } } - gBackupState->SendEvent(VMBACKUP_EVENT_RESET, VMBACKUP_SUCCESS, ""); + if (!VmBackupReadConfig(gBackupState)) { + free(gBackupState); + gBackupState = NULL; + return RpcIn_SetRetVals(result, + resultLen, + "Error when reading configuration file.", + FALSE); + } - if (!VmBackup_SetCurrentOp(gBackupState, - VmBackupOnFreezeScripts(), - VmBackupEnableSync, - "VmBackupOnFreeze")) { + gBackupState->SendEvent(VMBACKUP_EVENT_RESET, VMBACKUP_SUCCESS, ""); - gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, - VMBACKUP_SCRIPT_ERROR, - "Error starting OnFreeze scripts."); - VmBackupFinalize(); - return FALSE; + if (!VmBackupStartScripts(VMBACKUP_SCRIPT_FREEZE, VmBackupEnableSync)) { + free(gBackupState); + gBackupState = NULL; + return RpcIn_SetRetVals(result, + resultLen, + "Error initializing backup.", + FALSE); } VMBACKUP_ENQUEUE_EVENT(); diff --git a/open-vm-tools/lib/vmBackupLib/syncDriverOps.c b/open-vm-tools/lib/vmBackupLib/syncDriverOps.c index ab0ebca60..b90875820 100644 --- a/open-vm-tools/lib/vmBackupLib/syncDriverOps.c +++ b/open-vm-tools/lib/vmBackupLib/syncDriverOps.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/vmBackupLib/vmBackupInt.h b/open-vm-tools/lib/vmBackupLib/vmBackupInt.h new file mode 100644 index 000000000..92e851d6f --- /dev/null +++ b/open-vm-tools/lib/vmBackupLib/vmBackupInt.h @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation version 2.1 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + *********************************************************/ + +/* + * vmBackupInt.h -- + * + * Internal definitions used by the vmbackup code. + */ + +#ifndef _VMBACKUPINT_H_ +#define _VMBACKUPINT_H_ + +typedef enum { + VMBACKUP_SCRIPT_FREEZE, + VMBACKUP_SCRIPT_FREEZE_FAIL, + VMBACKUP_SCRIPT_THAW +} VmBackupScriptType; + + +VmBackupOp * +VmBackupNewScriptOp(VmBackupScriptType freeze, + VmBackupState *state); + +#endif /* _VMBACKUPINT_H_*/ + diff --git a/open-vm-tools/lib/vmCheck/Makefile.in b/open-vm-tools/lib/vmCheck/Makefile.in index 7bcc7e92c..c9dd54c7b 100644 --- a/open-vm-tools/lib/vmCheck/Makefile.in +++ b/open-vm-tools/lib/vmCheck/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/vmCheck/vmcheck.c b/open-vm-tools/lib/vmCheck/vmcheck.c index 8144734c5..d35afa828 100644 --- a/open-vm-tools/lib/vmCheck/vmcheck.c +++ b/open-vm-tools/lib/vmCheck/vmcheck.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/vmSignal/Makefile.in b/open-vm-tools/lib/vmSignal/Makefile.in index 9b6d80971..76a2ff06a 100644 --- a/open-vm-tools/lib/vmSignal/Makefile.in +++ b/open-vm-tools/lib/vmSignal/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/vmSignal/vmsignal.c b/open-vm-tools/lib/vmSignal/vmsignal.c index d09293155..d5360c771 100644 --- a/open-vm-tools/lib/vmSignal/vmsignal.c +++ b/open-vm-tools/lib/vmSignal/vmsignal.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/lib/wiper/Makefile.in b/open-vm-tools/lib/wiper/Makefile.in index e41203f75..9b798d3aa 100644 --- a/open-vm-tools/lib/wiper/Makefile.in +++ b/open-vm-tools/lib/wiper/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -105,7 +105,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -117,7 +116,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,7 +141,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,6 +149,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -158,7 +158,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -299,8 +299,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -312,8 +312,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -323,12 +323,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/lib/wiper/wiperPosix.c b/open-vm-tools/lib/wiper/wiperPosix.c index 93f5d5022..296c38a31 100644 --- a/open-vm-tools/lib/wiper/wiperPosix.c +++ b/open-vm-tools/lib/wiper/wiperPosix.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/libguestlib/Makefile.in b/open-vm-tools/libguestlib/Makefile.in index b1892e7ba..045cfa5a7 100644 --- a/open-vm-tools/libguestlib/Makefile.in +++ b/open-vm-tools/libguestlib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -117,7 +117,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -129,7 +128,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -154,7 +153,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -163,6 +161,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -170,7 +170,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -279,8 +279,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done @@ -288,8 +288,8 @@ uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: @@ -345,8 +345,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -358,8 +358,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -369,12 +369,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/libguestlib/stubs.c b/open-vm-tools/libguestlib/stubs.c index f232afe29..0958505b1 100644 --- a/open-vm-tools/libguestlib/stubs.c +++ b/open-vm-tools/libguestlib/stubs.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/libguestlib/vmGuestLib.c b/open-vm-tools/libguestlib/vmGuestLib.c index a0a90a627..5edeca6fe 100644 --- a/open-vm-tools/libguestlib/vmGuestLib.c +++ b/open-vm-tools/libguestlib/vmGuestLib.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/libguestlib/vmGuestLibInt.h b/open-vm-tools/libguestlib/vmGuestLibInt.h index 409144ed0..f836ece17 100644 --- a/open-vm-tools/libguestlib/vmGuestLibInt.h +++ b/open-vm-tools/libguestlib/vmGuestLibInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/libguestlib/vmGuestLibPanic.c b/open-vm-tools/libguestlib/vmGuestLibPanic.c index 210d5d3b6..9c1533138 100644 --- a/open-vm-tools/libguestlib/vmGuestLibPanic.c +++ b/open-vm-tools/libguestlib/vmGuestLibPanic.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/libguestlib/vmguestlib_version.h b/open-vm-tools/libguestlib/vmguestlib_version.h index 500eddcfd..c050211e2 100644 --- a/open-vm-tools/libguestlib/vmguestlib_version.h +++ b/open-vm-tools/libguestlib/vmguestlib_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/modules/Makefile.am b/open-vm-tools/modules/Makefile.am old mode 100644 new mode 100755 diff --git a/open-vm-tools/modules/Makefile.in b/open-vm-tools/modules/Makefile.in index ae5d9078c..6ab1f6165 100644 --- a/open-vm-tools/modules/Makefile.in +++ b/open-vm-tools/modules/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -67,7 +67,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -79,7 +78,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -104,7 +103,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -113,6 +111,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -120,7 +120,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ diff --git a/open-vm-tools/modules/freebsd/vmblock/includeCheck.h b/open-vm-tools/modules/freebsd/vmblock/includeCheck.h new file mode 100644 index 000000000..e69de29bb diff --git a/open-vm-tools/modules/freebsd/vmblock/vm_assert.h b/open-vm-tools/modules/freebsd/vmblock/vm_assert.h index 00cbb5d8c..746796fac 100644 --- a/open-vm-tools/modules/freebsd/vmblock/vm_assert.h +++ b/open-vm-tools/modules/freebsd/vmblock/vm_assert.h @@ -110,8 +110,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/modules/freebsd/vmblock/vm_basic_defs.h b/open-vm-tools/modules/freebsd/vmblock/vm_basic_defs.h index df9ae0a58..d52f303c4 100644 --- a/open-vm-tools/modules/freebsd/vmblock/vm_basic_defs.h +++ b/open-vm-tools/modules/freebsd/vmblock/vm_basic_defs.h @@ -120,6 +120,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -555,14 +557,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/modules/freebsd/vmblock/vm_basic_types.h b/open-vm-tools/modules/freebsd/vmblock/vm_basic_types.h index 91fbf5f4d..d97550f43 100644 --- a/open-vm-tools/modules/freebsd/vmblock/vm_basic_types.h +++ b/open-vm-tools/modules/freebsd/vmblock/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -850,4 +850,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/freebsd/vmhgfs/backdoor_def.h b/open-vm-tools/modules/freebsd/vmhgfs/backdoor_def.h index 0f97efb18..da052ec2b 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/backdoor_def.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/backdoor_def.h @@ -110,7 +110,8 @@ #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 #define BDOOR_CMD_VASSERT 51 -#define BDOOR_CMD_MAX 52 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_MAX 53 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, diff --git a/open-vm-tools/modules/freebsd/vmhgfs/debug.c b/open-vm-tools/modules/freebsd/vmhgfs/debug.c index 0cd024885..2810ae013 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/debug.c +++ b/open-vm-tools/modules/freebsd/vmhgfs/debug.c @@ -52,18 +52,24 @@ HgfsDebugPrintVattr(const HGFS_VNODE_ATTR *vap) { DEBUG(VM_DEBUG_STRUCT, " va_type: %d\n", vap->va_type); DEBUG(VM_DEBUG_STRUCT, " va_mode: %o\n", vap->va_mode); - DEBUG(VM_DEBUG_STRUCT, " va_nlink: %hd\n", vap->va_nlink); DEBUG(VM_DEBUG_STRUCT, " va_uid: %u\n", vap->va_uid); DEBUG(VM_DEBUG_STRUCT, " va_gid: %u\n", vap->va_gid); DEBUG(VM_DEBUG_STRUCT, " va_fsid: %u\n", vap->va_fsid); - DEBUG(VM_DEBUG_STRUCT, " va_fileid: %ld\n", vap->va_fileid); - DEBUG(VM_DEBUG_STRUCT, " va_gen: %lu\n", vap->va_gen); - DEBUG(VM_DEBUG_STRUCT, " va_flags: %lx\n", vap->va_flags); DEBUG(VM_DEBUG_STRUCT, " va_rdev: %u\n", vap->va_rdev); DEBUG(VM_DEBUG_STRUCT, " va_filerev: %"FMT64"u\n", vap->va_filerev); DEBUG(VM_DEBUG_STRUCT, " va_vaflags: %x\n", vap->va_vaflags); #if defined(__FreeBSD__) + /* + * The next group of attributes have the same name but different sizes on + * xnu-1228 and FreeBSD 6.2. + */ + DEBUG(VM_DEBUG_STRUCT, " va_flags: %lx\n", vap->va_flags); + DEBUG(VM_DEBUG_STRUCT, " va_gen: %lu\n", vap->va_gen); + DEBUG(VM_DEBUG_STRUCT, " va_fileid: %ld\n", vap->va_fileid); + DEBUG(VM_DEBUG_STRUCT, " va_nlink: %hd\n", vap->va_nlink); + + /* These attributes names changed have between xnu-1228 and FreeBSD 6.2. */ DEBUG(VM_DEBUG_STRUCT, " va_size: %ju\n", vap->va_size); DEBUG(VM_DEBUG_STRUCT, " va_blocksize: %ld\n", vap->va_blocksize); /* @@ -83,9 +89,18 @@ HgfsDebugPrintVattr(const HGFS_VNODE_ATTR *vap) DEBUG(VM_DEBUG_STRUCT, " va_bytes: %"FMT64"u\n", vap->va_bytes); #elif defined(__APPLE__) + /* + * The next group of attributes have the same name but different sizes on + * xnu-1228 and FreeBSD 6.2. + */ + DEBUG(VM_DEBUG_STRUCT, " va_flags: %x\n", vap->va_flags); + DEBUG(VM_DEBUG_STRUCT, " va_gen: %u\n", vap->va_gen); + DEBUG(VM_DEBUG_STRUCT, " va_fileid: %"FMT64"u\n", vap->va_fileid); + DEBUG(VM_DEBUG_STRUCT, " va_nlink: %"FMT64"u\n", vap->va_nlink); + /* These attribute names have changed between xnu-1228 and FreeBSD 6.2. */ DEBUG(VM_DEBUG_STRUCT, " va_size: %ju\n", vap->va_data_size); - DEBUG(VM_DEBUG_STRUCT, " va_blocksize: %ld\n", vap->va_iosize); + DEBUG(VM_DEBUG_STRUCT, " va_iosize: %u\n", vap->va_iosize); /* * XXX time_t is __int32_t on 32-bit architectures and __int64_t on 64-bit * architectures. Would this be better as add'l formats in vm_basic_types.h? diff --git a/open-vm-tools/modules/freebsd/vmhgfs/fsutil.c b/open-vm-tools/modules/freebsd/vmhgfs/fsutil.c index 665aa40fe..c96cf51c3 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/fsutil.c +++ b/open-vm-tools/modules/freebsd/vmhgfs/fsutil.c @@ -722,7 +722,6 @@ HgfsAttrToBSD(struct vnode *vp, // IN: The vnode for this file VATTR_RETURN(vap, va_fileid, HGFS_VP_TO_NODEID(vp)); DEBUG(VM_DEBUG_ATTR, "*HgfsAttrToBSD: fileName %s\n", HGFS_VP_TO_FILENAME(vp)); - DEBUG(VM_DEBUG_ATTR, " Node ID: %ld\n", vap->va_fileid); /* * Some of the attribute names or meanings have changed slightly between @@ -732,6 +731,8 @@ HgfsAttrToBSD(struct vnode *vp, // IN: The vnode for this file DEBUG(VM_DEBUG_ATTR, " Setting size to %"FMT64"u\n", hgfsAttrV2->size); #if defined(__APPLE__) + DEBUG(VM_DEBUG_ATTR, " Node ID: %"FMT64"u\n", vap->va_fileid); + /* va_iosize is the Optimal I/O blocksize. */ VATTR_RETURN(vap, va_iosize, HGFS_BLOCKSIZE); VATTR_RETURN(vap, va_data_size, hgfsAttrV2->size); @@ -753,6 +754,8 @@ HgfsAttrToBSD(struct vnode *vp, // IN: The vnode for this file VATTR_SET_SUPPORTED(vap, va_create_time); #elif defined(__FreeBSD__) + DEBUG(VM_DEBUG_ATTR, " Node ID: %ld\n", vap->va_fileid); + VATTR_RETURN(vap, va_bytes, hgfsAttrV2->size); VATTR_RETURN(vap, va_size, hgfsAttrV2->size); VATTR_RETURN(vap, va_blocksize, HGFS_BLOCKSIZE); @@ -875,7 +878,7 @@ rindex(const char *ptr, // IN: String to search. ASSERT(ptr); - for (; *ptr != NULL; ptr++) { + for (; *ptr != '\0'; ptr++) { if (*ptr == chr) { result = (char *)ptr; } diff --git a/open-vm-tools/modules/freebsd/vmhgfs/hgfs.h b/open-vm-tools/modules/freebsd/vmhgfs/hgfs.h index a2a607c7b..02bbbf2a3 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/hgfs.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/hgfs.h @@ -175,41 +175,6 @@ typedef enum { #define HGFS_SYNC_REQREP_CLIENT_CMD HGFS_SYNC_REQREP_CMD " " #define HGFS_SYNC_REQREP_CLIENT_CMD_LEN (sizeof HGFS_SYNC_REQREP_CLIENT_CMD - 1) -/* - * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be - * asynchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and asynchronously returned from the - * guest. - * - * In short, an endpoint sending this command is sending a request whose reply - * should be returned asynchronously. - */ -#define HGFS_ASYNC_REQUEST_CMD "g" -#define HGFS_ASYNC_REQUEST_CLIENT_CMD HGFS_ASYNC_REQUEST_CMD " " -#define HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REQUEST_CLIENT_CMD - 1) - -/* - * An endpoint sending this command is sending an asynchronous HGFS reply to a - * request sent by the HGFS_ASYNC_REQUEST command. - */ -#define HGFS_ASYNC_REPLY_CMD "h" -#define HGFS_ASYNC_REPLY_CLIENT_CMD HGFS_ASYNC_REPLY_CMD " " -#define HGFS_ASYNC_REPLY_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REPLY_CLIENT_CMD - 1) - -/* - * Ensuring that all commands are the same length eases the implementation of - * HGFS client code. - */ -MY_ASSERTS(HGFS_CMD_LENGTHS, - ASSERT_ON_COMPILE(HGFS_SYNC_REQREP_CLIENT_CMD_LEN == - HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN); - ASSERT_ON_COMPILE(HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN == - HGFS_ASYNC_REPLY_CLIENT_CMD_LEN); -) - /* * This is just for the sake of macro naming. Since we are guaranteed * equal command lengths, defining command length via a generalized macro name diff --git a/open-vm-tools/modules/freebsd/vmhgfs/hgfsProto.h b/open-vm-tools/modules/freebsd/vmhgfs/hgfsProto.h index e8d8d729e..f27663838 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/hgfsProto.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/hgfsProto.h @@ -79,14 +79,39 @@ typedef enum { HGFS_OP_CREATE_SYMLINK, /* Create a symlink */ HGFS_OP_SERVER_LOCK_CHANGE, /* Change the oplock on a file */ HGFS_OP_CREATE_DIR_V2, /* Create a directory */ - HGFS_OP_DELETE_FILE_V2, /* Delete a file */ - HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ - HGFS_OP_RENAME_V2, /* Rename a file or directory */ + HGFS_OP_DELETE_FILE_V2, /* Delete a file */ + HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ + HGFS_OP_RENAME_V2, /* Rename a file or directory */ - HGFS_OP_MAX, /* Dummy op, must be last in enum */ + /* + * Operations for version 3. + */ + + HGFS_OP_OPEN_V3, /* Open file */ + HGFS_OP_READ_V3, /* Read from file */ + HGFS_OP_WRITE_V3, /* Write to file */ + HGFS_OP_CLOSE_V3, /* Close file */ + HGFS_OP_SEARCH_OPEN_V3, /* Start new search */ + HGFS_OP_SEARCH_READ_V3, /* Start new search */ + HGFS_OP_SEARCH_CLOSE_V3, /* End a search */ + HGFS_OP_GETATTR_V3, /* Get file attributes */ + HGFS_OP_SETATTR_V3, /* Set file attributes */ + HGFS_OP_CREATE_DIR_V3, /* Create new directory */ + HGFS_OP_DELETE_FILE_V3, /* Delete a file */ + HGFS_OP_DELETE_DIR_V3, /* Delete a directory */ + HGFS_OP_RENAME_V3, /* Rename a file or directory */ + HGFS_OP_QUERY_VOLUME_INFO_V3, /* Query volume information */ + HGFS_OP_CREATE_SYMLINK_V3, /* Create a symlink */ + HGFS_OP_SERVER_LOCK_CHANGE_V3, /* Change the oplock on a file */ + + HGFS_OP_MAX, /* Dummy op, must be last in enum */ } HgfsOp; +/* HGFS protocol versions. */ +#define HGFS_VERSION_OLD (1 << 0) +#define HGFS_VERSION_3 (1 << 1) + /* * File types, used in HgfsAttr. We support regular files, * directories, and symlinks. @@ -411,7 +436,7 @@ HgfsAttrV2; * Precomposed (normal form C) versus Decomposed (normal form D) * ------------------------------------------------------------- * Certain Unicode characters can be encoded in more than one way. - * For example, an Á (A acute) can be encoded either precomposed, + * For example, an (A acute) can be encoded either precomposed, * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, * as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). * Precomposed characters are more common in the Windows world, @@ -430,6 +455,33 @@ struct HgfsFileName { HgfsFileName; +/* + * HgfsFileNameV3 - new header to incorporate case-sensitivity flags along with + * Hgfs file handle. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsFileNameV3 { + uint32 length; /* Does NOT include terminating NUL */ + uint32 flags; /* Flags describe below. */ + HgfsHandle fid; + char name[1]; +} +#include "vmware_pack_end.h" +HgfsFileNameV3; + + +/* + * HgfsFileNameV3 flags. Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ +#define HGFS_FILE_NAME_USE_FILE_DESC (1 << 0) /* Other flags ignored if set. */ +#define HGFS_FILE_NAME_CASE_SENSITIVE (1 << 1) +#define HGFS_FILE_NAME_CASE_INSENSITIVE (1 << 2) +#define HGFS_FILE_NAME_DEFAULT_CASE (1 << 3) /* Default host case. */ + + /* * Request/reply structs. These are the first members of all * operation request and reply messages, respectively. @@ -500,6 +552,31 @@ struct HgfsRequestOpenV2 { HgfsRequestOpenV2; +/* Version 3 of HgfsRequestOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestOpenV3 { + HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ + HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ + HgfsOpenFlags flags; /* Which flags to open the file with */ + HgfsPermissions specialPerms; /* Desired 'special' permissions for file creation */ + HgfsPermissions ownerPerms; /* Desired 'owner' permissions for file creation */ + HgfsPermissions groupPerms; /* Desired 'group' permissions for file creation */ + HgfsPermissions otherPerms; /* Desired 'other' permissions for file creation */ + HgfsAttrFlags attr; /* Attributes, if any, for file creation */ + uint64 allocationSize; /* How much space to pre-allocate during creation */ + uint32 desiredAccess; /* Extended support for windows access modes */ + uint32 shareAccess; /* Windows only, share access modes */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + uint64 reserved1; /* Reserved for future use */ + uint64 reserved2; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV3; + + /* Deprecated */ typedef @@ -525,6 +602,21 @@ struct HgfsReplyOpenV2 { HgfsReplyOpenV2; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyOpenV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestRead { @@ -536,6 +628,7 @@ struct HgfsRequestRead { #include "vmware_pack_end.h" HgfsRequestRead; +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -548,6 +641,32 @@ struct HgfsReplyRead { HgfsReplyRead; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestReadV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestReadV3; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyReadV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsReplyReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestWrite { @@ -562,6 +681,8 @@ struct HgfsRequestWrite { HgfsRequestWrite; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyWrite { @@ -571,6 +692,31 @@ struct HgfsReplyWrite { #include "vmware_pack_end.h" HgfsReplyWrite; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestWriteV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsRequestWriteV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyWriteV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyWriteV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -582,6 +728,8 @@ struct HgfsRequestClose { HgfsRequestClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyClose { @@ -591,6 +739,27 @@ struct HgfsReplyClose { HgfsReplyClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCloseV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyCloseV3 { + uint64 reserved; +} +#include "vmware_pack_end.h" +HgfsReplyCloseV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestSearchOpen { @@ -601,6 +770,18 @@ struct HgfsRequestSearchOpen { HgfsRequestSearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchOpenV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 dirName; +} +#include "vmware_pack_end.h" +HgfsRequestSearchOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchOpen { @@ -611,6 +792,16 @@ struct HgfsReplySearchOpen { HgfsReplySearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchOpenV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchOpenV3; + + /* Deprecated */ typedef @@ -636,6 +827,17 @@ struct HgfsRequestSearchReadV2 { #include "vmware_pack_end.h" HgfsRequestSearchReadV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchReadV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint32 offset; /* The first result is offset 0 */ + uint32 flags; /* Reserved for reading multiple directory entries. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchReadV3; + /* Deprecated */ @@ -655,21 +857,48 @@ HgfsReplySearchRead; typedef #include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { - HgfsReply header; +struct HgfsReplySearchReadV2 { + HgfsReply header; HgfsAttrV2 attr; - + /* * fileName.length = 0 means "no entry at this offset" * If the file is a symlink (as specified in attr) * this name is the name of the symlink, not the target. - */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" + */ + HgfsFileName fileName; +} +#include "vmware_pack_end.h" HgfsReplySearchReadV2; +/* Directory entry structure. */ + +typedef struct HgfsDirEntry { + uint32 nextEntry; + HgfsAttrV2 attr; + + /* + * fileName.length = 0 means "no entry at this offset" + * If the file is a symlink (as specified in attr) + * this name is the name of the symlink, not the target. + */ + HgfsFileNameV3 fileName; +} HgfsDirEntry; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchReadV3 { + uint64 count; /* Number of directory entries. */ + uint64 reserved; /* Reserved for future use. */ + char payload[1]; /* Directory entries. */ +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestSearchClose { @@ -680,6 +909,8 @@ struct HgfsRequestSearchClose { HgfsRequestSearchClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchClose { @@ -689,6 +920,25 @@ struct HgfsReplySearchClose { HgfsReplySearchClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchCloseV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchCloseV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchCloseV3; + + /* Deprecated */ typedef @@ -715,6 +965,18 @@ struct HgfsRequestGetattrV2 { HgfsRequestGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestGetattrV3 { + HgfsAttrHint hints; /* Flags for file handle valid. */ + HgfsHandle file; /* Opaque file ID used by the server. */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestGetattrV3; + + /* Deprecated */ typedef @@ -748,6 +1010,25 @@ struct HgfsReplyGetattrV2 { HgfsReplyGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyGetattrV3 { + HgfsAttrV2 attr; + + /* + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should + * be ignored. + * + * This filename is in "CPNameLite" format. See CPNameLite.c for details. + */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkTarget; +} +#include "vmware_pack_end.h" +HgfsReplyGetattrV3; + + /* Deprecated */ typedef @@ -777,6 +1058,18 @@ struct HgfsRequestSetattrV2 { HgfsRequestSetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSetattrV3 { + HgfsAttrHint hints; + HgfsAttrV2 attr; + HgfsHandle file; /* Opaque file ID used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestSetattrV3; + /* Deprecated */ typedef @@ -798,6 +1091,27 @@ struct HgfsReplySetattrV2 { #include "vmware_pack_end.h" HgfsReplySetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySetattrV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySetattrV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDir { + HgfsRequest header; + HgfsPermissions permissions; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDir; + /* Version 2 of HgfsRequestCreateDir */ @@ -816,17 +1130,32 @@ struct HgfsRequestCreateDirV2 { HgfsRequestCreateDirV2; +/* Version 3 of HgfsRequestCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDirV3 { + HgfsCreateDirValid mask; + HgfsPermissions specialPerms; + HgfsPermissions ownerPerms; + HgfsPermissions groupPerms; + HgfsPermissions otherPerms; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDirV3; + + /* Deprecated */ typedef #include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { - HgfsRequest header; - HgfsPermissions permissions; - HgfsFileName fileName; +struct HgfsReplyCreateDir { + HgfsReply header; } #include "vmware_pack_end.h" -HgfsRequestCreateDir; +HgfsReplyCreateDir; /* Version 2 of HgfsReplyCreateDir */ @@ -840,17 +1169,19 @@ struct HgfsReplyCreateDirV2 { HgfsReplyCreateDirV2; -/* Deprecated */ +/* Version 3 of HgfsReplyCreateDir */ typedef #include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { - HgfsReply header; +struct HgfsReplyCreateDirV3 { + uint64 reserved; /* Reserved for future use */ } #include "vmware_pack_end.h" -HgfsReplyCreateDir; +HgfsReplyCreateDirV3; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDelete { @@ -860,6 +1191,9 @@ struct HgfsRequestDelete { #include "vmware_pack_end.h" HgfsRequestDelete; + +/* Version 2 of HgfsReplyCreateDir */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDeleteV2 { @@ -871,6 +1205,23 @@ struct HgfsRequestDeleteV2 { #include "vmware_pack_end.h" HgfsRequestDeleteV2; + +/* Version 3 of HgfsReplyCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestDeleteV3 { + HgfsDeleteHint hints; + HgfsHandle file; /* Opaque file ID used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ +} +#include "vmware_pack_end.h" +HgfsRequestDeleteV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyDelete { @@ -889,6 +1240,18 @@ struct HgfsReplyDeleteV2 { #include "vmware_pack_end.h" HgfsReplyDeleteV2; + +/* Version 2 of HgfsReplyDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyDeleteV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyDeleteV3; + + /* * The size of the HgfsFileName struct is variable depending on the * length of the name, so you can't use request->newName to get the @@ -942,6 +1305,31 @@ struct HgfsReplyRenameV2 { HgfsReplyRenameV2; +/* HgfsRequestRename and HgfsReplyRename for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestRenameV3 { + HgfsRenameHint hints; + HgfsHandle srcFile; /* Opaque file ID to "old name" used by the server. */ + HgfsHandle targetFile; /* Opaque file ID to "old name" used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 oldName; + HgfsFileNameV3 newName; +} +#include "vmware_pack_end.h" +HgfsRequestRenameV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyRenameV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyRenameV3; + + typedef #include "vmware_pack_begin.h" struct HgfsRequestQueryVolume { @@ -963,6 +1351,30 @@ struct HgfsReplyQueryVolume { HgfsReplyQueryVolume; +/* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestQueryVolumeV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestQueryVolumeV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyQueryVolumeV3 { + uint64 freeBytes; + uint64 totalBytes; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyQueryVolumeV3; + + + /* New operations for Version 2 */ typedef @@ -1008,4 +1420,28 @@ struct HgfsReplySymlinkCreate { HgfsReplySymlinkCreate; +/* HgfsRequestServerLockChange and HgfsReplyServerLockChange for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkName; + + /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ + HgfsFileNameV3 targetName; +} +#include "vmware_pack_end.h" +HgfsRequestSymlinkCreateV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySymlinkCreateV3; + + #endif /* _HGFS_PROTO_H_ */ diff --git a/open-vm-tools/modules/freebsd/vmhgfs/hgfsUtil.h b/open-vm-tools/modules/freebsd/vmhgfs/hgfsUtil.h index b734faac4..1b98bf761 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/hgfsUtil.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/hgfsUtil.h @@ -89,6 +89,7 @@ struct timespec { #endif #define HGFS_NAME_BUFFER_SIZE(request) (HGFS_PACKET_MAX - (sizeof *request - 1)) +#define HGFS_NAME_BUFFER_SIZET(sizet) (HGFS_PACKET_MAX - (sizet) - 1) #ifndef _WIN32 /* @@ -114,3 +115,4 @@ int HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT HgfsStatus HgfsConvertFromInternalStatus(HgfsInternalStatus status); // IN #endif /* _HGFSUTIL_H_ */ + diff --git a/open-vm-tools/modules/freebsd/vmhgfs/kernelStubs.h b/open-vm-tools/modules/freebsd/vmhgfs/kernelStubs.h index ac7211c7d..6c443265f 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/kernelStubs.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/kernelStubs.h @@ -21,7 +21,7 @@ * * KernelStubs implements some userspace library functions in terms * of kernel functions to allow library userspace code to be used in a - * kernel. + * kernel. */ #ifndef __KERNELSTUBS_H__ @@ -29,7 +29,7 @@ #ifdef linux # ifndef __KERNEL__ -# error "__KERNEL__ is not defined" +# error "__KERNEL__ is not defined" # endif # include "driver-config.h" // Must be included before any other header files # include "vm_basic_types.h" @@ -57,10 +57,10 @@ #elif defined(__APPLE__) # include "vm_basic_types.h" # ifndef KERNEL -# error "KERNEL is not defined" +# error "KERNEL is not defined" # endif # include -# include +# include #endif /* @@ -71,9 +71,6 @@ # ifdef linux /* if (linux) { */ char *strdup(const char *source); -# elif defined(__APPLE__) /* else if (__APPLE__) { */ -void KernelStubs_Init(void); -void KernelStubs_Cleanup(void); # endif /* Shared between Linux and Apple kernel stubs. */ @@ -130,6 +127,7 @@ __compat_malloc(unsigned long size, struct malloc_type *type, int flags) { /* * Stub functions we provide. */ + void Panic(const char *fmt, ...); char *Str_Strcpy(char *buf, const char *src, size_t maxSize); diff --git a/open-vm-tools/modules/freebsd/vmhgfs/request.c b/open-vm-tools/modules/freebsd/vmhgfs/request.c index bafe72918..3a09c29b0 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/request.c +++ b/open-vm-tools/modules/freebsd/vmhgfs/request.c @@ -82,7 +82,7 @@ OS_CV_T hgfsKReqWorkItemCv; * to abstract away the request allocation & support code. * * Results: - * None. + * Zero on success, HGFS_ERR on error. * * Side effects: * hgfsKReqZone is initialized. This routine may sleep. @@ -100,8 +100,15 @@ HgfsKReq_SysInit(void) HgfsKReqZCtor, HgfsKReqZDtor, HgfsKReqZInit, HgfsKReqZFini, 0, 0); - /* The following routines cannot fail. */ + if (!hgfsKReqZone) { + return HGFS_ERR; + } + hgfsKReqWorkItemLock = os_mutex_alloc_init(HGFS_FS_NAME "_workmtx"); + if (!hgfsKReqWorkItemLock) { + os_zone_destroy(hgfsKReqZone); + return HGFS_ERR; + } /* * This is a nop on OS X because we don't actually have a condition variable @@ -115,11 +122,13 @@ HgfsKReq_SysInit(void) "HgfsKReqWorker", &hgfsKReqWorkerThread); if (ret != 0) { - os_mutex_destroy(hgfsKReqWorkItemLock); os_cv_destroy(&hgfsKReqWorkItemCv); + os_zone_destroy(hgfsKReqZone); + os_mutex_destroy(hgfsKReqWorkItemLock); + return HGFS_ERR; } - return ret; + return 0; } @@ -174,7 +183,7 @@ HgfsKReq_SysFini(void) * Allocate a request container for a single file system mount. * * Results: - * Pointer to a new allocation container. Always succeeds. + * Pointer to a new allocation container or NULL on failure. * * Side effects: * This routine may sleep. @@ -187,9 +196,17 @@ HgfsKReq_AllocateContainer(void) { HgfsKReqContainer *container; - /* Called with M_WAITOK, so this cannot fail. */ container = os_malloc(sizeof (struct HgfsKReqContainer), M_WAITOK | M_ZERO); + if (!container) { + return NULL; + } + container->listLock = os_mutex_alloc_init("hgfs_reql_mtx"); + if (!container->listLock) { + os_free(container, sizeof *container); + return NULL; + } + DblLnkLst_Init(&container->list); return container; @@ -353,7 +370,7 @@ HgfsKReq_ContainerIsEmpty(HgfsKReqContainerHandle container) // IN: * interrupted by a signal. * * Results: - * Pointer to fresh HgfsKReqObject. + * Pointer to fresh HgfsKReqObject or NULL on failure. * * Side effects: * Request inserted into caller's requests container. This routine may @@ -369,13 +386,10 @@ HgfsKReq_AllocateRequest(HgfsKReqContainerHandle container) // IN ASSERT(container); - /* - * Called with M_WAITOK, so this can not fail unless the user provided - * constructor returns a non-zero value. Ours will not do this, so we should - * always succeed. - */ req = os_zone_alloc(hgfsKReqZone, M_WAITOK); - ASSERT(req); + if (!req) { + return NULL; + } os_mutex_lock(container->listLock); DblLnkLst_LinkLast(&container->list, &req->fsNode); @@ -719,6 +733,10 @@ HgfsKReqZInit(void *mem, // IN: Pointer to the allocated object req->id = (uint32_t)((unsigned long)req & 0xffffffff); req->state = HGFS_REQ_UNUSED; req->stateLock = os_mutex_alloc_init("hgfs_req_mtx"); + if (!req->stateLock) { + return ENOMEM; + } + os_cv_init(&req->stateCv, "hgfs_req_cv"); /* Reset list pointers. */ diff --git a/open-vm-tools/modules/freebsd/vmhgfs/sha1.c b/open-vm-tools/modules/freebsd/vmhgfs/sha1.c index 66f4b665c..0c8924cba 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/sha1.c +++ b/open-vm-tools/modules/freebsd/vmhgfs/sha1.c @@ -61,6 +61,9 @@ A million repetitions of "a" #ifdef USERLEVEL #include "vmware.h" #endif +#ifdef VMKBOOT +#include "vm_libc.h" +#endif #include "sha1.h" #include "vm_basic_asm.h" diff --git a/open-vm-tools/modules/freebsd/vmhgfs/state.c b/open-vm-tools/modules/freebsd/vmhgfs/state.c index f5fa9eb62..0138cb569 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/state.c +++ b/open-vm-tools/modules/freebsd/vmhgfs/state.c @@ -30,14 +30,19 @@ #if defined(__FreeBSD__) # include # include +# include "sha1.h" #elif defined(__APPLE__) # include +/* + * The OS X kernel includes the same exact SHA1 routines as those + * provided by bora/lib/misc. Use the kernel ones under OS X. + */ +# include #endif #include "hgfs_kernel.h" #include "state.h" #include "debug.h" -#include "sha1.h" #include "os.h" /* @@ -49,6 +54,9 @@ #define HGFS_IS_ROOT_FILE(sip, file) (HGFS_VP_TO_FP(sip->rootVnode) == file) +#if defined(__APPLE__) +# define SHA1_HASH_LEN SHA_DIGEST_LENGTH +#endif /* * Local functions (prototypes) @@ -291,6 +299,9 @@ HgfsInitFileHashTable(HgfsFileHashTable *htp) // IN: Hash table to initialize ASSERT(htp); htp->mutex = os_mutex_alloc_init("HgfsHashChain"); + if (!htp->mutex) { + return HGFS_ERR; + } for (i = 0; i < ARRAYSIZE(htp->hashTable); i++) { DblLnkLst_Init(&htp->hashTable[i]); @@ -1072,7 +1083,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT: Filled with address of creat default: /* Hgfs only supports directories and regular files */ - goto vnode_error; + goto vnodeError; } /* @@ -1083,7 +1094,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT: Filled with address of creat vp->v_data = (void *)HgfsAllocOpenFile(fileName, fileType, htp, lockHtp); if (vp->v_data == NULL) { ret = ENOMEM; - goto vnode_error; + goto vnodeError; } /* If this is going to be the root vnode, we have to mark it as such. */ @@ -1098,7 +1109,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT: Filled with address of creat return 0; /* Cleanup points for errors. */ -vnode_error: +vnodeError: vrele(vp); return ret; } @@ -1159,7 +1170,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT default: /* Hgfs only supports directories and regular files */ - goto vnode_error; + goto vnodeError; } /* @@ -1173,7 +1184,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT params.vnfs_fsnode = (void *)ofp; if (params.vnfs_fsnode == NULL) { ret = ENOMEM; - goto vnode_error; + goto vnodeError; } @@ -1189,7 +1200,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT if (ret != 0) { DEBUG(VM_DEBUG_FAIL, "Failed to create vnode"); ret = EINVAL; - goto vnode_error; + goto vnodeError; } /* Fill in the provided address with the new vnode. */ @@ -1199,7 +1210,7 @@ HgfsVnodeGetInt(struct vnode **vpp, // OUT return 0; /* Cleanup points for errors. */ -vnode_error: +vnodeError: vnode_put(vp); return ret; } @@ -1242,30 +1253,64 @@ HgfsAllocOpenFile(const char *fileName, // IN: Name of file * We allocate and initialize our open-file state. */ ofp = os_malloc(sizeof *ofp, M_ZERO | M_WAITOK); + if (!ofp) { + return NULL; + } ofp->mode = 0; ofp->modeIsSet = FALSE; -#if defined(__APPLE__) - ofp->rwFileLock = os_rw_lock_alloc_init("hgfs_rw_file_lock"); -#endif - ofp->handleRefCount = 0; ofp->handle = 0; ofp->handleMutex = os_mutex_alloc_init("hgfs_mtx_handle"); + if (!ofp->handleMutex) { + goto destroyOut; + } + ofp->modeMutex = os_mutex_alloc_init("hgfs_mtx_mode"); + if (!ofp->modeMutex) { + goto destroyOut; + } + +#if defined(__APPLE__) + ofp->rwFileLock = os_rw_lock_alloc_init("hgfs_rw_file_lock"); + if (!ofp->rwFileLock) { + goto destroyOut; + } +#endif /* * Now we get a reference to the underlying per-file state. */ ofp->hgfsFile = HgfsGetFile(fileName, fileType, htp, lockHtp); if (!ofp->hgfsFile) { - os_free(ofp, sizeof *ofp); - return NULL; + goto destroyOut; } + /* Success */ return ofp; + +destroyOut: + ASSERT(ofp); + + if (ofp->handleMutex) { + os_mutex_destroy(ofp->handleMutex); + } + + if (ofp->modeMutex) { + os_mutex_destroy(ofp->modeMutex); + } + +#if defined(__APPLE__) + if (ofp->rwFileLock) { + os_rw_lock_destroy(ofp->rwFileLock); + } +#endif + + os_free(ofp, sizeof *ofp); + return NULL; + } diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vm_assert.h b/open-vm-tools/modules/freebsd/vmhgfs/vm_assert.h index c170ddefd..12b67f3ef 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vm_assert.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/vm_assert.h @@ -98,8 +98,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm.h b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm.h index 8dcad4baa..80d6cda6f 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm.h @@ -413,12 +413,21 @@ __GET_CPUID(int input, CPUIDRegs *regs) #endif } +#ifdef VM_X86_64 + +/* + * No inline assembly in Win64. Implemented in bora/lib/user in + * cpuidMasm64.asm. + */ + +extern void +__GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs); + +#else // VM_X86_64 + static INLINE void __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) { -#ifdef VM_X86_64 - *(int*)0 = 0; // NOT_IMPLEMENTED(); -#else __asm push esi __asm push ebx __asm push ecx @@ -437,8 +446,8 @@ __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) __asm pop ecx __asm pop ebx __asm pop esi -#endif } +#endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86.h b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86.h index e40035aeb..ce83e3be7 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86.h @@ -100,16 +100,13 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0\n" : "=m" (*save)); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*load)); } static INLINE void @@ -117,7 +114,8 @@ FXRSTOR_AMD_ES0(const uint8 *load) { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __asm__ __volatile__ + ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap @@ -130,8 +128,7 @@ FXRSTOR_AMD_ES0(const uint8 *load) : "m" (dummy), "m" (*load) : "ax"); } - -#endif +#endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h index 6b0a2f1b0..72db20a4f 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h @@ -84,31 +84,25 @@ uint64 __shiftright128(uint64 lowPart, uint64 highPart, uint8 shift); static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsaveq %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsaveq %0 \n" : "=m" (*save)); } static INLINE void FXSAVE_COMPAT_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0 \n" : "=m" (*save)); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstorq %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstorq %0 \n" : : "m" (*load)); } static INLINE void FXRSTOR_COMPAT_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0 \n" : : "m" (*load)); } static INLINE void @@ -116,7 +110,8 @@ FXRSTOR_AMD_ES0(const uint8 *load) { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __asm__ __volatile__ + ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap @@ -130,7 +125,7 @@ FXRSTOR_AMD_ES0(const uint8 *load) : "ax"); } -#endif +#endif /* __GNUC__ */ /* diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_defs.h b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_defs.h index f07223c96..bd264c975 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_defs.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_defs.h @@ -108,6 +108,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -543,14 +545,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_types.h b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_types.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/freebsd/vmhgfs/vnopscommon.c b/open-vm-tools/modules/freebsd/vmhgfs/vnopscommon.c index 2359b22d7..6ff3e8103 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/vnopscommon.c +++ b/open-vm-tools/modules/freebsd/vmhgfs/vnopscommon.c @@ -98,6 +98,9 @@ HgfsRenameInt(struct vnode *fvp, // IN: "from" file /* Make the full path of the destination. */ dstFullPath = os_malloc(MAXPATHLEN, M_WAITOK); + if (!dstFullPath) { + return ENOMEM; + } ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(tdvp), HGFS_VP_TO_FILENAME_LENGTH(tdvp), tcnp->cn_nameptr, tcnp->cn_namelen, dstFullPath, MAXPATHLEN); @@ -133,7 +136,7 @@ HgfsRenameInt(struct vnode *fvp, // IN: "from" file DEBUG(VM_DEBUG_FAIL, "HgfsRename: couldn't convert source to cross platform name.\n"); ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(request->oldName.name, ret); @@ -153,7 +156,7 @@ HgfsRenameInt(struct vnode *fvp, // IN: "from" file DEBUG(VM_DEBUG_FAIL, "HgfsRename: couldn't convert destination to cross platform name.\n"); ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(newNameP->name, ret); @@ -174,19 +177,19 @@ HgfsRenameInt(struct vnode *fvp, // IN: "from" file if (HgfsValidateReply(req, sizeof *reply) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } ret = HgfsStatusToBSD(reply->header.status); if (ret) { - goto destroy_out; + goto destroyOut; } /* Successfully renamed file on the server. */ ret = 0; DEBUG(VM_DEBUG_DONE, "done.\n"); -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: if (dstFullPath != NULL) { @@ -235,10 +238,6 @@ HgfsReaddirInt(struct vnode *vp, // IN : Directory vnode to get entries from. char *fullName = NULL; /* Hashed to generate inode number */ int ret = 0; - DEBUG(VM_DEBUG_ENTRY, "uiop->uio_resid=%d, " - "HGFS_UIOP_TO_OFFSET(uiop)=%jd\n", - HGFS_UIOP_TO_RESID(uiop), HGFS_UIOP_TO_OFFSET(uiop)); - /* uio_offset is a signed quantity. */ if (HGFS_UIOP_TO_OFFSET(uiop) < 0) { DEBUG(VM_DEBUG_FAIL, "fed negative offset.\n"); @@ -269,6 +268,9 @@ HgfsReaddirInt(struct vnode *vp, // IN : Directory vnode to get entries from. * Allocate 1K (MAXPATHLEN) buffer for inode number generation. */ fullName = os_malloc(MAXPATHLEN, M_WAITOK); + if (!fullName) { + return ENOMEM; + } /* * Loop until one of the following conditions is met: @@ -483,7 +485,7 @@ HgfsSetattrInt(struct vnode *vp, // IN : vnode of the file if (HgfsSetattrCopy(vap, &request->attr, &request->update) == FALSE) { DEBUG(VM_DEBUG_DONE, "don't need to update attributes.\n"); ret = 0; - goto destroy_out; + goto destroyOut; } /* Convert the filename to cross platform and escape its buffer. */ @@ -491,7 +493,7 @@ HgfsSetattrInt(struct vnode *vp, // IN : vnode of the file if (ret < 0) { DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(request->fileName.name, ret); @@ -512,12 +514,12 @@ HgfsSetattrInt(struct vnode *vp, // IN : vnode of the file if (HgfsValidateReply(req, sizeof *reply) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } ret = HgfsStatusToBSD(reply->header.status); if (ret) { - goto destroy_out; + goto destroyOut; } } /* else { they were trying to set filerev or vaflags, which we ignore } */ @@ -525,7 +527,7 @@ HgfsSetattrInt(struct vnode *vp, // IN : vnode of the file ret = 0; DEBUG(VM_DEBUG_DONE, "done.\n"); -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: return ret; @@ -784,6 +786,9 @@ HgfsLookupInt(struct vnode *dvp, // IN : directory vnode /* Snag a pathname buffer */ path = os_malloc(MAXPATHLEN, M_WAITOK); + if (!path) { + return ENOMEM; + } /* Construct the full path for this lookup. */ len = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Path to this file @@ -909,6 +914,9 @@ int HgfsCreateInt(struct vnode *dvp, // IN : Directory vnode * HgfsOpenInt call should happen right after this call. */ fullname = os_malloc(MAXPATHLEN, M_WAITOK); + if (!fullname) { + return ENOMEM; + } ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Name of directory to create in HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of name @@ -1090,8 +1098,6 @@ HgfsWriteInt(struct vnode *vp, // IN : the vnode of the file int ret; DEBUG(VM_DEBUG_ENTRY, "entry. (vp=%p)\n", vp); - DEBUG(VM_DEBUG_INFO, "***ioflag=%x, uio_resid=%d\n", - ioflag, HGFS_UIOP_TO_RESID(uiop)); /* Skip write requests for 0 bytes. */ if (HGFS_UIOP_TO_RESID(uiop) == 0) { @@ -1203,6 +1209,10 @@ HgfsMkdirInt(struct vnode *dvp, // IN : directory vnode /* Construct the complete path of the directory to create. */ fullname = os_malloc(MAXPATHLEN, M_WAITOK); + if (!fullname) { + return ENOMEM; + } + ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Parent directory HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of name cnp->cn_nameptr, // Name of file to create @@ -1232,7 +1242,7 @@ HgfsMkdirInt(struct vnode *dvp, // IN : directory vnode if (ret < 0) { DEBUG(VM_DEBUG_FAIL, "cross-platform name is too long.\n"); ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(request->fileName.name, ret); @@ -1253,25 +1263,25 @@ HgfsMkdirInt(struct vnode *dvp, // IN : directory vnode if (HgfsValidateReply(req, sizeof *reply) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } ret = HgfsStatusToBSD(reply->header.status); if (ret) { - goto destroy_out; + goto destroyOut; } ret = HgfsVnodeGet(vpp, sip, HGFS_VP_TO_MP(dvp), fullname, HGFS_FILE_TYPE_DIRECTORY, &sip->fileHashTable); if (ret) { ret = EIO; - goto destroy_out; + goto destroyOut; } ASSERT(*vpp); ret = 0; -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: if (fullname != NULL) { @@ -1373,7 +1383,7 @@ HgfsDirOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer MAXPATHLEN, request->dirName.name); if (ret < 0) { ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(request->dirName.name, ret); /* cannot fail */ @@ -1396,7 +1406,7 @@ HgfsDirOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof reply->header) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", reply->header.id); @@ -1405,19 +1415,19 @@ HgfsDirOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer ret = HgfsStatusToBSD(reply->header.status); if (ret) { - goto destroy_out; + goto destroyOut; } /* Set the search open handle for use in HgfsReaddir() */ ret = HgfsSetOpenFileHandle(vp, reply->search); if (ret) { ret = EINVAL; - goto destroy_out; + goto destroyOut; } ret = 0; /* Return success */ -destroy_out: +destroyOut: /* Make sure we put the request back on the list */ HgfsKReq_ReleaseRequest(sip->reqs, req); @@ -1482,7 +1492,7 @@ HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer if (ret < 0) { DEBUG(VM_DEBUG_FAIL, "HgfsGetOpenMode failed.\n"); ret = EINVAL; - goto destroy_out; + goto destroyOut; } request->mode = ret; @@ -1493,7 +1503,7 @@ HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer if (ret < 0) { DEBUG(VM_DEBUG_FAIL, "HgfsGetOpenFlags failed.\n"); ret = EINVAL; - goto destroy_out; + goto destroyOut; } request->flags = ret; @@ -1507,7 +1517,7 @@ HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer if (ret < 0) { DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(request->fileName.name, ret); request->fileName.length = ret; @@ -1527,12 +1537,12 @@ HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof reply->header) != 0) { DEBUG(VM_DEBUG_FAIL, "request not valid.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } ret = HgfsStatusToBSD(reply->header.status); if (ret) { - goto destroy_out; + goto destroyOut; } /* @@ -1544,13 +1554,13 @@ HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer DEBUG(VM_DEBUG_FAIL, "couldn't assign handle %d (%s)\n", reply->file, HGFS_VP_TO_FILENAME(vp)); ret = EINVAL; - goto destroy_out; + goto destroyOut; } ret = 0; -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: @@ -1623,7 +1633,7 @@ HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer DEBUG(VM_DEBUG_FAIL, "couldn't get handle for %s\n", HGFS_VP_TO_FILENAME(vp)); ret = EINVAL; - goto destroy_out; + goto destroyOut; } HgfsKReq_SetPayloadSize(req, sizeof *request); @@ -1640,7 +1650,7 @@ HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof reply->header) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", reply->header.id); @@ -1649,7 +1659,7 @@ HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer /* Ensure server was able to close directory. */ if (reply->header.status != HGFS_STATUS_SUCCESS) { ret = EFAULT; - goto destroy_out; + goto destroyOut; } /* Now clear this open file's handle for future use. */ @@ -1657,7 +1667,7 @@ HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer if (ret || (closed == FALSE)) { DEBUG(VM_DEBUG_FAIL, "couldn't clear handle.\n"); ret = EINVAL; - goto destroy_out; + goto destroyOut; } else { DEBUG(VM_DEBUG_FAIL, "cleared file handle\n"); } @@ -1665,7 +1675,7 @@ HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer /* The directory was closed successfully so we return success. */ ret = 0; -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: return ret; @@ -1733,7 +1743,7 @@ HgfsFileClose(HgfsSuperInfo *sip, // IN: Superinfo pointer if (ret) { DEBUG(VM_DEBUG_FAIL, "couldn't get handle.\n"); ret = EINVAL; - goto destroy_out; + goto destroyOut; } HgfsKReq_SetPayloadSize(req, sizeof *request); @@ -1748,7 +1758,7 @@ HgfsFileClose(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof *reply) != 0) { DEBUG(VM_DEBUG_FAIL, "reply was invalid.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } reply = (HgfsReplyClose *)HgfsKReq_GetPayload(req); @@ -1763,16 +1773,16 @@ HgfsFileClose(HgfsSuperInfo *sip, // IN: Superinfo pointer if (ret || (closed == FALSE)) { DEBUG(VM_DEBUG_FAIL, "couldn't clear handle.\n"); ret = EINVAL; - goto destroy_out; + goto destroyOut; } ret = 0; - goto destroy_out; + goto destroyOut; } else { - goto destroy_out; + goto destroyOut; } -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: DEBUG(VM_DEBUG_DONE, "returning %d\n", ret); @@ -1856,13 +1866,13 @@ HgfsDoRead(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof reply->header) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = -EPROTO; - goto destroy_out; + goto destroyOut; } if (reply->header.status != HGFS_STATUS_SUCCESS) { DEBUG(VM_DEBUG_FAIL, "request not completed successfully.\n"); ret = -EACCES; - goto destroy_out; + goto destroyOut; } /* @@ -1881,7 +1891,7 @@ HgfsDoRead(HgfsSuperInfo *sip, // IN: Superinfo pointer ret = uiomove(reply->payload, reply->actualSize, uiop); if (ret) { ret = -EIO; - goto destroy_out; + goto destroyOut; } /* We successfully copied the payload to the user's buffer */ @@ -1891,14 +1901,14 @@ HgfsDoRead(HgfsSuperInfo *sip, // IN: Superinfo pointer /* We got too much data: server error. */ DEBUG(VM_DEBUG_FAIL, "received too much data in payload.\n"); ret = -EPROTO; - goto destroy_out; + goto destroyOut; } success: ret = reply->actualSize; DEBUG(VM_DEBUG_DONE, "successfully read %d bytes to user.\n", ret); -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: return ret; @@ -1974,7 +1984,7 @@ HgfsDoWrite(HgfsSuperInfo *sip, // IN: Superinfo pointer DEBUG(VM_DEBUG_FAIL, "HgfsDoWrite: uiomove(9F) failed copying data from user.\n"); ret = -EIO; - goto destroy_out; + goto destroyOut; } /* We subtract one so request's 'char payload[1]' member isn't double counted. */ @@ -1996,28 +2006,28 @@ HgfsDoWrite(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof reply->header) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = -EPROTO; - goto destroy_out; + goto destroyOut; } if (reply->header.status != HGFS_STATUS_SUCCESS) { DEBUG(VM_DEBUG_FAIL, "write failed (status=%d).\n", reply->header.status); ret = -EACCES; - goto destroy_out; + goto destroyOut; } if (HgfsKReq_GetPayloadSize(req) != sizeof *reply) { DEBUG(VM_DEBUG_FAIL, "HgfsDoWrite: invalid size of reply on successful reply.\n"); ret = -EPROTO; - goto destroy_out; + goto destroyOut; } /* The write was completed successfully, so return the amount written. */ ret = reply->actualSize; DEBUG(VM_DEBUG_DONE, "wrote %d bytes.\n", ret); -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: return ret; @@ -2069,7 +2079,7 @@ HgfsDelete(HgfsSuperInfo *sip, // IN: Superinfo ret = CPName_ConvertTo(filename, MAXPATHLEN, request->fileName.name); if (ret < 0) { ret = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } ret = HgfsUnescapeBuffer(request->fileName.name, ret); @@ -2093,17 +2103,17 @@ HgfsDelete(HgfsSuperInfo *sip, // IN: Superinfo if (HgfsValidateReply(req, sizeof *reply) != 0) { DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } ret = HgfsStatusToBSD(reply->header.status); if (ret) { - goto destroy_out; + goto destroyOut; } DEBUG(VM_DEBUG_DONE, "done.\n"); -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: return ret; @@ -2181,7 +2191,7 @@ HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer if (HgfsValidateReply(req, sizeof reply->header) != 0) { DEBUG(VM_DEBUG_FAIL, "reply not valid.\n"); ret = EPROTO; - goto destroy_out; + goto destroyOut; } DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", @@ -2193,14 +2203,14 @@ HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer DEBUG(VM_DEBUG_FAIL, "server didn't return success (%d).\n", reply->header.status); ret = EINVAL; - goto destroy_out; + goto destroyOut; } /* Make sure we got an entire reply (excluding filename) */ if (HgfsKReq_GetPayloadSize(req) < sizeof *reply) { DEBUG(VM_DEBUG_FAIL, "server didn't provide entire reply.\n"); ret = EFAULT; - goto destroy_out; + goto destroyOut; } /* See if there are no more filenames to read */ @@ -2208,7 +2218,7 @@ HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer DEBUG(VM_DEBUG_DONE, "no more directory entries.\n"); *done = TRUE; ret = 0; /* return success */ - goto destroy_out; + goto destroyOut; } /* Make sure filename isn't too long */ @@ -2216,7 +2226,7 @@ HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer (reply->fileName.length > HGFS_PAYLOAD_MAX(reply)) ) { DEBUG(VM_DEBUG_FAIL, "filename is too long.\n"); ret = EOVERFLOW; - goto destroy_out; + goto destroyOut; } /* @@ -2231,7 +2241,7 @@ HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer ret = 0; DEBUG(VM_DEBUG_DONE, "done.\n"); -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: return ret; @@ -2364,7 +2374,7 @@ HgfsDoGetattrInt(const char *path, // IN : Path to get attributes for if (result < 0) { DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); result = ENAMETOOLONG; - goto destroy_out; + goto destroyOut; } result = HgfsUnescapeBuffer(requestV2->fileName.name, result); requestV2->fileName.length = result; @@ -2396,7 +2406,7 @@ HgfsDoGetattrInt(const char *path, // IN : Path to get attributes for DEBUG(VM_DEBUG_FAIL, "invalid reply received for ID %d " "with status %d.\n", replyV2->header.id, replyV2->header.status); result = EPROTO; - goto destroy_out; + goto destroyOut; } DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", replyV2->header.id); @@ -2416,7 +2426,7 @@ HgfsDoGetattrInt(const char *path, // IN : Path to get attributes for DEBUG(VM_DEBUG_LOG, "Get attribute request on \"%s\" failed with an error code of %d\n", path, result); - goto destroy_out; + goto destroyOut; } else { /* The GetAttr succeeded, ensure packet contains correct amount of data. */ if (HgfsKReq_GetPayloadSize(req) != sizeof *replyV2) { @@ -2424,14 +2434,14 @@ HgfsDoGetattrInt(const char *path, // IN : Path to get attributes for "HgfsLookup: invalid packet size received for \"%s\".\n", path); result = EFAULT; - goto destroy_out; + goto destroyOut; } /* Fill out hgfsAttrV2 with the results from the server. */ memcpy(hgfsAttrV2, &replyV2->attr, sizeof *hgfsAttrV2); } -destroy_out: +destroyOut: HgfsKReq_ReleaseRequest(sip->reqs, req); out: diff --git a/open-vm-tools/modules/freebsd/vmhgfs/x86cpuid.h b/open-vm-tools/modules/freebsd/vmhgfs/x86cpuid.h index e0617fe66..07e500d68 100644 --- a/open-vm-tools/modules/freebsd/vmhgfs/x86cpuid.h +++ b/open-vm-tools/modules/freebsd/vmhgfs/x86cpuid.h @@ -92,6 +92,8 @@ typedef struct CPUIDResult { #define CPUID_UNCACHED_LEVELS \ CPUIDLEVEL(FALSE, 4, 4) \ + CPUIDLEVEL(FALSE, 5, 5) \ + CPUIDLEVEL(FALSE, 6, 6) \ CPUIDLEVEL(FALSE, A, 0xA) \ CPUIDLEVEL(FALSE, 86, 0x80000006) \ CPUIDLEVEL(FALSE, 87, 0x80000007) \ @@ -248,6 +250,8 @@ FLAGDEF( 1, ECX, INTEL, 21, 1, X2APIC, MASK, 0, FALSE) FLAGDEF( 1, ECX, INTEL, 22, 1, MOVBE, RSVD, 0, TRUE) \ FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, HOST, 0, TRUE, POPCNT) \ FLAGDEF( 1, ECX, INTEL, 24, 1, ULE, RSVD, 0, TRUE) \ +FLAGDEF( 1, ECX, INTEL, 26, 1, XSAVE, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 27, 1, OSXSAVE, RSVD, 0, TRUE) \ FLAGDEFA( 1, ECX, COMMON, 31, 1, HYPERVISOR, IGNORE, 0, FALSE, HYPERVISOR)\ FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, HOST, 0, TRUE, FPU) \ FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, HOST, 0, FALSE, VME) \ @@ -290,6 +294,25 @@ FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, IGNORE, 0, FALSE) FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, IGNORE, 0, FALSE) \ FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, IGNORE, 0, FALSE) +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_5 \ +FIELDDEF( 5, EAX, COMMON, 0, 16, MWAIT_MIN_SIZE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EBX, COMMON, 0, 16, MWAIT_MAX_SIZE, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 0, 1, MWAIT_EXTENSIONS, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 1, 1, MWAIT_INTR_BREAK, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 0, 4, MWAIT_C0_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 4, 4, MWAIT_C1_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 8, 4, MWAIT_C2_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 12, 4, MWAIT_C3_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 16, 4, MWAIT_C4_SUBSTATE, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_6 \ +FLAGDEF( 6, EAX, INTEL, 0, 1, THERMAL_SENSOR, IGNORE, 0, FALSE) \ +FLAGDEF( 6, EAX, INTEL, 1, 1, TURBO_MODE, IGNORE, 0, FALSE) \ +FIELDDEF( 6, EBX, INTEL, 0, 4, NUM_INTR_THRESHOLDS, IGNORE, 0, FALSE) \ +FLAGDEF( 6, ECX, INTEL, 0, 1, HW_COORD_FEEDBACK, IGNORE, 0, FALSE) + /* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_A \ FIELDDEF( A, EAX, INTEL, 0, 8, PMC_VERSION, IGNORE, 0, FALSE) \ @@ -371,6 +394,14 @@ FIELDDEF( 86, ECX, AMD, 0, 8, CACHE_LINE, IGNORE, 0, FALSE) FIELDDEF( 86, ECX, AMD, 8, 4, CACHE_LINE_PER_TAG, IGNORE, 0, FALSE) \ FIELDDEF( 86, ECX, AMD, 12, 4, CACHE_WAYS, IGNORE, 0, FALSE) \ FIELDDEF( 86, ECX, AMD, 16, 16, CACHE_SIZE, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 0, 1, TS, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 1, 1, FID, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 2, 1, VID, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 3, 1, TTP, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 4, 1, TM, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 5, 1, STC, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 6, 1, 100MHZSTEPS, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 7, 1, HWPSTATE, IGNORE, 0, FALSE) \ FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, IGNORE, 0, FALSE) \ FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, IGNORE, 0, FALSE, PHYS_BITS) \ FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, IGNORE, 0, FALSE, VIRT_BITS) \ @@ -391,6 +422,8 @@ FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, MASK, 0, FALSE) CPUID_FIELD_DATA_LEVEL_0 \ CPUID_FIELD_DATA_LEVEL_1 \ CPUID_FIELD_DATA_LEVEL_4 \ + CPUID_FIELD_DATA_LEVEL_5 \ + CPUID_FIELD_DATA_LEVEL_6 \ CPUID_FIELD_DATA_LEVEL_A \ CPUID_FIELD_DATA_LEVEL_80 \ CPUID_FIELD_DATA_LEVEL_81 \ @@ -519,6 +552,13 @@ FIELD_FUNC(AMD_CORE_COUNT, CPUID_AMD_ID88ECX_CORE_COUNT) FIELD_FUNC(AMD_APICID_COREID_SIZE, CPUID_AMD_ID88ECX_APICID_COREID_SIZE) FIELD_FUNC(AMD_EXTAPICSPC, CPUID_AMD_ID81ECX_EXTAPICSPC) FIELD_FUNC(NUM_PMCS, CPUID_INTEL_IDAEAX_NUM_PMCS) +FIELD_FUNC(MWAIT_MIN_SIZE, CPUID_COMMON_ID5EAX_MWAIT_MIN_SIZE) +FIELD_FUNC(MWAIT_MAX_SIZE, CPUID_COMMON_ID5EBX_MWAIT_MAX_SIZE) +FIELD_FUNC(MWAIT_C0_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C0_SUBSTATE) +FIELD_FUNC(MWAIT_C1_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C1_SUBSTATE) +FIELD_FUNC(MWAIT_C2_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C2_SUBSTATE) +FIELD_FUNC(MWAIT_C3_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C3_SUBSTATE) +FIELD_FUNC(MWAIT_C4_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C4_SUBSTATE) #undef FIELD_FUNC @@ -706,19 +746,52 @@ CPUID_FullyWritableTSC(Bool isIntel, // IN CPUID_FAMILY(v) < CPUID_FAMILY_K8)); } + /* * For certain AMD processors, an lfence instruction is necessary at various * places to ensure ordering. */ + +static INLINE Bool +CPUID_VendorRequiresFence(CpuidVendors vendor) +{ + return vendor == CPUID_VENDOR_AMD; +} + +static INLINE Bool +CPUID_VersionRequiresFence(uint32 version) +{ + return CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8 && + CPUID_EFFECTIVE_MODEL(version) < 0x40; +} + +static INLINE Bool +CPUID_ID0RequiresFence(CPUIDRegs *id0) +{ + if (id0->eax == 0) { + return FALSE; + } + // hard to get strcmp() in some environments, so do it in the raw + return (id0->ebx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 0) && + id0->ecx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 4) && + id0->edx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 8)); +} + +static INLINE Bool +CPUID_ID1RequiresFence(CPUIDRegs *id1) +{ + return CPUID_VersionRequiresFence(id1->eax); +} + static INLINE Bool CPUID_RequiresFence(CpuidVendors vendor, // IN uint32 version) // IN: %eax from CPUID with %eax=1. { - return ((vendor == CPUID_VENDOR_AMD) && - (CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8) && - (CPUID_EFFECTIVE_MODEL(version) < 0x40)); + return CPUID_VendorRequiresFence(vendor) && + CPUID_VersionRequiresFence(version); } + /* * The following low-level functions compute the number of * cores per cpu. They should be used cautiously because diff --git a/open-vm-tools/modules/freebsd/vmmemctl/vm_assert.h b/open-vm-tools/modules/freebsd/vmmemctl/vm_assert.h index c170ddefd..12b67f3ef 100644 --- a/open-vm-tools/modules/freebsd/vmmemctl/vm_assert.h +++ b/open-vm-tools/modules/freebsd/vmmemctl/vm_assert.h @@ -98,8 +98,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_defs.h b/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_defs.h index f07223c96..bd264c975 100644 --- a/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_defs.h +++ b/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_defs.h @@ -108,6 +108,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -543,14 +545,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_types.h b/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_types.h +++ b/open-vm-tools/modules/freebsd/vmmemctl/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/freebsd/vmxnet/if_vxn.c b/open-vm-tools/modules/freebsd/vmxnet/if_vxn.c index de1cd5805..e7e80e87c 100644 --- a/open-vm-tools/modules/freebsd/vmxnet/if_vxn.c +++ b/open-vm-tools/modules/freebsd/vmxnet/if_vxn.c @@ -35,6 +35,14 @@ # include #endif +/* + * FreeBSD 7.0-RELEASE changed the bus_setup_intr API to include a device_filter_t + * parameter. + */ +#if __FreeBSD_version >= 700031 +# define VXN_NEWNEWBUS +#endif + #if __FreeBSD_version < 600000 #include #else @@ -91,7 +99,11 @@ static int vxn_attach (device_t); static int vxn_detach (device_t); typedef struct vxn_softc { - struct arpcom arpcom; +#ifdef VXN_NEEDARPCOM + struct arpcom arpcom; +#else + struct ifnet *vxn_ifp; +#endif #ifdef VXN_MPSAFE struct mtx vxn_mtx; #endif @@ -153,6 +165,7 @@ static driver_t vxn_driver = { static devclass_t vxn_devclass; +MODULE_DEPEND(if_vxn, pci, 1, 1, 1); DRIVER_MODULE(if_vxn, pci, vxn_driver, vxn_devclass, 0, 0); /* @@ -227,6 +240,7 @@ vxn_attach(device_t dev) u_int32_t r; u_int32_t vLow, vHigh; int driverDataSize; + u_char mac[6]; s = splimp(); @@ -297,7 +311,10 @@ vxn_attach(device_t dev) error = ENXIO; goto fail; } -#ifdef VXN_MPSAFE +#if defined(VXN_NEWNEWBUS) + error = bus_setup_intr(dev, sc->vxn_irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, vxn_intr, sc, &sc->vxn_intrhand); +#elif defined(VXN_MPSAFE) error = bus_setup_intr(dev, sc->vxn_irq, INTR_TYPE_NET | INTR_MPSAFE, vxn_intr, sc, &sc->vxn_intrhand); #else @@ -375,14 +392,21 @@ vxn_attach(device_t dev) * read the MAC address from the device */ for (i = 0; i < 6; i++) { - ((char *)(&VXN_SC2ENADDR(sc)))[i] = - bus_space_read_1(sc->vxn_iobtag, sc->vxn_iobhandle, VMXNET_MAC_ADDR + i); + mac[i] = bus_space_read_1(sc->vxn_iobtag, sc->vxn_iobhandle, VMXNET_MAC_ADDR + i); } +#ifdef VXN_NEEDARPCOM + /* + * FreeBSD 4.x requires that we manually record the device's MAC address to + * the attached arpcom structure prior to calling ether_ifattach(). + */ + bcopy(mac, sc->arpcom.ac_enaddr, 6); +#endif + /* * success */ - VXN_ETHER_IFATTACH(ifp, VXN_SC2ENADDR(sc)); + VXN_ETHER_IFATTACH(ifp, mac); printf("vxn%d: attached [num_rx_bufs=(%d*%d) num_tx_bufs=(%d*%d) driverDataSize=%d]\n", unit, sc->vxn_num_rx_bufs, (int)sizeof(Vmxnet2_RxRingEntry), @@ -839,10 +863,9 @@ vxn_encap(struct ifnet *ifp, static void vxn_start(struct ifnet *ifp) { - vxn_softc_t *sc = ifp->if_softc; - VXN_LOCK(sc); + VXN_LOCK((vxn_softc_t *)ifp->if_softc); vxn_startl(ifp); - VXN_UNLOCK(sc); + VXN_UNLOCK((vxn_softc_t *)ifp->if_softc); } /* diff --git a/open-vm-tools/modules/freebsd/vmxnet/includeCheck.h b/open-vm-tools/modules/freebsd/vmxnet/includeCheck.h new file mode 100644 index 000000000..e69de29bb diff --git a/open-vm-tools/modules/freebsd/vmxnet/net_compat.h b/open-vm-tools/modules/freebsd/vmxnet/net_compat.h index c53ba2e01..78c38507f 100644 --- a/open-vm-tools/modules/freebsd/vmxnet/net_compat.h +++ b/open-vm-tools/modules/freebsd/vmxnet/net_compat.h @@ -66,7 +66,7 @@ #define VXN_IF_UNIT(ifp) ((ifp)->if_unit) #define VXN_IF_INITNAME(ifp, name, unit) do { \ - (ifp)->if_name = (name); \ + (ifp)->if_name = (char *)(name); \ (ifp)->if_unit = (unit); \ } while (0) #else /* >= 501113 */ @@ -96,25 +96,23 @@ * returned from if_alloc() and if_alloc() allocates * space for if_l2com. * + * Accessing the link layer address via arpcom's ac_enaddr was deprecated as + * of sys/net/if_var.h:1.98, and drivers are to instead get/set said address + * through the embedded ifnet structure. So with FreeBSD 6 and above, we + * instead define vxn_softc as follows and rely on FreeBSD's macro glue for + * easy access to the LL-address. + * * struct vxn_softc { - * struct arpcom { - * struct ifnet { - * void *if_softc; - * void *if_l2com; - * ... - * } *ac_ifp; - * u_char _ac_enaddr[6]; - * ... - * } ; + * struct ifnet *vxn_ifp; * ... * }; */ -#if __FreeBSD_version < 600000 +#if __FreeBSD_version < 600000 /* Pre-FreeBSD 6.0-RELEASE */ + #define VXN_NEEDARPCOM #define VXN_IF_ALLOC(softc) (&(softc)->arpcom.ac_if) #define VXN_IF_FREE(softc) #define VXN_SC2IFP(softc) (&(softc)->arpcom.ac_if) - #define VXN_SC2ENADDR(softc) ((softc)->arpcom.ac_enaddr) #define VXN_PCIR_MAPS PCIR_MAPS @@ -127,12 +125,11 @@ ((ifp)->if_flags &= ~(flags)) #define VXN_GET_IF_DRV_FLAGS(ifp) \ ((ifp)->if_flags) -#else - #define VXN_IF_ALLOC(softc) (((softc)->arpcom.ac_ifp) = if_alloc(IFT_ETHER)); - #define VXN_IF_FREE(softc) if_free((softc)->arpcom.ac_ifp) +#else /* FreeBSD 6.x+ */ + #define VXN_IF_ALLOC(softc) ((softc)->vxn_ifp = if_alloc(IFT_ETHER)) + #define VXN_IF_FREE(softc) if_free((softc)->vxn_ifp) - #define VXN_SC2IFP(softc) ((softc)->arpcom.ac_ifp) - #define VXN_SC2ENADDR(softc) ((softc)->arpcom._ac_enaddr) + #define VXN_SC2IFP(softc) ((softc)->vxn_ifp) #define VXN_PCIR_MAPS PCIR_BARS diff --git a/open-vm-tools/modules/freebsd/vmxnet/vm_basic_types.h b/open-vm-tools/modules/freebsd/vmxnet/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/freebsd/vmxnet/vm_basic_types.h +++ b/open-vm-tools/modules/freebsd/vmxnet/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/freebsd/vmxnet/vm_device_version.h b/open-vm-tools/modules/freebsd/vmxnet/vm_device_version.h index 09235f3e6..ac7a82ced 100644 --- a/open-vm-tools/modules/freebsd/vmxnet/vm_device_version.h +++ b/open-vm-tools/modules/freebsd/vmxnet/vm_device_version.h @@ -124,6 +124,8 @@ /************* SCSI implementation limits ********************************/ #define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering #define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16 +#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS +#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 1) /************* Strings for the VESA BIOS Identity Fields *****************/ #define VBE_OEM_STRING COMPANY_NAME " SVGA" @@ -139,6 +141,9 @@ /************* PCI Passthrough implementation limits ********************/ #define MAX_PCI_PASSTHRU_DEVICES 2 +/************* USB implementation limits ********************************/ +#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 + /************* Strings for Host USB Driver *******************************/ #ifdef _WIN32 diff --git a/open-vm-tools/modules/freebsd/vmxnet/vmnet_def.h b/open-vm-tools/modules/freebsd/vmxnet/vmnet_def.h index 636a1ca56..1aa7bb454 100644 --- a/open-vm-tools/modules/freebsd/vmxnet/vmnet_def.h +++ b/open-vm-tools/modules/freebsd/vmxnet/vmnet_def.h @@ -57,4 +57,5 @@ #define VMNET_CAP_RX_CHAIN 0x8000 /* a pkt can span multiple rx entries */ #define VMNET_CAP_LPD 0x10000 /* large pkt delivery */ #define VMNET_CAP_BPF 0x20000 /* BPF Support in VMXNET Virtual Hardware */ +#define VMNET_CAP_SG_SPAN_PAGES 0x40000 /* Can do scatter-gather span multiple pages transmits. */ #endif // _VMNET_DEF_H_ diff --git a/open-vm-tools/modules/linux/vmblock/include/compat_fs.h b/open-vm-tools/modules/linux/vmblock/include/compat_fs.h index d1c083a3d..474a43e86 100644 --- a/open-vm-tools/modules/linux/vmblock/include/compat_fs.h +++ b/open-vm-tools/modules/linux/vmblock/include/compat_fs.h @@ -80,8 +80,8 @@ * * The VFS exports do_sync_read() and do_sync_write() as the "new" * generic_file_read() and generic_file_write(), but filesystems need not - * actually implement read and write- the VFS will automatically call - * do_sync_write() and do_sync_read() when applications invoke the standard + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard * read() and write() system calls. * * In 2.6.19, generic_file_read() and generic_file_write() were removed, @@ -103,6 +103,14 @@ #endif +/* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + /* * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 * implementation. It uses the dcache lock which is OK because per-dentry diff --git a/open-vm-tools/modules/linux/vmblock/include/compat_kernel.h b/open-vm-tools/modules/linux/vmblock/include/compat_kernel.h index 76b47cfad..5d230646b 100644 --- a/open-vm-tools/modules/linux/vmblock/include/compat_kernel.h +++ b/open-vm-tools/modules/linux/vmblock/include/compat_kernel.h @@ -72,5 +72,12 @@ static inline _syscall1(int, compat_exit, int, exit_code); #endif +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif #endif /* __COMPAT_KERNEL_H__ */ diff --git a/open-vm-tools/modules/linux/vmblock/include/compat_namei.h b/open-vm-tools/modules/linux/vmblock/include/compat_namei.h index a3176f524..28d72c8e1 100644 --- a/open-vm-tools/modules/linux/vmblock/include/compat_namei.h +++ b/open-vm-tools/modules/linux/vmblock/include/compat_namei.h @@ -23,6 +23,23 @@ #include #endif +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + /* path_lookup was exported in 2.4.25 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) #define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) diff --git a/open-vm-tools/modules/linux/vmblock/include/compat_sched.h b/open-vm-tools/modules/linux/vmblock/include/compat_sched.h index 6fc79dcfd..460ff5b9e 100644 --- a/open-vm-tools/modules/linux/vmblock/include/compat_sched.h +++ b/open-vm-tools/modules/linux/vmblock/include/compat_sched.h @@ -27,6 +27,11 @@ #define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND #endif +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + /* The capable() API appeared in 2.1.92 --hpreg */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) # define capable(_capability) suser() diff --git a/open-vm-tools/modules/linux/vmblock/include/vm_assert.h b/open-vm-tools/modules/linux/vmblock/include/vm_assert.h index c170ddefd..12b67f3ef 100644 --- a/open-vm-tools/modules/linux/vmblock/include/vm_assert.h +++ b/open-vm-tools/modules/linux/vmblock/include/vm_assert.h @@ -98,8 +98,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/modules/linux/vmblock/include/vm_basic_defs.h b/open-vm-tools/modules/linux/vmblock/include/vm_basic_defs.h index f07223c96..bd264c975 100644 --- a/open-vm-tools/modules/linux/vmblock/include/vm_basic_defs.h +++ b/open-vm-tools/modules/linux/vmblock/include/vm_basic_defs.h @@ -108,6 +108,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -543,14 +545,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/modules/linux/vmblock/include/vm_basic_types.h b/open-vm-tools/modules/linux/vmblock/include/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/linux/vmblock/include/vm_basic_types.h +++ b/open-vm-tools/modules/linux/vmblock/include/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/linux/vmblock/linux/dentry.c b/open-vm-tools/modules/linux/vmblock/linux/dentry.c index a39bb768e..1650e1b96 100644 --- a/open-vm-tools/modules/linux/vmblock/linux/dentry.c +++ b/open-vm-tools/modules/linux/vmblock/linux/dentry.c @@ -112,8 +112,9 @@ DentryOpRevalidate(struct dentry *dentry, // IN: dentry revalidating LOG(4, "DentryOpRevalidate: [%s] no longer exists\n", iinfo->name); return 0; } - ret = actualNd.dentry && actualNd.dentry->d_inode; - path_release(&actualNd); + ret = compat_vmw_nd_to_dentry(actualNd) && + compat_vmw_nd_to_dentry(actualNd)->d_inode; + compat_path_release(&actualNd); LOG(8, "DentryOpRevalidate: [%s] %s revalidated\n", iinfo->name, ret ? "" : "not"); diff --git a/open-vm-tools/modules/linux/vmblock/linux/filesystem.c b/open-vm-tools/modules/linux/vmblock/linux/filesystem.c index fb6d0bf6e..800d8ee97 100644 --- a/open-vm-tools/modules/linux/vmblock/linux/filesystem.c +++ b/open-vm-tools/modules/linux/vmblock/linux/filesystem.c @@ -46,6 +46,7 @@ # define KERNEL_25_FS 1 #endif +static struct inode *GetInode(struct super_block *sb, ino_t ino); /* File system operations */ #if KERNEL_25_FS /* { */ @@ -187,6 +188,38 @@ VMBlockCleanupFileSystem(void) } +/* + *---------------------------------------------------------------------------- + * + * VMBlockReadInode -- + * + * A filesystem wide function that is called to initialize a new inode. + * This is called from two different places depending on the kernel version. + * In older kernels that provide the iget() interface, this function is + * called by the kernel as part of inode initialization (from + * SuperOpReadInode). In newer kernels that call iget_locked(), this + * function is called by filesystem code to initialize the new inode. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +VMBlockReadInode(struct inode *inode) // IN: Inode to initialize +{ + VMBlockInodeInfo *iinfo = INODE_TO_IINFO(inode); + + iinfo->name[0] = '\0'; + iinfo->nameLen = 0; + iinfo->actualDentry = NULL; +} + + /* *---------------------------------------------------------------------------- * @@ -219,6 +252,48 @@ GetNextIno(void) } +/* + *---------------------------------------------------------------------------- + * + * GetInode -- + * + * This function replaces iget() and should be called instead of it. In newer + * kernels that have removed the iget() interface, GetInode() obtains an inode + * and if it is a new one, then initializes the inode by calling + * VMBlockReadInode(). In older kernels that support the iget() interface, + * VMBlockReadInode() is called by iget() internally by the superblock function + * SuperOpReadInode. + * + * Results: + * A new inode object on success, NULL on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static struct inode * +GetInode(struct super_block *sb, // IN: file system superblock object + ino_t ino) // IN: inode number to assign to new inode +{ +#ifdef VMW_USE_IGET_LOCKED + struct inode *inode; + + inode = iget_locked(sb, ino); + if (!inode) { + return NULL; + } else if (inode->i_state & I_NEW) { + VMBlockReadInode(inode); + unlock_new_inode(inode); + } + return inode; +#else + return iget(sb, ino); +#endif +} + + /* *---------------------------------------------------------------------------- * @@ -240,7 +315,7 @@ GetNextIno(void) * then returns the inode to us (this function). * * Note that in older kernels that don't have the alloc_inode operation - * (where VMW_EMBED_INODE is undefined), the allocation is delayed until + * (where VMW_EMBED_INODE is undefined), the allocation is delayed until * this function and is contained within the INODE_TO_IINFO macro. That * allocation is freed in the SuperOpClearInode() function. * @@ -273,7 +348,7 @@ Iget(struct super_block *sb, // IN: file system superblock object ASSERT(sb); - inode = iget(sb, ino); + inode = GetInode(sb, ino); if (!inode) { return NULL; } @@ -301,8 +376,8 @@ Iget(struct super_block *sb, // IN: file system superblock object return inode; } - iinfo->actualDentry = actualNd.dentry; - path_release(&actualNd); + iinfo->actualDentry = compat_vmw_nd_to_dentry(actualNd); + compat_path_release(&actualNd); return inode; diff --git a/open-vm-tools/modules/linux/vmblock/linux/filesystem.h b/open-vm-tools/modules/linux/vmblock/linux/filesystem.h index 697d11266..2f39702d2 100644 --- a/open-vm-tools/modules/linux/vmblock/linux/filesystem.h +++ b/open-vm-tools/modules/linux/vmblock/linux/filesystem.h @@ -95,6 +95,7 @@ struct inode *Iget(struct super_block *sb, struct inode *dir, struct dentry *dentry, ino_t ino); int MakeFullName(struct inode *dir, struct dentry *dentry, char *bufOut, size_t bufOutSize); +void VMBlockReadInode(struct inode *inode); /* Variables */ extern compat_kmem_cache *VMBlockInodeCache; diff --git a/open-vm-tools/modules/linux/vmblock/linux/super.c b/open-vm-tools/modules/linux/vmblock/linux/super.c index 2f2a9aa67..79e2e4a90 100644 --- a/open-vm-tools/modules/linux/vmblock/linux/super.c +++ b/open-vm-tools/modules/linux/vmblock/linux/super.c @@ -37,7 +37,9 @@ static void SuperOpDestroyInode(struct inode *inode); #else static void SuperOpClearInode(struct inode *inode); #endif +#ifndef VMW_USE_IGET_LOCKED static void SuperOpReadInode(struct inode *inode); +#endif #ifdef VMW_STATFS_2618 static int SuperOpStatfs(struct dentry *dentry, struct compat_kstatfs *stat); #else @@ -52,7 +54,9 @@ struct super_operations VMBlockSuperOps = { #else .clear_inode = SuperOpClearInode, #endif +#ifndef VMW_USE_IGET_LOCKED .read_inode = SuperOpReadInode, +#endif .statfs = SuperOpStatfs, }; @@ -122,12 +126,16 @@ SuperOpClearInode(struct inode *inode) // IN: Inode to free } +#ifndef VMW_USE_IGET_LOCKED /* *---------------------------------------------------------------------------- * * SuperOpReadInode -- * - * Performs any filesystem wide inode initialization. + * Performs any filesystem wide inode initialization. This is only called by + * iget() in older kernels that do not support iget_locked(). Newer kernels + * that use the iget_locked() interface are required to initialize the inode + * after it has been returned to the filesystem. * * Results: * None. @@ -141,13 +149,9 @@ SuperOpClearInode(struct inode *inode) // IN: Inode to free static void SuperOpReadInode(struct inode *inode) // IN: Inode to initialize { - VMBlockInodeInfo *iinfo = INODE_TO_IINFO(inode); - - iinfo->name[0] = '\0'; - iinfo->nameLen = 0; - iinfo->actualDentry = NULL; + VMBlockReadInode(inode); } - +#endif /* *---------------------------------------------------------------------------- diff --git a/open-vm-tools/modules/linux/vmblock/linux/vmblock_version.h b/open-vm-tools/modules/linux/vmblock/linux/vmblock_version.h index e93dabc88..765175c68 100644 --- a/open-vm-tools/modules/linux/vmblock/linux/vmblock_version.h +++ b/open-vm-tools/modules/linux/vmblock/linux/vmblock_version.h @@ -25,8 +25,8 @@ #ifndef _VMBLOCK_VERSION_H_ #define _VMBLOCK_VERSION_H_ -#define VMBLOCK_DRIVER_VERSION 1.0.1.1 -#define VMBLOCK_DRIVER_VERSION_COMMAS 1,0,1,1 -#define VMBLOCK_DRIVER_VERSION_STRING "1.0.1.1" +#define VMBLOCK_DRIVER_VERSION 1.1.2.0 +#define VMBLOCK_DRIVER_VERSION_COMMAS 1,1,2,0 +#define VMBLOCK_DRIVER_VERSION_STRING "1.1.2.0" #endif /* _VMBLOCK_VERSION_H_ */ diff --git a/open-vm-tools/modules/linux/vmhgfs/backdoor_def.h b/open-vm-tools/modules/linux/vmhgfs/backdoor_def.h index 0f97efb18..da052ec2b 100644 --- a/open-vm-tools/modules/linux/vmhgfs/backdoor_def.h +++ b/open-vm-tools/modules/linux/vmhgfs/backdoor_def.h @@ -110,7 +110,8 @@ #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 #define BDOOR_CMD_VASSERT 51 -#define BDOOR_CMD_MAX 52 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_MAX 53 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, diff --git a/open-vm-tools/modules/linux/vmhgfs/bdhandler.c b/open-vm-tools/modules/linux/vmhgfs/bdhandler.c index a64f4b9e9..3afbedadf 100644 --- a/open-vm-tools/modules/linux/vmhgfs/bdhandler.c +++ b/open-vm-tools/modules/linux/vmhgfs/bdhandler.c @@ -31,6 +31,7 @@ #include #include "compat_completion.h" #include "compat_kernel.h" +#include "compat_kthread.h" #include "compat_list.h" #include "compat_sched.h" #include "compat_slab.h" @@ -225,11 +226,15 @@ HgfsSendUnsentReqs(void) void HgfsResetOps(void) { + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_3); atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN_V2); atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR_V2); atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR_V2); atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ_V2); atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR_V2); + atomic_set(&hgfsVersionSearchOpen, HGFS_OP_SEARCH_OPEN); + atomic_set(&hgfsVersionCreateSymlink, HGFS_OP_CREATE_SYMLINK); + atomic_set(&hgfsVersionQueryVolumeInfo, HGFS_OP_QUERY_VOLUME_INFO); } @@ -242,6 +247,9 @@ HgfsResetOps(void) * the filesystem half of the driver, send them over the backdoor, * get replies, and send them back to the filesystem. * + * Note that this function is called out of the kthread subsystem or, in + * older kernels, a similar abstraction built in compat_kthread.h. + * * Results: * Always returns zero. * @@ -252,20 +260,18 @@ HgfsResetOps(void) */ int -HgfsBdHandler(void *data) +HgfsBdHandler(void *data) // Ignored { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Thread starting\n")); - compat_daemonize(HGFS_NAME); compat_set_freezable(); for (;;) { - /* Sleep, waiting for a request, a poll time, or exit. */ + /* Sleep, waiting for a request or exit. */ wait_event_interruptible(hgfsReqThreadWait, test_bit(HGFS_REQ_THREAD_SEND, &hgfsReqThreadFlags) || - test_bit(HGFS_REQ_THREAD_EXIT, - &hgfsReqThreadFlags)); + compat_kthread_should_stop()); /* * First, check for suspend. I'm not convinced that this actually @@ -284,7 +290,7 @@ HgfsBdHandler(void *data) } /* Kill yourself. */ - if (test_and_clear_bit(HGFS_REQ_THREAD_EXIT, &hgfsReqThreadFlags)) { + if (compat_kthread_should_stop()) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Told to exit\n")); break; } @@ -293,8 +299,6 @@ HgfsBdHandler(void *data) LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Closing backdoor\n")); HgfsBd_CloseBackdoor(&hgfsRpcOut); - /* Signal our parent that we're exiting, and exit, all at once. */ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Thread exiting\n")); - compat_complete_and_exit(&hgfsReqThreadDone, 0); - NOT_REACHED(); + return 0; } diff --git a/open-vm-tools/modules/linux/vmhgfs/compat_fs.h b/open-vm-tools/modules/linux/vmhgfs/compat_fs.h index d1c083a3d..474a43e86 100644 --- a/open-vm-tools/modules/linux/vmhgfs/compat_fs.h +++ b/open-vm-tools/modules/linux/vmhgfs/compat_fs.h @@ -80,8 +80,8 @@ * * The VFS exports do_sync_read() and do_sync_write() as the "new" * generic_file_read() and generic_file_write(), but filesystems need not - * actually implement read and write- the VFS will automatically call - * do_sync_write() and do_sync_read() when applications invoke the standard + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard * read() and write() system calls. * * In 2.6.19, generic_file_read() and generic_file_write() were removed, @@ -103,6 +103,14 @@ #endif +/* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + /* * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 * implementation. It uses the dcache lock which is OK because per-dentry diff --git a/open-vm-tools/modules/linux/vmhgfs/compat_kernel.h b/open-vm-tools/modules/linux/vmhgfs/compat_kernel.h index 76b47cfad..5d230646b 100644 --- a/open-vm-tools/modules/linux/vmhgfs/compat_kernel.h +++ b/open-vm-tools/modules/linux/vmhgfs/compat_kernel.h @@ -72,5 +72,12 @@ static inline _syscall1(int, compat_exit, int, exit_code); #endif +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif #endif /* __COMPAT_KERNEL_H__ */ diff --git a/open-vm-tools/modules/linux/vmhgfs/compat_kthread.h b/open-vm-tools/modules/linux/vmhgfs/compat_kthread.h new file mode 100644 index 000000000..8977b89e7 --- /dev/null +++ b/open-vm-tools/modules/linux/vmhgfs/compat_kthread.h @@ -0,0 +1,223 @@ +/********************************************************* + * Copyright (C) 2008 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2 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 GNU General Public License + * for more details. + * + * You should have received a copy of the GNU 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 + * + *********************************************************/ + +#ifndef __COMPAT_KTHREAD_H__ +# define __COMPAT_KTHREAD_H__ + +/* + * The kthread interface for managing kernel threads appeared in 2.6.4, but was + * only exported for module use in 2.6.7. + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 7) +# include + +# define COMPAT_KTHREAD_DECLARE_STOP_INFO() +# define compat_kthread_stop(_tsk) kthread_stop(_tsk) +# define compat_kthread_should_stop() kthread_should_stop() +# define compat_kthread_run(_fn, _data, _namefmt, ...) \ + kthread_run(_fn, _data, _namefmt, ## __VA_ARGS__) +# define compat_kthread_create(_fn, _data, _namefmt, ...) \ + kthread_create(_fn, _data, _namefmt, ## __VA_ARGS__) +#else + +/* + * When the kthread interface isn't available, we do our best to emulate it, + * with a few notable exceptions: + * + * 1: We use semaphores instead of mutexes for locking, because mutexes aren't + * available in kernels where kthread isn't available. + * 2: The real kthread interface uses the kthreadd kernel_thread to broker the + * creation of new kernel threads. This makes sense because kthreadd is part + * of the kernel, but doesn't make sense at all in the context of an + * individual module. So in our emulation, thread creation occurs in the + * context of a kthread_create call. + * 3: Because kthreadd is responsible for creating kernel threads in the real + * kthread interface, there's no need to explicitly reparent any of them. We + * aren't using kthreadd, so we call daemonize to reparent, which also sets + * the name of the new kernel thread. That's why we don't set the name as + * the real kthread interface does (within kthread_create). Furthermore, to + * get the name to daemonize, we're forced to pass it through the + * kthread_start_info struct. + * 4: Since our interface isn't in the kernel proper, we can't make use of + * get_task_struct/put_task_struct so as to acquire references to kernel + * threads that we're managing. To prevent races, we use an extra completion + * when stopping kernel threads. See the comments in compat_kthread_stop for + * more details. + * + * Like the real kthread interface, ours must be globally available so that we + * can emulate functions like kthread_should_stop without using different + * signatures. + */ + +# include "compat_completion.h" +# include "compat_kernel.h" +# include "compat_sched.h" + +struct compat_kthread_start_info { + int (*fn)(void *); + void *data; + compat_completion created; + char comm[TASK_COMM_LEN]; +}; + +struct compat_kthread_stop_info { + struct semaphore lock; + struct task_struct *task; + compat_completion woken; + compat_completion stopped; + int ret; +}; + +extern struct compat_kthread_stop_info compat_kthread_stop_info; + +# define COMPAT_KTHREAD_DECLARE_STOP_INFO() \ + struct compat_kthread_stop_info compat_kthread_stop_info = { \ + .lock = __SEMAPHORE_INITIALIZER(compat_kthread_stop_info.lock, 1), \ + .task = NULL, \ + } + + +static inline int +compat_kthread_should_stop(void) +{ + return (compat_kthread_stop_info.task == current); +} + + +static inline int +compat_kthread_stop(struct task_struct *_task) +{ + int ret; + + down(&compat_kthread_stop_info.lock); + + /* + * We use a write memory barrier to ensure that all CPUs see _task after + * the completions have been initialized. + * + * There's a race between kernel threads managed by kthread and the upcoming + * call to wake_up_process. If the kernel thread wakes up after we set task + * but before the call to wake_up_process, the thread's call to + * compat_kthread_should_stop will return true and the thread will exit. At + * that point, the call to wake_up_process will be on a dead task_struct. + * + * XXX: The real kthread interface protects against this race by grabbing + * and releasing a reference to _task. We don't have that luxury, because + * there is a range of kernels where put_task_struct isn't exported to + * modules. In fact, no other modules call get_task_struct or + * put_task_struct, so to do so from this context may be unwise. Instead, + * we'll use an extra completion to ensure that the kernel thread only exits + * after wake_up_process has been called. + */ + compat_init_completion(&compat_kthread_stop_info.woken); + compat_init_completion(&compat_kthread_stop_info.stopped); + smp_wmb(); + + compat_kthread_stop_info.task = _task; + wake_up_process(_task); + compat_complete(&compat_kthread_stop_info.woken); + + compat_wait_for_completion(&compat_kthread_stop_info.stopped); + compat_kthread_stop_info.task = NULL; + ret = compat_kthread_stop_info.ret; + up(&compat_kthread_stop_info.lock); + return ret; +} + + +# define compat_kthread_run(_fn, _data, _namefmt, ...) \ +({ \ + struct task_struct *tsk; \ + tsk = compat_kthread_create(_fn, _data, _namefmt, ## __VA_ARGS__); \ + if (!IS_ERR(tsk)) { \ + wake_up_process(tsk); \ + } \ + tsk; \ +}) + + +static inline int +compat_kthread(void *_data) +{ + int ret = -EINTR; + struct compat_kthread_start_info *info; + int (*fn)(void *data); + void *data; + + info = (struct compat_kthread_start_info *)_data; + fn = info->fn; + data = info->data; + + compat_daemonize(info->comm); + __set_current_state(TASK_UNINTERRUPTIBLE); + compat_complete(&info->created); + schedule(); + + if (!compat_kthread_should_stop()) { + ret = fn(data); + } + + if (compat_kthread_should_stop()) { + compat_wait_for_completion(&compat_kthread_stop_info.woken); + compat_kthread_stop_info.ret = ret; + compat_complete_and_exit(&compat_kthread_stop_info.stopped, 0); + BUG(); + } + return 0; +} + + +static inline struct task_struct * +compat_kthread_create(int (*_fn)(void *data), + void *_data, + const char _namefmt[], + ...) +{ + pid_t pid; + struct task_struct *task = NULL; + struct compat_kthread_start_info info; + va_list args; + + info.fn = _fn; + info.data = _data; + compat_init_completion(&info.created); + va_start(args, _namefmt); + vsnprintf(info.comm, sizeof info.comm, _namefmt, args); + va_end(args); + pid = kernel_thread(compat_kthread, &info, CLONE_KERNEL); + if (pid >= 0) { + compat_wait_for_completion(&info.created); + + /* + * find_task_by_pid must be called with tasklist_lock held or under + * rcu_read_lock. As the latter doesn't exist in old kernels, we use the + * former for convenience. + */ + read_lock(&tasklist_lock); + task = find_task_by_pid(pid); + read_unlock(&tasklist_lock); + + /* XXX: Do we need to get a reference on task? */ + } + return task; +} + +#endif + +#endif /* __COMPAT_KTHREAD_H__ */ diff --git a/open-vm-tools/modules/linux/vmhgfs/compat_namei.h b/open-vm-tools/modules/linux/vmhgfs/compat_namei.h index a3176f524..28d72c8e1 100644 --- a/open-vm-tools/modules/linux/vmhgfs/compat_namei.h +++ b/open-vm-tools/modules/linux/vmhgfs/compat_namei.h @@ -23,6 +23,23 @@ #include #endif +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + /* path_lookup was exported in 2.4.25 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) #define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) diff --git a/open-vm-tools/modules/linux/vmhgfs/compat_sched.h b/open-vm-tools/modules/linux/vmhgfs/compat_sched.h index 6fc79dcfd..460ff5b9e 100644 --- a/open-vm-tools/modules/linux/vmhgfs/compat_sched.h +++ b/open-vm-tools/modules/linux/vmhgfs/compat_sched.h @@ -27,6 +27,11 @@ #define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND #endif +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + /* The capable() API appeared in 2.1.92 --hpreg */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) # define capable(_capability) suser() diff --git a/open-vm-tools/modules/linux/vmhgfs/dir.c b/open-vm-tools/modules/linux/vmhgfs/dir.c index 174958a39..668996140 100644 --- a/open-vm-tools/modules/linux/vmhgfs/dir.c +++ b/open-vm-tools/modules/linux/vmhgfs/dir.c @@ -48,6 +48,10 @@ static int HgfsGetNextDirEntry(HgfsSuperInfo *si, uint32 offset, HgfsAttrInfo *attr, Bool *done); +static int HgfsPackDirOpenRequest(struct inode *inode, + struct file *file, + HgfsOp opUsed, + HgfsReq *req); /* HGFS file operations for directories. */ static int HgfsDirOpen(struct inode *inode, @@ -95,9 +99,8 @@ static int HgfsUnpackSearchReadReply(HgfsReq *req, // IN: Reply packet HgfsAttrInfo *attr) // IN/OUT: Attributes { - HgfsReplySearchReadV2 *replyV2; - HgfsReplySearchRead *replyV1; - HgfsFileName *fileNameP; + char *fileName; + uint32 fileNameLength; uint32 replySize; int result; @@ -110,16 +113,36 @@ HgfsUnpackSearchReadReply(HgfsReq *req, // IN: Reply packet } switch(attr->requestType) { - case HGFS_OP_SEARCH_READ_V2: + case HGFS_OP_SEARCH_READ_V3: { + HgfsReplySearchReadV3 *replyV3; + HgfsDirEntry *dirent; + + replyV3 = (HgfsReplySearchReadV3 *)(HGFS_REP_PAYLOAD_V3(req)); + replySize = sizeof *replyV3 + sizeof(struct HgfsReply) + + sizeof(struct HgfsDirEntry); + dirent = (HgfsDirEntry *)replyV3->payload; + fileName = dirent->fileName.name; + fileNameLength = dirent->fileName.length; + break; + } + case HGFS_OP_SEARCH_READ_V2: { + HgfsReplySearchReadV2 *replyV2; + replyV2 = (HgfsReplySearchReadV2 *)(HGFS_REQ_PAYLOAD(req)); replySize = sizeof *replyV2; - fileNameP = &replyV2->fileName; + fileName = replyV2->fileName.name; + fileNameLength = replyV2->fileName.length; break; - case HGFS_OP_SEARCH_READ: + } + case HGFS_OP_SEARCH_READ: { + HgfsReplySearchRead *replyV1; + replyV1 = (HgfsReplySearchRead *)(HGFS_REQ_PAYLOAD(req)); replySize = sizeof *replyV1; - fileNameP = &replyV1->fileName; + fileName = replyV1->fileName.name; + fileNameLength = replyV1->fileName.length; break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackSearchReadReply: unexpected " "OP type encountered\n")); @@ -129,8 +152,8 @@ HgfsUnpackSearchReadReply(HgfsReq *req, // IN: Reply packet /* * Make sure name length is legal. */ - if (fileNameP->length > NAME_MAX || - fileNameP->length > HGFS_PACKET_MAX - replySize) { + if (fileNameLength > NAME_MAX || + fileNameLength > HGFS_PACKET_MAX - replySize) { return -ENAMETOOLONG; } @@ -142,21 +165,21 @@ HgfsUnpackSearchReadReply(HgfsReq *req, // IN: Reply packet * bounded by NAME_MAX. Perhaps I should just put a statically-sized * array in HgfsAttrInfo and use a slab allocator to allocate the struct. */ - if (fileNameP->length > 0) { + if (fileNameLength > 0) { /* Sanity check on name length. */ - if (fileNameP->length != strlen(fileNameP->name)) { + if (fileNameLength != strlen(fileName)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackSearchReadReply: name " "length mismatch %u/%Zu, name \"%s\"\n", - fileNameP->length, strlen(fileNameP->name), fileNameP->name)); + fileNameLength, strlen(fileName), fileName)); return -EPROTO; } - attr->fileName = kmalloc(fileNameP->length + 1, GFP_KERNEL); + attr->fileName = kmalloc(fileNameLength + 1, GFP_KERNEL); if (attr->fileName == NULL) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackSearchReadReply: out of " "memory allocating filename, ignoring\n")); return -ENOMEM; } - memcpy(attr->fileName, fileNameP->name, fileNameP->length + 1); + memcpy(attr->fileName, fileName, fileNameLength + 1); } else { attr->fileName = NULL; } @@ -192,8 +215,8 @@ HgfsGetNextDirEntry(HgfsSuperInfo *si, // IN: Superinfo for this SB // no more dentries { HgfsReq *req; - HgfsRequestSearchRead *request; - HgfsReply *replyHeader; + HgfsOp opUsed; + HgfsStatus replyStatus; int result = 0; ASSERT(si); @@ -207,23 +230,41 @@ HgfsGetNextDirEntry(HgfsSuperInfo *si, // IN: Superinfo for this SB return -ENOMEM; } - request = (HgfsRequestSearchRead *)(HGFS_REQ_PAYLOAD(req)); - retry: - /* Fill out the request's fields. */ - request->header.op = attr->requestType = - atomic_read(&hgfsVersionSearchRead); - request->header.id = req->id; - request->search = searchHandle; - request->offset = offset; - req->payloadSize = sizeof *request; + opUsed = atomic_read(&hgfsVersionSearchRead); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_SEARCH_READ_V3; + } + + if (opUsed == HGFS_OP_SEARCH_READ_V3) { + HgfsRequest *header; + HgfsRequestSearchReadV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->op = attr->requestType = opUsed; + header->id = req->id; + + request = (HgfsRequestSearchReadV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->search = searchHandle; + request->offset = offset; + req->payloadSize = sizeof *request + sizeof *header; + } else { + HgfsRequestSearchRead *request; + + request = (HgfsRequestSearchRead *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = attr->requestType = opUsed; + request->header.id = req->id; + request->search = searchHandle; + request->offset = offset; + req->payloadSize = sizeof *request; + } /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetNextDirEntry: got reply\n")); - replyHeader = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(replyHeader->status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); switch(result) { case 0: @@ -238,10 +279,17 @@ HgfsGetNextDirEntry(HgfsSuperInfo *si, // IN: Superinfo for this SB case -EPROTO: /* Retry with Version 1 of SearchRead. Set globally. */ - if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { + if (attr->requestType == HGFS_OP_SEARCH_READ_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsGetNextDirEntry: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ_V2); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } else if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsGetNextDirEntry: Version 2 " "not supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); goto retry; } @@ -263,6 +311,103 @@ HgfsGetNextDirEntry(HgfsSuperInfo *si, // IN: Superinfo for this SB return result; } +/* + *---------------------------------------------------------------------- + * + * HgfsPackDirOpenRequest -- + * + * Setup the directory open request, depending on the op version. + * + * Results: + * Returns zero on success, or negative error on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static int +HgfsPackDirOpenRequest(struct inode *inode, // IN: Inode of the file to open + struct file *file, // IN: File pointer for this open + HgfsOp opUsed, // IN: Op to be used + HgfsReq *req) // IN/OUT: Packet to write into +{ + char *name; + uint32 *nameLength; + size_t requestSize; + int result; + + ASSERT(inode); + ASSERT(file); + ASSERT(req); + + switch (opUsed) { + case HGFS_OP_SEARCH_OPEN_V3: { + HgfsRequest *requestHeader; + HgfsRequestSearchOpenV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestSearchOpenV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* We'll use these later. */ + name = requestV3->dirName.name; + nameLength = &requestV3->dirName.length; + requestV3->dirName.flags = HGFS_FILE_NAME_CASE_SENSITIVE; + requestSize = sizeof *requestV3 + sizeof *requestHeader; + break; + } + + case HGFS_OP_SEARCH_OPEN: { + HgfsRequestSearchOpen *request; + + request = (HgfsRequestSearchOpen *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; + + /* We'll use these later. */ + name = request->dirName.name; + nameLength = &request->dirName.length; + requestSize = sizeof *request; + break; + } + + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: unexpected " + "OP type encountered\n")); + return -EPROTO; + } + + /* Build full name to send to server. */ + if (HgfsBuildPath(name, HGFS_PACKET_MAX - (requestSize - 1), + file->f_dentry) < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: build path failed\n")); + return -EINVAL; + } + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: opening \"%s\"\n", + name)); + + /* Convert to CP name. */ + result = CPName_ConvertTo(name, + HGFS_PACKET_MAX - (requestSize - 1), + name); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: CP conversion failed\n")); + return -EINVAL; + } + + /* Unescape the CP name. */ + result = HgfsUnescapeBuffer(name, result); + *nameLength = (uint32) result; + req->payloadSize = requestSize + result; + + return 0; +} + + /* * HGFS file operations for directories. */ @@ -292,18 +437,16 @@ static int HgfsDirOpen(struct inode *inode, // IN: Inode of the dir to open struct file *file) // IN: File pointer for this open { - HgfsSuperInfo *si; HgfsReq *req; - HgfsRequestSearchOpen *request; - HgfsReplySearchOpen *reply; int result; + HgfsOp opUsed; + HgfsStatus replyStatus; + HgfsHandle *replySearch; ASSERT(inode); ASSERT(inode->i_sb); ASSERT(file); - si = HGFS_SB_TO_COMMON(inode->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: out of memory while " @@ -312,62 +455,50 @@ HgfsDirOpen(struct inode *inode, // IN: Inode of the dir to open goto out; } - request = (HgfsRequestSearchOpen *)(HGFS_REQ_PAYLOAD(req)); - - /* Fill out the request's fields. */ - request->header.id = req->id; - request->header.op = HGFS_OP_SEARCH_OPEN; - - /* Build full name to send to server. */ - if (HgfsBuildPath(request->dirName.name, HGFS_NAME_BUFFER_SIZE(request), - file->f_dentry) < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: build path failed\n")); - result = -EINVAL; - goto out; + retry: + opUsed = atomic_read(&hgfsVersionSearchOpen); + replySearch = &((HgfsReplySearchOpen *)HGFS_REQ_PAYLOAD(req))->search; + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_SEARCH_OPEN_V3; + replySearch = &((HgfsReplySearchOpenV3 *)HGFS_REQ_PAYLOAD_V3(req))->search; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: opening \"%s\"\n", - request->dirName.name)); - - /* Convert to CP name. */ - result = CPName_ConvertTo(request->dirName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->dirName.name); - if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: CP conversion failed\n")); - result = -EINVAL; + + result = HgfsPackDirOpenRequest(inode, file, opUsed, req); + if (result != 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: error packing request\n")); goto out; } - /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(request->dirName.name, result); - request->dirName.length = result; - req->payloadSize = sizeof *request + result; - /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply and check return status. */ - reply = (HgfsReplySearchOpen *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* - * If status != success, the payloadSize will be smaller, - * so this test only applies in the success case. [bac] - */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: wrong " - "packet size\n")); - result = -EPROTO; - goto out; + result = HgfsCreateFileInfo(file, *replySearch); + switch (result) { + case 0: + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: set handle to %u\n", + *replySearch)); + break; + case -EPROTO: + /* Retry with Version 1 of SearchOpen. Set globally. */ + if (opUsed == HGFS_OP_SEARCH_OPEN_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionSearchOpen, HGFS_OP_SEARCH_OPEN); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } + break; + + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: server " + "returned error: %d\n", result)); + break; } - - result = HgfsCreateFileInfo(file, reply->search); - if (result) { - goto out; - } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: set handle to %u\n", - reply->search)); } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: timed out\n")); @@ -649,11 +780,10 @@ static int HgfsDirRelease(struct inode *inode, // IN: Inode that the file* points to struct file *file) // IN: File for the dir getting released { - HgfsSuperInfo *si; HgfsReq *req; - HgfsRequestSearchClose *request; - HgfsReplySearchClose *reply; + HgfsStatus replyStatus; HgfsHandle handle; + HgfsOp opUsed; int result = 0; ASSERT(inode); @@ -665,7 +795,6 @@ HgfsDirRelease(struct inode *inode, // IN: Inode that the file* points to LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: close fh %u\n", handle)); HgfsReleaseFileInfo(file); - si = HGFS_SB_TO_COMMON(file->f_dentry->d_sb); req = HgfsGetNewRequest(); if (!req) { @@ -675,25 +804,53 @@ HgfsDirRelease(struct inode *inode, // IN: Inode that the file* points to goto out; } - /* Fill in the request's fields. */ - request = (HgfsRequestSearchClose *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_SEARCH_CLOSE; - request->search = handle; - req->payloadSize = sizeof *request; + retry: + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + HgfsRequestSearchCloseV3 *request; + HgfsRequest *header; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed = HGFS_OP_SEARCH_CLOSE_V3; + + request = (HgfsRequestSearchCloseV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->search = handle; + req->payloadSize = sizeof *request + sizeof *header; + } else { + HgfsRequestSearchClose *request; + + request = (HgfsRequestSearchClose *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed = HGFS_OP_SEARCH_CLOSE; + request->search = handle; + req->payloadSize = sizeof *request; + } /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplySearchClose *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - if (result == 0) { + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + switch (result) { + case 0: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: release handle %u\n", handle)); - } else { + break; + case -EPROTO: + /* Retry with Version 2 of Open. Set globally. */ + if (opUsed == HGFS_OP_SEARCH_CLOSE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } + break; + default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: failed handle %u\n", handle)); + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: timed out\n")); diff --git a/open-vm-tools/modules/linux/vmhgfs/file.c b/open-vm-tools/modules/linux/vmhgfs/file.c index ad6d11b81..e43aa7506 100644 --- a/open-vm-tools/modules/linux/vmhgfs/file.c +++ b/open-vm-tools/modules/linux/vmhgfs/file.c @@ -43,6 +43,7 @@ /* Private functions. */ static int HgfsPackOpenRequest(struct inode *inode, struct file *file, + HgfsOp opUsed, HgfsReq *req); static int HgfsUnpackOpenReply(HgfsReq *req, HgfsOp opUsed, @@ -125,6 +126,16 @@ struct file_operations HgfsFileFileOperations = { #endif }; +/* File open mask. */ +#define HGFS_FILE_OPEN_MASK (HGFS_OPEN_VALID_MODE | \ + HGFS_OPEN_VALID_FLAGS | \ + HGFS_OPEN_VALID_SPECIAL_PERMS | \ + HGFS_OPEN_VALID_OWNER_PERMS | \ + HGFS_OPEN_VALID_GROUP_PERMS | \ + HGFS_OPEN_VALID_OTHER_PERMS | \ + HGFS_OPEN_VALID_FILE_NAME | \ + HGFS_OPEN_VALID_SERVER_LOCK) + /* * Private functions. @@ -149,12 +160,11 @@ struct file_operations HgfsFileFileOperations = { static int HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open struct file *file, // IN: File pointer for this open + HgfsOp opUsed, // IN: Op to use HgfsReq *req) // IN/OUT: Packet to write into { - HgfsRequest *requestHeader; - HgfsRequestOpenV2 *requestV2; - HgfsRequestOpen *request; - HgfsFileName *fileNameP; + char *name; + uint32 *nameLength; size_t requestSize; int result; @@ -162,20 +172,71 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open ASSERT(file); ASSERT(req); - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + switch (opUsed) { + case HGFS_OP_OPEN_V3: { + HgfsRequest *requestHeader; + HgfsRequestOpenV3 *requestV3; - switch (requestHeader->op) { - case HGFS_OP_OPEN_V2: - requestV2 = (HgfsRequestOpenV2 *)(HGFS_REQ_PAYLOAD(req)); + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestOpenV3 *)HGFS_REQ_PAYLOAD_V3(req); + requestSize = sizeof *requestV3 + sizeof *requestHeader; /* We'll use these later. */ - fileNameP = &requestV2->fileName; + name = requestV3->fileName.name; + nameLength = &requestV3->fileName.length; + + requestV3->mask = HGFS_FILE_OPEN_MASK; + + /* Linux clients need case-sensitive lookups. */ + requestV3->fileName.flags = HGFS_FILE_NAME_CASE_SENSITIVE; + requestV3->fileName.fid = 0; + + /* Set mode. */ + result = HgfsGetOpenMode(file->f_flags); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: failed to get " + "open mode\n")); + return -EINVAL; + } + requestV3->mode = result; + + /* Set flags. */ + result = HgfsGetOpenFlags(file->f_flags); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: failed to get " + "open flags\n")); + return -EINVAL; + } + requestV3->flags = result; + + /* Set permissions. */ + requestV3->specialPerms = (inode->i_mode & (S_ISUID | S_ISGID | S_ISVTX)) + >> 9; + requestV3->ownerPerms = (inode->i_mode & S_IRWXU) >> 6; + requestV3->groupPerms = (inode->i_mode & S_IRWXG) >> 3; + requestV3->otherPerms = (inode->i_mode & S_IRWXO); + + /* XXX: Request no lock for now. */ + requestV3->desiredLock = HGFS_LOCK_NONE; + break; + } + + case HGFS_OP_OPEN_V2: { + HgfsRequestOpenV2 *requestV2; + + requestV2 = (HgfsRequestOpenV2 *)(HGFS_REQ_PAYLOAD(req)); + requestV2->header.op = opUsed; + requestV2->header.id = req->id; + + /* We'll use these later. */ + name = requestV2->fileName.name; + nameLength = &requestV2->fileName.length; requestSize = sizeof *requestV2; - requestV2->mask = HGFS_OPEN_VALID_MODE | HGFS_OPEN_VALID_FLAGS | - HGFS_OPEN_VALID_SPECIAL_PERMS | HGFS_OPEN_VALID_OWNER_PERMS | - HGFS_OPEN_VALID_GROUP_PERMS | HGFS_OPEN_VALID_OTHER_PERMS | - HGFS_OPEN_VALID_FILE_NAME | HGFS_OPEN_VALID_SERVER_LOCK; + requestV2->mask = HGFS_FILE_OPEN_MASK; /* Set mode. */ result = HgfsGetOpenMode(file->f_flags); @@ -205,11 +266,17 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open /* XXX: Request no lock for now. */ requestV2->desiredLock = HGFS_LOCK_NONE; break; - case HGFS_OP_OPEN: + } + case HGFS_OP_OPEN: { + HgfsRequestOpen *request; + request = (HgfsRequestOpen *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; /* We'll use these later. */ - fileNameP = &request->fileName; + name = request->fileName.name; + nameLength = &request->fileName.length; requestSize = sizeof *request; /* Set mode. */ @@ -233,6 +300,7 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open /* Set permissions. */ request->permissions = (inode->i_mode & S_IRWXU) >> 6; break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: unexpected " "OP type encountered\n")); @@ -240,7 +308,7 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open } /* Build full name to send to server. */ - if (HgfsBuildPath(fileNameP->name, + if (HgfsBuildPath(name, HGFS_PACKET_MAX - (requestSize - 1), file->f_dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: build path " @@ -248,13 +316,13 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open return -EINVAL; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: opening \"%s\", " - "flags %o, create perms %o\n", fileNameP->name, + "flags %o, create perms %o\n", name, file->f_flags, file->f_mode)); /* Convert to CP name. */ - result = CPName_ConvertTo(fileNameP->name, + result = CPName_ConvertTo(name, HGFS_PACKET_MAX - (requestSize - 1), - fileNameP->name); + name); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: CP conversion " "failed\n")); @@ -262,8 +330,8 @@ HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileNameP->name, result); - fileNameP->length = result; + result = HgfsUnescapeBuffer(name, result); + *nameLength = (uint32) result; req->payloadSize = requestSize + result; return 0; @@ -302,6 +370,7 @@ HgfsUnpackOpenReply(HgfsReq *req, // IN: Packet with reply inside ASSERT(lock); switch (opUsed) { + case HGFS_OP_OPEN_V3: case HGFS_OP_OPEN_V2: replyV2 = (HgfsReplyOpenV2 *)(HGFS_REQ_PAYLOAD(req)); replySize = sizeof *replyV2; @@ -456,8 +525,7 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open HgfsSuperInfo *si; HgfsReq *req; HgfsOp opUsed; - HgfsRequest *requestHeader; - HgfsReply *replyHeader; + HgfsStatus replyStatus; HgfsHandle replyFile; HgfsServerLock replyLock; HgfsInodeInfo *iinfo; @@ -480,17 +548,18 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open goto out; } - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - retry: /* * Set up pointers using the proper struct This lets us check the * version exactly once and use the pointers later. */ - requestHeader->op = opUsed = atomic_read(&hgfsVersionOpen); - requestHeader->id = req->id; - result = HgfsPackOpenRequest(inode, file, req); + opUsed = atomic_read(&hgfsVersionOpen); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_OPEN_V3; + } + + result = HgfsPackOpenRequest(inode, file, opUsed, req); if (result != 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: error packing request\n")); goto out; @@ -500,8 +569,8 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open result = HgfsSendRequest(req); if (result == 0) { /* Get the reply and check return status. */ - replyHeader = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(replyHeader->status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); switch (result) { case 0: @@ -567,10 +636,20 @@ HgfsOpen(struct inode *inode, // IN: Inode of the file to open break; case -EPROTO: + /* Retry with Version 2 of Open. Set globally. */ + if (opUsed == HGFS_OP_OPEN_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: Version 3 not " + "supported. Falling back to version 2.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN_V2); + goto retry; + } + /* Retry with Version 1 of Open. Set globally. */ if (opUsed == HGFS_OP_OPEN_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: Version 2 not " "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN); goto retry; } @@ -921,9 +1000,9 @@ HgfsRelease(struct inode *inode, // IN: Inode that this file points to { HgfsSuperInfo *si; HgfsReq *req; - HgfsRequestClose *request; - HgfsReplyClose *reply; HgfsHandle handle; + HgfsOp opUsed; + HgfsStatus replyStatus; int result = 0; ASSERT(inode); @@ -951,25 +1030,53 @@ HgfsRelease(struct inode *inode, // IN: Inode that this file points to goto out; } - /* Fill in the request's fields. */ - request = (HgfsRequestClose *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_CLOSE; - request->file = handle; - req->payloadSize = sizeof *request; + retry: + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + HgfsRequest *header; + HgfsRequestCloseV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed = HGFS_OP_CLOSE_V3; + + request = (HgfsRequestCloseV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->file = handle; + req->payloadSize = sizeof *request + sizeof *header; + } else { + HgfsRequestClose *request; + + request = (HgfsRequestClose *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed = HGFS_OP_CLOSE; + request->file = handle; + req->payloadSize = sizeof *request; + } /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplyClose *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - if (result == 0) { + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + switch (result) { + case 0: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: released handle %u\n", handle)); - } else { + break; + case -EPROTO: + /* Retry with Version 2 of Open. Set globally. */ + if (opUsed == HGFS_OP_CLOSE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } + break; + default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: failed handle %u\n", handle)); + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: timed out\n")); diff --git a/open-vm-tools/modules/linux/vmhgfs/filesystem.c b/open-vm-tools/modules/linux/vmhgfs/filesystem.c index 1e7382974..3b547f99e 100644 --- a/open-vm-tools/modules/linux/vmhgfs/filesystem.c +++ b/open-vm-tools/modules/linux/vmhgfs/filesystem.c @@ -36,6 +36,7 @@ #include "compat_dcache.h" #include "compat_fs.h" #include "compat_kernel.h" +#include "compat_kthread.h" #include "compat_sched.h" #include "compat_slab.h" #include "compat_spinlock.h" @@ -71,7 +72,8 @@ spinlock_t hgfsBigLock = SPIN_LOCK_UNLOCKED; long hgfsReqThreadFlags; wait_queue_head_t hgfsReqThreadWait; -compat_completion hgfsReqThreadDone; +struct task_struct *hgfsReqThread; +COMPAT_KTHREAD_DECLARE_STOP_INFO(); /* Other variables. */ compat_kmem_cache *hgfsReqCache = NULL; @@ -79,11 +81,18 @@ compat_kmem_cache *hgfsInodeCache = NULL; RpcOut *hgfsRpcOut = NULL; unsigned int hgfsIdCounter = 0; struct list_head hgfsReqsUnsent; + +/* Global protocol version switch. */ +atomic_t hgfsProtocolVersion; + atomic_t hgfsVersionOpen; atomic_t hgfsVersionGetattr; atomic_t hgfsVersionSetattr; atomic_t hgfsVersionSearchRead; atomic_t hgfsVersionCreateDir; +atomic_t hgfsVersionSearchOpen; +atomic_t hgfsVersionCreateSymlink; +atomic_t hgfsVersionQueryVolumeInfo; /* Private functions. */ static inline unsigned long HgfsComputeBlockBits(unsigned long blockSize); @@ -581,12 +590,11 @@ Bool HgfsInitFileSystem(void) { Bool success = FALSE; - pid_t pid = 0; /* Initialize primitives. */ INIT_LIST_HEAD(&hgfsReqsUnsent); init_waitqueue_head(&hgfsReqThreadWait); - compat_init_completion(&hgfsReqThreadDone); + hgfsReqThread = NULL; hgfsReqThreadFlags = 0; HgfsResetOps(); @@ -613,8 +621,8 @@ HgfsInitFileSystem(void) } /* Create backdoor handler. */ - pid = kernel_thread(HgfsBdHandler, NULL, CLONE_KERNEL); - if (pid < 0) { + hgfsReqThread = compat_kthread_run(HgfsBdHandler, NULL, HGFS_NAME); + if (IS_ERR(hgfsReqThread)) { printk(KERN_WARNING "VMware hgfs: failed to create kernel thread\n"); goto exit; } @@ -637,10 +645,8 @@ HgfsInitFileSystem(void) /* Cleanup if an error occurred. */ if (success == FALSE) { - if (pid > 0) { - set_bit(HGFS_REQ_THREAD_EXIT, &hgfsReqThreadFlags); - wake_up_interruptible(&hgfsReqThreadWait); - compat_wait_for_completion(&hgfsReqThreadDone); + if (!IS_ERR(hgfsReqThread)) { + compat_kthread_stop(hgfsReqThread); } if (hgfsInodeCache != NULL) { kmem_cache_destroy(hgfsInodeCache); @@ -692,9 +698,7 @@ HgfsCleanupFileSystem(void) } /* Kill the backdoor handler thread. */ - set_bit(HGFS_REQ_THREAD_EXIT, &hgfsReqThreadFlags); - wake_up_interruptible(&hgfsReqThreadWait); - compat_wait_for_completion(&hgfsReqThreadDone); + compat_kthread_stop(hgfsReqThread); /* Destroy the inode and request slabs. */ kmem_cache_destroy(hgfsInodeCache); diff --git a/open-vm-tools/modules/linux/vmhgfs/fsutil.c b/open-vm-tools/modules/linux/vmhgfs/fsutil.c index 5c9432df6..acb72d74f 100644 --- a/open-vm-tools/modules/linux/vmhgfs/fsutil.c +++ b/open-vm-tools/modules/linux/vmhgfs/fsutil.c @@ -57,8 +57,9 @@ static int HgfsUnpackGetattrReply(HgfsReq *req, HgfsAttrInfo *attr); static int HgfsPackGetattrRequest(HgfsReq *req, struct dentry *dentry, - HgfsAttrInfo *attr, - Bool allowHandleReuse); + Bool allowHandleReuse, + HgfsOp opUsed, + HgfsAttrInfo *attr); /* * Private function implementations. @@ -89,11 +90,11 @@ HgfsInodeLookup(struct super_block *sb, // IN: Superblock of this fs { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 42) return ilookup(sb, ino); -#else +#else struct inode *inode; HgfsInodeInfo *iinfo; - /* + /* * Note that returning NULL in both of these cases will make the * caller think that no such inode exists, which is correct. In the first * case, we failed to allocate an inode inside iget(), meaning the inode @@ -101,18 +102,18 @@ HgfsInodeLookup(struct super_block *sb, // IN: Superblock of this fs * inode got marked bad inside read_inode, also indicative of a new inode * allocation. */ - inode = iget(sb, ino); + inode = HgfsGetInode(sb, ino); if (inode == NULL) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsInodeLookup: iget ran out of " "memory and returned NULL\n")); - return NULL; - } + return NULL; + } if (is_bad_inode(inode)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsInodeLookup: inode marked bad\n")); goto iput_and_exit; } - /* + /* * Our read_inode function should guarantee that if we're here, iinfo should * have been allocated already. */ @@ -123,8 +124,8 @@ HgfsInodeLookup(struct super_block *sb, // IN: Superblock of this fs "bailing out\n")); goto iput_and_exit; } - - /* + + /* * It's HGFS's job to make sure this is set to TRUE in all inodes on which * we hold a reference. If it is set to TRUE, we return the inode, just as * ilookup() does. @@ -137,7 +138,7 @@ HgfsInodeLookup(struct super_block *sb, // IN: Superblock of this fs if (iinfo->isReferencedInode) { goto exit; } - + iput_and_exit: iput(inode); inode = NULL; @@ -231,6 +232,8 @@ HgfsUnpackGetattrReply(HgfsReq *req, // IN: Reply packet HgfsAttrInfo *attr) // IN/OUT: Attributes { int result; + char *name = NULL; + uint32 length = 0; ASSERT(req); ASSERT(attr); @@ -240,33 +243,48 @@ HgfsUnpackGetattrReply(HgfsReq *req, // IN: Reply packet return result; } - /* GetattrV2 also wants a symlink target if it exists. */ - if (attr->requestType == HGFS_OP_GETATTR_V2) { + /* GetattrV2+ also wants a symlink target if it exists. */ + if (attr->requestType == HGFS_OP_GETATTR_V3) { + HgfsReplyGetattrV3 *replyV3 = (HgfsReplyGetattrV3 *) + (HGFS_REP_PAYLOAD_V3(req)); + name = replyV3->symlinkTarget.name; + length = replyV3->symlinkTarget.length; + + /* Skip the symlinkTarget if it's too long. */ + if (length > HGFS_NAME_BUFFER_SIZET(sizeof *replyV3 + sizeof(HgfsReply))) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: symlink " + "target name too long, ignoring\n")); + return -ENAMETOOLONG; + } + } else if (attr->requestType == HGFS_OP_GETATTR_V2) { HgfsReplyGetattrV2 *replyV2 = (HgfsReplyGetattrV2 *) (HGFS_REQ_PAYLOAD(req)); - uint32 length = replyV2->symlinkTarget.length; - if (length != 0) { - - /* Skip the symlinkTarget if it's too long. */ - if (length > HGFS_NAME_BUFFER_SIZE(replyV2)) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: symlink " - "target name too long, ignoring\n")); - return -ENAMETOOLONG; - } - attr->fileName = kmalloc(length + 1, GFP_KERNEL); - if (attr->fileName == NULL) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: out of " - "memory allocating symlink target name, ignoring\n")); - return -ENOMEM; - } - - /* Copy and convert. From now on, the symlink target is in UTF8. */ - memcpy(attr->fileName, replyV2->symlinkTarget.name, length); - CPNameLite_ConvertFrom(attr->fileName, length, '/'); - attr->fileName[length] = '\0'; + name = replyV2->symlinkTarget.name; + length = replyV2->symlinkTarget.length; + + /* Skip the symlinkTarget if it's too long. */ + if (length > HGFS_NAME_BUFFER_SIZE(replyV2)) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: symlink " + "target name too long, ignoring\n")); + return -ENAMETOOLONG; } } + if (length != 0) { + + attr->fileName = kmalloc(length + 1, GFP_KERNEL); + if (attr->fileName == NULL) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: out of " + "memory allocating symlink target name, ignoring\n")); + return -ENOMEM; + } + + /* Copy and convert. From now on, the symlink target is in UTF8. */ + memcpy(attr->fileName, name, length); + CPNameLite_ConvertFrom(attr->fileName, length, '/'); + attr->fileName[length] = '\0'; + } + return 0; } @@ -280,7 +298,7 @@ HgfsUnpackGetattrReply(HgfsReq *req, // IN: Reply packet * we will issue the getattr using an existing open HGFS handle. * * Results: - * Returns zero on success, or negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -291,56 +309,100 @@ HgfsUnpackGetattrReply(HgfsReq *req, // IN: Reply packet static int HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer struct dentry *dentry, // IN: Dentry containing name - HgfsAttrInfo *attr, // OUT: Attrs to update - Bool allowHandleReuse) // IN: Can we use a handle? + Bool allowHandleReuse, // IN: Can we use a handle? + HgfsOp opUsed, // IN: Op to be used + HgfsAttrInfo *attr) // OUT: Attrs to update { - HgfsRequest *requestHeader; - HgfsRequestGetattrV2 *requestV2; - HgfsRequestGetattr *requestV1; size_t reqBufferSize; size_t reqSize; - HgfsFileName *fileName; int result = 0; HgfsHandle handle; + char *fileName = NULL; + uint32 *fileNameLength = NULL; ASSERT(attr); ASSERT(dentry); ASSERT(req); - /* Fill out the request packet. */ - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - attr->requestType = requestHeader->op; + attr->requestType = opUsed; - switch (requestHeader->op) { - case HGFS_OP_GETATTR_V2: - requestV2 = (HgfsRequestGetattrV2 *)requestHeader; + switch (opUsed) { + case HGFS_OP_GETATTR_V3: { + HgfsRequest *requestHeader; + HgfsRequestGetattrV3 *requestV3; + + /* Fill out the request packet. */ + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestGetattrV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* + * When possible, issue a getattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more + * correct regardless. If we don't find a handle, fall back on getattr + * by name. + */ + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + 0, + &handle) == 0) { + requestV3->hints = HGFS_ATTR_HINT_USE_FILE_DESC; + requestV3->file = handle; + fileName = NULL; + } else { + requestV3->hints = 0; + fileName = requestV3->fileName.name; + fileNameLength = &requestV3->fileName.length; + requestV3->fileName.flags = HGFS_FILE_NAME_CASE_SENSITIVE; + } + reqSize = sizeof *requestV3 + sizeof *requestHeader; + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + break; + } + + case HGFS_OP_GETATTR_V2: { + HgfsRequestGetattrV2 *requestV2; + + requestV2 = (HgfsRequestGetattrV2 *)(HGFS_REQ_PAYLOAD(req)); + requestV2->header.op = opUsed; + requestV2->header.id = req->id; - /* - * When possible, issue a getattr using an existing handle. This will - * give us slightly better performance on a Windows server, and is more + /* + * When possible, issue a getattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more * correct regardless. If we don't find a handle, fall back on getattr * by name. */ - if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, - 0, + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + 0, &handle) == 0) { requestV2->hints = HGFS_ATTR_HINT_USE_FILE_DESC; requestV2->file = handle; fileName = NULL; } else { requestV2->hints = 0; - fileName = &requestV2->fileName; + fileName = requestV2->fileName.name; + fileNameLength = &requestV2->fileName.length; } reqSize = sizeof *requestV2; reqBufferSize = HGFS_NAME_BUFFER_SIZE(requestV2); break; + } - case HGFS_OP_GETATTR: - requestV1 = (HgfsRequestGetattr *)requestHeader; - fileName = &requestV1->fileName; + case HGFS_OP_GETATTR: { + HgfsRequestGetattr *requestV1; + + requestV1 = (HgfsRequestGetattr *)(HGFS_REQ_PAYLOAD(req)); + requestV1->header.op = opUsed; + requestV1->header.id = req->id; + + fileName = requestV1->fileName.name; + fileNameLength = &requestV1->fileName.length; reqSize = sizeof *requestV1; reqBufferSize = HGFS_NAME_BUFFER_SIZE(requestV1); break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: unexpected " @@ -353,7 +415,7 @@ HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer if (fileName != NULL) { /* Build full name to send to server. */ - if (HgfsBuildPath(fileName->name, reqBufferSize, + if (HgfsBuildPath(fileName, reqBufferSize, dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: build path " "failed\n")); @@ -361,22 +423,22 @@ HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer goto out; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: getting attrs " - "for \"%s\"\n", fileName->name)); - + "for \"%s\"\n", fileName)); + /* Convert to CP name. */ - result = CPName_ConvertTo(fileName->name, + result = CPName_ConvertTo(fileName, reqBufferSize, - fileName->name); + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: CP " "conversion failed\n")); result = -EINVAL; goto out; } - + /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileName->name, result); - fileName->length = result; + result = HgfsUnescapeBuffer(fileName, result); + *fileNameLength = result; } req->payloadSize = reqSize + result; result = 0; @@ -384,8 +446,8 @@ out: return result; } -/* - * Public function implementations. +/* + * Public function implementations. */ /* @@ -397,7 +459,7 @@ out: * Callers can pass one of four replies into it and receive back the * attributes for those replies. * - * Callers must populate attr->requestType so that we know whether to + * Callers must populate attr->requestType so that we know whether to * expect a V1 or V2 Attr struct. * * Results: @@ -408,21 +470,24 @@ out: * *---------------------------------------------------------------------- */ -int +int HgfsUnpackCommonAttr(HgfsReq *req, // IN: Reply packet HgfsAttrInfo *attrInfo) // OUT: Attributes { HgfsReplyGetattrV2 *getattrReplyV2; HgfsReplyGetattr *getattrReplyV1; + HgfsReplySearchReadV3 *searchReadReplyV3; HgfsReplySearchReadV2 *searchReadReplyV2; HgfsReplySearchRead *searchReadReplyV1; + HgfsDirEntry *dirent; HgfsAttrV2 *attrV2 = NULL; HgfsAttr *attrV1 = NULL; - + ASSERT(req); ASSERT(attrInfo); switch (attrInfo->requestType) { + case HGFS_OP_GETATTR_V3: case HGFS_OP_GETATTR_V2: getattrReplyV2 = (HgfsReplyGetattrV2 *)(HGFS_REQ_PAYLOAD(req)); attrV2 = &getattrReplyV2->attr; @@ -431,6 +496,11 @@ HgfsUnpackCommonAttr(HgfsReq *req, // IN: Reply packet getattrReplyV1 = (HgfsReplyGetattr *)(HGFS_REQ_PAYLOAD(req)); attrV1 = &getattrReplyV1->attr; break; + case HGFS_OP_SEARCH_READ_V3: + searchReadReplyV3 = (HgfsReplySearchReadV3 *)(HGFS_REP_PAYLOAD_V3(req)); + dirent = (HgfsDirEntry *)searchReadReplyV3->payload; + attrV2 = &dirent->attr; + break; case HGFS_OP_SEARCH_READ_V2: searchReadReplyV2 = (HgfsReplySearchReadV2 *)(HGFS_REQ_PAYLOAD(req)); attrV2 = &searchReadReplyV2->attr; @@ -638,10 +708,10 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode si = HGFS_SB_TO_COMMON(inode->i_sb); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsChangeFileAttributes: entered\n")); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsChangeFileAttributes: entered\n")); HgfsSetFileType(inode, attr); - /* + /* * Set the access mode. For hosts that don't give us group or other * bits (Windows), we use the owner bits in their stead. */ @@ -662,7 +732,7 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode } else { inode->i_mode |= ((inode->i_mode & S_IRWXU) >> 6); } - + /* Mask the access mode. */ switch (attr->type) { case HGFS_FILE_TYPE_REGULAR: @@ -676,17 +746,17 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode break; } - /* + /* * This field is used to represent the number of hard links. If the file is * really a file, this is easy; our filesystem doesn't support hard-linking, - * so we just set it to 1. If the field is a directory, the number of links + * so we just set it to 1. If the field is a directory, the number of links * represents the number of subdirectories, including '.' and "..". * * In either case, what we're doing isn't ideal. We've carefully tracked the * number of links through calls to HgfsMkdir and HgfsDelete, and now some * revalidate will make us trample on the number of links. But we have no * choice: someone on the server may have made our local view of the number - * of links inconsistent (by, say, removing a directory) , and without the + * of links inconsistent (by, say, removing a directory) , and without the * ability to retrieve nlink via getattr, we have no way of knowing that. * * XXX: So in the future, adding nlink to getattr would be nice. At that @@ -698,8 +768,8 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode */ inode->i_nlink = 1; - /* - * Use the stored uid and gid if we were given them at mount-time, or if + /* + * Use the stored uid and gid if we were given them at mount-time, or if * the server didn't give us a uid or gid. */ if (si->uidSet || (attr->mask & HGFS_ATTR_VALID_USERID) == 0) { @@ -718,7 +788,7 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode inode->i_blksize = HGFS_BLOCKSIZE; #endif - /* + /* * Invalidate cached pages if we didn't receive the file size, or if it has * changed on the server. */ @@ -743,7 +813,7 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode HGFS_SET_TIME(inode->i_atime, HGFS_GET_CURRENT_TIME()); } - /* + /* * Invalidate cached pages if we didn't receive the modification time, or if * it has changed on the server. */ @@ -752,7 +822,7 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode HGFS_SET_TIME(newTime, attr->writeTime); if (!HGFS_EQUAL_TIME(newTime, inode->i_mtime)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsChangeFileAttributes: new mod " - "time: %ld:%lu, old mod time: %ld:%lu\n", + "time: %ld:%lu, old mod time: %ld:%lu\n", HGFS_PRINT_TIME(newTime), HGFS_PRINT_TIME(inode->i_mtime))); needInvalidate = TRUE; } @@ -776,7 +846,7 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode HGFS_SET_TIME(inode->i_ctime, HGFS_GET_CURRENT_TIME()); } - /* + /* * Compare old size and write time with new size and write time. If there's * a difference (or if we didn't get a new size or write time), the file * must have been written to, and we need to invalidate our cached pages. @@ -799,8 +869,8 @@ HgfsChangeFileAttributes(struct inode *inode, // IN/OUT: Inode * for the indicated remote name, and if it succeeds copy the * results of the getattr into the provided HgfsAttrInfo. * - * attr->fileName will be allocated on success if the file is a - * symlink; it's the caller's duty to free it. + * attr->fileName will be allocated on success if the file is a + * symlink; it's the caller's duty to free it. * * Results: * Returns zero on success, or a negative error on failure. @@ -817,7 +887,8 @@ HgfsPrivateGetattr(struct dentry *dentry, // IN: Dentry containing name { struct HgfsSuperInfo *si; HgfsReq *req; - HgfsReply *replyHeader; + HgfsStatus replyStatus; + HgfsOp opUsed; int result = 0; HgfsRequest *requestHeader; Bool allowHandleReuse = TRUE; @@ -838,20 +909,23 @@ HgfsPrivateGetattr(struct dentry *dentry, // IN: Dentry containing name requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); retry: - /* Fill out the request packet. */ - requestHeader->op = atomic_read(&hgfsVersionGetattr); - requestHeader->id = req->id; - result = HgfsPackGetattrRequest(req, dentry, attr, allowHandleReuse); + + opUsed = atomic_read(&hgfsVersionGetattr); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_GETATTR_V3; + } + + result = HgfsPackGetattrRequest(req, dentry, allowHandleReuse, opUsed, attr); if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: no attrs\n")); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: no attrs\n")); goto out; } result = HgfsSendRequest(req); if (result == 0) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: got reply\n")); - replyHeader = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(replyHeader->status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); /* * If the getattr succeeded on the server, copy the stats @@ -862,7 +936,7 @@ HgfsPrivateGetattr(struct dentry *dentry, // IN: Dentry containing name result = HgfsUnpackGetattrReply(req, attr); break; case -EBADF: - /* + /* * This can happen if we attempted a getattr by handle and the handle * was closed. Because we have no control over the backdoor, it's * possible that an attacker closed our handle, in which case the @@ -875,18 +949,25 @@ HgfsPrivateGetattr(struct dentry *dentry, // IN: Dentry containing name goto retry; } - /* + /* * There's no reason why the server should have sent us this error * when we haven't used a handle. But to prevent an infinite loop in * the driver, let's make sure that we don't retry again. */ break; - + case -EPROTO: - /* Retry with Version 1 of Getattr. Set globally. */ - if (attr->requestType == HGFS_OP_GETATTR_V2) { + /* Retry with older versions of Getattr. Set globally. */ + if (attr->requestType == HGFS_OP_GETATTR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR_V2); + goto retry; + } else if (attr->requestType == HGFS_OP_GETATTR_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: Version 2 " "not supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR); goto retry; } @@ -958,7 +1039,7 @@ HgfsIget(struct super_block *sb, // IN: Superblock of this fs * * XXX: This logic is also racy. After our call to HgfsInodeLookup(), it's * possible another caller came in and grabbed that inode number, which - * will cause us to collide in iget() and step on their inode. + * will cause us to collide in iget() and step on their inode. */ if (attr->mask & HGFS_ATTR_VALID_FILEID) { struct inode *oldInode; @@ -966,16 +1047,16 @@ HgfsIget(struct super_block *sb, // IN: Superblock of this fs oldInode = HgfsInodeLookup(sb, attr->hostFileId); if (oldInode) { - /* + /* * If this inode's inode number was generated via iunique(), we * have a collision and cannot use the server's inode number. - * Otherwise, we should reuse this inode. + * Otherwise, we should reuse this inode. */ iinfo = INODE_GET_II_P(oldInode); if (iinfo->isFakeInodeNumber) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsIget: found existing " - "iuniqued inode %"FMT64"d, generating new one\n", - attr->hostFileId)); + "iuniqued inode %"FMT64"d, generating new one\n", + attr->hostFileId)); ino = iunique(sb, HGFS_RESERVED_INO); isFakeInodeNumber = TRUE; } else { @@ -988,13 +1069,13 @@ HgfsIget(struct super_block *sb, // IN: Superblock of this fs ino = attr->hostFileId; } } else { - /* + /* * Get the next available inode number. There is a bit of a problem - * with using iunique() in cases where HgfsIget was called to - * instantiate an inode that's already in memory to a new dentry. In + * with using iunique() in cases where HgfsIget was called to + * instantiate an inode that's already in memory to a new dentry. In * such cases, we would like to get the old inode. But if we're * generating inode numbers with iunique(), we'll always have a new - * inode number, thus we'll never get the old inode. This is + * inode number, thus we'll never get the old inode. This is * especially unfortunate when the old inode has some cached pages * attached to it that we won't be able to reuse. * @@ -1012,13 +1093,13 @@ HgfsIget(struct super_block *sb, // IN: Superblock of this fs LOG(6, (KERN_DEBUG "VMware hgfs: HgfsIget: calling iget on inode number " "%lu\n", ino)); - + /* Now we have a good inode number, get the inode itself. */ - inode = iget(sb, ino); + inode = HgfsGetInode(sb, ino); if (inode) { - /* + /* * On an allocation failure in read_super, the inode will have been * marked "bad". If it was, we certainly don't want to start playing with * the HgfsInodeInfo. So quietly put the inode back and fail. @@ -1027,8 +1108,8 @@ HgfsIget(struct super_block *sb, // IN: Superblock of this fs LOG(6, (KERN_DEBUG "VMware hgfs: HgfsIget: encountered bad inode\n")); iput(inode); return NULL; - } - + } + iinfo = INODE_GET_II_P(inode); iinfo->isFakeInodeNumber = isFakeInodeNumber; iinfo->isReferencedInode = TRUE; @@ -1048,9 +1129,9 @@ HgfsIget(struct super_block *sb, // IN: Superblock of this fs * Tie a dentry to a looked up or created inode. Callers may choose to * supply their own attributes, or may leave attr NULL in which case the * attributes will be queried from the server. Likewise, an inode number - * of zero may be specified, in which case HgfsIget will get one from the + * of zero may be specified, in which case HgfsIget will get one from the * server or, barring that, from iunique(). - * + * * Results: * Zero on success, negative error otherwise. * @@ -1087,7 +1168,7 @@ HgfsInstantiate(struct dentry *dentry, // IN: Dentry to use } /* - * Get the inode with this inode number and the attrs we got from + * Get the inode with this inode number and the attrs we got from * the server. */ inode = HgfsIget(dentry->d_sb, ino, attr); @@ -1125,7 +1206,7 @@ HgfsInstantiate(struct dentry *dentry, // IN: Dentry to use *----------------------------------------------------------------------------- */ -int +int HgfsBuildPath(unsigned char *buffer, // IN/OUT: Buffer to write into size_t bufferLen, // IN: Size of buffer struct dentry *dentry) // IN: First dentry to walk @@ -1141,10 +1222,10 @@ HgfsBuildPath(unsigned char *buffer, // IN/OUT: Buffer to write into si = HGFS_SB_TO_COMMON(dentry->d_sb); originalBuffer = buffer; - - /* + + /* * Buffer must hold at least the share name (which is already prefixed with - * a forward slash), and nul. + * a forward slash), and nul. */ shortestNameLength = si->shareNameLen + 1; if (bufferLen < shortestNameLength) { @@ -1154,7 +1235,7 @@ HgfsBuildPath(unsigned char *buffer, // IN/OUT: Buffer to write into /* Short-circuit if we're at the root already. */ if (IS_ROOT(dentry)) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Sending root \"%s\"\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Sending root \"%s\"\n", buffer)); return shortestNameLength; } @@ -1208,7 +1289,7 @@ HgfsBuildPath(unsigned char *buffer, // IN/OUT: Buffer to write into /* Don't forget the share name length (which also accounts for the nul). */ retval += shortestNameLength; - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Built \"%s\"\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Built \"%s\"\n", originalBuffer)); return retval; @@ -1222,7 +1303,7 @@ HgfsBuildPath(unsigned char *buffer, // IN/OUT: Buffer to write into * * Reset the age of this dentry by setting d_time to now. * - * XXX: smb_renew_times from smbfs claims it is safe to reset the time of + * XXX: smb_renew_times from smbfs claims it is safe to reset the time of * all the parent dentries too, but how is that possible? If I stat a file * using a relative path, only that relative path will be validated. Sure, * it means that the parents still /exist/, but that doesn't mean their @@ -1386,7 +1467,7 @@ HgfsCreateFileInfo(struct file *file, // IN: File pointer to attach to /* * Store the file information for this open() in the file*. This needs * to be freed on a close(). Note that we trim all flags from the open - * mode and increment it so that it is guaranteed to be non-zero, because + * mode and increment it so that it is guaranteed to be non-zero, because * callers of HgfsGetHandle may pass in zero as the desired mode if they * don't care about the mode of the opened handle. * @@ -1401,8 +1482,8 @@ HgfsCreateFileInfo(struct file *file, // IN: File pointer to attach to fileInfo->handle = handle; fileInfo->mode = HGFS_OPEN_MODE_ACCMODE(mode) + 1; FILE_SET_FI_P(file, fileInfo); - - /* + + /* * I don't think we need any VFS locks since we're only touching the HGFS * specific state. But we should still acquire our own lock. * @@ -1421,7 +1502,7 @@ HgfsCreateFileInfo(struct file *file, // IN: File pointer to attach to * * HgfsReleaseFileInfo -- * - * Release HGFS-specific file information struct created in + * Release HGFS-specific file information struct created in * HgfsCreateFileInfo. * * Results: @@ -1433,7 +1514,7 @@ HgfsCreateFileInfo(struct file *file, // IN: File pointer to attach to *----------------------------------------------------------------------------- */ -void +void HgfsReleaseFileInfo(struct file *file) // IN: File pointer to detach from { HgfsFileInfo *fileInfo; @@ -1460,8 +1541,8 @@ HgfsReleaseFileInfo(struct file *file) // IN: File pointer to detach from * The handle retrieved satisfies the mode desired by the client. * * The desired mode does not correspond directly to HgfsOpenMode. Callers - * should either increment the desired HgfsOpenMode, or, if any mode will - * do, pass zero instead. This is in line with the Linux kernel's behavior + * should either increment the desired HgfsOpenMode, or, if any mode will + * do, pass zero instead. This is in line with the Linux kernel's behavior * (see do_filp_open() and open_namei() for details). * * Results: @@ -1486,9 +1567,9 @@ HgfsGetHandle(struct inode *inode, // IN: Inode to search for handles LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: desired mode %u\n", mode)); - /* + /* * We may have been called from a dentry without an associated inode. - * HgfsReadSuper is one such caller. No inode means no open files, so + * HgfsReadSuper is one such caller. No inode means no open files, so * return an error. */ if (inode == NULL) { @@ -1497,7 +1578,7 @@ HgfsGetHandle(struct inode *inode, // IN: Inode to search for handles } iinfo = INODE_GET_II_P(inode); - /* + /* * Unfortunately, we can't reuse handles belonging to directories. These * handles were created by a SearchOpen request, but the server itself * backed them with an artificial list of dentries populated via scandir. So @@ -1508,16 +1589,16 @@ HgfsGetHandle(struct inode *inode, // IN: Inode to search for handles LOG(8, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: Called on directory\n")); return -EINVAL; } - - /* + + /* * Iterate over the open handles for this inode, and find one that allows - * the given mode. A desired mode of zero means "any mode will do". + * the given mode. A desired mode of zero means "any mode will do". * Otherwise return an error; */ spin_lock(&hgfsBigLock); list_for_each(cur, &iinfo->files) { HgfsFileInfo *finfo = list_entry(cur, HgfsFileInfo, list); - + if (mode == 0 || finfo->mode & mode) { *handle = finfo->handle; found = TRUE; @@ -1527,7 +1608,7 @@ HgfsGetHandle(struct inode *inode, // IN: Inode to search for handles spin_unlock(&hgfsBigLock); if (found) { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: Returning handle %d\n", + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: Returning handle %d\n", *handle)); return 0; } else { @@ -1543,17 +1624,17 @@ HgfsGetHandle(struct inode *inode, // IN: Inode to search for handles * * HgfsStatusConvertToLinux -- * - * Convert a cross-platform HGFS status code to its Linux-kernel specific - * counterpart. + * Convert a cross-platform HGFS status code to its Linux-kernel specific + * counterpart. * - * Rather than encapsulate the status codes within an array indexed by the - * various HGFS status codes, we explicitly enumerate them in a switch - * statement, saving the reader some time when matching HGFS status codes + * Rather than encapsulate the status codes within an array indexed by the + * various HGFS status codes, we explicitly enumerate them in a switch + * statement, saving the reader some time when matching HGFS status codes * against Linux status codes. * * Results: * Zero if the converted status code represents success, negative error - * otherwise. Unknown status codes are converted to the more generic + * otherwise. Unknown status codes are converted to the more generic * "protocol error" status code to maintain forwards compatibility. * * Side effects: @@ -1675,3 +1756,94 @@ HgfsSetUidGid(struct inode *parent, // IN: parent inode HgfsSetattr(dentry, &setUidGid); HgfsRevalidate(dentry); } + + +/* + *---------------------------------------------------------------------------- + * + * HgfsGetInode -- + * + * This function replaces iget() and should be called instead of it. In newer + * kernels that have removed the iget() interface, GetInode() obtains an inode + * and if it is a new one, then initializes the inode by calling + * HgfsDoReadInode(). In older kernels that support the iget() interface, + * HgfsDoReadInode() is called by iget() internally. + * + * Results: + * A new inode object on success, NULL on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +struct inode * +HgfsGetInode(struct super_block *sb, // IN: file system superblock object + ino_t ino) // IN: inode number to assign to new inode +{ +#ifdef VMW_USE_IGET_LOCKED + struct inode *inode; + + inode = iget_locked(sb, ino); + if (inode && (inode->i_state & I_NEW)) { + HgfsDoReadInode(inode); + unlock_new_inode(inode); + } + return inode; +#else + return iget(sb, ino); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoReadInode -- + * + * A filesystem wide function that is called to initialize a new inode. + * This is called from two different places depending on the kernel version. + * In older kernels that provide the iget() interface, this function is + * called by the kernel as part of inode initialization (from + * HgfsDoReadInode). In newer kernels that call iget_locked(), this + * function is called by filesystem code to initialize the new inode. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +HgfsDoReadInode(struct inode *inode) // IN: Inode to initialize +{ + HgfsInodeInfo *iinfo = INODE_GET_II_P(inode); + + /* + * If the vfs inode is not embedded within the HgfsInodeInfo, then we + * haven't yet allocated the HgfsInodeInfo. Do so now. + * + * XXX: We could allocate with GFP_ATOMIC. But instead, we'll do a standard + * allocation and mark the inode "bad" if the allocation fails. This'll + * make all subsequent operations on the inode fail, which is what we want. + */ +#ifndef VMW_EMBED_INODE + iinfo = kmem_cache_alloc(hgfsInodeCache, GFP_KERNEL); + if (!iinfo) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoReadInode: no memory for " + "iinfo!\n")); + make_bad_inode(inode); + return; + } +#endif + INODE_SET_II_P(inode, iinfo); + INIT_LIST_HEAD(&iinfo->files); + iinfo->isReferencedInode = FALSE; + iinfo->isFakeInodeNumber = FALSE; + iinfo->createdAndUnopened = FALSE; + +} diff --git a/open-vm-tools/modules/linux/vmhgfs/fsutil.h b/open-vm-tools/modules/linux/vmhgfs/fsutil.h index cc9548e81..8943b231b 100644 --- a/open-vm-tools/modules/linux/vmhgfs/fsutil.h +++ b/open-vm-tools/modules/linux/vmhgfs/fsutil.h @@ -97,5 +97,8 @@ void HgfsSetUidGid(struct inode *parent, struct dentry *dentry, uid_t uid, gid_t gid); +struct inode *HgfsGetInode(struct super_block *sb, ino_t ino); +void HgfsDoReadInode(struct inode *inode); + #endif // _HGFS_DRIVER_FSUTIL_H_ diff --git a/open-vm-tools/modules/linux/vmhgfs/hgfs.h b/open-vm-tools/modules/linux/vmhgfs/hgfs.h index a2a607c7b..02bbbf2a3 100644 --- a/open-vm-tools/modules/linux/vmhgfs/hgfs.h +++ b/open-vm-tools/modules/linux/vmhgfs/hgfs.h @@ -175,41 +175,6 @@ typedef enum { #define HGFS_SYNC_REQREP_CLIENT_CMD HGFS_SYNC_REQREP_CMD " " #define HGFS_SYNC_REQREP_CLIENT_CMD_LEN (sizeof HGFS_SYNC_REQREP_CLIENT_CMD - 1) -/* - * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be - * asynchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and asynchronously returned from the - * guest. - * - * In short, an endpoint sending this command is sending a request whose reply - * should be returned asynchronously. - */ -#define HGFS_ASYNC_REQUEST_CMD "g" -#define HGFS_ASYNC_REQUEST_CLIENT_CMD HGFS_ASYNC_REQUEST_CMD " " -#define HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REQUEST_CLIENT_CMD - 1) - -/* - * An endpoint sending this command is sending an asynchronous HGFS reply to a - * request sent by the HGFS_ASYNC_REQUEST command. - */ -#define HGFS_ASYNC_REPLY_CMD "h" -#define HGFS_ASYNC_REPLY_CLIENT_CMD HGFS_ASYNC_REPLY_CMD " " -#define HGFS_ASYNC_REPLY_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REPLY_CLIENT_CMD - 1) - -/* - * Ensuring that all commands are the same length eases the implementation of - * HGFS client code. - */ -MY_ASSERTS(HGFS_CMD_LENGTHS, - ASSERT_ON_COMPILE(HGFS_SYNC_REQREP_CLIENT_CMD_LEN == - HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN); - ASSERT_ON_COMPILE(HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN == - HGFS_ASYNC_REPLY_CLIENT_CMD_LEN); -) - /* * This is just for the sake of macro naming. Since we are guaranteed * equal command lengths, defining command length via a generalized macro name diff --git a/open-vm-tools/modules/linux/vmhgfs/hgfsProto.h b/open-vm-tools/modules/linux/vmhgfs/hgfsProto.h index e8d8d729e..f27663838 100644 --- a/open-vm-tools/modules/linux/vmhgfs/hgfsProto.h +++ b/open-vm-tools/modules/linux/vmhgfs/hgfsProto.h @@ -79,14 +79,39 @@ typedef enum { HGFS_OP_CREATE_SYMLINK, /* Create a symlink */ HGFS_OP_SERVER_LOCK_CHANGE, /* Change the oplock on a file */ HGFS_OP_CREATE_DIR_V2, /* Create a directory */ - HGFS_OP_DELETE_FILE_V2, /* Delete a file */ - HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ - HGFS_OP_RENAME_V2, /* Rename a file or directory */ + HGFS_OP_DELETE_FILE_V2, /* Delete a file */ + HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ + HGFS_OP_RENAME_V2, /* Rename a file or directory */ - HGFS_OP_MAX, /* Dummy op, must be last in enum */ + /* + * Operations for version 3. + */ + + HGFS_OP_OPEN_V3, /* Open file */ + HGFS_OP_READ_V3, /* Read from file */ + HGFS_OP_WRITE_V3, /* Write to file */ + HGFS_OP_CLOSE_V3, /* Close file */ + HGFS_OP_SEARCH_OPEN_V3, /* Start new search */ + HGFS_OP_SEARCH_READ_V3, /* Start new search */ + HGFS_OP_SEARCH_CLOSE_V3, /* End a search */ + HGFS_OP_GETATTR_V3, /* Get file attributes */ + HGFS_OP_SETATTR_V3, /* Set file attributes */ + HGFS_OP_CREATE_DIR_V3, /* Create new directory */ + HGFS_OP_DELETE_FILE_V3, /* Delete a file */ + HGFS_OP_DELETE_DIR_V3, /* Delete a directory */ + HGFS_OP_RENAME_V3, /* Rename a file or directory */ + HGFS_OP_QUERY_VOLUME_INFO_V3, /* Query volume information */ + HGFS_OP_CREATE_SYMLINK_V3, /* Create a symlink */ + HGFS_OP_SERVER_LOCK_CHANGE_V3, /* Change the oplock on a file */ + + HGFS_OP_MAX, /* Dummy op, must be last in enum */ } HgfsOp; +/* HGFS protocol versions. */ +#define HGFS_VERSION_OLD (1 << 0) +#define HGFS_VERSION_3 (1 << 1) + /* * File types, used in HgfsAttr. We support regular files, * directories, and symlinks. @@ -411,7 +436,7 @@ HgfsAttrV2; * Precomposed (normal form C) versus Decomposed (normal form D) * ------------------------------------------------------------- * Certain Unicode characters can be encoded in more than one way. - * For example, an Á (A acute) can be encoded either precomposed, + * For example, an (A acute) can be encoded either precomposed, * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, * as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). * Precomposed characters are more common in the Windows world, @@ -430,6 +455,33 @@ struct HgfsFileName { HgfsFileName; +/* + * HgfsFileNameV3 - new header to incorporate case-sensitivity flags along with + * Hgfs file handle. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsFileNameV3 { + uint32 length; /* Does NOT include terminating NUL */ + uint32 flags; /* Flags describe below. */ + HgfsHandle fid; + char name[1]; +} +#include "vmware_pack_end.h" +HgfsFileNameV3; + + +/* + * HgfsFileNameV3 flags. Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ +#define HGFS_FILE_NAME_USE_FILE_DESC (1 << 0) /* Other flags ignored if set. */ +#define HGFS_FILE_NAME_CASE_SENSITIVE (1 << 1) +#define HGFS_FILE_NAME_CASE_INSENSITIVE (1 << 2) +#define HGFS_FILE_NAME_DEFAULT_CASE (1 << 3) /* Default host case. */ + + /* * Request/reply structs. These are the first members of all * operation request and reply messages, respectively. @@ -500,6 +552,31 @@ struct HgfsRequestOpenV2 { HgfsRequestOpenV2; +/* Version 3 of HgfsRequestOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestOpenV3 { + HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ + HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ + HgfsOpenFlags flags; /* Which flags to open the file with */ + HgfsPermissions specialPerms; /* Desired 'special' permissions for file creation */ + HgfsPermissions ownerPerms; /* Desired 'owner' permissions for file creation */ + HgfsPermissions groupPerms; /* Desired 'group' permissions for file creation */ + HgfsPermissions otherPerms; /* Desired 'other' permissions for file creation */ + HgfsAttrFlags attr; /* Attributes, if any, for file creation */ + uint64 allocationSize; /* How much space to pre-allocate during creation */ + uint32 desiredAccess; /* Extended support for windows access modes */ + uint32 shareAccess; /* Windows only, share access modes */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + uint64 reserved1; /* Reserved for future use */ + uint64 reserved2; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV3; + + /* Deprecated */ typedef @@ -525,6 +602,21 @@ struct HgfsReplyOpenV2 { HgfsReplyOpenV2; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyOpenV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestRead { @@ -536,6 +628,7 @@ struct HgfsRequestRead { #include "vmware_pack_end.h" HgfsRequestRead; +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -548,6 +641,32 @@ struct HgfsReplyRead { HgfsReplyRead; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestReadV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestReadV3; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyReadV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsReplyReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestWrite { @@ -562,6 +681,8 @@ struct HgfsRequestWrite { HgfsRequestWrite; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyWrite { @@ -571,6 +692,31 @@ struct HgfsReplyWrite { #include "vmware_pack_end.h" HgfsReplyWrite; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestWriteV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsRequestWriteV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyWriteV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyWriteV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -582,6 +728,8 @@ struct HgfsRequestClose { HgfsRequestClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyClose { @@ -591,6 +739,27 @@ struct HgfsReplyClose { HgfsReplyClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCloseV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyCloseV3 { + uint64 reserved; +} +#include "vmware_pack_end.h" +HgfsReplyCloseV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestSearchOpen { @@ -601,6 +770,18 @@ struct HgfsRequestSearchOpen { HgfsRequestSearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchOpenV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 dirName; +} +#include "vmware_pack_end.h" +HgfsRequestSearchOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchOpen { @@ -611,6 +792,16 @@ struct HgfsReplySearchOpen { HgfsReplySearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchOpenV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchOpenV3; + + /* Deprecated */ typedef @@ -636,6 +827,17 @@ struct HgfsRequestSearchReadV2 { #include "vmware_pack_end.h" HgfsRequestSearchReadV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchReadV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint32 offset; /* The first result is offset 0 */ + uint32 flags; /* Reserved for reading multiple directory entries. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchReadV3; + /* Deprecated */ @@ -655,21 +857,48 @@ HgfsReplySearchRead; typedef #include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { - HgfsReply header; +struct HgfsReplySearchReadV2 { + HgfsReply header; HgfsAttrV2 attr; - + /* * fileName.length = 0 means "no entry at this offset" * If the file is a symlink (as specified in attr) * this name is the name of the symlink, not the target. - */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" + */ + HgfsFileName fileName; +} +#include "vmware_pack_end.h" HgfsReplySearchReadV2; +/* Directory entry structure. */ + +typedef struct HgfsDirEntry { + uint32 nextEntry; + HgfsAttrV2 attr; + + /* + * fileName.length = 0 means "no entry at this offset" + * If the file is a symlink (as specified in attr) + * this name is the name of the symlink, not the target. + */ + HgfsFileNameV3 fileName; +} HgfsDirEntry; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchReadV3 { + uint64 count; /* Number of directory entries. */ + uint64 reserved; /* Reserved for future use. */ + char payload[1]; /* Directory entries. */ +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestSearchClose { @@ -680,6 +909,8 @@ struct HgfsRequestSearchClose { HgfsRequestSearchClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchClose { @@ -689,6 +920,25 @@ struct HgfsReplySearchClose { HgfsReplySearchClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchCloseV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchCloseV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchCloseV3; + + /* Deprecated */ typedef @@ -715,6 +965,18 @@ struct HgfsRequestGetattrV2 { HgfsRequestGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestGetattrV3 { + HgfsAttrHint hints; /* Flags for file handle valid. */ + HgfsHandle file; /* Opaque file ID used by the server. */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestGetattrV3; + + /* Deprecated */ typedef @@ -748,6 +1010,25 @@ struct HgfsReplyGetattrV2 { HgfsReplyGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyGetattrV3 { + HgfsAttrV2 attr; + + /* + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should + * be ignored. + * + * This filename is in "CPNameLite" format. See CPNameLite.c for details. + */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkTarget; +} +#include "vmware_pack_end.h" +HgfsReplyGetattrV3; + + /* Deprecated */ typedef @@ -777,6 +1058,18 @@ struct HgfsRequestSetattrV2 { HgfsRequestSetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSetattrV3 { + HgfsAttrHint hints; + HgfsAttrV2 attr; + HgfsHandle file; /* Opaque file ID used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestSetattrV3; + /* Deprecated */ typedef @@ -798,6 +1091,27 @@ struct HgfsReplySetattrV2 { #include "vmware_pack_end.h" HgfsReplySetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySetattrV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySetattrV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDir { + HgfsRequest header; + HgfsPermissions permissions; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDir; + /* Version 2 of HgfsRequestCreateDir */ @@ -816,17 +1130,32 @@ struct HgfsRequestCreateDirV2 { HgfsRequestCreateDirV2; +/* Version 3 of HgfsRequestCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDirV3 { + HgfsCreateDirValid mask; + HgfsPermissions specialPerms; + HgfsPermissions ownerPerms; + HgfsPermissions groupPerms; + HgfsPermissions otherPerms; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDirV3; + + /* Deprecated */ typedef #include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { - HgfsRequest header; - HgfsPermissions permissions; - HgfsFileName fileName; +struct HgfsReplyCreateDir { + HgfsReply header; } #include "vmware_pack_end.h" -HgfsRequestCreateDir; +HgfsReplyCreateDir; /* Version 2 of HgfsReplyCreateDir */ @@ -840,17 +1169,19 @@ struct HgfsReplyCreateDirV2 { HgfsReplyCreateDirV2; -/* Deprecated */ +/* Version 3 of HgfsReplyCreateDir */ typedef #include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { - HgfsReply header; +struct HgfsReplyCreateDirV3 { + uint64 reserved; /* Reserved for future use */ } #include "vmware_pack_end.h" -HgfsReplyCreateDir; +HgfsReplyCreateDirV3; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDelete { @@ -860,6 +1191,9 @@ struct HgfsRequestDelete { #include "vmware_pack_end.h" HgfsRequestDelete; + +/* Version 2 of HgfsReplyCreateDir */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDeleteV2 { @@ -871,6 +1205,23 @@ struct HgfsRequestDeleteV2 { #include "vmware_pack_end.h" HgfsRequestDeleteV2; + +/* Version 3 of HgfsReplyCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestDeleteV3 { + HgfsDeleteHint hints; + HgfsHandle file; /* Opaque file ID used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ +} +#include "vmware_pack_end.h" +HgfsRequestDeleteV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyDelete { @@ -889,6 +1240,18 @@ struct HgfsReplyDeleteV2 { #include "vmware_pack_end.h" HgfsReplyDeleteV2; + +/* Version 2 of HgfsReplyDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyDeleteV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyDeleteV3; + + /* * The size of the HgfsFileName struct is variable depending on the * length of the name, so you can't use request->newName to get the @@ -942,6 +1305,31 @@ struct HgfsReplyRenameV2 { HgfsReplyRenameV2; +/* HgfsRequestRename and HgfsReplyRename for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestRenameV3 { + HgfsRenameHint hints; + HgfsHandle srcFile; /* Opaque file ID to "old name" used by the server. */ + HgfsHandle targetFile; /* Opaque file ID to "old name" used by the server. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 oldName; + HgfsFileNameV3 newName; +} +#include "vmware_pack_end.h" +HgfsRequestRenameV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyRenameV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyRenameV3; + + typedef #include "vmware_pack_begin.h" struct HgfsRequestQueryVolume { @@ -963,6 +1351,30 @@ struct HgfsReplyQueryVolume { HgfsReplyQueryVolume; +/* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestQueryVolumeV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestQueryVolumeV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyQueryVolumeV3 { + uint64 freeBytes; + uint64 totalBytes; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyQueryVolumeV3; + + + /* New operations for Version 2 */ typedef @@ -1008,4 +1420,28 @@ struct HgfsReplySymlinkCreate { HgfsReplySymlinkCreate; +/* HgfsRequestServerLockChange and HgfsReplyServerLockChange for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkName; + + /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ + HgfsFileNameV3 targetName; +} +#include "vmware_pack_end.h" +HgfsRequestSymlinkCreateV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySymlinkCreateV3; + + #endif /* _HGFS_PROTO_H_ */ diff --git a/open-vm-tools/modules/linux/vmhgfs/hgfsUtil.h b/open-vm-tools/modules/linux/vmhgfs/hgfsUtil.h index b734faac4..1b98bf761 100644 --- a/open-vm-tools/modules/linux/vmhgfs/hgfsUtil.h +++ b/open-vm-tools/modules/linux/vmhgfs/hgfsUtil.h @@ -89,6 +89,7 @@ struct timespec { #endif #define HGFS_NAME_BUFFER_SIZE(request) (HGFS_PACKET_MAX - (sizeof *request - 1)) +#define HGFS_NAME_BUFFER_SIZET(sizet) (HGFS_PACKET_MAX - (sizet) - 1) #ifndef _WIN32 /* @@ -114,3 +115,4 @@ int HgfsConvertFromNtTimeNsec(struct timespec *unixTime, // OUT HgfsStatus HgfsConvertFromInternalStatus(HgfsInternalStatus status); // IN #endif /* _HGFSUTIL_H_ */ + diff --git a/open-vm-tools/modules/linux/vmhgfs/inode.c b/open-vm-tools/modules/linux/vmhgfs/inode.c index 62bd92bf6..9c9cd3782 100644 --- a/open-vm-tools/modules/linux/vmhgfs/inode.c +++ b/open-vm-tools/modules/linux/vmhgfs/inode.c @@ -72,14 +72,20 @@ static int HgfsDelete(struct inode *dir, HgfsOp op); static int HgfsPackSetattrRequest(struct iattr *iattr, struct dentry *dentry, + Bool allowHandleReuse, + HgfsOp opUsed, HgfsReq *req, - Bool *changed, - Bool allowHandleReuse); + Bool *changed); static int HgfsPackCreateDirRequest(struct dentry *dentry, int mode, + HgfsOp opUsed, HgfsReq *req); static int HgfsTruncatePages(struct inode *inode, loff_t newSize); +static int HgfsPackSymlinkCreateRequest(struct dentry *dentry, + const char *symname, + HgfsOp opUsed, + HgfsReq *req); /* HGFS inode operations. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75) @@ -117,6 +123,12 @@ static int HgfsGetattr(struct vfsmount *mnt, struct kstat *stat); #endif +#define HGFS_CREATE_DIR_MASK (HGFS_CREATE_DIR_VALID_FILE_NAME | \ + HGFS_CREATE_DIR_VALID_SPECIAL_PERMS | \ + HGFS_CREATE_DIR_VALID_OWNER_PERMS | \ + HGFS_CREATE_DIR_VALID_GROUP_PERMS | \ + HGFS_CREATE_DIR_VALID_OTHER_PERMS) + /* HGFS inode operations structure for directories. */ struct inode_operations HgfsDirInodeOperations = { /* Optional */ @@ -179,12 +191,14 @@ HgfsDelete(struct inode *dir, // IN: Parent dir of file/dir to delete struct dentry *dentry, // IN: Dentry of file/dir to delete HgfsOp op) // IN: Opcode for file type (file or dir) { - struct HgfsSuperInfo *si; - HgfsRequestDelete *request; - HgfsReplyDelete *reply; HgfsReq *req = NULL; int result = 0; Bool secondAttempt = FALSE; + HgfsStatus replyStatus; + char *fileName = NULL; + uint32 *fileNameLength; + HgfsOp opUsed; + uint32 reqSize; ASSERT(dir); ASSERT(dir->i_sb); @@ -205,9 +219,6 @@ HgfsDelete(struct inode *dir, // IN: Parent dir of file/dir to delete goto out; } - - si = HGFS_SB_TO_COMMON(dir->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: out of memory while " @@ -216,27 +227,52 @@ HgfsDelete(struct inode *dir, // IN: Parent dir of file/dir to delete goto out; } - request = (HgfsRequestDelete *)(HGFS_REQ_PAYLOAD(req)); - retry: - /* Fill out the request packet. */ - request->header.id = req->id; - request->header.op = op; + opUsed = op; + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + HgfsRequestDeleteV3 *request; + HgfsRequest *header; + + if (op == HGFS_OP_DELETE_DIR) { + opUsed = HGFS_OP_DELETE_DIR_V3; + } else { + opUsed = HGFS_OP_DELETE_FILE_V3; + } + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed; + + request = (HgfsRequestDeleteV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->hints = 0; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; + reqSize = sizeof *request + sizeof *header; + } else { + HgfsRequestDelete *request; + + request = (HgfsRequestDelete *)(HGFS_REQ_PAYLOAD(req)); + /* Fill out the request packet. */ + request->header.id = req->id; + request->header.op = opUsed = op; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; + reqSize = sizeof *request; + } /* Build full name to send to server. */ - if (HgfsBuildPath(request->fileName.name, HGFS_NAME_BUFFER_SIZE(request), + if (HgfsBuildPath(fileName, HGFS_NAME_BUFFER_SIZET(reqSize), dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: build path failed\n")); result = -EINVAL; goto out; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDelete: deleting \"%s\", op %u\n", - request->fileName.name, op)); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: deleting \"%s\", op %u\n", + fileName, opUsed)); /* Convert to CP name. */ - result = CPName_ConvertTo(request->fileName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->fileName.name); + result = CPName_ConvertTo(fileName, + HGFS_NAME_BUFFER_SIZET(reqSize), + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: CP conversion failed\n")); result = -EINVAL; @@ -244,73 +280,82 @@ HgfsDelete(struct inode *dir, // IN: Parent dir of file/dir to delete } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(request->fileName.name, result); - request->fileName.length = result; - req->payloadSize = sizeof *request + result; + result = HgfsUnescapeBuffer(fileName, result); + *fileNameLength = result; + req->payloadSize = reqSize + result; result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: wrong packet size\n")); - result = -EPROTO; - } else { + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDelete: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDelete: got reply\n")); - reply = (HgfsReplyDelete *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - - switch (result) { - case 0: - /* - * Since we deleted the file, decrement its hard link count. As - * we don't support hard links, this has the effect of making the - * link count 0, which means that when the last reference to the - * inode is dropped, the inode will be freed instead of moved to - * the unused list. - * - * Also update the mtime/ctime of the parent directory, and the - * ctime of the deleted file. - */ - compat_drop_nlink(dentry->d_inode); - dentry->d_inode->i_ctime = dir->i_ctime = dir->i_mtime = - CURRENT_TIME; - break; + switch (result) { + case 0: + /* + * Since we deleted the file, decrement its hard link count. As + * we don't support hard links, this has the effect of making the + * link count 0, which means that when the last reference to the + * inode is dropped, the inode will be freed instead of moved to + * the unused list. + * + * Also update the mtime/ctime of the parent directory, and the + * ctime of the deleted file. + */ + compat_drop_nlink(dentry->d_inode); + dentry->d_inode->i_ctime = dir->i_ctime = dir->i_mtime = + CURRENT_TIME; + break; - case -EACCES: - case -EPERM: - /* - * It's possible that we're talking to a Windows server with - * a file marked read-only. Let's try again, after removing - * the read-only bit from the file. - * - * XXX: I think old servers will send -EPERM here. Is this entirely - * safe? - */ - if (!secondAttempt) { - struct iattr enableWrite; - secondAttempt = TRUE; - - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: access denied, " - "attempting to work around read-only bit\n")); - enableWrite.ia_mode = (dentry->d_inode->i_mode | S_IWUSR); - enableWrite.ia_valid = ATTR_MODE; - result = HgfsSetattr(dentry, &enableWrite); - if (result == 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: file is no " - "longer read-only, retrying delete\n")); - goto retry; - } - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: failed to remove " - "read-only property\n")); - } else { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: second attempt at " - "delete failed\n")); + case -EACCES: + case -EPERM: + /* + * It's possible that we're talking to a Windows server with + * a file marked read-only. Let's try again, after removing + * the read-only bit from the file. + * + * XXX: I think old servers will send -EPERM here. Is this entirely + * safe? + */ + if (!secondAttempt) { + struct iattr enableWrite; + secondAttempt = TRUE; + + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: access denied, " + "attempting to work around read-only bit\n")); + enableWrite.ia_mode = (dentry->d_inode->i_mode | S_IWUSR); + enableWrite.ia_valid = ATTR_MODE; + result = HgfsSetattr(dentry, &enableWrite); + if (result == 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: file is no " + "longer read-only, retrying delete\n")); + goto retry; } - break; - default: - break; + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: failed to remove " + "read-only property\n")); + } else { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: second attempt at " + "delete failed\n")); + } + break; + case -EPROTO: + if (opUsed == HGFS_OP_DELETE_DIR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } else if (opUsed == HGFS_OP_DELETE_FILE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; } + + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: server " + "returned error: %d\n", result)); + break; + default: + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: timed out\n")); @@ -351,19 +396,18 @@ out: static int HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from struct dentry *dentry, // IN: File to set attributes of - HgfsReq *req, // IN/OUT: Packet to write into - Bool *changed, // OUT: Have the attrs changed? - Bool allowHandleReuse) // IN: Can we use a handle? + Bool allowHandleReuse, // IN: Can we use a handle? + HgfsOp opUsed, // IN: Op to be used + HgfsReq *req, // IN/OUT: Packet to write into + Bool *changed) // OUT: Have the attrs changed? { - HgfsRequest *requestHeader; - HgfsRequestSetattrV2 *requestV2; - HgfsRequestSetattr *request; HgfsAttrV2 *attrV2; HgfsAttr *attr; HgfsAttrHint *hints; HgfsAttrChanges *update; - HgfsFileName *fileNameP; HgfsHandle handle; + char *fileName = NULL; + uint32 *fileNameLength = NULL; unsigned int valid; size_t reqBufferSize; size_t reqSize; @@ -376,10 +420,120 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from valid = iattr->ia_valid; - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - switch (requestHeader->op) { - case HGFS_OP_SETATTR_V2: + switch (opUsed) { + case HGFS_OP_SETATTR_V3: { + HgfsRequest *requestHeader; + HgfsRequestSetattrV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestSetattrV3 *)HGFS_REQ_PAYLOAD_V3(req); + attrV2 = &requestV3->attr; + hints = &requestV3->hints; + + /* + * Clear attributes, mask, and hints before touching them. + * We can't rely on GetNewRequest() to zero our structures, so + * make sure to zero them all here. + */ + memset(attrV2, 0, sizeof *attrV2); + memset(hints, 0, sizeof *hints); + + /* + * When possible, issue a setattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more + * correct regardless. If we don't find a handle, fall back on setattr + * by name. + * + * Changing the size (via truncate) requires write permissions. Changing + * the times also requires write permissions on Windows, so we require it + * here too. Otherwise, any handle will do. + */ + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + (valid & ATTR_SIZE) || + (valid & ATTR_ATIME) || + (valid & ATTR_MTIME) ? + HGFS_OPEN_MODE_WRITE_ONLY + 1 : 0, + &handle) == 0) { + *hints = HGFS_ATTR_HINT_USE_FILE_DESC; + requestV3->file = handle; + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: setting " + "attributes of handle %u\n", handle)); + } else { + fileName = requestV3->fileName.name; + fileNameLength = &requestV3->fileName.length; + requestV3->fileName.flags = HGFS_FILE_NAME_DEFAULT_CASE; + } + reqSize = sizeof *requestV3 + sizeof *requestHeader; + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* + * We only support changing these attributes: + * - all mode bits (i.e. all permissions) + * - uid/gid + * - size + * - access/write times + */ + + if (valid & ATTR_MODE) { + attrV2->mask |= HGFS_ATTR_VALID_SPECIAL_PERMS | + HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | + HGFS_ATTR_VALID_OTHER_PERMS; + attrV2->specialPerms = ((iattr->ia_mode & + (S_ISUID | S_ISGID | S_ISVTX)) >> 9); + attrV2->ownerPerms = ((iattr->ia_mode & S_IRWXU) >> 6); + attrV2->groupPerms = ((iattr->ia_mode & S_IRWXG) >> 3); + attrV2->otherPerms = (iattr->ia_mode & S_IRWXO); + *changed = TRUE; + } + + if (valid & ATTR_UID) { + attrV2->mask |= HGFS_ATTR_VALID_USERID; + attrV2->userId = iattr->ia_uid; + *changed = TRUE; + } + + if (valid & ATTR_GID) { + attrV2->mask |= HGFS_ATTR_VALID_GROUPID; + attrV2->groupId = iattr->ia_gid; + *changed = TRUE; + } + + if (valid & ATTR_SIZE) { + attrV2->mask |= HGFS_ATTR_VALID_SIZE; + attrV2->size = iattr->ia_size; + *changed = TRUE; + } + + if (valid & ATTR_ATIME) { + attrV2->mask |= HGFS_ATTR_VALID_ACCESS_TIME; + attrV2->accessTime = HGFS_GET_TIME(iattr->ia_atime); + if (valid & ATTR_ATIME_SET) { + *hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; + } + *changed = TRUE; + } + + if (valid & ATTR_MTIME) { + attrV2->mask |= HGFS_ATTR_VALID_WRITE_TIME; + attrV2->writeTime = HGFS_GET_TIME(iattr->ia_mtime); + if (valid & ATTR_MTIME_SET) { + *hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; + } + *changed = TRUE; + } + break; + } + + case HGFS_OP_SETATTR_V2: { + HgfsRequestSetattrV2 *requestV2; + requestV2 = (HgfsRequestSetattrV2 *)(HGFS_REQ_PAYLOAD(req)); + requestV2->header.op = opUsed; + requestV2->header.id = req->id; + attrV2 = &requestV2->attr; hints = &requestV2->hints; @@ -409,11 +563,11 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from &handle) == 0) { *hints = HGFS_ATTR_HINT_USE_FILE_DESC; requestV2->file = handle; - fileNameP = NULL; LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: setting " "attributes of handle %u\n", handle)); } else { - fileNameP = &requestV2->fileName; + fileName = requestV2->fileName.name; + fileNameLength = &requestV2->fileName.length; } reqSize = sizeof *requestV2; reqBufferSize = HGFS_NAME_BUFFER_SIZE(requestV2); @@ -474,13 +628,21 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from *changed = TRUE; } break; - case HGFS_OP_SETATTR: + } + + case HGFS_OP_SETATTR: { + HgfsRequestSetattr *request; + request = (HgfsRequestSetattr *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; + attr = &request->attr; update = &request->update; /* We'll use these later. */ - fileNameP = &request->fileName; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; reqSize = sizeof *request; reqBufferSize = HGFS_NAME_BUFFER_SIZE(request); @@ -526,6 +688,8 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from *changed = TRUE; } break; + } + default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: unexpected " "OP type encountered\n")); @@ -533,21 +697,21 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from } /* Avoid all this extra work when we're doing a setattr by handle. */ - if (fileNameP != NULL) { + if (fileName != NULL) { /* Build full name to send to server. */ - if (HgfsBuildPath(fileNameP->name, reqBufferSize, dentry) < 0) { + if (HgfsBuildPath(fileName, reqBufferSize, dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: build path " "failed\n")); return -EINVAL; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: setting " - "attributes of \"%s\"\n", fileNameP->name)); + "attributes of \"%s\"\n", fileName)); /* Convert to CP name. */ - result = CPName_ConvertTo(fileNameP->name, + result = CPName_ConvertTo(fileName, reqBufferSize, - fileNameP->name); + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: CP " "conversion failed\n")); @@ -555,8 +719,8 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileNameP->name, result); - fileNameP->length = result; + result = HgfsUnescapeBuffer(fileName, result); + *fileNameLength = result; } req->payloadSize = reqSize + result; return 0; @@ -582,34 +746,58 @@ HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from static int HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create int mode, // IN: Mode to assign dir + HgfsOp opUsed, // IN: Op to be used. HgfsReq *req) // IN/OUT: Packet to write into { - HgfsRequest *requestHeader; - HgfsRequestCreateDirV2 *requestV2; - HgfsRequestCreateDir *request; - HgfsFileName *fileNameP; + char *fileName = NULL; + uint32 *fileNameLength; size_t requestSize; int result; ASSERT(dentry); ASSERT(req); - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + switch (opUsed) { + case HGFS_OP_CREATE_DIR_V3: { + HgfsRequest *requestHeader; + HgfsRequestCreateDirV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestCreateDirV3 *)(HGFS_REQ_PAYLOAD(req) + + sizeof *requestHeader); - switch (requestHeader->op) { - case HGFS_OP_CREATE_DIR_V2: + /* We'll use these later. */ + fileName = requestV3->fileName.name; + fileNameLength = &requestV3->fileName.length; + requestV3->fileName.flags = HGFS_FILE_NAME_CASE_SENSITIVE; + + requestSize = sizeof *requestV3 + sizeof *requestHeader; + + requestV3->mask = HGFS_CREATE_DIR_MASK; + + /* Set permissions. */ + requestV3->specialPerms = (mode & (S_ISUID | S_ISGID | S_ISVTX)) >> 9; + requestV3->ownerPerms = (mode & S_IRWXU) >> 6; + requestV3->groupPerms = (mode & S_IRWXG) >> 3; + requestV3->otherPerms = (mode & S_IRWXO); + break; + } + case HGFS_OP_CREATE_DIR_V2: { + HgfsRequestCreateDirV2 *requestV2; + requestV2 = (HgfsRequestCreateDirV2 *)(HGFS_REQ_PAYLOAD(req)); + requestV2->header.op = opUsed; + requestV2->header.id = req->id; /* We'll use these later. */ - fileNameP = &requestV2->fileName; + fileName = requestV2->fileName.name; + fileNameLength = &requestV2->fileName.length; requestSize = sizeof *requestV2; - requestV2->mask = - HGFS_CREATE_DIR_VALID_FILE_NAME | - HGFS_CREATE_DIR_VALID_SPECIAL_PERMS | - HGFS_CREATE_DIR_VALID_OWNER_PERMS | - HGFS_CREATE_DIR_VALID_GROUP_PERMS | - HGFS_CREATE_DIR_VALID_OTHER_PERMS; + requestV2->mask = HGFS_CREATE_DIR_MASK; /* Set permissions. */ requestV2->specialPerms = (mode & (S_ISUID | S_ISGID | S_ISVTX)) >> 9; @@ -617,16 +805,22 @@ HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create requestV2->groupPerms = (mode & S_IRWXG) >> 3; requestV2->otherPerms = (mode & S_IRWXO); break; - case HGFS_OP_CREATE_DIR: + } + case HGFS_OP_CREATE_DIR: { + HgfsRequestCreateDir *request; + request = (HgfsRequestCreateDir *)(HGFS_REQ_PAYLOAD(req)); /* We'll use these later. */ - fileNameP = &request->fileName; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; + requestSize = sizeof *request; requestSize = sizeof *request; /* Set permissions. */ request->permissions = (mode & S_IRWXU) >> 6; break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: unexpected " "OP type encountered\n")); @@ -634,7 +828,7 @@ HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create } /* Build full name to send to server. */ - if (HgfsBuildPath(fileNameP->name, + if (HgfsBuildPath(fileName, HGFS_PACKET_MAX - (requestSize - 1), dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: build path " @@ -642,12 +836,12 @@ HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create return -EINVAL; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: create dir " - "\"%s\", perms %o\n", fileNameP->name, mode)); + "\"%s\", perms %o\n", fileName, mode)); /* Convert to CP name. */ - result = CPName_ConvertTo(fileNameP->name, + result = CPName_ConvertTo(fileName, HGFS_PACKET_MAX - (requestSize - 1), - fileNameP->name); + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: CP " "conversion failed\n")); @@ -655,8 +849,8 @@ HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileNameP->name, result); - fileNameP->length = result; + result = HgfsUnescapeBuffer(fileName, result); + *fileNameLength = result; req->payloadSize = requestSize + result; return 0; @@ -946,19 +1140,15 @@ HgfsMkdir(struct inode *dir, // IN: Inode of parent directory struct dentry *dentry, // IN: Dentry with name to be created int mode) // IN: Mode of dir to be created { - struct HgfsSuperInfo *si; HgfsReq *req; + HgfsStatus replyStatus; HgfsOp opUsed; - HgfsRequest *requestHeader; - HgfsReplyCreateDir *reply; int result = 0; ASSERT(dir); ASSERT(dir->i_sb); ASSERT(dentry); - si = HGFS_SB_TO_COMMON(dir->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: out of memory while " @@ -967,16 +1157,13 @@ HgfsMkdir(struct inode *dir, // IN: Inode of parent directory goto out; } - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); retry: - /* - * Set up pointers using the proper struct This lets us check the - * version exactly once and use the pointers later. - */ - requestHeader->op = opUsed = atomic_read(&hgfsVersionCreateDir); - requestHeader->id = req->id; + opUsed = atomic_read(&hgfsVersionCreateDir); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_CREATE_DIR_V3; + } - result = HgfsPackCreateDirRequest(dentry, mode, req); + result = HgfsPackCreateDirRequest(dentry, mode, opUsed, req); if (result != 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: error packing request\n")); goto out; @@ -988,43 +1175,44 @@ HgfsMkdir(struct inode *dir, // IN: Inode of parent directory */ result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: wrong packet size\n")); - result = -EPROTO; - } else { - - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: got reply\n")); - reply = (HgfsReplyCreateDir *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - - switch (result) { - case 0: - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: directory created " - "successfully, instantiating dentry\n")); - result = HgfsInstantiate(dentry, 0, NULL); - if (result == 0) { - /* - * Attempt to set host directory's uid/gid to that of the - * current user. As with the open(.., O_CREAT) case, this is - * only expected to work when the hgfs server is running on - * a Linux machine and as root, but we might as well give it - * a go. - */ - HgfsSetUidGid(dir, dentry, current->fsuid, current->fsgid); - } + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + switch (result) { + case 0: + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: directory created " + "successfully, instantiating dentry\n")); + result = HgfsInstantiate(dentry, 0, NULL); + if (result == 0) { /* - * XXX: When we support hard links, this is a good place to - * increment link count of parent dir. + * Attempt to set host directory's uid/gid to that of the + * current user. As with the open(.., O_CREAT) case, this is + * only expected to work when the hgfs server is running on + * a Linux machine and as root, but we might as well give it + * a go. */ - break; - case -EPROTO: - /* Retry with Version 1 of CreateDir. Set globally. */ - if (opUsed == HGFS_OP_CREATE_DIR_V2) { + HgfsSetUidGid(dir, dentry, current->fsuid, current->fsgid); + } + + /* + * XXX: When we support hard links, this is a good place to + * increment link count of parent dir. + */ + break; + case -EPROTO: + /* Retry with older versions of CreateDir. Set globally. */ + if (opUsed == HGFS_OP_CREATE_DIR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: Version 3 not " + "supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR_V2); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } else if (opUsed == HGFS_OP_CREATE_DIR_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: Version 2 not " "supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); goto retry; } @@ -1034,7 +1222,6 @@ HgfsMkdir(struct inode *dir, // IN: Inode of parent directory "created, error %d\n", result)); break; } - } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: timed out\n")); } else if (result == -EPROTO) { @@ -1140,7 +1327,6 @@ HgfsRename(struct inode *oldDir, // IN: Inode of original directory struct inode *newDir, // IN: Inode of new directory struct dentry *newDentry) // IN: Dentry containing new name { - struct HgfsSuperInfo *si; HgfsReq *req = NULL; HgfsRequestRename *request; HgfsReplyRename *reply; @@ -1159,8 +1345,6 @@ HgfsRename(struct inode *oldDir, // IN: Inode of original directory goto out; } - si = HGFS_SB_TO_COMMON(oldDir->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: out of memory while " @@ -1264,12 +1448,12 @@ out: /* *---------------------------------------------------------------------- * - * HgfsSymlink -- + * HgfsPackSymlinkCreateRequest -- * - * Handle a symlink request + * Setup the create symlink request, depending on the op version. * * Results: - * Returns zero on success, or a negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -1278,64 +1462,85 @@ out: */ static int -HgfsSymlink(struct inode *dir, // IN: Inode of parent directory - struct dentry *dentry, // IN: Dentry of new symlink file - const char *symname) // IN: Target name +HgfsPackSymlinkCreateRequest(struct dentry *dentry, // IN: File pointer for this open + const char *symname, // IN: Target name + HgfsOp opUsed, // IN: Op to be used + HgfsReq *req) // IN/OUT: Packet to write into { - struct HgfsSuperInfo *si; - HgfsReq *req; - HgfsRequestSymlinkCreate *request; - HgfsReplySymlinkCreate *reply; - HgfsFileName *targetNameP = NULL; - int result = 0; + HgfsRequestSymlinkCreateV3 *requestV3 = NULL; + HgfsRequestSymlinkCreate *request = NULL; + char *symlinkName; + uint32 *symlinkNameLength; + char *targetName; + uint32 *targetNameLength; size_t targetNameBytes; - ASSERT(dir); - ASSERT(dir->i_sb); + size_t requestSize; + int result; + ASSERT(dentry); ASSERT(symname); + ASSERT(req); - si = HGFS_SB_TO_COMMON(dir->i_sb); + switch (opUsed) { + case HGFS_OP_CREATE_SYMLINK_V3: { + HgfsRequest *requestHeader; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestSymlinkCreateV3 *)HGFS_REQ_PAYLOAD_V3(req); - req = HgfsGetNewRequest(); - if (!req) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: out of memory while " - "getting new request\n")); - result = -ENOMEM; - goto out; + /* We'll use these later. */ + symlinkName = requestV3->symlinkName.name; + symlinkNameLength = &requestV3->symlinkName.length; + requestV3->symlinkName.flags = HGFS_FILE_NAME_CASE_SENSITIVE; + requestSize = sizeof *requestV3 + sizeof *requestHeader; + break; } + case HGFS_OP_CREATE_SYMLINK: { + + request = (HgfsRequestSymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; - request = (HgfsRequestSymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); - - request->header.id = req->id; - request->header.op = HGFS_OP_CREATE_SYMLINK; + /* We'll use these later. */ + symlinkName = request->symlinkName.name; + symlinkNameLength = &request->symlinkName.length; + requestSize = sizeof *request; + break; + } + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: unexpected " + "OP type encountered\n")); + return -EPROTO; + } - /* Build full symlink name to send to server. */ - if (HgfsBuildPath(request->symlinkName.name, HGFS_NAME_BUFFER_SIZE(request), + if (HgfsBuildPath(symlinkName, HGFS_PACKET_MAX - (requestSize - 1), dentry) < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: build symlink path " + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: build symlink path " "failed\n")); - result = -EINVAL; - goto out; + return -EINVAL; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: Symlink name: \"%s\"\n", - request->symlinkName.name)); + + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: Symlink name: \"%s\"\n", + symlinkName)); /* Convert symlink name to CP format. */ - result = CPName_ConvertTo(request->symlinkName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->symlinkName.name); + result = CPName_ConvertTo(symlinkName, + HGFS_PACKET_MAX - (requestSize - 1), + symlinkName); if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlinkName CP " + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: symlinkName CP " "conversion failed\n")); - result = -EINVAL; - goto out; + return -EINVAL; } /* Unescape the symlink CP name. */ - result = HgfsUnescapeBuffer(request->symlinkName.name, result); - request->symlinkName.length = result; - req->payloadSize = sizeof *request + result; + result = HgfsUnescapeBuffer(symlinkName, result); + *symlinkNameLength = result; + req->payloadSize = requestSize + result; /* * Note the different buffer length. This is because HgfsRequestSymlink @@ -1347,51 +1552,119 @@ HgfsSymlink(struct inode *dir, // IN: Inode of parent directory * we've converted it to CP name, it won't be NUL-terminated and the length * of the string in the packet itself won't account for it. */ - targetNameP = (HgfsFileName *)((char *)&request->symlinkName + - sizeof request->symlinkName + result); + if (opUsed == HGFS_OP_CREATE_SYMLINK_V3) { + HgfsFileNameV3 *fileNameP; + fileNameP = (HgfsFileNameV3 *)((char *)&requestV3->symlinkName + + sizeof requestV3->symlinkName + result); + targetName = fileNameP->name; + targetNameLength = &fileNameP->length; + fileNameP->flags = HGFS_FILE_NAME_CASE_SENSITIVE; + } else { + HgfsFileName *fileNameP; + fileNameP = (HgfsFileName *)((char *)&request->symlinkName + + sizeof request->symlinkName + result); + targetName = fileNameP->name; + targetNameLength = &fileNameP->length; + } targetNameBytes = strlen(symname) + 1; /* Copy target name into request packet. */ - if (targetNameBytes > HGFS_NAME_BUFFER_SIZE(request) - result) { + if (targetNameBytes > HGFS_PACKET_MAX - (requestSize - 1)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: target name is too " "big\n")); - result = -EINVAL; - goto out; + return -EINVAL; } - memcpy(targetNameP->name, symname, targetNameBytes); + memcpy(targetName, symname, targetNameBytes); LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: target name: \"%s\"\n", - targetNameP->name)); + targetName)); /* Convert target name to CPName-lite format. */ - CPNameLite_ConvertTo(targetNameP->name, targetNameBytes - 1, '/'); + CPNameLite_ConvertTo(targetName, targetNameBytes - 1, '/'); /* Unescape the target CP-lite name. */ - result = HgfsUnescapeBuffer(targetNameP->name, targetNameBytes - 1); - targetNameP->length = result; + result = HgfsUnescapeBuffer(targetName, targetNameBytes - 1); + *targetNameLength = result; req->payloadSize += result; + return 0; +} + + +/* + *---------------------------------------------------------------------- + * + * HgfsSymlink -- + * + * Handle a symlink request + * + * Results: + * Returns zero on success, or a negative error on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static int +HgfsSymlink(struct inode *dir, // IN: Inode of parent directory + struct dentry *dentry, // IN: Dentry of new symlink file + const char *symname) // IN: Target name +{ + HgfsReq *req; + int result = 0; + HgfsOp opUsed; + HgfsStatus replyStatus; + + ASSERT(dir); + ASSERT(dir->i_sb); + ASSERT(dentry); + ASSERT(symname); + + req = HgfsGetNewRequest(); + if (!req) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: out of memory while " + "getting new request\n")); + result = -ENOMEM; + goto out; + } + + retry: + opUsed = atomic_read(&hgfsVersionCreateSymlink); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_CREATE_SYMLINK_V3; + } + + result = HgfsPackSymlinkCreateRequest(dentry, symname, opUsed, req); + if (result != 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: error packing request\n")); + goto out; + } + result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: wrong packet size\n")); - result = -EPROTO; + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + if (result == 0) { + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink created " + "successfully, instantiating dentry\n")); + result = HgfsInstantiate(dentry, 0, NULL); } else { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: got reply\n")); - reply = (HgfsReplySymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - if (result == 0) { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink created " - "successfully, instantiating dentry\n")); - result = HgfsInstantiate(dentry, 0, NULL); - } else { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink was not " - "created, error %d\n", result)); - } + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink was not " + "created, error %d\n", result)); } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: timed out\n")); } else if (result == -EPROTO) { + /* Retry with older versions of Setattr. Set globally. */ + if (opUsed == HGFS_OP_CREATE_SYMLINK_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionCreateSymlink, HGFS_OP_CREATE_SYMLINK); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: server " "returned error: %d\n", result)); } else { @@ -1474,10 +1747,8 @@ int HgfsSetattr(struct dentry *dentry, // IN: File to set attributes of struct iattr *iattr) // IN: Attributes to set { - struct HgfsSuperInfo *si; HgfsReq *req; - HgfsRequest *requestHeader; - HgfsReplySetattr *reply; + HgfsStatus replyStatus; int result = 0; Bool changed = FALSE; Bool allowHandleReuse = TRUE; @@ -1489,8 +1760,6 @@ HgfsSetattr(struct dentry *dentry, // IN: File to set attributes of ASSERT(dentry->d_sb); ASSERT(iattr); - si = HGFS_SB_TO_COMMON(dentry->d_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: out of memory while " @@ -1499,14 +1768,15 @@ HgfsSetattr(struct dentry *dentry, // IN: File to set attributes of goto out; } - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - retry: /* Fill out the request packet. */ - requestHeader->op = opUsed = atomic_read(&hgfsVersionSetattr); - requestHeader->id = req->id; - result = HgfsPackSetattrRequest(iattr, dentry, req, &changed, - allowHandleReuse); + opUsed = atomic_read(&hgfsVersionSetattr); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_SETATTR_V3; + } + + result = HgfsPackSetattrRequest(iattr, dentry, allowHandleReuse, + opUsed, req, &changed); if (result != 0 || !changed) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: no attrs changed\n")); goto out; @@ -1524,8 +1794,8 @@ HgfsSetattr(struct dentry *dentry, // IN: File to set attributes of result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplySetattr *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); switch (result) { case 0: @@ -1577,11 +1847,18 @@ HgfsSetattr(struct dentry *dentry, // IN: File to set attributes of break; case -EPROTO: - /* Retry with Version 1 of Setattr. Set globally. */ - if (opUsed == HGFS_OP_SETATTR_V2) { + /* Retry with older versions of Setattr. Set globally. */ + if (opUsed == HGFS_OP_SETATTR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR_V2); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } else if (opUsed == HGFS_OP_SETATTR_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: Version 2 " "not supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); goto retry; } diff --git a/open-vm-tools/modules/linux/vmhgfs/kernelStubs.h b/open-vm-tools/modules/linux/vmhgfs/kernelStubs.h index ac7211c7d..6c443265f 100644 --- a/open-vm-tools/modules/linux/vmhgfs/kernelStubs.h +++ b/open-vm-tools/modules/linux/vmhgfs/kernelStubs.h @@ -21,7 +21,7 @@ * * KernelStubs implements some userspace library functions in terms * of kernel functions to allow library userspace code to be used in a - * kernel. + * kernel. */ #ifndef __KERNELSTUBS_H__ @@ -29,7 +29,7 @@ #ifdef linux # ifndef __KERNEL__ -# error "__KERNEL__ is not defined" +# error "__KERNEL__ is not defined" # endif # include "driver-config.h" // Must be included before any other header files # include "vm_basic_types.h" @@ -57,10 +57,10 @@ #elif defined(__APPLE__) # include "vm_basic_types.h" # ifndef KERNEL -# error "KERNEL is not defined" +# error "KERNEL is not defined" # endif # include -# include +# include #endif /* @@ -71,9 +71,6 @@ # ifdef linux /* if (linux) { */ char *strdup(const char *source); -# elif defined(__APPLE__) /* else if (__APPLE__) { */ -void KernelStubs_Init(void); -void KernelStubs_Cleanup(void); # endif /* Shared between Linux and Apple kernel stubs. */ @@ -130,6 +127,7 @@ __compat_malloc(unsigned long size, struct malloc_type *type, int flags) { /* * Stub functions we provide. */ + void Panic(const char *fmt, ...); char *Str_Strcpy(char *buf, const char *src, size_t maxSize); diff --git a/open-vm-tools/modules/linux/vmhgfs/kernelStubsLinux.c b/open-vm-tools/modules/linux/vmhgfs/kernelStubsLinux.c index e37f89d56..221f88a66 100644 --- a/open-vm-tools/modules/linux/vmhgfs/kernelStubsLinux.c +++ b/open-vm-tools/modules/linux/vmhgfs/kernelStubsLinux.c @@ -26,20 +26,13 @@ /* Must come before any kernel header file */ #include "driver-config.h" #include "kernelStubs.h" +#include "compat_kernel.h" #include "compat_page.h" #include "compat_sched.h" #include #include "vm_assert.h" -/* - * vsnprintf was born in 2.4.10. Fall back on vsprintf if we're - * an older kernel. - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) -#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) -#endif - /* *----------------------------------------------------------------------------- diff --git a/open-vm-tools/modules/linux/vmhgfs/module.h b/open-vm-tools/modules/linux/vmhgfs/module.h index 24e7c77bb..62211d5c2 100644 --- a/open-vm-tools/modules/linux/vmhgfs/module.h +++ b/open-vm-tools/modules/linux/vmhgfs/module.h @@ -32,6 +32,7 @@ #include #include "compat_completion.h" #include "compat_fs.h" +#include "compat_kthread.h" #include "compat_slab.h" #include "compat_spinlock.h" #include "compat_version.h" @@ -218,12 +219,12 @@ extern spinlock_t hgfsBigLock; * -Sending outgoing HGFS requests. * -Shutting down the request handler thread. * - * Finally, we use hgfsReqThreadDone to synchronize the stopping of the + * Finally, we use hgfsReqThread to synchronize the stopping of the * backdoor handler thread. */ extern long hgfsReqThreadFlags; extern wait_queue_head_t hgfsReqThreadWait; -extern compat_completion hgfsReqThreadDone; +extern struct task_struct *hgfsReqThread; /* Hgfs filesystem structs. */ extern struct super_operations HgfsSuperOperations; @@ -241,10 +242,14 @@ extern compat_kmem_cache *hgfsInodeCache; extern RpcOut *hgfsRpcOut; extern unsigned int hgfsIdCounter; extern struct list_head hgfsReqsUnsent; +extern atomic_t hgfsProtocolVersion; extern atomic_t hgfsVersionOpen; extern atomic_t hgfsVersionGetattr; extern atomic_t hgfsVersionSetattr; extern atomic_t hgfsVersionSearchRead; extern atomic_t hgfsVersionCreateDir; +extern atomic_t hgfsVersionSearchOpen; +extern atomic_t hgfsVersionCreateSymlink; +extern atomic_t hgfsVersionQueryVolumeInfo; #endif // _HGFS_DRIVER_MODULE_H_ diff --git a/open-vm-tools/modules/linux/vmhgfs/page.c b/open-vm-tools/modules/linux/vmhgfs/page.c index 95f3660d5..68c87b922 100644 --- a/open-vm-tools/modules/linux/vmhgfs/page.c +++ b/open-vm-tools/modules/linux/vmhgfs/page.c @@ -132,9 +132,11 @@ HgfsDoRead(HgfsHandle handle, // IN: Handle for this file loff_t offset) // IN: Offset at which to read { HgfsReq *req; - HgfsRequestRead *request; - HgfsReplyRead *reply; + HgfsOp opUsed; int result = 0; + uint32 actualSize = 0; + char *payload = NULL; + HgfsStatus replyStatus; ASSERT(buf); @@ -146,48 +148,85 @@ HgfsDoRead(HgfsHandle handle, // IN: Handle for this file goto out; } - /* Fill out the request fields. */ - request = (HgfsRequestRead *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_READ; - request->file = handle; - request->offset = offset; - request->requiredSize = count; - req->payloadSize = sizeof *request; + retry: + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + HgfsRequest *header; + HgfsRequestReadV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed = HGFS_OP_READ_V3; + + request = (HgfsRequestReadV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->file = handle; + request->offset = offset; + request->requiredSize = count; + req->payloadSize = sizeof *request + sizeof *header; + } else { + HgfsRequestRead *request; + + request = (HgfsRequestRead *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed = HGFS_OP_READ; + request->file = handle; + request->offset = offset; + request->requiredSize = count; + req->payloadSize = sizeof *request; + } + /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplyRead *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); - if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: read failed\n")); - goto out; - } - - /* Sanity check on read size. */ - if (reply->actualSize > count) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: read too big!\n")); - result = -EPROTO; - goto out; - } + switch (result) { + case 0: + if (opUsed == HGFS_OP_READ_V3) { + actualSize = ((HgfsReplyReadV3 *)HGFS_REP_PAYLOAD_V3(req))->actualSize; + payload = ((HgfsReplyReadV3 *)HGFS_REP_PAYLOAD_V3(req))->payload; + } else { + actualSize = ((HgfsReplyRead *)HGFS_REQ_PAYLOAD(req))->actualSize; + payload = ((HgfsReplyRead *)HGFS_REQ_PAYLOAD(req))->payload; + } + + /* Sanity check on read size. */ + if (actualSize > count) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: read too big!\n")); + result = -EPROTO; + goto out; + } - if (!reply->actualSize) { - /* We got no bytes, so don't need to copy to user. */ - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: server returned " - "zero\n")); - result = reply->actualSize; - goto out; + if (!actualSize) { + /* We got no bytes, so don't need to copy to user. */ + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: server returned " + "zero\n")); + result = actualSize; + goto out; + } + + /* Return result. */ + memcpy(buf, payload, actualSize); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: copied %u\n", + actualSize)); + result = actualSize; + break; + + case -EPROTO: + /* Retry with Version 2 of Open. Set globally. */ + if (opUsed == HGFS_OP_READ_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } + break; + + default: + break; } - - /* Return result. */ - memcpy(buf, reply->payload, reply->actualSize); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: copied %u\n", - reply->actualSize)); - result = reply->actualSize; - goto out; } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: timed out\n")); } else if (result == -EPROTO) { @@ -234,9 +273,13 @@ HgfsDoWrite(HgfsHandle handle, // IN: Handle for this file loff_t offset) // IN: Offset to begin writing at { HgfsReq *req; - HgfsRequestWrite *request; - HgfsReplyWrite *reply; int result = 0; + HgfsOp opUsed; + uint32 requiredSize = 0; + uint32 actualSize = 0; + char *payload = NULL; + uint32 reqSize; + HgfsStatus replyStatus; ASSERT(buf); @@ -248,35 +291,77 @@ HgfsDoWrite(HgfsHandle handle, // IN: Handle for this file goto out; } - /* Fill out the request fields. */ - request = (HgfsRequestWrite *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_WRITE; - request->file = handle; - request->flags = 0; - request->offset = offset; - request->requiredSize = count; + retry: + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + HgfsRequest *header; + HgfsRequestWriteV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed = HGFS_OP_WRITE_V3; + + request = (HgfsRequestWriteV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->file = handle; + request->flags = 0; + request->offset = offset; + request->requiredSize = count; + payload = request->payload; + requiredSize = request->requiredSize; + reqSize = sizeof *request + sizeof *header; + } else { + HgfsRequestWrite *request; + + request = (HgfsRequestWrite *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed = HGFS_OP_WRITE; + request->file = handle; + request->flags = 0; + request->offset = offset; + request->requiredSize = count; + payload = request->payload; + requiredSize = request->requiredSize; + reqSize = sizeof *request; + } - memcpy(request->payload, buf, request->requiredSize); - req->payloadSize = sizeof *request + request->requiredSize - 1; + memcpy(payload, buf, requiredSize); + req->payloadSize = reqSize + requiredSize - 1; /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplyWrite *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - - if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: write failed\n")); - goto out; - } + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + switch (result) { + case 0: + if (opUsed == HGFS_OP_WRITE_V3) { + actualSize = ((HgfsReplyReadV3 *)HGFS_REP_PAYLOAD_V3(req))->actualSize; + } else { + actualSize = ((HgfsReplyRead *)HGFS_REQ_PAYLOAD(req))->actualSize; + } - /* Return result. */ - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: wrote %u bytes\n", - reply->actualSize)); - result = reply->actualSize; - goto out; + /* Return result. */ + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: wrote %u bytes\n", + actualSize)); + result = actualSize; + break; + + case -EPROTO: + /* Retry with Version 2 of Open. Set globally. */ + if (opUsed == HGFS_OP_WRITE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + goto retry; + } + break; + + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: server " + "returned error: %d\n", result)); + break; + } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: timed out\n")); } else if (result == -EPROTO) { diff --git a/open-vm-tools/modules/linux/vmhgfs/request.c b/open-vm-tools/modules/linux/vmhgfs/request.c index 03a3e4b4c..918f75e7b 100644 --- a/open-vm-tools/modules/linux/vmhgfs/request.c +++ b/open-vm-tools/modules/linux/vmhgfs/request.c @@ -245,3 +245,31 @@ HgfsFreeRequest(HgfsReq *req) // IN: Request to free } } + +/* + *---------------------------------------------------------------------- + * + * HgfsReplyStatus -- + * + * Return reply status. + * + * Results: + * Returns reply status as per the protocol. + * XXX: Needs changes when vmci headers are added. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +HgfsStatus +HgfsReplyStatus(HgfsReq *req) // IN +{ + HgfsReply *rep; + + rep = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); + + return rep->status; +} + diff --git a/open-vm-tools/modules/linux/vmhgfs/request.h b/open-vm-tools/modules/linux/vmhgfs/request.h index 8e93ba8a1..ef5f37973 100644 --- a/open-vm-tools/modules/linux/vmhgfs/request.h +++ b/open-vm-tools/modules/linux/vmhgfs/request.h @@ -40,6 +40,10 @@ /* Macros for accessing the payload portion of the HGFS request packet. */ #define HGFS_REQ_PAYLOAD(hgfsReq) ((hgfsReq)->packet + HGFS_CLIENT_CMD_LEN) +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_PAYLOAD_V3(hgfsReq) (HGFS_REQ_PAYLOAD(hgfsReq) + sizeof(HgfsRequest)) +#define HGFS_REP_PAYLOAD_V3(hgfsRep) (HGFS_REQ_PAYLOAD(hgfsRep) + sizeof(HgfsReply)) + /* * HGFS_REQ_STATE_ALLOCATED: * The filesystem half has allocated the request from the slab @@ -109,5 +113,6 @@ typedef struct HgfsReq { HgfsReq *HgfsGetNewRequest(void); int HgfsSendRequest(HgfsReq *req); void HgfsFreeRequest(HgfsReq *req); +HgfsStatus HgfsReplyStatus(HgfsReq *req); // IN #endif // _HGFS_DRIVER_REQUEST_H_ diff --git a/open-vm-tools/modules/linux/vmhgfs/super.c b/open-vm-tools/modules/linux/vmhgfs/super.c index 9f73d8e43..f4dcd866d 100644 --- a/open-vm-tools/modules/linux/vmhgfs/super.c +++ b/open-vm-tools/modules/linux/vmhgfs/super.c @@ -50,7 +50,9 @@ static struct inode *HgfsAllocInode(struct super_block *sb); static void HgfsDestroyInode(struct inode *inode); #endif +#ifndef VMW_USE_IGET_LOCKED static void HgfsReadInode(struct inode *inode); +#endif static void HgfsClearInode(struct inode *inode); static void HgfsPutSuper(struct super_block *sb); #if defined(VMW_STATFS_2618) @@ -66,7 +68,9 @@ struct super_operations HgfsSuperOperations = { .alloc_inode = HgfsAllocInode, .destroy_inode = HgfsDestroyInode, #endif +#ifndef VMW_USE_IGET_LOCKED .read_inode = HgfsReadInode, +#endif .clear_inode = HgfsClearInode, .put_super = HgfsPutSuper, .statfs = HgfsStatfs, @@ -134,6 +138,9 @@ HgfsDestroyInode(struct inode *inode) // IN: The VFS inode } #endif + + +#ifndef VMW_USE_IGET_LOCKED /* *----------------------------------------------------------------------------- * @@ -154,31 +161,9 @@ HgfsDestroyInode(struct inode *inode) // IN: The VFS inode static void HgfsReadInode(struct inode *inode) // IN/OUT: VFS inode to fill in { - HgfsInodeInfo *iinfo = INODE_GET_II_P(inode); - - /* - * If the vfs inode is not embedded within the HgfsInodeInfo, then we - * haven't yet allocated the HgfsInodeInfo. Do so now. - * - * XXX: We could allocate with GFP_ATOMIC. But instead, we'll do a standard - * allocation and mark the inode "bad" if the allocation fails. This'll - * make all subsequent operations on the inode fail, which is what we want. - */ -#ifndef VMW_EMBED_INODE - iinfo = kmem_cache_alloc(hgfsInodeCache, GFP_KERNEL); - if (!iinfo) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsReadInode: no memory for " - "iinfo!\n")); - make_bad_inode(inode); - return; - } -#endif - INODE_SET_II_P(inode, iinfo); - INIT_LIST_HEAD(&iinfo->files); - iinfo->isReferencedInode = FALSE; - iinfo->isFakeInodeNumber = FALSE; - iinfo->createdAndUnopened = FALSE; + HgfsDoReadInode(inode); } +#endif /* @@ -249,6 +234,99 @@ HgfsPutSuper(struct super_block *sb) // IN: The superblock } +/* + *---------------------------------------------------------------------- + * + * HgfsPackQueryVolumeRequest -- + * + * Setup the query volume request, depending on the op version. + * + * Results: + * Returns zero on success, or negative error on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static int +HgfsPackQueryVolumeRequest(struct dentry *dentry, // IN: File pointer for this open + HgfsOp opUsed, // IN: Op to be used. + HgfsReq *req) // IN/OUT: Packet to write into +{ + char *name; + uint32 *nameLength; + size_t requestSize; + int result; + + ASSERT(dentry); + ASSERT(req); + + switch (opUsed) { + case HGFS_OP_QUERY_VOLUME_INFO_V3: { + HgfsRequest *requestHeader; + HgfsRequestQueryVolumeV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestQueryVolumeV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* We'll use these later. */ + name = requestV3->fileName.name; + nameLength = &requestV3->fileName.length; + requestV3->fileName.flags = HGFS_FILE_NAME_CASE_SENSITIVE; + requestSize = sizeof *requestV3 + sizeof *requestHeader; + break; + } + case HGFS_OP_QUERY_VOLUME_INFO: { + HgfsRequestQueryVolume *request; + + request = (HgfsRequestQueryVolume *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; + + /* We'll use these later. */ + name = request->fileName.name; + nameLength = &request->fileName.length; + requestSize = sizeof *request; + break; + } + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: unexpected " + "OP type encountered\n")); + return -EPROTO; + } + + /* Build full name to send to server. */ + if (HgfsBuildPath(name, HGFS_PACKET_MAX - (requestSize - 1), + dentry) < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: build path failed\n")); + return -EINVAL; + } + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: opening \"%s\"\n", + name)); + + /* Convert to CP name. */ + result = CPName_ConvertTo(name, + HGFS_PACKET_MAX - (requestSize - 1), + name); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: CP conversion failed\n")); + return -EINVAL; + } + + /* Unescape the CP name. */ + result = HgfsUnescapeBuffer(name, result); + *nameLength = (uint32) result; + req->payloadSize = requestSize + result; + + return 0; +} + + /* *----------------------------------------------------------------------------- * @@ -278,11 +356,13 @@ HgfsStatfs(struct super_block *sb, // IN : The superblock #endif { HgfsReq *req; - HgfsRequestQueryVolume *request; - HgfsReplyQueryVolume *reply; int result = 0; struct dentry *dentryToUse; struct super_block *sbToUse; + HgfsOp opUsed; + HgfsStatus replyStatus; + uint64 freeBytes; + uint64 totalBytes; ASSERT(stat); #if defined(VMW_STATFS_2618) @@ -307,42 +387,23 @@ HgfsStatfs(struct super_block *sb, // IN : The superblock goto out; } - request = (HgfsRequestQueryVolume *)(HGFS_REQ_PAYLOAD(req)); - - /* Fill out the request packet. */ - request->header.op = HGFS_OP_QUERY_VOLUME_INFO; - request->header.id = req->id; - - /* Build full name to send to server. */ - if (HgfsBuildPath(request->fileName.name, HGFS_NAME_BUFFER_SIZE(request), - dentryToUse) < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: build path failed\n")); - result = -EINVAL; - goto out; + retry: + opUsed = atomic_read(&hgfsVersionQueryVolumeInfo); + if (atomic_read(&hgfsProtocolVersion) == HGFS_VERSION_3) { + opUsed = HGFS_OP_QUERY_VOLUME_INFO_V3; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsStatfs: getting fs stats on \"%s\"\n", - request->fileName.name)); - /* Convert to CP name. */ - result = CPName_ConvertTo(request->fileName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->fileName.name); - if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: CP conversion failed\n")); - result = -EINVAL; + result = HgfsPackQueryVolumeRequest(dentryToUse, opUsed, req); + if (result != 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: error packing request\n")); goto out; } - /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(request->fileName.name, result); - request->fileName.length = result; - req->payloadSize = sizeof *request + result; - result = HgfsSendRequest(req); if (result == 0) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsStatfs: got reply\n")); - reply = (HgfsReplyQueryVolume *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); /* * If the statfs succeeded on the server, copy the stats @@ -353,31 +414,47 @@ HgfsStatfs(struct super_block *sb, // IN : The superblock stat->f_type = HGFS_SUPER_MAGIC; stat->f_bsize = sbToUse->s_blocksize; stat->f_namelen = PATH_MAX; - stat->f_blocks = reply->totalBytes >> sbToUse->s_blocksize_bits; - stat->f_bfree = reply->freeBytes >> sbToUse->s_blocksize_bits; stat->f_bavail = stat->f_bfree; + if (opUsed == HGFS_OP_QUERY_VOLUME_INFO_V3) { + totalBytes = ((HgfsReplyQueryVolumeV3 *)HGFS_REP_PAYLOAD_V3(req))->totalBytes; + freeBytes = ((HgfsReplyQueryVolumeV3 *)HGFS_REP_PAYLOAD_V3(req))->freeBytes; + } else { + totalBytes = ((HgfsReplyQueryVolume *)HGFS_REQ_PAYLOAD(req))->totalBytes; + freeBytes = ((HgfsReplyQueryVolume *)HGFS_REQ_PAYLOAD(req))->freeBytes; + } + stat->f_blocks = totalBytes >> sbToUse->s_blocksize_bits; + stat->f_bfree = freeBytes >> sbToUse->s_blocksize_bits; break; case -EPERM: - /* - * We're cheating! This will cause statfs will return success. + /* + * We're cheating! This will cause statfs will return success. * We're doing this because an old server will complain when it gets * a statfs on a per-share mount. Rather than have 'df' spit an * error, let's just return all zeroes. */ result = 0; break; - + default: break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: timed out\n")); } else if (result == -EPROTO) { + /* Retry with Version 1 of SearchOpen. Set globally. */ + if (opUsed == HGFS_OP_QUERY_VOLUME_INFO_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsProtocolVersion, HGFS_VERSION_OLD); + atomic_set(&hgfsVersionQueryVolumeInfo, HGFS_OP_QUERY_VOLUME_INFO); + goto retry; + } + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: server returned error: " "%d\n", result)); } else { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: unknown error: %d\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: unknown error: %d\n", result)); } diff --git a/open-vm-tools/modules/linux/vmhgfs/vm_assert.h b/open-vm-tools/modules/linux/vmhgfs/vm_assert.h index c170ddefd..12b67f3ef 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vm_assert.h +++ b/open-vm-tools/modules/linux/vmhgfs/vm_assert.h @@ -98,8 +98,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm.h b/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm.h index 8dcad4baa..80d6cda6f 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm.h +++ b/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm.h @@ -413,12 +413,21 @@ __GET_CPUID(int input, CPUIDRegs *regs) #endif } +#ifdef VM_X86_64 + +/* + * No inline assembly in Win64. Implemented in bora/lib/user in + * cpuidMasm64.asm. + */ + +extern void +__GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs); + +#else // VM_X86_64 + static INLINE void __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) { -#ifdef VM_X86_64 - *(int*)0 = 0; // NOT_IMPLEMENTED(); -#else __asm push esi __asm push ebx __asm push ecx @@ -437,8 +446,8 @@ __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) __asm pop ecx __asm pop ebx __asm pop esi -#endif } +#endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) diff --git a/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86.h b/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86.h index e40035aeb..ce83e3be7 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86.h +++ b/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86.h @@ -100,16 +100,13 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0\n" : "=m" (*save)); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*load)); } static INLINE void @@ -117,7 +114,8 @@ FXRSTOR_AMD_ES0(const uint8 *load) { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __asm__ __volatile__ + ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap @@ -130,8 +128,7 @@ FXRSTOR_AMD_ES0(const uint8 *load) : "m" (dummy), "m" (*load) : "ax"); } - -#endif +#endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- diff --git a/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86_64.h b/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86_64.h index 6b0a2f1b0..72db20a4f 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86_64.h +++ b/open-vm-tools/modules/linux/vmhgfs/vm_basic_asm_x86_64.h @@ -84,31 +84,25 @@ uint64 __shiftright128(uint64 lowPart, uint64 highPart, uint8 shift); static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsaveq %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsaveq %0 \n" : "=m" (*save)); } static INLINE void FXSAVE_COMPAT_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0 \n" : "=m" (*save)); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstorq %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstorq %0 \n" : : "m" (*load)); } static INLINE void FXRSTOR_COMPAT_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0 \n" : : "m" (*load)); } static INLINE void @@ -116,7 +110,8 @@ FXRSTOR_AMD_ES0(const uint8 *load) { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __asm__ __volatile__ + ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap @@ -130,7 +125,7 @@ FXRSTOR_AMD_ES0(const uint8 *load) : "ax"); } -#endif +#endif /* __GNUC__ */ /* diff --git a/open-vm-tools/modules/linux/vmhgfs/vm_basic_defs.h b/open-vm-tools/modules/linux/vmhgfs/vm_basic_defs.h index f07223c96..bd264c975 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vm_basic_defs.h +++ b/open-vm-tools/modules/linux/vmhgfs/vm_basic_defs.h @@ -108,6 +108,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -543,14 +545,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/modules/linux/vmhgfs/vm_basic_types.h b/open-vm-tools/modules/linux/vmhgfs/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vm_basic_types.h +++ b/open-vm-tools/modules/linux/vmhgfs/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/linux/vmhgfs/vmhgfs_version.h b/open-vm-tools/modules/linux/vmhgfs/vmhgfs_version.h index eb3963f25..1ed359358 100644 --- a/open-vm-tools/modules/linux/vmhgfs/vmhgfs_version.h +++ b/open-vm-tools/modules/linux/vmhgfs/vmhgfs_version.h @@ -25,8 +25,8 @@ #ifndef _VMHGFS_VERSION_H_ #define _VMHGFS_VERSION_H_ -#define VMHGFS_DRIVER_VERSION 1.2.1.1 -#define VMHGFS_DRIVER_VERSION_COMMAS 1,2,1,1 -#define VMHGFS_DRIVER_VERSION_STRING "1.2.1.1" +#define VMHGFS_DRIVER_VERSION 1.4.1.1 +#define VMHGFS_DRIVER_VERSION_COMMAS 1,4,1,1 +#define VMHGFS_DRIVER_VERSION_STRING "1.4.1.1" #endif /* _VMHGFS_VERSION_H_ */ diff --git a/open-vm-tools/modules/linux/vmhgfs/x86cpuid.h b/open-vm-tools/modules/linux/vmhgfs/x86cpuid.h index e0617fe66..07e500d68 100644 --- a/open-vm-tools/modules/linux/vmhgfs/x86cpuid.h +++ b/open-vm-tools/modules/linux/vmhgfs/x86cpuid.h @@ -92,6 +92,8 @@ typedef struct CPUIDResult { #define CPUID_UNCACHED_LEVELS \ CPUIDLEVEL(FALSE, 4, 4) \ + CPUIDLEVEL(FALSE, 5, 5) \ + CPUIDLEVEL(FALSE, 6, 6) \ CPUIDLEVEL(FALSE, A, 0xA) \ CPUIDLEVEL(FALSE, 86, 0x80000006) \ CPUIDLEVEL(FALSE, 87, 0x80000007) \ @@ -248,6 +250,8 @@ FLAGDEF( 1, ECX, INTEL, 21, 1, X2APIC, MASK, 0, FALSE) FLAGDEF( 1, ECX, INTEL, 22, 1, MOVBE, RSVD, 0, TRUE) \ FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, HOST, 0, TRUE, POPCNT) \ FLAGDEF( 1, ECX, INTEL, 24, 1, ULE, RSVD, 0, TRUE) \ +FLAGDEF( 1, ECX, INTEL, 26, 1, XSAVE, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 27, 1, OSXSAVE, RSVD, 0, TRUE) \ FLAGDEFA( 1, ECX, COMMON, 31, 1, HYPERVISOR, IGNORE, 0, FALSE, HYPERVISOR)\ FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, HOST, 0, TRUE, FPU) \ FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, HOST, 0, FALSE, VME) \ @@ -290,6 +294,25 @@ FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, IGNORE, 0, FALSE) FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, IGNORE, 0, FALSE) \ FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, IGNORE, 0, FALSE) +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_5 \ +FIELDDEF( 5, EAX, COMMON, 0, 16, MWAIT_MIN_SIZE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EBX, COMMON, 0, 16, MWAIT_MAX_SIZE, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 0, 1, MWAIT_EXTENSIONS, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 1, 1, MWAIT_INTR_BREAK, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 0, 4, MWAIT_C0_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 4, 4, MWAIT_C1_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 8, 4, MWAIT_C2_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 12, 4, MWAIT_C3_SUBSTATE, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 16, 4, MWAIT_C4_SUBSTATE, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_6 \ +FLAGDEF( 6, EAX, INTEL, 0, 1, THERMAL_SENSOR, IGNORE, 0, FALSE) \ +FLAGDEF( 6, EAX, INTEL, 1, 1, TURBO_MODE, IGNORE, 0, FALSE) \ +FIELDDEF( 6, EBX, INTEL, 0, 4, NUM_INTR_THRESHOLDS, IGNORE, 0, FALSE) \ +FLAGDEF( 6, ECX, INTEL, 0, 1, HW_COORD_FEEDBACK, IGNORE, 0, FALSE) + /* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_A \ FIELDDEF( A, EAX, INTEL, 0, 8, PMC_VERSION, IGNORE, 0, FALSE) \ @@ -371,6 +394,14 @@ FIELDDEF( 86, ECX, AMD, 0, 8, CACHE_LINE, IGNORE, 0, FALSE) FIELDDEF( 86, ECX, AMD, 8, 4, CACHE_LINE_PER_TAG, IGNORE, 0, FALSE) \ FIELDDEF( 86, ECX, AMD, 12, 4, CACHE_WAYS, IGNORE, 0, FALSE) \ FIELDDEF( 86, ECX, AMD, 16, 16, CACHE_SIZE, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 0, 1, TS, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 1, 1, FID, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 2, 1, VID, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 3, 1, TTP, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 4, 1, TM, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 5, 1, STC, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 6, 1, 100MHZSTEPS, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 7, 1, HWPSTATE, IGNORE, 0, FALSE) \ FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, IGNORE, 0, FALSE) \ FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, IGNORE, 0, FALSE, PHYS_BITS) \ FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, IGNORE, 0, FALSE, VIRT_BITS) \ @@ -391,6 +422,8 @@ FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, MASK, 0, FALSE) CPUID_FIELD_DATA_LEVEL_0 \ CPUID_FIELD_DATA_LEVEL_1 \ CPUID_FIELD_DATA_LEVEL_4 \ + CPUID_FIELD_DATA_LEVEL_5 \ + CPUID_FIELD_DATA_LEVEL_6 \ CPUID_FIELD_DATA_LEVEL_A \ CPUID_FIELD_DATA_LEVEL_80 \ CPUID_FIELD_DATA_LEVEL_81 \ @@ -519,6 +552,13 @@ FIELD_FUNC(AMD_CORE_COUNT, CPUID_AMD_ID88ECX_CORE_COUNT) FIELD_FUNC(AMD_APICID_COREID_SIZE, CPUID_AMD_ID88ECX_APICID_COREID_SIZE) FIELD_FUNC(AMD_EXTAPICSPC, CPUID_AMD_ID81ECX_EXTAPICSPC) FIELD_FUNC(NUM_PMCS, CPUID_INTEL_IDAEAX_NUM_PMCS) +FIELD_FUNC(MWAIT_MIN_SIZE, CPUID_COMMON_ID5EAX_MWAIT_MIN_SIZE) +FIELD_FUNC(MWAIT_MAX_SIZE, CPUID_COMMON_ID5EBX_MWAIT_MAX_SIZE) +FIELD_FUNC(MWAIT_C0_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C0_SUBSTATE) +FIELD_FUNC(MWAIT_C1_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C1_SUBSTATE) +FIELD_FUNC(MWAIT_C2_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C2_SUBSTATE) +FIELD_FUNC(MWAIT_C3_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C3_SUBSTATE) +FIELD_FUNC(MWAIT_C4_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C4_SUBSTATE) #undef FIELD_FUNC @@ -706,19 +746,52 @@ CPUID_FullyWritableTSC(Bool isIntel, // IN CPUID_FAMILY(v) < CPUID_FAMILY_K8)); } + /* * For certain AMD processors, an lfence instruction is necessary at various * places to ensure ordering. */ + +static INLINE Bool +CPUID_VendorRequiresFence(CpuidVendors vendor) +{ + return vendor == CPUID_VENDOR_AMD; +} + +static INLINE Bool +CPUID_VersionRequiresFence(uint32 version) +{ + return CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8 && + CPUID_EFFECTIVE_MODEL(version) < 0x40; +} + +static INLINE Bool +CPUID_ID0RequiresFence(CPUIDRegs *id0) +{ + if (id0->eax == 0) { + return FALSE; + } + // hard to get strcmp() in some environments, so do it in the raw + return (id0->ebx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 0) && + id0->ecx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 4) && + id0->edx == *(uint32 *) (CPUID_AMD_VENDOR_STRING + 8)); +} + +static INLINE Bool +CPUID_ID1RequiresFence(CPUIDRegs *id1) +{ + return CPUID_VersionRequiresFence(id1->eax); +} + static INLINE Bool CPUID_RequiresFence(CpuidVendors vendor, // IN uint32 version) // IN: %eax from CPUID with %eax=1. { - return ((vendor == CPUID_VENDOR_AMD) && - (CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8) && - (CPUID_EFFECTIVE_MODEL(version) < 0x40)); + return CPUID_VendorRequiresFence(vendor) && + CPUID_VersionRequiresFence(version); } + /* * The following low-level functions compute the number of * cores per cpu. They should be used cautiously because diff --git a/open-vm-tools/modules/linux/vmmemctl/backdoor_def.h b/open-vm-tools/modules/linux/vmmemctl/backdoor_def.h index 0f97efb18..da052ec2b 100644 --- a/open-vm-tools/modules/linux/vmmemctl/backdoor_def.h +++ b/open-vm-tools/modules/linux/vmmemctl/backdoor_def.h @@ -110,7 +110,8 @@ #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 #define BDOOR_CMD_VASSERT 51 -#define BDOOR_CMD_MAX 52 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_MAX 53 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, diff --git a/open-vm-tools/modules/linux/vmmemctl/compat_kernel.h b/open-vm-tools/modules/linux/vmmemctl/compat_kernel.h index 76b47cfad..5d230646b 100644 --- a/open-vm-tools/modules/linux/vmmemctl/compat_kernel.h +++ b/open-vm-tools/modules/linux/vmmemctl/compat_kernel.h @@ -72,5 +72,12 @@ static inline _syscall1(int, compat_exit, int, exit_code); #endif +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif #endif /* __COMPAT_KERNEL_H__ */ diff --git a/open-vm-tools/modules/linux/vmmemctl/compat_sched.h b/open-vm-tools/modules/linux/vmmemctl/compat_sched.h index 6fc79dcfd..460ff5b9e 100644 --- a/open-vm-tools/modules/linux/vmmemctl/compat_sched.h +++ b/open-vm-tools/modules/linux/vmmemctl/compat_sched.h @@ -27,6 +27,11 @@ #define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND #endif +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + /* The capable() API appeared in 2.1.92 --hpreg */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) # define capable(_capability) suser() diff --git a/open-vm-tools/modules/linux/vmmemctl/vm_assert.h b/open-vm-tools/modules/linux/vmmemctl/vm_assert.h index c170ddefd..12b67f3ef 100644 --- a/open-vm-tools/modules/linux/vmmemctl/vm_assert.h +++ b/open-vm-tools/modules/linux/vmmemctl/vm_assert.h @@ -98,8 +98,6 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ diff --git a/open-vm-tools/modules/linux/vmmemctl/vm_basic_defs.h b/open-vm-tools/modules/linux/vmmemctl/vm_basic_defs.h index f07223c96..bd264c975 100644 --- a/open-vm-tools/modules/linux/vmmemctl/vm_basic_defs.h +++ b/open-vm-tools/modules/linux/vmmemctl/vm_basic_defs.h @@ -108,6 +108,8 @@ Max(int a, int b) #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) + /* * Not everybody (e.g., the monitor) has NULL @@ -543,14 +545,6 @@ typedef int pid_t; #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x -#else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) -#endif - #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else diff --git a/open-vm-tools/modules/linux/vmmemctl/vm_basic_types.h b/open-vm-tools/modules/linux/vmmemctl/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/linux/vmmemctl/vm_basic_types.h +++ b/open-vm-tools/modules/linux/vmmemctl/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/linux/vmsync/compat_fs.h b/open-vm-tools/modules/linux/vmsync/compat_fs.h index d1c083a3d..474a43e86 100644 --- a/open-vm-tools/modules/linux/vmsync/compat_fs.h +++ b/open-vm-tools/modules/linux/vmsync/compat_fs.h @@ -80,8 +80,8 @@ * * The VFS exports do_sync_read() and do_sync_write() as the "new" * generic_file_read() and generic_file_write(), but filesystems need not - * actually implement read and write- the VFS will automatically call - * do_sync_write() and do_sync_read() when applications invoke the standard + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard * read() and write() system calls. * * In 2.6.19, generic_file_read() and generic_file_write() were removed, @@ -103,6 +103,14 @@ #endif +/* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + /* * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 * implementation. It uses the dcache lock which is OK because per-dentry diff --git a/open-vm-tools/modules/linux/vmsync/compat_namei.h b/open-vm-tools/modules/linux/vmsync/compat_namei.h index a3176f524..28d72c8e1 100644 --- a/open-vm-tools/modules/linux/vmsync/compat_namei.h +++ b/open-vm-tools/modules/linux/vmsync/compat_namei.h @@ -23,6 +23,23 @@ #include #endif +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + /* path_lookup was exported in 2.4.25 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) #define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) diff --git a/open-vm-tools/modules/linux/vmsync/sync.c b/open-vm-tools/modules/linux/vmsync/sync.c index a105147e3..d06bab75e 100644 --- a/open-vm-tools/modules/linux/vmsync/sync.c +++ b/open-vm-tools/modules/linux/vmsync/sync.c @@ -223,7 +223,7 @@ VmSyncAddPath(const VmSyncState *state, // IN if ((result = path_lookup(path, LOOKUP_FOLLOW, &nd)) != 0) { goto exit; } - inode = nd.dentry->d_inode; + inode = compat_vmw_nd_to_dentry(nd)->d_inode; /* * Abort if the inode's superblock isn't backed by a block device, or if @@ -232,7 +232,7 @@ VmSyncAddPath(const VmSyncState *state, // IN if (inode->i_sb->s_bdev == NULL || inode->i_sb->s_frozen != SB_UNFROZEN) { result = (inode->i_sb->s_bdev == NULL) ? -EINVAL : -EALREADY; - path_release(&nd); + compat_path_release(&nd); goto exit; } @@ -243,7 +243,7 @@ VmSyncAddPath(const VmSyncState *state, // IN dev = list_entry(cur, VmSyncBlockDevice, list); if (dev->bdev == inode->i_sb->s_bdev) { result = 0; - path_release(&nd); + compat_path_release(&nd); goto exit; } } @@ -254,7 +254,7 @@ VmSyncAddPath(const VmSyncState *state, // IN dev = kmem_cache_alloc(gBlockDeviceCache, GFP_KERNEL); if (dev == NULL) { result = -ENOMEM; - path_release(&nd); + compat_path_release(&nd); goto exit; } @@ -350,7 +350,7 @@ VmSyncFreezeDevices(VmSyncState *state, // IN dev = list_entry(cur, VmSyncBlockDevice, list); if (result == 0) { dev->sb = freeze_bdev(dev->bdev); - path_release(&dev->nd); + compat_path_release(&dev->nd); if (dev->sb != NULL) { atomic_inc(&gFreezeCount); } diff --git a/open-vm-tools/modules/linux/vmsync/vmsync_version.h b/open-vm-tools/modules/linux/vmsync/vmsync_version.h index bc9931227..5b3ed875c 100644 --- a/open-vm-tools/modules/linux/vmsync/vmsync_version.h +++ b/open-vm-tools/modules/linux/vmsync/vmsync_version.h @@ -25,8 +25,8 @@ #ifndef _VMSYNC_VERSION_H_ #define _VMSYNC_VERSION_H_ -#define VMSYNC_DRIVER_VERSION 1.0.0.1 -#define VMSYNC_DRIVER_VERSION_COMMAS 1,0,0,1 -#define VMSYNC_DRIVER_VERSION_STRING "1.0.0.1" +#define VMSYNC_DRIVER_VERSION 1.1.0.1 +#define VMSYNC_DRIVER_VERSION_COMMAS 1,1,0,1 +#define VMSYNC_DRIVER_VERSION_STRING "1.1.0.1" #endif /* _VMSYNC_VERSION_H_ */ diff --git a/open-vm-tools/modules/linux/vmxnet/compat_netdevice.h b/open-vm-tools/modules/linux/vmxnet/compat_netdevice.h index 2e1c3ee91..cfdad2b3f 100644 --- a/open-vm-tools/modules/linux/vmxnet/compat_netdevice.h +++ b/open-vm-tools/modules/linux/vmxnet/compat_netdevice.h @@ -169,6 +169,13 @@ compat_alloc_netdev(int priv_size, # define compat_free_netdev(dev) free_netdev(dev) #endif +/* netdev_priv() appeared in 2.6.3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3) +# define compat_netdev_priv(netdev) (netdev)->priv +#else +# define compat_netdev_priv(netdev) netdev_priv(netdev) +#endif + #if defined(NETDEV_TX_OK) # define COMPAT_NETDEV_TX_OK NETDEV_TX_OK # define COMPAT_NETDEV_TX_BUSY NETDEV_TX_BUSY diff --git a/open-vm-tools/modules/linux/vmxnet/compat_pci.h b/open-vm-tools/modules/linux/vmxnet/compat_pci.h index 5701e3433..9b1231df6 100644 --- a/open-vm-tools/modules/linux/vmxnet/compat_pci.h +++ b/open-vm-tools/modules/linux/vmxnet/compat_pci.h @@ -554,4 +554,25 @@ pci_get_drvdata(struct pci_dev *pdev) # define PCI_DMA_FROMDEVICE 2 # define PCI_DMA_NONE 3 #endif + +/* + * Power Management related compat wrappers. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10) +# define compat_pci_save_state(pdev) pci_save_state((pdev), NULL) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev), NULL) +#else +# define compat_pci_save_state(pdev) pci_save_state((pdev)) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev)) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) +# define pm_message_t u32 +# define compat_pci_choose_state(pdev, state) (state) +# define PCI_D0 0 +# define PCI_D3hot 3 +#else +# define compat_pci_choose_state(pdev, state) pci_choose_state((pdev), (state)) +#endif + #endif /* __COMPAT_PCI_H__ */ diff --git a/open-vm-tools/modules/linux/vmxnet/vm_basic_types.h b/open-vm-tools/modules/linux/vmxnet/vm_basic_types.h index b0b0396c0..50afb4c21 100644 --- a/open-vm-tools/modules/linux/vmxnet/vm_basic_types.h +++ b/open-vm-tools/modules/linux/vmxnet/vm_basic_types.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -838,4 +838,14 @@ typedef uintptr_t PollDevHandle; typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff --git a/open-vm-tools/modules/linux/vmxnet/vm_device_version.h b/open-vm-tools/modules/linux/vmxnet/vm_device_version.h index 09235f3e6..ac7a82ced 100644 --- a/open-vm-tools/modules/linux/vmxnet/vm_device_version.h +++ b/open-vm-tools/modules/linux/vmxnet/vm_device_version.h @@ -124,6 +124,8 @@ /************* SCSI implementation limits ********************************/ #define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering #define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16 +#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS +#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 1) /************* Strings for the VESA BIOS Identity Fields *****************/ #define VBE_OEM_STRING COMPANY_NAME " SVGA" @@ -139,6 +141,9 @@ /************* PCI Passthrough implementation limits ********************/ #define MAX_PCI_PASSTHRU_DEVICES 2 +/************* USB implementation limits ********************************/ +#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 + /************* Strings for Host USB Driver *******************************/ #ifdef _WIN32 diff --git a/open-vm-tools/modules/linux/vmxnet/vmnet_def.h b/open-vm-tools/modules/linux/vmxnet/vmnet_def.h index 636a1ca56..1aa7bb454 100644 --- a/open-vm-tools/modules/linux/vmxnet/vmnet_def.h +++ b/open-vm-tools/modules/linux/vmxnet/vmnet_def.h @@ -57,4 +57,5 @@ #define VMNET_CAP_RX_CHAIN 0x8000 /* a pkt can span multiple rx entries */ #define VMNET_CAP_LPD 0x10000 /* large pkt delivery */ #define VMNET_CAP_BPF 0x20000 /* BPF Support in VMXNET Virtual Hardware */ +#define VMNET_CAP_SG_SPAN_PAGES 0x40000 /* Can do scatter-gather span multiple pages transmits. */ #endif // _VMNET_DEF_H_ diff --git a/open-vm-tools/scripts/common/vm-support b/open-vm-tools/scripts/common/vm-support index 7144b51f6..8212bdf66 100644 --- a/open-vm-tools/scripts/common/vm-support +++ b/open-vm-tools/scripts/common/vm-support @@ -1,6 +1,6 @@ #!/bin/bash ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/freebsd/poweroff-vm-default b/open-vm-tools/scripts/freebsd/poweroff-vm-default index 756335191..71061285d 100644 --- a/open-vm-tools/scripts/freebsd/poweroff-vm-default +++ b/open-vm-tools/scripts/freebsd/poweroff-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/freebsd/poweron-vm-default b/open-vm-tools/scripts/freebsd/poweron-vm-default index 7bdfc5a6c..3afe18c8a 100644 --- a/open-vm-tools/scripts/freebsd/poweron-vm-default +++ b/open-vm-tools/scripts/freebsd/poweron-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/freebsd/resume-vm-default b/open-vm-tools/scripts/freebsd/resume-vm-default index cabf85e83..43cadc56a 100644 --- a/open-vm-tools/scripts/freebsd/resume-vm-default +++ b/open-vm-tools/scripts/freebsd/resume-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/freebsd/suspend-vm-default b/open-vm-tools/scripts/freebsd/suspend-vm-default index 3a1dda881..d914a4b67 100644 --- a/open-vm-tools/scripts/freebsd/suspend-vm-default +++ b/open-vm-tools/scripts/freebsd/suspend-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/linux/poweroff-vm-default b/open-vm-tools/scripts/linux/poweroff-vm-default index c6e00cd4c..28f9c7a05 100644 --- a/open-vm-tools/scripts/linux/poweroff-vm-default +++ b/open-vm-tools/scripts/linux/poweroff-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/linux/poweron-vm-default b/open-vm-tools/scripts/linux/poweron-vm-default index cc69b5dd3..54e16a1c2 100644 --- a/open-vm-tools/scripts/linux/poweron-vm-default +++ b/open-vm-tools/scripts/linux/poweron-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/linux/resume-vm-default b/open-vm-tools/scripts/linux/resume-vm-default index 262629b4a..cebbba0a3 100644 --- a/open-vm-tools/scripts/linux/resume-vm-default +++ b/open-vm-tools/scripts/linux/resume-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/linux/suspend-vm-default b/open-vm-tools/scripts/linux/suspend-vm-default index 5a38694ff..80bf5b94a 100644 --- a/open-vm-tools/scripts/linux/suspend-vm-default +++ b/open-vm-tools/scripts/linux/suspend-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/solaris/poweroff-vm-default b/open-vm-tools/scripts/solaris/poweroff-vm-default index 3806ba8a4..1cfc1a9a0 100644 --- a/open-vm-tools/scripts/solaris/poweroff-vm-default +++ b/open-vm-tools/scripts/solaris/poweroff-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/solaris/poweron-vm-default b/open-vm-tools/scripts/solaris/poweron-vm-default index c5bbe8809..e52803224 100644 --- a/open-vm-tools/scripts/solaris/poweron-vm-default +++ b/open-vm-tools/scripts/solaris/poweron-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/solaris/resume-vm-default b/open-vm-tools/scripts/solaris/resume-vm-default index fe9b8b8fb..f48071ceb 100644 --- a/open-vm-tools/scripts/solaris/resume-vm-default +++ b/open-vm-tools/scripts/solaris/resume-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/scripts/solaris/suspend-vm-default b/open-vm-tools/scripts/solaris/suspend-vm-default index 874600d59..e1a82c125 100644 --- a/open-vm-tools/scripts/solaris/suspend-vm-default +++ b/open-vm-tools/scripts/solaris/suspend-vm-default @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-2008 VMware, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published @@ -8,11 +8,11 @@ # # 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 GNU General Public License -# for more details. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff --git a/open-vm-tools/toolbox/Makefile.am b/open-vm-tools/toolbox/Makefile.am index db761d57a..0d011f150 100644 --- a/open-vm-tools/toolbox/Makefile.am +++ b/open-vm-tools/toolbox/Makefile.am @@ -43,17 +43,14 @@ toolbox_LDADD += ../lib/wiper/libWiper.a toolbox_LDADD += ../lib/err/libErr.a toolbox_LDADD += ../lib/backdoor/libBackdoor.a toolbox_LDADD += ../lib/dict/libDict.a -toolbox_LDADD += ../lib/atomic/libAtomic.a toolbox_LDADD += ../lib/message/libMessage.a toolbox_LDADD += ../lib/unicode/libUnicode.a toolbox_LDADD += ../lib/sync/libSync.a toolbox_LDADD += ../lib/misc/libMisc.a toolbox_LDADD += ../lib/panicDefault/libPanicDefault.a toolbox_LDADD += ../lib/panic/libPanic.a - -toolbox_LDFLAGS = -toolbox_LDFLAGS += -lX11 -toolbox_LDFLAGS += @GTK_LIBS@ +toolbox_LDADD += -lX11 +toolbox_LDADD += @GTK_LIBS@ toolbox_SOURCES = toolbox_SOURCES += debugStdio.c diff --git a/open-vm-tools/toolbox/Makefile.in b/open-vm-tools/toolbox/Makefile.in index c3d737d88..b5a6e172d 100644 --- a/open-vm-tools/toolbox/Makefile.in +++ b/open-vm-tools/toolbox/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -73,13 +73,10 @@ toolbox_DEPENDENCIES = ../lib/conf/libConf.a \ ../lib/user/libUser.a ../lib/vmCheck/libVmCheck.a \ ../lib/vmSignal/libVmSignal.a ../lib/wiper/libWiper.a \ ../lib/err/libErr.a ../lib/backdoor/libBackdoor.a \ - ../lib/dict/libDict.a ../lib/atomic/libAtomic.a \ - ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ - ../lib/sync/libSync.a ../lib/misc/libMisc.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a -toolbox_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(toolbox_LDFLAGS) \ - $(LDFLAGS) -o $@ + ../lib/dict/libDict.a ../lib/message/libMessage.a \ + ../lib/unicode/libUnicode.a ../lib/sync/libSync.a \ + ../lib/misc/libMisc.a ../lib/panicDefault/libPanicDefault.a \ + ../lib/panic/libPanic.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -122,7 +119,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -134,7 +130,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -159,7 +155,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -168,6 +163,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -175,7 +172,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -245,11 +242,10 @@ toolbox_LDADD = ../lib/conf/libConf.a \ ../lib/user/libUser.a ../lib/vmCheck/libVmCheck.a \ ../lib/vmSignal/libVmSignal.a ../lib/wiper/libWiper.a \ ../lib/err/libErr.a ../lib/backdoor/libBackdoor.a \ - ../lib/dict/libDict.a ../lib/atomic/libAtomic.a \ - ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ - ../lib/sync/libSync.a ../lib/misc/libMisc.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a -toolbox_LDFLAGS = -lX11 @GTK_LIBS@ + ../lib/dict/libDict.a ../lib/message/libMessage.a \ + ../lib/unicode/libUnicode.a ../lib/sync/libSync.a \ + ../lib/misc/libMisc.a ../lib/panicDefault/libPanicDefault.a \ + ../lib/panic/libPanic.a -lX11 @GTK_LIBS@ toolbox_SOURCES = debugStdio.c stub.c toolbox-gtk.c toolboxAbout.c \ toolboxDevices.c toolboxOptions.c toolboxScripts.c \ toolboxShrink.c @@ -295,7 +291,7 @@ clean-noinstPROGRAMS: done toolbox$(EXEEXT): $(toolbox_OBJECTS) $(toolbox_DEPENDENCIES) @rm -f toolbox$(EXEEXT) - $(toolbox_LINK) $(toolbox_OBJECTS) $(toolbox_LDADD) $(LIBS) + $(LINK) $(toolbox_OBJECTS) $(toolbox_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -344,8 +340,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -357,8 +353,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -368,12 +364,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/toolbox/debugStdio.c b/open-vm-tools/toolbox/debugStdio.c index 222fcd27d..70501cd3a 100644 --- a/open-vm-tools/toolbox/debugStdio.c +++ b/open-vm-tools/toolbox/debugStdio.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,11 +24,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #include #include #include @@ -48,7 +43,7 @@ #include "fileIO.h" #include "file.h" #include "system.h" - +#include "unicode.h" static char debugFile[FILE_MAXPATH] = {0}; static Bool debugEnabled = FALSE; @@ -170,7 +165,8 @@ void DebugToFile(const char *str) // IN FileIOResult fr; FileIODescriptor *fd; size_t bytesWritten; - char *str2; + Unicode timePrefix; + const char *timePrefixUtf8; ASSERT(debugFile[0] != 0); @@ -178,23 +174,33 @@ void DebugToFile(const char *str) // IN ASSERT_NOT_IMPLEMENTED(fd); FileIO_Invalidate(fd); - fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, FILEIO_OPEN_CREATE); + fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, + FILEIO_OPEN_CREATE); if (fr != FILEIO_SUCCESS) { Warning("---Error opening file '%s'.\n", debugFile); debugFile[0] = '\0'; - goto done; } - FileIO_Seek(fd, 0, FILEIO_SEEK_END); + /* + * XXX: Writing the date/time prefix in UTF-8 and the rest of the string in + * an unspecified encoding is rather broken, but it'll have to do until the + * rest of the Tools are made internationalization-safe. + */ + timePrefix = System_GetTimeAsString(); + if (timePrefix == NULL) { + Warning("---Error getting formatted time string.\n"); + goto close; + } + timePrefixUtf8 = UTF8(timePrefix); + ASSERT(timePrefixUtf8); - str2 = Str_Asprintf(NULL, "(%"FMT64"u) ", System_Uptime()); - fr = FileIO_Write(fd, str2, strlen(str2), &bytesWritten); + FileIO_Seek(fd, 0, FILEIO_SEEK_END); + fr = FileIO_Write(fd, timePrefixUtf8, strlen(timePrefixUtf8), &bytesWritten); fr = FileIO_Write(fd, str, strlen(str), &bytesWritten); - free(str2); + Unicode_Free(timePrefix); if (fr != FILEIO_SUCCESS) { Warning("---Error writing to file '%s'.\n", debugFile); - goto close; } close: diff --git a/open-vm-tools/toolbox/stub.c b/open-vm-tools/toolbox/stub.c index 57a2ca7ed..7791bc915 100644 --- a/open-vm-tools/toolbox/stub.c +++ b/open-vm-tools/toolbox/stub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolbox-gtk.c b/open-vm-tools/toolbox/toolbox-gtk.c index dcb1fe1a8..ebf87b98f 100644 --- a/open-vm-tools/toolbox/toolbox-gtk.c +++ b/open-vm-tools/toolbox/toolbox-gtk.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -841,7 +841,7 @@ ShowUsage(char const *prog) " %s --help\n" " Display this help message.\n" "\n" - " %s --minimize|--inconify\n" + " %s --minimize|--iconify\n" " Start the toolbox window minimized.\n" "\n", prog, prog); diff --git a/open-vm-tools/toolbox/toolboxAbout.c b/open-vm-tools/toolbox/toolboxAbout.c index 240cefc0e..3f163c6e7 100644 --- a/open-vm-tools/toolbox/toolboxAbout.c +++ b/open-vm-tools/toolbox/toolboxAbout.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolboxDevices.c b/open-vm-tools/toolbox/toolboxDevices.c index dab63416d..7b0b2ae98 100644 --- a/open-vm-tools/toolbox/toolboxDevices.c +++ b/open-vm-tools/toolbox/toolboxDevices.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolboxInt.h b/open-vm-tools/toolbox/toolboxInt.h index 5ac19e2cb..33d43afaf 100644 --- a/open-vm-tools/toolbox/toolboxInt.h +++ b/open-vm-tools/toolbox/toolboxInt.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolboxOptions.c b/open-vm-tools/toolbox/toolboxOptions.c index f403b37a4..5d932a7f7 100644 --- a/open-vm-tools/toolbox/toolboxOptions.c +++ b/open-vm-tools/toolbox/toolboxOptions.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolboxScripts.c b/open-vm-tools/toolbox/toolboxScripts.c index ac040bce1..522fff68f 100644 --- a/open-vm-tools/toolbox/toolboxScripts.c +++ b/open-vm-tools/toolbox/toolboxScripts.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolboxShrink.c b/open-vm-tools/toolbox/toolboxShrink.c index e7d847645..ce0f99da7 100644 --- a/open-vm-tools/toolbox/toolboxShrink.c +++ b/open-vm-tools/toolbox/toolboxShrink.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/toolbox/toolboxgtk_version.h b/open-vm-tools/toolbox/toolboxgtk_version.h index 57b65bef8..b166d5ee1 100644 --- a/open-vm-tools/toolbox/toolboxgtk_version.h +++ b/open-vm-tools/toolbox/toolboxgtk_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/Makefile.am b/open-vm-tools/vmware-user/Makefile.am index 7e56db4af..fbee75662 100644 --- a/open-vm-tools/vmware-user/Makefile.am +++ b/open-vm-tools/vmware-user/Makefile.am @@ -23,7 +23,6 @@ AM_CFLAGS += @COMMON_CFLAGS@ AM_CFLAGS += @VMWARE_USER_CFLAGS@ vmware_user_LDADD = -vmware_user_LDADD += ../lib/atomic/libAtomic.a vmware_user_LDADD += ../lib/conf/libConf.a vmware_user_LDADD += ../lib/dnd/libDnd.a vmware_user_LDADD += ../lib/eventManager/libEventManager.a @@ -68,12 +67,10 @@ vmware_user_LDADD += ../lib/procMgr/libProcMgr.a vmware_user_LDADD += ../lib/auth/libAuth.a vmware_user_LDADD += ../lib/panicDefault/libPanicDefault.a vmware_user_LDADD += ../lib/panic/libPanic.a - -vmware_user_LDFLAGS = -vmware_user_LDFLAGS += -lcrypt -vmware_user_LDFLAGS += @GTK_LIBS@ -vmware_user_LDFLAGS += @VMWARE_USER_LDFLAGS@ -vmware_user_LDFLAGS += @COMMON_XLIBS@ +vmware_user_LDADD += -lcrypt +vmware_user_LDADD += @GTK_LIBS@ +vmware_user_LDADD += @VMWARE_USER_LDADD@ +vmware_user_LDADD += @COMMON_XLIBS@ vmware_user_SOURCES = vmware_user_SOURCES += copyPaste.c diff --git a/open-vm-tools/vmware-user/Makefile.in b/open-vm-tools/vmware-user/Makefile.in index 8607c0614..adf7a18c2 100644 --- a/open-vm-tools/vmware-user/Makefile.in +++ b/open-vm-tools/vmware-user/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -66,8 +66,7 @@ am_vmware_user_OBJECTS = copyPaste.$(OBJEXT) debugStdio.$(OBJEXT) \ pointer.$(OBJEXT) resolution.$(OBJEXT) stub.$(OBJEXT) \ vmware-user.$(OBJEXT) vmware_user_OBJECTS = $(am_vmware_user_OBJECTS) -vmware_user_DEPENDENCIES = ../lib/atomic/libAtomic.a \ - ../lib/conf/libConf.a ../lib/dnd/libDnd.a \ +vmware_user_DEPENDENCIES = ../lib/conf/libConf.a ../lib/dnd/libDnd.a \ ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ ../lib/ghIntegrationStub/libghIntegrationStub.a \ ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ @@ -90,9 +89,6 @@ vmware_user_DEPENDENCIES = ../lib/atomic/libAtomic.a \ ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ ../lib/procMgr/libProcMgr.a ../lib/auth/libAuth.a \ ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a -vmware_user_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(vmware_user_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -135,7 +131,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -147,7 +142,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -172,7 +167,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -181,6 +175,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -188,7 +184,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -249,9 +245,8 @@ AM_CFLAGS = @GTK_CFLAGS@ @COMMON_CFLAGS@ @VMWARE_USER_CFLAGS@ # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of # the alphabetical order so their symbols are properly resolved. -vmware_user_LDADD = ../lib/atomic/libAtomic.a ../lib/conf/libConf.a \ - ../lib/dnd/libDnd.a ../lib/eventManager/libEventManager.a \ - ../lib/file/libFile.a \ +vmware_user_LDADD = ../lib/conf/libConf.a ../lib/dnd/libDnd.a \ + ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ ../lib/ghIntegrationStub/libghIntegrationStub.a \ ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ ../lib/hgfsServer/libHgfsServer.a \ @@ -272,9 +267,8 @@ vmware_user_LDADD = ../lib/atomic/libAtomic.a ../lib/conf/libConf.a \ ../lib/hgfs/libHgfs.a ../lib/message/libMessage.a \ ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ ../lib/procMgr/libProcMgr.a ../lib/auth/libAuth.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a -vmware_user_LDFLAGS = -lcrypt @GTK_LIBS@ @VMWARE_USER_LDFLAGS@ \ - @COMMON_XLIBS@ $(am__empty) + ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ + -lcrypt @GTK_LIBS@ @VMWARE_USER_LDADD@ @COMMON_XLIBS@ vmware_user_SOURCES = copyPaste.c debugStdio.c dnd.c \ foreignVMToolsDaemon.c foreignVMToolsNetworking.c \ foundryToolsDaemon.c libvmwarectrl.c pointer.c resolution.c \ @@ -321,7 +315,7 @@ clean-noinstPROGRAMS: done vmware-user$(EXEEXT): $(vmware_user_OBJECTS) $(vmware_user_DEPENDENCIES) @rm -f vmware-user$(EXEEXT) - $(vmware_user_LINK) $(vmware_user_OBJECTS) $(vmware_user_LDADD) $(LIBS) + $(LINK) $(vmware_user_OBJECTS) $(vmware_user_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -373,8 +367,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -386,8 +380,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -397,12 +391,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/vmware-user/copyPaste.c b/open-vm-tools/vmware-user/copyPaste.c index 1ae048972..d90e06445 100644 --- a/open-vm-tools/vmware-user/copyPaste.c +++ b/open-vm-tools/vmware-user/copyPaste.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -130,8 +130,8 @@ static int32 gVmxCopyPasteVersion = 1; static Bool gWaitingOnGuestSelection = FALSE; static char gGuestSelPrimaryBuf[MAX_SELECTION_BUFFER_LENGTH]; static char gGuestSelClipboardBuf[MAX_SELECTION_BUFFER_LENGTH]; -static uint32 gGuestSelPrimaryTime = 0; -static uint32 gGuestSelClipboardTime = 0; +static uint64 gGuestSelPrimaryTime = 0; +static uint64 gGuestSelClipboardTime = 0; static char gHostClipboardBuf[MAX_SELECTION_BUFFER_LENGTH]; /* Guest->Host state. */ @@ -371,14 +371,32 @@ CopyPasteSelectionReceivedCB(GtkWidget *widget, // IN: unused /* Try to get clipboard or selection timestamp. */ if (selection_data->target == GDK_SELECTION_TYPE_TIMESTAMP) { if (selection_data->selection == GDK_SELECTION_PRIMARY) { - gGuestSelPrimaryTime = *(uint32 *)selection_data->data; - Debug("CopyPasteSelectionReceivedCB: Got pri time [%d]\n", - gGuestSelPrimaryTime); + if (selection_data->length == 4) { + gGuestSelPrimaryTime = *(uint32 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got pri time [%"FMT64"u]\n", + gGuestSelPrimaryTime); + } else if (selection_data->length == 8) { + gGuestSelPrimaryTime = *(uint64 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got pri time [%"FMT64"u]\n", + gGuestSelPrimaryTime); + } else { + Debug("CopyPasteSelectionReceivedCB: Unknown pri time. Size %d\n", + selection_data->length); + } } if (selection_data->selection == GDK_SELECTION_CLIPBOARD) { - gGuestSelClipboardTime = *(uint32 *)selection_data->data; - Debug("CopyPasteSelectionReceivedCB: Got clip time [%d]\n", - gGuestSelClipboardTime); + if (selection_data->length == 4) { + gGuestSelClipboardTime = *(uint32 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got clip time [%"FMT64"u]\n", + gGuestSelClipboardTime); + } else if (selection_data->length == 8) { + gGuestSelClipboardTime = *(uint64 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got clip time [%"FMT64"u]\n", + gGuestSelClipboardTime); + } else { + Debug("CopyPasteSelectionReceivedCB: Unknown clip time. Size %d\n", + selection_data->length); + } } goto exit; } @@ -419,7 +437,7 @@ CopyPasteSelectionReceivedCB(GtkWidget *widget, // IN: unused return; } - /* + /* * String in backdoor communication is 4 bytes by 4 bytes, so the len * should be aligned to 4; */ @@ -1497,7 +1515,7 @@ CopyPasteHGSetFileList(char const **result, // OUT * to access the file since it will enable vmblock to block that * application's progress if necessary. */ - DnD_GetLastDirName(gFileRoot, strlen(gFileRoot), &stagingDirName); + stagingDirName = DnD_GetLastDirName(gFileRoot); if (!stagingDirName) { Debug("CopyPasteHGSetFileList: error construct stagingDirName\n"); retStr = "error construct stagingDirName"; diff --git a/open-vm-tools/vmware-user/debugStdio.c b/open-vm-tools/vmware-user/debugStdio.c index 222fcd27d..70501cd3a 100644 --- a/open-vm-tools/vmware-user/debugStdio.c +++ b/open-vm-tools/vmware-user/debugStdio.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,11 +24,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #include #include #include @@ -48,7 +43,7 @@ #include "fileIO.h" #include "file.h" #include "system.h" - +#include "unicode.h" static char debugFile[FILE_MAXPATH] = {0}; static Bool debugEnabled = FALSE; @@ -170,7 +165,8 @@ void DebugToFile(const char *str) // IN FileIOResult fr; FileIODescriptor *fd; size_t bytesWritten; - char *str2; + Unicode timePrefix; + const char *timePrefixUtf8; ASSERT(debugFile[0] != 0); @@ -178,23 +174,33 @@ void DebugToFile(const char *str) // IN ASSERT_NOT_IMPLEMENTED(fd); FileIO_Invalidate(fd); - fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, FILEIO_OPEN_CREATE); + fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, + FILEIO_OPEN_CREATE); if (fr != FILEIO_SUCCESS) { Warning("---Error opening file '%s'.\n", debugFile); debugFile[0] = '\0'; - goto done; } - FileIO_Seek(fd, 0, FILEIO_SEEK_END); + /* + * XXX: Writing the date/time prefix in UTF-8 and the rest of the string in + * an unspecified encoding is rather broken, but it'll have to do until the + * rest of the Tools are made internationalization-safe. + */ + timePrefix = System_GetTimeAsString(); + if (timePrefix == NULL) { + Warning("---Error getting formatted time string.\n"); + goto close; + } + timePrefixUtf8 = UTF8(timePrefix); + ASSERT(timePrefixUtf8); - str2 = Str_Asprintf(NULL, "(%"FMT64"u) ", System_Uptime()); - fr = FileIO_Write(fd, str2, strlen(str2), &bytesWritten); + FileIO_Seek(fd, 0, FILEIO_SEEK_END); + fr = FileIO_Write(fd, timePrefixUtf8, strlen(timePrefixUtf8), &bytesWritten); fr = FileIO_Write(fd, str, strlen(str), &bytesWritten); - free(str2); + Unicode_Free(timePrefix); if (fr != FILEIO_SUCCESS) { Warning("---Error writing to file '%s'.\n", debugFile); - goto close; } close: diff --git a/open-vm-tools/vmware-user/dnd.c b/open-vm-tools/vmware-user/dnd.c index a6e3b4126..0b667089a 100644 --- a/open-vm-tools/vmware-user/dnd.c +++ b/open-vm-tools/vmware-user/dnd.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -460,7 +460,7 @@ DnDRpcInDataSetCB(char const **result, // OUT * access the file since it will enable vmblock to block that application's * progress if necessary. */ - DnD_GetLastDirName(gFileRoot, gFileRootSize, &perDnDDir); + perDnDDir = DnD_GetLastDirName(gFileRoot); if (!perDnDDir) { Debug("DnDRpcInDataSetCB: cannot obtain dirname of root.\n"); retStr = "error obtaining dirname of root"; diff --git a/open-vm-tools/vmware-user/foreignVMToolsDaemon.c b/open-vm-tools/vmware-user/foreignVMToolsDaemon.c index 9b2bb73a6..534116fa0 100644 --- a/open-vm-tools/vmware-user/foreignVMToolsDaemon.c +++ b/open-vm-tools/vmware-user/foreignVMToolsDaemon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/foreignVMToolsDaemon.h b/open-vm-tools/vmware-user/foreignVMToolsDaemon.h index 614d9b5a8..f84a22bea 100644 --- a/open-vm-tools/vmware-user/foreignVMToolsDaemon.h +++ b/open-vm-tools/vmware-user/foreignVMToolsDaemon.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/foreignVMToolsNetworking.c b/open-vm-tools/vmware-user/foreignVMToolsNetworking.c index 963746ea1..e1524284c 100644 --- a/open-vm-tools/vmware-user/foreignVMToolsNetworking.c +++ b/open-vm-tools/vmware-user/foreignVMToolsNetworking.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/foundryToolsDaemon.c b/open-vm-tools/vmware-user/foundryToolsDaemon.c index 3867f39dc..d4d587e37 100644 --- a/open-vm-tools/vmware-user/foundryToolsDaemon.c +++ b/open-vm-tools/vmware-user/foundryToolsDaemon.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,10 +28,6 @@ #include #include -#if !defined(__FreeBSD__) && !defined(sun) -#define IMPLEMENT_SOCKET_MGR 1 -#endif - #ifdef _WIN32 #include #else @@ -40,7 +36,9 @@ #endif #ifdef _MSC_VER -# include +# include +# include +# include #elif _WIN32 # include "win95.h" #endif @@ -72,18 +70,13 @@ #include "hgfs.h" #include "system.h" #include "codeset.h" -#if IMPLEMENT_SOCKET_MGR -#include "socketMgr.h" -#endif #ifndef __FreeBSD__ #include "netutil.h" #endif -/* Stub out impersonation functions for these platforms. */ -#if defined(__FreeBSD__) || defined(sun) || defined(N_PLAT_NLM) -void Impersonate_Init(void) { return; } -#else +/* Only Win32 and Linux use impersonation functions. */ +#if !defined(__FreeBSD__) && !defined(sun) #include "impersonate.h" #endif @@ -95,7 +88,7 @@ static DblLnkLst_Links *globalEventQueue; // event queue for main event loop #define GUESTMSG_MAX_IN_SIZE (64 * 1024) /* vmx/main/guest_msg.c */ #define MAX64_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) # if defined(_WIN32) # define DECLARE_SYNCDRIVER_ERROR(name) DWORD name = ERROR_SUCCESS; @@ -139,7 +132,7 @@ static Bool ToolsDaemonHgfsImpersonated(char const **result, void *clientData); #endif -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonTcloSyncDriverFreeze(char const **result, size_t *resultLen, const char *name, @@ -174,10 +167,6 @@ void ToolsDaemonTcloReportProgramCompleted(const char *requestName, */ #define DEFAULT_RESULT_MSG_MAX_LENGTH 1024 -#if IMPLEMENT_SOCKET_MGR -static Bool socketMgrInitialized = FALSE; -#endif - static Bool thisProcessRunsAsRoot = FALSE; @@ -491,7 +480,7 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN Bool runAsRoot) // IN { static Bool inited = FALSE; -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool sync_driver_inited = FALSE; #endif @@ -506,6 +495,7 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN globalEventQueue, ToolsDaemonTcloReportProgramCompleted); +#if defined(linux) || defined(_WIN32) /* * Be careful, Impersonate_Init should only be ever called once per process. * @@ -515,6 +505,7 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN if (!inited && thisProcessRunsAsRoot) { Impersonate_Init(); } +#endif RpcIn_RegisterCallback(in, VIX_BACKDOORCOMMAND_RUN_PROGRAM, @@ -542,17 +533,8 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN VIX_BACKDOORCOMMAND_MOUNT_VOLUME_LIST, ToolsDaemonTcloMountHGFS, NULL); -#if IMPLEMENT_SOCKET_MGR - /* - * We can be called again in certain tools error recovery cases, such - * as restoring from a hibernation. This annoys SocketMgr_Init(). - */ - if (!inited) { - socketMgrInitialized = SocketMgr_Init(globalEventQueue); - } -#endif // IMPLEMENT_SOCKET_MGR -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) /* * Only init once, but always register the RpcIn. @@ -579,10 +561,8 @@ FoundryToolsDaemon_RegisterRoutines(RpcIn *in, // IN } else { Debug("FoundryToolsDaemon: Failed to init SyncDriver, skipping command handlers.\n"); } - - inited = TRUE; - #endif + inited = TRUE; } // FoundryToolsDaemon_RegisterRoutines @@ -758,17 +738,11 @@ ToolsDaemonTcloOpenUrl(char const **result, // OUT Debug("Opening URL: \"%s\"\n", url); /* Actually open the URL. */ - #if !defined(WIN9XCOMPAT) if (!GuestApp_OpenUrl(url, strcmp(windowState, "maximize") == 0)) { err = VIX_E_FAIL; Debug("Failed to open the url \"%s\"\n", url); goto abort; } -#else - err = VIX_E_OP_NOT_SUPPORTED_ON_GUEST; - goto abort; -#endif - abort: if (impersonatingVMWareUser) { @@ -921,7 +895,7 @@ abort: *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonTcloSyncDriverFreeze(char const **result, // OUT size_t *resultLen, // OUT @@ -1038,7 +1012,7 @@ abort: *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonSyncDriverThawCallback(void *clientData) // IN (ignored) { @@ -1082,7 +1056,7 @@ exit: *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonTcloSyncDriverThaw(char const **result, // OUT size_t *resultLen, // OUT diff --git a/open-vm-tools/vmware-user/foundryToolsDaemon.h b/open-vm-tools/vmware-user/foundryToolsDaemon.h index 0b16b1f9c..30f3d0f58 100644 --- a/open-vm-tools/vmware-user/foundryToolsDaemon.h +++ b/open-vm-tools/vmware-user/foundryToolsDaemon.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/pointer.c b/open-vm-tools/vmware-user/pointer.c index 616243753..23dd9aa88 100644 --- a/open-vm-tools/vmware-user/pointer.c +++ b/open-vm-tools/vmware-user/pointer.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/resolution.c b/open-vm-tools/vmware-user/resolution.c index e84dc06b8..13e148c27 100644 --- a/open-vm-tools/vmware-user/resolution.c +++ b/open-vm-tools/vmware-user/resolution.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -307,6 +307,8 @@ TopologyRpcInSetCB(char const **result, // OUT xXineramaScreenInfo *displays = NULL; short maxX = 0; short maxY = 0; + int minX = 0; + int minY = 0; /* * The argument string will look something like: @@ -347,16 +349,32 @@ TopologyRpcInSetCB(char const **result, // OUT } maxX = MAX(maxX, displays[i].x_org + displays[i].width); maxY = MAX(maxY, displays[i].y_org + displays[i].height); + minX = MIN(minX, displays[i].x_org); + minY = MIN(minY, displays[i].y_org); + } + + if (minX != 0 || minY != 0) { + Warning("The bounding box of the display topology does not have an origin of (0,0)\n"); + } + + /* + * Transform the topology so that the bounding box has an origin of (0,0). Since the + * host is already supposed to pass a normalized topology, this should not have any + * effect. + */ + for (i = 0; i < count; i++) { + displays[i].x_org -= minX; + displays[i].y_org -= minY; } if (!VMwareCtrl_SetTopology(gXDisplay, DefaultScreen(gXDisplay), displays, count)) { - RpcIn_SetRetVals(result, resultLen, "Failed to set topology in the driver.", + RpcIn_SetRetVals(result, resultLen, "Failed to set topology in the driver.", FALSE); goto out; } - if (!ResolutionSet(maxX, maxY)) { - RpcIn_SetRetVals(result, resultLen, "Failed to set new resolution.", + if (!ResolutionSet(maxX - minX, maxY - minY)) { + RpcIn_SetRetVals(result, resultLen, "Failed to set new resolution.", FALSE); goto out; } @@ -394,7 +412,7 @@ Bool Resolution_RegisterCapability(void) { if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_set 1")) { - Debug("%s: Unable to register resolution set capability\n", + Debug("%s: Unable to register resolution set capability\n", __FUNCTION__); return FALSE; } @@ -416,6 +434,14 @@ Resolution_RegisterCapability(void) __FUNCTION__); return FALSE; } + if (gCanUseVMwareCtrlTopologySet && + !RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 1")) { + Debug("%s: Unable to register topology global offset capability\n", + __FUNCTION__); + /* + * Ignore failures - host may not support these RPCs. + */ + } #endif return TRUE; } @@ -503,10 +529,13 @@ Resolution_Unregister(void) } #ifndef NO_MULTIMON if (gCanUseVMwareCtrlTopologySet && - !RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 0")) { - Debug("%s: Unable to unregister TopologySet capability\n", + (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 0") + || !RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 0"))) { + Debug("%s: Unable to unregister TopologySet capability\n", __FUNCTION__); - return FALSE; + /* + * Ignore failures - host may not support these RPCs. + */ } #endif diff --git a/open-vm-tools/vmware-user/stub.c b/open-vm-tools/vmware-user/stub.c index 57a2ca7ed..7791bc915 100644 --- a/open-vm-tools/vmware-user/stub.c +++ b/open-vm-tools/vmware-user/stub.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/vmware-user.c b/open-vm-tools/vmware-user/vmware-user.c index cef7c9c9d..f04f299a4 100644 --- a/open-vm-tools/vmware-user/vmware-user.c +++ b/open-vm-tools/vmware-user/vmware-user.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/vmwareuserInt.h b/open-vm-tools/vmware-user/vmwareuserInt.h index 508314a32..0aefed5a7 100644 --- a/open-vm-tools/vmware-user/vmwareuserInt.h +++ b/open-vm-tools/vmware-user/vmwareuserInt.h @@ -8,11 +8,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/vmware-user/vmwareuser_version.h b/open-vm-tools/vmware-user/vmwareuser_version.h index 60aa5af69..849211538 100644 --- a/open-vm-tools/vmware-user/vmwareuser_version.h +++ b/open-vm-tools/vmware-user/vmwareuser_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/xferlogs/Makefile.in b/open-vm-tools/xferlogs/Makefile.in index 271bee50a..991bce371 100644 --- a/open-vm-tools/xferlogs/Makefile.in +++ b/open-vm-tools/xferlogs/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -107,7 +107,6 @@ DEPDIR = @DEPDIR@ DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ DNET_LIBS = @DNET_LIBS@ -DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -119,7 +118,7 @@ FFLAGS = @FFLAGS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -144,7 +143,6 @@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_OS = @MODULES_OS@ -NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -153,6 +151,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_CFLAGS = @PROCPS_CFLAGS@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -160,7 +160,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ @@ -309,8 +309,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS @@ -322,8 +322,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -333,12 +333,13 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ + here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique diff --git a/open-vm-tools/xferlogs/xferlogs.c b/open-vm-tools/xferlogs/xferlogs.c index 5cb5018af..5824de166 100644 --- a/open-vm-tools/xferlogs/xferlogs.c +++ b/open-vm-tools/xferlogs/xferlogs.c @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff --git a/open-vm-tools/xferlogs/xferlogs_version.h b/open-vm-tools/xferlogs/xferlogs_version.h index 08dd60f0f..f16d7ac5b 100644 --- a/open-vm-tools/xferlogs/xferlogs_version.h +++ b/open-vm-tools/xferlogs/xferlogs_version.h @@ -7,11 +7,11 @@ * * 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 GNU General Public License - * for more details. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/