mirror of
https://github.com/upa/mscp.git
synced 2026-05-14 06:47:29 +08:00
fix duplicate error message on ssh auth failed.
and fix the final \n with -q
This commit is contained in:
@@ -378,7 +378,7 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
pprint3("connecting to %s for checking destinations...\n", m.host);
|
pprint3("connecting to %s for checking destinations...\n", m.host);
|
||||||
m.ctrl = ssh_make_sftp_session(m.host, &opts);
|
m.ctrl = ssh_init_sftp_session(m.host, &opts);
|
||||||
if (!m.ctrl)
|
if (!m.ctrl)
|
||||||
return 1;
|
return 1;
|
||||||
m.opts = &opts; /* save ssh-able ssh_opts */
|
m.opts = &opts; /* save ssh-able ssh_opts */
|
||||||
@@ -425,7 +425,7 @@ int main(int argc, char **argv)
|
|||||||
t->cpu = cores[n % nr_cores];
|
t->cpu = cores[n % nr_cores];
|
||||||
|
|
||||||
pprint3("connecting to %s for a copy thread...\n", m.host);
|
pprint3("connecting to %s for a copy thread...\n", m.host);
|
||||||
t->sftp = ssh_make_sftp_session(m.host, m.opts);
|
t->sftp = ssh_init_sftp_session(m.host, m.opts);
|
||||||
if (!t->sftp) {
|
if (!t->sftp) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto join_out;
|
goto join_out;
|
||||||
@@ -654,7 +654,7 @@ void mscp_monitor_thread_cleanup(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_progress(&m->start, &end, total, 0, done);
|
print_progress(&m->start, &end, total, 0, done);
|
||||||
fputs("\n", stdout); /* the final ouput. we need \n */
|
pprint(1, "\n"); /* the final ouput. we need \n */
|
||||||
}
|
}
|
||||||
|
|
||||||
void *mscp_monitor_thread(void *arg)
|
void *mscp_monitor_thread(void *arg)
|
||||||
|
|||||||
@@ -80,11 +80,10 @@ static int ssh_authenticate(ssh_session ssh, struct ssh_opts *opts)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_err("authentication failure: %s\n", ssh_get_error(ssh));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssh_session ssh_make_ssh_session(char *sshdst, struct ssh_opts *opts)
|
static ssh_session ssh_init_session(char *sshdst, struct ssh_opts *opts)
|
||||||
{
|
{
|
||||||
ssh_session ssh = ssh_new();
|
ssh_session ssh = ssh_new();
|
||||||
|
|
||||||
@@ -119,10 +118,10 @@ free_out:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
sftp_session ssh_make_sftp_session(char *sshdst, struct ssh_opts *opts)
|
sftp_session ssh_init_sftp_session(char *sshdst, struct ssh_opts *opts)
|
||||||
{
|
{
|
||||||
sftp_session sftp;
|
sftp_session sftp;
|
||||||
ssh_session ssh = ssh_make_ssh_session(sshdst, opts);
|
ssh_session ssh = ssh_init_session(sshdst, opts);
|
||||||
|
|
||||||
if (!ssh) {
|
if (!ssh) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ struct ssh_opts {
|
|||||||
char *password; /* filled at the first connecting phase */
|
char *password; /* filled at the first connecting phase */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ssh_make_sftp_session() creates sftp_session. sshdst accpets
|
/* ssh_init_sftp_session() creates sftp_session. sshdst accpets
|
||||||
* user@hostname and hostname notations (by libssh).
|
* user@hostname and hostname notations (by libssh).
|
||||||
*/
|
*/
|
||||||
sftp_session ssh_make_sftp_session(char *sshdst, struct ssh_opts *opts);
|
sftp_session ssh_init_sftp_session(char *sshdst, struct ssh_opts *opts);
|
||||||
void ssh_sftp_close(sftp_session sftp);
|
void ssh_sftp_close(sftp_session sftp);
|
||||||
|
|
||||||
#define sftp_ssh(sftp) (sftp)->session
|
#define sftp_ssh(sftp) (sftp)->session
|
||||||
|
|||||||
Reference in New Issue
Block a user