Changeset 1631


Ignore:
Timestamp:
Sep 9, 2010, 12:29:54 AM (11 years ago)
Author:
andersk
Message:
admof: Do not use Kerberos IV
Location:
branches/fc13-dev/server/common/oursrc/accountadm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/fc13-dev/server/common/oursrc/accountadm/Makefile.in

    r1376 r1631  
    1111
    1212admof: admof.c
    13         $(CC) $(CPPFLAGS) $(CFLAGS) $< -L/usr/lib/afs -L/usr/lib64/afs -lprot -lauth -lrxkad -lubik -laudit -lsys -lrx -llwp -lsys -lafsutil -lcom_err -lresolv -lkrb5 -ldes -lkrb4 -o $@
     13        $(CC) $(CPPFLAGS) $(CFLAGS) $< -L/usr/lib/afs -L/usr/lib64/afs -lprot -lauth -lrxkad -lubik -laudit -lsys -lrx -llwp -lsys -lafsutil -lcom_err -lresolv -lkrb5 -ldes -o $@
    1414
    1515install:
  • branches/fc13-dev/server/common/oursrc/accountadm/admof.c

    r1601 r1631  
    3030#include <afs/afsutil.h>
    3131#include <krb5.h>
    32 #include <kerberosIV/krb.h>
    3332#include <stdbool.h>
    3433#include <syslog.h>
     34
     35#define ANAME_SZ 40
     36#define REALM_SZ 40
     37#define INST_SZ 40
     38#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2)
    3539
    3640extern int pioctl(char *, afs_int32, struct ViceIoctl *, afs_int32);
     
    117121    if (krb5_524_conv_principal(context, principal, pname, pinst, prealm) != 0)
    118122        die("internal error: krb5_524_conv_principal failed\n");
    119     if (kname_unparse(user, pname, pinst,
    120                       strcmp(prealm, realm_list[0]) == 0 ? NULL : prealm) != 0)
    121         die("internal error: kname_unparse failed\n");
     123
     124    krb5_data realm = *krb5_princ_realm(context, principal);
     125    if (realm.length > REALM_SZ - 1)
     126        realm.length = REALM_SZ - 1;
     127    if (strlen(realm_list[0]) == realm.length &&
     128        memcmp(realm.data, realm_list[0], realm.length) == 0)
     129        snprintf(user, MAX_K_NAME_SZ, "%s%s%s",
     130                 pname, pinst[0] ? "." : "", pinst);
     131    else
     132        snprintf(user, MAX_K_NAME_SZ, "%s%s%s@%.*s",
     133                 pname, pinst[0] ? "." : "", pinst, realm.length, realm.data);
    122134
    123135    krb5_free_principal(context, principal);
Note: See TracChangeset for help on using the changeset viewer.