]> granicus.if.org Git - sudo/log
sudo
7 years agoMerge sudo 1.8.20 from tip SUDO_1_8_20
Todd C. Miller [Wed, 10 May 2017 15:39:23 +0000 (09:39 -0600)]
Merge sudo 1.8.20 from tip

--HG--
branch : 1.8

7 years agoOnly display string version of errno if sudo_ev_add() fails for now
Todd C. Miller [Wed, 10 May 2017 15:22:07 +0000 (09:22 -0600)]
Only display string version of errno if sudo_ev_add() fails for now

7 years agoupdate
Todd C. Miller [Mon, 8 May 2017 20:03:29 +0000 (14:03 -0600)]
update

7 years agoBe clear that #includedir diverts control to the files in the
Todd C. Miller [Mon, 8 May 2017 19:55:02 +0000 (13:55 -0600)]
Be clear that #includedir diverts control to the files in the
specified directory and, when parsing of those files is complete,
returns control to the original file.  Bug #775

7 years agosync with translationproject.org
Todd C. Miller [Sun, 7 May 2017 12:44:33 +0000 (06:44 -0600)]
sync with translationproject.org

7 years agoupdate
Todd C. Miller [Fri, 5 May 2017 20:48:19 +0000 (14:48 -0600)]
update

7 years agoFix a hang introduced in the last commit. Don't close the pty slave
Todd C. Miller [Fri, 5 May 2017 20:45:35 +0000 (14:45 -0600)]
Fix a hang introduced in the last commit.  Don't close the pty slave
until after we have the controlling tty.

7 years agoIf any of std{in,out,err} are not hooked up to a tty only interpose
Todd C. Miller [Fri, 5 May 2017 20:27:42 +0000 (14:27 -0600)]
If any of std{in,out,err} are not hooked up to a tty only interpose
ourselves with a pipe if the plugin will actually log the data.
This avoids a problem with non-interactive commands where no tty
is present where sudo will consume stdin even when log_input is not
enabled in sudoers.

7 years agoupdate
Todd C. Miller [Fri, 5 May 2017 16:51:18 +0000 (10:51 -0600)]
update

7 years agoUpdate based on information from Michael Felt.
Todd C. Miller [Fri, 5 May 2017 16:45:33 +0000 (10:45 -0600)]
Update based on information from Michael Felt.

7 years agoIn check_input() when switch()ing on the return value of read(),
Todd C. Miller [Thu, 4 May 2017 18:25:51 +0000 (12:25 -0600)]
In check_input() when switch()ing on the return value of read(),
use the default label instead of 1 for the success case.  It is
only reading a single byte so the two are equivalent but it reads
better using default.

7 years agoCheck sudo_ev_add() return value. Coverity CID 168362
Todd C. Miller [Thu, 4 May 2017 17:10:42 +0000 (11:10 -0600)]
Check sudo_ev_add() return value.  Coverity CID 168362

7 years agoAdd io_open() wrapper for open(2) that retries with PERM_IOLOG if
Todd C. Miller [Thu, 4 May 2017 17:00:22 +0000 (11:00 -0600)]
Add io_open() wrapper for open(2) that retries with PERM_IOLOG if
open(2) fails with EACCES.  Use io_open() instead of duplicate
copies of the same fallback code.

7 years agoDon't retry the open() if set_perms() fails.
Todd C. Miller [Thu, 4 May 2017 16:45:05 +0000 (10:45 -0600)]
Don't retry the open() if set_perms() fails.

7 years agoFix typo (fd2 vs. fd) caught by coverity, CID 168359.
Todd C. Miller [Thu, 4 May 2017 16:30:59 +0000 (10:30 -0600)]
Fix typo (fd2 vs. fd) caught by coverity, CID 168359.

7 years agosync with translationproject.org
Todd C. Miller [Thu, 4 May 2017 15:17:19 +0000 (09:17 -0600)]
sync with translationproject.org

