Fix some visual flaws in the auth callback of the client.

This commit is contained in:
Andreas Schneider 2008-08-12 11:18:24 +02:00
parent 95f4db7c4f
commit 27800adce5
2 changed files with 7 additions and 5 deletions

View file

@ -75,9 +75,9 @@ int csync_auth(const char *prompt, char *buf, size_t len, int echo, int verify)
/* read the password */
while (!ok) {
if (*buf) {
fprintf(stdout, "%s: [%s] ", prompt, buf);
fprintf(stdout, "%s [%s] ", prompt, buf);
} else {
fprintf(stdout, "%s: ", prompt);
fprintf(stdout, "%s ", prompt);
}
fflush(stdout);
while (! fgets(tmp, len, stdin));
@ -85,6 +85,7 @@ int csync_auth(const char *prompt, char *buf, size_t len, int echo, int verify)
if ((ptr = strchr(tmp, '\n'))) {
*ptr = '\0';
}
fprintf(stdout, "\n");
if (*tmp) {
strncpy(buf, tmp, len);
@ -103,7 +104,8 @@ int csync_auth(const char *prompt, char *buf, size_t len, int echo, int verify)
if ((ptr = strchr(key_string, '\n'))) {
*ptr = '\0';
}
if (strcmp(buf ,key_string)) {
fprintf(stdout, "\n");
if (strcmp(buf, key_string)) {
printf("\n\07\07Mismatch - try again\n");
fflush(stdout);
continue;

View file

@ -76,8 +76,8 @@ static void get_auth_data_with_context_fn(SMBCCTX *c,
/* Call the passwort prompt */
if (auth_cb != NULL) {
DEBUG_SMB(("csync_smb - execute authentication callback\n"));
(*auth_cb) ("Username", un, unlen, 1, 0);
(*auth_cb) ("Password", pw, pwlen, 0, 0);
(*auth_cb) ("Username:", un, unlen, 1, 0);
(*auth_cb) ("Password:", pw, pwlen, 0, 0);
}
DEBUG_SMB(("csync_smb - user=%s, workgroup=%s, server=%s, share=%s\n",