From: Ken Raeburn Date: Tue, 30 Apr 1996 21:54:16 +0000 (+0000) Subject: * configure.in: Test that regcomp actually works X-Git-Tag: krb5-1.0-beta6~168 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3c60214962d642df4c10b98c4bb98053a54fcf2b;p=krb5.git * configure.in: Test that regcomp actually works * Makefile.in (check-unix): Use $(RM). * t_an_to_ln.c (main): Print principal name when an error is detected. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7874 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index c6edc6d64..c2b4f96f7 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,12 @@ +Tue Apr 30 17:51:47 1996 Ken Raeburn + + * configure.in: Test that regcomp actually works. + + * Makefile.in (check-unix): Use $(RM). + + * t_an_to_ln.c (main): Print principal name when an error is + detected. + Thu Apr 11 22:15:44 1996 Theodore Y. Ts'o * ustime.c (krb5_us_timeofday): When doing the time offset diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in index 6e23fa75b..8c49fbe40 100644 --- a/src/lib/krb5/os/Makefile.in +++ b/src/lib/krb5/os/Makefile.in @@ -146,7 +146,7 @@ check-unix:: $(KRB5_RUN_ENV) ./t_an_to_ln rul/helpme/e@r ru/123/le@r KRB5_CONFIG=./t_an.conf ; export KRB5_CONFIG ; \ $(KRB5_RUN_ENV) ./t_an_to_ln fred/r@r barney/r@r - rm ./t_an.* + $(RM) ./t_an.* clean:: $(RM) $(TEST_PROGS) test.out t_std_conf.o t_an_to_ln.o diff --git a/src/lib/krb5/os/configure.in b/src/lib/krb5/os/configure.in index f3a48865f..b7f52f497 100644 --- a/src/lib/krb5/os/configure.in +++ b/src/lib/krb5/os/configure.in @@ -4,7 +4,20 @@ dnl time checks are for timeofday.c (which gets them from osconf.h) dnl and gmt_mktime.c (which only gets them from here...) AC_TIME_WITH_SYS_TIME AC_HAVE_HEADERS(unistd.h sys/time.h regex.h regexp.h) -AC_HAVE_FUNCS(re_comp regcomp) + +dnl regcomp is present but non-functional on Solaris 2.4 +AC_C_CROSS +AC_MSG_CHECKING(for working regcomp) +AC_CACHE_VAL(ac_cv_func_regcomp,[ +AC_TRY_RUN([ +#include +regex_t x; regmatch_t m; +int main() { return regcomp(&x,"pat.*",0) || regexec(&x,"pattern",1,&m,0); } +], ac_cv_func_regcomp=yes, ac_cv_func_regcomp=no)]) +AC_MSG_RESULT($ac_cv_func_regcomp) +test $ac_cv_func_regcomp = yes && AC_DEFINE(HAVE_REGCOMP) + +AC_HAVE_FUNCS(re_comp) AC_HEADER_EGREP(time_t, sys/types.h, AC_DEFINE(POSIX_TYPES)) HAS_ANSI_VOLATILE AC_DEFINE(AN_TO_LN_RULES) diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index 318b07403..75f52ace6 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -45,9 +45,7 @@ krb5_sname_to_principal(context, hostname, sname, type, ret_princ) krb5_error_code retval; register char *cp; char localname[MAXHOSTNAMELEN]; - /* We cast this instead of declaring as const char* due to some compilers - * which apparently get upset at reassigning the variable - */ + if ((type == KRB5_NT_UNKNOWN) || (type == KRB5_NT_SRV_HST)) { diff --git a/src/lib/krb5/os/t_an_to_ln.c b/src/lib/krb5/os/t_an_to_ln.c index be91868d8..9fb0c3017 100644 --- a/src/lib/krb5/os/t_an_to_ln.c +++ b/src/lib/krb5/os/t_an_to_ln.c @@ -25,8 +25,8 @@ main(argc, argv) programname, argv[i], sbuf); } else { - printf("%s: aname to lname returns %s\n", programname, - error_message(kret)); + printf("%s: aname to lname returns %s for %s\n", programname, + error_message(kret), argv[i]); } krb5_free_principal(kcontext, principal); }