]> granicus.if.org Git - sudo/log
sudo
8 years agoDon't generate SIGTOU when restoring the terminal modes. It doen't
Todd C. Miller [Mon, 17 Oct 2016 15:02:34 +0000 (09:02 -0600)]
Don't generate SIGTOU when restoring the terminal modes.  It doen't
make sense to suspend the process only to restore the terminal
settings since in this case the shell has already taken ownership
of the tty.

8 years agoThe flush parameter of sudo_term_restore() is bool, not int.
Todd C. Miller [Mon, 17 Oct 2016 14:57:17 +0000 (08:57 -0600)]
The flush parameter of sudo_term_restore() is bool, not int.

8 years agoAdd wordexp() to the list of functions wrapped by sudo_noexec.so.
Todd C. Miller [Fri, 14 Oct 2016 16:33:55 +0000 (10:33 -0600)]
Add wordexp() to the list of functions wrapped by sudo_noexec.so.

8 years agoNeed RTLD_NEXT for wordexp() on dlopen() systems. It is missing on AIX 5.1 at least.
Todd C. Miller [Mon, 10 Oct 2016 14:38:50 +0000 (08:38 -0600)]
Need RTLD_NEXT for wordexp() on dlopen() systems.  It is missing on AIX 5.1 at least.

8 years agoadd missing guard around wordexp()
Todd C. Miller [Mon, 10 Oct 2016 14:33:57 +0000 (08:33 -0600)]
add missing guard around wordexp()

8 years agoexpand on 1.8.18p1 changes
Todd C. Miller [Mon, 10 Oct 2016 14:24:47 +0000 (08:24 -0600)]
expand on 1.8.18p1 changes

8 years agosudo 1.8.18p1
Todd C. Miller [Mon, 10 Oct 2016 01:58:54 +0000 (19:58 -0600)]
sudo 1.8.18p1

8 years agoFix configure check for seccomp filter on Linux
Todd C. Miller [Sun, 9 Oct 2016 17:24:29 +0000 (11:24 -0600)]
Fix configure check for seccomp filter on Linux

8 years agoUse a seccomp filter on Linux to disable execve(2) and execveat(2).
Todd C. Miller [Sun, 9 Oct 2016 01:09:17 +0000 (19:09 -0600)]
Use a seccomp filter on Linux to disable execve(2) and execveat(2).
This still relies on LD_PRELOAD to work so it has the same issues
as the existing mether with respect to running 32-bit binaries on
a 64-bit kernel.

8 years agoregen
Todd C. Miller [Sun, 9 Oct 2016 01:02:15 +0000 (19:02 -0600)]
regen

8 years agoregen
Todd C. Miller [Sat, 8 Oct 2016 16:36:02 +0000 (10:36 -0600)]
regen

8 years agoWrap wordexp(3) in sudo_noexec.
Todd C. Miller [Thu, 6 Oct 2016 02:21:18 +0000 (20:21 -0600)]
Wrap wordexp(3) in sudo_noexec.

8 years agoClean .json files created by "make check"
Todd C. Miller [Mon, 26 Sep 2016 19:38:51 +0000 (13:38 -0600)]
Clean .json files created by "make check"

8 years agorecompile .po files
Todd C. Miller [Mon, 19 Sep 2016 22:40:26 +0000 (16:40 -0600)]
recompile .po files

8 years agoFix matching when no sudoRunAsUser is present in a sudoRole.
Todd C. Miller [Mon, 19 Sep 2016 12:19:49 +0000 (06:19 -0600)]
Fix matching when no sudoRunAsUser is present in a sudoRole.
If only a sudoRunAsGroup is present, match on the invoking user
if the -g option was specified and the group matched.
If no sudoRunAsGroup is present and the -g option was specified,
allow it if it matches the passwd gid of the runas user.
This matches the behavior of the sudoers backend.

8 years agorunas_pw can no longer be NULL
Todd C. Miller [Mon, 19 Sep 2016 12:08:00 +0000 (06:08 -0600)]
runas_pw can no longer be NULL

