Add support for tuples in def_data.in; these are implemented as an

enum type.  Currently there is only a single tuple enum but in the
future we may have one tuple enum per T_TUPLE entry in def_data.in.
Currently listpw, verifypw and lecture are tuples.  This avoids the
need to have two entries (one ival, one str) for pwflags and syslog
values.

lecture is now a tuple with the following values: never, once, always

We no longer use both an int and string entry for syslog facilities
and priorities.  Instead, there are logfac2str() and logpri2str()
functions that get used when we need to print the string values.
This commit is contained in:
Todd C. Miller
2003-12-30 22:31:30 +00:00
parent 6ad252765b
commit 02f37dc2da
11 changed files with 444 additions and 390 deletions

8
sudo.c
View File

@@ -235,7 +235,7 @@ main(argc, argv, envp)
break;
case MODE_VALIDATE:
user_cmnd = "validate";
pwflag = I_VERIFYPW_I;
pwflag = I_VERIFYPW;
break;
case MODE_KILL:
case MODE_INVALIDATE:
@@ -248,7 +248,7 @@ main(argc, argv, envp)
break;
case MODE_LIST:
user_cmnd = "list";
pwflag = I_LISTPW_I;
pwflag = I_LISTPW;
printmatches = 1;
break;
}
@@ -355,9 +355,9 @@ main(argc, argv, envp)
/* Fill in passwd struct based on user we are authenticating as. */
auth_pw = get_authpw();
/* Require a password unless the NOPASS tag was set. */
/* Require a password if sudoers says so. */
if (!(validated & FLAG_NOPASS))
check_user();
check_user(validated & FLAG_CHECK_USER);
/* Build up custom environment that avoids any nasty bits. */
new_environ = rebuild_env(sudo_mode, envp);