1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00
Commit graph

1740 commits

Author SHA1 Message Date
Jose Rubio
5c56c32d17 Fixes for a few -Wincompatible-pointer-types 2019-10-12 22:29:44 +02:00
Jon Trulson
e05d138c4c Merge /u/jrubio/cdesktopenv/ branch int-conversion into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/14/
2019-10-11 23:58:44 +00:00
Jose Rubio
c900cedbc9 Fix to delete-incomplete warnings. 2019-10-11 13:43:08 +02:00
Jose Rubio
0086a7067e Fix to compile warnings.
* discarded-qualifiers warnings.
* Function definitions, the .h doesn't match the .c.
* Added some include to ensure the .c has function definition.
2019-10-11 10:49:48 +02:00
Jose Rubio
f9790767f3 Fix to different compile warnings.
Fix to multiple int-conversion
Removal of duplicated function definition in dtudcfonted/util.h
Added XtEventHandler prototypes to mtfgui
2019-10-10 19:59:40 +02:00
Jose Rubio
20ba7550cd Fix to Wenum-compare
It seems the purpose is to define a constant as an anonymous enum.
that behaviour triggers the enum  compare. Let's make it a constant.
2019-10-10 17:01:56 +02:00
Jose Rubio
707cc1256f Fix openbsd compile build errors due to dependency on libiconv
The path to libiconv is selected in config/cf/OpenBSD.cf reusing the
same trick  as FreeBSD does.
2019-09-27 21:54:06 +02:00
Jon Trulson
ddc3c8857b Merge branch 'master' into utf8-conversion 2019-09-16 13:24:18 -06:00
Jose Rubio
4f86508321 Merge branch 'linux-suse-tcl-link' of https://git.code.sf.net/u/jrubio/cdesktopenv into linux-suse-tcl-link 2019-09-16 14:59:24 +02:00
Jose Rubio
507665352f Link TCL libraries and restrict tcl8.6 to SuSE only. 2019-09-16 14:58:21 +02:00
Jose Rubio
523e9ba304 Update TCL libraries link and restrict tcl8.6 only to SuSE. 2019-09-15 19:01:17 +02:00
Jon Trulson
1ebd1a2416 Merge /u/jrubio/cdesktopenv/ branch implicit-int into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/9/
2019-09-12 22:14:19 +00:00
Jon Trulson
6e23c81914 Merge /u/jrubio/cdesktopenv/ branch pointer-compare into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/8/
2019-09-12 22:11:52 +00:00
Jon Trulson
0561080e16 Merge /u/jrubio/cdesktopenv/ branch linux_aarch64 into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/6/
2019-09-12 22:05:43 +00:00
Jon Trulson
086672e193 Merge /u/jrubio/cdesktopenv/ branch dtksh_include_sys_sysmacros into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/10/
2019-09-12 22:02:51 +00:00
Jose Rubio
51db5ff378 Fix for deprecated warnings related to gnu libc sys macros.
The patch only includes sysmacros for linux, the only target with gnu libc to avoid regression issues.
2019-09-12 13:10:02 +02:00
Jon Trulson
426a18d9ef isfname.c: remove register keyword 2019-09-11 17:48:06 -06:00
Jon Trulson
b53728d3b3 ksh/libast: include sys/sysmacros.h in fmtdev.c for linux systems
Fix scraped from CDE forum post:
https://sourceforge.net/p/cdesktopenv/discussion/general/thread/24d7511a39/
2019-09-11 17:39:30 -06:00
Jose Rubio
a49aedc946 FIX: Define Aarch64 as little endian so DtInfo compiles. 2019-08-29 11:12:26 +02:00
Jose Rubio
f0c312b207 Fixes for warnings related to -Wimplicit-int. 2019-08-20 12:52:43 +02:00
Jose Rubio
db7370b62b Cleanup of -Wpointer-compare warnings. 2019-08-19 18:02:25 +02:00
Jose Rubio
0d115796c2 Added linux/aarch64 as valid target. 2019-08-19 16:55:11 +02:00
Jon Trulson
d59ec197e5 dtprintinfo: remove SUID root on install
This program should not be SUID root.  If you need it's services, just
run

sudo dtprintinfo -populate

