printing: explicitly clear PUBLISHED attribute
authorDavid Disseldorp <ddiss@samba.org>
Wed, 29 May 2013 08:43:32 +0000 (10:43 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 3 Jun 2013 12:10:07 +0000 (14:10 +0200)
Currently nt_printer_publish(DSPRINT_UNPUBLISH) flips (via xor) the
info2->attributes PRINTER_ATTRIBUTE_PUBLISHED flag, rather than
explicitly clearing it.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/printing/nt_printing_ads.c

index 3a2baf40f5e742c6e446b0e6ab6b764a07fb4a11..86ea8f7a8588aa8a953a54bad01a1b05b882ffde 100644 (file)
@@ -355,7 +355,7 @@ WERROR nt_printer_publish(TALLOC_CTX *mem_ctx,
                pinfo2->attributes |= PRINTER_ATTRIBUTE_PUBLISHED;
                break;
        case DSPRINT_UNPUBLISH:
-               pinfo2->attributes ^= PRINTER_ATTRIBUTE_PUBLISHED;
+               pinfo2->attributes &= (~PRINTER_ATTRIBUTE_PUBLISHED);
                break;
        default:
                win_rc = WERR_NOT_SUPPORTED;