s3-spoolss/registry: use marshall_sec_desc in fill_in_printer_values().
authorGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 14:21:06 +0000 (15:21 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 17 Mar 2009 17:39:29 +0000 (18:39 +0100)
Guenther

source3/registry/reg_backend_printing.c

index 192bc78e09f864d0a9e17c546a9d5a938bd20a42..aa7b8ae49cf6e8c02bf01821d73ec57d9d96d2a3 100644 (file)
@@ -458,14 +458,19 @@ static void fill_in_printer_values( NT_PRINTER_INFO_LEVEL_2 *info2, REGVAL_CTR *
        prs_set_offset( &prs, 0 );
                
        /* stream the printer security descriptor */
-       
-       if ( info2->secdesc_buf &&
-            info2->secdesc_buf->sd &&
-            info2->secdesc_buf->sd_size )  
+
+       if (info2->secdesc_buf &&
+           info2->secdesc_buf->sd &&
+           info2->secdesc_buf->sd_size)
        {
-               if ( sec_io_desc("sec_desc", &info2->secdesc_buf->sd, &prs, 0 ) ) {
-                       offset = prs_offset( &prs );
-                       regval_ctr_addvalue( values, "Security", REG_BINARY, prs_data_p(&prs), offset );
+               NTSTATUS status;
+               DATA_BLOB blob;
+
+               status = marshall_sec_desc(values, info2->secdesc_buf->sd,
+                                          &blob.data, &blob.length);
+               if (NT_STATUS_IS_OK(status)) {
+                       regval_ctr_addvalue(values, "Security", REG_BINARY,
+                                           (const char *)blob.data, blob.length);
                }
        }