On Wed, 2011-07-27 at 10:26 -0400, Rob Crittenden wrote:
> Rob Crittenden wrote:
> > Martin Kosek wrote:
> >> On Mon, 2011-07-25 at 10:08 -0400, Rob Crittenden wrote:
> >>> When adding an indirect map verify that the key doesn't already exist.
> >>>
> >>> There is still the chance of collision but checking first should limit
> >>> it in any case.
> >>>
> >>> https://fedorahosted.org/freeipa/ticket/1520
> >>>
> >>> rob
> >>
> >> This patch is OK functionally, but it can be improved. This command
> >> consists of 2 sub-commands. Checking for one sub-command's corner-case
> >> (by automountkey_show) may be OK for now, but it doesn't cover a
> >> situation when second sub-command fails for some other error.
> >>
> >> I think this is what we should to do:
> >>
> >> try:
> >> automountmap_add
> >> automountkey_add
> >> except Exception, e:
> >> Clean up - remove possibly created automountmap
> >> raise e
> >>
> >> That way we will be covered for more corner-cases + we will save one
> >> automountkey_show and speed up the command.
> >>
> >> Martin
> >>
> >
> > Except in the case where a user is delegated to only be able to add
> > maps/keys and not remove them.
> >
> > Still, this method is easier to understand, I'll consider it.
> >
> > rob
> 
> Updated patch attached.
> 
> rob

ACK.

It could be useful to check that automountmap created by faulty
automountmap_add_indirect is really not created. But since you are
already working on rewriting automount unit tests it would be OK to add
it there.

Martin

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to