Commit Graph

28 Commits

Author SHA1 Message Date
Todd C. Miller
3bb69ffe81 Remove CVS $Sudo$ tags. 2010-01-17 19:51:28 -05:00
Todd C. Miller
d20335136b Better split of membership vs. traditional group check in user_in_group().
Allow user_ngroups to be < 0 if getgroups() fails.
2009-12-13 22:24:34 +00:00
Todd C. Miller
0d054f897d Fix pasto and add default return value. 2009-12-12 16:27:02 +00:00
Todd C. Miller
ab72e242ba refactor group member checking into user_in_group() 2009-12-12 16:12:26 +00:00
Todd C. Miller
e56d4af8fd Remove my_* redirection in pwutil.c for testsudoers and just use the normal
libc get{pw,gr}* names.
2009-09-19 19:13:10 +00:00
Todd C. Miller
62b89f9dfc Update copyright years. 2009-05-25 12:02:42 +00:00
Todd C. Miller
03f4a2e703 Only cache by the method we fetched for pwd and grp lookups. Previously
we cached both by namd and id but this can cause problems for entries
that share the same id.  Also add more info in the error message in case
the insert fails (which should now be impossible).
2009-05-08 17:07:10 +00:00
Todd C. Miller
840acbd3ac Update copyright years. 2008-11-09 14:13:13 +00:00
Todd C. Miller
3cb9d538f9 use zero_bytes() instead of memset() for consistency 2008-11-02 14:51:16 +00:00
Todd C. Miller
e439faeeb4 Flesh out the fake passwd entry used for running commands as a uid not
listed in the passwd database.  Fixes an issue with some PAM modules.
2008-07-02 10:27:57 +00:00
Todd C. Miller
82ba4c72e9 Add #ifdef PURITY 2008-03-31 15:24:28 +00:00
Todd C. Miller
2a5a01c22d When copying gr_mem we must guarantee that the storage space for
gr_mem is properly aligned.  The simplest way to do this is to
simply store gr_mem directly after struct group.  This is not a
problem for gr_passwd or gr_name as they are simple strings.
2008-01-18 22:32:52 +00:00
Todd C. Miller
f9f4aca556 Add support for runas groups. This allows the user to run a command
with a different effective group.  If the -g option is specified
without -u the command will be run as the current user (only the
group will change).  the -g and -u options may be used together.
TODO: implement runas group for ldap
      improve runas group documentation
      add testsudoers support
2007-11-21 20:12:00 +00:00
Todd C. Miller
19fa259480 Remove support for compilers that don't support void * 2007-08-31 23:30:07 +00:00
Todd C. Miller
51d61f148f Don't declare pw_free() if we are not going to use it. 2007-01-31 15:02:24 +00:00
Todd C. Miller
5994797e4d pw_free() is only used by sudo_freepwcache() so ifdef it out too. 2006-08-17 15:25:07 +00:00
Todd C. Miller
884b70acc9 Move password/group cache cleaning out of sudo_end{pw,grp}ent() so
we can close the passwd/group files early.
2006-07-31 17:51:44 +00:00
Todd C. Miller
06a11acf14 Use macros where possible for sudo_grdup() like sudo_pwdup(). 2005-04-10 17:32:42 +00:00
Todd C. Miller
304dc46d7f Add efree() for consistency with emalloc() et al. Allows us to rely
on C89 behavior (free(NULL) is valid) even on K&R.
2005-03-29 14:29:47 +00:00
Todd C. Miller
f78ce55170 Sync sudo_pwdup with OpenBSD changes: use macros for size computaton and
string copies.
2005-03-25 17:36:52 +00:00
Todd C. Miller
ca7c435740 Zero old pw_passwd before replacing with version from shadow file. 2005-03-19 03:08:40 +00:00
Todd C. Miller
bb63e0168d Missed piece from rev. 1.6, fix sudo_getpwnam() too. 2005-03-12 17:27:27 +00:00
Todd C. Miller
0ea568c7de Store shadow password after making a local copy of struct passwd in
case normal and shadow routines use the same internal buffer in libc.
2005-03-12 04:42:30 +00:00
Todd C. Miller
543fe6e7d6 Don't try to destroy a tree we didn't create. 2005-02-01 04:03:29 +00:00
Todd C. Miller
3b8b88407f Add __unused to rcsids 2005-01-27 15:42:30 +00:00
Todd C. Miller
7ca844890d Use function pointers to only call private passwd/group routines when
using a nonstandard passwd/group file.
2005-01-09 23:58:21 +00:00
Todd C. Miller
308b6fa118 Move all but the shadow stuff from getspwuid.c to pwutil.c and pwcache_get
and pwcache_put as they are no longer needed.  Also add preprocessor
magic to use private versions of the passwd and group routines if MYPW
is defined (for use by testsudoers).
2005-01-05 19:41:31 +00:00
Todd C. Miller
282c0bf361 Split off pw/gr cache and dup code into its own file.
This allows visudo and testsudoers to use the pw/gr cache too.
2005-01-05 01:07:33 +00:00