Пример #1
0
def getent_shadow(database, keys=None):
    if not keys:
        write_shadow(NslcdClient(constants.NSLCD_ACTION_SHADOW_ALL))
        return
    for key in keys:
        con = NslcdClient(constants.NSLCD_ACTION_SHADOW_BYNAME)
        con.write_string(key)
        write_shadow(con)
Пример #2
0
def getent_shadow(database, keys=None):
    if not keys:
        write_shadow(NslcdClient(constants.NSLCD_ACTION_SHADOW_ALL))
        return
    for key in keys:
        con = NslcdClient(constants.NSLCD_ACTION_SHADOW_BYNAME)
        con.write_string(key)
        write_shadow(con)
Пример #3
0
def getent_aliases(database, keys=None):
    if not keys:
        write_aliases(NslcdClient(constants.NSLCD_ACTION_ALIAS_ALL))
        return
    for key in keys:
        con = NslcdClient(constants.NSLCD_ACTION_ALIAS_BYNAME)
        con.write_string(key)
        write_aliases(con)
Пример #4
0
def getent_aliases(database, keys=None):
    if not keys:
        write_aliases(NslcdClient(constants.NSLCD_ACTION_ALIAS_ALL))
        return
    for key in keys:
        con = NslcdClient(constants.NSLCD_ACTION_ALIAS_BYNAME)
        con.write_string(key)
        write_aliases(con)
Пример #5
0
def getent_netgroup(database, keys=None):
    recurse = database == 'netgroup'
    if not keys:
        write_netgroup(NslcdClient(constants.NSLCD_ACTION_NETGROUP_ALL),
                       recurse)
        return
    for key in keys:
        con = NslcdClient(constants.NSLCD_ACTION_NETGROUP_BYNAME)
        con.write_string(key)
        write_netgroup(con, recurse)
Пример #6
0
def getent_netgroup(database, keys=None):
    recurse = database == 'netgroup'
    if not keys:
        write_netgroup(
            NslcdClient(constants.NSLCD_ACTION_NETGROUP_ALL), recurse)
        return
    for key in keys:
        con = NslcdClient(constants.NSLCD_ACTION_NETGROUP_BYNAME)
        con.write_string(key)
        write_netgroup(con, recurse)
Пример #7
0
def getent_netgroup(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_NETGROUP_ALL)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_NETGROUP_BYNAME)
        con.write_string(key)
    for name, members, tripples in _get_getgroups(con, database == 'netgroup'):
        print '%-15s %s' % (name, ' '.join(
                members +
                ['(%s, %s, %s)' % (host, user, domain)
                 for host, user, domain in tripples]
            ))
Пример #8
0
def getent_ethers(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_ETHER_ALL)
    elif re.match('^[0-9a-fA-F]{1,2}(:[0-9a-fA-F]{1,2}){5}$', key):
        con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYETHER)
        con.write_ether(key)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name = con.read_string()
        ether = con.read_ether()
        print '%s %s' % (ether, name)
Пример #9
0
def getent_aliases(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_ALIAS_ALL)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_ALIAS_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%-16s%s' % (
            con.read_string() + ': ',
            ', '.join(con.read_stringlist()),
        )
Пример #10
0
def getent_passwd(database, keys=None):
    if not keys:
        write_passwd(NslcdClient(constants.NSLCD_ACTION_PASSWD_ALL))
        return
    for key in keys:
        if re.match('^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYUID)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYNAME)
            con.write_string(key)
        write_passwd(con)
Пример #11
0
def getent_protocols(database, keys=None):
    if not keys:
        write_protocols(NslcdClient(constants.NSLCD_ACTION_PROTOCOL_ALL))
        return
    for key in keys:
        if re.match(r'^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_PROTOCOL_BYNUMBER)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_PROTOCOL_BYNAME)
            con.write_string(key)
        write_protocols(con)
Пример #12
0
def getent_ethers(database, keys=None):
    if not keys:
        write_ethers(NslcdClient(constants.NSLCD_ACTION_ETHER_ALL))
        return
    for key in keys:
        if re.match('^[0-9a-fA-F]{1,2}(:[0-9a-fA-F]{1,2}){5}$', key):
            con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYETHER)
            con.write_ether(key)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYNAME)
            con.write_string(key)
        write_ethers(con)
