Commit Graph

2669 Commits

Author SHA1 Message Date
Jon Trulson 1eeee86d98 Merge /u/runlevel5/cde/ branch fix-return-local-addr into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/84/
2026-01-31 23:38:56 +00:00
Jon Trulson 71a14ce723 Merge /u/runlevel5/cde/ branch xkb into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/83/
2026-01-31 23:37:55 +00:00
Jon Trulson e6da0932a1 Merge /u/runlevel5/cde/ branch strncat into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/82/
2026-01-31 23:37:17 +00:00
Jon Trulson 3f6ee6090e Merge /u/runlevel5/cde/ branch non-root-inst into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/81/
2026-01-31 23:32:33 +00:00
Jon Trulson 65ef653c59 Merge /u/runlevel5/cde/ branch fix-tmpnam-security into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/80/
2026-01-31 23:31:36 +00:00
Jon Trulson 44b93c9f52 Merge /u/runlevel5/cde/ branch config-pamdir into master
https://sourceforge.net/p/cdesktopenv/code/merge-requests/79/
2026-01-31 23:26:01 +00:00
Trung Lê 8a58275ca2 Fix C11 compilation compatibility in dtinfo
- Add TRUE/FALSE macro definitions to FolioObject.hh and List.hh
  to ensure they are defined before use with C11 standard
- Fix config.h include paths in DtSR_BookcaseEntry.C and
  DtSR_SearchResultsEntry.C to use relative path ../../config.h
  so ON_DEBUG and ISSPACE_C macros are available
2026-01-29 22:17:42 +11:00
Trung Lê 443dd7dfa8 Fix return-local-addr warning in DmxUtils.C phrase() 2026-01-29 17:16:30 +11:00
Trung Lê c0c47c28e9 Replace deprecated XKeycodeToKeysym with XkbKeycodeToKeysym
XKeycodeToKeysym() has been deprecated since X11R6.1 (1996).
Use XkbKeycodeToKeysym() instead, which takes an additional group
parameter (0 for default keyboard group).

API change:
  XKeycodeToKeysym(display, keycode, index)
  -> XkbKeycodeToKeysym(display, keycode, 0, index)

Files modified:
- lib/DtWidget/Editor.c
- programs/dtcalc/motif.c
- programs/dtsession/SmSave.c
- programs/dtwm/WmCPlace.c
- programs/dtwm/WmResParse.c
- programs/dtwm/WmWinConf.c
2026-01-29 17:15:28 +11:00
Trung Lê ee445dafcb Fix misleading strncat usage in RFCMIME.c
Replace strncat(buf, str, strlen(str)) with strcat(buf, str).

Using strlen(src) as the bound to strncat is pointless - it will
always copy the entire source string, making it equivalent to strcat.
This also triggers -Wstringop-overflow warnings on modern GCC.

Similarly, strncat with literal strings and their exact length
(e.g., strncat(buf, "==", 2)) is equivalent to strcat.
2026-01-29 17:14:28 +11:00
Trung Lê ee42be7489 Fix non-root installation: ignore chown/chmod errors
Prefix chown root and chmod 4755 commands with - to allow
installation to succeed when running as non-root user.

Affected files:
- programs/dtcm/dtcm/Makefile.am: use localstatedir for spool
- programs/dtsearchpath/dtappg/Makefile.am: ignore setuid errors
- programs/dtsession/Makefile.am: ignore setuid errors
- programs/dtterm/Makefile.am: ignore setuid errors
2026-01-29 17:13:21 +11:00
Trung Lê 72d0164644 Security: replace tmpnam() with mkstemp()
tmpnam() is inherently insecure due to race conditions between
filename generation and file creation (CWE-377). Replace all
occurrences with mkstemp() which atomically creates the file.

Pattern used (portable, already used elsewhere in CDE):
  strcpy(tmpName, "/tmp/dtXXX_XXXXXX");
  { int _tf = mkstemp(tmpName); if (_tf >= 0) close(_tf); }

