diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-01 04:45:33 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-01 04:45:33 +0100 |
commit | 08259c1c52a9921de6fba08939130698b474f382 (patch) | |
tree | 2e563ba2d2dd10d34965f0de5b2c56118065d0f1 /source3 | |
parent | 2dc045007ef68bc42822471a3a08c8f094e29980 (diff) | |
download | samba-08259c1c52a9921de6fba08939130698b474f382.tar.gz samba-08259c1c52a9921de6fba08939130698b474f382.tar.bz2 samba-08259c1c52a9921de6fba08939130698b474f382.zip |
Add iconv_convenience argument to size functions.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/includes.h | 1 | ||||
-rw-r--r-- | source3/include/proto.h | 13 | ||||
-rw-r--r-- | source3/lib/secace.c | 4 | ||||
-rw-r--r-- | source3/lib/secdesc.c | 4 | ||||
-rw-r--r-- | source3/lib/sharesec.c | 2 | ||||
-rw-r--r-- | source3/lib/util_sid.c | 6 | ||||
-rw-r--r-- | source3/librpc/ndr/util.c | 1 | ||||
-rw-r--r-- | source3/libsmb/cliquota.c | 4 | ||||
-rw-r--r-- | source3/passdb/lookup_sid.c | 16 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 7 | ||||
-rw-r--r-- | source3/registry/reg_api.c | 2 | ||||
-rw-r--r-- | source3/registry/regfio.c | 4 | ||||
-rw-r--r-- | source3/rpc_parse/parse_buffer.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_sec.c | 6 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_svcctl_nt.c | 4 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 2 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 2 |
19 files changed, 37 insertions, 49 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 3f35602ba6..64be27336d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -559,7 +559,6 @@ typedef char fstring[FSTRING_LEN]; #endif /* Samba 3 doesn't use iconv_convenience: */ -extern void *global_iconv_convenience; extern void *cmdline_lp_ctx; struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); diff --git a/source3/include/proto.h b/source3/include/proto.h index be34bb0e65..e1e98eb125 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2307,19 +2307,6 @@ _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss); const char *ndr_errstr(enum ndr_err_code err); -/* The following definitions come from librpc/ndr/ndr_sec_helper.c */ - -size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags); -size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags); -size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags); -size_t ndr_size_security_ace(const struct security_ace *ace, int flags); -size_t ndr_size_security_acl(const struct security_acl *acl, int flags); -size_t ndr_size_security_descriptor(const struct security_descriptor *sd, int flags); -void ndr_print_dom_sid(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); -void ndr_print_dom_sid2(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); -void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); -void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid); - /* The following definitions come from librpc/ndr/sid.c */ char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); diff --git a/source3/lib/secace.c b/source3/lib/secace.c index 9f5a0c02ba..878fac252b 100644 --- a/source3/lib/secace.c +++ b/source3/lib/secace.c @@ -59,7 +59,7 @@ void init_sec_ace(SEC_ACE *t, const DOM_SID *sid, enum security_ace_type type, { t->type = type; t->flags = flag; - t->size = ndr_size_dom_sid(sid, 0) + 8; + t->size = ndr_size_dom_sid(sid, NULL, 0) + 8; t->access_mask = mask; ZERO_STRUCTP(&t->trustee); @@ -86,7 +86,7 @@ NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, unsign (*pp_new)[i].type = SEC_ACE_TYPE_ACCESS_ALLOWED; (*pp_new)[i].flags = 0; - (*pp_new)[i].size = SEC_ACE_HEADER_SIZE + ndr_size_dom_sid(sid, 0); + (*pp_new)[i].size = SEC_ACE_HEADER_SIZE + ndr_size_dom_sid(sid, NULL, 0); (*pp_new)[i].access_mask = mask; sid_copy(&(*pp_new)[i].trustee, sid); return NT_STATUS_OK; diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c index 400f5f31b0..232bbca43c 100644 --- a/source3/lib/secdesc.c +++ b/source3/lib/secdesc.c @@ -233,11 +233,11 @@ SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, } if (dst->owner_sid != NULL) { - offset += ndr_size_dom_sid(dst->owner_sid, 0); + offset += ndr_size_dom_sid(dst->owner_sid, NULL, 0); } if (dst->group_sid != NULL) { - offset += ndr_size_dom_sid(dst->group_sid, 0); + offset += ndr_size_dom_sid(dst->group_sid, NULL, 0); } *sd_size = (size_t)offset; diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index 3866ff083f..a1d30f1d2b 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -190,7 +190,7 @@ SEC_DESC *get_share_security( TALLOC_CTX *ctx, const char *servicename, } if (psd) - *psize = ndr_size_security_descriptor(psd, 0); + *psize = ndr_size_security_descriptor(psd, NULL, 0); return psd; } diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index f656bb13dc..97284afae7 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -382,7 +382,7 @@ bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid) { size_t i; - if (len < ndr_size_dom_sid(sid, 0)) + if (len < ndr_size_dom_sid(sid, NULL, 0)) return False; SCVAL(outbuf,0,sid->sid_rev_num); @@ -523,7 +523,7 @@ bool non_mappable_sid(DOM_SID *sid) char *sid_binstring(const DOM_SID *sid) { char *buf, *s; - int len = ndr_size_dom_sid(sid, 0); + int len = ndr_size_dom_sid(sid, NULL, 0); buf = (char *)SMB_MALLOC(len); if (!buf) return NULL; @@ -541,7 +541,7 @@ char *sid_binstring(const DOM_SID *sid) char *sid_binstring_hex(const DOM_SID *sid) { char *buf, *s; - int len = ndr_size_dom_sid(sid, 0); + int len = ndr_size_dom_sid(sid, NULL, 0); buf = (char *)SMB_MALLOC(len); if (!buf) return NULL; diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c index b8221838fa..5afc4f4f5a 100644 --- a/source3/librpc/ndr/util.c +++ b/source3/librpc/ndr/util.c @@ -166,7 +166,6 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss)); } -void *global_iconv_convenience; void *cmdline_lp_ctx; struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx) { diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c index 1462aa7a6a..e40dac368d 100644 --- a/source3/libsmb/cliquota.c +++ b/source3/libsmb/cliquota.c @@ -150,7 +150,7 @@ bool cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC SIVAL(params, 8,0x00000000); SIVAL(params,12,0x00000024); - sid_len = ndr_size_dom_sid(&pqt->sid, 0); + sid_len = ndr_size_dom_sid(&pqt->sid, NULL, 0); data_len = sid_len+8; SIVAL(data, 0, 0x00000000); SIVAL(data, 4, sid_len); @@ -213,7 +213,7 @@ bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC SSVAL(params,0,quota_fnum); - sid_len = ndr_size_dom_sid(&pqt->sid, 0); + sid_len = ndr_size_dom_sid(&pqt->sid, NULL, 0); SIVAL(data,0,0); SIVAL(data,4,sid_len); SBIG_UINT(data, 8,(uint64_t)0); diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index b9a67f208e..53845117e2 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -1014,7 +1014,7 @@ static bool fetch_sid_from_uid_cache(DOM_SID *psid, uid_t uid) memcpy(psid, cache_value.data, MIN(sizeof(*psid), cache_value.length)); SMB_ASSERT(cache_value.length >= offsetof(struct dom_sid, id_auth)); - SMB_ASSERT(cache_value.length == ndr_size_dom_sid(psid, 0)); + SMB_ASSERT(cache_value.length == ndr_size_dom_sid(psid, NULL, 0)); return true; } @@ -1028,7 +1028,7 @@ static bool fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid ) DATA_BLOB cache_value; if (!memcache_lookup(NULL, SID_UID_CACHE, - data_blob_const(psid, ndr_size_dom_sid(psid, 0)), + data_blob_const(psid, ndr_size_dom_sid(psid, NULL, 0)), &cache_value)) { return false; } @@ -1046,11 +1046,11 @@ static bool fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid ) void store_uid_sid_cache(const DOM_SID *psid, uid_t uid) { memcache_add(NULL, SID_UID_CACHE, - data_blob_const(psid, ndr_size_dom_sid(psid, 0)), + data_blob_const(psid, ndr_size_dom_sid(psid, NULL, 0)), data_blob_const(&uid, sizeof(uid))); memcache_add(NULL, UID_SID_CACHE, data_blob_const(&uid, sizeof(uid)), - data_blob_const(psid, ndr_size_dom_sid(psid, 0))); + data_blob_const(psid, ndr_size_dom_sid(psid, NULL, 0))); } /***************************************************************** @@ -1069,7 +1069,7 @@ static bool fetch_sid_from_gid_cache(DOM_SID *psid, gid_t gid) memcpy(psid, cache_value.data, MIN(sizeof(*psid), cache_value.length)); SMB_ASSERT(cache_value.length >= offsetof(struct dom_sid, id_auth)); - SMB_ASSERT(cache_value.length == ndr_size_dom_sid(psid, 0)); + SMB_ASSERT(cache_value.length == ndr_size_dom_sid(psid, NULL, 0)); return true; } @@ -1083,7 +1083,7 @@ static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid) DATA_BLOB cache_value; if (!memcache_lookup(NULL, SID_UID_CACHE, - data_blob_const(psid, ndr_size_dom_sid(psid, 0)), + data_blob_const(psid, ndr_size_dom_sid(psid, NULL, 0)), &cache_value)) { return false; } @@ -1101,11 +1101,11 @@ static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid) void store_gid_sid_cache(const DOM_SID *psid, gid_t gid) { memcache_add(NULL, SID_GID_CACHE, - data_blob_const(psid, ndr_size_dom_sid(psid, 0)), + data_blob_const(psid, ndr_size_dom_sid(psid, NULL, 0)), data_blob_const(&gid, sizeof(gid))); memcache_add(NULL, GID_SID_CACHE, data_blob_const(&gid, sizeof(gid)), - data_blob_const(psid, ndr_size_dom_sid(psid, 0))); + data_blob_const(psid, ndr_size_dom_sid(psid, NULL, 0))); } /***************************************************************** diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 3a81f27ad6..ac3817b94a 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -435,7 +435,7 @@ static int sec_desc_upg_fn( TDB_CONTEXT *the_tdb, TDB_DATA key, /* store it back */ - sd_size = ndr_size_security_descriptor(sd_store->sd, 0) + sd_size = ndr_size_security_descriptor(sd_store->sd, NULL, 0) + sizeof(SEC_DESC_BUF); if ( !prs_init(&ps, sd_size, ctx, MARSHALL) ) { DEBUG(0,("sec_desc_upg_fn: Failed to allocate prs memory for %s\n", key.dptr )); @@ -5477,7 +5477,8 @@ WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr) /* Store the security descriptor in a tdb */ if (!prs_init(&ps, - (uint32)ndr_size_security_descriptor(new_secdesc_ctr->sd, 0) + (uint32_t)ndr_size_security_descriptor(new_secdesc_ctr->sd, + NULL, 0) + sizeof(SEC_DESC_BUF), mem_ctx, MARSHALL) ) { status = WERR_NOMEM; goto out; @@ -5630,7 +5631,7 @@ bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **s /* Save default security descriptor for later */ - if (!prs_init(&ps, (uint32)ndr_size_security_descriptor((*secdesc_ctr)->sd, 0) + + if (!prs_init(&ps, (uint32_t)ndr_size_security_descriptor((*secdesc_ctr)->sd, NULL, 0) + sizeof(SEC_DESC_BUF), ctx, MARSHALL)) return False; diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 30ad3d9751..a5f3935821 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -436,7 +436,7 @@ WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, return err; } - *secdescsize = ndr_size_security_descriptor(secdesc, 0); + *secdescsize = ndr_size_security_descriptor(secdesc, NULL, 0); TALLOC_FREE(mem_ctx); *last_changed_time = 0; diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index b6e822955c..5395f225f1 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -1553,7 +1553,7 @@ static uint32 sk_record_data_size( SEC_DESC * sd ) /* the record size is sizeof(hdr) + name + static members + data_size_field */ - size = sizeof(uint32)*5 + ndr_size_security_descriptor(sd, 0) + sizeof(uint32); + size = sizeof(uint32)*5 + ndr_size_security_descriptor(sd, NULL, 0) + sizeof(uint32); /* multiple of 8 */ size_mod8 = size & 0xfffffff8; @@ -1783,7 +1783,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) nk->sec_desc->ref_count = 0; /* size value must be self-inclusive */ - nk->sec_desc->size = ndr_size_security_descriptor(sec_desc, 0) + nk->sec_desc->size = ndr_size_security_descriptor(sec_desc, NULL, 0) + sizeof(uint32); DLIST_ADD_END( file->sec_desc_list, nk->sec_desc, REGF_SK_REC *); diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c index 63a73c4b7c..b5177cc634 100644 --- a/source3/rpc_parse/parse_buffer.c +++ b/source3/rpc_parse/parse_buffer.c @@ -439,7 +439,7 @@ bool smb_io_relsecdesc(const char *desc, RPC_BUFFER *buffer, int depth, SEC_DESC } if (*secdesc != NULL) { - buffer->string_at_end -= ndr_size_security_descriptor(*secdesc, 0); + buffer->string_at_end -= ndr_size_security_descriptor(*secdesc, NULL, 0); if(!prs_set_offset(ps, buffer->string_at_end)) return False; diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c index c71b31086a..23c9610381 100644 --- a/source3/rpc_parse/parse_sec.c +++ b/source3/rpc_parse/parse_sec.c @@ -275,14 +275,14 @@ bool sec_io_desc(const char *desc, SEC_DESC **ppsd, prs_struct *ps, int depth) if (psd->owner_sid != NULL) { off_owner_sid = offset; - offset += ndr_size_dom_sid(psd->owner_sid, 0); + offset += ndr_size_dom_sid(psd->owner_sid, NULL, 0); } else { off_owner_sid = 0; } if (psd->group_sid != NULL) { off_grp_sid = offset; - offset += ndr_size_dom_sid(psd->group_sid, 0); + offset += ndr_size_dom_sid(psd->group_sid, NULL, 0); } else { off_grp_sid = 0; } @@ -410,7 +410,7 @@ bool sec_io_desc_buf(const char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int if(!prs_uint32 ("ptr ", ps, depth, &ptr)) return False; - len = ndr_size_security_descriptor(psdb->sd, 0); + len = ndr_size_security_descriptor(psdb->sd, NULL, 0); if(!prs_uint32_pre("len ", ps, depth, &len, &off_len)) return False; diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 78a80a019b..3fe0c3a416 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -3103,7 +3103,7 @@ uint32 spoolss_size_printer_info_2(PRINTER_INFO_2 *info) size += 4; - size += ndr_size_security_descriptor( info->secdesc, 0 ); + size += ndr_size_security_descriptor( info->secdesc, NULL, 0 ); size+=size_of_device_mode( info->devmode ); @@ -3190,7 +3190,7 @@ return the size required by a struct in the stream uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info) { /* The 8 is for the self relative pointer - 8 byte aligned.. */ - return 8 + (uint32)ndr_size_security_descriptor( info->secdesc, 0 ); + return 8 + (uint32)ndr_size_security_descriptor( info->secdesc, NULL, 0 ); } /******************************************************************* diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index 15af963c4c..a37e55270e 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -2106,7 +2106,7 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p, goto error_exit; } - sd_size = ndr_size_security_descriptor(psd, 0); + sd_size = ndr_size_security_descriptor(psd, NULL, 0); sd_buf = TALLOC_ZERO_P(p->mem_ctx, struct sec_desc_buf); if (!sd_buf) { diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c index 6692160ba2..187fb368e2 100644 --- a/source3/rpc_server/srv_svcctl_nt.c +++ b/source3/rpc_server/srv_svcctl_nt.c @@ -688,7 +688,7 @@ WERROR _svcctl_QueryServiceConfigW(pipes_struct *p, if ( !W_ERROR_IS_OK(wresult) ) return wresult; - buffer_size = ndr_size_QUERY_SERVICE_CONFIG(r->out.query, 0); + buffer_size = ndr_size_QUERY_SERVICE_CONFIG(r->out.query, NULL, 0); *r->out.bytes_needed = (buffer_size > r->in.buf_size) ? buffer_size : r->in.buf_size; if (buffer_size > r->in.buf_size ) { @@ -838,7 +838,7 @@ WERROR _svcctl_QueryServiceObjectSecurity(pipes_struct *p, if ( !(sec_desc = svcctl_get_secdesc( p->mem_ctx, info->name, get_root_nt_token() )) ) return WERR_NOMEM; - *r->out.needed = ndr_size_security_descriptor( sec_desc, 0 ); + *r->out.needed = ndr_size_security_descriptor( sec_desc, NULL, 0 ); if ( *r->out.needed > r->in.buffer_size ) { ZERO_STRUCTP( &r->out.buffer ); diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 9bfc566410..b17aec80fa 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1655,7 +1655,7 @@ static void call_nt_transact_query_security_desc(connection_struct *conn, security_info_wanted & DACL_SECURITY_INFORMATION) psd->type |= SEC_DESC_DACL_PRESENT; - sd_size = ndr_size_security_descriptor(psd, 0); + sd_size = ndr_size_security_descriptor(psd, NULL, 0); DEBUG(3,("call_nt_transact_query_security_desc: sd_size = %lu.\n",(unsigned long)sd_size)); diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 5abfffd618..390b166f5f 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -3071,6 +3071,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned i < conn->server_info->ptok->num_sids; ++i) { sid_bytes += ndr_size_dom_sid( &conn->server_info->ptok->user_sids[i], + NULL, 0); } @@ -3093,6 +3094,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned i < conn->server_info->ptok->num_sids; ++i) { int sid_len = ndr_size_dom_sid( &conn->server_info->ptok->user_sids[i], + NULL, 0); sid_linearize(pdata + data_len, sid_len, |