Commit Graph

2195 Commits

Author SHA1 Message Date
Todd C. Miller
0d38bef9a7 include strcasecmp() for those without it 1999-08-24 17:37:38 +00:00
Todd C. Miller
1a5da52c7b Use the : operator some more and fix a typo 1999-08-24 16:43:37 +00:00
Todd C. Miller
f4f46ff024 update the history of sudo 1999-08-24 16:43:17 +00:00
Todd C. Miller
8723291d89 CIDR-style netmask support 1999-08-24 16:42:28 +00:00
Todd C. Miller
3781e9d410 recent changes 1999-08-24 16:41:46 +00:00
Todd C. Miller
25d75cea68 these should be generated with byacc, not bison 1999-08-24 16:40:58 +00:00
Todd C. Miller
7b0368f2f4 regen 1999-08-24 16:40:23 +00:00
Todd C. Miller
51350b2c79 In "sudo -l" mode, the type of the stored (expanded) alias was not
stored with the contents.  This could lead to incorrect output
if the sudoers file had different alias types with the same name.
Normal parsing (ie: not in '-l' mode) is unaffected.
1999-08-24 15:58:39 +00:00
Todd C. Miller
ba358d6d51 define _XOPEN_SOURCE to get at crypt() proto on some systems 1999-08-23 16:47:42 +00:00
Todd C. Miller
8b3c8d5c75 fix comment 1999-08-22 17:10:20 +00:00
Todd C. Miller
db4cac1740 don't need limits.h 1999-08-22 17:09:49 +00:00
Todd C. Miller
9d5008bf3c kill bogus reference to vfprintf 1999-08-22 11:36:44 +00:00
Todd C. Miller
c58303644f better examples 1999-08-22 11:26:23 +00:00
Todd C. Miller
5922bfb583 Add some const in the K&R defs. This is safe since we define const away
if the compiler doesn't grok it.
1999-08-22 11:23:09 +00:00
Todd C. Miller
084b426b3b Better test for working long long support. Ultrix compiler supports
basic long long but not all operations on them.
1999-08-22 11:22:06 +00:00
Todd C. Miller
b13e8006ec Add check for LONG_IS_QUAD
#undef MAXINT before including hpsecurity.h to silence an HP-UX warning
Check for U?LONG_LONG_MAX in snprintf.c and use LONG_IS_QUAD
1999-08-22 09:59:28 +00:00
Todd C. Miller
ab0c1eae13 UCB-derived snprintf + asprintf support. Supports quads if the compiler
does.  No floating point yet, perhaps later...
1999-08-21 19:00:53 +00:00
Todd C. Miller
275c2fc980 Run most of the code as root, not the invoking user. It doesn't really
gain us anything to run as the user since an attacker can just have
an setuid(0) in their egg.  Running as root solves potential problems
wrt signalling.
1999-08-20 20:37:16 +00:00
Todd C. Miller
bc65b24ed3 regen 1999-08-20 20:32:07 +00:00
Todd C. Miller
b9746389ce Don't wait for child to finish in log_error(), let the signal handler
get it if we are still running, else let init reap it for us.  The extra
time it takes to wait lets the user know that mail is being sent.

Install SIGCHLD handler in main() and for POSIX signals, block everything
*except* SIGCHLD.
1999-08-19 17:45:36 +00:00
Todd C. Miller
0598093e2c sudoers_lookup() now returns a bitmap instead of an int. This makes it
possible to express things like "failed to validate because user not listed
for this host".  Some thigns that were previously VALIDATE_FOO are now
FLAG_FOO.  This may change later on.

Reorganized code in log_auth() and sudo.c to deal with above changes.

Safer versions of push/pushcp with in the do { ... } while (0) style

parse.yacc now saves info on the stack to allow parse.c to determine
if a user was listed, but not for the host he/she tried to run on.