7 years agoWarn people not to use --enable-asan in production.
Todd C. Miller [Wed, 3 May 2017 18:56:06 +0000 (12:56 -0600)]
Warn people not to use --enable-asan in production.

7 years agoMove the invocation of check_noexec into the main "check" target
Todd C. Miller [Wed, 3 May 2017 17:58:40 +0000 (11:58 -0600)]
Move the invocation of check_noexec into the main "check" target
but only run it if not cross compiling and whe CHECK_NOEXEC is not
empty.

7 years agoMove @CHECK_NOEXEC@ to TEST_PROGS so it gets cleaned up properly.
Todd C. Miller [Wed, 3 May 2017 17:32:56 +0000 (11:32 -0600)]
Move @CHECK_NOEXEC@ to TEST_PROGS so it gets cleaned up properly.

7 years agoMove syslog_maxlen to the "Integers" section. Move syslog_goodpri and
Todd C. Miller [Wed, 3 May 2017 16:32:21 +0000 (10:32 -0600)]
Move syslog_maxlen to the "Integers" section.  Move syslog_goodpri and
syslog_badpri to the "Strings at can be used in a boolean context" section.

7 years agoFix a pasto that resulted in an extra (empty) syslog_goodpri list entry.
Todd C. Miller [Wed, 3 May 2017 16:24:12 +0000 (10:24 -0600)]
Fix a pasto that resulted in an extra (empty) syslog_goodpri list entry.

7 years agoAdd tests for parsing tuples and syslog options.
Todd C. Miller [Wed, 3 May 2017 15:54:30 +0000 (09:54 -0600)]
Add tests for parsing tuples and syslog options.

7 years agoAllow the syslog Defaults option to be used in a "true" boolean
Todd C. Miller [Wed, 3 May 2017 15:53:03 +0000 (09:53 -0600)]
Allow the syslog Defaults option to be used in a "true" boolean
context and use the compiled in default log facility in this case.

7 years agoAllow a tuple to be set to boolean true. Regression introduced by
Todd C. Miller [Wed, 3 May 2017 15:28:36 +0000 (09:28 -0600)]
Allow a tuple to be set to boolean true.  Regression introduced by
refactor of set_default_entry() in sudo 1.8.18.

7 years agoReplace the list of "dangerous" environment variables and explain
Todd C. Miller [Mon, 1 May 2017 17:33:51 +0000 (11:33 -0600)]
Replace the list of "dangerous" environment variables and explain
how sudo handles the environment instead.

7 years agoFix exponential behavior in glob() with respect to multiple '*'.
Todd C. Miller [Fri, 28 Apr 2017 18:12:00 +0000 (12:12 -0600)]
Fix exponential behavior in glob() with respect to multiple '*'.
See https://research.swtch.com/glob
Adapted from https://perl5.git.perl.org/perl.git/commit/33252c318625f3c6c89b816ee88481940e3e6f95

7 years agoWe no longer need to write to the tty if the command was killed by
Todd C. Miller [Fri, 28 Apr 2017 16:32:15 +0000 (10:32 -0600)]
We no longer need to write to the tty if the command was killed by
a signal.  Sudo will terminate itself with the same signal the
command died from.  Unfortunately, we lose the "core dumped" bit
since sudo itself will not dump core, but there doesn't appear to
be a way around that.

7 years agoOn Linux, if the command we ran dumped core, set PR_SET_DUMPABLE
Todd C. Miller [Thu, 27 Apr 2017 18:28:08 +0000 (12:28 -0600)]
On Linux, if the command we ran dumped core, set PR_SET_DUMPABLE
to 0.  This will prevent sudo itself from dumping core in this case.

7 years agoUpdate path to sudo_noexec.so
Todd C. Miller [Thu, 27 Apr 2017 18:02:29 +0000 (12:02 -0600)]
Update path to sudo_noexec.so

