]> granicus.if.org Git - sudo/log
sudo
6 years agoNo longer need to include stddef.h
Todd C. Miller [Sat, 10 Feb 2018 20:37:59 +0000 (13:37 -0700)]
No longer need to include stddef.h

6 years agoRemove dead store, found by cppcheck.
Todd C. Miller [Sat, 10 Feb 2018 16:44:34 +0000 (09:44 -0700)]
Remove dead store, found by cppcheck.

6 years agosimplify iterator
Todd C. Miller [Sat, 10 Feb 2018 11:29:43 +0000 (04:29 -0700)]
simplify iterator

6 years agoSilence a false positive from cppcheck.
Todd C. Miller [Sat, 10 Feb 2018 11:08:42 +0000 (04:08 -0700)]
Silence a false positive from cppcheck.

6 years agoCast version to int when printing. Avoids a cppcheck warning.
Todd C. Miller [Sat, 10 Feb 2018 11:00:17 +0000 (04:00 -0700)]
Cast version to int when printing.  Avoids a cppcheck warning.

6 years agoUse an iterator instead of fragile pointer arithmetic to iterate
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().

6 years agoMove sudoers formatting code into fmtsudoers.
Todd C. Miller [Sat, 10 Feb 2018 01:22:04 +0000 (18:22 -0700)]
Move sudoers formatting code into fmtsudoers.

6 years agoClean up some XXX in parse.c
Todd C. Miller [Sat, 10 Feb 2018 01:22:03 +0000 (18:22 -0700)]
Clean up some XXX in parse.c

6 years agoRename sudo_file_append_default() -> sudo_lbuf_append_default() and
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.

6 years agoMove common bits of ldap to sudoers conversion into ldap_common.c
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.

6 years agoConvert ldap results into a sudoers userspec so we can use the "sudo
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.

6 years agoDon't mark sudoers.dist volatile, it only gets used on systems that
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.

6 years agoRefactor member freeing code into free_member().
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().

6 years agoFix compilation with glibc where stdout is not constant.
Todd C. Miller [Mon, 5 Feb 2018 13:23:33 +0000 (06:23 -0700)]
Fix compilation with glibc where stdout is not constant.

6 years agoFor "sudo -l", if a word includes spaces, print it in double quotes.
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.

6 years agoDisplay sudoNotBefore and sudoNotAfter in "sudo -l"
Todd C. Miller [Sat, 3 Feb 2018 21:56:00 +0000 (14:56 -0700)]
Display sudoNotBefore and sudoNotAfter in "sudo -l"

6 years agoFor "sudo -l", if a word includes spaces, print it in double quotes.
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.

6 years agoAdd back printing of negation operator ('!') when printing a word
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.

6 years agoUse visudo to validate "cvtsudoers -f sudoers" output.
Todd C. Miller [Sat, 3 Feb 2018 13:46:56 +0000 (06:46 -0700)]
Use visudo to validate "cvtsudoers -f sudoers" output.

6 years agoRemove syslog_goodpri and syslog_badpri without a value that causes
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.

6 years agoWhen outputting sudoers, if a word includes spaces, print it in
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.

6 years agoAdd sudoers output format to cvtsudoers. In the future this may
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.

6 years agoWhen printing a member name, quote sudoers special characters unless
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.

6 years agoMove SUDOERS_QUOTED define to parse.h
Todd C. Miller [Fri, 2 Feb 2018 13:28:04 +0000 (06:28 -0700)]
Move SUDOERS_QUOTED define to parse.h

6 years agoRemove extraneous break statement and fix some whitespace.
Todd C. Miller [Tue, 30 Jan 2018 18:12:38 +0000 (11:12 -0700)]
Remove extraneous break statement and fix some whitespace.

6 years agoThe max timeout for kernel time stamps is 60 minutes, not 3600 minutes.
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.

6 years agoCheck the return value of sudoers_debug_register().
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

6 years agoFix memory leak, su->count is now 0 when it is unused, not 1.
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

6 years agoQuiet a clang analyzer false positive.
Todd C. Miller [Mon, 29 Jan 2018 18:50:56 +0000 (11:50 -0700)]
Quiet a clang analyzer false positive.

6 years agoQuote special characters when creating the cn as per RFC2253
Todd C. Miller [Mon, 29 Jan 2018 18:00:43 +0000 (11:00 -0700)]
Quote special characters when creating the cn as per RFC2253

6 years agoSudo 1.8.23
Todd C. Miller [Mon, 29 Jan 2018 16:40:12 +0000 (09:40 -0700)]
Sudo 1.8.23

