getpass regressions on Solaris/Illumos - 3.6 and master.
jelmer at samba.org
Mon Jan 30 05:39:58 MST 2012
-----BEGIN PGP SIGNED MESSAGE-----
On 01/29/2012 10:48 AM, Andrew Bartlett wrote:
> On Sun, 2012-01-29 at 00:24 -0500, Ira Cooper wrote:
>> There's been at least 2 regressions on the Solaris platforms. One
>> involving net join not working, and one involving smbclient not working,
>> using typed passwords.
>> I ended up tracking this issue down via bisection
>> to: 510e61871c0c2b2659b80d5f785522184131b1d9 and then working out why that
>> patch was the issue.
>> If you look at the commit involved, it looks like a no-op. Alas, util.c
>> included "system/passwd.h" and util_cmdline.c did not, so there was a
>> regression, because getpass doesn't take passwords longer than 8
>> characters, on Solaris.
>> I'm looking for a better idea than just adding "system/passwd.h" to
>> source3/include/includes.h, that also has the effect of protecting against
>> the kind of simple mistake made in the commit above. I can't blame the
>> committer for the error, it was far too easy to make, in my opinion.
>> Patch enclosed, and verified to work, against v3-6-test, that just adds
>> "system/passwd.h" to source3/include/includes.h.
>> Thanks for the explanation of the brokenness of getpass on Solaris, Andrew
> I think the correct fix is change the getpass() calls to be explicit
> calls directly to the Samba replacement functions (which would be
> renamed and moved to samba-util).
> We should then only fall back if we find a real-world system where the
> replacement (now samba-util) function fails to compile, that we wish to
> support, and it has a non-broken getpass()/getpassphrase().
> (This is the opposite to our normal practice with replacement functions,
> and I queried this myself in years past, but it was put to me
> persuasively that otherwise the replacement will never be tested).
> This will greatly reduce the chance that this might happen again.
The defines for using the alternative functions should be in replace.h,
so we can't miss them if we happen to forget one of the system/ includes.
The reason I added libreplace as a separate thing from the code in lib/
in the first place was exactly to be able to avoid this. Libreplace
should be as transparent as possible, so we can just do the right thing
on sane platforms, and it will just work on other platforms. We
shouldn't have to worry about calling wrapper functions in case there
are platforms on which a function is broken.
Originally it was also possible to compile with just an empty replace.h
and without having libreplace at all on modern Linux systems.
Unfortunately that's no longer possible because of the system/ headers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the samba-technical