Commit Graph

461 Commits

Author SHA1 Message Date
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
Jon Trulson d99b3eb895 DtXinerama: build as shared lib, all dep on libXinerama 2019-10-29 18:07:58 -06:00
Jon Trulson 86bae29d78 Protect inclusions of autotools_config.h with HAVE_CONFIG_H 2019-10-28 15:01:02 -06:00
Jon Trulson d7e5206d6b DtSvc/DtUtil2: fix implicit function declarations 2019-10-28 14:30:43 -06:00
Jon Trulson dbce2e4337 DtSvc/DtUtil1: fix implicit function declarations 2019-10-28 14:30:36 -06:00
Jon Trulson c0e3f08c9f DtSvc/DtUtil2: fix implicit function declarations 2019-10-28 13:27:47 -06:00
Jon Trulson 951ae0d327 DtSvc/DtUtil1: fix implicit function declarations 2019-10-28 13:22:09 -06:00
Jon Trulson 7bd6429b8a csa: add dep for reparser.h to fix multicore build
Also rework a bit to make sure reparser.o is actually linked into the
lib.  Ahem.
2019-10-26 17:31:59 -06:00
Jon Trulson c15237ddac csa: make it build 2019-10-26 17:08:41 -06:00
Jon Trulson 6186a4c631 DtMrm: make it build 2019-10-26 16:36:37 -06:00
Jon Trulson c3d7858424 DtTerm: make it build 2019-10-26 16:34:29 -06:00
Jon Trulson 7ff1995da0 DtPrint: make it build 2019-10-26 16:09:18 -06:00
Jon Trulson b0cc0c8747 DtHelp: make it build
Use configure's endian checks to determine whether to set LSB in il/.

Add locale.h check, include to Helpos.c

Both via including autotools_config.h.
2019-10-26 16:05:48 -06:00
Jon Trulson 61ab4a5b95 DtWidget: make it build, change include/cppfile.inc a bit
cppfile.inc - don't set BUIT_SOURCES or CLEANFILES here as they
overwrite (or in case of the CLEANFILES +=...) ignore the settings.
Do those in the Makefile.am always.

We still need a better way to preprocess generic files.  cppfile.inc
will only work for one file per Makefile...
2019-10-26 15:05:52 -06:00
Jon Trulson 1079ffa240 configure: create some convenience AC_SUBST's for the global includes
Modify the various makefiles that were doing $(top_builddir)/include/Dt
to use them like @DT_INCDIR@, @TT_INCDIR@, etc...
2019-10-26 14:30:36 -06:00
Jon Trulson 056144488a DtSearch: get it to build, fix up some confusion
There are/were two dproto.h files, one in DtSearch, one in raima.  The
one in raima is the one we want, so replace the global Dt/dproto.h
with it.  Also correct a prototype declaration error in that file.

Delete the dproto.h file in DtSearch, it's garbage and unused.

Next, redo the way yacc is used.  Autotools does "the right thing" by
simply including the .y file in *_SOURCES and using
BUILT_SOURCES/CLEANFILES to manage it.  No need for special rules to
handle yacc and lex.
2019-10-26 14:13:19 -06:00
Jon Trulson 43387e7368 libDtSvc: get it to build 2019-10-25 18:33:06 -06:00
Jon Trulson 0d78e17036 DtSvc,DtXinerama: More include fixes to deal with new order. 2019-10-25 18:06:54 -06:00
Jon Trulson 647d0ae96a DtXinerama.h header file - moved to main include/ dir 2019-10-25 17:52:20 -06:00
Jon Trulson 31fec7edb5 tt: Fixup tt build for new includes locations
Some files were trying to access the global includes directy in the
build area with things like #include <api/c/tt_c.h>, which is now
wrong.  Se we fix all of those up.  tt_c.h and tttk.h are now global,
so we no longer need to root around various build dirs to find them.

TT builds again.
2019-10-25 17:37:58 -06:00
Jon Trulson 369308b737 The great includes migration of 2019 (autotools)
Ok - so one of the steps in building CDE is an early phase called the
includes phase (make includes).  At this point, all of the public
header files are exported to exports/include/Dt, DtI, ...

Then, the software is built using that include dir.

This of course does not work in autotools.  Much of the software does
things like #include <Dt/something.h>, so in order for the build to
succeed, this behavior must be represented/replicated in some way.

It seems the usual way of dealing with this is to place all public
headers (and in some projects, ALL headers) into a toplevel include
directory.

We now do this for all public headers - they have been moved from
wherever they were and placed in the appropriate spot in includes/

This will break the Imake 'make includes' phase unless the Imakefiles
are fixed (remove the HEADERS = stuff, and the incdir defines).  This
has not been done at this point since in reality, once autotools works
properly, there will be no need for the Imake stuff anymore, and I
intend to get rid of it.

This is just a warning for now - Imake builds in this tree will now
fail at the 'includes' stage.

This commit is only the migration.  In upcoming commits, libtt will be
fixed so that the hack being used before to get around this problem is
removed as there will no longer be any need.

And then the autotools work continues...
2019-10-25 17:01:34 -06:00
Jon Trulson 7c2983185d Re-fix tt_type_comp -- it doesn't actually need yacc/lex 2019-10-25 10:43:05 -06:00
Jon Trulson 9182ddfcc3 tt: fixup remaining build issues 2019-10-24 21:29:03 -06:00
Jon Trulson e8f3c6eee2 tt: get tt_type_comp to build 2019-10-24 20:55:04 -06:00