TODO: dtprintinfo should only create it's actions (if ever) in a
user's .dt/types/ directory and not in any system-wide dirs.  No need
for root access at all.
2019-05-07 11:32:44 -06:00
Jon Trulson
05d231606e dtprintinfo: correct another possible buffer overflow 2019-05-07 11:21:49 -06:00
Jon Trulson
30cd56ac38 dtprintinfo: Fix a potential exploitable buffer overrun
This fixes a potentially exploitable buffer overrun in dtprintinfo.
This was brought to my attention based on a 0day exploit released for
Solaris CDE.

The exploit code does not work (or build) on linux, and the overrun is
in the heap rather than the stack as on Solaris, but it's easy to see
how this could be exploited.

The following is the content of the advisory:

8<-----------------------------------------------------------

@Mediaservice.net (Cybaze Group) Security Advisory #2019-01 (2019-05-07)

         Title:	Local privilege escalation via CDE dtprintinfo
   Application:	Common Desktop Environment 2.3.0 and earlier
     Platforms:	Oracle Solaris 10 1/13 (Update 11) and earlier
   Description:	A local attacker can gain root privileges by exploiting
		a buffer overflow in CDE dtprintinfo
        Author:	Marco Ivaldi <marco.ivaldi@mediaservice.net>
   Contributor:	Dave Aitel <dave.aitel@cyxtera.com> (original discovery)
 Vendor Status:	<secalert_us@oracle.com> notified on 2019-05-05
		<cdesktopenv-devel@lists.sourceforge.net> notified on 2019-05-05
           CVE:	The Common Vulnerabilities and Exposures project has not assigned
		a name to this issue yet
    References: https://lab.mediaservice.net/advisory/2019-01-cde-dtprintinfo.txt
		https://github.com/0xdea/raptor_infiltrate19
		https://sourceforge.net/p/cdesktopenv/wiki/Home/
		https://www.oracle.com/technetwork/server-storage/solaris10/
		https://www.mediaservice.net/
		https://infiltratecon.com/

1. Abstract.

A buffer overflow in the DtPrinterAction::PrintActionExists() function in the
Common Desktop Environment 2.3.0 and earlier, as used in Oracle Solaris 10 1/13
(Update 11) and earlier, allows local users to gain root privileges via a long
printer name passed to dtprintinfo by a malicious lpstat program.

This is a 0day vulnerability demonstrated at #INFILTRATE19 on May 2nd, 2019 in
the talk "A bug's life: story of a Solaris 0day".

2. Example Attack Session.

bash-3.2$ cat /etc/release
                    Oracle Solaris 10 1/13 s10x_u11wos_24a X86
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
                            Assembled 17 January 2013
bash-3.2$ uname -a
SunOS nostalgia 5.10 Generic_147148-26 i86pc i386 i86pc
bash-3.2$ id
uid=54322(raptor) gid=1(other)
bash-3.2$ gcc raptor_dtprintname_intel.c -o raptor_dtprintname_intel -Wall
bash-3.2$ ./raptor_dtprintname_intel 192.168.1.1:0
raptor_dtprintname_intel.c - dtprintinfo 0day, Solaris/Intel
Copyright (c) 2004-2019 Marco Ivaldi <raptor@0xdeadbeef.info>

Using SI_PLATFORM       : i86pc (5.10)
Using stack base        : 0x8047fff
Using rwx_mem address   : 0xfeffa004
Using sc address        : 0x8047f60
Using strcpy() address  : 0xfefe26a0

lpstat called with -v
lpstat called with -v
lpstat called with -d
uid=0(root) gid=1(other)

3. Affected Platforms.

All platforms shipping the Common Desktop Environment are potentially
affected. This includes:

* Oracle Solaris 10 1/13 (Update 11) and earlier [default installation]

According to the CDE Wiki, the following platforms are officially supported:

* All Official Ubuntu variants 12.04 - 18.04
* Debian 6, 7, 8, 9
* Fedora 17 at least
* Archlinux
* Red Hat
* Slackware 14.0
* OpenBSD
* NetBSD
* FreeBSD 9.2, 10.x, 11.x
* openSUSE Tumbleweed (gcc7)
* openSUSE Leap 4.2 (gcc4)
* SUSE 12 SP3 (gcc4)
* Solaris, OpenIndiana

4. Fix.

The upstream CDE maintainers have issued a patch for this vulnerability. Oracle
is investigating the issue via tracking# S1153109 and is expected to release a
fix for all affected-supported versions of Solaris via their quarterly Critical
Patch Update (CPU) program.