6 years agoRemove the C-style comment charactes from the getopt_long.c and
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.

6 years agoRemove sudoers2ldif, it has been replaced by cvtsudoers.
Todd C. Miller [Mon, 29 Jan 2018 16:18:48 +0000 (09:18 -0700)]
Remove sudoers2ldif, it has been replaced by cvtsudoers.

6 years agoAdd -b option to specify the base dn.
Todd C. Miller [Mon, 29 Jan 2018 02:58:10 +0000 (19:58 -0700)]
Add -b option to specify the base dn.

6 years agoDocument limitations of LDIF conversion.
Todd C. Miller [Mon, 29 Jan 2018 02:38:00 +0000 (19:38 -0700)]
Document limitations of LDIF conversion.

6 years agoSwitch the default output format to LDIF
Todd C. Miller [Mon, 29 Jan 2018 02:36:16 +0000 (19:36 -0700)]
Switch the default output format to LDIF

6 years agoExecute cvtsudoers if the user runs "visudo -x" but also emit a
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.

6 years agoRevert 04ec05108b2b, change the default input source back to stdin.
Todd C. Miller [Sun, 28 Jan 2018 23:11:02 +0000 (16:11 -0700)]
Revert 04ec05108b2b, change the default input source back to stdin.

6 years agoAdd LDIF conversion to sudoers tests
Todd C. Miller [Sun, 28 Jan 2018 17:07:15 +0000 (10:07 -0700)]
Add LDIF conversion to sudoers tests

6 years agoAdd notbefore and notafter support to the backends.
Todd C. Miller [Sun, 28 Jan 2018 14:09:22 +0000 (07:09 -0700)]
Add notbefore and notafter support to the backends.

6 years agocvtsudoers instead of sudoers2ldif
Todd C. Miller [Sun, 28 Jan 2018 03:12:34 +0000 (20:12 -0700)]
cvtsudoers instead of sudoers2ldif

6 years agoAdd ldif backend to cvtsudoers, to replace sudoers2ldif
Todd C. Miller [Sun, 28 Jan 2018 03:08:02 +0000 (20:08 -0700)]
Add ldif backend to cvtsudoers, to replace sudoers2ldif

6 years agofix make check
Todd C. Miller [Sun, 28 Jan 2018 02:52:20 +0000 (19:52 -0700)]
fix make check

6 years agoParse sudoers in the front end, not the back end.
Todd C. Miller [Sat, 27 Jan 2018 00:29:56 +0000 (17:29 -0700)]
Parse sudoers in the front end, not the back end.

6 years agoinstall the cvtsudoers manual
Todd C. Miller [Fri, 26 Jan 2018 20:19:03 +0000 (13:19 -0700)]
install the cvtsudoers manual

6 years agoUse the built-in sudoers file location as the default sudoers file
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.

6 years agoMove common stub functions required by the parser out of visudo.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.

6 years agoRename export_sudoers() to convert_sudoers_json() and move the
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.

6 years agoadd cvtsudoers
Todd C. Miller [Fri, 26 Jan 2018 19:26:59 +0000 (12:26 -0700)]
add cvtsudoers

6 years agoMove sudoers JSON conversion to cvtsudoers which will eventually
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.

6 years agoConvert from time in minutes to timespec directly instead of
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.

6 years agodocument that kernel tty timestamps don't support negative timeouts
Todd C. Miller [Wed, 24 Jan 2018 12:27:54 +0000 (05:27 -0700)]
document that kernel tty timestamps don't support negative timeouts

6 years agoFall back to ppid time stamps if timestamp_type == kernel and no
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.

6 years agoDo not call the TIOCSETVERAUTH ioctl with a negative number of seconds.
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.

6 years agoBetter conversion from double to nanoseconds.
Todd C. Miller [Tue, 23 Jan 2018 00:27:25 +0000 (17:27 -0700)]
Better conversion from double to nanoseconds.

6 years agoStore passwd_timeout and timestamp_timeout as a struct timespec
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.

6 years agoDon't rely on perl being installed in /usr/local/bin
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

6 years agoRemove use of AC_HEADER_TIME, only obsolete platforms actually
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.

6 years agoRemove duplicate options %type
Todd C. Miller [Wed, 17 Jan 2018 16:52:09 +0000 (09:52 -0700)]
Remove duplicate options %type

6 years agoAdd an approval function to the sudo auth API which is run after
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).

6 years agotreat uid as unsigned in error message
Todd C. Miller [Mon, 15 Jan 2018 17:29:38 +0000 (10:29 -0700)]
treat uid as unsigned in error message

