summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@fedoraproject.org>2008-10-28 21:36:18 +0000
committerNalin Dahyabhai <nalin@fedoraproject.org>2008-10-28 21:36:18 +0000
commit6df4ee1a7acf7fc7327b36ab46163805064d8ee4 (patch)
tree6e43e5ab6070337e8f728ff24569d350f52a9c23
parent0d57fe8b860cff34e2a9c7c39e0979304a10af45 (diff)
downloadkrb5-6df4ee1a7acf7fc7327b36ab46163805064d8ee4.tar.gz
krb5-6df4ee1a7acf7fc7327b36ab46163805064d8ee4.tar.xz
krb5-6df4ee1a7acf7fc7327b36ab46163805064d8ee4.zip
- krb5_fcc_generate_new(): unlock the fcc list lock before returning in theF-10-split
non-mkstemp() case, don't unlock the lock twice before returning if we happen to run out of memory (fixed in trunk by rewriting the function)
-rw-r--r--krb5-1.6.3-cc_gen_new-locks.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/krb5-1.6.3-cc_gen_new-locks.patch b/krb5-1.6.3-cc_gen_new-locks.patch
new file mode 100644
index 0000000..b1e18e6
--- /dev/null
+++ b/krb5-1.6.3-cc_gen_new-locks.patch
@@ -0,0 +1,25 @@
+We lock "krb5int_cc_file_mutex" before attempting to open the file in the
+we-don't-have-mkstemp() case. And we shouldn't be trying to unlock it twice.
+The function's rewritten in 1.6.4, but fix it here in the meantime.
+--- krb5-1.6.3/src/lib/krb5/ccache/cc_file.c 2008-10-28 17:20:13.000000000 -0400
++++ krb5-1.6.3/src/lib/krb5/ccache/cc_file.c 2008-10-28 17:20:07.000000000 -0400
+@@ -1976,8 +1976,9 @@ krb5_fcc_generate_new (krb5_context cont
+ mktemp(scratch);
+ /* Make sure the file name is reserved */
+ ret = THREEPARAMOPEN(scratch, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0);
+ if (ret == -1) {
++ k5_mutex_unlock(&krb5int_cc_file_mutex);
+ return krb5_fcc_interpret(context, errno);
+ }
+ #endif
+
+@@ -1995,9 +1996,8 @@ krb5_fcc_generate_new (krb5_context cont
+ k5_mutex_unlock(&krb5int_cc_file_mutex);
+ free(data);
+ close(ret);
+ unlink(scratch);
+- k5_mutex_unlock(&krb5int_cc_file_mutex);
+ return KRB5_CC_NOMEM;
+ }
+
+ kret = k5_mutex_init(&data->lock);