As a temporary workaround, it is possible to remove the setuid bit from the
dtprintinfo executable as follows:

bash-3.2# chmod -s /usr/dt/bin/dtprintinfo

5. Proof of Concept.

A working exploit for Oracle Solaris 10 1/13 (Update 11) Intel has been
developed as a proof of concept. Exploits for other Solaris versions and for
the SPARC architecture are also available. All exploits can be downloaded at:

https://github.com/0xdea/raptor_infiltrate19/
https://github.com/0xdea/exploits/

8<-----------------------------------------------------------
2019-05-07 11:21:49 -06:00
Jon Trulson
5cdeaf5b1f NLS: fix quote issue with various OS's in C/types/_common.dt.tmsg 2019-02-24 12:58:31 -07:00
Jon Trulson
d6ece8fd00 Merge branch 'master' of ssh://git.code.sf.net/p/cdesktopenv/code 2019-02-24 12:56:10 -07:00
Jon Trulson
c575ca9315 dtdockbook/instant: Add the proper paths for TCL on NetBSD
Patch submitted by Danilo Pecher <danilo.pecher@data-experts.biz>
2019-02-24 12:54:42 -07:00
Adam Sampson
ae499c794e Explicitly initialise two more static pointers
"dtcm: Coverity 88006" fixed this for buf, but not for string in the
same function (and we may as well initialise string_head for consistency
too).
2019-01-26 00:07:36 +00:00
Adam Sampson
162c88b6ea Don't dereference an uninitialised pointer
This was an incorrect fix in "dtcm: Coverity 88382".
2019-01-26 00:05:54 +00:00
Adam Sampson
a97ab71059 Avoid a NULL pointer dereference
"dtcm: Coverity 89051" fixed an instance of this on the previous line,
but not this one.
2019-01-26 00:03:34 +00:00
Jon Trulson
8ba629fcd1 Merge branch 'master' into utf8-conversion 2019-01-15 12:02:49 -07:00
Chase
4d7f9df692 Use iconv on linux 2019-01-14 10:48:28 -07:00
Alex Ivanov
b9f352df59 define M4Cmd 2019-01-08 19:48:47 -07:00
tu83
d5faa0360c Fixed segfault for mode switching when compiled with clang
dtcalc compiled with clang segfaulted when switched
to a different mode like Deg to Rad or Financial to
Scientific. Was reproducable at least under FreeBSD/AMD64.
Fixed now.
2019-01-06 18:55:19 +01:00
Jon Trulson
2902373dbb Merge branch 'master' into utf8-conversion 2018-11-08 14:51:46 -07:00
Jon Trulson
76721c2348 dtcalc/calctool.h: Use include stdlib rather than extern declarations 2018-11-08 14:19:25 -07:00
Jon Trulson
965e5c0384 Merge branch 'master' into utf8-conversion-2 2018-11-07 11:24:00 -07:00
Peter Howkins
cb4075e855 libDtHelp: Fix another regression caused by Coverity fix, clicking 'Help Manager' works again. 2018-11-07 17:04:59 +00:00
Peter Howkins
fff0c54538 libDtHelp: Fix a regression with the Help Index pages caused by an overzealous Coverity fix 2018-11-07 01:05:56 +00:00
Jon Trulson
cf89ba1a77 Merge branch 'master' into utf8-conversion-2 2018-11-05 15:52:14 -07:00
Jon Trulson
59dc231872 linux: DtHelp/StringFuncs, enable real iconv() support
For some reason, the #include of iconv.h was removed, and dummy stubs
were put in place on linux systems (only).  This caused iconv() calls
to be completely ignored.

Now we use iconv() just like very other OS we support.
2018-11-05 15:33:16 -07:00
Jon Trulson
54b7550205 utf8 conversion: mostly working, help has issues
Localization seems to work.  The main help viewer dies though.  Other
parts of help seem to work.  Index causes a crash too.

