]>
granicus.if.org Git - sudo/log
Todd C. Miller [Fri, 2 Mar 2018 17:58:50 +0000 (10:58 -0700)]
Avoid changing the order of non-negated hosts and commands.
We still put negated hosts/commands at the end of the list.
Todd C. Miller [Fri, 2 Mar 2018 17:44:33 +0000 (10:44 -0700)]
Handle parsing boolean options that have no explicit value.
Todd C. Miller [Fri, 2 Mar 2018 16:27:27 +0000 (09:27 -0700)]
Refactor the code that actually converts the role to sudoers format
into role_to_sudoers() now that it is more involved than just calling
sudo_ldap_role_to_priv().
Todd C. Miller [Fri, 2 Mar 2018 13:42:29 +0000 (06:42 -0700)]
When merging two privileges, use the runas lists of the previous
privilege when possible. Otherwise, the generated sudoers line
will include a runas list for commands that is not necessary.
Todd C. Miller [Fri, 2 Mar 2018 03:31:01 +0000 (20:31 -0700)]
Use a case-insensitive comparison when matching user and group names
in sudoers with the passwd or group database. This can be necessary
when users and groups are stored in AD or LDAP.
Todd C. Miller [Thu, 1 Mar 2018 17:35:32 +0000 (10:35 -0700)]
Fix clean target for *.sudo regress files
Todd C. Miller [Thu, 1 Mar 2018 17:33:47 +0000 (10:33 -0700)]
ignore more binaries
Todd C. Miller [Thu, 1 Mar 2018 17:18:48 +0000 (10:18 -0700)]
Fix use of uninitialized variable (conf) if sudoers_debug_register()
happens to fail.
Todd C. Miller [Wed, 28 Feb 2018 23:21:09 +0000 (16:21 -0700)]
Split conversion code out of parse_ldif() and into ldif_to_sudoers().
Todd C. Miller [Wed, 28 Feb 2018 21:44:54 +0000 (14:44 -0700)]
Quiet a clang analyzer warning.
Todd C. Miller [Wed, 28 Feb 2018 21:24:33 +0000 (14:24 -0700)]
rename ldap_common.c -> ldap_util.c
Todd C. Miller [Wed, 28 Feb 2018 21:02:50 +0000 (14:02 -0700)]
When converting from ldif to sudoers, sudoRole objects with the
same user if possible. If both user and host are the same, merge
into a single privilege. This makes it possible to convert a
sudoers entry like:
aaron shanty = NOEXEC: /usr/bin/vi, /usr/bin/more, EXEC: /bin/sh
to ldif and then back to sudoers as a single line. Currently, the
ldif entries to be merged must have the same or adjacent sudoOrder
attributes.
Todd C. Miller [Wed, 28 Feb 2018 21:02:11 +0000 (14:02 -0700)]
plug memory leaks
Todd C. Miller [Wed, 28 Feb 2018 14:05:36 +0000 (07:05 -0700)]
Restore line to set MODE_PRESERVE_ENV in flags when the -E command
line option is used. The caller doesn't check MODE_PRESERVE_ENV
these days but parse_args uses it to detect usage errors when -E
is used along with a mutually excusive option. Problem found by
Yuriy Vostrikov.
Todd C. Miller [Tue, 27 Feb 2018 00:59:58 +0000 (17:59 -0700)]
Add missing close parenthesis in "Including other files from within
sudoers" section. Bug #824
Todd C. Miller [Sun, 25 Feb 2018 13:30:32 +0000 (06:30 -0700)]
When converting from LDAP to sudoers, put negated hosts and commands
at the end of the list. Since LDAP doesn't guarantee attribute order
we need to make sure negated entries always override non-negated ones.
Todd C. Miller [Sun, 25 Feb 2018 01:46:00 +0000 (18:46 -0700)]
We may need the hostname to resolve %h escapes in include files.
Todd C. Miller [Sat, 24 Feb 2018 21:35:38 +0000 (14:35 -0700)]
Setting a sudoOrder start point of 0 will disable creation of
sudoOrder attributes in the resulting LDIF output.
Todd C. Miller [Sat, 24 Feb 2018 16:28:01 +0000 (09:28 -0700)]
Don't need to fill in struct sudo_user since we don't do matching.
Todd C. Miller [Sat, 24 Feb 2018 16:23:14 +0000 (09:23 -0700)]
Add support for setting default options in a config file. In
addition to expand_aliases, input_format and output_format, both
the initial sudoOrder and the increment when updating sudoOrder for
subsequent sudoRole objects can be specified. Command line options
have also been added for the start order and increment.
Todd C. Miller [Thu, 22 Feb 2018 20:17:55 +0000 (13:17 -0700)]
cvtsudoers can now read LDIF
Todd C. Miller [Thu, 22 Feb 2018 20:17:37 +0000 (13:17 -0700)]
Fix a typo.
Todd C. Miller [Thu, 22 Feb 2018 17:43:47 +0000 (10:43 -0700)]
Deal with user_name not being set in cvtsudoers.
Todd C. Miller [Thu, 22 Feb 2018 16:53:12 +0000 (09:53 -0700)]
Initial support for parsing sudoers LDIF files in cvtsudoers.
This makes it possible to convert from LDAP sudoers to a traditional
sudoers file. Semantic differences between file sudoers and LDAP
sudoers mean that LDIF -> sudoers is not completely equivalent.
Todd C. Miller [Thu, 22 Feb 2018 04:24:53 +0000 (21:24 -0700)]
Fix LDIF conversion of commands with an associated digest.
Todd C. Miller [Thu, 22 Feb 2018 04:09:57 +0000 (21:09 -0700)]
In array_to_member_list() use the correct type for netgroups and
user groups.
Todd C. Miller [Thu, 22 Feb 2018 04:08:37 +0000 (21:08 -0700)]
Prepend digest to command if present.
Fix printing of group IDs and non-unix groups.
Todd C. Miller [Thu, 22 Feb 2018 04:02:36 +0000 (21:02 -0700)]
Fix gcc false positive for uninitialized variable
Todd C. Miller [Wed, 21 Feb 2018 04:08:31 +0000 (21:08 -0700)]
Update Polypkg to the latest version from git.
Todd C. Miller [Tue, 20 Feb 2018 20:22:59 +0000 (13:22 -0700)]
Use setpassent() and setgroupent() on systems that support it to
keep the passwd and group database open. Sudo does a lot of passwd
and group lookups so it can be beneficial to just leave the file
open.
Todd C. Miller [Mon, 19 Feb 2018 22:32:56 +0000 (15:32 -0700)]
Add option to cvtsudoers to expand aliases in the output.
Todd C. Miller [Mon, 19 Feb 2018 20:39:11 +0000 (13:39 -0700)]
Fix conversion of "ALL" in the JSON output format, which was being
printed as an alias.
Todd C. Miller [Mon, 19 Feb 2018 18:27:30 +0000 (11:27 -0700)]
Clarify that --with-rundir and --with-vardir take sudo-specific directory,
e.g. /var/run/sudo and not just /var/run. Bug #823
Todd C. Miller [Mon, 19 Feb 2018 18:00:12 +0000 (11:00 -0700)]
In pty_cleanup() we need to call sudo_term_restore() even if no I/O
plugins are present as long as /dev/tty exists. Fixes the use_pty
case with no I/O plugins.
Todd C. Miller [Mon, 19 Feb 2018 18:00:10 +0000 (11:00 -0700)]
Add sudo_ev_dispatch(), a wrapper for ev_loop() with no flags.
Similar the dispatch function in libevent.
Todd C. Miller [Mon, 19 Feb 2018 17:59:12 +0000 (10:59 -0700)]
Use /run in preference to /var/run if it exists.
Bug #822
Todd C. Miller [Wed, 14 Feb 2018 18:30:49 +0000 (11:30 -0700)]
mention common sudoers formatting changes
Todd C. Miller [Sun, 11 Feb 2018 14:36:08 +0000 (07:36 -0700)]
Move LDAP configuration bits into ldap_conf.c
Todd C. Miller [Sat, 10 Feb 2018 20:37:59 +0000 (13:37 -0700)]
No longer need to include stddef.h
Todd C. Miller [Sat, 10 Feb 2018 16:44:34 +0000 (09:44 -0700)]
Remove dead store, found by cppcheck.
Todd C. Miller [Sat, 10 Feb 2018 11:29:43 +0000 (04:29 -0700)]
simplify iterator
Todd C. Miller [Sat, 10 Feb 2018 11:08:42 +0000 (04:08 -0700)]
Silence a false positive from cppcheck.
Todd C. Miller [Sat, 10 Feb 2018 11:00:17 +0000 (04:00 -0700)]
Cast version to int when printing. Avoids a cppcheck warning.
Todd C. Miller [Sat, 10 Feb 2018 05:06:56 +0000 (22:06 -0700)]
Use an iterator instead of fragile pointer arithmetic to iterate
over value arrays in sudo_ldap_role_to_priv().
Todd C. Miller [Sat, 10 Feb 2018 01:22:04 +0000 (18:22 -0700)]
Move sudoers formatting code into fmtsudoers.
Todd C. Miller [Sat, 10 Feb 2018 01:22:03 +0000 (18:22 -0700)]
Clean up some XXX in parse.c
Todd C. Miller [Sat, 10 Feb 2018 01:22:02 +0000 (18:22 -0700)]
Rename sudo_file_append_default() -> sudo_lbuf_append_default() and
use it for ldap and sssd too.
Todd C. Miller [Sat, 10 Feb 2018 01:21:40 +0000 (18:21 -0700)]
Move common bits of ldap to sudoers conversion into ldap_common.c
and use it in sssd.c.
Todd C. Miller [Sat, 10 Feb 2018 01:21:01 +0000 (18:21 -0700)]
Convert ldap results into a sudoers userspec so we can use the "sudo
-l" output functions in parse.c.
Todd C. Miller [Thu, 8 Feb 2018 16:14:12 +0000 (09:14 -0700)]
Don't mark sudoers.dist volatile, it only gets used on systems that
don't have the concept of volatile files.
Todd C. Miller [Mon, 5 Feb 2018 20:33:29 +0000 (13:33 -0700)]
Refactor member freeing code into free_member().
Refactor userspec freeing code into free_userspec().
Todd C. Miller [Mon, 5 Feb 2018 13:23:33 +0000 (06:23 -0700)]
Fix compilation with glibc where stdout is not constant.
Todd C. Miller [Sun, 4 Feb 2018 19:53:32 +0000 (12:53 -0700)]
For "sudo -l", if a word includes spaces, print it in double quotes.
Also escape spaces in the command path. This matches the sudoers
quoting rules.
Todd C. Miller [Sat, 3 Feb 2018 21:56:00 +0000 (14:56 -0700)]
Display sudoNotBefore and sudoNotAfter in "sudo -l"
Todd C. Miller [Sat, 3 Feb 2018 13:59:37 +0000 (06:59 -0700)]
For "sudo -l", if a word includes spaces, print it in double quotes.
Also escape spaces in the command path. This matches the sudoers
quoting rules.
Todd C. Miller [Sat, 3 Feb 2018 13:57:12 +0000 (06:57 -0700)]
Add back printing of negation operator ('!') when printing a word
with spaces in it.
Todd C. Miller [Sat, 3 Feb 2018 13:46:56 +0000 (06:46 -0700)]
Use visudo to validate "cvtsudoers -f sudoers" output.
Todd C. Miller [Sat, 3 Feb 2018 13:45:39 +0000 (06:45 -0700)]
Remove syslog_goodpri and syslog_badpri without a value that causes
visudo to report an error.
Todd C. Miller [Sat, 3 Feb 2018 13:18:47 +0000 (06:18 -0700)]
When outputting sudoers, if a word includes spaces, print it in
double quotes. Also escape spaces in the command path.
Todd C. Miller [Fri, 2 Feb 2018 21:29:19 +0000 (14:29 -0700)]
Add sudoers output format to cvtsudoers. In the future this may
be used with filters to emit a partial sudoers file instead of a
full one.
Todd C. Miller [Fri, 2 Feb 2018 21:29:17 +0000 (14:29 -0700)]
When printing a member name, quote sudoers special characters unless
it is a UID/GID, in which case we print the '#' unquoted.
Todd C. Miller [Fri, 2 Feb 2018 13:28:04 +0000 (06:28 -0700)]
Move SUDOERS_QUOTED define to parse.h
Todd C. Miller [Tue, 30 Jan 2018 18:12:38 +0000 (11:12 -0700)]
Remove extraneous break statement and fix some whitespace.
Todd C. Miller [Tue, 30 Jan 2018 18:11:48 +0000 (11:11 -0700)]
The max timeout for kernel time stamps is 60 minutes, not 3600 minutes.
Todd C. Miller [Mon, 29 Jan 2018 21:02:21 +0000 (14:02 -0700)]
Check the return value of sudoers_debug_register().
Coverity CID 182574
Todd C. Miller [Mon, 29 Jan 2018 20:58:25 +0000 (13:58 -0700)]
Fix memory leak, su->count is now 0 when it is unused, not 1.
Covertity CID 182573
Todd C. Miller [Mon, 29 Jan 2018 18:50:56 +0000 (11:50 -0700)]
Quiet a clang analyzer false positive.
Todd C. Miller [Mon, 29 Jan 2018 18:00:43 +0000 (11:00 -0700)]
Quote special characters when creating the cn as per RFC2253
Todd C. Miller [Mon, 29 Jan 2018 16:40:12 +0000 (09:40 -0700)]
Sudo 1.8.23
Todd C. Miller [Mon, 29 Jan 2018 16:31:54 +0000 (09:31 -0700)]
Remove the C-style comment charactes from the getopt_long.c and
inet_pton.c license text as it was inconsistent with the rest of
the file and messed up the html formatting.
Todd C. Miller [Mon, 29 Jan 2018 16:18:48 +0000 (09:18 -0700)]
Remove sudoers2ldif, it has been replaced by cvtsudoers.
Todd C. Miller [Mon, 29 Jan 2018 02:58:10 +0000 (19:58 -0700)]
Add -b option to specify the base dn.
Todd C. Miller [Mon, 29 Jan 2018 02:38:00 +0000 (19:38 -0700)]
Document limitations of LDIF conversion.
Todd C. Miller [Mon, 29 Jan 2018 02:36:16 +0000 (19:36 -0700)]
Switch the default output format to LDIF
Todd C. Miller [Sun, 28 Jan 2018 23:34:16 +0000 (16:34 -0700)]
Execute cvtsudoers if the user runs "visudo -x" but also emit a
warning.
Todd C. Miller [Sun, 28 Jan 2018 23:11:02 +0000 (16:11 -0700)]
Revert
04ec05108b2b , change the default input source back to stdin.
Todd C. Miller [Sun, 28 Jan 2018 17:07:15 +0000 (10:07 -0700)]
Add LDIF conversion to sudoers tests
Todd C. Miller [Sun, 28 Jan 2018 14:09:22 +0000 (07:09 -0700)]
Add notbefore and notafter support to the backends.
Todd C. Miller [Sun, 28 Jan 2018 03:12:34 +0000 (20:12 -0700)]
cvtsudoers instead of sudoers2ldif
Todd C. Miller [Sun, 28 Jan 2018 03:08:02 +0000 (20:08 -0700)]
Add ldif backend to cvtsudoers, to replace sudoers2ldif
Todd C. Miller [Sun, 28 Jan 2018 02:52:20 +0000 (19:52 -0700)]
fix make check
Todd C. Miller [Sat, 27 Jan 2018 00:29:56 +0000 (17:29 -0700)]
Parse sudoers in the front end, not the back end.
Todd C. Miller [Fri, 26 Jan 2018 20:19:03 +0000 (13:19 -0700)]
install the cvtsudoers manual
Todd C. Miller [Fri, 26 Jan 2018 20:15:10 +0000 (13:15 -0700)]
Use the built-in sudoers file location as the default sudoers file
for cvtsudoers and move parse_sudoers_options() to stubs.c since
it is shared between visudo.c and cvtsudoers.c.
Todd C. Miller [Fri, 26 Jan 2018 19:51:24 +0000 (12:51 -0700)]
Move common stub functions required by the parser out of visudo.c
and cvtsudoers.c and into stubs.c.
Todd C. Miller [Fri, 26 Jan 2018 19:28:49 +0000 (12:28 -0700)]
Rename export_sudoers() to convert_sudoers_json() and move the
check for the same input and output file to the front-end.
Todd C. Miller [Fri, 26 Jan 2018 19:26:59 +0000 (12:26 -0700)]
add cvtsudoers
Todd C. Miller [Fri, 26 Jan 2018 18:20:37 +0000 (11:20 -0700)]
Move sudoers JSON conversion to cvtsudoers which will eventually
output to other formats too.
Todd C. Miller [Fri, 26 Jan 2018 17:17:47 +0000 (10:17 -0700)]
Convert from time in minutes to timespec directly instead of
converting to double via strtod(). This makes it easier to catch
overflow.
Todd C. Miller [Wed, 24 Jan 2018 12:27:54 +0000 (05:27 -0700)]
document that kernel tty timestamps don't support negative timeouts
Todd C. Miller [Tue, 23 Jan 2018 18:18:18 +0000 (11:18 -0700)]
Fall back to ppid time stamps if timestamp_type == kernel and no
tty is present. This is consistent with timestamp_type == tty.
Todd C. Miller [Tue, 23 Jan 2018 18:05:41 +0000 (11:05 -0700)]
Do not call the TIOCSETVERAUTH ioctl with a negative number of seconds.
Also cap the max number of seconds at 3600 to avoid getting EINVAL
from TIOCSETVERAUTH.
Todd C. Miller [Tue, 23 Jan 2018 00:27:25 +0000 (17:27 -0700)]
Better conversion from double to nanoseconds.
Todd C. Miller [Mon, 22 Jan 2018 19:18:48 +0000 (12:18 -0700)]
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.
Todd C. Miller [Sun, 21 Jan 2018 23:08:22 +0000 (16:08 -0700)]
Don't rely on perl being installed in /usr/local/bin
Todd C. Miller [Wed, 17 Jan 2018 16:52:15 +0000 (09:52 -0700)]
Remove use of AC_HEADER_TIME, only obsolete platforms actually
need this. Also stop removing sys/time.h unless the source file
uses struct timeval.
Todd C. Miller [Wed, 17 Jan 2018 16:52:09 +0000 (09:52 -0700)]
Remove duplicate options %type
Todd C. Miller [Tue, 16 Jan 2018 17:27:58 +0000 (10:27 -0700)]
Add an approval function to the sudo auth API which is run after
the user's password has been verified. The approval function is
run even if no password is required. This is currently only used
for PAM (use pam_acct_mgmt) and BSD auth (auth_approval).
Todd C. Miller [Mon, 15 Jan 2018 17:29:38 +0000 (10:29 -0700)]
treat uid as unsigned in error message
Todd C. Miller [Mon, 15 Jan 2018 17:24:13 +0000 (10:24 -0700)]
Add missing plugins/sudoers/po/fur.mo file to repo.