Changeset 1047


Ignore:
Timestamp:
Apr 2, 2009, 7:52:34 PM (16 years ago)
Author:
geofft
Message:
openafs-scripts.patch: efficiency hack

afs_GetAccessBits is a function call that can potentially do an RPC. Although I
doubt it does so in this context, we might as well short circuit it, because
the check for whether you're root or Apache is easy, and that case is rare.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/common/patches/openafs-scripts.patch

    r937 r1047  
    162162+           !(((arights & ~(PRSFS_LOOKUP|PRSFS_READ)) == 0) && areq->realuid == HTTPD_UID) &&
    163163+           !(((arights & ~(PRSFS_LOOKUP|PRSFS_READ)) == 0) && areq->realuid == POSTFIX_UID) &&
    164 +           !(PRSFS_USR3 == afs_GetAccessBits(avc, PRSFS_USR3, areq) && areq->realuid == 0) &&
    165 +           !(PRSFS_USR4 == afs_GetAccessBits(avc, PRSFS_USR4, areq) && (areq->realuid == 0 || areq->realuid == SIGNUP_UID)) ) {
     164+           !(areq->realuid == 0 && PRSFS_USR3 == afs_GetAccessBits(avc, PRSFS_USR3, areq)) &&
     165+           !((areq->realuid == 0 || areq->realuid == SIGNUP_UID) && PRSFS_USR4 == afs_GetAccessBits(avc, PRSFS_USR4, areq)) ) {
    166166+         return 0;
    167167+      }
     
    181181+             !(arights == PRSFS_LOOKUP && areq->realuid == POSTFIX_UID) &&
    182182+             !(arights == PRSFS_READ && areq->realuid == HTTPD_UID && avc->m.Mode == 33279) &&
    183 +             !(PRSFS_USR3 == afs_GetAccessBits(avc, PRSFS_USR3, areq) && areq->realuid == 0) &&
    184 +             !(PRSFS_USR4 == afs_GetAccessBits(avc, PRSFS_USR4, areq) && (areq->realuid == 0 || areq->realuid == SIGNUP_UID)) ) {
     183+             !(areq->realuid == 0 && PRSFS_USR3 == afs_GetAccessBits(avc, PRSFS_USR3, areq)) &&
     184+             !((areq->realuid == 0 || areq->realuid == SIGNUP_UID) PRSFS_USR4 == afs_GetAccessBits(avc, PRSFS_USR4, areq)) ) {
    185185+           return 0;
    186186+        }
Note: See TracChangeset for help on using the changeset viewer.