Commit Graph

3651 Commits

Author SHA1 Message Date
Todd C. Miller
f261a99f22 In -l mode, only check local sudoers file if def_ignore_sudoers is not set
and call LDAP versions from display_privs() and display_cmnd() instead
of directly from main().  Because of this we need to defer closing
the ldap connection until after -l processing has ocurred and we
must pass in the ldap pointer to display_privs() and display_cmnd().
2005-04-12 01:37:08 +00:00
Todd C. Miller
fe4f33ab94 Reorganize LDAP code to better match normal sudoers parsing. Instead
of storing strings for later printing in -l mode we do another query
since the authenticating user and the user being listed may not be
the same (the new -U flag).  Also add support for "sudo -l command".

There is still a fair bit if duplicated code that can probably
be refactored.
2005-04-12 01:33:23 +00:00
Todd C. Miller
b8cbf50a38 Replace pass variable with do_netgr for better readability. 2005-04-11 04:37:49 +00:00
Todd C. Miller
3f84e1b18d use DPRINTF macro 2005-04-11 03:49:46 +00:00
Todd C. Miller
f1d67a9b34 estrdup, not strdup 2005-04-11 03:18:38 +00:00
Todd C. Miller
d0df82a93a Add macro to test if the tag changed to improve readability. 2005-04-10 21:44:27 +00:00
Todd C. Miller
ce7708e09a Avoid printing defaults header if there are no defaults to print... 2005-04-10 21:40:41 +00:00
Todd C. Miller
132a799457 Fix a warning on systems without strlcpy(). 2005-04-10 19:29:45 +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
f057686d20 It is possible for tv_usec to hold >= 1000000 usecs so add in tv_usec / 1000000. 2005-04-08 21:04:22 +00:00
Todd C. Miller
d857334e61 The component in krb5_principal_get_comp_string() should be 1, not 0
for Heimdal.  From Alex Plotnick.
2005-03-30 04:38:25 +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
9efe91fa1e Move initgroups() for -U option into display_privs() so group matching
in sudoers works correctly.
2005-03-29 03:33:05 +00:00
Todd C. Miller
e3c99d9c84 Removed duplicate call to ldap_unbind_s introduced along with sudo_ldap_close. 2005-03-27 02:34:25 +00:00
Todd C. Miller
61413ca509 Add missing space in Defaults printing 2005-03-27 01:01:02 +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
6666ca23d4 Only attempt shadow password detection if PAM is not being used
Add shadow_* variables to make shadow password detection more generic.
2005-03-19 03:07:27 +00:00
Todd C. Miller
0a795b83dd Use OSDEFS for os-specific -D_FOO_BAR stuff rather than CPPFLAGS 2005-03-19 02:46:16 +00:00
Todd C. Miller
244eae916f use a non-breaking space to avoid a double space after e.g. 2005-03-13 00:27:05 +00:00
Todd C. Miller
963ca5045d commna, not colon after e.g. 2005-03-13 00:26:33 +00:00
Todd C. Miller
00bea5e742 Add __ variants of the exec functions. GNU libc at least uses __execve()
internally.
2005-03-12 23:43:40 +00:00
Todd C. Miller
5a7ab7e637 Match reality a bit more. 2005-03-12 17:29:00 +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
e7dcda7920 Make varargs usage consistent with the rest of the code. 2005-03-11 01:57:44 +00:00
Todd C. Miller
7362b7e981 Wrap more of the exec family since on Linux the others do not appear
to go through the normal execve() path.
2005-03-10 15:09:28 +00:00
Todd C. Miller
d4b7457596 make print_unused static like proto says 2005-03-10 14:57:17 +00:00
Todd C. Miller
b980f95883 silence a warning on K&R systems 2005-03-10 14:55:12 +00:00
Todd C. Miller
40b899b10c make this build in K&R land 2005-03-10 14:53:04 +00:00
Todd C. Miller
f35ff3e327 make this build in K&R land 2005-03-10 14:51:48 +00:00
Todd C. Miller
5e060faa34 regen 2005-03-08 03:21:28 +00:00
Todd C. Miller
ddb8c3d7df return(foo) not return foo
optimize _atobool() slightly
2005-03-06 03:46:52 +00:00
Todd C. Miller
474768bd5f Use TRUE/FALSE 2005-03-06 03:40:18 +00:00
Todd C. Miller
3154a75b8e Reformat to match the rest of sudo's code. 2005-03-06 03:31:58 +00:00
Todd C. Miller
abc10fd9a6 I am the primary author 2005-03-06 00:33:18 +00:00
Todd C. Miller
b5e92527cc The RUNSON file is toast--it confused too many people and really isn't
needed in a configure-oriented world.
2005-02-23 03:29:40 +00:00
Todd C. Miller
33d0e51281 alternate -> alternative 2005-02-23 03:28:13 +00:00
Todd C. Miller
7facbeeed7 Use TCSADRAIN instead of TCSAFLUSH since some OSes have issues with TCSAFLUSH. 2005-02-23 03:26:50 +00:00
Todd C. Miller
470a4b549d Allow leading blanks before Defaults and Foo_Alias definitions 2005-02-23 03:16:06 +00:00
Todd C. Miller
444b6fbf8e fix rules to build toke.o and gram.o in devel mode 2005-02-23 03:14:03 +00:00
Todd C. Miller
9805bdd7f6 env_keep overrides set_logname 2005-02-20 18:00:24 +00:00
Todd C. Miller
2791a18078 Fix disabling set_logname and make env_keep override set_logname. 2005-02-20 17:57:48 +00:00
Todd C. Miller
c2f6b93ada No longer need memmove() 2005-02-20 17:28:25 +00:00
Todd C. Miller
6bee8e3770 Just clean the environment once. This assumes that any further
setenv/putenv will be able to handle the fact that we replaced environ
with our own malloc'd copy but all the implementations I've checked do.
2005-02-20 16:48:05 +00:00
Todd C. Miller
87a8b5b48b In -i mode, base the value of insert_env()'s dupcheck flag on DID_FOO flags.
Move checks for $HOME resetting into rebuild_env()
2005-02-16 04:16:22 +00:00
Todd C. Miller
74894ebf62 Move setting of user_path, user_shell, user_prompt and prev_user
into init_vars() since user_shell at least is needed there.
2005-02-13 05:33:59 +00:00
Todd C. Miller
e2a517d88d fix devel builds 2005-02-12 23:51:43 +00:00
Todd C. Miller
b7068a4138 Fix some printf format mismatches on error. 2005-02-12 23:48:46 +00:00
Todd C. Miller
cc84c41fbe Fix some printf format mismatches on error. 2005-02-12 23:46:13 +00:00