Files modified:
- lib/DtHelp/Access.c (2 occurrences)
- lib/DtSvc/DtUtil1/DtsMM.c (1 occurrence)
- lib/DtWidget/Editor.c (2 occurrences)
- lib/DtWidget/SearchCalls.c (1 occurrence)
- programs/dtcreate/main.c (2 occurrences)
- programs/dticon/main.c (1 occurrence)
- programs/dtlogin/policy.c (1 occurrence)
- programs/dtpad/fileIo.c (1 occurrence)
- programs/dtpdm/PdmXp.c (1 occurrence)
- programs/dtpdmd/manager.c (1 occurrence)
- programs/dtspcd/main.c (1 occurrence)
- programs/dtwm/WmResParse.c (1 occurrence)

Note: dtksh/ksh93 directory intentionally skipped (vendored code)
2026-01-29 17:10:18 +11:00
Trung Lê 2e0c32e11c configure: Add --with-pam-dir option for configurable PAM directory
The PAM configuration directory was hardcoded to /etc/pam.d (or
/usr/local/etc/pam.d on FreeBSD), which prevented non-root installations.

This change:
- Adds --with-pam-dir configure option to specify PAM config location
- Defaults to /etc/pam.d for system installs (prefix=/usr or /usr/local)
- Defaults to PREFIX/etc/pam.d for local/user installs
- Updates dtlogin/config/Makefile.am to use the PAM_CONFDIR variable

Examples:
  # User installation (PAM config goes to ~/cde/etc/pam.d)
  ./configure --prefix=$HOME/cde

  # System install with standard PAM location
  ./configure --prefix=/usr  # PAM goes to /etc/pam.d

  # Explicit PAM directory
  ./configure --prefix=/opt/cde --with-pam-dir=/etc/pam.d
