s4-drsuapi: Avoid segfault when replicating as a non-admin with GUID_DRS_GET_CHANGES
authorAndrew Bartlett <abartlet@samba.org>
Thu, 3 Aug 2017 23:44:19 +0000 (11:44 +1200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 31 Aug 2017 12:02:50 +0000 (14:02 +0200)
commiteb299c63f15c42bf65393f26cf3c7ab6b05470fd
tree3edcb67070ec906c18ca9a56d077c30a91d292b1
parent7364965ac09b799a25f95ab475819b389dcad174
s4-drsuapi: Avoid segfault when replicating as a non-admin with GUID_DRS_GET_CHANGES

Users who are not administrator do not get b_state->sam_ctx_system filled in.

We should probably use the 'sam_ctx' variable in all cases (instead of
b_state->sam_ctx*), but I'll make this change in a separate patch, so
that the bug fix remains independent from other tidy-ups.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12946

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit dd863b604984c1504895f376ec64f58e27e53efa)

Autobuild-User(v4-7-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-7-test): Thu Aug 31 14:02:51 CEST 2017 on sn-devel-144
source4/rpc_server/drsuapi/getncchanges.c
source4/selftest/tests.py
source4/torture/drs/python/getnc_unpriv.py [new file with mode: 0644]