8 years agoRunAsGroup without RunAsUser issues
Todd C. Miller [Thu, 15 Sep 2016 21:24:00 +0000 (15:24 -0600)]
RunAsGroup without RunAsUser issues

8 years agouser_matched and group_matched must be type int, not bool
Todd C. Miller [Thu, 15 Sep 2016 21:22:06 +0000 (15:22 -0600)]
user_matched and group_matched must be type int, not bool

8 years agoUse RUNAS_USER_SPECIFIED and RUNAS_GROUP_SPECIFIED when deciding
Todd C. Miller [Thu, 15 Sep 2016 19:47:38 +0000 (13:47 -0600)]
Use RUNAS_USER_SPECIFIED and RUNAS_GROUP_SPECIFIED when deciding
whether to check runas user/group instead of checking runas_pw or
runas_gr.

8 years agoWhen matching against runas_default use userpw_matches() instead
Todd C. Miller [Thu, 15 Sep 2016 19:36:43 +0000 (13:36 -0600)]
When matching against runas_default use userpw_matches() instead
of just strcasecmp().

8 years agoSet RUNAS_USER_SPECIFIED when -u is specified and/or RUNAS_GROUP_SPECIFIED
Todd C. Miller [Thu, 15 Sep 2016 19:16:38 +0000 (13:16 -0600)]
Set RUNAS_USER_SPECIFIED when -u is specified and/or RUNAS_GROUP_SPECIFIED
when -g is specified.

8 years agoFix printing of the default runas user when a RunAsGroup is specified
Todd C. Miller [Thu, 15 Sep 2016 17:29:27 +0000 (11:29 -0600)]
Fix printing of the default runas user when a RunAsGroup is specified
but no RunAsUser is present.

8 years agoOnly match against runas_default if both sudoRunAsUser and
Todd C. Miller [Thu, 15 Sep 2016 16:46:57 +0000 (10:46 -0600)]
Only match against runas_default if both sudoRunAsUser and
sudoRunAsGroup are missing.

8 years agorunas_pw can no longer be NULL here
Todd C. Miller [Thu, 15 Sep 2016 15:40:41 +0000 (09:40 -0600)]
runas_pw can no longer be NULL here

8 years agoUpdate check for whether or not the runas user was set in the ldap
Todd C. Miller [Thu, 15 Sep 2016 15:37:53 +0000 (09:37 -0600)]
Update check for whether or not the runas user was set in the ldap
and sssd backends to match the sudoers file backend.  Introduces
the runas_user_set() macro to improve readability.  Previously,
runas_pw was set late, now it is set before checking sudoers.

8 years agoDocument that negated sudoHosts are only supported by 1.8.18 and higher.
Todd C. Miller [Thu, 15 Sep 2016 14:36:08 +0000 (08:36 -0600)]
Document that negated sudoHosts are only supported by 1.8.18 and higher.

8 years agoDisable Address Sanitizer leak detection for tests which generate
Todd C. Miller [Thu, 15 Sep 2016 14:33:01 +0000 (08:33 -0600)]
Disable Address Sanitizer leak detection for tests which generate
parse errors.  The parser leaks a bit on error.

8 years agoFix underflow in get_ipa_hostname() when trimming trailing
Todd C. Miller [Thu, 15 Sep 2016 11:54:53 +0000 (05:54 -0600)]
Fix underflow in get_ipa_hostname() when trimming trailing
whitespace.

8 years agoDocument negated sudoHost entries.
Todd C. Miller [Wed, 14 Sep 2016 16:33:38 +0000 (10:33 -0600)]
Document negated sudoHost entries.

8 years agoSupport negated sudoHost entries.
Todd C. Miller [Wed, 14 Sep 2016 16:33:27 +0000 (10:33 -0600)]
Support negated sudoHost entries.

8 years agoDocument negated sudoHost entries.
Todd C. Miller [Wed, 14 Sep 2016 16:29:18 +0000 (10:29 -0600)]
Document negated sudoHost entries.

8 years agoSupport negated sudoHost entries.
Todd C. Miller [Wed, 14 Sep 2016 16:22:52 +0000 (10:22 -0600)]
Support negated sudoHost entries.