2026-01-29 17:08:13 +11:00
Peter Howkins f0154141b1 Resolve some more C23 compile issues, a generated file and a missed sub directory in dtinfo 2026-01-09 11:23:58 +00:00
Peter Howkins 68cae0c36b Handle changes needed for C23 compatibility that turns on strict ansi prototypes by default. C23 is now the default for GCC 15 2025-12-31 15:06:27 +00:00
Peter Howkins dd3fd3ddf8 lib/tt/mini_isam: Update to use strict prototypes, required for C23/GCC 15 etc 2025-12-23 17:34:45 +00:00
Chase 2081389353 il: remove ilxpm(P).h 2025-12-20 12:44:32 -07:00
Chase 36b6f82ee8 ttce2xdr: use autoconf substitutions 2025-12-20 12:32:46 -07:00
Patrick Georgi 7ab683d29a handle missing return values 2025-12-18 22:58:26 +01:00
Patrick Georgi 1b852f19a5 Remove uses of prototype argument hiding macros
Modern compilers don't use accept them, they _want_ complete prototypes.
2025-12-18 22:58:26 +01:00
Patrick Georgi de2c06c54d remove system library prototypes 2025-12-18 22:58:26 +01:00
Patrick Georgi 1a524cb93a lib/tt: Align types
int, long, and Recno are close enough but newer compilers became more
strict about nominal vs structural compatibility.
2025-12-18 22:58:26 +01:00
Patrick Georgi acdee57318 Fix issues with va_lists
Identified by clangsa.
2025-12-18 22:58:26 +01:00
Patrick Georgi aced075a9f lib/DtSvc: Free memory more soundly
It _probably_ works to just pass free(ptr) another two arguments, but
compilers don't like this kind of sloppiness anymore.
The call site only expects this function to free the first value,
ignoring the other two, so model that in the local wrapper function.
2025-12-18 22:58:26 +01:00
Patrick Georgi ae001c320f fix misleading indentation
Mostly to shut up the compiler, but some real bugs hidden in there.
2025-12-18 22:58:26 +01:00
Patrick Georgi dca08bc5c2 terminate warning string 2025-12-18 22:58:26 +01:00
Patrick Georgi fa31987221 dtlogin: Avoid putenv to fix issue with passing stack address
putenv doesn't copy the data, so the stack address used here is plain
wrong. It _probably_ doesn't matter all that much because it's
immediately followed by execv(), but let's keep things clean.
2025-12-18 22:58:26 +01:00
Patrick Georgi b86eff35f0 Fix memory leaks 2025-12-18 22:58:26 +01:00
Patrick Georgi ae767ed3dc Mark error handlers as "noreturn"
Match X headers to satisfy newer compilers.
2025-12-18 22:58:26 +01:00
Patrick Georgi ef2c655f55 Use NULL instead of nullptr
NULL is standard for long enough in POSIX to always be available,
while C23 introduced nullptr as a new constant, creating a conflict
here.
2025-12-18 22:58:26 +01:00
Patrick Georgi 5787ee456e avoid use-after-free 2025-12-18 22:58:26 +01:00
Patrick Georgi 01b9288a2b Remove FAR declarations 2025-12-18 22:58:26 +01:00
Patrick Georgi ccbf6a8f8f lib/tt: pass int by ref 2025-12-18 22:58:26 +01:00
Patrick Georgi c0ad5170c9 Avoid "bool" variable name
C23 has a type of that name.
2025-12-18 22:58:26 +01:00
Patrick Georgi 4d41663c58 Avoid conflict with X11 headers 2025-12-18 22:58:25 +01:00
Patrick Georgi 3947facfa2 Remove trailing newlines 2025-12-18 22:58:24 +01:00
Patrick Georgi a6f26ad279 dtmail: Update project files 2025-12-18 00:39:02 +01:00
Chase 61ed7ad39c dthelp: merge duplicate headers 2025-12-14 13:32:54 -07:00
Chase 44a8e2bb4f poll.h: fix ordering 2025-12-14 13:28:17 -07:00
Chase e64189f19d Feature test for poll.h 2025-12-14 13:27:55 -07:00
Jon Trulson 0dc238d08e configure.ac: add checks for "compress" and "uncompress"
These are typically part of the "ncompress" package.
2025-12-12 08:13:33 -07:00
Jon Trulson 5bfdd6f533 dtcm/cm_i18n.c: remove use of fcvt (obsolete), fix sign
Fixes #184
2025-12-06 18:57:59 -07:00
Chase 62a23fc33b dtsession: split ShowWaitState into Enter and LeaveWaitState 2025-11-30 16:30:14 -07:00
Chase 5639630d61 dtwm: fix hourglass not showing up where it should 2025-11-30 16:30:14 -07:00
Chase f38cd20c5c dtmail: remove DEAD_WOOD code 2025-11-30 16:26:42 -07:00
Jon Trulson e945fc8b08 Release 2.5.3 2025-11-25 13:09:08 -07:00
Chase 9d9f3f9380 dthelp/parser: use standard ctype case functions 2025-11-25 12:31:07 -07:00
Chase 48aaa75f11 dtfile: use sh instead of ksh for find command 2025-11-25 12:12:49 -07:00
Jon Trulson 76b99355ce fix: t_optmgmt: Incorrect options format
From a diff file provided by Mariusz Zynel:

    Every time, every dt program gives that error on its
    start. t_optmgmt() is called once in _tt_tli_set_nodelay(), as the
    name says, to set TCP_NODELAY option for ToolTalk connections.
2025-11-15 13:09:49 -07:00
Myrrh Periwinkle 9f0f015c4d libDtWidget: Do not mix wide and narrow operations on the same stream
The current behavior is not standards conformant, and will cause the
format operation to result in empty text as glibc fails any calls to
getwc against a narrow stream with WEOF. Additionally, narrow write
operations against a wide stream appears to bypass the buffer, causing
incorrect formatting results.

Fix this by changing all write operations against the reformatted output
file stream to be wide operations, and reopening the temporary input
file before performing any wide read operations.
2025-06-13 18:16:32 +07:00