7 years agoIf the command terminated due to a signal, sudo will send that same
Todd C. Miller [Thu, 27 Apr 2017 16:34:30 +0000 (10:34 -0600)]
If the command terminated due to a signal, sudo will send that same
signal to itself so the parent shell knows the command died from
a signal.  However, we don't want sudo itself to dump core.

7 years agosync
Todd C. Miller [Thu, 27 Apr 2017 02:33:20 +0000 (20:33 -0600)]
sync

7 years agoThe fix for Bug #722 contained a typo/thinko that resulted in the
Todd C. Miller [Thu, 27 Apr 2017 02:17:34 +0000 (20:17 -0600)]
The fix for Bug #722 contained a typo/thinko that resulted in the
exit status being 0 when a command was killed by a signal other
than SIGINT.  This fixes the signal handler setup so sudo will
terminate with the same signal as the command.  Bug #784.

7 years agoBetter check for /etc/rc.d/rc2.d/S90sudo on AIX
Todd C. Miller [Wed, 26 Apr 2017 21:49:10 +0000 (15:49 -0600)]
Better check for /etc/rc.d/rc2.d/S90sudo on AIX

7 years agoDon't install the rc.d link when installing to a DESTDIR.
Todd C. Miller [Wed, 26 Apr 2017 20:49:05 +0000 (14:49 -0600)]
Don't install the rc.d link when installing to a DESTDIR.
DESTDIR is generally only set when installing to a temporary
directory for packaging in which case the link should be
made in a post-install script.

7 years agoIn "make install", install sample sudoers file as /etc/sudoers.dist
Todd C. Miller [Wed, 26 Apr 2017 19:52:49 +0000 (13:52 -0600)]
In "make install", install sample sudoers file as /etc/sudoers.dist
and copy it to /etc/sudoers if there is no existing /etc/sudoers.
Packages either contain /etc/sudoers (RPM and Debian) or /etc/sudoers.dist
(everything else).

7 years agoAllow "make dist" and "make depend" to work for out of tree builds.
Todd C. Miller [Wed, 26 Apr 2017 16:43:42 +0000 (10:43 -0600)]
Allow "make dist" and "make depend" to work for out of tree builds.

7 years agoAdd missing $(srcdir) prefix to shlib_exp definition.
Todd C. Miller [Mon, 24 Apr 2017 16:05:38 +0000 (10:05 -0600)]
Add missing $(srcdir) prefix to shlib_exp definition.

7 years agoFix typo in killpg macro.
Todd C. Miller [Fri, 21 Apr 2017 15:25:17 +0000 (09:25 -0600)]
Fix typo in killpg macro.

7 years agoFix the killpg macro for systems without killpg() in libc.
Todd C. Miller [Fri, 21 Apr 2017 13:28:45 +0000 (07:28 -0600)]
Fix the killpg macro for systems without killpg() in libc.

7 years agoUse the standard idiom for popping all entries from a tail queue.
Todd C. Miller [Thu, 20 Apr 2017 22:13:14 +0000 (16:13 -0600)]
Use the standard idiom for popping all entries from a tail queue.
The llvm checker gets confused by TAILQ_REMOVE and generate
use-after-free false positives.

7 years agorewrite errpipe callbacks
Todd C. Miller [Thu, 20 Apr 2017 22:12:53 +0000 (16:12 -0600)]
rewrite errpipe callbacks

7 years agouse pipe2() with O_CLOEXEC instead of pipe() + fcntl() and FD_CLOEXEC
Todd C. Miller [Thu, 20 Apr 2017 21:10:57 +0000 (15:10 -0600)]
use pipe2() with O_CLOEXEC instead of pipe() + fcntl() and FD_CLOEXEC

7 years agoinit io_pipe[][] to -1, not 0
Todd C. Miller [Thu, 20 Apr 2017 21:09:07 +0000 (15:09 -0600)]
init io_pipe[][] to -1, not 0

