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
a7e724b75d
Change how sudo.conf is parsed. We now do a quick parse and then
...
set the values after the entire file has been parsed. This lets
us init the debug system earlier. Plugin-specific debug flags are
now stored in struct plugin_info and struct plugin_container and
passed to the plugin via one or more debug_flags settings.
2014-10-22 13:20:32 -06:00
Todd C. Miller
bd99dcc028
Add sudo_warn_set_conversation() to specify a conversation function
...
to use for warn/fatal. If no conversation function is specified,
the standard error will be used. We now only need sudo_printf()
for things that use the parser.
2014-10-05 16:41:52 -06:00
Todd C. Miller
15dee8745d
Make sudoers file nsswitch functions static to parse.c since they
...
are self-contained.
2014-09-15 15:11:30 -06:00
Todd C. Miller
47835ff289
Rename missing.h -> sudo_compat.h
2014-07-22 14:25:16 -06:00
Todd C. Miller
127ba1354b
Rename gettext.h -> sudo_gettext.h
2014-07-21 14:49:43 -06:00
Todd C. Miller
3687b665cb
Rename fatal.h -> sudo_fatal.h
2014-07-21 14:40:18 -06:00
Todd C. Miller
b45727cefa
Rename queue.h -> sudo_queue.h to avoid collisions with the system
...
version.
2014-07-21 14:37:27 -06:00
Todd C. Miller
2d61d38c23
Add sudo_ prefix to alloc.c functions and rename alloc.h -> sudo_alloc.h
2014-06-27 10:48:31 -06:00
Todd C. Miller
8e088e65c0
Split fileops.c into parseln.c and locking.c
2014-06-27 09:46:24 -06:00
Todd C. Miller
7bafa63c15
Don't pollute the namespace with lbuf struct and functions
2014-06-26 15:51:15 -06:00
Todd C. Miller
5086194c67
Eliminate calls to fatal()/fatalx()/log_fatal() in env.c and just
...
pass back a return value.
2014-04-30 16:57:12 -06:00
Todd C. Miller
e45b388a37
Make get_boottime() return bool.
2014-04-28 08:40:32 -06:00
Todd C. Miller
a78da37487
Make set_perms() and restore_perms() return an error instead of
...
calling exit() on failure.
2014-04-10 16:11:47 -06:00
Todd C. Miller
2a290f812e
Return MODE_ERROR from sudoers_policy_deserialize_info() instead
...
of calling fatalx().
2014-04-07 05:34:56 -06:00
Todd C. Miller
9b7dfa7522
Remove calls to log_fatal() in I/O log functions and just pass an
...
error back to the caller.
2014-04-04 15:30:12 -06:00
Todd C. Miller
2d1484fe84
Make a password/group cache collision a warning rather than fatal.
...
This should not be possible in practice and we can safely return
the new (potentially duplicate) item as it will be freed by the
caller. Make sudo_set_grlist() return an error on failure instead
of calling fatalx().
2014-03-26 16:44:29 -06:00
Todd C. Miller
639ac92e6d
In find_path(), return NOT_FOUND_ERROR instead of calling fatal()
...
if the path is too long. Remove an extraneous check against PATH_MAX
in set_cmnd() since find_path() already contains such a check.
2014-03-26 14:15:15 -06:00
Todd C. Miller
4848b5691d
Remove unused MODE_LISTDEFS define and correct a comment.
2014-03-26 14:03:04 -06:00
Todd C. Miller
3cdb944de4
Fix expansion of %p in the prompt for "sudo -l" when rootpw, runaspw
...
or targetpw is set. Bug #639
2014-03-19 16:55:37 -06:00
Todd C. Miller
12a1b672c0
We must include gettext.h before missing.h as it includes system
...
headers. Also add missing DEFAULT_TEXT_DOMAIN defines in sudoers
audit code that does not include sudoers.h.
2014-02-11 09:40:59 -07:00
Todd C. Miller
7155fc526f
Bring back boot time checking code and zero out time stamp files
...
that predate the boot time. This should help systems w/o /var/run
where the admin has setup rc.d to clear the timestamp directory.
2014-02-03 05:45:27 -07:00
Todd C. Miller
659b1f0e34
Switch to new time stamp file format. Each user now has a single
...
file which may contain multiple records when per-tty time stamps
are in use (the default). The time stamps use a monotonic timer
where available and are once again stored in /var/run/sudo. The
lecture status is now stored separately from the time stamps in a
different directory.
2014-01-30 15:50:40 -07:00
Todd C. Miller
b2c456341a
Move symbol extern defs into sudoers.h
2013-12-16 14:18:42 -07:00
Todd C. Miller
3e2d818ed9
Move prototypes for functions provided by libcommon that don't have
...
their own header files into sudo_util.h.
2013-12-12 18:29:07 -07:00
Todd C. Miller
d83bfb9fe6
Add atomode() function for parsing a file mode.
2013-12-10 16:56:54 -07:00
Todd C. Miller
2508da6f68
Better match debugging.
...
Sprinkle const in match functions.
2013-12-05 14:34:56 -07:00
Todd C. Miller
923edabe6c
Convert sudo to use BSD TAILQ macros instead of home ground tail
...
queue functions. This includes a private queue.h header derived
from FreeBSD. It is simpler to just use our own header rather than
try to deal with macros that may or may not be present in various
queue.h incarnations.
2013-10-22 09:00:37 -06:00
Todd C. Miller
7a76844d98
When merging the PAM environment, allow environment variables set
...
in PAM to override ones set by sudo as long as they do not match
the env_keep or env_check lists.
2013-08-17 06:34:09 -06:00
Todd C. Miller
99352d6738
Rename error.h -> fatal.h now that there is no error() function.
2013-08-15 14:24:29 -06:00
Todd C. Miller
d0e3867587
Add limited support for "sudo -l -h other_host". Since group lookups
...
are done on the local host, rules that use group membership may be
incorrect if the group database is not synchronized between hosts.
2013-08-14 13:49:14 -06:00
Todd C. Miller
8b4fbc5cc0
Refactor code to parse list of gids into its own function that is
...
shared by the sudo front-end and the sudoers module.
Make uid/gid parse error be fatal, not just a warning.
2013-08-08 11:40:36 -06:00
Todd C. Miller
fe23e7c038
Add endpointer and separator args to atoid()
2013-08-08 06:11:52 -06:00
Todd C. Miller
5dc56ea81d
Add atoid() function to convert a string to an id_t (uid, gid or
...
pid). We have to be careful to choose() either strtol() or strtoul()
depending on whether the string appears to be signed or unsigned.
Always using strtoul() is unsafe on 64-bit platforms since the
uid might be represented as a negative number and (unsigned long)-1
on a 64-bit system is 0xffffffffffffffff not 0xffffffff.
Fixes a problem with uids larger than 0x7fffffff on 32-bit platforms.
2013-08-07 11:23:19 -06:00
Todd C. Miller
1f3ea50afd
Implement memset_s() and use it instead of zero_bytes().
...
A new constant, SUDO_CONV_REPL_MAX, is defined by the plugin
API as the max conversation reply length. This constant can be
used as a max value for memset_s() when clearing passwords
filled in by the conversation function.
2013-08-03 08:30:06 -06:00
Todd C. Miller
fa6c857112
Allow ldap_conf and ldap_secret to be specified as plugin arguments
...
in sudo.conf
2013-04-25 14:49:02 -04:00
Todd C. Miller
5337da144b
Replace sudo_fakepwnamid() with sudo_mkpwent() and don't return an
...
error if the entry already exists in the cache.
2013-04-19 14:48:23 -04:00
Todd C. Miller
38dac1e0a4
Stash umask in struct sudo_user so we don't need to look it up later.
2013-03-28 15:40:32 -04:00
Todd C. Miller
6e50087010
Add sudo_set_grlist(), currently unused by the back end.
2013-03-26 13:27:51 -04:00
Todd C. Miller
d6b5ffbbd8
expand_prompt() is now in prompt.c
...
sudo_printf extern is now in error.h
2013-03-25 11:19:56 -04:00
Todd C. Miller
a803b4d2ec
Change multiple inclusion guards to be _SUDOERS_FOO_H
2013-03-25 11:17:46 -04:00
Todd C. Miller
d3ff0f31ee
Dummy out close function if there is no end_session for the auth
...
method and the front-end can handle a NULL close function. Avoids
the extra sudo process when we don't actually need it.
2013-02-24 05:54:57 -05:00
Todd C. Miller
b9159ecb26
Add maxseq sudoers option to limit the max number of I/O log files.
2013-02-18 15:06:23 -05:00
Todd C. Miller
d837700341
Use max_groups in front-end and plugin.
2013-02-14 15:52:27 -05:00
Todd C. Miller
2e08777f25
Store the session ID in the tty ticket file too. A tty may only
...
be in one session at a time so if the session ID doesn't match we
ignore the ticket.
2013-02-08 10:43:14 -05:00
Todd C. Miller
b7ae7977a6
Cannot wrap sigsetjmp() or we end up returning to the wrong place.
...
Use a macro instead.
2012-11-29 06:37:13 -05:00
Todd C. Miller
2632ec7e69
Move warn/error into common and make static builds work.
2012-11-25 09:34:40 -05:00
Todd C. Miller
5496ffe1e8
Add plugin_setjmp() wrapper for siglongjmp(error_jmp, 1) so we don't
...
need error_jmp to be extern. Also add plugin_clearjmp() that clears
a flag so error()/errorx() knows when to call exit() vs. longjmp().
2012-11-25 09:34:26 -05:00
Todd C. Miller
90147bb605
Allow sudoers programs (visudo, sudoreplay, visudo) to use
...
plugin_error.c instead of the error.c from the front-end. This
means sudoers_setlocale() needs to be independent of the sudo_user
struct and the defaults table. The sudoers locale is now updated
via a callback.
2012-11-25 09:33:52 -05:00