diff options
author | Günther Deschner <gd@samba.org> | 2010-02-16 02:48:01 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-02-18 15:47:59 +0100 |
commit | 28817424935e5b6eaf465fe993dedc2b0a0cf177 (patch) | |
tree | 8e4827f8d0ba646722aaeeb064ae36719d8d3654 /librpc | |
parent | 70f8b34f513ceeb736061d79e9d44dda39b51642 (diff) | |
download | samba-28817424935e5b6eaf465fe993dedc2b0a0cf177.tar.gz samba-28817424935e5b6eaf465fe993dedc2b0a0cf177.tar.bz2 samba-28817424935e5b6eaf465fe993dedc2b0a0cf177.zip |
spoolss: add spoolss_security_descriptor.
Guenther
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 88 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 9 | ||||
-rw-r--r-- | librpc/idl/spoolss.idl | 11 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.c | 56 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.h | 3 |
5 files changed, 115 insertions, 52 deletions
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index 035444b2fd..2a903850f1 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -1561,10 +1561,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, i ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc)); - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_push_spoolss_PrinterAttributes(ndr, NDR_SCALARS, r->attributes)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); @@ -1703,19 +1703,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, i ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc)); { struct ndr_push *_ndr_secdesc; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc)); } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -1896,7 +1896,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, i ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); if (_ptr_secdesc) { @@ -1905,7 +1905,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, i } else { r->secdesc = NULL; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); @@ -2143,7 +2143,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, i ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { uint32_t _relative_save_offset; @@ -2154,7 +2154,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, i { struct ndr_pull *_ndr_secdesc; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); @@ -2163,7 +2163,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, i } ndr->offset = _relative_save_offset; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -2248,7 +2248,7 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo2(struct ndr_print *ndr, const char * ndr_print_ptr(ndr, "secdesc", r->secdesc); ndr->depth++; if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc); } ndr->depth--; ndr_print_spoolss_PrinterAttributes(ndr, "attributes", r->attributes); @@ -2272,28 +2272,28 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, i if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 5)); { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc)); - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_push_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc)); { struct ndr_push *_ndr_secdesc; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc)); } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -2306,7 +2306,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, i if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 5)); { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); if (_ptr_secdesc) { @@ -2315,13 +2315,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, i } else { r->secdesc = NULL; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_pull_trailer_align(ndr, 5)); } if (ndr_flags & NDR_BUFFERS) { { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { uint32_t _relative_save_offset; @@ -2332,7 +2332,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, i { struct ndr_pull *_ndr_secdesc; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); @@ -2341,7 +2341,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, i } ndr->offset = _relative_save_offset; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -2354,7 +2354,7 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo3(struct ndr_print *ndr, const char * ndr_print_ptr(ndr, "secdesc", r->secdesc); ndr->depth++; if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc); } ndr->depth--; ndr->depth--; @@ -3749,10 +3749,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc)); - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); @@ -3883,19 +3883,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc)); { struct ndr_push *_ndr_secdesc; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc)); } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -4063,7 +4063,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); if (_ptr_secdesc) { @@ -4072,7 +4072,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int n } else { r->secdesc = NULL; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); @@ -4294,7 +4294,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { uint32_t _relative_save_offset; @@ -4305,7 +4305,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int n { struct ndr_pull *_ndr_secdesc; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); @@ -4314,7 +4314,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int n } ndr->offset = _relative_save_offset; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -4394,7 +4394,7 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo2(struct ndr_print *ndr, const char *name ndr_print_ptr(ndr, "secdesc", r->secdesc); ndr->depth++; if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc); } ndr->depth--; ndr_print_spoolss_JobStatus(ndr, "status", r->status); @@ -4530,10 +4530,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc)); - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); @@ -4665,19 +4665,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->secdesc)); { struct ndr_push *_ndr_secdesc; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_push_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->secdesc)); } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -4845,7 +4845,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); if (_ptr_secdesc) { @@ -4854,7 +4854,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int n } else { r->secdesc = NULL; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); @@ -5077,7 +5077,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int n ndr->flags = _flags_save_string; } { - uint32_t _flags_save_security_descriptor = ndr->flags; + uint32_t _flags_save_spoolss_security_descriptor = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); if (r->secdesc) { uint32_t _relative_save_offset; @@ -5088,7 +5088,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int n { struct ndr_pull *_ndr_secdesc; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_secdesc, 0, -1)); - NDR_CHECK(ndr_pull_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_CHECK(ndr_pull_spoolss_security_descriptor(_ndr_secdesc, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_secdesc, 0, -1)); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); @@ -5097,7 +5097,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int n } ndr->offset = _relative_save_offset; } - ndr->flags = _flags_save_security_descriptor; + ndr->flags = _flags_save_spoolss_security_descriptor; } } return NDR_ERR_SUCCESS; @@ -5177,7 +5177,7 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo4(struct ndr_print *ndr, const char *name ndr_print_ptr(ndr, "secdesc", r->secdesc); ndr->depth++; if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + ndr_print_spoolss_security_descriptor(ndr, "secdesc", r->secdesc); } ndr->depth--; ndr_print_spoolss_JobStatus(ndr, "status", r->status); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index 5f5c5373ce..7c69f57c0d 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -7,6 +7,7 @@ #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/winreg.h" +#define spoolss_security_descriptor security_descriptor #ifndef _HEADER_spoolss #define _HEADER_spoolss @@ -821,7 +822,7 @@ struct spoolss_PrinterInfo2 { const char * printprocessor;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * datatype;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * parameters;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ - struct security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ + struct spoolss_security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ uint32_t attributes; uint32_t priority;/* [range(0,99)] */ uint32_t defaultpriority; @@ -833,7 +834,7 @@ struct spoolss_PrinterInfo2 { }/* [gensize,public] */; struct spoolss_PrinterInfo3 { - struct security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ + struct spoolss_security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ }/* [gensize,public] */; struct spoolss_PrinterInfo4 { @@ -917,7 +918,7 @@ struct spoolss_JobInfo2 { const char * driver_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ struct spoolss_DeviceMode *devmode;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ - struct security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ + struct spoolss_security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ uint32_t status; uint32_t priority;/* [range(0,99)] */ uint32_t position; @@ -949,7 +950,7 @@ struct spoolss_JobInfo4 { const char * driver_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ struct spoolss_DeviceMode *devmode;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ - struct security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ + struct spoolss_security_descriptor *secdesc;/* [relative,subcontext(0),flag(LIBNDR_FLAG_ALIGN4)] */ uint32_t status; uint32_t priority;/* [range(0,99)] */ uint32_t position; diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index 3365ea3319..48162097cc 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -5,6 +5,9 @@ */ import "misc.idl", "security.idl", "winreg.idl"; + +cpp_quote("#define spoolss_security_descriptor security_descriptor") + [ uuid("12345678-1234-abcd-ef00-0123456789ab"), version(1.0), endpoint("ncacn_np:[\\pipe\\spoolss]"), @@ -478,7 +481,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *printprocessor; [relative] nstring *datatype; [relative] nstring *parameters; - [relative,subcontext(0),flag(NDR_ALIGN4)] security_descriptor *secdesc; + [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc; spoolss_PrinterAttributes attributes; [range(0,99)] uint32 priority; uint32 defaultpriority; @@ -490,7 +493,7 @@ import "misc.idl", "security.idl", "winreg.idl"; } spoolss_PrinterInfo2; typedef [public,gensize] struct { - [relative,subcontext(0),flag(NDR_ALIGN4)] security_descriptor *secdesc; + [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc; } spoolss_PrinterInfo3; typedef [public,gensize] struct { @@ -621,7 +624,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *driver_name; [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_DeviceMode *devmode; [relative] nstring *text_status; - [relative,subcontext(0),flag(NDR_ALIGN4)] security_descriptor *secdesc; + [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc; spoolss_JobStatus status; [range(0,99)] uint32 priority; uint32 position; @@ -653,7 +656,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *driver_name; [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_DeviceMode *devmode; [relative] nstring *text_status; - [relative,subcontext(0),flag(NDR_ALIGN4)] security_descriptor *secdesc; + [relative,subcontext(0),flag(NDR_ALIGN4)] spoolss_security_descriptor *secdesc; spoolss_JobStatus status; [range(0,99)] uint32 priority; uint32 position; diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index 19e7737666..14503a0aab 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -24,6 +24,7 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_spoolss.h" +#include "librpc/gen_ndr/ndr_security.h" #if (_SAMBA_BUILD_ >= 4) #include "param/param.h" #endif @@ -1408,3 +1409,58 @@ _PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData, ic); } +void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r) +{ + ndr_print_security_descriptor(ndr, name, r); +} + +enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r) +{ + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NO_RELATIVE_REVERSE); + NDR_CHECK(ndr_pull_security_descriptor(ndr, ndr_flags, r)); + ndr->flags = _flags_save_STRUCT; + return NDR_ERR_SUCCESS; +} + +enum ndr_err_code ndr_push_spoolss_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r) +{ + { + uint32_t _flags_save_STRUCT = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN|LIBNDR_FLAG_NO_RELATIVE_REVERSE); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 5)); + NDR_CHECK(ndr_push_security_descriptor_revision(ndr, NDR_SCALARS, r->revision)); + NDR_CHECK(ndr_push_security_descriptor_type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->owner_sid)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->group_sid)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->sacl)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->dacl)); + NDR_CHECK(ndr_push_trailer_align(ndr, 5)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->sacl) { + NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->sacl)); + NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->sacl)); + NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->sacl)); + } + if (r->dacl) { + NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->dacl)); + NDR_CHECK(ndr_push_security_acl(ndr, NDR_SCALARS|NDR_BUFFERS, r->dacl)); + NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->dacl)); + } + if (r->owner_sid) { + NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->owner_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->owner_sid)); + NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->owner_sid)); + } + if (r->group_sid) { + NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->group_sid)); + NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, r->group_sid)); + NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->group_sid)); + } + } + ndr->flags = _flags_save_STRUCT; + } + return NDR_ERR_SUCCESS; +} diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h index a53ab7bb8c..948e910edf 100644 --- a/librpc/ndr/ndr_spoolss_buf.h +++ b/librpc/ndr/ndr_spoolss_buf.h @@ -54,6 +54,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r); void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r); size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic, int flags); +void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r); +enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r); +enum ndr_err_code ndr_push_spoolss_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r); #undef _PRINTF_ATTRIBUTE #define _PRINTF_ATTRIBUTE(a1, a2) |