From: Sam Hartman Date: Wed, 14 Jun 1995 18:05:37 +0000 (+0000) Subject: Wed Jun 14 12:37:51 1995 Sam Hartman X-Git-Tag: krb5-1.0-beta6~1750 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9e6f0fdfd1caf9f9a6c6bafef0c372d4a6c3689e;p=krb5.git Wed Jun 14 12:37:51 1995 Sam Hartman * configure.in: Check for umask being defined. * store_mkey.c (krb5_db_store_mkey): Use HAVE_UMASK instead of unix as a preprocessor define for setting the umask. AIX doesn't define unix. * t_kdb.c (main): Declare option as int, not char. When char is unsigned, the comparison to EOF fails and it loops forever. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6060 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index fde12d6bb..2c32b96fc 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,15 @@ +Wed Jun 14 12:37:51 1995 Sam Hartman + + * configure.in: Check for umask being defined. + + * store_mkey.c (krb5_db_store_mkey): Use HAVE_UMASK instead of + unix as a preprocessor define for setting the umask. AIX doesn't + define unix. + + * t_kdb.c (main): Declare option as int, not char. When char is + unsigned, the comparison to EOF fails and it loops forever. + + Sun Jun 11 09:26:48 1995 Ezra Peisach * Makefile.in (clean): Remove t_kdb and t_kdb.o diff --git a/src/lib/kdb/configure.in b/src/lib/kdb/configure.in index 4ea81341b..1b97e4e15 100644 --- a/src/lib/kdb/configure.in +++ b/src/lib/kdb/configure.in @@ -5,6 +5,6 @@ AC_PROG_ARCHIVE_ADD AC_PROG_RANLIB AC_PROG_INSTALL AC_HAVE_HEADERS(unistd.h) -AC_HAVE_FUNCS(srand48 srand srandom) +AC_CHECK_FUNCS(srand48 srand srandom umask) AppendRule([all:: libkdb5.a]) V5_AC_OUTPUT_MAKEFILE diff --git a/src/lib/kdb/store_mkey.c b/src/lib/kdb/store_mkey.c index d739e2626..ddec7d203 100644 --- a/src/lib/kdb/store_mkey.c +++ b/src/lib/kdb/store_mkey.c @@ -57,7 +57,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) krb5_ui_2 keytype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); -#if defined(unix) || defined(__unix__) +#if HAVE_UMASK int oumask; #endif @@ -70,7 +70,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) keyfile = defkeyfile; } -#if defined(unix) || defined(__unix__) +#if HAVE_UMASK oumask = umask(077); #endif #ifdef ANSI_STDIO @@ -79,7 +79,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) if (!(kf = fopen(keyfile, "w"))) #endif { -#if defined(unix) || defined(__unix__) +#if HAVE_UMASK (void) umask(oumask); #endif return errno; @@ -96,7 +96,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) } if (fclose(kf) == EOF) retval = errno; -#if defined(unix) || defined(__unix__) +#if HAVE_UMASK (void) umask(oumask); #endif return retval; diff --git a/src/lib/kdb/t_kdb.c b/src/lib/kdb/t_kdb.c index b14ef15fa..7807b8aa3 100644 --- a/src/lib/kdb/t_kdb.c +++ b/src/lib/kdb/t_kdb.c @@ -795,7 +795,7 @@ main(argc, argv) int argc; char *argv[]; { - char option; + int option; extern char *optarg; int do_time, do_random, num_passes, check_cont, verbose, error;