def _mkpwent(pw): return struct_passwd([ ffi.string(pw.pw_name), ffi.string(pw.pw_passwd), pw.pw_uid, pw.pw_gid, ffi.string(pw.pw_gecos), ffi.string(pw.pw_dir), ffi.string(pw.pw_shell) ])
def _mkpwent(pw): return struct_passwd([ ffi.string(pw.pw_name), ffi.string(pw.pw_passwd), pw.pw_uid, pw.pw_gid, ffi.string(pw.pw_gecos), ffi.string(pw.pw_dir), ffi.string(pw.pw_shell)])
def _group_from_gstruct(res): i = 0 members = [] while res.gr_mem[i]: members.append(ffi.string(res.gr_mem[i])) i += 1 return struct_group([ os.fsdecode(ffi.string(res.gr_name)), os.fsdecode(ffi.string(res.gr_passwd)), res.gr_gid, members ])
def _group_from_gstruct(res): i = 0 members = [] while res.gr_mem[i]: members.append(os.fsdecode(ffi.string(res.gr_mem[i]))) i += 1 return struct_group([ os.fsdecode(ffi.string(res.gr_name)), os.fsdecode(ffi.string(res.gr_passwd)), res.gr_gid, members])