diff options
author | Andreas Schneider <asn@samba.org> | 2010-04-23 14:45:48 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-23 16:23:49 +0200 |
commit | 94a8482261526c7bb3ae15194bf3939978b324b6 (patch) | |
tree | c27416573b8250ad300ee6936422df2f8c493188 /source3/rpc_server | |
parent | 96a04b067efe34d16ab14339703be89d27e64b0b (diff) | |
download | samba-94a8482261526c7bb3ae15194bf3939978b324b6.tar.gz samba-94a8482261526c7bb3ae15194bf3939978b324b6.tar.bz2 samba-94a8482261526c7bb3ae15194bf3939978b324b6.zip |
s3-spoolss: Fixed winreg_delete_printer_key if key is NULL or emtpy.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_util.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c index d41edc0317..fdcb62cf38 100644 --- a/source3/rpc_server/srv_spoolss_util.c +++ b/source3/rpc_server/srv_spoolss_util.c @@ -1700,13 +1700,17 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx, rpccli_winreg_CloseKey(winreg_pipe, tmp_ctx, &key_hnd, NULL); } - keyname = talloc_asprintf(tmp_ctx, - "%s\\%s", - path, - key); - if (keyname == NULL) { - result = WERR_NOMEM; - goto done; + if (key == NULL || key[0] == '\0') { + keyname = path; + } else { + keyname = talloc_asprintf(tmp_ctx, + "%s\\%s", + path, + key); + if (keyname == NULL) { + result = WERR_NOMEM; + goto done; + } } result = winreg_printer_delete_subkeys(tmp_ctx, |