7 years agoIn sudo_sss_check_user() it is not possible for handle to be NULL.
Todd C. Miller [Wed, 19 Apr 2017 20:30:30 +0000 (14:30 -0600)]
In sudo_sss_check_user() it is not possible for handle to be NULL.

7 years agoFix a use after free when the fqdn sudoOption is set and no hostname
Todd C. Miller [Wed, 19 Apr 2017 20:15:18 +0000 (14:15 -0600)]
Fix a use after free when the fqdn sudoOption is set and no hostname
value is present in sssd.conf.

7 years agoAvoid unused variable when getgrouplist_2() is available.
Todd C. Miller [Wed, 19 Apr 2017 15:39:55 +0000 (09:39 -0600)]
Avoid unused variable when getgrouplist_2() is available.
It would be nicer to just provide getgrouplist_2() (or the equivalent)
and avoid the ugly #ifdefs.

7 years agosync with translationproject.org
Todd C. Miller [Wed, 19 Apr 2017 15:07:55 +0000 (09:07 -0600)]
sync with translationproject.org

7 years agoregen
Todd C. Miller [Thu, 13 Apr 2017 19:45:00 +0000 (13:45 -0600)]
regen

7 years agoIn sudo_ttyname_scan() if dir is the empty string, set errno to
Todd C. Miller [Wed, 12 Apr 2017 23:06:48 +0000 (17:06 -0600)]
In sudo_ttyname_scan() if dir is the empty string, set errno to
ENOENT before returning.

7 years agoTry to make it clear that when match_group_by_gid is enabled, groups
Todd C. Miller [Tue, 11 Apr 2017 22:56:04 +0000 (16:56 -0600)]
Try to make it clear that when match_group_by_gid is enabled, groups
in sudoers are looked up by group name instead of group ID.  This
doesn't usually cause problems, but if there are conflicting group
entries (for example, from a local /etc/group file and an LDAP or
AD group database), whether the group is resolved by name or ID can
be used to work around conflicts.

7 years agosync with translationproject.org
Todd C. Miller [Fri, 7 Apr 2017 16:32:52 +0000 (10:32 -0600)]
sync with translationproject.org

7 years agoplug memory leak in check_digest
Todd C. Miller [Fri, 7 Apr 2017 15:56:47 +0000 (09:56 -0600)]
plug memory leak in check_digest

7 years agoCheck return value of dispatch_pending_signals() in case we received
Todd C. Miller [Fri, 7 Apr 2017 14:38:56 +0000 (08:38 -0600)]
Check return value of dispatch_pending_signals() in case we received
SIGINT or SIGQUIT before executing the command.

7 years agoback out unintentional change to the version number
Todd C. Miller [Thu, 30 Mar 2017 13:10:36 +0000 (07:10 -0600)]
back out unintentional change to the version number

7 years agosync with translationproject.org
Todd C. Miller [Tue, 28 Mar 2017 16:56:30 +0000 (10:56 -0600)]
sync with translationproject.org

7 years agoMake check_digest test sudo_filedigest() itself instead of the
Todd C. Miller [Mon, 27 Mar 2017 20:45:24 +0000 (14:45 -0600)]
Make check_digest test sudo_filedigest() itself instead of the
underlying SHA2 functions.  That way we can test it regardless of
whether we use sudo's SHA2 functions or a library version.

7 years agoDocument that commands matched by "sudo ALL" are not affected by
Todd C. Miller [Mon, 27 Mar 2017 17:10:18 +0000 (11:10 -0600)]
Document that commands matched by "sudo ALL" are not affected by
fdexec.

7 years agoUpdate for 1.8.20
Todd C. Miller [Fri, 24 Mar 2017 22:29:09 +0000 (16:29 -0600)]
Update for 1.8.20

7 years agoregen for restricted_env_file
Todd C. Miller [Fri, 24 Mar 2017 21:37:14 +0000 (15:37 -0600)]
regen for restricted_env_file

