Todd C. Miller
a09e45d339
In fill_args(), check for "arg_size == 0" instead of
...
"sudoerslval.command.args == NULL" since the latter leads Coverity
to imply that sudoerslval.command.args could be NULL later on.
Coverity CID 104093.
2016-05-05 15:12:37 -06:00
Todd C. Miller
5725acd1c4
In fill_args(), replace loop that increments arg_size() with
...
a simple add and mask. Should prevent a false positive from
Coverity CID 104094.
2016-05-04 16:59:04 -06:00
Todd C. Miller
2224cfd000
If realloc of sudoerslval.command.args fails, reset sudoerslval.command.args
...
as well as arg_len and arg_size after freeing sudoerslval.command.args.
2016-01-29 11:10:36 -07:00
Todd C. Miller
604d350344
Use size_t for length parameters in the fill functions used by the
...
lexer.
2015-11-22 09:22:38 -07:00
Todd C. Miller
108bfb7af3
Add missing warnings for memory allocation failure.
...
Add function name to memory allocation warnings.
2015-07-14 14:50:36 -06:00
Todd C. Miller
0b241088b3
There's no need to conditionalize the #include <unistd.h>, we require
...
a POSIX system.
2015-07-02 09:08:28 -06:00
Todd C. Miller
d7224ea502
It's safe to rely on C89 semantics for realloc(NULL, size).
2015-06-20 19:27:31 -06:00
Todd C. Miller
4a07b472f0
Only include stddef.h where it is needed.
2015-06-20 05:34:35 -06:00
Todd C. Miller
dc883f2454
We require ANSI C so stop using the obsolete STDC_HEADERS.
2015-06-19 14:29:27 -06:00
Todd C. Miller
a50555faa2
Remove support for the obsolete malloc.h header.
2015-06-18 20:30:59 -06:00
Todd C. Miller
4da9e10971
Use non-exiting allocators in the parser (much of it already did).
2015-05-27 10:36:03 -06:00
Todd C. Miller
cbcaaa299a
No need to cast malloc() return value.
2015-05-14 10:47:09 -06:00
Todd C. Miller
59ab26dbcc
Go back to a 2 args debug_decl and just use the "default" instance,
...
now renamed "active".
2015-02-01 08:24:49 -07:00
Todd C. Miller
e9914a91b1
The sudoers plugin now defines its own list of debugging subsystem names
...
and defines.
2014-10-22 13:30:52 -06:00
Todd C. Miller
866cfc4fc3
Add support for multiple Debug lines per program. Callers may
...
register arbitrary debug facilities or use built-in defaults. We
now use separate Debug statements for plugins and programs.
2014-10-22 13:23:05 -06:00
Todd C. Miller
36a5767e3e
efree -> sudo_efree for consistency
2014-07-10 15:35:04 -06:00
Todd C. Miller
aecef4aa1d
Rename warning/fatal -> sudo_warn/sudo_fatal to avoid namespace
...
pollution in libsudo_util.so.
2014-06-27 09:30:52 -06:00
Todd C. Miller
a1240a5417
Use common printf format when warning of buffer overflow prevention.
2014-03-31 15:58:24 -06:00
Todd C. Miller
9ff3b1b570
Make hexchar() return -1 on invalid input instead of calling fatalx().
...
Callers used to check that the string was hex before calling hexchar().
Now callers must check for a -1 return value instead.
2014-03-26 13:50:51 -06:00
Todd C. Miller
96eb2c4f8f
Add warning_gettext() wrapper function that changes to the user locale,
...
then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().
2013-11-18 08:59:57 -07:00
Todd C. Miller
07a804caf3
Quiet sign comparision warnings.
2013-10-23 15:03:31 -06:00
Todd C. Miller
d6282d154a
Update copyright years.
2013-04-24 09:35:02 -04:00
Todd C. Miller
35375a2b7e
Initial implementation of checksum support in sudoers.
...
Currently supports SHA-224, SHA-256, SHA-384, SHA-512.
TODO: checksum format validation in parser and base64 support.
checksum support for ldap sudoers
2013-04-14 07:00:21 -04:00
Todd C. Miller
1d7072fe09
Don't include <sys/param.h>. We only needed it for MAXPATHLEN,
...
MAXHOSTNAMELEN and the MIN/MAX macros. We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
2012-12-04 10:40:47 -05:00
Todd C. Miller
7b3d268687
Call gettext() on parameters for warning()/warningx() instead of
...
having warning() do it for us.
2012-11-25 09:34:04 -05:00
Todd C. Miller
15c69e0e3f
Call gettext() in sudoerserror() in the user's locale and pass the untranslated string to it.
2012-11-25 09:33:58 -05:00
Todd C. Miller
1d90c0ad71
No need to translate "unable to allocate memory" when we can just
...
use the system translation via strerror().
2012-09-17 16:59:26 -04:00
Todd C. Miller
5276ab3a5f
Set yacc prefix to "sudoers" to avoid conflicts other yacc parsers.
2012-09-14 16:19:25 -04:00
Todd C. Miller
21a2f95821
Use stdbool.h instead of rolling our own TRUE/FALSE macros.
2011-12-02 11:27:33 -05:00
Todd C. Miller
09beba8259
Revert 003bdb078a15. We need to #include <gram.h> not "gram.h" and
...
<def_data.h> and not "def_data.h" when generating the parser in a
build dir.
2011-11-12 12:18:44 -05:00
Todd C. Miller
0bf68d2103
#include "gram.h" not <gram.h> and "def_data.h" and not <def_data.h>.
2011-11-08 14:09:48 -05:00
Todd C. Miller
839919566e
Add debug_decl/debug_return (almost) everywhere.
...
Remove old sudo_debug() and convert users to sudo_debug_printf().
2011-10-22 14:40:21 -04:00
Todd C. Miller
b643b190a7
Prepare sudoers module messages for translation.
2011-05-16 16:32:05 -04:00
Todd C. Miller
4294650039
#include "foo.h", not <foo.h> for local includes.
2011-02-07 10:51:43 -05:00
Todd C. Miller
ae2f7638f5
standardize on "return foo;" rather than "return(foo);" or "return (foo);"
2011-01-24 15:15:18 -05:00
Todd C. Miller
f7f8b6867e
Update copyright year to 2011
2011-01-20 16:46:56 -05:00
Todd C. Miller
e63849afb0
constify
2011-01-08 19:54:30 -05:00
Todd C. Miller
400b6ffe20
Split tokenizer utility functions out into toke_util.c
2011-01-08 15:42:39 -05:00