[PATCH] Fix 'net ads changetrustpw'

Richard Sharpe realrichardsharpe at gmail.com
Fri Aug 11 18:52:43 UTC 2017


On Fri, Aug 11, 2017 at 10:43 AM, Alexander Bokovoy <ab at samba.org> wrote:
> On pe, 11 elo 2017, Richard Sharpe via samba-technical wrote:
>> On Fri, Aug 11, 2017 at 7:30 AM, Richard Sharpe
>> <realrichardsharpe at gmail.com> wrote:
>> > On Thu, Aug 10, 2017 at 10:47 PM, Andreas Schneider <asn at samba.org> wrote:
>> >> On Friday, 11 August 2017 02:06:15 CEST Richard Sharpe wrote:
>> >>> On Wed, Aug 9, 2017 at 9:45 AM, Andreas Schneider via samba-technical
>> >>>
>> >>> <samba-technical at lists.samba.org> wrote:
>> >>> > Hi,
>> >>> >
>> >>> > as always, untested code is broken code. So I broke 'net ads
>> >>> > changetrustpw' in Samba 4.6.
>> >>> >
>> >>> > The attached patch fixes the issue and adds a tests which verifies that it
>> >>> > is working.
>> >>> >
>> >>> >
>> >>> > Please review and push if OK.
>> >>>
>> >>> I have a couple of questions. While it looks OK,
>> >>>
>> >>> 1. I can't see why you changed princ to NULL in the following:
>> >>>
>> >>>           ret = krb5_set_password(context,
>> >>>                                                   &creds,
>> >>>                                                   discard_const_p(char,
>> >>> newpw), - princ,
>> >>>                                                   + NULL,
>> >>>                                                   &result_code,
>> >>>                                                   &result_code_string,
>> >>>                                                   &result_string);
>> >>>
>> >>> Perhaps it's because we just got a changepw ticket for the princ, so
>> >>> it is established in the creds who we are changing the password for.
>> >>
>> >> If we 'set' a password the client principal and the target principal are
>> >> different. That isn't the case, we change our own password so we need to pass
>> >> NULL.
>> >>
>> >>>
>> >>> 2. Can you fix the indentation in the call to krb5_set_password?
>> >>
>> >> What indentation? It looks correct to me. You know that the patch tool adds a
>> >> + at the beginning so the indentation with tabs can look strange in patch
>> >> files. Please apply the patch and check the source code :-)
>> >
>> > OK, I can see what is happening. The indentation is wrong for the
>> > whole file, at least in current master (pulled last night) as shown by
>> > the attached screen shot.
>> >
>> > In that case: RB+
>>
>> With attachment this time:
> You have attached a binary blob, not a C source file.

Sigh, Misnamed it. It should have been .jpg

It shows the weird indenting in that the file krb5_setpw.c

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: krb5_setpw.kpg
Type: application/octet-stream
Size: 158607 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170811/b7b83426/krb5_setpw-0001.obj>


More information about the samba-technical mailing list