7 years agoMention that iolog_user is useful for NFS.
Todd C. Miller [Fri, 24 Mar 2017 21:36:03 +0000 (15:36 -0600)]
Mention that iolog_user is useful for NFS.

7 years agoOnly retry mkdir or create with PERM_IOLOG if errno is EACCES.
Todd C. Miller [Thu, 23 Mar 2017 23:00:27 +0000 (17:00 -0600)]
Only retry mkdir or create with PERM_IOLOG if errno is EACCES.
Also always use PERM_IOLOG for mkdtemp() since we cannot retry
if it fails.  Since we are guaranteed to create a new directory
there's no real need to try w/o PERM_IOLOG in this case.

7 years agoAdd fallback to PERM_IOLOG when making the final componenet of iolog_dir.
Todd C. Miller [Wed, 22 Mar 2017 21:55:16 +0000 (15:55 -0600)]
Add fallback to PERM_IOLOG when making the final componenet of iolog_dir.

7 years agoAdd restricted_env_file which is like env_file but subject to the
Todd C. Miller [Wed, 22 Mar 2017 19:39:25 +0000 (13:39 -0600)]
Add restricted_env_file which is like env_file but subject to the
same restrictions as the user's own environment.

7 years agoquiet a warning on older zlib
Todd C. Miller [Wed, 22 Mar 2017 14:47:10 +0000 (08:47 -0600)]
quiet a warning on older zlib

7 years agocast mode_t to unsigned int when printing with %o
Todd C. Miller [Wed, 22 Mar 2017 14:37:12 +0000 (08:37 -0600)]
cast mode_t to unsigned int when printing with %o

7 years agoregen
Todd C. Miller [Tue, 21 Mar 2017 22:34:17 +0000 (16:34 -0600)]
regen

7 years agoSet umask temporarily when creating files instead of changing the
Todd C. Miller [Tue, 21 Mar 2017 22:21:17 +0000 (16:21 -0600)]
Set umask temporarily when creating files instead of changing the
mode after the fact.  This is slightly less error prone.

7 years agoremove now-useless variable
Todd C. Miller [Tue, 21 Mar 2017 21:04:47 +0000 (15:04 -0600)]
remove now-useless variable

7 years agoDon't set owner/mode on directories that already exist, only on
Todd C. Miller [Tue, 21 Mar 2017 20:55:19 +0000 (14:55 -0600)]
Don't set owner/mode on directories that already exist, only on
newly-created ones.

7 years agoExplicitly set the file mode of I/O log files so the mode is not
Todd C. Miller [Tue, 21 Mar 2017 19:54:27 +0000 (13:54 -0600)]
Explicitly set the file mode of I/O log files so the mode is not
affected by the invoking user's umask.

7 years agoAdd PERM_IOLOG so we can create I/O log files on an NFS-mounted
Todd C. Miller [Tue, 21 Mar 2017 19:41:14 +0000 (13:41 -0600)]
Add PERM_IOLOG so we can create I/O log files on an NFS-mounted
filesystem where root is remapped to an unprivileged user.

7 years agoRestore the '/' in the path before returning if we encounter an error.
Todd C. Miller [Tue, 21 Mar 2017 16:15:31 +0000 (10:15 -0600)]
Restore the '/' in the path before returning if we encounter an error.

7 years agoWhen creating the timestamp directory, use the group of the timestamp
Todd C. Miller [Mon, 20 Mar 2017 18:59:28 +0000 (12:59 -0600)]
When creating the timestamp directory, use the group of the timestamp
owner instead of inheriting the group of the parent directory.

7 years agozero out nss->handle after it has been freed to make sure we cannot free it twice
Todd C. Miller [Tue, 21 Mar 2017 15:52:51 +0000 (09:52 -0600)]
zero out nss->handle after it has been freed to make sure we cannot free it twice

