Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 55279 | Differences between
and this patch

Collapse All | Expand All

(-)pam_skey-1.1.4/INSTALL (+34 lines)
Lines 1-5 Link Here
1
$Id: INSTALL,v 1.1.1.1 2005/06/18 12:11:24 kreator Exp $
1
$Id: INSTALL,v 1.1.1.1 2005/06/18 12:11:24 kreator Exp $
2
2
3
Gentoo patch
4
------------
5
Most everything below still holds, though the libraries required are now
6
those used by Gentoo.  Other S/Key libraries may work with a bit of
7
tweaking.
8
9
The options listed for the module below are no longer valid.  See the
10
Gentoo patch section in README for details.
11
12
The intended method for configuring PAM is by using the newer module
13
specification, with a line like:
14
15
auth	[success=done ignore=ignore auth_err=die default=bad] /lib/security/pam_skey.so
16
17
This is a combination of the standard "sufficient" and "requisite"
18
specifications:
19
20
- If the module returns PAM_SUCCESS, we are authenticated and no other
21
  modules should be tested.
22
- If the module returns PAM_IGNORE, then the module didn't accept its
23
  input as an S/Key response, and the next module should try using
24
  the input (using the try_first_pass option).
25
- If the module returns PAM_AUTH_ERR, then the module accepted an
26
  S/Key input but it was invalid.  Do not try any more modules in the
27
  stack; the user already chose S/Key authentication.
28
- If the module returns any other code, it is a simple error in processing.
29
  Set the error flag but try other modules, just in case.
30
31
The module is intended to be placed before another authentication module,
32
like pam_unix.so; if not, it should be placed before pam_deny.so.
33
34
If the newer module specification is unavailable in your version of PAM,
35
the "sufficient" specification will work.
36
3
Required
37
Required
4
--------
38
--------
5
For building this package you will probably need original Wietse Venema's
39
For building this package you will probably need original Wietse Venema's
(-)pam_skey-1.1.4/Makefile.in (-23 / +7 lines)
Lines 12-53 Link Here
12
LIBS=@LIBS@ @SKEYLIB@ @PAMLIB@
12
LIBS=@LIBS@ @SKEYLIB@ @PAMLIB@
13
LDFLAGS=@LDFLAGS@
13
LDFLAGS=@LDFLAGS@
14
14
15
INSTALL=@INSTALL@ -m 644
15
INSTALL=@INSTALL@
16
INSTALL_LIB=${INSTALL} -m 755
16
RM=@RM@ -f
17
RM=@RM@ -f
17
CP=@CP@ -f
18
CP=@CP@ -f
18
LN=@LN@ -s
19
LN=@LN@ -s
19
AWK=@AWK@
20
AWK=@AWK@
20
21
21
PAM_FILES=pam_skey.so.1 pam_skey_access.so.1
22
PAM_FILES=pam_skey.so
22
23
23
all: $(PAM_FILES)
24
all: $(PAM_FILES)
24
25
25
pam_skey.so.1: pam_skey.o
26
pam_skey.so: pam_skey.o
26
	$(CC) $(CFLAGS) -o $@ $< $(LIBS) $(LDFLAGS)
27
28
pam_skey_access.so.1: pam_skey_access.o
29
	$(CC) $(CFLAGS) -o $@ $< $(LIBS) $(LDFLAGS)
27
	$(CC) $(CFLAGS) -o $@ $< $(LIBS) $(LDFLAGS)
30
28
31
lint-pam_skey:
29
lint-pam_skey:
32
	lclint $(CFLAGS) pam_skey.c
30
	lclint $(CFLAGS) pam_skey.c
33
31
34
lint-pam_skey_access:
32
install: all
35
	lclint $(CFLAGS) pam_skey_access.c
33
	$(INSTALL) -d $(INSTALLDIR)
36
34
	$(INSTALL_LIB) $(PAM_FILES) $(INSTALLDIR)
37
install:
38
	@if test ! -d $(INSTALLDIR); then \
39
		echo "Missing $(INSTALLDIR). Problem with PAM installation?"; \
40
	else \
41
		for file in $(PAM_FILES); do \
42
			if test ! -f "$(INSTALLDIR)/$$file"; then \
43
				echo "Installing $$file in $(INSTALLDIR)"; \
44
				$(INSTALL) "$$file" "$(INSTALLDIR)/$$file"; \
45
				(cd $(INSTALLDIR) && $(LN) "$$file" `echo $$file | cut -d. -f1,2`); \
46
			else \
47
				echo "$$file exists - will not overwrite it"; \
48
			fi \
49
		done \
50
	fi
51
35
52
clean:
36
clean:
53
	$(RM) a.out core *.so.1 *.o *.bak
37
	$(RM) a.out core *.so.1 *.o *.bak
(-)pam_skey-1.1.4/README (+72 lines)
Lines 1-5 Link Here
1
$Id: README,v 1.2 2005/06/18 12:36:18 kreator Exp $
1
$Id: README,v 1.2 2005/06/18 12:36:18 kreator Exp $
2
2
3
Gentoo patch
4
------------
5
6
The Gentoo pam_skey patch changes the original module in a number of ways.
7
The behavior of the module is changed to make it more consistent with the
8
PAM design, and several changes were made throughout the code to make the
9
module interact better with the skey library used by Gentoo.  Many of
10
these changes will break pam_skey's compatibility with other systems and
11
libraries, but this is, after all, the Gentoo patch.
12
13
A (not necessarily) exhaustive list of the changes is as follows:
14
- pam_skey_access.so is completely removed, since the Gentoo skey library
15
  does not support the skey_access() call.
16
- The pam_skey.so authentication code is completely rewritten.  The
17
  original code contained many references to the standard I/O library
18
  (writing to stderr, etc.), as well as inconsistent communication with
19
  the PAM libraries.  Also, the authentication process is different, as
20
  described below.
21
- The options accepted by the pam_skey.so module are different, as
22
  described below.
23
24
Four options are accepted by the pam_skey.so module:
25
  debug                  - This option turns on debug logging.
26
  try_first_pass         - This option tells the module to first try using
27
                           the authentication token passed from the
28
			   previous module as an S/Key response, before
29
			   informing the user of the challenge.  If the
30
			   token is not valid, the module will proceed with
31
			   the standard process of challenging the user
32
			   and requesting a response, subject to the
33
			   no_default_skey option below.
34
  use_first_pass         - This option is identical to the try_first_pass
35
                           option, except that if the token is not valid,
36
			   it will return silently without challenging the
37
			   user.
38
  no_default_skey        - This flag changes the behavior of pam_skey.
39
                           Instead of immediately challenging the user with
40
			   an S/Key challenge, it will present the user with
41
			   a standard "Password: " prompt.  If the user enters
42
			   the password "s/key" (case insensitive), it will
43
			   then challenge the user.  Any other input will
44
			   cause the module to pass the given password to the
45
			   next module in the authentication stack (usually
46
			   pam_unix.so with the try_first_pass option).
47
48
The exact behavior of pam_skey.so is detailed below:
49
50
1. Retrieve username from PAM, possibly querying the user for it.
51
2. If the user does not have any S/Key information, return PAM_IGNORE to
52
   proceed to the next module in the stack.
53
3. If *_first_pass is enabled, check the given authentication token to see
54
   if it is a valid response to the current S/Key challenge.  If so,
55
   return PAM_SUCCESS.
56
 3a. If the token is invalid and use_first_pass is enabled, return
57
     PAM_IGNORE.
58
4. If no_default_skey is enabled, issue a "Password: " prompt.
59
 4a. If the response is anything besides "s/key" (case insensitive),
60
     store it as the authentication token and return PAM_IGNORE.
61
5. Display the current S/Key challenge and request a response, with
62
   input not echoed.  If no_default_skey is enabled, this will only be
63
   an S/Key response request; otherwise, it will request either an
64
   S/Key response or a system passsword.
65
 5a. If an empty response is given, request the S/Key response again,
66
     this time with input echoed.
67
 5b. If the response is a valid S/Key response, return PAM_SUCCESS.
68
     Otherwise, return PAM_AUTHERR.
69
6. If the response is a valid S/Key response, return PAM_SUCCESS.
70
7. Otherwise, if no_default_skey is enabled (the user specifically
71
   requested "s/key" authentication), return PAM_AUTHERR.
72
8. Otherwise, store the response as the authentication token and
73
   return PAM_IGNORE.
74
3
About
75
About
4
-----
76
-----
5
This is complete pam_skey modul as interface to existing S/Key
77
This is complete pam_skey modul as interface to existing S/Key
(-)pam_skey-1.1.4/RELEASENOTES (-1 / +4 lines)
Lines 1-5 Link Here
1
RELEASE 1.1.4 - Sat Jun 18 14:28:31 CEST 2005
1
RELEASE 1.1.4 - Sat Jun 18 14:28:31 CEST 2005
2
2
3
* fix for _pam_delete() if we got AUTHTOK
3
* misc changes in source
4
* FreeBSD testing
5
* add support for Yuri Yudin's S/Key library (port from OpenBSD)
6
* fixed dlopen() issue for Solaris (appearing in proftpd suite)
4
7
5
- Dinko Korunic <kreator@srce.hr>
8
- Dinko Korunic <kreator@srce.hr>
(-)pam_skey-1.1.4/autoconf/acconfig.h (-15 lines)
Lines 1-17 Link Here
1
/* Define if we can include both string.h and strings.h */
1
/* Define if we can include both string.h and strings.h */
2
#undef STRING_WITH_STRINGS
2
#undef STRING_WITH_STRINGS
3
4
/* Define if you have Linux */
5
#undef LINUX
6
7
/* Define if you have *BSD */
8
#undef BSD
9
10
/* Define if not missing skeyaccess() */
11
#undef HAVE_SKEYACCESS
12
13
/* Define if not missing skeyinfo() */
14
#undef HAVE_SKEYINFO
15
16
/* Define if you have skeylookup() instead of skeyinfo() */
17
#undef HAVE_SKEYLOOKUP
(-)pam_skey-1.1.4/autoconf/configure.in (-19 / +3 lines)
Lines 10-30 Link Here
10
AC_LANG_C
10
AC_LANG_C
11
AC_LANG_SAVE
11
AC_LANG_SAVE
12
12
13
dnl Get system type
14
AC_CANONICAL_HOST
15
MYHOST=$host_os
16
case "$host_os" in
17
*linux*)
18
  AC_DEFINE(LINUX)
