Version: Samba 4.1.0 OS: Fedora 19 The "net ads join" tool works fine when called via tty, but fails when called via stdin (such as when I run "realm join" using password credentials). The error message emitted is "tcgetattr: Inappropriate ioctl for device". Full output: $ sudo realm -v join FOO.COM -U Administrator * Searching for kerberos SRV records for domain: _kerberos._udp.foo.com * Searching for MSDCS SRV records on domain: _kerberos._tcp.dc._msdcs.foo.com * adserver.foo.com:88 * Found kerberos DNS records for: foo.com * Found AD style DNS records for: foo.com * Successfully discovered: foo.com Password for Administrator: * Required files: /usr/sbin/sss_cache, /usr/sbin/sssd, /usr/bin/net * LANG=C /usr/bin/net ads lookup -S adserver.foo.com * Looked up workgroup name: FOO * LANG=C /usr/bin/net -s /var/cache/realmd/realmd-smb-conf.PYDVUW -U Administrator ads join FOO.COM tcgetattr: Inappropriate ioctl for device Failed to join domain: failed to lookup DC info for domain 'FOO.COM' over rpc: Logon failure ! The Administrator account, password, or credentials are invalid realm: Couldn't join realm: The Administrator account, password, or credentials are invalid
We don't need to manipulate the tty state (such as turning off echo) when prompting for passwords if we're not reading from a tty.
Created attachment 8727 [details] Don't manipulate tty state (such as turning off echo) when prompting for passwords if we're not reading from a tty.
Pushed to autobuild.
Created attachment 8734 [details] backport for 4.0 Attached is backport for 4.0. Since in 4.0 we don't have explicit samba_getpass(), I only backported the fix to libreplace replacement as otherwise we are using a system version of getpass(). Please review.
Comment on attachment 8734 [details] backport for 4.0 LGTM
Re-assigning to Karolin for inclusion in 4.0.next. Jeremy.
(In reply to comment #4) > Created attachment 8734 [details] > backport for 4.0 > > Attached is backport for 4.0. Since in 4.0 we don't have explicit > samba_getpass(), I only backported the fix to libreplace replacement as > otherwise we are using a system version of getpass(). > > Please review. Alexander, please provide git formatted patches if possible. That avoids wrong/bad commit messages. Thanks!
Pushed to autobuild-v4-0-test.
Pushed to v4-0-test. Closing out bug report. Thanks!