diff options
author | ache <ache@FreeBSD.org> | 1997-09-29 08:53:38 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-09-29 08:53:38 +0000 |
commit | 620a15402ca567d1bb9f3ff04408b31d5195a26d (patch) | |
tree | bad95c33ccd79344b37c342113b585dc03504240 /contrib/opie/libopie/writerec.c | |
parent | e1721b38212f929793aa901252e7ce3b6e495d69 (diff) | |
download | FreeBSD-src-620a15402ca567d1bb9f3ff04408b31d5195a26d.zip FreeBSD-src-620a15402ca567d1bb9f3ff04408b31d5195a26d.tar.gz |
Upgrade to 2.31
Diffstat (limited to 'contrib/opie/libopie/writerec.c')
-rw-r--r-- | contrib/opie/libopie/writerec.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/contrib/opie/libopie/writerec.c b/contrib/opie/libopie/writerec.c index 6978669..2246899 100644 --- a/contrib/opie/libopie/writerec.c +++ b/contrib/opie/libopie/writerec.c @@ -1,13 +1,15 @@ /* writerec.c: The __opiewriterec() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Removed active attack protection + support. Fixed passwd bug. Created by cmetz for OPIE 2.3 from passwd.c. */ #include "opie_cfg.h" @@ -46,23 +48,19 @@ int __opiewriterec FUNCTION((opie), struct opie *opie) if (!(opie->opie_flags & __OPIE_FLAGS_READ)) { struct opie opie2; i = opielookup(&opie2, opie->opie_principal); + opie->opie_flags = opie2.opie_flags; + opie->opie_recstart = opie2.opie_recstart; } switch(i) { case 0: - if (!(f = __opieopen(STD_KEY_FILE, 1, 0644))) - return -1; - if (!(f2 = __opieopen(EXT_KEY_FILE, 1, 0600))) + if (!(f = __opieopen(KEY_FILE, 1, 0644))) return -1; if (fseek(f, opie->opie_recstart, SEEK_SET)) return -1; - if (fseek(f2, opie->opie_extrecstart, SEEK_SET)) - return -1; break; case 1: - if (!(f = __opieopen(STD_KEY_FILE, 2, 0644))) - return -1; - if (!(f2 = __opieopen(EXT_KEY_FILE, 2, 0600))) + if (!(f = __opieopen(KEY_FILE, 2, 0644))) return -1; break; default: @@ -74,12 +72,5 @@ int __opiewriterec FUNCTION((opie), struct opie *opie) fclose(f); - if (f2) { - if (fprintf(f2, "%-32s %-16s %-77s\n", opie->opie_principal, opie->opie_reinitkey ? opie->opie_reinitkey : __opienone, "") < 1) - return -1; - - fclose(f2); - } - return 0; } |