From 8db8a2290683acf94f02e855af668a864d6001c2 Mon Sep 17 00:00:00 2001 From: Nina Didenko Date: Wed, 20 Nov 2019 22:50:06 +0300 Subject: [PATCH 1/3] installCDE: don't hardcode path to whoami Hi. Patch removes hardcoded paths to echo and whoami in installation scripts. Thanks. --- cde/admin/IntegTools/dbTools/installCDE.src | 11 ++--------- cde/admin/IntegTools/dbTools/mkProd | 9 +-------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/cde/admin/IntegTools/dbTools/installCDE.src b/cde/admin/IntegTools/dbTools/installCDE.src index a00fefd13..233b4a965 100755 --- a/cde/admin/IntegTools/dbTools/installCDE.src +++ b/cde/admin/IntegTools/dbTools/installCDE.src @@ -52,7 +52,7 @@ LOGFILE="installCDE.$$.log" Log() { - /bin/echo "$1" | tee -a $LOGFILE + echo "$1" | tee -a $LOGFILE } MakeTarball() @@ -537,14 +537,7 @@ XCOMM PLATFORM_SCRIPT_DIR=hp fi - if [ "$PLATFORM" = "aix" ]; - then - USER=$(/bin/whoami) - else - USER=$(/usr/bin/whoami) - fi - - if [ "$USER" != "root" ]; + if [ $(whoami) != "root" ]; then echo "" echo "You should be root to run this script. Continuing anyway." diff --git a/cde/admin/IntegTools/dbTools/mkProd b/cde/admin/IntegTools/dbTools/mkProd index 44591fabe..413a77e87 100755 --- a/cde/admin/IntegTools/dbTools/mkProd +++ b/cde/admin/IntegTools/dbTools/mkProd @@ -96,13 +96,6 @@ else # Build system = HP PLATFORM=hp-ux fi -if [ $PLATFORM = "aix" ]; -then - USER=`/bin/whoami` -else - USER=`/usr/bin/whoami` -fi - awkit() { awk ' BEGIN { @@ -504,7 +497,7 @@ doit() } # set permissions for non-links if [ "${TYPE%link}" = "$TYPE" ]; then - if [ "$USER" = "root" ]; then + if [ $(whoami) = "root" ]; then chgrp $GROUP $DEST || echo "ERROR: \"chgrp $GROUP $DEST\" failed" >&2 chown $OWNER $DEST || From 9221c55a5f811986eaf0e01301827c294ac2e29b Mon Sep 17 00:00:00 2001 From: Nina Didenko Date: Sun, 24 Nov 2019 10:42:05 +0300 Subject: [PATCH 2/3] tt_type_comp: use CppCmd definition Hi. This patch makes tt_type_comp respect CppCmd Thanks! --- cde/lib/tt/bin/tt_type_comp/Imakefile | 4 +++- cde/lib/tt/lib/tt_options.h | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cde/lib/tt/bin/tt_type_comp/Imakefile b/cde/lib/tt/bin/tt_type_comp/Imakefile index 92179208f..624349297 100644 --- a/cde/lib/tt/bin/tt_type_comp/Imakefile +++ b/cde/lib/tt/bin/tt_type_comp/Imakefile @@ -8,7 +8,9 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB) #include "../../tooltalk.tmpl" -DEFINES = +CPP_PROGRAM = CppCmd +CPP_DEFINES = -DCPP_PROGRAM="\"$(CPP_PROGRAM)\"" +DEFINES = $(CPP_DEFINES) INCLUDES = $(TIRPCINC) -I../../lib -I../../slib DEPLIBS = ../../slib/libstt.a TtClientDepLibs diff --git a/cde/lib/tt/lib/tt_options.h b/cde/lib/tt/lib/tt_options.h index 4315daa8c..e23bb9e5a 100644 --- a/cde/lib/tt/lib/tt_options.h +++ b/cde/lib/tt/lib/tt_options.h @@ -529,4 +529,9 @@ #endif +#ifdef CPP_PROGRAM +# undef OPT_CPP_PATH +# define OPT_CPP_PATH CPP_PROGRAM +#endif + #endif /* _TT_OPTIONS_H */ From 5cebd7c4da1afea353a3baef250e31a4cf867bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Cie=C5=9Blak?= Date: Sat, 30 Nov 2019 03:51:40 +0000 Subject: [PATCH 3/3] dtdocbook/instant: fix buffer overlow on German umlaut in latin-1 One-off error: Old buffer length was 6 for one character (3 * 1 + 3) We need one more byte par character in the buffer for the hex representation of it. +0 '"' +1 '\\' +2 'x' +3 'f' +4 'c' +5 '"' +6 0x0 << overflow tcl combined with RCHECK will abort because memory blocks are allocated contiguously and we overwrite the magic marker of the next block. --- cde/programs/dtdocbook/instant/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cde/programs/dtdocbook/instant/main.c b/cde/programs/dtdocbook/instant/main.c index 7dfe91c60..a3762bded 100644 --- a/cde/programs/dtdocbook/instant/main.c +++ b/cde/programs/dtdocbook/instant/main.c @@ -359,7 +359,7 @@ static int DefaultOutputString(ClientData clientData, /* leave room for worst case expansion plus quotes plus null */ pArgv = argv[1]; - stringLength = (3 * strlen(pArgv)) + 3; + stringLength = (4 * strlen(pArgv)) + 3; string = Tcl_Alloc(stringLength); memset(string, 0, stringLength);