Changeset 1347 for trunk


Ignore:
Timestamp:
Nov 8, 2009, 5:23:09 AM (15 years ago)
Author:
geofft
Message:
admof: Add a -noauth flag.
File:
1 edited

Legend:

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

    r907 r1347  
    88 * Outputs "yes" and exits with status 33 if the given principal is an
    99 * administrator of the locker.
     10 *
     11 * Requires tokens (to authenticate/encrypt the connection to the
     12 * ptserver) unless -noauth is given.
    1013 */
    1114
     
    7881{
    7982    /* Get arguments. */
    80     if (argc != 3)
    81         die("Usage: %s LOCKER PRINCIPAL\n", argv[0]);
    82     const char *locker = argv[1], *name = argv[2];
     83    const char *locker, *name;
     84    afs_int32 secLevel;
     85
     86    if (argc == 3) {
     87        locker = argv[1];
     88        name = argv[2];
     89        secLevel = 3;
     90    } else if (argc == 4 && strcmp("-noauth", argv[1]) == 0) {
     91        locker = argv[2];
     92        name = argv[3];
     93        secLevel = 0;
     94    } else {
     95        die("Usage: %s [-noauth] LOCKER PRINCIPAL\n", argv[0]);
     96    }
    8397
    8498    /* Convert the locker into a directory. */
     
    141155        die("internal error: pioctl: %m\n");
    142156
    143     if (pr_Initialize(3, (char *)AFSDIR_CLIENT_ETC_DIRPATH, cell) != 0)
     157    if (pr_Initialize(secLevel, (char *)AFSDIR_CLIENT_ETC_DIRPATH, cell) != 0)
    144158        die("internal error: pr_Initialize failed\n");
    145159
Note: See TracChangeset for help on using the changeset viewer.