diff --git a/proxytunnel.c b/proxytunnel.c index a847223..2817738 100644 --- a/proxytunnel.c +++ b/proxytunnel.c @@ -428,7 +428,15 @@ int main( int argc, char *argv[] ) { /* If the usename is given, but password is not, prompt for it */ if( args_info.user_given && !args_info.pass_given ) { char *cp; +#ifdef USE_WINCREDMAN + if (args_info.credman_flag) { + cp = getcred_x (args_info.proxy_arg, args_info.user_arg); + } else { + cp = getpass_x ("Enter local proxy password for user %s: ", args_info.user_arg); + } +#else cp = getpass_x ("Enter local proxy password for user %s: ", args_info.user_arg); +#endif if (cp != NULL && strlen (cp) > 0) { args_info.pass_arg = strdup (cp); args_info.pass_given = 1; @@ -438,7 +446,15 @@ int main( int argc, char *argv[] ) { if( args_info.remuser_given && !args_info.rempass_given ) { char *cp; +#ifdef USE_WINCREDMAN + if (args_info.credman_flag) { + cp = getcred_x (args_info.remproxy_arg, args_info.remuser_arg); + } else { + cp = getpass_x ("Enter remote proxy password for user %s: ", args_info.remuser_arg); + } +#else cp = getpass_x ("Enter remote proxy password for user %s: ", args_info.remuser_arg); +#endif if (cp != NULL && strlen (cp) > 0) { args_info.rempass_arg = strdup (cp); args_info.rempass_given = 1; diff --git a/proxytunnel.h b/proxytunnel.h index 74547f8..2860001 100644 --- a/proxytunnel.h +++ b/proxytunnel.h @@ -44,6 +44,9 @@ size_t strzcat(char *dst, char *format, ...); int main( int argc, char *argv[] ); char * readpassphrase(const char *, char *, size_t, int); char * getpass_x(const char *format, ...); +#ifdef USE_WINCREDMAN +char* getcred_x(const char*, const char*); +#endif /* Globals */ extern int read_fd; /* The file descriptor to read from */