7 years agoAdd iolog_flush option.
Todd C. Miller [Mon, 20 Mar 2017 16:25:58 +0000 (10:25 -0600)]
Add iolog_flush option.

7 years agoDon't allow the user to specify an I/O log file mode that sudo can't
Todd C. Miller [Fri, 17 Mar 2017 16:56:17 +0000 (10:56 -0600)]
Don't allow the user to specify an I/O log file mode that sudo can't
read or write to.  I/O logs must always be readable and writable
by the owner.

7 years agoRegenerate the cat pages with newer mandoc which formats double
Todd C. Miller [Tue, 14 Mar 2017 15:13:25 +0000 (09:13 -0600)]
Regenerate the cat pages with newer mandoc which formats double
quotes as "foo" instead of ``foo''.

7 years agoMake it clear that I/O logs will be complete even if the command
Todd C. Miller [Tue, 14 Mar 2017 15:11:56 +0000 (09:11 -0600)]
Make it clear that I/O logs will be complete even if the command
run by sudo is terminated by a signal.  The I/O log buffering just
prevents the logs from being displayed in real-time as the command
is running.

7 years agoReplace pipe_nonblock() with pipe2()
Todd C. Miller [Mon, 13 Mar 2017 18:11:52 +0000 (12:11 -0600)]
Replace pipe_nonblock() with pipe2()

7 years agoEmulate pipe2() on systems without it.
Todd C. Miller [Mon, 13 Mar 2017 18:11:51 +0000 (12:11 -0600)]
Emulate pipe2() on systems without it.

7 years agoFix declaration of sudo_krb5_verify() in the case where krb5_verify_user()
Todd C. Miller [Fri, 10 Mar 2017 18:52:49 +0000 (11:52 -0700)]
Fix declaration of sudo_krb5_verify() in the case where krb5_verify_user()
is not present.  Bug #777

7 years agoUse HAVE_STDBOOL_H to detect systems w/o stdbool.h.
Todd C. Miller [Fri, 10 Mar 2017 18:49:07 +0000 (11:49 -0700)]
Use HAVE_STDBOOL_H to detect systems w/o stdbool.h.
Bug #778

7 years agoregen
Todd C. Miller [Thu, 9 Mar 2017 19:00:18 +0000 (12:00 -0700)]
regen

7 years agoMove SIGCHLD handling into handle_sigchld() functions and move the
Todd C. Miller [Thu, 9 Mar 2017 15:36:40 +0000 (08:36 -0700)]
Move SIGCHLD handling into handle_sigchld() functions and move the
remaining bits of dispatch_signal() into signal_pipe_cb()

7 years agoe_termination should be set to the value of WTERMSIG not WEXITSTATUS
Todd C. Miller [Wed, 8 Mar 2017 16:17:53 +0000 (09:17 -0700)]
e_termination should be set to the value of WTERMSIG not WEXITSTATUS

7 years agoAdd tcsetpgrp_nobg() which acts like tcsetpgrp() but returns -1
Todd C. Miller [Tue, 7 Mar 2017 19:29:21 +0000 (12:29 -0700)]
Add tcsetpgrp_nobg() which acts like tcsetpgrp() but returns -1
for a background process.  This is safer than blocking SIGTTOU
which would cause tcsetpgrp() to succeed in the background.

7 years agoPrevent sudo from receiving SIGTTOU when it tries to restore the
Todd C. Miller [Mon, 6 Mar 2017 20:05:17 +0000 (13:05 -0700)]
Prevent sudo from receiving SIGTTOU when it tries to restore the
controlling terminal.  There appears to be a race with the shell
(bash) which we may lose.

7 years agoAdd some casts to quiet gcc warnings on Solaris and remove a
Todd C. Miller [Fri, 3 Mar 2017 18:20:56 +0000 (11:20 -0700)]
Add some casts to quiet gcc warnings on Solaris and remove a
now-useless debug printf.

