aboutsummaryrefslogtreecommitdiff
path: root/libssh/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2008-12-29 11:33:51 +0000
committerAndreas Schneider <mail@cynapses.org>2008-12-29 11:33:51 +0000
commitf9f8ded7f0a691c0b46ccff596944ef1b06cf8a8 (patch)
tree592e5ac919e74c6c44bc2762918de2eac0b45f63 /libssh/options.c
parent6ea38880543478fb7d23de731f56fbe33632f5f7 (diff)
downloadlibssh-f9f8ded7f0a691c0b46ccff596944ef1b06cf8a8.tar.gz
libssh-f9f8ded7f0a691c0b46ccff596944ef1b06cf8a8.tar.xz
libssh-f9f8ded7f0a691c0b46ccff596944ef1b06cf8a8.zip
Add a more generic auth callback function.
You should be able to obtain passwords or usernames with this function. Signed-off-by: Andreas Schneider <mail@cynapses.org> git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@198 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/options.c')
-rw-r--r--libssh/options.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libssh/options.c b/libssh/options.c
index 762980d2..9de84ad4 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -101,7 +101,8 @@ SSH_OPTIONS *ssh_options_copy(SSH_OPTIONS *opt){
for(i=0;i<10;++i)
if(opt->wanted_methods[i])
ret->wanted_methods[i]=strdup(opt->wanted_methods[i]);
- ret->passphrase_function=opt->passphrase_function;
+ ret->auth_function=opt->auth_function;
+ ret->auth_userdata=opt->auth_userdata;
ret->connect_status_function=opt->connect_status_function;
ret->connect_status_arg=opt->connect_status_arg;
ret->timeout=opt->timeout;
@@ -571,6 +572,14 @@ int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv){
return 0 ;
}
+void ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback cb,
+ void *userdata) {
+ if (opt == NULL) {
+ return;
+ }
+ opt->auth_function = cb;
+ opt->auth_userdata = userdata;
+}
/** @} */