Commit Graph

484 Commits

Author SHA1 Message Date
Lev Kujawski 356ac2f327 Purge unused Freetype dependency from CDE
config/cf/{DragonFly,OpenBSD,darwin}.cf: Remove Freetype imake settings
config/cf/darwinLib.tmpl: Do not link against Freetype
debian/control: Remove Freetype and Xft dependencies
*/Imakefile: Purge Freetype includes

lib/DtWidget/ComboBoxP.h
lib/DtWidget/SpinBoxP.h
programs/dtfile/ChangeDirP.c
programs/dtlogin/vgcallback.c
    Undefine USE_XFT so Motif 2.3 doesn't pull in Freetype

CDE included Freetype and Xft solely to satisfy builds of Motif with
Xft support enabled. However, as CDE only supports bitmap fonts, this
dependency was entirely superfluous and unnecessarily broke backwards
compatibility with older systems.
2021-06-02 19:56:26 -06:00
Lev Kujawski 1f52f5ca81 Avoid Global Offset Table (GOT) limits by enabling -fPIC on the BSDs.
config/cf/bsdLib.rules: Switch -fpic to -fPIC
lib/DtXinerama/Imakefile: Use $(PICFLAGS) instead of -fpic

Several tickets have been opened by users encountering the low 8KiB
GOT limit on SPARC systems running BSD. This change makes CDE builds
on BSD more consistent with those on Linux, where -fPIC has been the
default without any reported issues.
2021-06-02 19:56:26 -06:00
Lev Kujawski a6ea2a2d52 Centralize catgets() calls through MsgCat
CDE has relied upon catgets() implementations following a relaxed
interpretation of the XPG internationalization standard that ignored
-1, the standard error value returned by catopen, as the catalog
argument. However, this same behavior causes segmentation faults with
the musl C library.

This patch:

- Centralizes (with the exception of ToolTalk) all calls to catopen(),
  catgets(), and catclose() through MsgCat within the DtSvc library.
- Prevents calls to catgets() and catclose() that rely upon
  undefined behavior.
- Eliminates a number of bespoke catgets() wrappers, including multiple
  redundant caching implementations designed to work around a design
  peculiarity in HP/UX.
- Eases building CDE without XPG internationalization support by providing
  the appropriate macros.
2021-06-02 19:55:15 -06:00
Jon Trulson e8345c9241 autotools: specify tirpc lib to link the tooltalk binaries
Newer ubuntu's do not seem to honor the implied library dependency of
libtt->libtirpc, so we must explicitly specify libtirpc when linking
them.
2021-06-01 18:23:46 -06:00
Jon Trulson 248c75515e libDtTerm: fixes to build in autotools branch for freebsd 2021-06-01 18:23:46 -06:00
Jon Trulson ece5c0ea14 Merge branch 'master' into autotools-conversion
Lost the ksh93 submodule so will re-add in a later commit.
2021-01-30 19:04:10 -07:00
Jon Trulson eb381022a5 Change version to 2.3.2b for the new ksh93 submodule merge 2021-01-30 16:32:41 -07:00
Lev Kujawski 225522cc6b Define time_t within AccessI.h by including <time.h>. 2021-01-15 18:33:26 -07:00
Lev Kujawski d14d956c00 Rename functions within ToolTalk that conflict with the musl C library headers. 2021-01-10 18:08:00 -07:00
Lev Kujawski 5d5523fd6a Define _DtPLATFORM_MAX_LEN for C libraries (including musl) that do not provide the SVID SYS_NMLN definition. Use sizeof() to replace another #ifdef. 2021-01-10 18:08:00 -07:00
Peter Howkins c62a5049ed libcsa: Always use ANSI function prototypes 2020-11-27 16:58:22 +00:00
Jon Trulson 90e61dda5f Merge branch 'master' into autotools-conversion 2020-11-24 16:53:24 -07:00
Peter Howkins 0444e500bc libDtSearch: Resolve GCC 10 errors about multiple definitions of global variables 2020-11-24 02:48:10 +00:00
Jon Trulson b21968f26a fix broken dev version number: 2.3.1a -> 2.3.2a 2020-11-23 17:01:37 -07:00
Peter Howkins 67f62e5a8a all: remove deprecated sys_errlist[] and replace with ANSI C strerror() 2020-11-02 05:30:08 +00:00
Peter Howkins cb3180cd2a libcsa: resolve all missing-prototypes warnings 2020-08-01 23:00:23 +01:00
Peter Howkins f4eb62fa69 libcsa: Resolve all strict-prototype warnings 2020-08-01 22:45:55 +01:00
Peter Howkins ce4fad4c5a libcsa: Resolve GCC 9 warnings 2020-08-01 21:38:08 +01:00
Jon Trulson 349802ddd3 dthelpprint: make it build. 2020-04-13 16:21:27 -06:00
Jon Trulson 316ab9c9db tt: fix link order for tt_type_comp and dbck
These caused link errors on Gentoo, maybe other systems.

