diff --git a/contrib/opie/libopie/lock.c b/contrib/opie/libopie/lock.c index fc449d4cada4..0f666a6480b2 100644 --- a/contrib/opie/libopie/lock.c +++ b/contrib/opie/libopie/lock.c @@ -27,6 +27,8 @@ License Agreement applies to this software. error return values. Check open() return value properly. Avoid NULL. Created at NRL for OPIE 2.2 from opiesubr2.c + +$FreeBSD$ */ #include "opie_cfg.h" #if HAVE_STRING_H @@ -49,12 +51,17 @@ License Agreement applies to this software. #endif /* !HAVE_LSTAT */ int __opie_lockrefcount = 0; +static int do_atexit = 1; +VOIDRET opiedisableaeh FUNCTION_NOARGS +{ + do_atexit = 0; +} #if USER_LOCKING char *__opie_lockfilename = (char *)0; /* atexit() handler for opielock() */ -static VOIDRET opieunlockaeh FUNCTION_NOARGS +VOIDRET opieunlockaeh FUNCTION_NOARGS { if (__opie_lockfilename) { __opie_lockrefcount = 0; @@ -227,7 +234,8 @@ int opielock FUNCTION((principal), char *principal) __opie_lockrefcount++; rval = 0; - atexit(opieunlockaeh); + if (do_atexit) + atexit(opieunlockaeh); lockret: if (fh >= 0) diff --git a/contrib/opie/opie.h b/contrib/opie/opie.h index 71db7bdf1ab6..c41fabf2d24c 100644 --- a/contrib/opie/opie.h +++ b/contrib/opie/opie.h @@ -93,6 +93,9 @@ void opiehash __P((void *, unsigned)); int opiehtoi __P((register char)); int opiekeycrunch __P((int, char *, char *, char *)); int opielock __P((char *)); +int opieunlock __P((void)); +void opieunlockaeh __P((void)); +void opiedisableaeh __P((void)); int opielookup __P((struct opie *,char *)); int opiepasscheck __P((char *)); void opierandomchallenge __P((char *));