Added --with-mail-if-no-host option
1999-08-19 16:30:09 +00:00
Todd C. Miller
804e168d90 o NewArgv and NewArgc don't need to be externally visible.
o If pedantic > 1, it is a parse error.
o Add -s (strict) option to visudo which sets pedantic to 2.
1999-08-17 15:29:47 +00:00
Todd C. Miller
1afa5be400 Just have sudo-bugs contact info in one place 1999-08-17 15:26:17 +00:00
Todd C. Miller
b7a10e7403 Add BUGS section 1999-08-17 15:20:48 +00:00
Todd C. Miller
3ad8fe164a Add testsudoers to default build target if --with-devel
Don't clean generated parser files unless "distclean".
1999-08-17 14:29:28 +00:00
Todd C. Miller
b28ac86ab8 In pedantic mode we need to save *all* the aliases, not just those
that match, or we get spurious warnings.
1999-08-17 12:47:53 +00:00
Todd C. Miller
0acdc98f1d reference samples.sylog.conf 1999-08-17 09:32:43 +00:00
Todd C. Miller
1451404baf Sample entries for syslog.conf 1999-08-14 15:50:49 +00:00
Todd C. Miller
2e8eaae774 recent changes 1999-08-14 15:40:58 +00:00
Todd C. Miller
d40947c0b0 In struct sudo_auth, turn need_root and configured into flags and
add a flag to specify an auth method is running alone (the only
one).  Pass auth methods their sudo_auth pointer, not the data
pointer.  This allows us to get at the flags and tell if we are the
only auth method.  That, in turn, allows the method to be able to
decide what should/should not be a fatal error.  Currently only
rfc1938 uses it this way, which allows us to kill the OTP_ONLY
define and te hackery that went with it.  With access to the
sudo_auth struct, methods can also get at a string holding their
cannonical name (useful in error messages).
1999-08-14 15:36:47 +00:00
Todd C. Miller
3a8b0be635 o --with-otp deprecated, use --without-passwd instead
o real dependencies in the Makefile
o --with-devel option to enable yacc, lex, and -Wall
o style -- "foo -> bar" becomes "foo->bar"
o ALL goes back to being a token, not a string but don't leak memory
o rename hsotspec -> host in parse.yacc
1999-08-14 15:34:55 +00:00
Todd C. Miller
c2d088ebe1 recent changes 1999-08-12 16:26:25 +00:00
Todd C. Miller
d7ebfe06d1 o Digital UNIX needs to check for *snprintf() before -ldb is added to LIBS
since -ldb includes a bogus snprintf().
o Add forward refs for struct mbuf and struct rtentry for Digital UNIX.
o Reorder some functions in snprintf.c to fix -Wall
o Add missing includes to fix more -Wall
1999-08-12 16:24:10 +00:00
Todd C. Miller
2386dc1b45 o Add a "pedentic" flag to the parser. This makes sudo warn in cases
where an alias may be used before it is defined.  Only turned on for visudo
and testsudoers.
o Add --disable-authentication option that makes sudo not require
authentication by default.  The PASSWD tag can be used to require
authentication for an entry.  We no longer overload --without-passwd.
1999-08-12 14:37:27 +00:00
Todd C. Miller
f14dd25b01 Break 'WORD' regexp def into HOSTNAME and USERNAME. These days a
username can contain just about anything so be very permissive.
Also drop the unused \. punctuation.
1999-08-12 14:29:12 +00:00
Todd C. Miller
2ce523cd1f o add a 'val' element to aliasinfo struct and move -> parse.h
o find_alias() now returns an aliasinfo * instead of boolean
o add_alias() now takes a value parameter to store in the aliasinfo.val
o The cmnd, hostspec, runasuser, and user rules now return:
1) positive match
0) negative match (due to '!')
-1) no match
This means setting $$ explicitly in all cases, which I should have done in
the first place.  It also means that we always store a value that is != -1
and when we see a '!' we can set *_matches to !rv if rv != -1.
The upshot of all of this is that '!' now works the way it should in
lists and some of the rules are more uniform and sensible.
1999-08-09 22:25:17 +00:00
Todd C. Miller
518eec0abb add parse.h dependency 1999-08-09 22:17:27 +00:00
Todd C. Miller
b18495e627 kill unused *_matched macros 1999-08-09 22:17:05 +00:00
Todd C. Miller
76c801a685 Allow a list of users as the first thing in a user spec, not just a
single entry.  This makes things more uniform, though it does allow
you to write user specs that are hard to read.
1999-08-09 14:35:53 +00:00
Todd C. Miller
b4a7c5507a parse.yacc 1999-08-09 14:34:23 +00:00
Todd C. Miller
d2dcea30cb regen 1999-08-09 14:08:19 +00:00
Todd C. Miller
7bb2d52e95 fix check for crypt() in libufc 1999-08-09 14:08:03 +00:00
Todd C. Miller
609851d851 sudo-users list now exists 1999-08-07 18:03:19 +00:00
Todd C. Miller
be4e87f666 Update to reality. 1999-08-07 11:46:39 +00:00
Todd C. Miller
76148d5316 o Move lock_file() and touch() into fileops.c so visudo can use them
o Visudo now locks the sudoers temp file instead of bailing when
the temp file already exists.  This fixes the problem of stale
temp files but it does *require* that you not try to put the
temp file in a world-writable directory.  This shoud not be
an issue as the temp file should live in the same dir as sudoers.
o Visudo now only installs the temp file as sudoers if it changed.
1999-08-07 09:59:43 +00:00
Todd C. Miller
68a2b16781 add fcntl locking 1999-08-06 13:49:26 +00:00
Todd C. Miller
925f4eabc2 Lock the log file. 1999-08-06 13:33:03 +00:00
Todd C. Miller
145992dce2 o /etc/stmp -> /etc/sudoers.tmp since solaris uses stmp as shadow temp file
o _PATH_SUDO_SUDOERS -> _PATH_SUDOERS and _PATH_SUDO_STMP -> _PATH_SUDOERS_TMP
1999-08-06 09:37:03 +00:00
Todd C. Miller
7c53b74961 o Kill *_MESSAGE and replace with NO_LECTURE
o Add more things to root sudo -V config reporting
1999-08-05 21:38:19 +00:00
Todd C. Miller
61dc1ddf61 aix_auth.o not authenticate.o 1999-08-05 14:56:07 +00:00