Skip to content

Commit

Permalink
Remove convertutf and bsd_printf
Browse files Browse the repository at this point in the history
The license for convertutf.c and convertutf.h does not
explicitly permit, or prohibit, modification of the files,
and restricts use to "products supporting the Unicode
Standard". This is a problem for distribution with Debian,
which complies to strict guidelines. See details at
#148
and
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823100

The code is not essential for open-vm-tools. It's needed by
code in bsd_printf.c and related code, which in turn is
needed by msgfmt.c and msgList.c. The latter code is not needed
for open-vm-tools, and can therefore be eliminated from
the open-vm-tools package.

When HAS_BSD_PRINTF isn't set, Str_Snprintf() and
Str_Vsnprintf will fall back to vsnprintf(), and
Str_Asprintf()/Str_Vasprintf() will fall back to
vasprintf(). Under Linux and FreeBSD these functions are
properly implemented, and support %ls and %S.
  • Loading branch information
oliverkurth committed Sep 15, 2017
1 parent 131e4a6 commit dc81979
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 8,471 deletions.
9 changes: 0 additions & 9 deletions open-vm-tools/configure.ac
Expand Up @@ -1037,14 +1037,6 @@ if test "$enable_multimon" != "no"; then
#include <X11/Xmd.h>])
fi

bsdPrintfWrappers=no
if test "$os" = "linux"; then
AC_CHECK_LIB([c],
[ecvt],
[bsdPrintfWrappers=yes],
[])
fi

###
### Typdefs, structs, and compiler quarks.
###
Expand Down Expand Up @@ -1321,7 +1313,6 @@ AM_CONDITIONAL(HAVE_GNU_LD, test "$with_gnu_ld" = "yes")
AM_CONDITIONAL(HAVE_GTKMM, test "$have_x" = "yes" -a \( "$with_gtkmm" = "yes" -o "$with_gtkmm3" = "yes" \) )
AM_CONDITIONAL(HAVE_PAM, test "$with_pam" = "yes")
AM_CONDITIONAL(USE_SLASH_PROC, test "$os" = "linux")
AM_CONDITIONAL(USE_PRINTF_WRAPPERS, test "$bsdPrintfWrappers" = "yes")
AM_CONDITIONAL(ENABLE_DEPLOYPKG, test "$enable_deploypkg" = "yes")
AM_CONDITIONAL(ENABLE_GRABBITMQPROXY, test "$enable_grabbitmqproxy" = "yes")
AM_CONDITIONAL(ENABLE_VGAUTH, test "$enable_vgauth" = "yes")
Expand Down
5 changes: 5 additions & 0 deletions open-vm-tools/lib/file/fileLockPosix.c
Expand Up @@ -593,9 +593,14 @@ void
FileLockAppendMessage(MsgList **msgs, // IN/OUT/OPT:
int err) // IN: errno
{
#if defined(VMX86_TOOLS)
Log(LGPFX "A file locking error (%d) has occurred: %s.",
err, Err_Errno2String(err));
#else
MsgList_Append(msgs, MSGID(fileLock.posix)
"A file locking error (%d) has occurred: %s.",
err, Err_Errno2String(err));
#endif
}


Expand Down
58 changes: 0 additions & 58 deletions open-vm-tools/lib/include/bsd_output.h

This file was deleted.

216 changes: 0 additions & 216 deletions open-vm-tools/lib/include/bsdfmt.h

This file was deleted.

5 changes: 5 additions & 0 deletions open-vm-tools/lib/include/str.h
Expand Up @@ -60,25 +60,30 @@ extern "C" {
#endif



/*
* These platforms use bsd_vsnprintf().
* This does not mean it has bsd_vsnwprintf().
*/
#if !defined(OPEN_VM_TOOLS)
#if (defined _WIN32 && !defined STR_NO_WIN32_LIBS) || \
(defined __linux__ && !defined __UCLIBC__) || \
defined __APPLE__
#define HAS_BSD_PRINTF 1
#endif
#endif

/*
* And these platforms/setups use bsd_vsnwprintf()
*/
#if !defined(OPEN_VM_TOOLS)
#if (defined _WIN32 && !defined STR_NO_WIN32_LIBS) || \
(defined __GNUC__ && (__GNUC__ < 2 \
|| (__GNUC__ == 2 \
&& __GNUC_MINOR__ < 96)))
#define HAS_BSD_WPRINTF 1
#endif
#endif

/*
* ASCII/UTF-8 versions
Expand Down
2 changes: 0 additions & 2 deletions open-vm-tools/lib/misc/Makefile.am
Expand Up @@ -37,8 +37,6 @@ libMisc_la_SOURCES += iovector.c
libMisc_la_SOURCES += logFixed.c
libMisc_la_SOURCES += machineID.c
libMisc_la_SOURCES += miscSolaris.c
libMisc_la_SOURCES += msgfmt.c
libMisc_la_SOURCES += msgList.c
libMisc_la_SOURCES += posixDlopen.c
libMisc_la_SOURCES += posixPosix.c
libMisc_la_SOURCES += posixPwd.c
Expand Down

0 comments on commit dc81979

Please sign in to comment.