Todd C. Miller
bc5e2d06a7
Add free_default() to free a struct defaults pointer so we have a
...
single place where we free the defaults. A pointer to the previous
Default's binding may be passed in to avoid freeing an already free
binding.
2018-03-21 12:11:19 -06:00
Todd C. Miller
e26ef96a65
Add case_insensitive_group and case_insensitive_user sudoers options,
...
which are enabled by default.
2018-03-05 10:42:02 -07:00
Todd C. Miller
bcfb092a4e
Convert from time in minutes to timespec directly instead of
...
converting to double via strtod(). This makes it easier to catch
overflow.
2018-01-26 10:17:47 -07:00
Todd C. Miller
2e37959fec
Better conversion from double to nanoseconds.
2018-01-22 17:27:25 -07:00
Todd C. Miller
4c0c225062
Store passwd_timeout and timestamp_timeout as a struct timespec
...
instead of as a float. Remove timeout argument to auth_getpass()
as it was never used.
2018-01-22 12:18:48 -07:00
Todd C. Miller
b16912da1d
Don't include syslog.h from logging.h, just include it in the two
...
.c files it is actually needed.
2017-12-08 15:00:41 -07:00
Todd C. Miller
48fba3c2cc
update my email to Todd.Miller@sudo.ws
2017-12-03 17:53:40 -07:00
Todd C. Miller
507ab6fdcd
Sprinkle a few more debugging printfs.
2017-09-01 09:22:31 -06:00
Todd C. Miller
63d954d1fc
Replace tty_tickets option with timestamp_type which can be
...
global, ppid or tty. Defaults to tty (no change in behavior).
Some users want the ppid behavior.
2017-08-01 16:14:54 -06:00
Todd C. Miller
2d8717bdd2
Allow the syslog Defaults option to be used in a "true" boolean
...
context and use the compiled in default log facility in this case.
2017-05-03 09:53:03 -06:00
Todd C. Miller
631d458b6f
Allow a tuple to be set to boolean true. Regression introduced by
...
refactor of set_default_entry() in sudo 1.8.18.
2017-05-03 09:28:36 -06:00
Todd C. Miller
3980f1531b
Add support for command timeouts in sudoers. After the timeout,
...
the command will be terminated.
2017-02-14 15:56:34 -07:00
Todd C. Miller
3742f7a46e
Add ignore_unknown_defaults flag to ignore unknown Defaults entries
...
in sudoers instead of producing a warning.
2017-02-06 05:41:57 -07:00
Todd C. Miller
413e1100b8
Add new fdexec sudoers setting to allow choose whether execve() or
...
fexecve() is used.
2017-01-22 18:56:16 -08:00
Todd C. Miller
0d9255b2f7
Fix logic bug when matching syslog priority and facility.
2016-12-20 10:24:55 -07:00
Todd C. Miller
00b6be9dfa
Allow syslog priority to be negated or set to "none" to disable
...
logging successes or failures.
2016-11-30 16:26:10 -07:00
Todd C. Miller
79ca752802
Go back to parsing Defaults entries in update_defaults instead of
...
as sudoers is read. Otherwise, we cannot properly support early
defaults like sudoers_locale.
2016-11-09 16:00:12 -07:00
Todd C. Miller
1d9b8ca32e
Zero out sd_un before calling parse_default() so we don't try
...
to free stack garbage in the ldap/sssd backends.
2016-11-08 12:58:28 -07:00
Todd C. Miller
8133cdfdf6
Use sys/stat.h defines instead of bare octal values.
2016-11-07 13:36:05 -07:00
Todd C. Miller
df8404dbd4
Instead of parsing sudoers Defaults twice, parse once while reading
...
sudoers and then just set the parsed value in update_defaults().
2016-11-06 18:59:49 -07:00
Todd C. Miller
1f24108969
Use "struct defaults *d" instead of "struct defaults *def" throughout
...
for consistency and to avoid confusino with "struct def_values *def".
Use "str" not "var" for the string argument to convert and store in
sd_un for the store_* functions.
2016-11-06 18:55:18 -07:00
Todd C. Miller
4f532dcc50
Avoid passing in a struct sudo_defs_types pointer to the store
...
functions. Pass in a pointer to the union to fill instead.
2016-11-03 11:02:48 -06:00
Todd C. Miller
7c56179c7d
Use "double quotes" in messages instead of a combination of the
...
accent (grave) mark and apostrophe.
2016-11-02 17:10:17 -06:00
Todd C. Miller
75e29f163e
Add file:linenumber prefix to all Defaults warnings so we can see
...
them when running sudo too. For LDAP/SSSD we print the sudoRole
instead of the file name and omit the line number.
2016-11-02 17:07:32 -06:00
Todd C. Miller
8a48085184
Instead of checking Defaults values after the fact, check them at
...
sudoers parse time. This makes it possible to display the file and
line number with the problem and for visudo to go right to the
error.
2016-11-01 14:22:32 -06:00
Todd C. Miller
484b5718d8
s/rval/ret/g -- old habits die hard
2016-11-01 12:34:24 -06:00
Todd C. Miller
271a07ff00
Make the I/O log file/dir permissions and owner configurable.
2016-10-29 12:45:55 -06:00
Todd C. Miller
3423d0af7c
Don't try to syntax check an unrecognized Defaults value in visudo.
2016-10-28 08:24:51 -06:00
Todd C. Miller
e3825cbedd
When checking syslog facility or priority, move the string
...
compare into the body of the loop and return if it matches.
If we finish the loop it means we didn't find a match.
This makes the code a little bit more readable.
2016-10-26 10:46:03 -06:00
Todd C. Miller
fc1b4155d7
Replace bare ";" in the body of for() loops with "continue;" for
...
improved readability.
2016-10-26 10:42:28 -06:00
Todd C. Miller
44c2679f83
Add syslog_maxlen to control the max size of syslog messages.
2016-10-18 15:51:47 -06:00
Todd C. Miller
43084d8f91
Apply match_group_by_gid early.
2016-09-05 06:21:23 -06:00
Todd C. Miller
7918f7e7eb
Use sudo_strsplit() instead of doing the equivalent manually.
2016-08-26 11:07:19 -06:00
Todd C. Miller
a246c9570a
Fix memset size typo in previous commit.
2016-08-25 10:36:53 -06:00
Todd C. Miller
99b9699793
Fix use-after-free in check_defaults(), reported by Radovan Sroka
...
of RedHat.
2016-08-25 08:32:45 -06:00
Todd C. Miller
ed18d0d5f8
Make the behavior when we cannot write to a log or audit file
...
configurable. File log failures are ignored by default for consistency
with syslog. Audit errors are ignored by default to allow the admin
to fix the issue. I/O log file errors are still fatal by default
since if I/O logging is activated it is usually to have an audit trail.
Bug #751
2016-08-17 07:22:51 -06:00
Todd C. Miller
c3b8e97a6e
Remove the "op" parameter from all the store_foo() functions except
...
store_list() where it is actually needed. For the others, a NULL
value indicates the setting was negated. This unconfuses static
analyzers (and perhaps humans too).
2016-08-12 16:41:51 -06:00
Todd C. Miller
8c2b6fb34e
Flags always have a NULL value. Regression introduced by refactor
...
of set_default_entry().
2016-08-12 15:03:54 -06:00
Todd C. Miller
1ca261c305
Set rc to true when setting a flag Defaults value.
2016-08-12 11:32:36 -06:00
Todd C. Miller
caf064e17b
Refactor the error parts of set_default_entry() so the switch() is
...
mostly just calls to store_foo() functions. Avoids a lot of
duplicated error checking and silences a cppcheck false positive.
2016-08-12 10:37:41 -06:00
Todd C. Miller
9051c92cb3
In set_default_entry() check for unsupported Defaults type.
2016-08-12 09:37:11 -06:00
Todd C. Miller
7ac77b094c
Check sudoers_initlocale return value and treat as oom.
...
Coverity CID 141832
2016-08-12 06:00:17 -06:00
Todd C. Miller
56ead73886
Load sudoers group plugin via an early callback.
2016-08-09 13:14:31 -06:00
Todd C. Miller
0bf2d9b162
Instead of deferring setting early defaults until we have traversed
...
the entire defaults list, just defer running the callbacks. Otherwise,
if the last early default setting we see has a bad value we won't
set any defaults of that type even if there was an earlier one that
was valid.
2016-08-08 17:04:20 -06:00
Todd C. Miller
e5a7891ec8
Run callbacks once in set_default_entry() instead of each of the
...
store_foo() functions.
2016-08-08 16:47:11 -06:00
Todd C. Miller
2b150925dc
Flag settings have a NULL value so we can't use that to test whether
...
an entry in struct early_default is set or not. Add a "set" member
and use that instead.
2016-07-28 06:05:39 -06:00
Todd C. Miller
a014a2abd4
Fix --with-fqdn, the value should be NULL since it is a flag.
2016-07-27 15:03:48 -06:00
Todd C. Miller
16551031f9
Add support for early defaults to the ldap and sssd backends.
2016-07-27 14:20:17 -06:00
Todd C. Miller
2c21663b22
Split set_default_entry() out of set_default() so we can call it
...
from check_defaults() to validate the defaults value. In visudo,
suppress warnings from update_defaults() and rely on check_defaults()
to provide warnings.
2016-07-23 09:10:48 -06:00
Todd C. Miller
29d842dbaf
Split binding match code out of default_type_matches() into
...
default_binding_matches(). We can now use default_type_matches()
in check_defaults().
2016-07-23 08:45:43 -06:00