[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Wed Mar 30 17:01:02 MDT 2011
The branch, master has been updated
via 0e46e09 s3-samr: make getgrgid() failure a little more visible in _samr_CreateDomAlias().
via e54f292 s3-idmap: fix the build of idmap_hash on FreeBSD.
via a730dff s3-libndr: add ../librpc/ndr/libndr.h include in some places.
via 2352e7c s3-rpcclient: include rpc_client/cli_pipe.h globally in rpcclient.h
via 5fcb4d3 rep_parse_prs: remove some dead, unused code.
from c109a70 Fix convert_string() to take a *converted_size arg. and return a bool.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0e46e09122b43ff237ca45173129813a875767bd
Author: Günther Deschner <gd at samba.org>
Date: Thu Mar 31 00:08:57 2011 +0200
s3-samr: make getgrgid() failure a little more visible in _samr_CreateDomAlias().
Guenther
Autobuild-User: Günther Deschner <gd at samba.org>
Autobuild-Date: Thu Mar 31 01:00:42 CEST 2011 on sn-devel-104
commit e54f292a4f4e9ea9726479333883d63035efc8d4
Author: Günther Deschner <gd at samba.org>
Date: Thu Mar 31 00:08:19 2011 +0200
s3-idmap: fix the build of idmap_hash on FreeBSD.
Guenther
commit a730dff78318a0bfe8c6b2b8a2cefed63cc586e8
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 30 23:47:34 2011 +0200
s3-libndr: add ../librpc/ndr/libndr.h include in some places.
Guenther
commit 2352e7cb7fe43b2a3cb5c4876f21cd655823288a
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 30 23:21:42 2011 +0200
s3-rpcclient: include rpc_client/cli_pipe.h globally in rpcclient.h
Guenther
commit 5fcb4d328ce28e6c4f413f2b31d70e07818c0527
Author: Günther Deschner <gd at samba.org>
Date: Wed Mar 30 23:17:25 2011 +0200
rep_parse_prs: remove some dead, unused code.
Guenther
-----------------------------------------------------------------------
Summary of changes:
libgpo/gpo_sec.c | 1 +
source3/lib/tldap_util.c | 1 +
source3/libads/disp_sec.c | 1 +
source3/libads/dns.c | 1 +
source3/librpc/ndr/util.c | 1 +
source3/passdb/machine_account_secrets.c | 1 +
source3/passdb/pdb_ipa.c | 1 +
source3/registry/reg_parse_prs.c | 401 ------------------------------
source3/registry/reg_parse_prs.h | 20 --
source3/rpc_server/samr/srv_samr_nt.c | 2 +-
source3/rpcclient/cmd_drsuapi.c | 1 -
source3/rpcclient/cmd_lsarpc.c | 1 -
source3/rpcclient/cmd_netlogon.c | 1 -
source3/rpcclient/cmd_samr.c | 1 -
source3/rpcclient/cmd_spoolss.c | 1 -
source3/rpcclient/cmd_test.c | 1 -
source3/rpcclient/rpcclient.c | 1 -
source3/rpcclient/rpcclient.h | 2 +
source3/winbindd/idmap_hash/mapfile.c | 1 +
19 files changed, 11 insertions(+), 429 deletions(-)
Changeset truncated at 500 lines:
diff --git a/libgpo/gpo_sec.c b/libgpo/gpo_sec.c
index 4e1612d..05b011b 100644
--- a/libgpo/gpo_sec.c
+++ b/libgpo/gpo_sec.c
@@ -21,6 +21,7 @@
#include "libcli/security/security.h"
#include "../libgpo/gpo.h"
#include "auth.h"
+#include "../librpc/ndr/libndr.h"
#if _SAMBA_BUILD_ == 4
#include "libgpo/ads_convenience.h"
#include "librpc/gen_ndr/security.h"
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c
index ae3dab3..a908301 100644
--- a/source3/lib/tldap_util.c
+++ b/source3/lib/tldap_util.c
@@ -22,6 +22,7 @@
#include "tldap_util.h"
#include "../libcli/security/security.h"
#include "../lib/util/asn1.h"
+#include "../librpc/ndr/libndr.h"
bool tldap_entry_values(struct tldap_message *msg, const char *attribute,
DATA_BLOB **values, int *num_values)
diff --git a/source3/libads/disp_sec.c b/source3/libads/disp_sec.c
index b06276e..7dcdc95 100644
--- a/source3/libads/disp_sec.c
+++ b/source3/libads/disp_sec.c
@@ -21,6 +21,7 @@
#include "ads.h"
#include "libads/ldap_schema.h"
#include "../libcli/security/secace.h"
+#include "../librpc/ndr/libndr.h"
/* for ADS */
#define SEC_RIGHTS_FULL_CTRL 0xf01ff
diff --git a/source3/libads/dns.c b/source3/libads/dns.c
index e7d8a40..113e637 100644
--- a/source3/libads/dns.c
+++ b/source3/libads/dns.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libads/dns.h"
+#include "../librpc/ndr/libndr.h"
/* AIX resolv.h uses 'class' in struct ns_rr */
diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c
index a026ecc..6bbe054 100644
--- a/source3/librpc/ndr/util.c
+++ b/source3/librpc/ndr/util.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "../librpc/ndr/libndr.h"
#include "librpc/ndr/util.h"
_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
diff --git a/source3/passdb/machine_account_secrets.c b/source3/passdb/machine_account_secrets.c
index dcf37d1..a51a99c 100644
--- a/source3/passdb/machine_account_secrets.c
+++ b/source3/passdb/machine_account_secrets.c
@@ -27,6 +27,7 @@
#include "../libcli/auth/libcli_auth.h"
#include "secrets.h"
#include "dbwrap.h"
+#include "../librpc/ndr/libndr.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
diff --git a/source3/passdb/pdb_ipa.c b/source3/passdb/pdb_ipa.c
index 3fffbe0..d19deef 100644
--- a/source3/passdb/pdb_ipa.c
+++ b/source3/passdb/pdb_ipa.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "passdb.h"
#include "libcli/security/dom_sid.h"
+#include "../librpc/ndr/libndr.h"
#include "smbldap.h"
diff --git a/source3/registry/reg_parse_prs.c b/source3/registry/reg_parse_prs.c
index d831f19..023fd0c 100644
--- a/source3/registry/reg_parse_prs.c
+++ b/source3/registry/reg_parse_prs.c
@@ -98,16 +98,6 @@ void prs_mem_free(prs_struct *ps)
}
/*******************************************************************
- Clear the memory in a parse structure.
- ********************************************************************/
-
-void prs_mem_clear(prs_struct *ps)
-{
- if (ps->buffer_size)
- memset(ps->data_p, '\0', (size_t)ps->buffer_size);
-}
-
-/*******************************************************************
Allocate memory when unmarshalling... Always zero clears.
********************************************************************/
@@ -137,55 +127,6 @@ TALLOC_CTX *prs_get_mem_context(prs_struct *ps)
}
/*******************************************************************
- Hand some already allocated memory to a prs_struct.
- If "is_dynamic" is true, this is a talloc_steal.
- If "is_dynamic" is false, just make ps->data_p a pointer to
- the unwritable memory.
- ********************************************************************/
-
-void prs_give_memory(prs_struct *ps, char *buf, uint32 size, bool is_dynamic)
-{
- ps->is_dynamic = is_dynamic;
- if (ps->is_dynamic && buf) {
- talloc_steal(ps->mem_ctx, buf);
- }
- ps->data_p = buf;
- ps->buffer_size = size;
-}
-
-/*******************************************************************
- Set a prs_struct to exactly a given size. Will grow or tuncate if neccessary.
- ********************************************************************/
-
-bool prs_set_buffer_size(prs_struct *ps, uint32 newsize)
-{
- if (newsize > ps->buffer_size)
- return prs_force_grow(ps, newsize - ps->buffer_size);
-
- if (newsize < ps->buffer_size) {
- ps->buffer_size = newsize;
-
- /* newsize == 0 acts as a free and set pointer to NULL */
- if (newsize == 0) {
- TALLOC_FREE(ps->data_p);
- } else {
- ps->data_p = talloc_realloc(ps->mem_ctx,
- ps->data_p,
- char,
- newsize);
-
- if (ps->data_p == NULL) {
- DEBUG(0,("prs_set_buffer_size: Realloc failure for size %u.\n",
- (unsigned int)newsize));
- return False;
- }
- }
- }
-
- return True;
-}
-
-/*******************************************************************
Attempt, if needed, to grow a data buffer.
Also depends on the data stream mode (io).
********************************************************************/
@@ -256,39 +197,6 @@ bool prs_grow(prs_struct *ps, uint32 extra_space)
}
/*******************************************************************
- Attempt to force a data buffer to grow by len bytes.
- This is only used when appending more data onto a prs_struct
- when reading an rpc reply, before unmarshalling it.
- ********************************************************************/
-
-bool prs_force_grow(prs_struct *ps, uint32 extra_space)
-{
- uint32 new_size = ps->buffer_size + extra_space;
-
- if(!UNMARSHALLING(ps) || !ps->is_dynamic) {
- DEBUG(0,("prs_force_grow: Buffer overflow - unable to expand buffer by %u bytes.\n",
- (unsigned int)extra_space));
- return False;
- }
-
- ps->data_p = (char *)talloc_realloc(ps->mem_ctx,
- ps->data_p,
- char,
- new_size);
- if(ps->data_p == NULL) {
- DEBUG(0,("prs_force_grow: Realloc failure for size %u.\n",
- (unsigned int)new_size));
- return False;
- }
-
- memset(&ps->data_p[ps->buffer_size], '\0', (size_t)(new_size - ps->buffer_size));
-
- ps->buffer_size = new_size;
-
- return True;
-}
-
-/*******************************************************************
Get the data pointer (external interface).
********************************************************************/
@@ -331,50 +239,6 @@ bool prs_set_offset(prs_struct *ps, uint32 offset)
}
/*******************************************************************
- Append the data from one parse_struct into another.
- ********************************************************************/
-
-bool prs_append_prs_data(prs_struct *dst, prs_struct *src)
-{
- if (prs_offset(src) == 0)
- return True;
-
- if(!prs_grow(dst, prs_offset(src)))
- return False;
-
- memcpy(&dst->data_p[dst->data_offset], src->data_p, (size_t)prs_offset(src));
- dst->data_offset += prs_offset(src);
-
- return True;
-}
-
-/*******************************************************************
- Append some data from one parse_struct into another.
- ********************************************************************/
-
-bool prs_append_some_data(prs_struct *dst, void *src_base, uint32_t start,
- uint32_t len)
-{
- if (len == 0) {
- return true;
- }
-
- if(!prs_grow(dst, len)) {
- return false;
- }
-
- memcpy(&dst->data_p[dst->data_offset], ((char *)src_base) + start, (size_t)len);
- dst->data_offset += len;
- return true;
-}
-
-bool prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start,
- uint32 len)
-{
- return prs_append_some_data(dst, src->data_p, start, len);
-}
-
-/*******************************************************************
Append the data from a buffer into a parse_struct.
********************************************************************/
@@ -393,48 +257,6 @@ bool prs_copy_data_in(prs_struct *dst, const char *src, uint32 len)
}
/*******************************************************************
- Copy some data from a parse_struct into a buffer.
- ********************************************************************/
-
-bool prs_copy_data_out(char *dst, prs_struct *src, uint32 len)
-{
- if (len == 0)
- return True;
-
- if(!prs_mem_get(src, len))
- return False;
-
- memcpy(dst, &src->data_p[src->data_offset], (size_t)len);
- src->data_offset += len;
-
- return True;
-}
-
-/*******************************************************************
- Copy all the data from a parse_struct into a buffer.
- ********************************************************************/
-
-bool prs_copy_all_data_out(char *dst, prs_struct *src)
-{
- uint32 len = prs_offset(src);
-
- if (!len)
- return True;
-
- prs_set_offset(src, 0);
- return prs_copy_data_out(dst, src, len);
-}
-
-/*******************************************************************
- Set the data as X-endian (external interface).
- ********************************************************************/
-
-void prs_set_endian_data(prs_struct *ps, bool endian)
-{
- ps->bigendian_data = endian;
-}
-
-/*******************************************************************
Align a the data_len to a multiple of align bytes - filling with
zeros.
********************************************************************/
@@ -455,22 +277,6 @@ bool prs_align(prs_struct *ps)
}
/******************************************************************
- Align on a 2 byte boundary
- *****************************************************************/
-
-bool prs_align_uint16(prs_struct *ps)
-{
- bool ret;
- uint8 old_align = ps->align;
-
- ps->align = 2;
- ret = prs_align(ps);
- ps->align = old_align;
-
- return ret;
-}
-
-/******************************************************************
Align on a 8 byte boundary
*****************************************************************/
@@ -486,36 +292,6 @@ bool prs_align_uint64(prs_struct *ps)
return ret;
}
-/******************************************************************
- Align on a specific byte boundary
- *****************************************************************/
-
-bool prs_align_custom(prs_struct *ps, uint8 boundary)
-{
- bool ret;
- uint8 old_align = ps->align;
-
- ps->align = boundary;
- ret = prs_align(ps);
- ps->align = old_align;
-
- return ret;
-}
-
-
-
-/*******************************************************************
- Align only if required (for the unistr2 string mainly)
- ********************************************************************/
-
-bool prs_align_needed(prs_struct *ps, uint32 needed)
-{
- if (needed==0)
- return True;
- else
- return prs_align(ps);
-}
-
/*******************************************************************
Ensure we can read/write to a given offset.
********************************************************************/
@@ -634,35 +410,6 @@ bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32)
}
/*******************************************************************
- Stream an int32.
- ********************************************************************/
-
-bool prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32)
-{
- char *q = prs_mem_get(ps, sizeof(int32));
- if (q == NULL)
- return False;
-
- if (UNMARSHALLING(ps)) {
- if (ps->bigendian_data)
- *data32 = RIVALS(q,0);
- else
- *data32 = IVALS(q,0);
- } else {
- if (ps->bigendian_data)
- RSIVALS(q,0,*data32);
- else
- SIVALS(q,0,*data32);
- }
-
- DEBUGADD(5,("%s%04x %s: %08x\n", tab_depth(5,depth), ps->data_offset, name, *data32));
-
- ps->data_offset += sizeof(int32);
-
- return True;
-}
-
-/*******************************************************************
Stream a uint64_struct
********************************************************************/
bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64)
@@ -686,36 +433,6 @@ bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64)
}
}
-/*******************************************************************
- Stream a DCE error code
- ********************************************************************/
-
-bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *status)
-{
- char *q = prs_mem_get(ps, sizeof(uint32));
- if (q == NULL)
- return False;
-
- if (UNMARSHALLING(ps)) {
- if (ps->bigendian_data)
- *status = NT_STATUS(RIVAL(q,0));
- else
- *status = NT_STATUS(IVAL(q,0));
- } else {
- if (ps->bigendian_data)
- RSIVAL(q,0,NT_STATUS_V(*status));
- else
- SIVAL(q,0,NT_STATUS_V(*status));
- }
-
- DEBUGADD(5,("%s%04x %s: %s\n", tab_depth(5,depth), ps->data_offset, name,
- dcerpc_errstr(talloc_tos(), NT_STATUS_V(*status))));
-
- ps->data_offset += sizeof(uint32);
-
- return True;
-}
-
/******************************************************************
Stream an array of uint8s. Length is number of uint8s.
********************************************************************/
@@ -748,121 +465,3 @@ bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint
return True;
}
-
-/******************************************************************
- Stream an array of uint16s. Length is number of uint16s.
- ********************************************************************/
-
-bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len)
-{
- int i;
- char *q = prs_mem_get(ps, len * sizeof(uint16));
- if (q == NULL)
- return False;
-
- if (UNMARSHALLING(ps)) {
- if (ps->bigendian_data) {
- for (i = 0; i < len; i++)
- data16s[i] = RSVAL(q, 2*i);
- } else {
- for (i = 0; i < len; i++)
- data16s[i] = SVAL(q, 2*i);
- }
- } else {
- if (ps->bigendian_data) {
- for (i = 0; i < len; i++)
- RSSVAL(q, 2*i, data16s[i]);
- } else {
- for (i = 0; i < len; i++)
- SSVAL(q, 2*i, data16s[i]);
- }
- }
-
- DEBUGADD(5,("%s%04x %s: ", tab_depth(5,depth), ps->data_offset, name));
- if (charmode)
- print_asc(5, (unsigned char*)data16s, 2*len);
- else {
- for (i = 0; i < len; i++)
- DEBUGADD(5,("%04x ", data16s[i]));
- }
- DEBUGADD(5,("\n"));
-
- ps->data_offset += (len * sizeof(uint16));
-
- return True;
-}
-
-/******************************************************************
- Stream an array of uint32s. Length is number of uint32s.
- ********************************************************************/
-
-bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len)
-{
- int i;
- char *q = prs_mem_get(ps, len * sizeof(uint32));
- if (q == NULL)
- return False;
-
- if (UNMARSHALLING(ps)) {
- if (ps->bigendian_data) {
- for (i = 0; i < len; i++)
- data32s[i] = RIVAL(q, 4*i);
- } else {
- for (i = 0; i < len; i++)
- data32s[i] = IVAL(q, 4*i);
--
Samba Shared Repository
More information about the samba-cvs
mailing list