Commit Graph

93 Commits

Author SHA1 Message Date
Peter Howkins 91bb9a037a libtt: resolve coverity issues related to double close() 2018-04-12 00:04:13 +01:00
Peter Howkins 30ad8e35e5 libtt: Resolve coverity warnings 2018-04-11 19:31:03 +01:00
Jon Trulson 78110e7921 libtt/isrepair.c: coverity CID 86705; uninit ptr read 2018-04-01 14:25:34 -06:00
Jon Trulson 9412da725b libtt/tt_file_system.C: coverity CID 86024; array vs singlton 2018-03-31 19:05:35 -06:00
Jon Trulson 4543bc6192 libtt/process.c: coverity CID 87051; use after free 2018-03-31 18:08:02 -06:00
Jon Trulson 6cd0391409 libtt/db_server_svc.C: coverity CID 87060; string overflow 2018-03-31 18:02:11 -06:00
Peter Howkins 50a96959f0 libtt: Resolve some compiler warnings 2018-03-28 21:34:08 +01:00
alx 5669c8a60f libtt: pass proper flags to getfsstat, log error message and exit if it fails 2017-07-29 12:42:49 -06:00
alx ae7dd95cc4 ttsession: don't segfault if host name isn't properly set 2016-12-31 15:14:59 -07:00
Jon Trulson a173dd3b3b release: update version to 2.2.4, update HISTORY 2016-06-19 12:46:29 -06:00
Jon Trulson 10742f3679 ttcp: fix missing arg to fprintf 2015-12-18 09:55:20 -07:00
Jon Trulson 14b9e2efa3 cde: change revision to 2.2.3 2015-05-09 16:58:46 -06:00
Matthew Howkins 2863b839e5 libtt: Change to standard function prototypes in ttauth. Fix some compiler warnings by adding #includes 2014-12-30 17:31:46 +00:00
Matthew Howkins be49dc56bc libtt: Fix some uninitialized variables detected by Coverity 2014-12-30 17:31:38 +00:00
Jon Trulson 4c6e66ceb8 tt/mini_isam: Coverity (memory corruption, moderate) 2014-12-26 16:15:53 -07:00
Jon Trulson 6f45dde569 tt/mini_isam: Coverity (memory corruption, moderate) 2014-12-26 16:15:25 -07:00
Jon Trulson ce7bdf9f62 ttsession: Coverity (memory corruption, moderate) 2014-12-26 16:14:35 -07:00
Jon Trulson e45843bc95 ttauth: Coverity (memory corruption, moderate) 2014-12-26 16:13:07 -07:00
Jon Trulson f719d20b6c ttauth: Coverity (memory corruption) 2014-12-26 14:12:10 -07:00
Matthew Howkins caf4929c41 libtt: Fix 'Missing return statement' errors detected by static analysis 2014-12-23 22:04:59 +00:00
Ulrich Wilkens 01d6c363fa OpenIndiana and Solaris port 2014-10-28 13:40:11 -06:00
Ulrich Wilkens 42e891d9e7 Resolve many build warnings
This patch fixes many warnings from the beginning of the build up to
and including the depend stage. Nearly all warnings should be gone
even with -Wall.
2014-09-23 17:57:50 -06:00
Ulrich Wilkens c3f74eec17 FreeBSD 10 clang port 2014-07-27 12:32:35 -06:00
Jon Trulson 8d0551bfda Version change to 2.2.2 2014-07-23 16:16:57 -06:00
Jon Trulson 4312a1190b cleanup: eliminate missing sentinel warnings 2014-03-24 18:26:10 -06:00
Jon Trulson ddb4933039 tt_xdr_utils.h: fix build error on linux/bsd introduced with illumos initial patch.
The linux's and BSD's need the 'struct XDR::xdr_ops ops' declaration,
whereas I guess sun does not.
2014-03-22 16:54:24 -06:00
Peter Tribble 468d576030 initial illumos port 2014-03-22 16:33:11 -06:00
Jon Trulson 9f0fbc3015 mp_rpc_server.C: limit iteration of svc_fdset to FD_SETSIZE, as per spec.
In init() there was code iterating over all of the possible file
descriptors in a svc_fdset.  fdsets are limited to FD_SETSIZE.  This
caused coredumps on FreeBSD 10, and possibly other hidden issues.