Пример #13
0
def getent_rpc(database, keys=None):
    if not keys:
        write_rpc(NslcdClient(constants.NSLCD_ACTION_RPC_ALL))
        return
    for key in keys:
        if re.match('^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNUMBER)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNAME)
            con.write_string(key)
        write_rpc(con)
Пример #14
0
def getent_services(database, keys=None):
    if not keys:
        write_services(NslcdClient(constants.NSLCD_ACTION_SERVICE_ALL))
        return
    for key in keys:
        value = key
        protocol = ''
        if '/' in value:
            value, protocol = value.split('/', 1)
        if re.match('^\d+$', value):
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNUMBER)
            con.write_int32(int(value))
            con.write_string(protocol)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNAME)
            con.write_string(value)
            con.write_string(protocol)
        write_services(con)
Пример #15
0
def _get_getgroups(con, recurse, netgroups=None):
    if netgroups is None:
        netgroups = {}
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name, members, tripples = _read_netgroup(con)
        if not recurse:
            yield (name, members, tripples)
        else:
            netgroups[name] = None
            for netgroup in members:
                if netgroup not in netgroups:
                    con2 = NslcdClient(constants.NSLCD_ACTION_NETGROUP_BYNAME)
                    con2.write_string(netgroup)
                    all(_get_getgroups(con2, recurse, netgroups))
                if netgroups.get(netgroup, None) is not None:
                    tripples += netgroups[netgroup][1]
            netgroups[name] = (members, tripples)
            yield (name, [], tripples)
Пример #16
0
def _get_getgroups(con, recurse, netgroups=None):
    if netgroups is None:
        netgroups = {}
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name, members, tripples = _read_netgroup(con)
        if not recurse:
            yield (name, members, tripples)
        else:
            netgroups[name] = None
            for netgroup in members:
                if netgroup not in netgroups:
                    con2 = NslcdClient(constants.NSLCD_ACTION_NETGROUP_BYNAME)
                    con2.write_string(netgroup)
                    all(_get_getgroups(con2, recurse, netgroups))
                if netgroups.get(netgroup, None) is not None:
                    tripples += netgroups[netgroup][1]
            netgroups[name] = (members, tripples)
            yield (name, [], tripples)
Пример #17
0
def getent_group(database, keys=None):
    if not keys:
        write_group(NslcdClient(constants.NSLCD_ACTION_GROUP_ALL))
        return
    for key in keys:
        if database == 'group.bymember':
            con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYMEMBER)
            con.write_string(key)
        elif re.match('^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYGID)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYNAME)
            con.write_string(key)
        write_group(con)
Пример #18
0
def getent_shadow(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_SHADOW_ALL)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_SHADOW_BYNAME)
        con.write_string(key)
    value2str = lambda x: str(x) if x != -1 else ''
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%s:%s:%s:%s:%s:%s:%s:%s:%s' % (
                con.read_string(),
                con.read_string(),
                value2str(con.read_int32()),
                value2str(con.read_int32()),
                value2str(con.read_int32()),
                value2str(con.read_int32()),
                value2str(con.read_int32()),
                value2str(con.read_int32()),
                value2str(con.read_int32()),
            )
Пример #19
0
def getent_networks(database, keys=None):
    db_af = _get_af(database)
    if not keys:
        write_networks(NslcdClient(constants.NSLCD_ACTION_NETWORK_ALL), db_af)
        return
    for key in keys:
        ipv4_addr = _get_ipv4(key)
        ipv6_addr = _get_ipv6(key)
        if ipv4_addr and db_af in (socket.AF_INET, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET, ipv4_addr)
        elif ipv6_addr and db_af in (socket.AF_INET6, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET6, ipv6_addr)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYNAME)
            con.write_string(key)
        write_networks(con, db_af)
Пример #20
0
def getent_aliases(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_ALIAS_ALL)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_ALIAS_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%-16s%s' % (
                con.read_string() + ': ',
                ', '.join(con.read_stringlist()),
            )
Пример #21
0
def getent_netgroup(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_NETGROUP_ALL)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_NETGROUP_BYNAME)
        con.write_string(key)
    for name, members, tripples in _get_getgroups(con, database == 'netgroup'):
        print '%-15s %s' % (name, ' '.join(members + [
            '(%s, %s, %s)' % (host, user, domain)
            for host, user, domain in tripples
        ]))
