Elided error codes in error messages in the net command ...

Richard Sharpe realrichardsharpe at gmail.com
Tue Apr 7 03:41:31 GMT 2009


On Mon, Apr 6, 2009 at 7:23 PM, Jeremy Allison <jra at samba.org> wrote:
> On Mon, Apr 06, 2009 at 07:15:40PM -0700, Richard Sharpe wrote:
>> Hi,
>>
>> I have recently been bitten by code like this in utils/net_groupmap.c
>>
>>         if (!NT_STATUS_IS_OK(pdb_add_aliasmem(&alias, &member))) {
>>                 d_fprintf(stderr, "Could not add sid %s to alias %s\n",
>>                          argv[1], argv[0]);
>>                 return -1;
>>         }
>>
>> Unfortunately, since pdb_add_aliasmem can return something like three
>> different error codes, it takes a great deal of digging to figure out
>> what the problem is.
>>
>> It really should be something like:
>>
>>         err = pdb_add_aliasmem(&alias, &member);
>>         if (!NT_STATUS_IS_OK(err)) {
>>                 d_fprintf(stderr, "Could not add sid %s to alias %s (%s)\n",
>>                          argv[1], argv[0], nt_errstr(err));
>>                 return -1;
>>         }
>>
>> Is there any interest in getting this fixed? I could probably run AWK
>> over the offending code!
>
> Please do - it'll help a lot of people as well as you :-).

I'll give it a try. It will take a little more attention than I first
thought, but it does seem worth it.

-- 
Regards,
Richard Sharpe


More information about the samba-technical mailing list