X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/blobdiff_plain/3fbeec9f565ec843972c35d1ea3fb97ad1fb7f15..a589b6a78351509326cd03bc790c271de31e7914:/afs/_pts.pyx diff --git a/afs/_pts.pyx b/afs/_pts.pyx index 90b3327..eb62c08 100644 --- a/afs/_pts.pyx +++ b/afs/_pts.pyx @@ -70,7 +70,6 @@ cdef import from "afs/ptuser.h": cdef import from "afs/pterror.h": enum: PRNOENT - PRTOOMANY cdef class PTEntry: cdef public afs_int32 flags @@ -134,6 +133,7 @@ cdef class PTS: server """ cdef ubik_client * client + cdef readonly object cell def __cinit__(self, cell=None, sec=1): cdef afs_int32 code @@ -167,6 +167,8 @@ cdef class PTS: code = afsconf_GetCellInfo(cdir, c_cell, "afsprot", &info) pyafs_error(code) + self.cell = info.name + if sec > 0: strncpy(prin.cell, info.name, sizeof(prin.cell)) prin.instance[0] = 0 @@ -216,7 +218,7 @@ cdef class PTS: integer. """ if isinstance(ident, (str, unicode)): - return self.NameToId(ident) + return self._NameToId(ident) else: return int(ident) @@ -296,7 +298,7 @@ cdef class PTS: cdef afs_int32 code, cid name = name[:PR_MAXNAMELEN].lower() - oid = self.NameOrId(owner) + oid = self._NameOrId(owner) if id is not None: cid = id @@ -313,7 +315,7 @@ cdef class PTS: identifier. """ cdef afs_int32 code - cdef afs_int32 id = self.NameOrId(ident) + cdef afs_int32 id = self._NameOrId(ident) code = ubik_PR_Delete(self.client, 0, id) pyafs_error(code) @@ -323,7 +325,7 @@ cdef class PTS: Add the given user to the given group. """ cdef afs_int32 code - cdef afs_int32 uid = self.NameOrId(user), gid = self.NameOrId(group) + cdef afs_int32 uid = self._NameOrId(user), gid = self._NameOrId(group) code = ubik_PR_AddToGroup(self.client, 0, uid, gid) pyafs_error(code) @@ -333,7 +335,7 @@ cdef class PTS: Remove the given user from the given group. """ cdef afs_int32 code - cdef afs_int32 uid = self.NameOrId(user), gid = self.NameOrId(group) + cdef afs_int32 uid = self._NameOrId(user), gid = self._NameOrId(group) code = ubik_PR_RemoveFromGroup(self.client, 0, uid, gid) pyafs_error(code) @@ -355,7 +357,7 @@ cdef class PTS: cdef int i cdef object members = [] - cdef afs_int32 id = self.NameOrId(ident) + cdef afs_int32 id = self._NameOrId(ident) alist.prlist_len = 0 alist.prlist_val = NULL @@ -367,8 +369,6 @@ cdef class PTS: members.append(alist.prlist_val[i]) free(alist.prlist_val) - if over: - code = PRTOOMANY pyafs_error(code) return members @@ -382,7 +382,7 @@ cdef class PTS: cdef int i cdef object owned = [] - cdef afs_int32 oid = self.NameOrId(owner) + cdef afs_int32 oid = self._NameOrId(owner) alist.prlist_len = 0 alist.prlist_val = NULL @@ -394,8 +394,6 @@ cdef class PTS: owned.append(alist.prlist_val[i]) free(alist.prlist_val) - if over: - code = PRTOOMANY pyafs_error(code) return owned @@ -409,7 +407,7 @@ cdef class PTS: cdef prcheckentry centry cdef object entry = PTEntry() - cdef afs_int32 id = self.NameOrId(ident) + cdef afs_int32 id = self._NameOrId(ident) code = ubik_PR_ListEntry(self.client, 0, id, ¢ry) pyafs_error(code) @@ -428,10 +426,10 @@ cdef class PTS: cdef afs_int32 c_newid = 0, c_newoid = 0 cdef char * c_newname - cdef afs_int32 id = self.NameOrId(ident) + cdef afs_int32 id = self._NameOrId(ident) if newname is None: - newname = self.IdToName(id) + newname = self._IdToName(id) c_newname = newname if newid is not None: c_newid = newid @@ -448,7 +446,7 @@ cdef class PTS: cdef afs_int32 code cdef afs_int32 flag - cdef afs_int32 uid = self.NameOrId(user), gid = self.NameOrId(group) + cdef afs_int32 uid = self._NameOrId(user), gid = self._NameOrId(group) code = ubik_PR_IsAMemberOf(self.client, 0, uid, gid, &flag) pyafs_error(code) @@ -537,7 +535,7 @@ cdef class PTS: cdef afs_int32 code cdef afs_int32 mask = 0, flags = 0, nusers = 0, ngroups = 0 - cdef afs_int32 id = self.NameOrId(ident) + cdef afs_int32 id = self._NameOrId(ident) if access is not None: flags = access