Пример #22
0
def getent_rpc(database, keys=None):
    if not keys:
        write_rpc(NslcdClient(constants.NSLCD_ACTION_RPC_ALL))
        return
    for key in keys:
        if re.match('^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNUMBER)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNAME)
            con.write_string(key)
        write_rpc(con)
Пример #23
0
def getent_ethers(database, keys=None):
    if not keys:
        write_ethers(NslcdClient(constants.NSLCD_ACTION_ETHER_ALL))
        return
    for key in keys:
        if re.match('^[0-9a-fA-F]{1,2}(:[0-9a-fA-F]{1,2}){5}$', key):
            con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYETHER)
            con.write_ether(key)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYNAME)
            con.write_string(key)
        write_ethers(con)
Пример #24
0
def getent_passwd(database, keys=None):
    if not keys:
        write_passwd(NslcdClient(constants.NSLCD_ACTION_PASSWD_ALL))
        return
    for key in keys:
        if re.match('^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYUID)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYNAME)
            con.write_string(key)
        write_passwd(con)
Пример #25
0
def getent_passwd(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_PASSWD_ALL)
    elif re.match('^\d+$', key):
        con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYUID)
        con.write_int32(int(key))
    else:
        con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%s:%s:%d:%d:%s:%s:%s' % (
            con.read_string(),
            con.read_string(),
            con.read_int32(),
            con.read_int32(),
            con.read_string(),
            con.read_string(),
            con.read_string(),
        )
Пример #26
0
def getent_networks(database, key=None):
    db_af = _get_af(database)
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_NETWORK_ALL)
    else:
        ipv4_addr = _get_ipv4(key)
        ipv6_addr = _get_ipv6(key)
        if ipv4_addr and db_af in (socket.AF_INET, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET, ipv4_addr)
        elif ipv6_addr and db_af in (socket.AF_INET, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET6, ipv6_addr)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYNAME)
            con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        names = ' '.join([con.read_string()] + con.read_stringlist())
        for af, address in con.read_addresslist():
            if db_af in (af, None):
                print '%-15s %s' % (address, names)
Пример #27
0
def getent_ethers(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_ETHER_ALL)
    elif re.match('^[0-9a-fA-F]{1,2}(:[0-9a-fA-F]{1,2}){5}$', key):
        con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYETHER)
        con.write_ether(key)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_ETHER_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name = con.read_string()
        ether = con.read_ether()
        print '%s %s' % (ether, name)
Пример #28
0
def getent_group(database, keys=None):
    if not keys:
        write_group(NslcdClient(constants.NSLCD_ACTION_GROUP_ALL))
        return
    for key in keys:
        if database == 'group.bymember':
            con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYMEMBER)
            con.write_string(key)
        elif re.match('^\d+$', key):
            con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYGID)
            con.write_int32(int(key))
        else:
            con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYNAME)
            con.write_string(key)
        write_group(con)
Пример #29
0
def getent_passwd(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_PASSWD_ALL)
    elif re.match('^\d+$', key):
        con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYUID)
        con.write_int32(int(key))
    else:
        con = NslcdClient(constants.NSLCD_ACTION_PASSWD_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%s:%s:%d:%d:%s:%s:%s' % (
                con.read_string(),
                con.read_string(),
                con.read_int32(),
                con.read_int32(),
                con.read_string(),
                con.read_string(),
                con.read_string(),
            )
Пример #30
0
def getent_networks(database, keys=None):
    db_af = _get_af(database)
    if not keys:
        write_networks(NslcdClient(constants.NSLCD_ACTION_NETWORK_ALL), db_af)
        return
    for key in keys:
        ipv4_addr = _get_ipv4(key)
        ipv6_addr = _get_ipv6(key)
        if ipv4_addr and db_af in (socket.AF_INET, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET, ipv4_addr)
        elif ipv6_addr and db_af in (socket.AF_INET6, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET6, ipv6_addr)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYNAME)
            con.write_string(key)
        write_networks(con, db_af)
Пример #31
0
def getent_services(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_SERVICE_ALL)
    else:
        value = key
        protocol = ''
        if '/' in value:
            value, protocol = value.split('/', 1)
        if re.match('^\d+$', value):
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNUMBER)
            con.write_int32(int(value))
            con.write_string(protocol)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNAME)
            con.write_string(value)
            con.write_string(protocol)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name = con.read_string()
        aliases = con.read_stringlist()
        number = con.read_int32()
        protocol = con.read_string()
        print '%-21s %d/%s %s' % (name, number, protocol, ' '.join(aliases))
