4 cdef ubik_client * client
6 def __cinit__(self, cell=None, sec=1):
11 cdef ktc_principal prin
13 cdef rx_securityClass *sc
24 raise Exception(code, "Error initializing Rx")
26 cdir = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH)
29 "Error opening configuration directory (%s): %s" % \
30 (AFSDIR_CLIENT_ETC_DIRPATH, strerror(errno)))
31 code = afsconf_GetCellInfo(cdir, c_cell, "afsprot", &info)
33 raise Exception(code, "GetCellInfo: %s" % error_message(code))
36 strncpy(prin.cell, info.name, sizeof(prin.cell))
38 strncpy(prin.name, "afs", sizeof(prin.name))
40 code = ktc_GetToken(&prin, &token, sizeof(token), NULL);
43 # No really - we wanted authentication
44 raise Exception(code, "Failed to get token for service AFS: %s" % error_message(code))
51 sc = rxkad_NewClientSecurityObject(level, &token.sessionKey,
52 token.kvno, token.ticketLen,
56 sc = rxnull_NewClientSecurityObject()
60 code = rxs_Release(sc)
62 def __dealloc__(self):