19
  ;;
20
*bsd*)
21
  AC_DEFINE(BSD)
22
  ;;
23
esac
24
25
dnl Package information
13
dnl Package information
26
PACKAGE=pam_skey
14
PACKAGE=pam_skey
27
VERSION=1.1
15
VERSION=1.4r1
28
16
29
dnl Standard installation path
17
dnl Standard installation path
30
AC_PREFIX_DEFAULT(/usr)
18
AC_PREFIX_DEFAULT(/usr)
Lines 65-77 Link Here
65
AC_ARG_WITH(skey-inc, [  --with-skey-inc=DIR     Directory containing skey include files], CFLAGS="${CFLAGS} -I${withval}")
53
AC_ARG_WITH(skey-inc, [  --with-skey-inc=DIR     Directory containing skey include files], CFLAGS="${CFLAGS} -I${withval}")
66
54
67
dnl Check for skey library
55
dnl Check for skey library
68
AC_CHECK_LIB(socket, socket)
56
AC_CHECK_LIB(socket, socket, LIBS="${LIBS} -lsocket")
69
AC_CHECK_LIB(nsl, gethostbyname)
57
AC_CHECK_LIB(nsl, gethostbyname, LIBS="${LIBS} -lnsl")
70
AC_CHECK_LIB(skey, skeyverify, SKEYLIB="-lskey", AC_MSG_ERROR(skey library not found or unknown interface))
58
AC_CHECK_LIB(skey, skeyverify, SKEYLIB="-lskey", AC_MSG_ERROR(skey library not found or unknown interface))
71
AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS))
72
AC_CHECK_LIB(skey, skeyinfo, AC_DEFINE(HAVE_SKEYINFO),
73
  AC_CHECK_LIB(skey, skeylookup, AC_DEFINE(HAVE_SKEYLOOKUP))
74
)
75
59
76
dnl Check against -G linker flag
60
dnl Check against -G linker flag
77
hold_ldflags=$LDFLAGS
61
hold_ldflags=$LDFLAGS
(-)pam_skey-1.1.4/configure (-337 / +47 lines)
Lines 310-316 Link Here
310
# include <unistd.h>
310
# include <unistd.h>
311
#endif"
311
#endif"
312
312
313
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE RM LN CP AWK INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP SKEYLIB PAMLIB MYHOST PACKAGE VERSION LIBOBJS LTLIBOBJS'
313
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE RM LN CP AWK INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP SKEYLIB PAMLIB MYHOST PACKAGE VERSION LIBOBJS LTLIBOBJS'
314
ac_subst_files=''
314
ac_subst_files=''
315
315
316
# Initialize some variables set by options.
316
# Initialize some variables set by options.
Lines 720-732 Link Here
720
  	  /^X\(\/\).*/{ s//\1/; q; }
720
  	  /^X\(\/\).*/{ s//\1/; q; }
721
  	  s/.*/./; q'`
721
  	  s/.*/./; q'`
722
  srcdir=$ac_confdir
722
  srcdir=$ac_confdir
723
  if test ! -r $srcdir/$ac_unique_file; then
723
  if test ! -r "$srcdir/$ac_unique_file"; then
724
    srcdir=..
724
    srcdir=..
725
  fi
725
  fi
726
else
726
else
727
  ac_srcdir_defaulted=no
727
  ac_srcdir_defaulted=no
728
fi
728
fi
729
if test ! -r $srcdir/$ac_unique_file; then
729
if test ! -r "$srcdir/$ac_unique_file"; then
730
  if test "$ac_srcdir_defaulted" = yes; then
730
  if test "$ac_srcdir_defaulted" = yes; then
731
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
731
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
732
   { (exit 1); exit 1; }; }
732
   { (exit 1); exit 1; }; }
Lines 735-741 Link Here
735
   { (exit 1); exit 1; }; }
735
   { (exit 1); exit 1; }; }
736
  fi
736
  fi
737
fi
737
fi
738
(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
738
(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null ||
739
  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
739
  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
740
   { (exit 1); exit 1; }; }
740
   { (exit 1); exit 1; }; }
741
srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
741
srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
Lines 831-840 Link Here
831
_ACEOF
831
_ACEOF
832
832
833
  cat <<\_ACEOF
833
  cat <<\_ACEOF
834
835
System types:
836
  --build=BUILD     configure for building on BUILD [guessed]
837
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
838
_ACEOF
834
_ACEOF
839
fi
835
fi
840
836
Lines 948-954 Link Here
948
    else
944
    else
949
      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
945
      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
950
    fi
946
    fi
951
    cd "$ac_popdir"
947
    cd $ac_popdir
952
  done
948
  done
953
fi
949
fi
954
950
Lines 1333-1410 Link Here
1333
1329
1334
1330
1335
1331
1336
# Make sure we can run config.sub.
1337
$ac_config_sub sun4 >/dev/null 2>&1 ||
1338
  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
1339
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1340
   { (exit 1); exit 1; }; }
1341
1342
echo "$as_me:$LINENO: checking build system type" >&5
1343
echo $ECHO_N "checking build system type... $ECHO_C" >&6
1344
if test "${ac_cv_build+set}" = set; then
1345
  echo $ECHO_N "(cached) $ECHO_C" >&6
1346
else
1347
  ac_cv_build_alias=$build_alias
1348
test -z "$ac_cv_build_alias" &&
1349
  ac_cv_build_alias=`$ac_config_guess`
1350
test -z "$ac_cv_build_alias" &&
1351
  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
1352
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1353
   { (exit 1); exit 1; }; }
1354
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1355
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
1356
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
1357
   { (exit 1); exit 1; }; }
1358
1359
fi
1360
echo "$as_me:$LINENO: result: $ac_cv_build" >&5
1361
echo "${ECHO_T}$ac_cv_build" >&6
1362
build=$ac_cv_build
1363
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1364
build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1365
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1366
1367
1368
echo "$as_me:$LINENO: checking host system type" >&5
1369
echo $ECHO_N "checking host system type... $ECHO_C" >&6
1370
if test "${ac_cv_host+set}" = set; then
1371
  echo $ECHO_N "(cached) $ECHO_C" >&6
1372
else
1373
  ac_cv_host_alias=$host_alias
1374
test -z "$ac_cv_host_alias" &&
1375
  ac_cv_host_alias=$ac_cv_build_alias
1376
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1377
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1378
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1379
   { (exit 1); exit 1; }; }
1380
1381
fi
1382
echo "$as_me:$LINENO: result: $ac_cv_host" >&5
1383
echo "${ECHO_T}$ac_cv_host" >&6
1384
host=$ac_cv_host
1385
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1386
host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1387
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1388
1389
1390
MYHOST=$host_os
1391
case "$host_os" in
1392
*linux*)
1393
  cat >>confdefs.h <<\_ACEOF
1394
#define LINUX 1
1395
_ACEOF
1396
1397
  ;;
1398
*bsd*)
1399
  cat >>confdefs.h <<\_ACEOF
1400
#define BSD 1
1401
_ACEOF
1402
1403
  ;;
1404
esac
1405
1406
PACKAGE=pam_skey
1332
PACKAGE=pam_skey
1407
VERSION=1.1
1333
VERSION=1.4r1
1408
1334
1409
1335
1410
1336
Lines 1976-1982 Link Here
1976
  cat conftest.err >&5
1902
  cat conftest.err >&5
1977
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
1903
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
1978
  (exit $ac_status); } &&
1904
  (exit $ac_status); } &&
1979
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
1905
	 { ac_try='test -z "$ac_c_werror_flag"
1906
			 || test ! -s conftest.err'
1980
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1907
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1981
  (eval $ac_try) 2>&5
1908
  (eval $ac_try) 2>&5
1982
  ac_status=$?
1909
  ac_status=$?
Lines 2034-2040 Link Here
2034
  cat conftest.err >&5
1961
  cat conftest.err >&5
2035
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
1962
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2036
  (exit $ac_status); } &&
1963
  (exit $ac_status); } &&
2037
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
1964
	 { ac_try='test -z "$ac_c_werror_flag"
1965
			 || test ! -s conftest.err'
2038
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
1966
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2039
  (eval $ac_try) 2>&5
1967
  (eval $ac_try) 2>&5
2040
  ac_status=$?
1968
  ac_status=$?
Lines 2150-2156 Link Here
2150
  cat conftest.err >&5
2078
  cat conftest.err >&5
2151
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2079
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2152
  (exit $ac_status); } &&
2080
  (exit $ac_status); } &&
2153
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
2081
	 { ac_try='test -z "$ac_c_werror_flag"
2082
			 || test ! -s conftest.err'
2154
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2083
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2155
  (eval $ac_try) 2>&5
2084
  (eval $ac_try) 2>&5
2156
  ac_status=$?
2085
  ac_status=$?
Lines 2204-2210 Link Here
2204
  cat conftest.err >&5
2133
  cat conftest.err >&5
2205
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2134
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2206
  (exit $ac_status); } &&
2135
  (exit $ac_status); } &&
2207
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
2136
	 { ac_try='test -z "$ac_c_werror_flag"
2137
			 || test ! -s conftest.err'
2208
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2138
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2209
  (eval $ac_try) 2>&5
2139
  (eval $ac_try) 2>&5
2210
  ac_status=$?
2140
  ac_status=$?
Lines 2249-2255 Link Here
2249
  cat conftest.err >&5
2179
  cat conftest.err >&5
2250
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2180
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2251
  (exit $ac_status); } &&
