s4-libnet: wipe the old keytab when exporting
authorAndrew Tridgell <tridge@samba.org>
Thu, 30 Sep 2010 19:43:14 +0000 (12:43 -0700)
committerAndrew Tridgell <tridge@samba.org>
Thu, 30 Sep 2010 21:36:11 +0000 (14:36 -0700)
this prevents confusion with old keytab entries

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/libnet/libnet_export_keytab.c

index f7ab88ffd36e4d0865759d98e68d574beee677b1..e8a0a1321d83085a8726cbdf086a4a5a228e8117 100644 (file)
@@ -45,6 +45,8 @@ NTSTATUS libnet_export_keytab(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, s
                return NT_STATUS_NO_MEMORY;
        }
 
+       unlink(r->in.keytab_name);
+
        ret = kt_copy(smb_krb5_context->krb5_context, from_keytab, r->in.keytab_name);
        if(ret) {
                r->out.error_string = smb_get_krb5_error_message(smb_krb5_context->krb5_context,