6 years agoAdd missing plugins/sudoers/po/fur.mo file to repo.
Todd C. Miller [Mon, 15 Jan 2018 17:24:13 +0000 (10:24 -0700)]
Add missing plugins/sudoers/po/fur.mo file to repo.

6 years agoMention new sudoers_timestamp manual.
Todd C. Miller [Mon, 15 Jan 2018 17:12:40 +0000 (10:12 -0700)]
Mention new sudoers_timestamp manual.

6 years agoignore tsdump
Todd C. Miller [Fri, 12 Jan 2018 18:43:02 +0000 (11:43 -0700)]
ignore tsdump

6 years agoConvert from mono time to real time before displaying time stamps.
Todd C. Miller [Fri, 12 Jan 2018 18:03:22 +0000 (11:03 -0700)]
Convert from mono time to real time before displaying time stamps.

6 years agoUse PATH_MAX, not MAXPATHLEN.
Todd C. Miller [Thu, 11 Jan 2018 21:55:11 +0000 (14:55 -0700)]
Use PATH_MAX, not MAXPATHLEN.

6 years agoAdd tsdump, a simple utility to dump a timestamp file. To build,
Todd C. Miller [Thu, 11 Jan 2018 17:49:20 +0000 (10:49 -0700)]
Add tsdump, a simple utility to dump a timestamp file.  To build,
run "make tsdump" in the plugins/sudoers directory (it is not built
by default).  In order to map the tty device number to a name,
sudo_ttyname_dev() has been moved into libsudo_util.

6 years agosync with translationproject.org
Todd C. Miller [Fri, 5 Jan 2018 04:35:47 +0000 (21:35 -0700)]
sync with translationproject.org

6 years agoWelcome to 2018
Todd C. Miller [Fri, 5 Jan 2018 04:35:17 +0000 (21:35 -0700)]
Welcome to 2018

7 years agosync with translationproject.org
Todd C. Miller [Thu, 28 Dec 2017 15:09:53 +0000 (08:09 -0700)]
sync with translationproject.org

7 years agoSilence a clang analyzer false positive.
Todd C. Miller [Fri, 22 Dec 2017 20:27:08 +0000 (13:27 -0700)]
Silence a clang analyzer false positive.

7 years agoRemove extra $(srcdir)/sudoreplay.man.in target added by mistake.
Todd C. Miller [Fri, 22 Dec 2017 19:55:41 +0000 (12:55 -0700)]
Remove extra $(srcdir)/sudoreplay.man.in target added by mistake.

7 years agosync with translationproject.org
Todd C. Miller [Fri, 22 Dec 2017 19:47:07 +0000 (12:47 -0700)]
sync with translationproject.org

7 years agoUse a tty lock even for kernel time stamps so we can avoid simultaneous
Todd C. Miller [Fri, 22 Dec 2017 18:10:22 +0000 (11:10 -0700)]
Use a tty lock even for kernel time stamps so we can avoid simultaneous
password prompts.

7 years agovisudo changes
Todd C. Miller [Fri, 22 Dec 2017 17:39:57 +0000 (10:39 -0700)]
visudo changes

7 years agoAlso honor SUDO_EDITOR in visudo. Previously is was only used
Todd C. Miller [Fri, 22 Dec 2017 17:22:33 +0000 (10:22 -0700)]
Also honor SUDO_EDITOR in visudo.  Previously is was only used
by sudoedit.

7 years agoStop looking for an editor as soon as we find one.
Todd C. Miller [Thu, 21 Dec 2017 23:31:42 +0000 (16:31 -0700)]
Stop looking for an editor as soon as we find one.
A similar fix was made to visudo some time ago.

7 years agoThe session ID was added in 1.8.6p7 to prevent a user in another
Todd C. Miller [Thu, 21 Dec 2017 21:37:13 +0000 (14:37 -0700)]
The session ID was added in 1.8.6p7 to prevent a user in another
session from re-using the time stamp file.
Other minor cleanups.

7 years ago"time stamp" not "timestamp"
Todd C. Miller [Thu, 21 Dec 2017 21:21:48 +0000 (14:21 -0700)]
"time stamp" not "timestamp"

7 years agoAdd "kernel" as a possible value of timestamp_type.
Todd C. Miller [Wed, 20 Dec 2017 23:19:54 +0000 (16:19 -0700)]
Add "kernel" as a possible value of timestamp_type.
Currently only supported on OpenBSD.

7 years agoDocument the sudoers time stamp file format.
Todd C. Miller [Wed, 20 Dec 2017 20:01:06 +0000 (13:01 -0700)]
Document the sudoers time stamp file format.