2181
  (exit $ac_status); } &&
2252
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
2182
	 { ac_try='test -z "$ac_c_werror_flag"
2183
			 || test ! -s conftest.err'
2253
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2184
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2254
  (eval $ac_try) 2>&5
2185
  (eval $ac_try) 2>&5
2255
  ac_status=$?
2186
  ac_status=$?
Lines 2293-2299 Link Here
2293
  cat conftest.err >&5
2224
  cat conftest.err >&5
2294
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2225
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2295
  (exit $ac_status); } &&
2226
  (exit $ac_status); } &&
2296
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
2227
	 { ac_try='test -z "$ac_c_werror_flag"
2228
			 || test ! -s conftest.err'
2297
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2229
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2298
  (eval $ac_try) 2>&5
2230
  (eval $ac_try) 2>&5
2299
  ac_status=$?
2231
  ac_status=$?
Lines 2881-2887 Link Here
2881
  cat conftest.err >&5
2813
  cat conftest.err >&5
2882
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2814
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2883
  (exit $ac_status); } &&
2815
  (exit $ac_status); } &&
2884
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
2816
	 { ac_try='test -z "$ac_c_werror_flag"
2817
			 || test ! -s conftest.err'
2885
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2818
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2886
  (eval $ac_try) 2>&5
2819
  (eval $ac_try) 2>&5
2887
  ac_status=$?
2820
  ac_status=$?
Lines 3051-3057 Link Here
3051
  cat conftest.err >&5
2984
  cat conftest.err >&5
3052
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
2985
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3053
  (exit $ac_status); } &&
2986
  (exit $ac_status); } &&
3054
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
2987
	 { ac_try='test -z "$ac_c_werror_flag"
2988
			 || test ! -s conftest.err'
3055
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2989
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3056
  (eval $ac_try) 2>&5
2990
  (eval $ac_try) 2>&5
3057
  ac_status=$?
2991
  ac_status=$?
Lines 3124-3130 Link Here
3124
  cat conftest.err >&5
3058
  cat conftest.err >&5
3125
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3059
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3126
  (exit $ac_status); } &&
3060
  (exit $ac_status); } &&
3127
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3061
	 { ac_try='test -z "$ac_c_werror_flag"
3062
			 || test ! -s conftest.err'
3128
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3063
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3129
  (eval $ac_try) 2>&5
3064
  (eval $ac_try) 2>&5
3130
  ac_status=$?
3065
  ac_status=$?
Lines 3278-3284 Link Here
3278
  cat conftest.err >&5
3213
  cat conftest.err >&5
3279
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3214
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3280
  (exit $ac_status); } &&
3215
  (exit $ac_status); } &&
3281
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3216
	 { ac_try='test -z "$ac_c_werror_flag"
3217
			 || test ! -s conftest.err'
3282
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3218
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3283
  (eval $ac_try) 2>&5
3219
  (eval $ac_try) 2>&5
3284
  ac_status=$?
3220
  ac_status=$?
Lines 3431-3437 Link Here
3431
  cat conftest.err >&5
3367
  cat conftest.err >&5
3432
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3368
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3433
  (exit $ac_status); } &&
3369
  (exit $ac_status); } &&
3434
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3370
	 { ac_try='test -z "$ac_c_werror_flag"
3371
			 || test ! -s conftest.err'
3435
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3372
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3436
  (eval $ac_try) 2>&5
3373
  (eval $ac_try) 2>&5
3437
  ac_status=$?
3374
  ac_status=$?
Lines 3533-3539 Link Here
3533
  cat conftest.err >&5
3470
  cat conftest.err >&5
3534
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3471
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3535
  (exit $ac_status); } &&
3472
  (exit $ac_status); } &&
3536
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3473
	 { ac_try='test -z "$ac_c_werror_flag"
3474
			 || test ! -s conftest.err'
3537
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3475
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3538
  (eval $ac_try) 2>&5
3476
  (eval $ac_try) 2>&5
3539
  ac_status=$?
3477
  ac_status=$?
Lines 3583-3589 Link Here
3583
  CFLAGS="${CFLAGS} -I${withval}"
3521
  CFLAGS="${CFLAGS} -I${withval}"
3584
fi;
3522
fi;
3585
3523
3586
3587
echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
3524
echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
3588
echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
3525
echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
3589
if test "${ac_cv_lib_socket_socket+set}" = set; then
3526
if test "${ac_cv_lib_socket_socket+set}" = set; then
Lines 3622-3628 Link Here
3622
  cat conftest.err >&5
3559
  cat conftest.err >&5
3623
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3560
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3624
  (exit $ac_status); } &&
3561
  (exit $ac_status); } &&
3625
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3562
	 { ac_try='test -z "$ac_c_werror_flag"
3563
			 || test ! -s conftest.err'
3626
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3564
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3627
  (eval $ac_try) 2>&5
3565
  (eval $ac_try) 2>&5
3628
  ac_status=$?
3566
  ac_status=$?
Lines 3648-3662 Link Here
3648
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
3586
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
3649
echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
3587
echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
3650
if test $ac_cv_lib_socket_socket = yes; then
3588
if test $ac_cv_lib_socket_socket = yes; then
3651
  cat >>confdefs.h <<_ACEOF
3589
  LIBS="${LIBS} -lsocket"
3652
#define HAVE_LIBSOCKET 1
3653
_ACEOF
3654
3655
  LIBS="-lsocket $LIBS"
3656
3657
fi
3590
fi
3658
3591
3659
3660
echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
3592
echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
3661
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
3593
echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
3662
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
3594
if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
Lines 3695-3701 Link Here
3695
  cat conftest.err >&5
3627
  cat conftest.err >&5
3696
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3628
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3697
  (exit $ac_status); } &&
3629
  (exit $ac_status); } &&
3698
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3630
	 { ac_try='test -z "$ac_c_werror_flag"
3631
			 || test ! -s conftest.err'
3699
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3632
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3700
  (eval $ac_try) 2>&5
3633
  (eval $ac_try) 2>&5
3701
  ac_status=$?
3634
  ac_status=$?
Lines 3721-3732 Link Here
3721
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
3654
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
3722
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
3655
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
3723
if test $ac_cv_lib_nsl_gethostbyname = yes; then
3656
if test $ac_cv_lib_nsl_gethostbyname = yes; then
3724
  cat >>confdefs.h <<_ACEOF
3657
  LIBS="${LIBS} -lnsl"
3725
#define HAVE_LIBNSL 1
3726
_ACEOF
3727
3728
  LIBS="-lnsl $LIBS"
3729
3730
fi
3658
fi
3731
3659
3732
echo "$as_me:$LINENO: checking for skeyverify in -lskey" >&5
3660
echo "$as_me:$LINENO: checking for skeyverify in -lskey" >&5
Lines 3767-3773 Link Here
3767
  cat conftest.err >&5
3695
  cat conftest.err >&5
3768
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3696
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3769
  (exit $ac_status); } &&
3697
  (exit $ac_status); } &&
3770
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3698
	 { ac_try='test -z "$ac_c_werror_flag"
3699
			 || test ! -s conftest.err'
3771
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3700
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3772
  (eval $ac_try) 2>&5
3701
  (eval $ac_try) 2>&5
3773
  ac_status=$?
3702
  ac_status=$?
Lines 3800-4017 Link Here
3800
   { (exit 1); exit 1; }; }
3729
   { (exit 1); exit 1; }; }
3801
fi
3730
fi
3802
3731
3803
echo "$as_me:$LINENO: checking for skeyaccess in -lskey" >&5
3804
echo $ECHO_N "checking for skeyaccess in -lskey... $ECHO_C" >&6
3805
if test "${ac_cv_lib_skey_skeyaccess+set}" = set; then
3806
  echo $ECHO_N "(cached) $ECHO_C" >&6
3807
else
3808
  ac_check_lib_save_LIBS=$LIBS
3809
LIBS="-lskey  $LIBS"
3810
cat >conftest.$ac_ext <<_ACEOF
3811
/* confdefs.h.  */
3812
_ACEOF
3813
cat confdefs.h >>conftest.$ac_ext
3814
cat >>conftest.$ac_ext <<_ACEOF
3815
/* end confdefs.h.  */
3816
3817
/* Override any gcc2 internal prototype to avoid an error.  */
3818
#ifdef __cplusplus
3819
extern "C"
3820
#endif
3821
/* We use char because int might match the return type of a gcc2
3822
   builtin and then its argument prototype would still apply.  */
3823
char skeyaccess ();
3824
int
3825
main ()
3826
{
3827
skeyaccess ();
3828
  ;
3829
  return 0;
3830
}
3831
_ACEOF
3832
rm -f conftest.$ac_objext conftest$ac_exeext
3833
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3834
  (eval $ac_link) 2>conftest.er1
3835
  ac_status=$?
3836
  grep -v '^ *+' conftest.er1 >conftest.err
3837
  rm -f conftest.er1
3838
  cat conftest.err >&5
3839
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3840
  (exit $ac_status); } &&
3841
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3842
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3843
  (eval $ac_try) 2>&5
3844
  ac_status=$?
3845
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3846
  (exit $ac_status); }; } &&
3847
	 { ac_try='test -s conftest$ac_exeext'
3848
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3849
  (eval $ac_try) 2>&5
3850
  ac_status=$?
3851
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3852
  (exit $ac_status); }; }; then
3853
  ac_cv_lib_skey_skeyaccess=yes
3854
else
3855
  echo "$as_me: failed program was:" >&5
3856
sed 's/^/| /' conftest.$ac_ext >&5
3857
3858
ac_cv_lib_skey_skeyaccess=no
3859
fi
3860
rm -f conftest.err conftest.$ac_objext \
3861
      conftest$ac_exeext conftest.$ac_ext
