summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-08-25 13:05:48 +0000
committerGerald Carter <jerry@samba.org>2003-08-25 13:05:48 +0000
commit017133ea0c3eb0579710727379585df2b585614d (patch)
tree478c036486bf93166d2fc31bdb0d7fe3bf506c2f
parentafbf15f94189f50cd447d9bcdebbc4886800b05a (diff)
downloadsamba-017133ea0c3eb0579710727379585df2b585614d.tar.gz
samba-017133ea0c3eb0579710727379585df2b585614d.tar.xz
samba-017133ea0c3eb0579710727379585df2b585614d.zip
make sure the printer data value exists before saying you deleted it
-rw-r--r--source/printing/nt_printing.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 294b9c9018a..b4a551c1612 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -2897,6 +2897,11 @@ WERROR delete_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const
key_index = lookup_printerkey( &p2->data, key );
if ( key_index == -1 )
return WERR_OK;
+
+ /* make sure the value exists so we can return the correct error code */
+
+ if ( !regval_ctr_getvalue( &p2->data.keys[key_index].values, value ) )
+ return WERR_BADFILE;
regval_ctr_delvalue( &p2->data.keys[key_index].values, value );