diff options
author | Chris Provenzano <proven@mit.edu> | 1995-08-16 07:31:37 +0000 |
---|---|---|
committer | Chris Provenzano <proven@mit.edu> | 1995-08-16 07:31:37 +0000 |
commit | 305eb9de72a961f8bf5cbb8844e34a12cd1f523e (patch) | |
tree | 73287a0f836cf2421309bfb35967505607092b2d /src/lib | |
parent | 437bc39bdbffb4ae309c21cf667c780b80317d6b (diff) | |
download | krb5-305eb9de72a961f8bf5cbb8844e34a12cd1f523e.tar.gz krb5-305eb9de72a961f8bf5cbb8844e34a12cd1f523e.tar.xz krb5-305eb9de72a961f8bf5cbb8844e34a12cd1f523e.zip |
Pass fds to krb5_lock_file() and krb5_unlock_file()
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6539 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/krb5/ccache/stdio/ChangeLog | 4 | ||||
-rw-r--r-- | src/lib/krb5/ccache/stdio/scc_maybe.c | 16 | ||||
-rw-r--r-- | src/lib/krb5/keytab/file/ChangeLog | 4 | ||||
-rw-r--r-- | src/lib/krb5/keytab/file/ktf_util.c | 11 |
4 files changed, 21 insertions, 14 deletions
diff --git a/src/lib/krb5/ccache/stdio/ChangeLog b/src/lib/krb5/ccache/stdio/ChangeLog index b62956693..64544d2b6 100644 --- a/src/lib/krb5/ccache/stdio/ChangeLog +++ b/src/lib/krb5/ccache/stdio/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 16 02:45:19 1995 Chris Provenzano <proven@mit.edu> + + * scc_maybe.c: Pass fds to krb5_lock_file() and krb5_unlock_file() + Tue Jul 11 19:22:17 1995 Ezra Peisach <epeisach@kangaroo.mit.edu> * scc-proto.h: Add prototype for krb5_scc_read. diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c index 3e9194ee2..f6e008ddd 100644 --- a/src/lib/krb5/ccache/stdio/scc_maybe.c +++ b/src/lib/krb5/ccache/stdio/scc_maybe.c @@ -56,12 +56,12 @@ krb5_scc_close_file (context, id) memset (data->stdio_buffer, 0, sizeof (data->stdio_buffer)); if (ret == EOF) { int errsave = errno; - (void) krb5_unlock_file(context, data->file, data->filename); + (void) krb5_unlock_file(context, fileno(data->file)); (void) fclose (data->file); data->file = 0; return krb5_scc_interpret (context, errsave); } - retval = krb5_unlock_file(context, data->file, data->filename); + retval = krb5_unlock_file(context, fileno(data->file)); ret = fclose (data->file); data->file = 0; if (retval) @@ -85,7 +85,7 @@ krb5_scc_open_file (context, id, mode) data = (krb5_scc_data *) id->data; if (data->file) { /* Don't know what state it's in; shut down and start anew. */ - (void) krb5_unlock_file(context, data->file, data->filename); + (void) krb5_unlock_file(context, fileno(data->file)); (void) fclose (data->file); data->file = 0; } @@ -127,14 +127,14 @@ krb5_scc_open_file (context, id, mode) #endif switch (mode) { case SCC_OPEN_RDONLY: - if ((retval = krb5_lock_file(context, f, data->filename, KRB5_LOCKMODE_SHARED))) { + if ((retval = krb5_lock_file(context,fileno(f),KRB5_LOCKMODE_SHARED))){ (void) fclose(f); return retval; } break; case SCC_OPEN_RDWR: case SCC_OPEN_AND_ERASE: - if ((retval = krb5_lock_file(context, f, data->filename, + if ((retval = krb5_lock_file(context, fileno(f), KRB5_LOCKMODE_EXCLUSIVE))) { (void) fclose(f); return retval; @@ -150,14 +150,14 @@ krb5_scc_open_file (context, id, mode) data->version = krb5_scc_default_format; if (!fwrite((char *)fvno_bytes, sizeof(fvno_bytes), 1, f)) { errsave = errno; - (void) krb5_unlock_file(context, f, data->filename); + (void) krb5_unlock_file(context, fileno(f)); (void) fclose(f); return krb5_scc_interpret(context, errsave); } } else { /* verify a valid version number is there */ if (!fread((char *)fvno_bytes, sizeof(fvno_bytes), 1, f)) { - (void) krb5_unlock_file(context, f, data->filename); + (void) krb5_unlock_file(context, fileno(f)); (void) fclose(f); return KRB5_CCACHE_BADVNO; } @@ -165,7 +165,7 @@ krb5_scc_open_file (context, id, mode) if ((data->version != KRB5_SCC_FVNO_1) && (data->version != KRB5_SCC_FVNO_2) && (data->version != KRB5_SCC_FVNO_3)) { - (void) krb5_unlock_file(context, f, data->filename); + (void) krb5_unlock_file(context, fileno(f)); (void) fclose(f); return KRB5_CCACHE_BADVNO; } diff --git a/src/lib/krb5/keytab/file/ChangeLog b/src/lib/krb5/keytab/file/ChangeLog index 134f97a6d..7f22f2710 100644 --- a/src/lib/krb5/keytab/file/ChangeLog +++ b/src/lib/krb5/keytab/file/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 16 02:45:19 1995 Chris Provenzano <proven@mit.edu> + + * ktf_util.c: Pass fds to krb5_lock_file() and krb5_unlock_file() + Tue Aug 15 01:34:57 1995 Tom Yu <tlyu@dragons-lair.MIT.EDU> * ktf_util.c: return KRB5_KEYTAB_BADVNO instead of -1 diff --git a/src/lib/krb5/keytab/file/ktf_util.c b/src/lib/krb5/keytab/file/ktf_util.c index 9c2f7aa55..42009a050 100644 --- a/src/lib/krb5/keytab/file/ktf_util.c +++ b/src/lib/krb5/keytab/file/ktf_util.c @@ -122,8 +122,7 @@ int mode; } else /* some other error */ return errno; } - if ((kerror = krb5_lock_file(context, KTFILEP(id), KTFILENAME(id), - mode))) { + if ((kerror = krb5_lock_file(context, fileno(KTFILEP(id)), mode))) { (void) fclose(KTFILEP(id)); KTFILEP(id) = 0; return kerror; @@ -137,7 +136,7 @@ int mode; KTVERSION(id) = krb5_kt_default_vno; if (!xfwrite(&kt_vno, sizeof(kt_vno), 1, KTFILEP(id))) { kerror = errno; - (void) krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); + (void) krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); return kerror; } @@ -145,14 +144,14 @@ int mode; /* gotta verify it instead... */ if (!xfread(&kt_vno, sizeof(kt_vno), 1, KTFILEP(id))) { kerror = errno; - (void) krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); + (void) krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); return kerror; } kt_vno = KTVERSION(id) = ntohs(kt_vno); if ((kt_vno != KRB5_KT_VNO) && (kt_vno != KRB5_KT_VNO_1)) { - (void) krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); + (void) krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); return KRB5_KEYTAB_BADVNO; } @@ -185,7 +184,7 @@ krb5_keytab id; if (!KTFILEP(id)) return 0; - kerror = krb5_unlock_file(context, KTFILEP(id), KTFILENAME(id)); + kerror = krb5_unlock_file(context, fileno(KTFILEP(id))); (void) fclose(KTFILEP(id)); KTFILEP(id) = 0; return kerror; |