Todd C. Miller
b743b77a0d
Better warning message on setuid() failure for the setreuid()
...
version of set_perms().
2011-10-04 11:13:28 -04:00
Todd C. Miller
d81c14005f
Silence compiler warnings on Solaris with gcc 3.4.3
2011-08-23 16:42:18 -04:00
Todd C. Miller
4f9a93f658
Fix some potential problems found by the clang static analyzer,
...
none serious.
2011-07-28 10:59:37 -04:00
Todd C. Miller
1f9fb7609f
Fix two PERM_INITIAL cases that were still using user_gids.
2011-07-22 15:13:35 -04:00
Todd C. Miller
022591f4bf
Add a wrapper for setgroups() that trims off extra groups and retries
...
if setgroups() fails. Also add some missing addrefs for PERM_USER
and PERM_FULL_USER.
2011-07-20 16:54:12 -04:00
Todd C. Miller
b124635b04
Instead of keeping separate groups and gids arrays, create struct
...
group_info and use it to store both, along with a count for each.
Cache group info on a per-user basis using getgrouplist() to get
the groups. We no longer need special to special case the user or
list user for user_in_group() and thus no longer need to reset the
groups list when listing another user.
2011-07-20 11:58:45 -04:00
Todd C. Miller
37873051a8
Make error strings translatable.
2011-07-13 16:50:25 -04:00
Todd C. Miller
56321ec778
Resolve the list of gids passed in from the sudo frontend (the
...
result of getgroups()) to names and store both the group names and
ids in the sudo_user struct. When matching groups in the sudoers
file, match based on the names in the groups list first and
only do a gid-based match when we absolutely have to. By matching
on the group name (as it is listed in sudoers) instead of id
(which we would have to resolve) we save a lot of group lookups
for sudoers files with a lot of groups in them.
2011-07-01 14:13:47 -04:00
Todd C. Miller
6f8cd91928
can't -> "unable to" in warning/error messages
2011-05-18 12:36:26 -04:00
Todd C. Miller
b643b190a7
Prepare sudoers module messages for translation.
2011-05-16 16:32:05 -04:00
Todd C. Miller
7c35601cf3
Be explicit when setting euid to 0 before call to setreuid(0, 0)
2011-04-23 06:13:48 -04:00
Todd C. Miller
b08ad6083b
Work around weird AIX saved uid semantics on setuid() and setreuid().
...
On AIX, setuid() will only set the saved uid if the euid is already 0.
2011-04-15 12:30:08 -04:00
Todd C. Miller
53da5e8cdf
Update copyright years.
2011-03-11 15:34:35 -05:00
Todd C. Miller
6bea3f524e
Fix running commands as non-root on systems where setreuid() changes
...
the saved uid based on the effective uid we are changing to.
2011-03-11 10:48:12 -05:00
Todd C. Miller
47968912a2
Fix passing of login class back to sudo front end.
2011-03-07 16:55:08 -05:00
Todd C. Miller
3c0672e2e3
Allow sudoers file name, mode, uid and gid to be specified in the
...
settings list. The sudo front end does not currently set these
but may in the future.
2011-02-23 13:38:52 -05:00
Todd C. Miller
ae2f7638f5
standardize on "return foo;" rather than "return(foo);" or "return (foo);"
2011-01-24 15:15:18 -05:00
Todd C. Miller
94de54b19d
If runas_pw changes, reset the stashed runas aux group vector.
...
Otherwise, if runas_default is set in a per-command Defaults statement,
the command runs with root's aux group vector (i.e. the one that
was used when locating the command).
2010-08-26 11:40:04 -04:00
Todd C. Miller
e6b48d415c
Replace built-in non-unix group support with a sudoers group plugin.
...
Include a sample plugin that can read Unix-format group files.
2010-07-02 11:11:25 -04:00
Todd C. Miller
30fe4a067c
Set usrinfo for AIX
...
Set adminstrative domain for the process when looking up user's
password or group info and when preparing for execve().
Include strings.h even if string.h exists since they may define
different things. Fixes warnings on AIX and others.
2010-06-29 13:08:05 -04:00
Todd C. Miller
27be96c9cd
Add open/close session to sudo auth, only used by PAM.
...
This allows us to open (and close) the PAM session from sudoers.
2010-05-26 17:57:47 -04:00
Todd C. Miller
fdd28d411f
Work in progress support for sudoedit. The actual interface used by the
...
plugin for sudoedit is likely to change.
2010-05-13 14:09:21 -04:00
Todd C. Miller
f38afc9779
Add separate test for getresuid() since HP-UX has setresuid() but no
...
getresuid().
2010-05-11 10:55:59 -04:00
Todd C. Miller
1bb9f62143
Convert perm setting to push/pop model; still needs some work
...
Use the stashed runas groups instead of using getgrouplist()
Reset perms to the initial value on error
2010-04-20 17:00:31 -04:00
Todd C. Miller
0d2524e68e
Fix set/restore perms for systems w/o setresuid
2010-04-11 16:38:42 -04:00
Todd C. Miller
744eae82e7
Primitive set/restore permissions. Will be replaced by a push/pop
...
model.
2010-04-10 10:34:37 -04:00
Todd C. Miller
05e8023e78
Add back io logging (transcript) support. Currently, the open function
...
runs too early and it is not possible to use the io module independently
of the policy module.
2010-03-27 20:19:40 -04:00
Todd C. Miller
681c6faf3e
Comment out dead code; will be removed when set_perms is rewritten.
2010-03-27 09:12:48 -04:00
Todd C. Miller
d5ae4c7d87
Kill __P in sudoers
2010-03-17 19:56:27 -04:00
Todd C. Miller
9b0205846b
Initial bits of sudoers plugin; still needs work.
2010-03-14 19:58:47 -04:00
Todd C. Miller
e90fa482f9
Rework source layout in preparation for modular sudo.
2010-02-20 09:14:01 -05:00