From: Mark Eichin Date: Thu, 16 Nov 1995 03:08:18 +0000 (+0000) Subject: * *.c (*): initialize lock_arg to a copy of a static X-Git-Tag: krb5-1.0-beta6~796 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aa9faf302a09736947dd70b0b05d4fcbb06c37b9;p=krb5.git * *.c (*): initialize lock_arg to a copy of a static (thus zero) struct flock, to avoid panic'ing sunos 4.1.4. If you call fcntl F_SETLKW with l_type == F_UNLCK and l_xxx == 15 (GRANT_LOCK_FLAG) you'll panic sunos 4.1.4 with assertion failed: ld->l_xxx != GRANT_LOCK_FLAG, file: ../../ufs/ufs_lockf.c, line: 995 Since automatic structs like these have random values in uninitialized fields, we initialize from a static struct (since using memset in this case is abhorrent, and naming l_xxx is non POSIX.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7109 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/popper/ChangeLog b/src/appl/popper/ChangeLog index f32e06e78..bd9885fd0 100644 --- a/src/appl/popper/ChangeLog +++ b/src/appl/popper/ChangeLog @@ -6,6 +6,15 @@ Fri Jul 7 15:44:56 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in - Remove all explicit library handling. * configure.in - add USE_KADM_LIBRARY and KRB5_LIBRARIES. +Wed Nov 15 20:36:33 1995 Mark Eichin + + * pop_updt.c (pop_updt): initialize lock_arg to a copy of a static + (thus zero) struct flock, to avoid panic'ing sunos 4.1.4. + +Wed Nov 15 20:35:19 1995 Mark Eichin + + * pop_dropcopy.c (pop_dropcopy): initialize lock_arg to a copy of + a static (thus zero) struct flock, to avoid panic'ing sunos 4.1.4. Thu Jun 15 17:38:06 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in - Change explicit library names to -l form, and diff --git a/src/appl/popper/pop_dropcopy.c b/src/appl/popper/pop_dropcopy.c index 130989bb4..e745db902 100644 --- a/src/appl/popper/pop_dropcopy.c +++ b/src/appl/popper/pop_dropcopy.c @@ -46,7 +46,10 @@ struct passwd * pwp; off_t offset; /* Old/New boundary */ int nchar; /* Bytes written/read */ #ifdef POSIX_FILE_LOCKS + static struct flock flock_zero; struct flock lock_arg; + + lock_arg = flock_zero; #endif /* Create a temporary maildrop into which to copy the updated maildrop */ diff --git a/src/appl/popper/pop_updt.c b/src/appl/popper/pop_updt.c index 306f6707f..190279342 100644 --- a/src/appl/popper/pop_updt.c +++ b/src/appl/popper/pop_updt.c @@ -55,7 +55,10 @@ POP * p; int begun; /* Sanity check */ #ifdef POSIX_FILE_LOCKS + static struct flock flock_zero; struct flock lock_arg; + + lock_arg = flock_zero; #endif #ifdef DEBUG diff --git a/src/lib/kdb4/ChangeLog b/src/lib/kdb4/ChangeLog index ba30b9ae6..46e1eb3cc 100644 --- a/src/lib/kdb4/ChangeLog +++ b/src/lib/kdb4/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 15 20:37:30 1995 Mark Eichin + + * krb_dbm.c (kerb_dbl_lock): initialize f to a copy of a static + (thus zero) struct flock, to avoid panic'ing sunos 4.1.4. + (kerb_dbl_unlocK): ditto. Thu Jun 15 18:06:24 EDT 1995 Paul Park (pjpark@mit.edu) * configure.in - Create symlink for archive when we build it. diff --git a/src/lib/kdb4/krb_dbm.c b/src/lib/kdb4/krb_dbm.c index 7dfb6bcef..b9baf9755 100644 --- a/src/lib/kdb4/krb_dbm.c +++ b/src/lib/kdb4/krb_dbm.c @@ -731,8 +731,11 @@ static int kerb_dbl_lock(mode) int mode; { #ifdef POSIX_FILE_LOCKS + static struct flock flock_zero; struct flock f; int rv; + + f = flock_zero; #else int flock_mode; #endif @@ -792,7 +795,10 @@ static int kerb_dbl_lock(mode) static void kerb_dbl_unlock() { #ifdef POSIX_FILE_LOCKS + static struct flock flock_zero; struct flock f; + + f = flock_zero; #endif if (!mylock) { /* lock already unlocked */ diff --git a/src/lib/krb4/ChangeLog b/src/lib/krb4/ChangeLog index 8a090da68..5cfac77d2 100644 --- a/src/lib/krb4/ChangeLog +++ b/src/lib/krb4/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 15 20:38:38 1995 Mark Eichin + + * tf_util.c (emul_flock): initialize f to a copy of a static + (thus zero) struct flock, to avoid panic'ing sunos 4.1.4. + Sun Nov 12 05:26:08 1995 Mark W. Eichin * g_cnffile.c (krb__get_srvtabname): new function, looks up diff --git a/src/lib/krb4/tf_util.c b/src/lib/krb4/tf_util.c index 02af59d4b..7761b3d58 100644 --- a/src/lib/krb4/tf_util.c +++ b/src/lib/krb4/tf_util.c @@ -76,8 +76,11 @@ int utimes(path, times) int emul_flock(fd, cmd) int fd, cmd; { + static struct flock flock_zero; struct flock f; + f = flock_zero; + memset(&f, 0, sizeof (f)); if (cmd & LOCK_UN) diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog index 65a0d6e0d..f8b252791 100644 --- a/src/lib/krb5/ccache/file/ChangeLog +++ b/src/lib/krb5/ccache/file/ChangeLog @@ -52,6 +52,12 @@ Wed July 5 15:52:31 1995 James Mattly * fcc_gennew.c conditons for HAS_MACSOCK_H and THREEPARAMOPEN * fcc_maybe.c conditons for HAS_MACSOCK_H +Wed Nov 15 20:39:18 1995 Mark Eichin + + * fcc_maybe.c (fcc_lock_file_posix): initialize lock_arg to a copy + of a static (thus zero) struct flock, to avoid panic'ing sunos + 4.1.4. + Wed Jun 14 23:54:09 1995 Theodore Y. Ts'o (tytso@dcl) * fcc_errs.c (krb5_fcc_interpret): Add #ifdef around switch diff --git a/src/lib/krb5/ccache/file/fcc_maybe.c b/src/lib/krb5/ccache/file/fcc_maybe.c index ce7d033e4..30657b29d 100644 --- a/src/lib/krb5/ccache/file/fcc_maybe.c +++ b/src/lib/krb5/ccache/file/fcc_maybe.c @@ -75,6 +75,9 @@ int lockunlock; int lock_cmd = F_SETLKW; struct flock lock_arg; + static struct flock flock_zero; + + lock_arg = flock_zero; #define lock_flag lock_arg.l_type lock_flag = -1; diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index cf2c45624..bd58f06e8 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 15 20:40:03 1995 Mark Eichin + + * lock_file.c (krb5_lock_file): initialize lock_arg to a copy of a + static (thus zero) struct flock, to avoid panic'ing sunos 4.1.4. + Sun Nov 12 05:31:21 1995 Mark W. Eichin * def_realm.c (krb5_get_default_realm): check for PROF_NO_PROFILE diff --git a/src/lib/krb5/os/lock_file.c b/src/lib/krb5/os/lock_file.c index 5571521b9..4994caf08 100644 --- a/src/lib/krb5/os/lock_file.c +++ b/src/lib/krb5/os/lock_file.c @@ -59,7 +59,9 @@ krb5_lock_file(context, fd, mode) { #ifdef POSIX_FILE_LOCKS int lock_cmd = F_SETLKW; + static struct flock flock_zero; struct flock lock_arg; + lock_arg = flock_zero; #define lock_flag lock_arg.l_type lock_flag = -1; #else