Patch by Peter G.
2020-03-24 11:34:51 -06:00
Jon Trulson 5852c4742f Fix erroneous uses of ${prefix} rather than $(CDE_INSTALLATION_TOP)
Some Makefiles use prefix when they should be using
CDE_INSTALLATION_TOP.

Patch by Peter G.
2020-03-23 13:10:07 -06:00
Jon Trulson 11af2add7e Merge branch 'master' into autotools-conversion 2020-03-23 12:55:32 -06:00
Jon Trulson 15a2032626 Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
patch supplied from Peter G.
2020-03-23 12:51:18 -06:00
Jon Trulson 313b4a8e0b Merge branch 'master' into autotools-conversion 2020-01-26 12:17:44 -07:00
Chase b46cfa7876 Remove redundant hourglass functions 2020-01-26 12:09:12 -07:00
Jon Trulson 6b32246d06 dtsession, DtSvc: fix CVE-2020-2696/VU#308289
Marco Ivaldi <marco.ivaldi@mediaservice.net> has identified 3
vulnerabilities in CDE.

Two of them could affect our CDE (open-source version), while the 3rd
(sdtcm_convert) is Solaris specific.

The two vulnerabilities, both of which affect dtsession could allow a
local privilege escalation to root.  A POC exists for Solaris.  The
POC will not function on our CDE for two main reasons:

- the POC is Solaris specific
- The overflowed variables in question are allocated on the heap,
  whereas in Solaris these variables are located on the stack.

The first vulnerability allows an extra long palette name to be used
to cause a crash via insufficient validation in
SrvPalette.c:CheckMonitor().

The second, which has not yet been assigned a CERT CVE resides in
SmCreateDirs.c:_DtCreateDtDirs() in libDtSvc.  Due to insufficient
bounds checking, a crash or corruption can be achieved by using a very
long DISPLAY name.

This one is considered difficult to exploit, and no POC code is
available at this time.  CDE 2.x code-bases are also listed as not
vulnerable, however some work has been done anyway to do some proper
bounds checking in this function.

The following text portions are copied from the relevant advisories,
which have not been released as of this writing.

NOTE: Oracle CDE does NOT use CDE 2.3.0a or earlier as mentioned
below.  They are completely different code-bases):

Regarding CVE-2020-2692:

  A buffer overflow in the CheckMonitor() function in the Common
  Desktop Environment 2.3.0a and earlier, as distributed with Oracle
  Solaris 10 1/13 (Update 11) and earlier, allows local users to gain
  root privileges via a long palette name passed to dtsession in a
  malicious .Xdefaults file.

  Note that Oracle Solaris CDE is based on the original CDE 1.x train,
  which is different from the CDE 2.x codebase that was later open
  sourced. Most notably, the vulnerable buffer in the Oracle Solaris
  CDE is stack-based, while in the open source version it is
  heap-based.

Regarding the DtSvc bug, which does not currently have a CERT CVE:

  A difficult to exploit stack-based buffer overflow in the
  _DtCreateDtDirs() function in the Common Desktop Environment version
  distributed with Oracle Solaris 10 1/13 (Update 11) and earlier may
  allow local users to corrupt memory and potentially execute
  arbitrary code in order to escalate privileges via a long X11
  display name. The vulnerable function is located in the libDtSvc
  library and can be reached by executing the setuid program
  dtsession.

  The open source version of CDE (based on the CDE 2.x codebase) is
  not affected.
2020-01-13 19:13:23 -07:00
Jon Trulson ab023dfaed DtSvc: always use vsnprintf
There was code (_DtSimpleError() and _DtSimpleErrornoError()) that
only used snprintf when USE_SNPRINTF was defined, which it never was
of course.  We just remove the 2 checks and always use [v]snprintf.
2020-01-12 17:25:56 -07:00
Jon Trulson 7f4889f348 freetype: redo the way we detect and use
We (configure) relies on freetype-config existing and telling us what
the proper includes and libs are.
2020-01-05 18:11:52 -07:00
Jon Trulson 4d12673147 configure: detect and use jpeg library 2020-01-05 16:27:17 -07:00
Jon Trulson 00dcd9c63d FreeBSD 12: get CDE to build and run
With this patch, CDE (autotools) builds and runs on fbsd 12 now.
fbsd11 should work too, but not yet tested.

You must use gmake - ie:

./configure MAKE=gmake
gmake