8 years agoDon't check the username when matching a host netgroup unless
Todd C. Miller [Tue, 13 Sep 2016 15:12:42 +0000 (09:12 -0600)]
Don't check the username when matching a host netgroup unless
def_netgroup_tuple is enabled.

8 years agoMove valid domain name check into a new valid_domain() function.
Todd C. Miller [Tue, 13 Sep 2016 15:06:25 +0000 (09:06 -0600)]
Move valid domain name check into a new valid_domain() function.
Fix memory leak if getdomainname(2) fails and avoid using heap
garbage for the domain name matching in this case.

8 years agosync with translationproject.org
Todd C. Miller [Mon, 12 Sep 2016 20:59:22 +0000 (14:59 -0600)]
sync with translationproject.org

8 years agoAdd back line mistakenly removed in 0cf2a9351740
Todd C. Miller [Sun, 11 Sep 2016 20:37:42 +0000 (14:37 -0600)]
Add back line mistakenly removed in 0cf2a9351740

8 years agosync with translationproject.org
Todd C. Miller [Sun, 11 Sep 2016 13:50:12 +0000 (07:50 -0600)]
sync with translationproject.org

8 years agoBug #757
Todd C. Miller [Fri, 9 Sep 2016 22:29:37 +0000 (16:29 -0600)]
Bug #757

8 years agoFix typo that broke short host name matching when the fqdn
Todd C. Miller [Fri, 9 Sep 2016 22:26:22 +0000 (16:26 -0600)]
Fix typo that broke short host name matching when the fqdn
flag is enabled.  Bug #757

8 years agoBe consistent with the naming of the variable used to store the
Todd C. Miller [Thu, 8 Sep 2016 22:38:08 +0000 (16:38 -0600)]
Be consistent with the naming of the variable used to store the
function return value.  Previously, some code used "rval", some
used "ret".  This standardizes on "ret" and uses "rc" for temporary
return codes.

8 years agosync with translationproject.org
Todd C. Miller [Wed, 7 Sep 2016 17:08:12 +0000 (11:08 -0600)]
sync with translationproject.org

8 years agoNorwegian Nynorsk translation of sudo from translationproject.org
Todd C. Miller [Wed, 7 Sep 2016 17:07:59 +0000 (11:07 -0600)]
Norwegian Nynorsk translation of sudo from translationproject.org

8 years agoFix for Bug #756
Todd C. Miller [Wed, 7 Sep 2016 17:02:25 +0000 (11:02 -0600)]
Fix for Bug #756

8 years agoIn sudoers_main() avoid setting rval prematurely. Prevents a crash
Todd C. Miller [Tue, 6 Sep 2016 01:44:46 +0000 (19:44 -0600)]
In sudoers_main() avoid setting rval prematurely.  Prevents a crash
when auditing fails after successfully authenticating.  Bug #756

8 years agoApply match_group_by_gid early.
Todd C. Miller [Mon, 5 Sep 2016 12:21:23 +0000 (06:21 -0600)]
Apply match_group_by_gid early.

8 years agoupdate
Todd C. Miller [Fri, 2 Sep 2016 16:30:35 +0000 (10:30 -0600)]
update

8 years agoDon't disable large file support for Linux, just SVR4-style /proc.
Todd C. Miller [Fri, 2 Sep 2016 14:05:07 +0000 (08:05 -0600)]
Don't disable large file support for Linux, just SVR4-style /proc.
Otherwise, stat(2) may fail on Linux when running a 32-bit sudo
on a 64-bit machine.  Bug #755

8 years agoMake sudo_parseln() flags hex to make it more obvious that they are
Todd C. Miller [Thu, 1 Sep 2016 20:36:24 +0000 (14:36 -0600)]
Make sudo_parseln() flags hex to make it more obvious that they are
bit flags.

8 years agoDon't try to support line continuation in /etc/environment.
Todd C. Miller [Thu, 1 Sep 2016 20:35:40 +0000 (14:35 -0600)]
Don't try to support line continuation in /etc/environment.