Crash:
*** Error in `/usr/dt/bin/dthelpview': malloc(): memory corruption (fast): 0x00000000021fefb0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f61814917e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x82651)[0x7f618149c651]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f618149e184]
/usr/lib/x86_64-linux-gnu/libxcb.so.1(+0xc2ab)[0x7f617f71d2ab]
/usr/lib/x86_64-linux-gnu/libxcb.so.1(+0x9ed1)[0x7f617f71aed1]
/usr/lib/x86_64-linux-gnu/libxcb.so.1(+0xa31d)[0x7f617f71b31d]
/usr/lib/x86_64-linux-gnu/libxcb.so.1(xcb_writev+0x45)[0x7f617f71b3a5]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XSend+0x19e)[0x7f6181b2a54e]
/usr/lib/x86_64-linux-gnu/libX11.so.6(_XReply+0x82)[0x7f6181b2aa42]
/usr/lib/x86_64-linux-gnu/libX11.so.6(XSync+0x4d)[0x7f6181b2652d]
/usr/lib/x86_64-linux-gnu/libXm.so.4(XmUpdateDisplay+0x49)[0x7f61821c1d89]
/usr/dt/lib/libDtHelp.so.2(+0x2cf1d)[0x7f6182ae8f1d]
/usr/dt/lib/libDtHelp.so.2(+0x2d66d)[0x7f6182ae966d]
/usr/dt/lib/libDtHelp.so.2(_DtHelpGlobSrchDisplayDialog+0x2205)[0x7f6182aebca5]
/usr/dt/lib/libDtHelp.so.2(_DtHelpDisplayIndexCB+0x26)[0x7f6182af07e6]
/usr/lib/x86_64-linux-gnu/libXm.so.4(+0xde9d5)[0x7f618216e9d5]
/usr/lib/x86_64-linux-gnu/libXm.so.4(+0xdf0c5)[0x7f618216f0c5]
/usr/lib/x86_64-linux-gnu/libXm.so.4(_XmDispatchGadgetInput+0x113)[0x7f6182140683]
/usr/lib/x86_64-linux-gnu/libXm.so.4(_XmGadgetActivate+0x22)[0x7f61821ef0b2]
/usr/lib/x86_64-linux-gnu/libXt.so.6(+0x48965)[0x7f6181e6f965]
/usr/lib/x86_64-linux-gnu/libXt.so.6(_XtTranslateEvent+0x31a)[0x7f6181e7090a]
/usr/lib/x86_64-linux-gnu/libXt.so.6(XtDispatchEventToWidget+0x4cb)[0x7f6181e4921b]
/usr/lib/x86_64-linux-gnu/libXt.so.6(+0x228dd)[0x7f6181e498dd]
/usr/lib/x86_64-linux-gnu/libXt.so.6(XtDispatchEvent+0xc9)[0x7f6181e499b9]
/usr/lib/x86_64-linux-gnu/libXt.so.6(XtAppProcessEvent+0x1d7)[0x7f6181e555d7]
/usr/lib/x86_64-linux-gnu/libXt.so.6(XtAppMainLoop+0x2d)[0x7f6181e49d9d]
/usr/dt/bin/dthelpview[0x401b77]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f618143a830]
/usr/dt/bin/dthelpview[0x401c89]
2018-11-04 20:21:20 -07:00
Jon Trulson
5839bfdc5f Fix .gitignore for ISO8859-1 docs 2018-11-04 19:31:22 -07:00
Jon Trulson
c876a76f4f utf8 conversion: fix up seperation of locale and doc building
Docs (help and the dtinfo guides) are now always built using the
ISO8859-1 locale.  To support UTF-8, our docbook needs to be updated
to something from this century, ideally this decade.  In addition, a
conversion to XML would also be required as a result.  So, until that
happens, use ISO8859-1 for docs.

However, other locale information, like message catalogs, resource
files, and the like are now converted to UTF-8.

All supported languages are now built by default on linux again.
2018-11-04 19:25:57 -07:00
Jon Trulson
6a5dc63f3b UTF-8 conversion: fixup database Imakefiles, config and gitignore 2018-11-04 18:36:07 -07:00
Jon Trulson
63ad725508 UTF-8 conversion: programs/localized/sv_SE 2018-11-04 18:35:54 -07:00
Jon Trulson
8c73c01cb1 UTF-8 conversion: programs/localized/it_IT 2018-11-04 18:34:49 -07:00
Jon Trulson
592c6bc5d1 UTF-8 conversion: programs/localized/fr_FR 2018-11-04 18:34:43 -07:00
Jon Trulson
6867b04b1b UTF-8 conversion: programs/localized/es_ES 2018-11-04 18:34:34 -07:00