Seems all of the BSD's will need to use gmake for now.
2020-01-04 16:26:46 -07:00
Jon Trulson 2f8a2ec066 FreeBSD 12/libDtHelp: fix link errors with missing libjpeg 2020-01-04 14:36:06 -07:00
Jon Trulson 973ebf9ed0 library versioning: use proper format and specify for ALL libraries 2019-12-04 18:09:22 -07:00
Jon Trulson 25035724af cpp revisited: look for a cpp binary in various locations for use at runtime
Certain programs like dtlogin and tt_type_comp need access to the
system's cpp command to process certain files at runtime.  tradcpp is
not installed on most systems, and is intended for use as a imake-cpp
replacement which is all we are using it for.  We still need an
honest cpp for the CDE components to use.

Now, we look in various places for a 'cpp' command and set CPP_COMMAND
to it's value.  This way tt_type_comp and other CDE programs can do
required processing at runtime.
2019-12-04 14:28:44 -07:00
Jon Trulson cdc9eae583 Get tttypes installed correctly.
There is a problem with CPP_PROGRAM - using $CPP or $GENCPP (tradcpp)
always fails in tt_type_comp with the error:

"nclude ", line 8: syntax error

If I define it to /lib/cpp (previous hardcoded value) then it seems to
work fine.  Only the dtinfo and dtinfo_start ptypes use #include, and
therefore show this error.  Needs investigation.
2019-12-02 19:59:44 -07:00
Jon Trulson c40f0c9f08 Get /usr/dt/config populated correctly on make install 2019-12-02 14:33:05 -07:00
Jon Trulson e577e8102c tt_type_comp: incorporate master CPP_PROGRAM fix into Makefile.am 2019-12-01 13:44:02 -07:00
Jon Trulson e481f4cb93 Merge branch 'master' into autotools-conversion 2019-12-01 13:31:21 -07:00
Nina Didenko 9221c55a5f tt_type_comp: use CppCmd definition
Hi.

This patch makes tt_type_comp respect CppCmd

Thanks!
2019-11-29 18:12:20 -07:00
Jon Trulson c329d5cfd7 Remove $(TIRPCINC) from all Makefile.am files - it no longer exists
Also, restructure some of the dependencies in the lib/tt binaries.  We
will link with libtt (which will include libtirpc as a dependency),
and XTOOLLIB - all the right X11 stuff without needing to add it to
every OS.  Removed several uneeded OS specializations ("if LINUX",
etc) as a result.
2019-11-20 18:52:29 -07:00
Jon Trulson af20bc2b57 changing_version_number.txt: change tooltalk.tmpl to tooltalk.inc 2019-11-19 18:15:26 -07:00
Jon Trulson 31e69340ce libtt: add -ltirpc as a dependency if we are using it
This means that when linking against libtt, libtirpc should also
automatically be linked in if we determined that we are using tirpc.

This avoids having to link every program that uses libtt (almost all
of them) from having to have a $(TIRPCLIB) added to their link
commands.
2019-11-19 18:09:21 -07:00
Jon Trulson 152f5c9a88 Merge branch 'master' into autotools-conversion after utf8-conversion 2019-11-19 11:44:33 -07:00
Jon Trulson 0d70d8b120 Set version to 2.3.1a (devel) for current master 2019-11-18 13:03:52 -07:00
Jon Trulson 82059bf240 Merge branch 'master' into autotools-conversion after 2.3.1 release 2019-11-16 16:35:56 -07:00
Jon Trulson 5fe7ee5b67 Change CDE version info for 2.3.1 release 2019-11-15 18:04:01 -07:00
Chase 88b46c6a28 il: remove various deprecated files 2019-11-01 17:23:48 -06:00
Chase 0f36a57eff remove more internal jpeg headers 2019-11-01 17:23:24 -06:00
Jon Trulson 1fc3284829 libtt, DtWidget: use new GENCPP 2019-10-30 19:48:04 -06:00
Jon Trulson 3ce0527e52 DtSvc: vastly simplify building this library
We take advantage of subdir-object and just build the subdir source
files directly as normal dependencies of libDtSvc in the top level
Makefile.am.

This means the intevening subdirectory Makefiles are no longer needed,
and no need to replicate flags and the like between the
subdirectory Makefile.am files.

Also, no need to build fake .a libs we can't really use.

configure: remove AC_OUTPUT_FILES related the the lib/DtSvc/*
subdirectories.  They are no longer needed.
2019-10-29 19:17:52 -06:00
Jon Trulson d183ade8b3 DtSvc: we can't use archive .a libs in building libDtSvc.so
We were building subsets of this library as archive.a objects, then
trying to combine them into a shared object.  This warnings, and link
failures due to the lack of 0fPIC when building the archive libraries.

Now, we do not buld archive libraries, and the main libDtSvc.so
library is build by adding all of the .lo file in the component
subdirectories.

In a future commit, we could just remove the SUBDIR builds (DtUtil1,
etc) and build the sub objects directly.
2019-10-29 18:11:42 -06:00