8 years agoNo line continuation support in ldap.conf.
Todd C. Miller [Thu, 1 Sep 2016 18:45:42 +0000 (12:45 -0600)]
No line continuation support in ldap.conf.

8 years agoAdd flag to sudo_parseln() to disable line continuation support.
Todd C. Miller [Thu, 1 Sep 2016 16:50:39 +0000 (10:50 -0600)]
Add flag to sudo_parseln() to disable line continuation support.

8 years agoA comment character ('#') is only special at the beginning of the
Todd C. Miller [Thu, 1 Sep 2016 15:28:40 +0000 (09:28 -0600)]
A comment character ('#') is only special at the beginning of the
line.

8 years agoAdd a flags option to sudo_parseln() and a flag to only mach comments
Todd C. Miller [Thu, 1 Sep 2016 15:19:20 +0000 (09:19 -0600)]
Add a flags option to sudo_parseln() and a flag to only mach comments
at the beginning of the line.  Use the flag when parsing ldap.conf.

8 years agoIf get_process_ttyname() fails for errno != ENOENT, just warn
Todd C. Miller [Thu, 1 Sep 2016 14:23:19 +0000 (08:23 -0600)]
If get_process_ttyname() fails for errno != ENOENT, just warn
instead of making it a fatal error.  Bug #755

8 years agouse strict
Todd C. Miller [Wed, 31 Aug 2016 20:33:24 +0000 (14:33 -0600)]
use strict

8 years agoDefine def_foo in terms of the I_FOO index instead of a bare number.
Todd C. Miller [Wed, 31 Aug 2016 20:27:40 +0000 (14:27 -0600)]
Define def_foo in terms of the I_FOO index instead of a bare number.

8 years agosync with translationproject.org
Todd C. Miller [Wed, 31 Aug 2016 18:31:27 +0000 (12:31 -0600)]
sync with translationproject.org

8 years agoMention that match_group_by_gid has no effect when sudoers is stored
Todd C. Miller [Wed, 31 Aug 2016 18:29:54 +0000 (12:29 -0600)]
Mention that match_group_by_gid has no effect when sudoers is stored
in LDAP.

8 years agoUse W_EXITCODE to construct the wait status if sudo could not execute
Todd C. Miller [Wed, 31 Aug 2016 14:39:26 +0000 (08:39 -0600)]
Use W_EXITCODE to construct the wait status if sudo could not execute
the command.  Fixes the sudo exit value for exec(3) failure.

8 years agofix brace style
Todd C. Miller [Wed, 31 Aug 2016 14:34:07 +0000 (08:34 -0600)]
fix brace style

8 years agoregen
Todd C. Miller [Wed, 31 Aug 2016 11:50:18 +0000 (05:50 -0600)]
regen

8 years agoIt is possible for get_user_info() to fail for reasons other than
Todd C. Miller [Wed, 31 Aug 2016 11:47:36 +0000 (05:47 -0600)]
It is possible for get_user_info() to fail for reasons other than
ENOMEM so print the warning message there rather than in main().

8 years agomatch_group_by_gid is only available in sudo 1.8.18 and above
Todd C. Miller [Tue, 30 Aug 2016 20:37:57 +0000 (14:37 -0600)]
match_group_by_gid is only available in sudo 1.8.18 and above

8 years agoMention match_group_by_gid
Todd C. Miller [Tue, 30 Aug 2016 20:37:11 +0000 (14:37 -0600)]
Mention match_group_by_gid

8 years agoDocument match_group_by_gid
Todd C. Miller [Tue, 30 Aug 2016 20:35:16 +0000 (14:35 -0600)]
Document match_group_by_gid

8 years agoAdd match_group_by_gid Defaults option to allow sites with slow
Todd C. Miller [Tue, 30 Aug 2016 19:42:42 +0000 (13:42 -0600)]
Add match_group_by_gid Defaults option to allow sites with slow
group lookups and a small number of groups in sudoers to match
groups by group ID instead of by group name.

8 years agoMention "sudo -l command" bug fix.
Todd C. Miller [Mon, 29 Aug 2016 16:42:17 +0000 (10:42 -0600)]
Mention "sudo -l command" bug fix.

