version 1.13, 2019/05/08 21:30:11 |
version 1.14, 2021/03/22 11:25:29 |
|
|
#include "extern.h" |
#include "extern.h" |
|
|
/* |
/* |
* Free a list of struct ident previously allocated with idents_gid_add(). |
* Free a list of struct ident previously allocated with idents_add(). |
* Does nothing if the pointer is NULL. |
* Does nothing if the pointer is NULL. |
*/ |
*/ |
void |
void |
|
|
struct group *grp; |
struct group *grp; |
struct passwd *usr; |
struct passwd *usr; |
uint32_t id; |
uint32_t id; |
int valid; |
int valid; |
|
|
assert(!sess->opts->numeric_ids); |
assert(!sess->opts->numeric_ids); |
|
|
|
|
idents_recv(struct sess *sess, |
idents_recv(struct sess *sess, |
int fd, struct ident **ids, size_t *idsz) |
int fd, struct ident **ids, size_t *idsz) |
{ |
{ |
int32_t id; |
uint32_t id; |
uint8_t sz; |
uint8_t sz; |
void *pp; |
void *pp; |
|
|
|
|
} else if (sz == 0) |
} else if (sz == 0) |
WARNX("zero-length name in identifier list"); |
WARNX("zero-length name in identifier list"); |
|
|
|
assert(id < INT32_MAX); |
(*ids)[*idsz].id = id; |
(*ids)[*idsz].id = id; |
(*ids)[*idsz].name = calloc(sz + 1, 1); |
(*ids)[*idsz].name = calloc(sz + 1, 1); |
if ((*ids)[*idsz].name == NULL) { |
if ((*ids)[*idsz].name == NULL) { |