7 years agochange debug info when suspending sudo
Todd C. Miller [Fri, 3 Mar 2017 18:20:25 +0000 (11:20 -0700)]
change debug info when suspending sudo

7 years agoReorganize the command execution code to separate out the pty and
Todd C. Miller [Fri, 3 Mar 2017 17:35:11 +0000 (10:35 -0700)]
Reorganize the command execution code to separate out the pty and
non-pty code paths into their own event loops.  The non-pty exec
code is now contained in exec_nopty.c and the pty exec code is split
between exec_pty.c (parent process) and exec_monitor.c (session leader).
This results in a small bit of duplicated code but improves readability.
Some of the duplicated code will fall out in future changes to the
event subsystem (the signal pipe).

7 years agoRemove support for the TIOCGSIZE ioctl. Systems that use this
Todd C. Miller [Sun, 26 Feb 2017 23:41:25 +0000 (16:41 -0700)]
Remove support for the TIOCGSIZE ioctl.  Systems that use this
rather than TIOCGWINSZ are too old for sudo to build on anyway.

7 years agoSet the child pid to -1 after we've waited for it and take care to
Todd C. Miller [Fri, 24 Feb 2017 22:14:56 +0000 (15:14 -0700)]
Set the child pid to -1 after we've waited for it and take care to
avoid killing pid -1.  This makes it a bit more explicit and removes
the need for a separate variable to track the child's status.
Sudo already stops processing signals after it receives SIGCHLD so
it is not vulnerable to CVE-2017-2616.

7 years agoUpdate the description of strict mode to current reality. Aliases
Todd C. Miller [Wed, 22 Feb 2017 21:13:07 +0000 (14:13 -0700)]
Update the description of strict mode to current reality.  Aliases
haven't needed to be defined before they are used since sudo 1.7.

7 years agoGo back to using a Warning/Error prefix in the message printed to
Todd C. Miller [Wed, 22 Feb 2017 13:38:33 +0000 (06:38 -0700)]
Go back to using a Warning/Error prefix in the message printed to
stderr for alias problems.  Requested by Tomas Sykora.

7 years agofix copyright years
Todd C. Miller [Tue, 21 Feb 2017 16:03:57 +0000 (09:03 -0700)]
fix copyright years

7 years agoAdd support for using the message digest functions in libgcrypt
Todd C. Miller [Mon, 20 Feb 2017 23:44:12 +0000 (16:44 -0700)]
Add support for using the message digest functions in libgcrypt
instead of sudo's own SHA2 implementation.

7 years agoAdd support for using the message digest functions in OpenSSL instead
Todd C. Miller [Mon, 20 Feb 2017 23:44:12 +0000 (16:44 -0700)]
Add support for using the message digest functions in OpenSSL instead
of sudo's own SHA2 implementation.

7 years agoMove the file digest code out of match.c and into filedigest.c.
Todd C. Miller [Mon, 20 Feb 2017 23:44:12 +0000 (16:44 -0700)]
Move the file digest code out of match.c and into filedigest.c.
Inspired by RedHat changes that used libgcrypt.
Also add digest_type_to_name() to map a sudo digest type (int)
to a name (string) and use it.

7 years agoCheck for gmtime() or localtime() returning NULL and just use a
Todd C. Miller [Mon, 20 Feb 2017 23:44:02 +0000 (16:44 -0700)]
Check for gmtime() or localtime() returning NULL and just use a
zero offset in that case.  Should not be possible.

7 years agoAdd support for ROLE, TYPE, PRIVS, LIMITPRIVS, TIMEOUT, NOTBEFORE
Todd C. Miller [Sat, 18 Feb 2017 23:44:56 +0000 (16:44 -0700)]
Add support for ROLE, TYPE, PRIVS, LIMITPRIVS, TIMEOUT, NOTBEFORE
and NOTAFTER.