Commit Graph

1216 Commits

Author SHA1 Message Date
Peter Howkins d2e1f3158b dtcalc: warning prevention, add <stdlib.h> include for prototype of free() 2012-08-09 12:08:46 +01:00
Peter Howkins 697c1522fb dtcalc: warning prevention, do not use NULL when you mean 0. 2012-08-09 12:07:53 +01:00
Jon Trulson 70e1c5a55a dtaction: Fix unsafe use of sprintf
Patch from Robert Tomsick <robert+cde@tomsick.net>:

I believe this fixes vulnerability #3 from CERT CA-1999-11.[1]  The other
uses of sprintf in DtAction seem to be safe.

[1] https://www.cert.org/advisories/CA-1999-11.html
2012-08-08 20:17:17 -06:00
Jon Trulson 4ac42dd84f dtterm - minor warning fixes
Patch by Robert Tomsick <robert+cde@tomsick.net>
2012-08-08 20:09:40 -06:00
Jon Trulson f9c2b3184e DtSvc/dtwm: Fix some implicit declarations of functions by adding appropriate
Patch from Frederic Koehler <f.koehler427@gmail.com>:

These implicit definitions cause segfaults on x64 because
the implicit return type is a 32-bit signed int, rather than a pointer
type.
2012-08-08 11:47:18 -06:00
Jon Trulson a26b73a1a6 dtwm: Define a final fallback for loading default window manager font
Patch from Frederic Koehler <f.koehler427@gmail.com>:

Define a final fallback for loading default window manager font;
before exiting, forcefully try to load "fixed" font. This is sufficient
to allow systems where fontList is set to an empty list to startup dtwm,
for now.
2012-08-08 11:39:29 -06:00
Jon Trulson a7562a8009 dtlogin: don't try to use /dev/mem to get random data on linux/bsd
dtlogin's genauth routines were trying to open and read /dev/mem on
linux and (presumably) bsd systems in order to obtain random data used
in creating an auth key.

This is bad for a variety of reasons.  Newer linux kernels (at least
on 3.2) issue the following warning to the kernel logs:

"Program dtlogin tried to access /dev/mem between 100000->102000."

Now on linux we will use /dev/urandom, and on CSRG_BASED (bsd) systems
we will use /dev/random to obtain some entropy.
2012-08-07 23:22:44 -06:00
Jon Trulson f42fa885be Fix SIGSEGV while compiling dthelp on 64 bit systems.
Patch from Ulrich Wilkens <mail@uwilkens.de>

I have a little patch for a problem that I found when I tried to
compile dthelp on 64bit FreeBSD. It could also be a problem on other
64bit systems.  The problem is that the program context compiles but
fails running with segmentation fault.

context uses the function m_malloc() which is missing a correct
prototype sometimes. Then it's treated to return int instead of void *
. On 64bit systems this cuts off the higher 32 bits because void * is
64bit whereas int is only 32bit.
2012-08-06 22:42:34 -06:00
Jon Trulson 606df517f0 dtprintinfo: Fix SIGSEGV in dtprintinfo (passing NULL as first argument to catgets).
Patch from Douglas Mencken <dougmencken@gmail.com>:

The issue is that MESSAGE tries to invoke catgets with NULL first
parameter, which is dereferenced inside catgets (Std C Library
function) without checking, from catgets.c source:

if (catalog->name_ptr[idx + 0] == (u_int32_t) set
          && catalog->name_ptr[idx + 1] == (u_int32_t) message)

On the other hand, there's a special value: -1 (cast to nl_catd),
which must be used instead of 0 (NULL) in the case when we are unable
to provide real catalog_desc, from catgets.c source:

  /* Be generous if catalog which failed to be open is used.  */
  if (catalog_desc == (nl_catd) -1 || ++set <= 0 || message < 0)
    return (char *) string;
2012-08-06 17:12:38 -06:00
Jon Trulson 4c82b51daf programs/Imakefile: don't try to build dtksh or dtinfo under linux. 2012-08-03 23:10:12 -06:00
Jon Trulson 4553d912b0 dtlogin: Fix up Options->Language menu
In dtlogin, you can select the language to switch to by selecting it
via Options->Language.  Unfortunately this was also including '.' and
'..', since this list is built dynamically by scanning a directory.

Now we screen out '.' and '..'.
2012-08-03 17:38:06 -06:00
Jon Trulson cf410afbdb dtbuilder: fixup TOG copyrights issue in generated files.
The TOG copyrights were being removed after a rebuild, leaving behind
the scary "RESTRICTED" copyright text that was originally there.

