Commit Graph

1684 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
Patrick Georgi 7ab683d29a handle missing return values 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 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 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 c0ad5170c9 Avoid "bool" variable name
C23 has a type of that name.
2025-12-18 22:58:26 +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 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
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
Dark Ayron f0be964d6c dtwm: add support for more mouse buttons
Some mice have more than 3 buttons. Although Xlib.h doesn't provide
definitions for these buttons, button 6 to 9 is reported through the
XButtonEvent struct.
This adds support for mapping actions to mouse button 6 to 9.
2025-03-19 09:47:12 -06:00
hyousatsu 38a1b9fcca dtwm: manage windows properly to avoid potential
segmentation faults.
2025-03-01 02:43:25 -05:00
Nilton Perim Neto e4c1e173fa
Made a workaround to not use the sh_access
The sh_access was defined to two arguments
Made a workaround to not use the sh_access
that was outputting the error.
Not ideal, but it will hopefully compile on Arch Linux

Also added mksh for compatibility
Ksh is unmaintained in the Arch User Repository

Signed-off-by: Nilton Perim Neto <niltonperimneto@gmail.com>
2025-02-03 14:47:17 -03:00
hyousatsu fbc9488037 dtcreate: make pop-ups work properly. 2024-09-09 06:39:02 +00:00
hyousatsu f0123efa84 Fix some warnings. 2024-07-21 00:43:27 +00:00
hyousatsu ba49a9e161 dtdocbook: link to lmdb. 2024-07-16 09:05:45 +00:00
hyousatsu c7ade43d86 DtMmdb: replace Berkeley DB with LMDB. 2024-07-16 09:05:38 +00:00
Jon Trulson 3fa42c44a8 dtcm: Chase FreeBSD src bb421be6c117 which moved ftime(3)
Patch from Cy Schubert:

FreeBSD bb421be6c117 moved ftime(3) from libcompat to libutil. This
results in the following error,

ld: error: undefined symbol: ftime
>>> referenced by getdate.c
>>>               libDtCmP_a-getdate.o:(cm_getdate) in archive
../libDtCmP/libDtCmP.a
>>> did you mean: ctime

Signed off by:	Cy Schubert <cy@FreeBSD.org>
2024-06-02 17:51:26 -06:00
hyousatsu 76812a9115 ksh93: fix a compilation error on 32-bit system. 2023-12-01 09:22:32 +00:00
hyousatsu 615d9a3907 dtsession: fix a crash. 2023-08-16 23:18:47 -04:00
hyousatsu 549b759c66 dtstyle: make the style manager recognize wheel mouse correctly. 2023-06-11 07:33:37 +00:00
hyousatsu b979a073df dtwm: fix a segfault. 2023-03-28 02:16:17 +00:00
hyousatsu 760d36bfe9 dtlogin: use sessreg to manage utmp/wtmp. 2023-03-27 08:48:27 +00:00
hyousatsu 28277ce88e dtsession: change the maximum size of cover dialog to fullscreen. 2023-02-26 11:59:29 +00:00
hyousatsu 2351a19d7e dtwm: support _NET_WM_STATE_ABOVE and _NET_WM_STATE_BELOW. 2023-02-26 11:59:29 +00:00
hyousatsu e22fd8d84f dtwm: optimize EWMH processing. 2023-02-26 11:59:21 +00:00