Changeset 1598 for trunk/server


Ignore:
Timestamp:
Aug 21, 2010, 3:09:23 AM (14 years ago)
Author:
geofft
Message:
admof: Always check system:scripts-root -c athena, not in the locker's cell

Also rename us from OVERLORDS to SYSADMINS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/accountadm/admof.c

    r1597 r1598  
    4040#define STR(x) _STR(x)
    4141
    42 #define OVERLORDS "system:scripts-root"
     42#define SYSADMINS "system:scripts-root"
     43#define SYSADMIN_CELL "athena.mit.edu"
    4344
    4445static bool
     
    243244    int rights = parse_rights(nplus, &p, user);
    244245    rights &= ~parse_rights(nminus, &p, user);
    245 #ifdef OVERLORDS
    246     if (~rights & PRSFS_ADMINISTER && ismember(user, OVERLORDS)) {
    247         openlog("admof", 0, LOG_AUTHPRIV);
    248         syslog(LOG_NOTICE, "giving %s admin rights on %s", user, locker);
    249         closelog();
    250         rights |= PRSFS_ADMINISTER;
     246    pr_End();
     247
     248#ifdef SYSADMINS
     249    if (~rights & PRSFS_ADMINISTER) {
     250        strncpy(cell, SYSADMIN_CELL, MAXCELLCHARS - 1);
     251        if (pr_Initialize(secLevel, (char *)AFSDIR_CLIENT_ETC_DIRPATH, cell) == 0) {
     252            if (ismember(user, SYSADMINS)) {
     253                openlog("admof", 0, LOG_AUTHPRIV);
     254                syslog(LOG_NOTICE, "giving %s admin rights on %s", user, locker);
     255                closelog();
     256                rights |= PRSFS_ADMINISTER;
     257            }
     258            pr_End();
     259        }
     260        /* If not, that's okay -- the normal codepath ran fine, so don't error */
    251261    }
    252262#endif
    253 
    254     pr_End();
    255263
    256264    /* Output whether the user is an administrator. */
Note: See TracChangeset for help on using the changeset viewer.