The issue was that the TOG copyrights were not properly embedded
within a 'DTB_USER_CODE_START' code block.

dtcodegen does not preserve any code outside DT_USER_CODE START and
END blocks.

Additionally, these objects are built with -merge by dtcodgen, so the
existing 'RESTRICTED' header within the codeblocks was being retained.
2012-08-03 15:06:56 -06:00
Peter Howkins 47637b0c37 Re-enable dtappbuilder on linux builds. 2012-08-03 17:10:36 +01:00
Jon Trulson 80559fcfdd dtwm: add missing workspace 'Occupy" commands to the C, de, es, fr, and it locales.
The dtwm DefaultWindowMenu did not list any of the workspace enabled
Occupy commands, which makes it a bit difficult to move windows into a
workspace, or to occupy multiple workspaces.

This was rectified by copying the relevant lines from the
SampleWindowMenu sections containing them that already existed in the
localized files.  Tested on C and DE (German).
2012-07-24 21:21:27 -06:00
Jon Trulson f3be236767 Dtwm.defs.src: set proper mail file path for linux 2012-07-24 20:48:43 -06:00
Jon Trulson ff0dc919ed localized/templates: remove remaining attempts at building dtinfo related catalogs and other files
Attempts were still being made to build dtinfo.cat and other related
dtinfo files.  This could cause build failures in
programs/localized/...
2012-07-24 17:53:57 -06:00
Jon Trulson 3edce2a0c0 sys.resources.src: make HIGH_COLOR the default 2012-07-24 17:51:29 -06:00
Jon Trulson 978aff3dc9 Commit the template changes for the locales including the missing msg files. 2012-07-16 19:52:36 -06:00
Jon Trulson 7604468ca1 instant: change warning message to fatal message, since it is. 2012-07-13 22:26:02 -06:00
Jon Trulson a933d4b600 instant: partially revert commit bc96e6f1ff. remove 'HACK' :)
instant should fail if the locale xlation db cannot be opened.

The reason this was failing was because the locale translation DB for
linux did not exist (Linux.lcx).  I didn't add it until weeks/months
later :)

There needs to be one for each platform called "$(uname -s).lcx".
FreeBSD will need one too.
2012-07-13 22:15:58 -06:00
Jon Trulson bf51c110e5 dtmail: IO.C: just compare against \r on all systems 2012-07-13 21:45:46 -06:00
Jon Trulson 860aa64942 Fix some minor issues and re-enable building of DE, ES, FR, and IT locale data (help and message cats)
Note, there are still some issues with certain programs appearing not
to use their localized message catalogs properly, while others work
fine.

Also, in order to build these now, you need to make sure you have
installed the DE, ES, FR, and IT locales before building or you will
get failures.  On [k]ubuntu, at least, you can install these with the
following commands:

sudo locale-gen de_DE
sudo locale-gen es_ES
sudo locale-gen fr_FR
sudo locale-gen it_IT
2012-07-13 17:42:12 -06:00
Jon Trulson 1c733e5b16 dtsession: implement screen lock/unlock for linux
In order for this to work, dtsession must be setuid root.  If
dtsession is not setuid root, then locking will be disabled, and a
message will be written to ~/.dt/errorlog with the message: "Unable to
lock display due to security restrictions".
2012-07-12 14:22:59 -06:00
Jon Trulson 9c92d5a4ee dtsession: SmUI.c: fix ancient typo 2012-07-12 13:31:54 -06:00
Jon Trulson f46a9c62b9 dtsession: also block HUP and PIPE when preparing to shutdown 2012-07-12 13:13:21 -06:00
Jon Trulson dc5d68afba dtsession: don't exit while processing your own session exit event.
Setup a global that protects against accidentally exiting
while doing session exit related housekeeping.
2012-07-12 13:09:22 -06:00
Jon Trulson 8f6700b0d9 fontaliases: add more robust font.aliases file.
Note, this requires that the xfonts-100dpi and
xfonts-100dpi-transcode[d] packages be installed.  Kubuntu 11.10 calls
the transcoded package 'xfonts-100dpi-transcoded' while 12.04 calls it
'xfonts-100dpi-transcode'