Moving to poll(), rather than select() would be better, but is a bigger
job.  For now, just limit to the FD_SETSIZE that select() requires.
2014-03-10 14:49:37 -06:00
Jon Trulson 8f648927eb Version change to 2.2.1 2014-03-01 15:48:49 -07:00
Jon Trulson a198d898e8 TT RPC server: Don't search 538 million transients trying to allocate one.
Currently, mp_rpc_server.C tries 538 million ports to acquire an
available transient rpcbind port number.  This is bad when rpcbind is
running in secure mode (and you are not using tirpc) - Xsession will
'hang' at the dthello (blue) screen filling up your error logs with
RPC errors.

Now, just try +- 50 (for a total of 100 ports) before bailing.  The
dthello 'blue screen of death' is the most common problem in starting
CDE when rpcbind isn't set up properly.  This should at least not
cause the appearance of a 'hang'.
2013-05-17 16:16:17 -06:00
Jon Trulson f84950100f Revert "Older Linux installations do not have svcfd_create()."
This reverts commit 44e384aedb.

This code is actually needed.  If svcfd_create() is not available, it
should be fixed only for those systems that it affects.
2012-11-24 19:16:58 -07:00
Jelle Hermsen b8862cab32 Changed a couple of ifdefs for __FreeBSD__ to CSRG_BASED. These are all clearcut cases. I left the ones I had doubts about, or where I wasn't sure about the OpenBSD side of things to look at later. 2012-10-03 17:06:57 -06:00
Jelle Hermsen 399915f0ce Teach ToolTalk config about NetBSD and adds HAS_STATVFS identifier which is consequently used in tt_file_system.C, because NetBSD switched to the POSIX/XOpen statvfs() calls in 2004. 2012-09-28 19:11:09 -06:00
James Woodcock 44e384aedb Older Linux installations do not have svcfd_create().
svcfd_create() is only called if OPT_UNIX_SOCKET_RPC is defined, so a #ifdef
round that code should be OK.
2012-09-27 18:01:19 -06:00
James Woodcock 406fa95994 Use RPC_ANYSOCK instead of the magic number -1. 2012-09-27 18:01:14 -06:00
Marcin Cieslak ee82570104 Use typedef XDR from <rpc/xdr.h>
__rpc_xdr is no longer available on FreeBSD 10.
(XDR is typedef'd as "struct XDR" and not "struct __rpc_xdr").

By the way, why did we ever need this? Probably
it should be removed. Leaving for __OpenBSD__ for now.
2012-09-27 17:54:12 -06:00
Peter Howkins 8479d150e2 libtt: Resolve all remaining format-security warnings. 2012-08-26 22:19:27 +01:00
Peter Howkins 8c8a5380ca libtt: Warning prevention
One missing stdlib include and one security warning about not
using varargs func correctly.
2012-08-26 19:48:55 +01:00
Peter Howkins 8a78cc767e libtt: resolve implicit delaration of free() and exit() warnings 2012-08-22 12:39:25 +01:00
Frederic Koehler 66e428596b mp_session: Always use global displayname
This code tried to automatically generate the X DISPLAY
from the combination of the hostname and display number;
however 127.0.0.1:0 is normally rejected by X11, so this
technique is no good. Fixes dticon hang on startup, caused by
XOpenDisplay failure leading to this message from tttrace:
tt_default_session_set(0x0x875190=="X 127.0.0.1 0") = 1032 (TT_ERR_ACCESS)
2012-08-14 20:37:59 -06:00
Marcin Cieslak e8ff159737 const char maze: unbreak ToolTalk build
Follow up to de82eebdd5
2012-08-14 20:37:23 -06:00
Chris Wareham de82eebdd5 Have to pass a const char * to function expecting char * here, otherwise it fails to link thanks to the declaration of a stub wth non-const param. 2012-08-14 12:44:20 -06:00
Chris Wareham e738704385 Fix most of the following classes of warnings in the ToolTalk libraries:
- Const strings referenced by non-const variables.
- Incorrect format specifers for printing addresses
- Unused variables
- Signed comparison to unsigned

Also fix an incorrect enumeration value in a switch statement.
2012-08-14 12:43:44 -06:00
Marcin Cieslak bf8c5e674f Compile ToolTalk on FreeBSD
Fix const correctness problems with OPT_CONST_CORRECT:

tt_xdr_utils.C: In constructor '_Tt_xdr_size_stream::_Tt_xdr_size_stream()':
tt_xdr_utils.C:150: error: invalid conversion from 'bool_t (*)(__rpc_xdr*, long int*)' to 'bool_t (*)(__rpc_xdr*, const long int*)'
tt_xdr_utils.C:151: error: invalid conversion from 'bool_t (*)(__rpc_xdr*, char*, unsigned int)' to 'bool_t (*)(__rpc_xdr*, const char*, u_int)'
tt_xdr_utils.C:159: error: invalid conversion from 'bool_t (*)(__rpc_xdr*, char*, unsigned int)' to 'bool_t (*)(__rpc_xdr*, const char*, u_int)'

tt_entry_pt.C: In function '_Tt_string _tt_entrypt_to_string(_Tt_entry_pt)':
tt_entry_pt.C:455: error: conversion from 'long int' to '_Tt_string' is ambiguous
../../lib/util/tt_string.h:104: note: candidates are: _Tt_string::_Tt_string(int)
../../lib/util/tt_string.h:102: note:                 _Tt_string::_Tt_string(const char*)
2012-08-12 20:57:49 -06:00
Pascal Stumpf 0bbd4ff9aa Get rid of malloc.h.
This is a non-POSIX/ISO-C header.  It is ok to include this on Linux, but it
is obsolete on BSD; FreeBSD even throws an error if you include it with
__STDC__ defined.  Every system should nowadays have malloc() defined in
stdlib.h.

Diff is largely mechanical, replacing malloc.h with stdlib.h where it is not
yet included anyway.
2012-08-12 14:20:58 -06:00
Frederic Koehler b33cf9fb60 tooltalk: Fix bad assumptions about sizeof(uid_t)
In part of the tooltalk rpc code (mp_message.c), it was assumed that on
the majority of platforms, sizeof(uid_t)=sizeof(gid_t)=sizeof(long).  On
Linux-x64, uid_t is an unsigned int, which makes the code fail: all
tooltalk messages fail to send with an RPC_CANTENCODEARGS at the
rpc-level, and TT_INTERNAL_ERR for the actual program.  We instead
change the code to explicitly examine sizeof(uid_t) to see whether it is
int or long sized. This allows tooltalk-dependent functinoality
like logout and multiple calls to dtfile to work.
2012-08-12 13:50:34 -06:00
Frederic Koehler 19c7c80aa3 tt (tooltalk): Kill some warnings
Includes some potentially bad pointer/int conversions
2012-08-11 20:13:46 -06:00
Frederic Koehler 5ad7a83985 tttrace: Fix bad usage of va_arg with enums
Enums may be represented with a smaller type than int; however, they are
automatically promoted to int when passed in va_arg lists, just as
short, char, etc. are. GCC thus "knows" that you never want to call
va_arg with an enum type, and instead inserts an abort.
2012-08-11 20:13:46 -06:00
Pascal Stumpf 3b77d7c065 Tooltalk fixes for OpenBSD. This consists mainly of #ifdefs, casts and some small type nits. 2012-08-10 06:24:29 -06:00
James Woodcock d1848610a7 Remove ambiguity in string compare. 2012-08-09 13:55:54 -06:00