mirror of
https://github.com/samba-team/samba.git
synced 2025-03-12 20:58:37 +03:00
r24868: Don't use callbacks for prompting when stdout is not a tty.
(This used to be commit 9b02a39c156862f9e9258dcdb9b8b86715022fc1)
This commit is contained in:
parent
c37fa61abc
commit
6131ff85d5
@ -38,7 +38,12 @@ static const char *cmdline_get_userpassword(struct cli_credentials *credentials)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cli_credentials_set_cmdline_callbacks(struct cli_credentials *cred)
|
||||
bool cli_credentials_set_cmdline_callbacks(struct cli_credentials *cred)
|
||||
{
|
||||
cli_credentials_set_password_callback(cred, cmdline_get_userpassword);
|
||||
if (isatty(fileno(stdout))) {
|
||||
cli_credentials_set_password_callback(cred, cmdline_get_userpassword);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
|
||||
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
|
||||
AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
|
||||
AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp socketpair)
|
||||
AC_CHECK_FUNCS(isatty)
|
||||
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
|
||||
AC_HAVE_DECL(setresgid, [#include <unistd.h>])
|
||||
AC_HAVE_DECL(errno, [#include <errno.h>])
|
||||
|
Loading…
x
Reference in New Issue
Block a user