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

Jeremy Allison jra at samba.org
Tue Apr 7 02:23:22 GMT 2009


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 :-).

Thanks,

Jeremy.


More information about the samba-technical mailing list