You can also use the 75dpi variants if you wish, though they will look
crappy on larger monitors (>1024x768).
2012-06-21 18:30:40 -06:00
Jon Trulson 191e1849a6 dtlogin|Xsession/config: setup some env variables and fontpath for linux (and CSRG) systems.
What we really need are more fonts installed, like all of the xf 75dpi
and 100dpi fonts.  100dpi looks much better than 75/72 dpi, especially
on any display larger than 1024x768.  Of course, in the far future, we
should use the anti-aliased TT fonts everyone else uses these days
anyway.
2012-06-21 18:05:24 -06:00
Jon Trulson 4b80191943 fonts.alias: use Peters version in the CDE wiki for now. 2012-06-21 17:30:56 -06:00
Jon Trulson ba54c6271b Add fontaliases/linux/ dir, and appropriate entries in the CDE-FONT.udb database.
Note, these still aren't quie working yet.  Notably, font.dir needs to
be generated properly and re-committed so they will be used.
mkfontdir is used to do this, but currently it fails on these
font.alias files (does not recognize them).
2012-06-21 17:07:21 -06:00
Jon Trulson 52360a2cb6 Xsession.src: setup proper cpp_* defines for linux 2012-06-21 17:05:37 -06:00
Jon Trulson 89b98f4ef6 dtfile: add freetype includes to Imakfile
While removing the CCLINK options, accidentally removed freetype
includes, causing dtfile to fail to build.
2012-06-20 14:25:41 -06:00
Jon Trulson f8b5b2fd2a Fix dtsession_res so certain config/xrdb options will work properly. 2012-06-20 01:37:05 -06:00
Jon Trulson 1b74fb9ba7 instant: fix infinite loop seen in non-C locales 2012-06-19 20:02:56 -06:00
Jon Trulson f7e87eb7f3 Remove dtinfo launcher and icons from the default front panel.
Use the help system instead.  Someday, if dtinfo can be made to work,
this can be undone easily.  Note, you may have to clear out your ~/.dt
dir to see the change.
2012-06-19 19:22:08 -06:00
Jon Trulson 157f2e2bf7 nsgmls: Imakefile fixes so it will build 2012-06-19 18:04:53 -06:00
Jon Trulson 8e0523ff02 Remove OS deps from tclPosixStr.c (EOPNOTSUPP/ENOTSUP errnos) 2012-06-19 17:18:00 -06:00
Jon Trulson cdf8003f7c Remove hardcoded CCLINK's in Imakefiles when linking with C++ built libs (DtSvc).
Added proper SharedDtSvcReqs in lnxLib.tmpl and CplusplusLibC in
linux.cf.  This allows the libstdc++ dependancy to be properly
declared for libDtSvc so that it is not neccessary to hardcode 'CCLINK
= g++' in the Imakefiles of programs linking angainst libDtSvc.
2012-06-19 16:27:20 -06:00
Jon Trulson fff18bf2b7 doc/help localization changes
- by default, do not build any other locale than C for now
- do not try to build the guides.  These require functioning
  dtinfo/docbook
- add a Linux.lcx locale translation db.  Not used yet.
- fix some overflows in dtdocbook/instant
2012-06-18 22:01:02 -06:00
Jon Trulson 784c7dff56 Add -fpermissive to linux standard c++ option define in linux.cf
Remove from individual Imakefiles.

