Use different command to reboot linux VM, depending on the init system type
We currently use the "telinit 6" command to reboot linux VMs.
However, the "telinit" command will be unavailable in the future as SysVinit
will be deprecated on some modern linux systems.
For example: In SUSE, "telinit" command is part of systemd-sysvcompat
(15 SP6 and newer) or systemd-sysvinit (older than 15 SP6), whereas in some
SUSE images or templates such as SUSE minimal VM has no such packages installed.
See SUSE KB: https://www.suse.com/support/kb/doc/?id=000021564
This change detects the init system of a linux and uses different command
to trigger reboot. If the modern init system, systemd, is available, then
"systemctl reboot" command will be used to trigger reboot. Otherwise, continue
using "telinit 6" command as SysVinit, the traditional init system, is still
available.
The change is about the handling of the **result parameter in the wrapper
functions. (UsercheckRetryGetpwnam_r and UsercheckRetryGetpwuid_r)
Issues:
o Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer result to getpwuid_r, or
getpwnam_r which dereferences it.
o Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking result suggests that it may be
null, but it has already been dereferenced on all paths leading to the
check
Add null check for 'result' before dereferencing
The current caller will not have this issue.
We could silence the issue, but we should add an assert for development
and return error 'EINVAL' when '**result' parameter is NULL.
Update caller functions to return VGAUTH_E_INVALID_ARGUMENT when return code
is EINVAL.
The condition used validates that 'result' is NULL while it should
validate '*result' is NULL.
This needs to be fixed; replace "!result" with "*result == NULL" to be
explicit or "!*result" to match other usage in vgauth.
[vgauth] Retry on EBADF when getting pam entry (getpwuid_r, getpwnam_r)
Below are the changes made as part of this update
o resetting the errno value before calling the getpw*_r functions in
usercheck.c. Some man pages mention this is required as the errno might
be left unchanged by the function. We're performing a few retries,
therefore resetting errno at the start of a retry loop ensures we're
not 'stuck' on the error.
o implementing retry in impersonateLinux.c which includes the reset of errno.
o logging 'errno' in impersonateLinux.c and usercheck.c where relevant.
o On EBADF error, adding g_thread_yield in the retry loop to add some
delay to the retry.
Add #ifdef USE_UINPUT to fix open-vm-tools build failure on FreeBSD
In the previous update, the "#ifdef USE_UINPUT" preprocessor guard was
removed, which broke the compilation of open-vm-tools on FreeBSD, because
FreeBSD does not have support for fakeMouseWayland.cpp.
Since USE_UINPUT is already defined for Linux systems in
services/plugins/dndcp/Makefile.am, adding those conditionals back to prevent
build failures on FreeBSD.
Enable UInput and handle few issues in DNDCP plugin for GTK3
Below are the changes made as part of this update
1) Enabling UInput code for emulating Fake mouse and keyboard events in
Xwayland backend.
2) Making sure Xtest and UInput codes are inherent. The Xtest specific
code which was being invoked in Uinput flow as well is now guarded to be
used in Xtest flow only..
3) Fix for Leaking X server Connection
In VMTools dndcp plugin, when CopyPasteUIMac class is constructed,
the mCP class variable is created with "new" by calling
VMGuestDnDCPMgr::GetCopyPasteMgr(). The equivalent "delete" should be called
in the destructor.
Update the VMTools version history with recent EP releases.
Adding versions 12.4.7, 12.4.8, 12.5.2, 12.5.3, and 13.0.1 to the
vm_tools_version.h header file.
Along the way the tagname for the 13.0.x series was changed from
"tweezers" to "swiss_army_knife".
Update regex for checking 'disable_vmware_customization' flag
The regex check for "disable_vmware_customization" is too strict and
fails when there are inline comments after the flag. As a result, the
cloud-init workflow doesn't start.
This change is relaxing the check to allow inline comments. Please note
that non-capturing group is not supported by POSIX regex API, using
capturing group here.
A previous change to lib/misc/posixPosix.c introduced the
`Posix_Printf` and `Posix_Fprintf` implementations only for non-Solaris,
non-Apple, and non-FreeBSD builds. (Note that this set of
conditions is inconsistent with when `posix.h` aliases them
(and various other functions) to their standard POSIX
counterparts.)
Moving the `Posix_Printf`/`Posix_Fprintf` implementations out
of the `#if` sections so that they're always available.
Kruti Pendharkar [Tue, 24 Jun 2025 16:26:22 +0000 (09:26 -0700)]
Modify alias store file permissions for regular users.
Currently, the user whose alias store is to be used is granted 'Full Control'
to the alias store file created under alias store root directory (which is
generally secured from regular users).
Modifying the alias store file permissions by removing "Change
permissions" and "Take ownership" of the file privileges from the user.