3862
LIBS=$ac_check_lib_save_LIBS
3863
fi
3864
echo "$as_me:$LINENO: result: $ac_cv_lib_skey_skeyaccess" >&5
3865
echo "${ECHO_T}$ac_cv_lib_skey_skeyaccess" >&6
3866
if test $ac_cv_lib_skey_skeyaccess = yes; then
3867
  cat >>confdefs.h <<\_ACEOF
3868
#define HAVE_SKEYACCESS 1
3869
_ACEOF
3870
3871
fi
3872
3873
echo "$as_me:$LINENO: checking for skeyinfo in -lskey" >&5
3874
echo $ECHO_N "checking for skeyinfo in -lskey... $ECHO_C" >&6
3875
if test "${ac_cv_lib_skey_skeyinfo+set}" = set; then
3876
  echo $ECHO_N "(cached) $ECHO_C" >&6
3877
else
3878
  ac_check_lib_save_LIBS=$LIBS
3879
LIBS="-lskey  $LIBS"
3880
cat >conftest.$ac_ext <<_ACEOF
3881
/* confdefs.h.  */
3882
_ACEOF
3883
cat confdefs.h >>conftest.$ac_ext
3884
cat >>conftest.$ac_ext <<_ACEOF
3885
/* end confdefs.h.  */
3886
3887
/* Override any gcc2 internal prototype to avoid an error.  */
3888
#ifdef __cplusplus
3889
extern "C"
3890
#endif
3891
/* We use char because int might match the return type of a gcc2
3892
   builtin and then its argument prototype would still apply.  */
3893
char skeyinfo ();
3894
int
3895
main ()
3896
{
3897
skeyinfo ();
3898
  ;
3899
  return 0;
3900
}
3901
_ACEOF
3902
rm -f conftest.$ac_objext conftest$ac_exeext
3903
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3904
  (eval $ac_link) 2>conftest.er1
3905
  ac_status=$?
3906
  grep -v '^ *+' conftest.er1 >conftest.err
3907
  rm -f conftest.er1
3908
  cat conftest.err >&5
3909
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3910
  (exit $ac_status); } &&
3911
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3912
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3913
  (eval $ac_try) 2>&5
3914
  ac_status=$?
3915
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3916
  (exit $ac_status); }; } &&
3917
	 { ac_try='test -s conftest$ac_exeext'
3918
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3919
  (eval $ac_try) 2>&5
3920
  ac_status=$?
3921
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3922
  (exit $ac_status); }; }; then
3923
  ac_cv_lib_skey_skeyinfo=yes
3924
else
3925
  echo "$as_me: failed program was:" >&5
3926
sed 's/^/| /' conftest.$ac_ext >&5
3927
3928
ac_cv_lib_skey_skeyinfo=no
3929
fi
3930
rm -f conftest.err conftest.$ac_objext \
3931
      conftest$ac_exeext conftest.$ac_ext
3932
LIBS=$ac_check_lib_save_LIBS
3933
fi
3934
echo "$as_me:$LINENO: result: $ac_cv_lib_skey_skeyinfo" >&5
3935
echo "${ECHO_T}$ac_cv_lib_skey_skeyinfo" >&6
3936
if test $ac_cv_lib_skey_skeyinfo = yes; then
3937
  cat >>confdefs.h <<\_ACEOF
3938
#define HAVE_SKEYINFO 1
3939
_ACEOF
3940
3941
else
3942
  echo "$as_me:$LINENO: checking for skeylookup in -lskey" >&5
3943
echo $ECHO_N "checking for skeylookup in -lskey... $ECHO_C" >&6
3944
if test "${ac_cv_lib_skey_skeylookup+set}" = set; then
3945
  echo $ECHO_N "(cached) $ECHO_C" >&6
3946
else
3947
  ac_check_lib_save_LIBS=$LIBS
3948
LIBS="-lskey  $LIBS"
3949
cat >conftest.$ac_ext <<_ACEOF
3950
/* confdefs.h.  */
3951
_ACEOF
3952
cat confdefs.h >>conftest.$ac_ext
3953
cat >>conftest.$ac_ext <<_ACEOF
3954
/* end confdefs.h.  */
3955
3956
/* Override any gcc2 internal prototype to avoid an error.  */
3957
#ifdef __cplusplus
3958
extern "C"
3959
#endif
3960
/* We use char because int might match the return type of a gcc2
3961
   builtin and then its argument prototype would still apply.  */
3962
char skeylookup ();
3963
int
3964
main ()
3965
{
3966
skeylookup ();
3967
  ;
3968
  return 0;
3969
}
3970
_ACEOF
3971
rm -f conftest.$ac_objext conftest$ac_exeext
3972
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
3973
  (eval $ac_link) 2>conftest.er1
3974
  ac_status=$?
3975
  grep -v '^ *+' conftest.er1 >conftest.err
3976
  rm -f conftest.er1
3977
  cat conftest.err >&5
3978
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3979
  (exit $ac_status); } &&
3980
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3981
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3982
  (eval $ac_try) 2>&5
3983
  ac_status=$?
3984
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3985
  (exit $ac_status); }; } &&
3986
	 { ac_try='test -s conftest$ac_exeext'
3987
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3988
  (eval $ac_try) 2>&5
3989
  ac_status=$?
3990
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3991
  (exit $ac_status); }; }; then
3992
  ac_cv_lib_skey_skeylookup=yes
3993
else
3994
  echo "$as_me: failed program was:" >&5
3995
sed 's/^/| /' conftest.$ac_ext >&5
3996
3997
ac_cv_lib_skey_skeylookup=no
3998
fi
3999
rm -f conftest.err conftest.$ac_objext \
4000
      conftest$ac_exeext conftest.$ac_ext
4001
LIBS=$ac_check_lib_save_LIBS
4002
fi
4003
echo "$as_me:$LINENO: result: $ac_cv_lib_skey_skeylookup" >&5
4004
echo "${ECHO_T}$ac_cv_lib_skey_skeylookup" >&6
4005
if test $ac_cv_lib_skey_skeylookup = yes; then
4006
  cat >>confdefs.h <<\_ACEOF
4007
#define HAVE_SKEYLOOKUP 1
4008
_ACEOF
4009
4010
fi
4011
4012
4013
fi
4014
4015
3732
4016
hold_ldflags=$LDFLAGS
3733
hold_ldflags=$LDFLAGS
4017
echo "$as_me:$LINENO: checking for the ld -shared flag" >&5
3734
echo "$as_me:$LINENO: checking for the ld -shared flag" >&5
Lines 4041-4047 Link Here
4041
  cat conftest.err >&5
3758
  cat conftest.err >&5
4042
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3759
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4043
  (exit $ac_status); } &&
3760
  (exit $ac_status); } &&
4044
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3761
	 { ac_try='test -z "$ac_c_werror_flag"
3762
			 || test ! -s conftest.err'
4045
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3763
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4046
  (eval $ac_try) 2>&5
3764
  (eval $ac_try) 2>&5
4047
  ac_status=$?
3765
  ac_status=$?
Lines 4099-4105 Link Here
4099
  cat conftest.err >&5
3817
  cat conftest.err >&5
4100
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
3818
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
4101
  (exit $ac_status); } &&
3819
  (exit $ac_status); } &&
4102
	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