7 years agoVerify start time of the current process, allowing for some clock
Todd C. Miller [Tue, 19 Dec 2017 17:10:54 +0000 (10:10 -0700)]
Verify start time of the current process, allowing for some clock
drift.  For Linux, process start time is relative to boot time, not
wallclock time.

7 years agosync
Todd C. Miller [Mon, 18 Dec 2017 18:34:59 +0000 (11:34 -0700)]
sync

7 years agoregen
Todd C. Miller [Mon, 18 Dec 2017 17:52:45 +0000 (10:52 -0700)]
regen

7 years agoTrivial test for process start time. We don't try to check the
Todd C. Miller [Mon, 18 Dec 2017 17:35:37 +0000 (10:35 -0700)]
Trivial test for process start time.  We don't try to check the
resulting timespec as it differs by platform.  On most it is wallclock
time, on others it is relative to boot time (Linux).

7 years agoregen
Todd C. Miller [Mon, 18 Dec 2017 16:39:06 +0000 (09:39 -0700)]
regen

7 years agoSupport start time on macOS and 4.4BSD
Todd C. Miller [Sun, 17 Dec 2017 14:40:21 +0000 (07:40 -0700)]
Support start time on macOS and 4.4BSD

7 years agoInclude sys/types.h for mode_t used in sudoers.h.
Todd C. Miller [Sun, 17 Dec 2017 03:55:01 +0000 (20:55 -0700)]
Include sys/types.h for mode_t used in sudoers.h.

7 years agoFix compilation error on FreeBSD
Todd C. Miller [Sun, 17 Dec 2017 03:46:58 +0000 (20:46 -0700)]
Fix compilation error on FreeBSD

7 years agoFix debug_decl(), it should be SUDOERS_DEBUG_UTIL
Todd C. Miller [Sat, 16 Dec 2017 21:50:14 +0000 (14:50 -0700)]
Fix debug_decl(), it should be SUDOERS_DEBUG_UTIL
Add debugging for the successful case
For Linux, don't NUL out *ep before parsing with strtoull().
* * *
Add missing debug info for the System V /proc version.

7 years agoIn the timestamp record, include the start time of the terminal
Todd C. Miller [Sat, 16 Dec 2017 12:53:05 +0000 (05:53 -0700)]
In the timestamp record, include the start time of the terminal
session leader for tty-based timestamps or the start time of the
parent process for ppid-based timestamps.  Idea from Duncan Overbruck.

7 years agoIf the lock record doesn't match the expected record size we need
Todd C. Miller [Sat, 16 Dec 2017 04:08:38 +0000 (21:08 -0700)]
If the lock record doesn't match the expected record size we need
to seek to the end of the record as we otherwise may have gone too
far (or not far enough).  Fixes interop problems when the time stamp
record changes size.

7 years agoNo need for a loop around the recv() now that we don't have to worry
Todd C. Miller [Wed, 13 Dec 2017 04:44:23 +0000 (21:44 -0700)]
No need for a loop around the recv() now that we don't have to worry
about EINTR.  CID 180697

7 years agoTry to be clearer about sudo's exit value when the -l option is used.
Todd C. Miller [Tue, 12 Dec 2017 22:42:21 +0000 (15:42 -0700)]
Try to be clearer about sudo's exit value when the -l option is used.

7 years agosync
Todd C. Miller [Tue, 12 Dec 2017 22:13:52 +0000 (15:13 -0700)]
sync

7 years agoAn empty RunAsUser means run as the invoking user, similar to how
Todd C. Miller [Tue, 12 Dec 2017 21:20:56 +0000 (14:20 -0700)]
An empty RunAsUser means run as the invoking user, similar to how
the sudoers files works.

7 years agoregen
Todd C. Miller [Tue, 12 Dec 2017 21:19:13 +0000 (14:19 -0700)]
regen

7 years agoAdd authfail_message sudoers option to allow the user to override
Todd C. Miller [Mon, 11 Dec 2017 19:43:58 +0000 (12:43 -0700)]
Add authfail_message sudoers option to allow the user to override
the default message of %d incorrect password attempt(s).

7 years agoAllow the plugin to determine whether or not an empty timeout is
Todd C. Miller [Mon, 11 Dec 2017 16:20:41 +0000 (09:20 -0700)]
Allow the plugin to determine whether or not an empty timeout is
allowed.  For sudoers, an error will be returned for an empty timeout.

7 years agoReturn an error for an empty timeout string. Just use strtol() for
Todd C. Miller [Mon, 11 Dec 2017 16:19:42 +0000 (09:19 -0700)]
Return an error for an empty timeout string.  Just use strtol() for
syntax checking instead of scanning with strspn().