s4:ntp_signd: fix SEGV if SID cannot be found
authorArvid Requate <requate@univention.de>
Tue, 14 Aug 2012 12:16:54 +0000 (14:16 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Aug 2012 15:16:54 +0000 (17:16 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 14 17:16:54 CEST 2012 on sn-devel-104

source4/ntp_signd/ntp_signd.c

index c6d605699f6dedaa91fa648af05e37feb17613ca..1de9cc30f97757467a9322335d2c97de152bfe7d 100644 (file)
@@ -180,8 +180,12 @@ static NTSTATUS ntp_signd_process(struct ntp_signd_connection *ntp_signd_conn,
        }
 
        if (res->count == 0) {
-               DEBUG(5, ("Failed to find SID %s in SAM for NTP signing\n",
+               DEBUG(2, ("Failed to find SID %s in SAM for NTP signing\n",
                          dom_sid_string(mem_ctx, sid)));
+               return signing_failure(ntp_signd_conn,
+                                      mem_ctx,
+                                      output,
+                                      sign_request.packet_id);
        } else if (res->count != 1) {
                DEBUG(1, ("Found SID %s %u times in SAM for NTP signing\n",
                          dom_sid_string(mem_ctx, sid), res->count));