8 years agoFix "sudo -l command" in the LDAP and SSS backends when the command
Todd C. Miller [Mon, 29 Aug 2016 16:04:24 +0000 (10:04 -0600)]
Fix "sudo -l command" in the LDAP and SSS backends when the command
is not allowed.

8 years agoUse sudo_strsplit() instead of doing the equivalent manually.
Todd C. Miller [Fri, 26 Aug 2016 17:07:19 +0000 (11:07 -0600)]
Use sudo_strsplit() instead of doing the equivalent manually.

8 years agoMove SIGPIPE bug fix to 1.8.18 where it belongs
Todd C. Miller [Thu, 25 Aug 2016 19:24:03 +0000 (13:24 -0600)]
Move SIGPIPE bug fix to 1.8.18 where it belongs

8 years agoFix memset size typo in previous commit.
Todd C. Miller [Thu, 25 Aug 2016 16:36:53 +0000 (10:36 -0600)]
Fix memset size typo in previous commit.

8 years agoAdd regress for check_defaults() use-after-free bug.
Todd C. Miller [Thu, 25 Aug 2016 14:33:07 +0000 (08:33 -0600)]
Add regress for check_defaults() use-after-free bug.

8 years agoFix use-after-free in check_defaults(), reported by Radovan Sroka
Todd C. Miller [Thu, 25 Aug 2016 14:32:45 +0000 (08:32 -0600)]
Fix use-after-free in check_defaults(), reported by Radovan Sroka
of RedHat.

8 years agoSIGPIPE bug fix
Todd C. Miller [Wed, 24 Aug 2016 15:01:28 +0000 (09:01 -0600)]
SIGPIPE bug fix

8 years agoNow that we ignore SIGPIPE in sudo we need to restore it at exec
Todd C. Miller [Wed, 24 Aug 2016 14:59:37 +0000 (08:59 -0600)]
Now that we ignore SIGPIPE in sudo we need to restore it at exec
time.  Problem reported by Radovan Sroka of RedHat.

8 years agoFix appending to make_opts
Todd C. Miller [Mon, 22 Aug 2016 13:13:02 +0000 (07:13 -0600)]
Fix appending to make_opts

8 years agoAdd Bug #753 and fix reference to Bug #752.
Todd C. Miller [Mon, 22 Aug 2016 12:32:54 +0000 (06:32 -0600)]
Add Bug #753 and fix reference to Bug #752.

8 years agosync with translationproject.org
Todd C. Miller [Mon, 22 Aug 2016 01:23:52 +0000 (19:23 -0600)]
sync with translationproject.org

8 years agoregen pot files
Todd C. Miller [Sun, 21 Aug 2016 20:10:56 +0000 (14:10 -0600)]
regen pot files

8 years agoUpdate with logging changes.
Todd C. Miller [Wed, 17 Aug 2016 21:23:33 +0000 (15:23 -0600)]
Update with logging changes.

8 years agoAvoid duplicate warnings when we cannot write to the log file.
Todd C. Miller [Wed, 17 Aug 2016 20:51:20 +0000 (14:51 -0600)]
Avoid duplicate warnings when we cannot write to the log file.
Also send the warning in mail if possible.

8 years agoMove the ignoring of I/O log plugin errors into the I/O log plugin
Todd C. Miller [Wed, 17 Aug 2016 20:38:00 +0000 (14:38 -0600)]
Move the ignoring of I/O log plugin errors into the I/O log plugin
itself.

8 years agoMake the behavior when we cannot write to a log or audit file
Todd C. Miller [Wed, 17 Aug 2016 13:22:51 +0000 (07:22 -0600)]
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