Пример #32
0
def getent_shadow(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_SHADOW_ALL)
    else:
        con = NslcdClient(constants.NSLCD_ACTION_SHADOW_BYNAME)
        con.write_string(key)
    value2str = lambda x: str(x) if x != -1 else ''
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%s:%s:%s:%s:%s:%s:%s:%s:%s' % (
            con.read_string(),
            con.read_string(),
            value2str(con.read_int32()),
            value2str(con.read_int32()),
            value2str(con.read_int32()),
            value2str(con.read_int32()),
            value2str(con.read_int32()),
            value2str(con.read_int32()),
            value2str(con.read_int32()),
        )
Пример #33
0
def getent_rpc(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_RPC_ALL)
    elif re.match('^\d+$', key):
        con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNUMBER)
        con.write_int32(int(key))
    else:
        con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name = con.read_string()
        aliases = con.read_stringlist()
        number = con.read_int32()
        print '%-15s %d  %s' % (name, number, ' '.join(aliases))
Пример #34
0
def getent_services(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_SERVICE_ALL)
    else:
        value = key
        protocol = ''
        if '/' in value:
            value, protocol = value.split('/', 1)
        if re.match('^\d+$', value):
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNUMBER)
            con.write_int32(int(value))
            con.write_string(protocol)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNAME)
            con.write_string(value)
            con.write_string(protocol)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name = con.read_string()
        aliases = con.read_stringlist()
        number = con.read_int32()
        protocol = con.read_string()
        print '%-21s %d/%s %s' % (name, number, protocol, ' '.join(aliases))
Пример #35
0
def getent_networks(database, key=None):
    db_af = _get_af(database)
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_NETWORK_ALL)
    else:
        ipv4_addr = _get_ipv4(key)
        ipv6_addr = _get_ipv6(key)
        if ipv4_addr and db_af in (socket.AF_INET, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET, ipv4_addr)
        elif ipv6_addr and db_af in (socket.AF_INET, None):
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYADDR)
            con.write_address(socket.AF_INET6, ipv6_addr)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_NETWORK_BYNAME)
            con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        names = ' '.join([con.read_string()] + con.read_stringlist())
        for af, address in con.read_addresslist():
            if db_af in (af, None):
                print '%-15s %s' % (address, names)
Пример #36
0
def getent_services(database, keys=None):
    if not keys:
        write_services(NslcdClient(constants.NSLCD_ACTION_SERVICE_ALL))
        return
    for key in keys:
        value = key
        protocol = ''
        if '/' in value:
            value, protocol = value.split('/', 1)
        if re.match('^\d+$', value):
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNUMBER)
            con.write_int32(int(value))
            con.write_string(protocol)
        else:
            con = NslcdClient(constants.NSLCD_ACTION_SERVICE_BYNAME)
            con.write_string(value)
            con.write_string(protocol)
        write_services(con)
Пример #37
0
def getent_rpc(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_RPC_ALL)
    elif re.match('^\d+$', key):
        con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNUMBER)
        con.write_int32(int(key))
    else:
        con = NslcdClient(constants.NSLCD_ACTION_RPC_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        name = con.read_string()
        aliases = con.read_stringlist()
        number = con.read_int32()
        print '%-15s %d  %s' % (name, number, ' '.join(aliases))
Пример #38
0
def getent_group(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_ALL)
    elif database == 'group.bymember':
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYMEMBER)
        con.write_string(key)
    elif re.match('^\d+$', key):
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYGID)
        con.write_int32(int(key))
    else:
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%s:%s:%d:%s' % (
            con.read_string(),
            con.read_string(),
            con.read_int32(),
            ','.join(con.read_stringlist()),
        )
Пример #39
0
def getent_group(database, key=None):
    if not key:
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_ALL)
    elif database == 'group.bymember':
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYMEMBER)
        con.write_string(key)
    elif re.match('^\d+$', key):
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYGID)
        con.write_int32(int(key))
    else:
        con = NslcdClient(constants.NSLCD_ACTION_GROUP_BYNAME)
        con.write_string(key)
    while con.get_response() == constants.NSLCD_RESULT_BEGIN:
        print '%s:%s:%d:%s' % (
                con.read_string(),
                con.read_string(),
                con.read_int32(),
                ','.join(con.read_stringlist()),
            )