3820
	 { ac_try='test -z "$ac_c_werror_flag"
3821
			 || test ! -s conftest.err'
4103
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3822
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4104
  (eval $ac_try) 2>&5
3823
  (eval $ac_try) 2>&5
4105
  ac_status=$?
3824
  ac_status=$?
Lines 4747-4760 Link Here
4747
s,@ECHO_N@,$ECHO_N,;t t
4466
s,@ECHO_N@,$ECHO_N,;t t
4748
s,@ECHO_T@,$ECHO_T,;t t
4467
s,@ECHO_T@,$ECHO_T,;t t
4749
s,@LIBS@,$LIBS,;t t
4468
s,@LIBS@,$LIBS,;t t
4750
s,@build@,$build,;t t
4751
s,@build_cpu@,$build_cpu,;t t
4752
s,@build_vendor@,$build_vendor,;t t
4753
s,@build_os@,$build_os,;t t
4754
s,@host@,$host,;t t
4755
s,@host_cpu@,$host_cpu,;t t
4756
s,@host_vendor@,$host_vendor,;t t
4757
s,@host_os@,$host_os,;t t
4758
s,@CC@,$CC,;t t
4469
s,@CC@,$CC,;t t
4759
s,@CFLAGS@,$CFLAGS,;t t
4470
s,@CFLAGS@,$CFLAGS,;t t
4760
s,@LDFLAGS@,$LDFLAGS,;t t
4471
s,@LDFLAGS@,$LDFLAGS,;t t
Lines 4945-4950 Link Here
4945
  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
4656
  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
4946
  esac
4657
  esac
4947
4658
4659
  if test x"$ac_file" != x-; then
4660
    { echo "$as_me:$LINENO: creating $ac_file" >&5
4661
echo "$as_me: creating $ac_file" >&6;}
4662
    rm -f "$ac_file"
4663
  fi
4948
  # Let's still pretend it is `configure' which instantiates (i.e., don't
4664
  # Let's still pretend it is `configure' which instantiates (i.e., don't
4949
  # use $as_me), people would be surprised to read:
4665
  # use $as_me), people would be surprised to read:
4950
  #    /* config.h.  Generated by config.status.  */
4666
  #    /* config.h.  Generated by config.status.  */
Lines 4983-4994 Link Here
4983
	 fi;;
4699
	 fi;;
4984
      esac
4700
      esac
4985
    done` || { (exit 1); exit 1; }
4701
    done` || { (exit 1); exit 1; }
4986
4987
  if test x"$ac_file" != x-; then
4988
    { echo "$as_me:$LINENO: creating $ac_file" >&5
4989
echo "$as_me: creating $ac_file" >&6;}
4990
    rm -f "$ac_file"
4991
  fi
4992
_ACEOF
4702
_ACEOF
4993
cat >>$CONFIG_STATUS <<_ACEOF
4703
cat >>$CONFIG_STATUS <<_ACEOF
4994
  sed "$ac_vpsub
4704
  sed "$ac_vpsub
(-)pam_skey-1.1.4/defs.h.in (-72 / +25 lines)
Lines 1-96 Link Here
1
/* defs.h.in.  Generated from configure.in by autoheader.  */
1
/* defs.h.in.  Generated automatically from configure.in by autoheader.  */
2
/* Define if we can include both string.h and strings.h */
3
#undef STRING_WITH_STRINGS
4
5
/* Define if you have Linux */
6
#undef LINUX
7
8
/* Define if you have *BSD */
9
#undef BSD
10
2
11
/* Define if not missing skeyaccess() */
3
/* Define if you have the ANSI C header files.  */
12
#undef HAVE_SKEYACCESS
4
#undef STDC_HEADERS
13
14
/* Define if not missing skeyinfo() */
15
#undef HAVE_SKEYINFO
16
5
17
/* Define if you have skeylookup() instead of skeyinfo() */
6
/* Define if we can include both string.h and strings.h */
18
#undef HAVE_SKEYLOOKUP
7
#undef STRING_WITH_STRINGS
19
8
20
/* Define to 1 if you have the `fprintf' function. */
9
/* Define if you have the fprintf function.  */
21
#undef HAVE_FPRINTF
10
#undef HAVE_FPRINTF
22
11
23
/* Define to 1 if you have the <inttypes.h> header file. */
12
/* Define if you have the gethostbyname function.  */
24
#undef HAVE_INTTYPES_H
13
#undef HAVE_GETHOSTBYNAME
25
14
26
/* Define to 1 if you have the `nsl' library (-lnsl). */
15
/* Define if you have the snprintf function.  */
27
#undef HAVE_LIBNSL
16
#undef HAVE_SNPRINTF
28
17
29
/* Define to 1 if you have the `socket' library (-lsocket). */
18
/* Define if you have the strncmp function.  */
30
#undef HAVE_LIBSOCKET
19
#undef HAVE_STRNCMP
31
20
32
/* Define to 1 if you have the <memory.h> header file. */
21
/* Define if you have the syslog function.  */
33
#undef HAVE_MEMORY_H
22
#undef HAVE_SYSLOG
34
23
35
/* Define to 1 if you have the <pwd.h> header file. */
24
/* Define if you have the <pwd.h> header file.  */
36
#undef HAVE_PWD_H
25
#undef HAVE_PWD_H
37
26
38
/* Define to 1 if you have the <security/pam_appl.h> header file. */
27
/* Define if you have the <security/pam_appl.h> header file.  */
39
#undef HAVE_SECURITY_PAM_APPL_H
28
#undef HAVE_SECURITY_PAM_APPL_H
40
29
41
/* Define to 1 if you have the <security/pam_modules.h> header file. */
30
/* Define if you have the <security/pam_modules.h> header file.  */
42
#undef HAVE_SECURITY_PAM_MODULES_H
31
#undef HAVE_SECURITY_PAM_MODULES_H
43
32
44
/* Define to 1 if you have the `snprintf' function. */
33
/* Define if you have the <stdlib.h> header file.  */
45
#undef HAVE_SNPRINTF
46
47
/* Define to 1 if you have the <stdint.h> header file. */
48
#undef HAVE_STDINT_H
49
50
/* Define to 1 if you have the <stdlib.h> header file. */
51
#undef HAVE_STDLIB_H
34
#undef HAVE_STDLIB_H
52
35
53
/* Define to 1 if you have the <strings.h> header file. */
36
/* Define if you have the <string.h> header file.  */
54
#undef HAVE_STRINGS_H
55
56
/* Define to 1 if you have the <string.h> header file. */
57
#undef HAVE_STRING_H
37
#undef HAVE_STRING_H
58
38
59
/* Define to 1 if you have the `strncmp' function. */
39
/* Define if you have the <strings.h> header file.  */
60
#undef HAVE_STRNCMP
40
#undef HAVE_STRINGS_H
61
62
/* Define to 1 if you have the `syslog' function. */
63
#undef HAVE_SYSLOG
64
65
/* Define to 1 if you have the <syslog.h> header file. */
66
#undef HAVE_SYSLOG_H
67
68
/* Define to 1 if you have the <sys/stat.h> header file. */
69
#undef HAVE_SYS_STAT_H
70
41
71
/* Define to 1 if you have the <sys/syslog.h> header file. */
42
/* Define if you have the <sys/syslog.h> header file.  */
72
#undef HAVE_SYS_SYSLOG_H
43
#undef HAVE_SYS_SYSLOG_H
73
44
74
/* Define to 1 if you have the <sys/types.h> header file. */
45
/* Define if you have the <sys/types.h> header file.  */
75
#undef HAVE_SYS_TYPES_H
46
#undef HAVE_SYS_TYPES_H
76
47
77
/* Define to 1 if you have the <unistd.h> header file. */
48
/* Define if you have the <syslog.h> header file.  */
78
#undef HAVE_UNISTD_H
49
#undef HAVE_SYSLOG_H
79
80
/* Define to the address where bug reports for this package should be sent. */
81
#undef PACKAGE_BUGREPORT
82
83
/* Define to the full name of this package. */
84
#undef PACKAGE_NAME
85
86
/* Define to the full name and version of this package. */
87
#undef PACKAGE_STRING
88
89
/* Define to the one symbol short name of this package. */
90
#undef PACKAGE_TARNAME
91
92
/* Define to the version of this package. */
93
#undef PACKAGE_VERSION
94
95
/* Define to 1 if you have the ANSI C header files. */
96
#undef STDC_HEADERS
(-)pam_skey-1.1.4/pam_skey.c (-257 / +125 lines)
Lines 1-5 Link Here
1
/* 
1
/* 
2
 * (c) 2001 Dinko Korunic, kreator@srce.hr
2
 * Rewrite (c) 2005 Dani Church, dani.church@gmail.com
3
 * Original (c) 2001 Dinko Korunic, kreator@srce.hr
3
 *
4
 *
4
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Lines 33-304 Link Here
33
#include <pwd.h> 
34
#include <pwd.h> 
34
#include <sys/types.h>
35
#include <sys/types.h>
35
#include <syslog.h>
36
#include <syslog.h>
37
#include <ctype.h>
36
38
37
#define PAM_EXTERN extern
39
#define PAM_EXTERN extern
38
#undef PAM_STATIC
40
#undef PAM_STATIC
39
41
40
#include <security/pam_appl.h>
42
#include <security/pam_appl.h>
41
#include <security/pam_modules.h>
43
#include <security/pam_modules.h>
44
#include <security/_pam_macros.h>
42
45
43
#include "skey.h"
46
#include "skey.h"
44
#include "pam_skey.h"
47
#include "pam_skey.h"
45
#include "misc.h"
48
#include "misc.h"
46
49
50
#define LOGDEBUG(x) if (mod_opt & _MOD_DEBUG) { syslog x ;}
51
#define QUERY_USERNAME NULL /* Use default username prompt */
52
#define QUERY_PASSWORD "Password: "
53
#define QUERY_RESPONSE_OR_PASSWORD "S/Key response or system password: "
54
#define QUERY_RESPONSE "S/Key response: "
55
47
PAM_EXTERN int pam_sm_setcred (pam_handle_t *pamh, int flags,
56
PAM_EXTERN int pam_sm_setcred (pam_handle_t *pamh, int flags,
48
  int argc, const char **argv)
57
  int argc, const char **argv)
49
{
58
{
50
  return PAM_SUCCESS;
59
  return PAM_SUCCESS;
51
}
60
}
52
61
62
/*
63
 * The authentication module will return the following status codes:
64
 * PAM_SUCCESS: Successful authentication via S/Key.
65
 * PAM_IGNORE: The user doesn't have S/Key or doesn't want to use it.
66
 *             Continue with the next module, using try_first_pass.
67
 * PAM_AUTH_ERR: The user asked to use S/Key, but failed the authentication.
68
 *               Don't try any more PAM modules.
69
 * others: random errors, try next authentication method
70
 */
71
53
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,
72
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,
54
  int argc, const char **argv)
73
  int argc, const char **argv)