Also, remove '#if 0' block in linux.cf, and remove empty
LinuxMachineDefines. This should be working correctly.  If not, let me
know.
2012-06-18 16:27:25 -06:00
Peter Howkins a34f78b798 convert all Imakefile LinuxDistribution to LinuxArchitecture.
(programs part 2)
2012-05-31 13:47:41 +01:00
Peter Howkins 1d555edb6c Convert all Imakefile LinuxDistribution switches to LinuxArchitecture.
(programs part1)
2012-05-31 13:40:38 +01:00
Jon Trulson 262171d25f disable building of dtappbuilder until building right 2012-05-26 21:06:06 -06:00
Jon Trulson 9526740ddd dtsession: fix VU#497553 2012-05-26 19:29:50 -06:00
Jon Trulson a2959aa768 dtspcd: fix symlink vulnerability, a couple warnings 2012-05-26 18:57:11 -06:00
Jon Trulson 9a74b54870 Remove dtinfo and dtksh from the build for now 2012-05-26 17:23:03 -06:00
Peter Howkins de621b906b On the gneeric authenticator use shadow password API if under linux,
allows login on dtlogin.
2012-04-19 17:16:50 +01:00
Peter Howkins bc96e6f1ff HACK, instant should not stop on non fatal fatals, this allows building
of 'C' locale help files.
2012-04-14 23:18:17 +01:00
Peter Howkins aa605c16f3 Linux compilation of ttsnoop (Matthew Howkins)
This may contain prexisting 64-bit issues, caused by hammering pointers
into ints.
2012-04-12 19:08:52 +01:00
Peter Howkins 0859109ba0 Linux compilation of dtbuilder (Matthew Howkins) 2012-04-12 17:36:54 +01:00
Peter Howkins 1d97f19166 Linux compilation fixes for dthelp (Matthew Howkins) 2012-04-12 16:21:14 +01:00
Peter Howkins e60d58be07 Linux compilation of nsgmls (Matthew Howkins) 2012-04-11 18:03:23 +01:00
Peter Howkins cc1d109aa9 Linux compilation of dtcm (Calendar), (Matthew Howkins) 2012-04-11 17:33:26 +01:00
Peter Howkins 09f0b16cf3 Fix segfault on file not copyright file not found. Only fclose() a file
handle that has been successfully fopen()ed.
2012-04-11 15:37:12 +01:00
Peter Howkins 7e9a7df246 Add a MainWindow.h include to prevent missing references. 2012-04-02 15:18:51 +01:00
Peter Howkins 24d74bceee Don't declare 'Chunk' as both public and private, that's just daft. 2012-04-02 15:17:50 +01:00
Peter Howkins 145ffe54dd Don't redeclare forceUpdate() with the wrong prototype. 2012-04-02 15:16:58 +01:00
Peter Howkins 7416482cc3 Add -fpermissive to allow compilation of old C++ on modern GCC 2012-04-02 15:16:05 +01:00
Peter Howkins 7795c597af Use a particulaly unpleasant cast to get a void * into an enumeration type. 2012-04-02 15:15:04 +01:00
Peter Howkins dcbef994e0 C++ needs variables to have a type, use int as a default. 2012-04-02 15:14:09 +01:00
Peter Howkins 8f43a96122 On linux use \r instead of ^M as the character for a carridge return. 2012-04-02 15:13:13 +01:00
Peter Howkins 5c6f7d5317 -fpermissive to allow GCC to compile old C++ 2012-04-02 14:56:05 +01:00
Peter Howkins e7de343555 C++ doesn't allow variables to be declared without a type, use 'int' as
a default.
2012-04-02 14:47:47 +01:00
Peter Howkins d929f4cf5f Link with C++ linker 2012-03-23 13:49:49 +00:00
Peter Howkins d2f85af5e5 Don't try to define abs() on linux, stdlib will handle it. 2012-03-23 13:49:24 +00:00
Peter Howkins cc949fccd2 Exceptionally hacky linux fix. gnu gencat is returning != 0 even when it's
succeeding.
2012-03-22 17:05:45 +00:00
Peter Howkins 87eee2f1e5 Link with C++ linker 2012-03-14 13:53:28 +00:00
Peter Howkins 939fc535d1 Prototype static function setRealDelArea() before it is used. 2012-03-14 13:52:14 +00:00
Peter Howkins 32e8c91d44 On linux do not include X11/Xlocale.h but locale.h, this prevents
Xlocale.h redefining setlocate() into _Xsetlocale() that it then can't
find and link against.
2012-03-14 13:50:42 +00:00
Peter Howkins 7294970c18 Namespace ostream and endl into std::
Use <iostream> without the .h
2012-03-13 17:54:48 +00:00
Peter Howkins 167fd854e1 namespace ostream into std::ostream for modern C++ 2012-03-13 17:45:34 +00:00
Peter Howkins 4e71617973 Add in -fpermissive for compiling old C++ on gcc 2012-03-13 17:43:43 +00:00
Peter Howkins 585674c817 Include <iostream> without the .h on modern C++ 2012-03-13 17:41:48 +00:00
Peter Howkins 5d76061f5d On linux ostream and endl need prefixing into the std namespace. 2012-03-13 17:40:21 +00:00
Peter Howkins adf14ccd77 Include <iostream> without the .h on modern C++ 2012-03-13 17:31:56 +00:00
Peter Howkins 3984d5a45b On linux use the system provided libXau rather than one from the imports
directory (that would have linked to the X11 tree).
2012-03-13 17:18:35 +00:00
Peter Howkins d1f3e24eac Use C++ linker
Add in freetype headers

