]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-darwin90-ukernel-setjmp-conflict-20060927
authorDerrick Brashear <shadow@dementia.org>
Wed, 27 Sep 2006 22:14:27 +0000 (22:14 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 27 Sep 2006 22:14:27 +0000 (22:14 +0000)
FIXES 39354

setjmp isn't safe for #define KERNEL

(cherry picked from commit 4bfe736b9157fa3ee4c1c851e53d66b18e774827)

src/afs/LINUX/osi_groups.c
src/afs/UKERNEL/sysincludes.h
src/afs/afs_osi.c

index c4a0514dd57a9cdde6bf9957c6e37c07850d7130..a754cb60f8dfd522b885602c3c38eb039e35c39e 100644 (file)
@@ -554,12 +554,26 @@ static int afs_pag_match(const struct key *key, const void *description)
        return strcmp(key->description, description) == 0;
 }
 
+static void afs_pag_destroy(struct key *key)
+{
+    afs_uint32 pag = key->payload.value;
+    struct unixuser *pu;
+
+    pu = afs_FindUser(pag, -1, READ_LOCK);
+    if (pu) {
+       pu->ct.EndTimestamp = 0;
+       pu->tokenTime = 0;
+       afs_PutUser(pu, READ_LOCK);
+    }
+}
+
 struct key_type key_type_afs_pag =
 {
     .name        = "afs_pag",
     .describe    = afs_pag_describe,
     .instantiate = afs_pag_instantiate,
     .match       = afs_pag_match,
+    .destroy     = afs_pag_destroy,
 };
 
 void osi_keyring_init(void)
index 54f078beb117f2f53acbd79bf20979a68ef2f0bc..2c851b0e2cb2cb6c37e64fc3633f9335434fd074 100644 (file)
@@ -21,7 +21,9 @@
 #include  <limits.h>
 #include  <assert.h>
 #include  <stdarg.h>
+#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */
 #include <setjmp.h>
+#endif
 
 #ifdef AFS_USR_SUN5_ENV
 #include  <signal.h>
 #define AFS_USR_UNDEF_KERNEL_ENV 1
 #endif
 #include  <errno.h>
+#include  <setjmp.h>
 #include  <sys/param.h>
 #include  <sys/types.h>
 #include  <sys/socket.h>
index a36729a2446d2ab20e7eae3f54d6fbcdb35660e0..559657c411bb6d62eae8bb592fb0b476c870e87c 100644 (file)
@@ -805,11 +805,13 @@ afs_osi_TraverseProcTable(void)
 #endif
 
 #if defined(AFS_LINUX22_ENV)
-extern rwlock_t tasklist_lock __attribute__((weak));
 void
 afs_osi_TraverseProcTable()
 {
+#if !defined(LINUX_KEYRING_SUPPORT)
+    extern rwlock_t tasklist_lock __attribute__((weak));
     struct task_struct *p;
+
     if (&tasklist_lock)
        read_lock(&tasklist_lock);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
@@ -846,6 +848,7 @@ afs_osi_TraverseProcTable()
     else
        rcu_read_unlock();
 #endif
+#endif
 }
 #endif