version 1.5, 2019/02/14 18:26:52 |
version 1.6, 2019/02/21 22:06:26 |
|
|
/* |
/* |
* Given a list of identifiers from the remote host, fill in our local |
* Given a list of identifiers from the remote host, fill in our local |
* identifiers of the same names. |
* identifiers of the same names. |
* Use the remote numeric identifier if we can't find the identifier OR |
* Use the remote numeric identifier if we can't find the identifier OR the |
* the identifier is zero (wheel/root). |
* identifier is zero (wheel/root). |
* FIXME: what happens if we don't find the local identifier (we should |
* FIXME: we should at least warn when we can't find an identifier, use |
* really warn about this), but the remote identifier maps into a |
* the numeric id, and that numeric id is assigned to a different user. |
* different name for us? |
|
* These are pretty unexpected things for rsync to do. |
|
* Another FIXME because we shouldn't let that happen even though the |
|
* reference rsync does. |
|
*/ |
*/ |
void |
void |
idents_remap(struct sess *sess, int isgid, struct ident *ids, size_t idsz) |
idents_remap(struct sess *sess, int isgid, struct ident *ids, size_t idsz) |
|
|
struct group *grp; |
struct group *grp; |
struct passwd *usr; |
struct passwd *usr; |
int32_t id; |
int32_t id; |
|
|
|
if (sess->opts->numeric_ids) { |
|
for (i = 0; i < idsz; i++) { |
|
assert(ids[i].id != 0); |
|
ids[i].mapped = ids[i].id; |
|
} |
|
LOG4(sess, "did not remap identifiers"); |
|
return; |
|
} |
|
|
for (i = 0; i < idsz; i++) { |
for (i = 0; i < idsz; i++) { |
assert(ids[i].id != 0); |
assert(ids[i].id != 0); |