version 1.17, 2019/02/16 16:25:45 |
version 1.18, 2019/02/21 22:07:44 |
|
|
|
|
/* Conditionally write identifier lists. */ |
/* Conditionally write identifier lists. */ |
|
|
if (sess->opts->preserve_uids) { |
if (sess->opts->preserve_uids && !sess->opts->numeric_ids) { |
LOG2(sess, "sending uid list: %zu", uidsz); |
LOG2(sess, "sending uid list: %zu", uidsz); |
if (!idents_send(sess, fdout, uids, uidsz)) { |
if (!idents_send(sess, fdout, uids, uidsz)) { |
ERRX1(sess, "idents_send"); |
ERRX1(sess, "idents_send"); |
|
|
} |
} |
} |
} |
|
|
if (sess->opts->preserve_gids) { |
if (sess->opts->preserve_gids && !sess->opts->numeric_ids) { |
LOG2(sess, "sending gid list: %zu", gidsz); |
LOG2(sess, "sending gid list: %zu", gidsz); |
if (!idents_send(sess, fdout, gids, gidsz)) { |
if (!idents_send(sess, fdout, gids, gidsz)) { |
ERRX1(sess, "idents_send"); |
ERRX1(sess, "idents_send"); |
|
|
|
|
/* Conditionally read the user/group list. */ |
/* Conditionally read the user/group list. */ |
|
|
if (sess->opts->preserve_uids) { |
if (sess->opts->preserve_uids && !sess->opts->numeric_ids) { |
if (!idents_recv(sess, fd, &uids, &uidsz)) { |
if (!idents_recv(sess, fd, &uids, &uidsz)) { |
ERRX1(sess, "idents_recv"); |
ERRX1(sess, "idents_recv"); |
goto out; |
goto out; |
|
|
LOG2(sess, "received uid list: %zu", uidsz); |
LOG2(sess, "received uid list: %zu", uidsz); |
} |
} |
|
|
if (sess->opts->preserve_gids) { |
if (sess->opts->preserve_gids && !sess->opts->numeric_ids) { |
if (!idents_recv(sess, fd, &gids, &gidsz)) { |
if (!idents_recv(sess, fd, &gids, &gidsz)) { |
ERRX1(sess, "idents_recv"); |
ERRX1(sess, "idents_recv"); |
goto out; |
goto out; |
|
|
|
|
/* Conditionally remap and reassign identifiers. */ |
/* Conditionally remap and reassign identifiers. */ |
|
|
if (sess->opts->preserve_uids) { |
if (sess->opts->preserve_uids && !sess->opts->numeric_ids) { |
idents_remap(sess, 0, uids, uidsz); |
idents_remap(sess, 0, uids, uidsz); |
idents_assign_uid(sess, fl, flsz, uids, uidsz); |
idents_assign_uid(sess, fl, flsz, uids, uidsz); |
} |
} |
|
|
if (sess->opts->preserve_gids) { |
if (sess->opts->preserve_gids && !sess->opts->numeric_ids) { |
idents_remap(sess, 1, gids, gidsz); |
idents_remap(sess, 1, gids, gidsz); |
idents_assign_gid(sess, fl, flsz, gids, gidsz); |
idents_assign_gid(sess, fl, flsz, gids, gidsz); |
} |
} |