MCPcopy Index your code
hub / github.com/RsyncProject/rsync / auth_client

Function auth_client

authenticate.c:348–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void auth_client(int fd, const char *user, const char *challenge)
349{
350 const char *pass;
351 char pass2[MAX_DIGEST_LEN*2];
352
353 if (!user || !*user)
354 user = "nobody";
355 negotiate_daemon_auth(-1, 1);
356
357 if (!(pass = getpassf(password_file))
358 && !(pass = getenv("RSYNC_PASSWORD"))) {
359 /* XXX: cyeoh says that getpass is deprecated, because
360 * it may return a truncated password on some systems,
361 * and it is not in the LSB.
362 *
363 * Andrew Klein says that getpassphrase() is present
364 * on Solaris and reads up to 256 characters.
365 *
366 * OpenBSD has a readpassphrase() that might be more suitable.
367 */
368 pass = getpass("Password: ");
369 }
370
371 if (!pass)
372 pass = "";
373
374 generate_hash(pass, challenge, pass2);
375 io_printf(fd, "%s %s\n", user, pass2);
376}

Callers 1

start_inband_exchangeFunction · 0.85

Calls 5

negotiate_daemon_authFunction · 0.85
getpassfFunction · 0.85
getpassFunction · 0.85
generate_hashFunction · 0.85
io_printfFunction · 0.85

Tested by

no test coverage detected