Bug 9767 - "net ads join" fails when called via stdin
Summary: "net ads join" fails when called via stdin
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-04 14:39 UTC by Yassir Elley
Modified: 2013-04-11 10:16 UTC (History)
2 users (show)

See Also:


Attachments
Don't manipulate tty state (such as turning off echo) when prompting for passwords if we're not reading from a tty. (2.21 KB, patch)
2013-04-04 14:47 UTC, Yassir Elley
no flags Details
backport for 4.0 (991 bytes, patch)
2013-04-08 13:30 UTC, Alexander Bokovoy
asn: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yassir Elley 2013-04-04 14:39:55 UTC
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
Comment 1 Yassir Elley 2013-04-04 14:44:48 UTC
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.
Comment 2 Yassir Elley 2013-04-04 14:47:43 UTC
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.
Comment 3 Alexander Bokovoy 2013-04-05 03:47:37 UTC
Pushed to autobuild.
Comment 4 Alexander Bokovoy 2013-04-08 13:30:16 UTC
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 5 Andreas Schneider 2013-04-09 07:07:12 UTC
Comment on attachment 8734 [details]
backport for 4.0

LGTM
Comment 6 Jeremy Allison 2013-04-09 18:58:09 UTC
Re-assigning to Karolin for inclusion in 4.0.next.
Jeremy.
Comment 7 Karolin Seeger 2013-04-11 07:47:06 UTC
(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!
Comment 8 Karolin Seeger 2013-04-11 07:47:27 UTC
Pushed to autobuild-v4-0-test.
Comment 9 Karolin Seeger 2013-04-11 10:16:34 UTC
Pushed to v4-0-test.
Closing out bug report.

Thanks!