Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions afs/_pts.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ cdef class PTEntry:
cdef int _ptentry_from_c(PTEntry p_entry, prcheckentry * c_entry) except -1:
if p_entry is None:
raise TypeError
return -1

p_entry.flags = c_entry.flags
p_entry.id = c_entry.id
Expand All @@ -127,7 +126,6 @@ cdef int _ptentry_from_c(PTEntry p_entry, prcheckentry * c_entry) except -1:
cdef int _ptentry_to_c(prcheckentry * c_entry, PTEntry p_entry) except -1:
if p_entry is None:
raise TypeError
return -1

c_entry.flags = p_entry.flags
c_entry.id = p_entry.id
Expand Down Expand Up @@ -227,7 +225,9 @@ cdef class PTS:

self.cell = info.name

if sec > 0:
if sec == 0:
sc = rxnull_NewClientSecurityObject()
else:
strncpy(prin.cell, info.name, sizeof(prin.cell))
prin.instance[0] = 0
strncpy(prin.name, "afs", sizeof(prin.name))
Expand All @@ -237,6 +237,7 @@ cdef class PTS:
if sec >= 2:
# No really - we wanted authentication
pyafs_error(code)
sc = rxnull_NewClientSecurityObject()
sec = 0
else:
if sec == 3:
Expand All @@ -246,11 +247,7 @@ cdef class PTS:
sc = rxkad_NewClientSecurityObject(level, &token.sessionKey,
token.kvno, token.ticketLen,
token.ticket)

if sec == 0:
sc = rxnull_NewClientSecurityObject()
else:
sec = 2
sec = 2

memset(serverconns, 0, sizeof(serverconns))
for 0 <= i < info.numServers:
Expand Down
4 changes: 2 additions & 2 deletions afs/_util.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cdef int _init = 0

# pioctl convenience wrappers

cdef extern int pioctl_read(char *dir, afs_int32 op, void *buffer, unsigned short size, afs_int32 follow) except -1:
cdef int pioctl_read(char *dir, afs_int32 op, void *buffer, unsigned short size, afs_int32 follow) except -1:
cdef ViceIoctl blob
cdef afs_int32 code
blob.in_size = 0
Expand All @@ -26,7 +26,7 @@ cdef extern int pioctl_read(char *dir, afs_int32 op, void *buffer, unsigned shor
pyafs_error(code)
return code

cdef extern int pioctl_write(char *dir, afs_int32 op, char *buffer, afs_int32 follow) except -1:
cdef int pioctl_write(char *dir, afs_int32 op, char *buffer, afs_int32 follow) except -1:
cdef ViceIoctl blob
cdef afs_int32 code
blob.cin = buffer
Expand Down