version 1.8, 2019/03/06 18:37:22 |
version 1.9, 2019/03/23 00:20:55 |
|
|
* The server (remote) side of the system. |
* The server (remote) side of the system. |
* This parses the arguments given it by the remote shell then moves |
* This parses the arguments given it by the remote shell then moves |
* into receiver or sender mode depending upon those arguments. |
* into receiver or sender mode depending upon those arguments. |
* |
* Returns exit code 0 on success, 1 on failure, 2 on failure with |
* Pledges: unveil rpath, cpath, wpath, stdio, fattr. |
* incompatible protocols. |
* |
|
* Pledges (dry-run): -cpath, -wpath, -fattr. |
|
* Pledges (!preserve_times): -fattr. |
|
*/ |
*/ |
int |
int |
rsync_server(const struct opts *opts, size_t argc, char *argv[]) |
rsync_server(const struct opts *opts, size_t argc, char *argv[]) |
{ |
{ |
struct sess sess; |
struct sess sess; |
int fdin = STDIN_FILENO, |
int fdin = STDIN_FILENO, |
fdout = STDOUT_FILENO, rc = 0; |
fdout = STDOUT_FILENO, rc = 1; |
|
|
if (pledge("stdio unix rpath wpath cpath dpath fattr chown getpw unveil", |
if (pledge("stdio unix rpath wpath cpath dpath fattr chown getpw unveil", |
NULL) == -1) |
NULL) == -1) |
|
|
WARNX(&sess, "data remains in read pipe"); |
WARNX(&sess, "data remains in read pipe"); |
#endif |
#endif |
|
|
rc = 1; |
rc = 0; |
out: |
out: |
return rc; |
return rc; |
} |
} |