Use system provided -lXdmcp and -Xau instead of trying to compile them
from the imports directory.
2012-03-13 16:15:22 +00:00
Peter Howkins 7d770cff75 These days include standard C++ header files without the .h on the end 2012-03-12 16:43:22 +00:00
Peter Howkins ca8ede6c1f Use C++ linker 2012-03-12 16:27:41 +00:00
Peter Howkins fb174a8ec3 Undo previous method and use __va_copy instead. 2012-03-12 16:27:08 +00:00
Peter Howkins 0456158e41 On linux use the va_copy() func for variable arugment copying 2012-03-12 16:24:24 +00:00
Peter Howkins 63f6536c72 Initialise varargs list in the same way as OSF 2012-03-12 16:19:32 +00:00
Peter Howkins 71e364de5c Do not bother trying to redefine the putenv() function 2012-03-12 16:16:16 +00:00
Peter Howkins 53f42b5113 CLK_TCK is considered obsolete in GCC, use CLOCKS_PER_SEC instead 2012-03-12 16:05:21 +00:00
Peter Howkins 5949e1c410 Do not redefine strdup() on Linux 2012-03-12 16:03:06 +00:00
Peter Howkins 88cc514fbd Use C++ linker 2012-03-12 15:41:09 +00:00
Peter Howkins 5a09544b16 Linux doesn't allow open() with O_CREAT without permission flags anymore. 2012-03-12 15:39:22 +00:00
Peter Howkins baf772785b -fpermissive to allow gcc to compile old C++ 2012-03-12 15:19:36 +00:00
Peter Howkins 77ed6f7ee3 -fpermissive to allow GCC to compile old C++ 2012-03-12 15:18:09 +00:00
Peter Howkins dd2ff6b448 Set untyped variable to int 2012-03-12 15:15:38 +00:00
Peter Howkins e315d4ba3e Setting const variable with no type to 'int' (likely the default the
old compilers would have used)
2012-03-12 15:14:12 +00:00
Peter Howkins cbffec168a Use C++ linker 2012-03-12 14:48:23 +00:00
Peter Howkins a26bc89ad5 Use C++ linker 2012-03-12 14:42:58 +00:00
Peter Howkins c03c12449d use C++ linker 2012-03-12 14:40:34 +00:00
Peter Howkins b368679e95 Use C++ linker 2012-03-12 14:37:47 +00:00
Peter Howkins 72d9ef5875 Add linux to list of platforms that use that form of memset() 2012-03-12 14:35:03 +00:00
Peter Howkins 8631b4f7c0 Link with C++ linker 2012-03-12 12:14:03 +00:00
Peter Howkins eeb7e285f5 On linux use __fds_bits instead of fds_bits 2012-03-12 12:12:41 +00:00
Peter Howkins a5b6e62764 Link with C++ linker 2012-03-12 12:07:09 +00:00
Peter Howkins fd23228803 -fpermissive to allow old C++ to compile on gcc 2012-03-12 12:04:55 +00:00
Peter Howkins 7ed2353605 On Linux no access to pre iso C varargs.h 2012-03-12 11:56:11 +00:00
Peter Howkins ef1755be43 Link with C++ linker 2012-03-12 11:45:18 +00:00
Peter Howkins 44baf5431b Link with C++ linker 2012-03-12 11:33:49 +00:00
Peter Howkins 68027a6aa0 Link with C++ linker 2012-03-12 11:27:37 +00:00
Peter Howkins b069127485 Linux has the same value for ENOTSUP as another var, therefore protect one
to prevent a duplicate case issue in the switch().
2012-03-12 11:26:01 +00:00
Peter Howkins 12598a4780 Link with C++ linker 2012-03-12 11:19:46 +00:00
Peter Howkins 4d9bb3d348 Link with C++ linker 2012-03-12 11:19:04 +00:00
Peter Howkins 9ad5e31edd Link with C++ linker 2012-03-12 11:17:27 +00:00
Peter Howkins 7d5fcc4400 Link with C++ linker 2012-03-12 11:16:41 +00:00
Peter Howkins ce390d1290 Link with C++ linker 2012-03-12 11:11:10 +00:00
Peter Howkins bd368b24a2 Link with C++ linker 2012-03-12 11:01:17 +00:00
Peter Howkins 0e302b6bba Add in freetype directory to inlude path 2012-03-12 10:41:53 +00:00
Peter Howkins f972ee1646 On Linux when linking against a C++ library the whole program must be linked
with the C++ linker.
2012-03-12 10:38:42 +00:00
Peter Howkins c35c337aa1 When linking against libtt (a C++ lib) the link stage should use the C++
linker
2012-03-12 00:48:04 +00:00
Peter Howkins c884521619 Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Peter Howkins 83b6996daa Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00