add SIA support
This commit is contained in:
10
Makefile.in
10
Makefile.in
@@ -98,12 +98,14 @@ SHELL = /bin/sh
|
|||||||
PROGS = @PROGS@
|
PROGS = @PROGS@
|
||||||
|
|
||||||
SRCS = check.c getspwuid.c find_path.c logging.c parse.c sudo.c secureware.c \
|
SRCS = check.c getspwuid.c find_path.c logging.c parse.c sudo.c secureware.c \
|
||||||
goodpath.c sudo_setenv.c parse.yacc parse.lex visudo.c interfaces.c
|
goodpath.c sudo_setenv.c parse.yacc parse.lex visudo.c interfaces.c \
|
||||||
|
check_sia.c
|
||||||
|
|
||||||
PARSEOBJS = sudo.tab.o lex.yy.o
|
PARSEOBJS = sudo.tab.o lex.yy.o
|
||||||
|
|
||||||
SUDOBJS = check.o getspwuid.o find_path.o logging.o parse.o sudo.o goodpath.o \
|
SUDOBJS = check.o getspwuid.o find_path.o logging.o parse.o sudo.o \
|
||||||
sudo_setenv.o interfaces.o secureware.o @DCE_OBJS@ @TGETPASS@
|
secureware.o goodpath.o sudo_setenv.o interfaces.o \
|
||||||
|
check_sia.o @DCE_OBJS@ @TGETPASS@
|
||||||
|
|
||||||
VISUDOBJS = visudo.o
|
VISUDOBJS = visudo.o
|
||||||
|
|
||||||
@@ -133,7 +135,7 @@ VERSIONFILES = emul/utime.h check.c compat.h config.h.in dce_pwent.c \
|
|||||||
ins_classic.h ins_csops.h ins_goons.h insults.h interfaces.c \
|
ins_classic.h ins_csops.h ins_goons.h insults.h interfaces.c \
|
||||||
logging.c parse.c parse.lex parse.yacc pathnames.h.in \
|
logging.c parse.c parse.lex parse.yacc pathnames.h.in \
|
||||||
putenv.c strdup.c sudo.c sudo.h sudo_setenv.c testsudoers.c \
|
putenv.c strdup.c sudo.c sudo.h sudo_setenv.c testsudoers.c \
|
||||||
tgetpass.c utime.c visudo.c secureware.c
|
tgetpass.c utime.c visudo.c secureware.c check_sia.c
|
||||||
|
|
||||||
all: $(PROGS)
|
all: $(PROGS)
|
||||||
|
|
||||||
|
8
check.c
8
check.c
@@ -159,11 +159,13 @@ void check_user()
|
|||||||
if (rtn == 2)
|
if (rtn == 2)
|
||||||
reminder(); /* do the reminder if ticket file is new */
|
reminder(); /* do the reminder if ticket file is new */
|
||||||
#endif /* NO_MESSAGE */
|
#endif /* NO_MESSAGE */
|
||||||
#ifdef HAVE_PAM
|
#ifdef HAVE_SIA
|
||||||
|
sia_attempt_auth();
|
||||||
|
#elif HAVE_PAM
|
||||||
pam_attempt_auth();
|
pam_attempt_auth();
|
||||||
#else /* !HAVE_PAM */
|
#else /* !HAVE_SIA && !HAVE_PAM */
|
||||||
check_passwd();
|
check_passwd();
|
||||||
#endif /* HAVE_PAM */
|
#endif /* HAVE_SIA */
|
||||||
}
|
}
|
||||||
|
|
||||||
update_timestamp();
|
update_timestamp();
|
||||||
|
@@ -144,6 +144,9 @@
|
|||||||
# define HAVE_KERB4
|
# define HAVE_KERB4
|
||||||
#endif /* HAVE_KERB5 */
|
#endif /* HAVE_KERB5 */
|
||||||
|
|
||||||
|
/* Define if you use SIA. */
|
||||||
|
#undef HAVE_SIA
|
||||||
|
|
||||||
/* Define if you use PAM. */
|
/* Define if you use PAM. */
|
||||||
#undef HAVE_PAM
|
#undef HAVE_PAM
|
||||||
|
|
||||||
|
15
configure.in
15
configure.in
@@ -233,10 +233,22 @@ AC_ARG_WITH(authenticate, [ --with-authenticate enable AIX general authenti
|
|||||||
;;
|
;;
|
||||||
esac])
|
esac])
|
||||||
|
|
||||||
|
AC_ARG_WITH(sia, [ --with-sia enable SIA support],
|
||||||
|
[case $with_sia in
|
||||||
|
yes) AC_DEFINE(HAVE_SIA)
|
||||||
|
AC_MSG_CHECKING(whether to use SIA authentication)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
;;
|
||||||
|
no) ;;
|
||||||
|
*) echo "Sorry, --with-sia does not take an argument."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac])
|
||||||
|
|
||||||
AC_ARG_WITH(pam, [ --with-pam enable PAM support],
|
AC_ARG_WITH(pam, [ --with-pam enable PAM support],
|
||||||
[case $with_pam in
|
[case $with_pam in
|
||||||
yes) AC_DEFINE(HAVE_PAM)
|
yes) AC_DEFINE(HAVE_PAM)
|
||||||
AC_MSG_CHECKING(whether to try PAM authentication)
|
AC_MSG_CHECKING(whether to use PAM authentication)
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
;;
|
;;
|
||||||
no) ;;
|
no) ;;
|
||||||
@@ -1437,5 +1449,6 @@ dnl
|
|||||||
if test "$with_pam" = "yes"; then
|
if test "$with_pam" = "yes"; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "You will need to customize sample.pam and install it as /etc/pam.d/sudo"
|
echo "You will need to customize sample.pam and install it as /etc/pam.d/sudo"
|
||||||
|
echo "for RedHat Linux 5.x or modify /etc/pam.conf for Solaris."
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
16
logging.c
16
logging.c
@@ -283,8 +283,14 @@ void log_error(code)
|
|||||||
tty, cwd, runas_user);
|
tty, cwd, runas_user);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BAD_ALLOCATION:
|
||||||
|
(void) sprintf(p,
|
||||||
|
"allocation failure; TTY=%s ; PWD=%s ; USER=%s ; COMMAND=",
|
||||||
|
tty, cwd, runas_user);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
strcat(p, "found a wierd error : ");
|
strcat(p, "found a weird error : ");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,9 +681,14 @@ void inform_user(code)
|
|||||||
"Your timestamp file has a preposterous date, ignoring.\n");
|
"Your timestamp file has a preposterous date, ignoring.\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BAD_ALLOCATION:
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"Resource allocation failure.\n");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"Something wierd happened.\n\n");
|
"Something weird happened.\n\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -732,6 +743,7 @@ static int appropriate(code)
|
|||||||
case SPOOF_ATTEMPT:
|
case SPOOF_ATTEMPT:
|
||||||
case BAD_STAMPDIR:
|
case BAD_STAMPDIR:
|
||||||
case BAD_STAMPFILE:
|
case BAD_STAMPFILE:
|
||||||
|
case BAD_ALLOCATION:
|
||||||
default:
|
default:
|
||||||
return (1);
|
return (1);
|
||||||
break;
|
break;
|
||||||
|
2
sudo.h
2
sudo.h
@@ -162,6 +162,7 @@ struct generic_alias {
|
|||||||
#define SPOOF_ATTEMPT 0x0D
|
#define SPOOF_ATTEMPT 0x0D
|
||||||
#define BAD_STAMPDIR 0x0E
|
#define BAD_STAMPDIR 0x0E
|
||||||
#define BAD_STAMPFILE 0x0F
|
#define BAD_STAMPFILE 0x0F
|
||||||
|
#define BAD_ALLOCATION 0x10
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Boolean values
|
* Boolean values
|
||||||
@@ -229,6 +230,7 @@ void set_perms __P((int, int));
|
|||||||
void remove_timestamp __P((void));
|
void remove_timestamp __P((void));
|
||||||
void load_interfaces __P((void));
|
void load_interfaces __P((void));
|
||||||
int check_secureware __P((char *));
|
int check_secureware __P((char *));
|
||||||
|
void sia_attempt_auth __P((void));
|
||||||
int yyparse __P((void));
|
int yyparse __P((void));
|
||||||
YY_DECL;
|
YY_DECL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user