[5814] in Athena Bugs

home help back first fref pref prev next nref lref last post

7.1H: libacl.a

daemon@ATHENA.MIT.EDU (lwvanels@MIT.EDU)
Fri Aug 24 03:21:02 1990

From: lwvanels@MIT.EDU
Date: Fri, 24 Aug 90 03:20:45 -0400
To: bugs@ATHENA.MIT.EDU

When the acl_load function is called for a non-existant acl file, it will
cause the cache to fill up with multiple copies of the cache entry for that
acl.  This is because the comparison looks at the status of the file
descriptor as well as the filename when it is looking for matching entries
in the cache; it should only look at the filename when looking for matching
entries, and just use the value of the file descriptor to determine whether
to try re-opening that file.

*** /tmp/,RCSt1018150	Fri Aug 24 02:53:43 1990
--- acl_files.c	Fri Aug 24 01:44:40 1990
***************
*** 387,396 ****
      char canon[MAX_PRINCIPAL_SIZE];
  
      /* See if it's there already */
!     for(i = 0; i < acl_cache_count; i++) {
! 	if(!strcmp(acl_cache[i].filename, name)
! 	   && acl_cache[i].fd >= 0) goto got_it;
!     }
  
      /* It isn't, load it in */
      /* maybe there's still room */
--- 387,399 ----
      char canon[MAX_PRINCIPAL_SIZE];
  
      /* See if it's there already */
!     for(i = 0; i < acl_cache_count; i++)
! 	if(!strcmp(acl_cache[i].filename, name)) {
! 	   if acl_cache[i].fd >= 0)
! 	      goto got_it;
! 	   else /* Exists in cache, but wasn't able to be opened last time */
! 	      goto in_cache;
!         }
  
      /* It isn't, load it in */
      /* maybe there's still room */
***************
*** 409,414 ****
--- 412,418 ----
  
      /* Set up the acl */
      strcpy(acl_cache[i].filename, name);
+  in_cache:
      if((acl_cache[i].fd = open(name, O_RDONLY, 0)) < 0) return(-1);
      /* Force reload */
      acl_cache[i].acl = (struct hashtbl *) 0;


Thanks to Ezra for helping to track this down.

home help back first fref pref prev next nref lref last post