55
{
74
{
56
  char challenge[CHALLENGE_MAXSIZE]; /* challenge to print in conv */
75
  const char *challenge; /* challenge to print in conv */
57
  char msg_text[PAM_MAX_MSG_SIZE]; /* text for pam conv */
76
  const char *username = NULL; /* username spacer */
58
  char *username = NULL; /* username spacer */
59
  char *response = NULL; /* response spacer */
77
  char *response = NULL; /* response spacer */
60
  struct skey skey; /* structure that contains skey information */
61
  int status; /* return status spacer */
78
  int status; /* return status spacer */
62
  unsigned mod_opt = _MOD_NONE_ON; /* module options */
79
  unsigned mod_opt=_MOD_NONE_ON; /* module options */
63
80
64
  /* Get module options */
81
  /* Get module options */
65
  mod_getopt(&mod_opt, argc, argv);
82
  mod_getopt(&mod_opt, argc, argv);
66
83
67
  /* Get username */
84
  /* Get username (taken mainly from pam_unix) */
68
#if defined LINUX || defined BSD
85
  status = pam_get_user(pamh, &username, QUERY_USERNAME);
69
  if (pam_get_user(pamh, (const char **)&username, "login:")
86
  if (status == PAM_SUCCESS) {
70
#else
87
    if (username == NULL || !isalnum(*username)) {
71
  if (pam_get_user(pamh, (char **)&username, "login:")
88
      syslog(LOG_ERR, "bad username [%s]", username);
72
#endif
89
      return PAM_USER_UNKNOWN;
73
      != PAM_SUCCESS)
74
  {
75
    fprintf(stderr, "cannot determine username\n");
76
    if (mod_opt & _MOD_DEBUG)
77
      syslog(LOG_DEBUG, "cannot determine username");
78
    return PAM_USER_UNKNOWN;
79
  }
80
81
  if (mod_opt & _MOD_DEBUG)
82
    syslog(LOG_DEBUG, "got username %s", username);
83
84
#ifdef HAVE_SKEYACCESS
85
  /* Check S/Key access permissions - user, host and port. Also include
86
   * sanity checks */
87
  if (mod_opt & _MOD_ACCESS_CHECK)
88
  {
89
    char *host; /* points to host */
90
    char *port; /* points to port */
91
    struct passwd *pwuser; /* structure for getpw() */
92
93
    /* Get host.. */
94
#if defined LINUX || defined BSD
95
    if (pam_get_item(pamh, PAM_RHOST, (const void **)&host)
96
#else
97
    if (pam_get_item(pamh, PAM_RHOST, (void **)&host)
98
#endif
99
        != PAM_SUCCESS)
100
      host = NULL; /* couldn't get host */
101
    /* ..and port */
102
#if defined LINUX || defined BSD
103
    if (pam_get_item(pamh, PAM_TTY, (const void **)&port)
104
#else
105
    if (pam_get_item(pamh, PAM_TTY, (void **)&port)
106
#endif
107
        != PAM_SUCCESS)
108
      port = NULL; /* couldn't get port */
109
110
    if (mod_opt & _MOD_DEBUG)
111
      syslog(LOG_DEBUG, "checking s/key access for user %s,"
112
        " host %s, port %s", username,
113
        (host != NULL) ? host : "*unknown*",
114
        (port != NULL) ? port : "*unknown*");
115
116
    /* Get information from passwd file */
117
    if ((pwuser = getpwnam(username)) == NULL)
118
    {
119
      fprintf(stderr, "no such user\n");
120
      syslog(LOG_NOTICE, "cannot find user %s", username);
121
      return PAM_USER_UNKNOWN; /* perhaps even return PAM_ABORT here? */
122
    }
90
    }
91
    LOGDEBUG((LOG_DEBUG, "username [%s] obtained", username));
92
  } else {
93
    LOGDEBUG((LOG_DEBUG, "trouble reading username"));
94
    if (status == PAM_CONV_AGAIN)
95
      return PAM_INCOMPLETE;
96
    return status;
97
  }
123
98
124
    /* Do actual checking - we assume skeyaccess() returns PERMIT which is
99
  /* Check whether or not this user has an S/Key */
125
     * by default 1. Notice 4th argument is NULL - we will not perform
100
  if (skey_haskey(username) != 0) {
126
     * address checks on host itself */
101
    LOGDEBUG((LOG_DEBUG, "user [%s] has no S/Key entry", username));
127
    if (skeyaccess(pwuser, port, host, NULL) != 1)
102
    return PAM_IGNORE;
128
    {
129
      fprintf(stderr, "no s/key access permissions\n");
130
      syslog(LOG_NOTICE, "no s/key access permissions for %s",
131
          username);
132
      return PAM_AUTH_ERR;
133
    }
134
  }
103
  }
135
  else
136
104
137
#endif /* HAVE_SKEYACCESS */
105
  if ((mod_opt & _MOD_TRY_FIRST_PASS) || (mod_opt & _MOD_USE_FIRST_PASS)) {
138
    
106
    status = pam_get_item(pamh, PAM_AUTHTOK, (const void **) &response);
139
  /* Only do check whether user has passwd entry */
107
    if (status != PAM_SUCCESS) {
140
    if (getpwnam(username) == NULL)
108
      syslog(LOG_ALERT, "pam_get_item returned error to pam_skey");
141
    {
109
      return status;
142
      fprintf(stderr, "no such user\n");
110
    } else if (response != NULL) {
143
      if (mod_opt & _MOD_DEBUG)
111
      if (skey_passcheck(username, response) != -1) {
144
        syslog(LOG_DEBUG, "cannot find user %s",
112
	return PAM_SUCCESS;
145
            username);
113
      } else if (mod_opt & _MOD_USE_FIRST_PASS) {
146
      return PAM_USER_UNKNOWN;
114
	return PAM_IGNORE;
115
      }
116
    } else if (mod_opt & _MOD_USE_FIRST_PASS) {
117
      return PAM_AUTHTOK_RECOVER_ERR;
147
    }
118
    }
148
149
  /* Get S/Key information on user with skeyinfo() */
150
#ifdef HAVE_SKEYINFO
151
  switch (skeyinfo(&skey, username, NULL))
152
#else
153
#ifdef HAVE_SKEYLOOKUP
154
  switch (skeylookup(&skey, username))
155
#endif /* HAVE_SKEYLOOKUP */
156
#endif /* HAVE_SKEYINFO */
157
  {
158
  /* 0: OK */
159
  case 0:
160
    break;
161
  /* -1: File error */
162
  case -1:
163
#if 0
164
  /* XXX- This seems broken in (at least) logdaemon-5.8. It returns -1
165
   * when user not found in keyfile. -kre */
166
    fprintf(stderr, "s/key database error\n");
167
    syslog(LOG_NOTICE, "s/key database error");
168
    return PAM_AUTH_ERR;
169
#endif
170
  /* 1: No such user in database */
171
  case 1:
172
    /* We won't confuse the ordinary user telling him about missing skeys
173
     * -kre */
174
#if 0
175
    fprintf(stderr, "no s/key for %s\n", username);
176
#endif
177
    if (mod_opt & _MOD_DEBUG)
178
      syslog(LOG_DEBUG, "no s/key for %s\n", username);
179
    return PAM_AUTH_ERR;
180
  }
119
  }
181
120
  
182
  /* Make challenge string */
121
  if (mod_opt & _MOD_NO_DEFAULT_SKEY) {
183
#if defined(SKEY_MAX_HASHNAME_LEN) && defined(SKEY_MAX_SEED_LEN)
122
    status = mod_talk_touser(pamh, mod_opt, NULL, QUERY_PASSWORD, 0, &response);
184
  snprintf(challenge, CHALLENGE_MAXSIZE, "otp-%.*s %d %.*s",
123
    if (status != PAM_SUCCESS) {
185
      SKEY_MAX_HASHNAME_LEN, skey_get_algorithm(), skey.n - 1, SKEY_MAX_SEED_LEN, skey.seed);
124
      _pam_delete(response)
186
#else
125
      return status;
187
  snprintf(challenge, CHALLENGE_MAXSIZE, "s/key %d %s",
188
      skey.n - 1, skey.seed);
189
#endif
190
191
  if (mod_opt & _MOD_DEBUG)
192
    syslog(LOG_DEBUG, "got challenge %s for %s", challenge,
193
        username);
194
195
  /* Read response from last module's PAM_AUTHTOK */
196
  if (mod_opt & _MOD_USE_FIRST_PASS)
197
  {
198
    /* Try to extract authtoken */
199
#if defined LINUX || defined BSD
200
    if (pam_get_item(pamh, PAM_AUTHTOK, (const void **)&response)
201
#else
202
    if (pam_get_item(pamh, PAM_AUTHTOK, (void **)&response)
203
#endif
204
        != PAM_SUCCESS)
205
    {
206
      if (mod_opt & _MOD_DEBUG)
207
        syslog(LOG_DEBUG, "could not get PAM_AUTHTOK");
208
      mod_opt &= ~_MOD_USE_FIRST_PASS;
209
    }
126
    }
210
    else
127
    if (strcasecmp(response,"s/key")!=0) {
211
    {
128
      status = pam_set_item(pamh, PAM_AUTHTOK, response);
212
      /* Got AUTHTOK, but it was empty */
129
      if (status != PAM_SUCCESS)
213
      if (empty_authtok(response))
130
	return status;
214
      {
131
      return PAM_IGNORE;
215
        if (mod_opt & _MOD_DEBUG)
216
          syslog(LOG_DEBUG, "empty PAM_AUTHTOK");
217
        mod_opt &= ~_MOD_USE_FIRST_PASS;
218
      }
219
      else
220
        /* All OK, print challenge information */
221
        fprintf(stderr, "challenge %s\n", challenge);
222
    }
132
    }
133
    _pam_delete(response);
223
  }
134
  }
224
135
225
  /* There was no PAM_AUTHTOK, or there was no such option in pam-conf
136
  challenge = skey_keyinfo(username);
226
   * file */
137
  if (challenge == NULL) {
227
  if (!(mod_opt & _MOD_USE_FIRST_PASS))
138
    syslog(LOG_ALERT, "Could not retrieve S/Key challenge for [%s]", username);
228
  {
139
    return PAM_AUTHINFO_UNAVAIL;
229
    /* Prepare a complete message for conversation */
140
  }
230
    snprintf(msg_text, PAM_MAX_MSG_SIZE,
231
        "challenge %s\npassword: ", challenge);
232
233
    /* Talk with user */
234
    if (mod_talk_touser(pamh, &mod_opt, msg_text, &response)
235
        != PAM_SUCCESS)
236
      return PAM_SERVICE_ERR;
237
238
    /* Simulate standard S/Key login procedure - if empty token, turn on
239
     * ECHO and prompt again */
240
    if (empty_authtok(response) && !(mod_opt & _MOD_ONLY_ONE_TRY))
241
    {
242
      /* Was there echo off? */
243
      if (mod_opt & _MOD_ECHO_OFF)
244
      {
245
        _pam_delete(response);
246
        fprintf(stderr, "(turning echo on)\n");
247
        mod_opt &= ~_MOD_ECHO_OFF;
248
249
        /* Prepare a complete message for conversation */
250
        snprintf(msg_text, PAM_MAX_MSG_SIZE, "password: ");
251
252
        /* Talk with user */
253
        if (mod_talk_touser(pamh, &mod_opt, msg_text, &response)
254
          != PAM_SUCCESS)
255
          return PAM_SERVICE_ERR;
256
257
        /* Got again empty response. Bailout and don't save auth token */
258
        if (empty_authtok(response))
259
          return PAM_AUTH_ERR;
260
      }
261
      else
262
      /* There was echo on already - just get out and don't save auth token
263
       * for other modules */
264
        return PAM_AUTH_ERR;
265
    }
266
141
267
    /* XXX - ECHO ON puts '\n' at the end in Solaris 2.7! This is
142
  if (mod_opt & _MOD_NO_DEFAULT_SKEY) 
268
     * cludge to get rid of this nasty `feature' -kre */
143
    status = mod_talk_touser(pamh, mod_opt, challenge, QUERY_RESPONSE, 0, &response);
269
    _pam_degarbage(response);
144
  else
270
  
145
    status = mod_talk_touser(pamh, mod_opt, challenge, QUERY_RESPONSE_OR_PASSWORD, 0, &response);
271
    /* Store auth token - that next module can use with `use_first_pass' */
272
    if (pam_set_item(pamh, PAM_AUTHTOK, response) != PAM_SUCCESS)
273
    {
274
      syslog(LOG_NOTICE, "unable to save auth token");
275
      return PAM_SERVICE_ERR;
276
    }
277
146
278
    /* cleanup conversation */
147
  if (status != PAM_SUCCESS)
148
    return status;
149
  
150
  if (*response == '\0') {
279
    _pam_delete(response);
151
    _pam_delete(response);
280
  } 
152
    status = mod_talk_touser(pamh, mod_opt, NULL, QUERY_RESPONSE, 1, &response);
281
153
    if (status != PAM_SUCCESS)
282
  /* Verify S/Key */
154
      return status;
283
  status = skeyverify(&skey, response);
155
    status = pam_set_item(pamh, PAM_AUTHTOK, response);
156
    status = skey_passcheck(username, response);
157
    _pam_delete(response);
158
    if (status != -1)
159
      return PAM_SUCCESS;
160
    return PAM_AUTH_ERR;
161
  }
284
162
285
  switch (status)
163
  status = pam_set_item(pamh, PAM_AUTHTOK, response);
286
  {
164
  status = skey_passcheck(username, response);
287
    /* 0: Verify successful, database updated */
165
  if (status != -1) {
288
    case 0:
166
    _pam_delete(response);
289
      break;
167
    return PAM_SUCCESS;
290
    /* -1: Error of some sort; database unchanged */
168
  }
291
    /*  1: Verify failed, database unchanged */
169
  
292
    case -1:
170
  if (mod_opt & _MOD_NO_DEFAULT_SKEY) {
293
    case 1:
171
    _pam_delete(response);
294
      if (mod_opt & _MOD_DEBUG)
172
    return PAM_AUTH_ERR;
295
        syslog(LOG_DEBUG, "verify for %s failed, database"
296
            " unchanged", username);
297
      return PAM_AUTH_ERR;
298
  }
173
  }
299
174
300
  /* Success by default */
175
  status = pam_set_item(pamh, PAM_AUTHTOK, response);
301
  return PAM_SUCCESS;
176
  return PAM_IGNORE;
302
}
177
}
303
178
304
/* Get module optional parameters */
179
/* Get module optional parameters */
Lines 332-381 Link Here
332
}
207
}
333
208
334
/* This will talk to user through PAM_CONV */
209
/* This will talk to user through PAM_CONV */
335
static int mod_talk_touser(pam_handle_t *pamh, unsigned *mod_opt,
210
static int mod_talk_touser(pam_handle_t *pamh, unsigned mod_opt,
336
    char *msg_text, char **response)
211
    const char *info_text, const char *prompt_text, int echo_on, char **response)
337
{
212
{
338
  struct pam_message message;
213
  struct pam_message message[2], *pmessage[2];
339
  const struct pam_message *pmessage = &message;
340
  struct pam_conv *conv = NULL;
214
  struct pam_conv *conv = NULL;
341
  struct pam_response *presponse = NULL;
215
  struct pam_response *presponse = NULL;
342
216
  int i=0;
217
  
343
  /* Better safe than sorry */
218
  /* Better safe than sorry */
344
  *response = NULL;
219
  *response = NULL;
345
220
346
  /* Be paranoid */
221
  /* Be paranoid */
347
  memset(&message, 0, sizeof(message));
222
  memset(&message, 0, sizeof(message));
348
223
349
  /* Turn on/off PAM echo */
224
  pmessage[0] = &message[0];
350
  if (*mod_opt & _MOD_ECHO_OFF)
225
  pmessage[1] = &message[1];
351
    message.msg_style = PAM_PROMPT_ECHO_OFF;
226
  
352
  else
227
  /* Set info text, if any */
353
    message.msg_style = PAM_PROMPT_ECHO_ON;
228
  if (info_text) {
229
    message[i].msg = info_text;
230
    message[i].msg_style = PAM_TEXT_INFO;
231
    i++;
232
  }
354
  
233
  
355
  /* Point to conversation text */
234
  /* Set prompt text */
356
  message.msg = msg_text;
235
  message[i].msg = prompt_text;
236
  message[i].msg_style = echo_on ? PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF;
237
  i++;
357
238
358
  /* Do conversation and see if all is OK */
239
  /* Do conversation and see if all is OK */
359
#if defined LINUX || defined BSD
240
  if (pam_get_item(pamh, PAM_CONV, (const void **)&conv) != PAM_SUCCESS) {
360
  if (pam_get_item(pamh, PAM_CONV, (const void **)&conv)
241
    LOGDEBUG((LOG_DEBUG, "error in conversation"));
361
#else
362
  if (pam_get_item(pamh, PAM_CONV, (void **)&conv)
363
#endif
364
      != PAM_SUCCESS)
365
  {
366
    if (*mod_opt & _MOD_DEBUG)
367
      syslog(LOG_DEBUG, "error in conversation");
368
    return PAM_SERVICE_ERR;
242
    return PAM_SERVICE_ERR;
369
  }
243
  }
370
244
  /* Convert into pam_response */
371
  /* Convert into pam_response - only 1 reply expected */
245
  if (conv->conv(i, (const struct pam_message **)pmessage, &presponse,
372
#if defined LINUX || defined BSD
373
  if (conv->conv(1, &pmessage, &presponse,
374
        conv->appdata_ptr)
246
        conv->appdata_ptr)
375
#else
376
  if (conv->conv(1, (struct pam_message **)&pmessage, &presponse,
377
        conv->appdata_ptr)
378
#endif
379
    != PAM_SUCCESS)
247
    != PAM_SUCCESS)
380
  {
248
  {
381
    _pam_delete(presponse->resp);
249
    _pam_delete(presponse->resp);
Lines 385-394 Link Here
385
  if (presponse != NULL)
253
  if (presponse != NULL)
386
  {
254
  {
387
    /* Save address */
255
    /* Save address */
388
    *response = presponse->resp;
256
    *response = presponse[i-1].resp;
389
    /* To ensure that response address will not be erased */
257
    /* To ensure that response address will not be erased */
390
    presponse->resp = NULL;
258
    presponse[i-1].resp = NULL;
391
    _pam_drop(presponse);
259
    _pam_drop_reply(presponse,i);
392
  }
260
  }
393
  else
261
  else
394
    return PAM_SERVICE_ERR;
262
    return PAM_SERVICE_ERR;
(-)pam_skey-1.1.4/pam_skey.h (-30 / +17 lines)
Lines 22-50 Link Here
22
 */
22
 */
23
23
24
/* Prototypes */
24
/* Prototypes */
25
#ifndef BSD
26
extern int skeyinfo(struct skey *, char *, char *); /* ORGH! Not in skey.h */
27
#endif
28
29
static void mod_getopt(unsigned *, int, const char **);
25
static void mod_getopt(unsigned *, int, const char **);
30
static int mod_talk_touser(pam_handle_t *, unsigned *, char *, char **);
26
static int mod_talk_touser(pam_handle_t *, unsigned, const char *, const char *, int, char **);
31
27
32
/* free() macro */
28
/* free() macro */
33
#define _pam_drop(X)  \
29
/*#define _pam_drop(X)  \
34
if (X != NULL)        \
30
if (X != NULL)        \
35
{                     \
31
{                     \
36
  free(X);            \
32
  free(X);            \
37
  X = NULL;           \
33
  X = NULL;           \
38
}
34
}*/
39
35
40
/* Secure overwrite */
36
/* Secure overwrite */
41
#define _pam_overwrite(x)   \
37
/*#define _pam_overwrite(x)   \
42
{                           \
38
{                           \
43
  register char *__xx__;    \
39
  register char *__xx__;    \
44
  if ((__xx__ = (x)))       \
40
  if ((__xx__ = (x)))       \
45
    while (*__xx__)         \
41
    while (*__xx__)         \
46
    *__xx__++ = '\0';       \
42
    *__xx__++ = '\0';       \
47
}
43
}*/
48
44
49
/* Drop-in secure replacement - we do not want cleartext passwords lying
45
/* Drop-in secure replacement - we do not want cleartext passwords lying
50
 * scattered around */
46
 * scattered around */
Lines 56-62 Link Here
56
52
57
/* This will get us rid of first '\n' in response string and cut-off the
53
/* This will get us rid of first '\n' in response string and cut-off the
58
 * rest of the string. It should be ASCIIZ, of course */
54
 * rest of the string. It should be ASCIIZ, of course */
59
#define _pam_degarbage(x)      \
55
/*#define _pam_degarbage(x)      \
60
{                              \
56
{                              \
61
  register char *__xx__;       \
57
  register char *__xx__;       \
62
    if ((__xx__ = (x)))        \
58
    if ((__xx__ = (x)))        \
Lines 70-99 Link Here
70
        else                   \
66
        else                   \
71
          __xx__++;            \
67
          __xx__++;            \
72
      }                        \
68
      }                        \
73
}
69
}*/
74
70
75
/* Handy empty AUTHTOK macro */
71
/* Handy empty AUTHTOK macro */
76
#define empty_authtok(a) (a == NULL || !*a || *a == '\n')
72
#define empty_authtok(a) (a == NULL || !*a || *a == '\n')
77
73
78
/* Maximum challenge size. It should be 64, but be sure */
79
#define CHALLENGE_MAXSIZE 128
80
81
/* Define module flags */
74
/* Define module flags */
82
#define _MOD_NONE_ON        0x0000      /* Generic flag */
75
#define _MOD_NONE_ON         0x0000	/* Generic flag */
83
#define _MOD_ALL_ON    (~_MOD_NONE_ON)  /* Generic mask */
76
#define _MOD_ALL_ON    (~_MOD_NONE_ON)	/* Generic mask */
84
#define _MOD_DEBUG          0x0001      /* Debugging options on */
77
#define _MOD_DEBUG           0x0001	/* Debugging options on */
85
#define _MOD_ECHO_OFF       0x0002      /* PAM_ECHO_OFF */
78
#define _MOD_TRY_FIRST_PASS  0x0002	/* Attempt using PAM_AUTHTOK */
86
#define _MOD_ACCESS_CHECK   0x0004      /* Check S/Key access permissions */
79
#define _MOD_USE_FIRST_PASS  0x0004	/* Only use PAM_AUTHTOK */
87
#define _MOD_USE_FIRST_PASS 0x0008      /* Use PAM_AUTHTOK */
80
#define _MOD_NO_DEFAULT_SKEY 0x0008	/* Don't use S/Key by default */
88
#define _MOD_ONLY_ONE_TRY   0x0010      /* Only one try, no matter of echo */
89
#define _MOD_SPACER         0x0020      /* Currently unused */
90
81
91
/* Setup defaults - use echo off only */
82
/* Setup defaults - use echo off only */
92
#define _MOD_DEFAULT_FLAG   _MOD_ECHO_OFF
83
#define _MOD_DEFAULT_FLAG   _MOD_NONE_ON
93
#define _MOD_DEFAULT_MASK   _MOD_ALL_ON
84
#define _MOD_DEFAULT_MASK   _MOD_ALL_ON
94
85
95
/* Number of parameters currently known */
86
/* Number of parameters currently known */
96
#define _MOD_ARGS           8
87
#define _MOD_ARGS           4
97
88
98
/* Structure for flexible argument parsing */
89
/* Structure for flexible argument parsing */
99
typedef struct
90
typedef struct
Lines 108-118 Link Here
108
{
99
{
109
  /* String            Mask                           Flag */
100
  /* String            Mask                           Flag */
110
  {"debug",            _MOD_ALL_ON,                   _MOD_DEBUG},
101
  {"debug",            _MOD_ALL_ON,                   _MOD_DEBUG},
111
  {"echo=off",         _MOD_ALL_ON,                   _MOD_ECHO_OFF},
102
  {"try_first_pass",   _MOD_ALL_ON,                   _MOD_TRY_FIRST_PASS},
112
  {"echo=on",          _MOD_ALL_ON^_MOD_ECHO_OFF,     _MOD_NONE_ON},
113
  {"access_check=on",  _MOD_ALL_ON,                   _MOD_ACCESS_CHECK},
114
  {"access_check=off", _MOD_ALL_ON^_MOD_ACCESS_CHECK, _MOD_NONE_ON},
115
  {"use_first_pass",   _MOD_ALL_ON,                   _MOD_USE_FIRST_PASS},
103
  {"use_first_pass",   _MOD_ALL_ON,                   _MOD_USE_FIRST_PASS},
116
  {"try_first_pass",   _MOD_ALL_ON,                   _MOD_USE_FIRST_PASS},
104
  {"no_default_skey",  _MOD_ALL_ON,                   _MOD_NO_DEFAULT_SKEY}
117
  {"only_one_try",     _MOD_ALL_ON,                   _MOD_ONLY_ONE_TRY}
118
};
105
};
(-)pam_skey-1.1.4/pam_skey_access.c (-161 lines)
Lines 1-161 Link Here
1
/* 
2
 * (c) 2001 Dinko Korunic, kreator@srce.hr
3
 *
4
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
5
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
7
 *
8
 * S/KEY is a trademark of Bellcore.
9
 * Mink is the former name of the S/KEY authentication system.
10
 *
11
 * Programs that had some influence in development of this source:
12
 *  Wietse Venema's logdaemon package
13
 *  Olaf Kirch's Linux S/Key package
14
 *  Linux-PAM modules and templates
15
 *  Wyman Miles' pam_securid module
16
 *
17
 * Should you choose to use and/or modify this source code, please do so
18
 * under the terms of the GNU General Public License under which this
19
 * program is distributed.
20
 */
21
22
static char rcsid[] = "$Id: pam_skey_access.c,v 1.2 2005/06/18 12:36:18 kreator Exp $";
23
24
#include "defs.h"
25
26
#include <stdio.h>
27
#include <stdlib.h>
28
#include <string.h>
29
#ifdef STRING_WITH_STRINGS
30
# include <strings.h>
31
#endif
32
#include <unistd.h>
33
#include <pwd.h> 
34
#include <sys/types.h>
35
#include <syslog.h>
36
37
#define PAM_EXTERN extern
38
#undef PAM_STATIC
39
40
#include <security/pam_appl.h>
41
#include <security/pam_modules.h>
42
43
#include "skey.h"
44
#include "pam_skey.h"
45
#include "misc.h"
46
47
PAM_EXTERN int pam_sm_setcred (pam_handle_t *pamh, int flags,
48
  int argc, const char **argv)
49
{
50
  return PAM_SUCCESS;
51
}
52
53
PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,
54
  int argc, const char **argv)
55
{
56
  char *username = NULL; /* will point to username */
57
  unsigned mod_opt = _MOD_NONE_ON; /* module options */
58
  char *host; /* will point to host */
59
  char *port; /* will point to port */
60
  struct passwd *pwuser;
61
62
  /* Get module options */
63
  mod_getopt(&mod_opt, argc, argv);
64
65
  /* Get username */
66
#if defined LINUX || defined BSD
67
  if (pam_get_user(pamh, (const char **)&username, "login:")!=PAM_SUCCESS)
68
#else
69
  if (pam_get_user(pamh, (char **)&username, "login:")!=PAM_SUCCESS)
70
#endif
71
  {
72
    fprintf(stderr, "cannot determine username\n");
73
    if (mod_opt & _MOD_DEBUG)
74
      syslog(LOG_DEBUG, "cannot determine username");
75
    return PAM_AUTHINFO_UNAVAIL;
76
  }
77
78
  if (mod_opt & _MOD_DEBUG)
79
    syslog(LOG_DEBUG, "got username %s", username);
80
81
  /* Check S/Key access permissions - user, host and port. Also include
82
   * sanity checks */
83
  /* Get host.. */
84
#if defined LINUX || defined BSD
85
  if (pam_get_item(pamh, PAM_RHOST, (const void **)&host)
86
#else
87
  if (pam_get_item(pamh, PAM_RHOST, (void **)&host)
88
#endif
89
    != PAM_SUCCESS)
90
      host = NULL;
91
  /* ..and port */
92
#ifdef LINUX
93
  if (pam_get_item(pamh, PAM_TTY, (const void **)&port)
94
#else
95
  if (pam_get_item(pamh, PAM_TTY, (void **)&port)
96
#endif
97
    != PAM_SUCCESS)
98
      port = NULL;
99
100
  if (mod_opt & _MOD_DEBUG)
101
    syslog(LOG_DEBUG, "checking s/key access for user %s,"
102
      " host %s, port %s", username,
103
      (host != NULL) ? host : "*unknown*",
104
      (port != NULL) ? port : "*unknown*");
105
106
  /* Get information from passwd file */
107
  if ((pwuser = getpwnam(username)) == NULL)
108
  {
109
    fprintf(stderr, "no such user\n");
110
    syslog(LOG_NOTICE, "cannot find user %s",
111
      username);
112
    return PAM_AUTHINFO_UNAVAIL;
113
  }
114
115
#ifdef HAVE_SKEYACCESS
116
117
  /* Do actual checking - we assume skeyaccess() returns PERMIT which is
118
   * by default 1. Notice 4th argument is NULL - we will not perform
119
   * address checks on host itself */
120
  if (skeyaccess(pwuser, port, host, NULL) != 1)
121
  {
122
    fprintf(stderr, "no s/key access permissions\n");
123
    syslog(LOG_NOTICE, "no s/key access permissions for %s",
124
        username);
125
    return PAM_AUTH_ERR;
126
  }
127
128
#endif /* HAVE_SKEYACCESS */
129
130
  return PAM_SUCCESS;
131
}
132
133
/* Get module optional parameters */
134
static void mod_getopt(unsigned *mod_opt, int mod_argc, const char **mod_argv)
135
{
136
  int i;
137
138
  /* Setup runtime defaults */
139
  *mod_opt |= _MOD_DEFAULT_FLAG;
140
  *mod_opt &= _MOD_DEFAULT_MASK;
141
142
  /* Setup runtime options */
143
  while (mod_argc--)
144
  {
145
    for (i = 0; i < _MOD_ARGS; ++i)
146
    {
147
      if (mod_args[i].token != NULL &&
148
          !strncmp(*mod_argv, mod_args[i].token,
149
            strlen(mod_args[i].token)))
150
        break;
151
    }
152
    if (i >= _MOD_ARGS)
153
      syslog(LOG_ERR, "unknown option %s", *mod_argv);
154
    else
155
    {
156
      *mod_opt &= mod_args[i].mask; /* Turn off */
157
      *mod_opt |= mod_args[i].flag; /* Turn on */
158
    }
159
    ++mod_argv;
160
  }
161
}

Return to bug 55279