8 years agoMake sure we print an error message to stderr (and not just send
Todd C. Miller [Mon, 15 Aug 2016 13:25:18 +0000 (07:25 -0600)]
Make sure we print an error message to stderr (and not just send
mail) if do_logfile() fails.  Bug #751

8 years agoSeparate out the supplemental group ID checks from the supplemental
Todd C. Miller [Sun, 14 Aug 2016 03:12:22 +0000 (21:12 -0600)]
Separate out the supplemental group ID checks from the supplemental
group name checks in user_in_group().  We now call sudo_get_gidlist()
only when the group name in sudoers begins with a '#' (which is
seldom used).

8 years agoCache the user's group IDs and group names separately and only
Todd C. Miller [Sat, 13 Aug 2016 22:27:44 +0000 (16:27 -0600)]
Cache the user's group IDs and group names separately and only
resolve group IDs -> names when needed.  If the sudoers file doesn't
contain groups we will no longer try to resolve all the user's group
IDs to names, which can be expensive on some systems.

8 years agoRemove the "op" parameter from all the store_foo() functions except
Todd C. Miller [Fri, 12 Aug 2016 22:41:51 +0000 (16:41 -0600)]
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).

8 years agoFlags always have a NULL value. Regression introduced by refactor
Todd C. Miller [Fri, 12 Aug 2016 21:03:54 +0000 (15:03 -0600)]
Flags always have a NULL value.  Regression introduced by refactor
of set_default_entry().

8 years agoSet rc to true when setting a flag Defaults value.
Todd C. Miller [Fri, 12 Aug 2016 17:32:36 +0000 (11:32 -0600)]
Set rc to true when setting a flag Defaults value.

8 years agosuppress a cppcheck false positive
Todd C. Miller [Fri, 12 Aug 2016 17:11:49 +0000 (11:11 -0600)]
suppress a cppcheck false positive

8 years agoRefactor the error parts of set_default_entry() so the switch() is
Todd C. Miller [Fri, 12 Aug 2016 16:37:41 +0000 (10:37 -0600)]
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.

8 years agoIn set_default_entry() check for unsupported Defaults type.
Todd C. Miller [Fri, 12 Aug 2016 15:37:11 +0000 (09:37 -0600)]
In set_default_entry() check for unsupported Defaults type.

8 years agoAdd missing break in switch that sets the max limit for RLIMIT_NOFILE.
Todd C. Miller [Fri, 12 Aug 2016 15:24:41 +0000 (09:24 -0600)]
Add missing break in switch that sets the max limit for RLIMIT_NOFILE.
Found by cppcheck.

8 years agoCheck sudoers_initlocale return value and treat as oom.
Todd C. Miller [Fri, 12 Aug 2016 12:00:17 +0000 (06:00 -0600)]
Check sudoers_initlocale return value and treat as oom.
Coverity CID 141832

8 years agoSet runas_pw early and adjust runaslist_matches() to deal. Since
Todd C. Miller [Wed, 10 Aug 2016 16:56:05 +0000 (10:56 -0600)]
Set runas_pw early and adjust runaslist_matches() to deal.  Since
we now set runas_default early there is no need to call update_defaults
with SETDEF_RUNAS after sudoers has been parsed.

8 years agoLoad sudoers group plugin via an early callback.
Todd C. Miller [Tue, 9 Aug 2016 19:14:31 +0000 (13:14 -0600)]
Load sudoers group plugin via an early callback.

8 years agoSystem Integrity Protection on Mac OS X won't allow us to write
Todd C. Miller [Tue, 9 Aug 2016 18:35:08 +0000 (12:35 -0600)]
System Integrity Protection on Mac OS X won't allow us to write
directly to /etc or /var.  We must install in /private/{etc,var}
instead.

8 years agoDocument that fqdn, runas_default and sudoers_locale are parsed early.
Todd C. Miller [Tue, 9 Aug 2016 16:26:02 +0000 (10:26 -0600)]
Document that fqdn, runas_default and sudoers_locale are parsed early.

8 years agoRegen for 1.8.18
Todd C. Miller [Tue, 9 Aug 2016 16:25:50 +0000 (10:25 -0600)]
Regen for 1.8.18

8 years agoAvoid passing around struct defaults when it is not needed. As a
Todd C. Miller [Tue, 9 Aug 2016 02:09:59 +0000 (20:09 -0600)]
Avoid passing around struct defaults when it is not needed.  As a
result, we no longer need to include gram.h in the LDAP and SSSD
backends.