The branch, master has been updated
       via  d704efc536cdd0cc9ae9d235242cc4a12ed17858 (commit)
      from  a66828a37fbb4250dd25c828f3bbb8535fcffea0 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit d704efc536cdd0cc9ae9d235242cc4a12ed17858
Author: Günther Deschner <[email protected]>
Date:   Thu Feb 5 02:54:05 2009 +0100

    s3-svcctl: use security descriptor marshall helper in svcctl_set_secdesc().
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/services/services_db.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index e415248..6d1b5d5 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -567,7 +567,8 @@ bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, 
SEC_DESC *sec_desc,
        WERROR wresult;
        char *path = NULL;
        REGVAL_CTR *values = NULL;
-       prs_struct ps;
+       DATA_BLOB blob;
+       NTSTATUS status;
        bool ret = False;
 
        /* now add the security descriptor */
@@ -593,21 +594,18 @@ bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char 
*name, SEC_DESC *sec_desc,
 
        /* stream the printer security descriptor */
 
-       if (!prs_init( &ps, RPC_MAX_PDU_FRAG_LEN, key, MARSHALL)) {
-               DEBUG(0,("svcctl_set_secdesc: prs_init() failed!\n"));
+       status = marshall_sec_desc(ctx, sec_desc, &blob.data, &blob.length);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(0,("svcctl_set_secdesc: ndr_push_struct_blob() 
failed!\n"));
                TALLOC_FREE( key );
                return False;
        }
 
-       if ( sec_io_desc("sec_desc", &sec_desc, &ps, 0 ) ) {
-               uint32 offset = prs_offset( &ps );
-               regval_ctr_addvalue( values, "Security", REG_BINARY, 
prs_data_p(&ps), offset );
-               ret = store_reg_values( key, values );
-       }
+       regval_ctr_addvalue( values, "Security", REG_BINARY, (const char 
*)blob.data, blob.length);
+       ret = store_reg_values( key, values );
 
        /* cleanup */
 
-       prs_mem_free( &ps );
        TALLOC_FREE( key);
 
        return ret;


-- 
Samba Shared Repository

Reply via email to