[PATCHS] Fix GPO unapply log

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCHS] Fix GPO unapply log

Samba - samba-technical mailing list
Fixes for 2 bugs in the gpo unapply.
* The apply log was being left empty. Apparently pointers to tree
elements can't be stored in an object, they somehow are disconnected
from the main tree and nothing gets logged. These have to be found each
time we want to add something. This is probably a bug in python ElementTree.
* We should only commit the earliest change from a gpo to the log.
Otherwise we overwrite the original value written by that gpo, and then
we tattoo the setting on unapply.

 python/samba/gpclass.py | 67
++++++++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 38 insertions(+), 29 deletions(-)

--
David Mulder
SUSE Labs Software Engineer - Samba
[hidden email]
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)


gpo_fixes.mbox (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCHS] Fix GPO unapply log

Samba - samba-technical mailing list
Hi,

It seems that you didn't have any particular tests for gpo unapply. It
would be good to have a test that showed it previously failed, even if
only at the python level. Otherwise this change seems fine.

Cheers,

Garming


On 03/12/17 04:48, David Mulder wrote:

> Fixes for 2 bugs in the gpo unapply.
> * The apply log was being left empty. Apparently pointers to tree
> elements can't be stored in an object, they somehow are disconnected
> from the main tree and nothing gets logged. These have to be found each
> time we want to add something. This is probably a bug in python ElementTree.
> * We should only commit the earliest change from a gpo to the log.
> Otherwise we overwrite the original value written by that gpo, and then
> we tattoo the setting on unapply.
>
>  python/samba/gpclass.py | 67
> ++++++++++++++++++++++++++++++++++++++-----------------------------
>  1 file changed, 38 insertions(+), 29 deletions(-)
>


Reply | Threaded
Open this post in threaded view
|

Re: [PATCHS] Fix GPO unapply log

Samba - samba-technical mailing list
I thought of that shortly after submitting these. I'm about halfway
through writing a test. Will send updated patches soon.

On 12/05/2017 04:17 PM, Garming Sam wrote:

> Hi,
>
> It seems that you didn't have any particular tests for gpo unapply. It
> would be good to have a test that showed it previously failed, even if
> only at the python level. Otherwise this change seems fine.
>
> Cheers,
>
> Garming
>
>
> On 03/12/17 04:48, David Mulder wrote:
>> Fixes for 2 bugs in the gpo unapply.
>> * The apply log was being left empty. Apparently pointers to tree
>> elements can't be stored in an object, they somehow are disconnected
>> from the main tree and nothing gets logged. These have to be found each
>> time we want to add something. This is probably a bug in python ElementTree.
>> * We should only commit the earliest change from a gpo to the log.
>> Otherwise we overwrite the original value written by that gpo, and then
>> we tattoo the setting on unapply.
>>
>>  python/samba/gpclass.py | 67
>> ++++++++++++++++++++++++++++++++++++++-----------------------------
>>  1 file changed, 38 insertions(+), 29 deletions(-)
>>
>

--
David Mulder
SUSE Labs Software Engineer - Samba
[hidden email]
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)