summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in32
-rw-r--r--source3/include/core.h3
-rw-r--r--source3/include/core/nterr.h1
-rw-r--r--source3/include/dcerpc.h0
-rw-r--r--source3/include/includes.h3
-rw-r--r--source3/include/ndr.h1
-rw-r--r--source3/include/smb.h4
-rw-r--r--source3/libndr/unixinfo.h79
-rw-r--r--source3/librpc/gen_ndr/ndr_dcerpc.h0
-rw-r--r--source3/librpc/gen_ndr/ndr_unixinfo.c (renamed from source3/libndr/ndr_unixinfo.c)35
-rw-r--r--source3/librpc/gen_ndr/ndr_unixinfo.h (renamed from source3/libndr/ndr_unixinfo.h)13
-rw-r--r--source3/librpc/gen_ndr/unixinfo.h82
-rw-r--r--source3/librpc/ndr/libndr.h (renamed from source3/libndr/libndr.h)4
-rw-r--r--source3/librpc/ndr/misc.h (renamed from source3/libndr/misc.h)0
-rw-r--r--source3/librpc/ndr/ndr.c (renamed from source3/libndr/ndr.c)0
-rw-r--r--source3/librpc/ndr/ndr_basic.c (renamed from source3/libndr/ndr_basic.c)0
-rw-r--r--source3/librpc/ndr/ndr_dcerpc.h0
-rw-r--r--source3/librpc/ndr/ndr_misc.c (renamed from source3/libndr/ndr_misc.c)0
-rw-r--r--source3/librpc/ndr/ndr_misc.h0
-rw-r--r--source3/librpc/ndr/ndr_sec.h (renamed from source3/libndr/ndr_sec.h)0
-rw-r--r--source3/librpc/ndr/ndr_sec_helper.c (renamed from source3/libndr/ndr_sec_helper.c)0
-rw-r--r--source3/librpc/ndr/ndr_security.h0
-rw-r--r--source3/librpc/ndr/ndr_string.c (renamed from source3/libndr/ndr_string.c)0
-rw-r--r--source3/librpc/ndr/security.h (renamed from source3/libndr/security.h)0
-rw-r--r--source3/librpc/ndr/sid.c (renamed from source3/libndr/sid.c)0
-rw-r--r--source3/rpc_client/cli_unixinfo.h3
-rw-r--r--source3/script/build_idl.sh40
27 files changed, 189 insertions, 111 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 60adf713d6..3eb229214b 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -121,7 +121,7 @@ LIBADDNS=bin/libaddns.a @LIBADDNS_SHARED@
LIBADDNS_MAJOR=0
LIBADDNS_MINOR=1
-FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/tdb/include @SMBWRAP_INC@ -I. $(CPPFLAGS) -I$(srcdir) -D_SAMBA_BUILD_ -I$(srcdir)/libaddns
+FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/tdb/include @SMBWRAP_INC@ -I. $(CPPFLAGS) -I$(srcdir) -D_SAMBA_BUILD_ -I$(srcdir)/libaddns -I$(srcdir)/librpc
FLAGS2 =
FLAGS3 =
FLAGS4 =
@@ -209,10 +209,10 @@ PASSCHANGE_OBJ = libsmb/passchange.o
SOCKET_WRAPPER_OBJ = lib/socket_wrapper.o
-LIBNDR_OBJ = libndr/ndr_basic.o libndr/ndr.o libndr/ndr_misc.o \
- libndr/ndr_sec_helper.o libndr/ndr_string.o libndr/sid.o
+LIBNDR_OBJ = librpc/ndr/ndr_basic.o librpc/ndr/ndr.o librpc/ndr/ndr_misc.o \
+ librpc/ndr/ndr_sec_helper.o librpc/ndr/ndr_string.o librpc/ndr/sid.o
-LIBNDR_GEN_OBJ = libndr/ndr_unixinfo.o
+LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_unixinfo.o
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
@@ -698,7 +698,7 @@ DEBUG2HTML_OBJ = utils/debug2html.o utils/debugparse.o
SMBFILTER_OBJ = utils/smbfilter.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(SECRETS_OBJ) \
$(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ)
-PROTO_OBJ = $(SMBD_OBJ_MAIN) $(LIBNDR_OBJ) \
+PROTO_OBJ = $(SMBD_OBJ_MAIN) $(LIBNDR_OBJ) $(LIBNDR_GEN_OBJ) \
$(SMBD_OBJ_SRV) $(NMBD_OBJ1) $(SWAT_OBJ1) $(LIB_OBJ) $(LIBSMB_OBJ) \
$(SMBTORTURE_OBJ1) $(RPCCLIENT_OBJ1) \
$(LIBMSRPC_OBJ) @SMBWRAP_OBJS@ \
@@ -838,6 +838,26 @@ modules: SHOWFLAGS proto_exists $(MODULES)
cac: SHOWFLAGS $(LIBMSRPC)
+
+#####################################################################
+## Perl IDL Compiler
+IDL_FILES = unixinfo.idl
+
+pidl/Makefile: pidl/Makefile.PL
+ @echo Building Perl IDL Compiler....
+ @cd $(srcdir)/pidl && $(PERL) Makefile.PL
+
+pidl/lib/Parse/Pidl/IDL.pm: pidl/Makefile
+ @cd $(srcdir)/pidl && make
+
+idl: pidl/lib/Parse/Pidl/IDL.pm
+ @IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
+ srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh $(PIDL_ARGS)
+
+
+#####################################################################
+
+
everything: all libsmbclient debug2html smbfilter talloctort modules torture \
$(EVERYTHING_PROGS)
@@ -1796,6 +1816,8 @@ distclean: realclean
-rm -f include/config.h Makefile
-rm -f config.status config.cache so_locations
-rm -rf .deps TAGS
+ #-cd $(srcdir)/pidl && make distclean
+ #-rm -rf $(srcdir)/librpc/gen_ndr
realdistclean: distclean
-rm -f include/config.h.in
diff --git a/source3/include/core.h b/source3/include/core.h
new file mode 100644
index 0000000000..1f9ddb8b3c
--- /dev/null
+++ b/source3/include/core.h
@@ -0,0 +1,3 @@
+/* dummy file to deal with pidl autogenerated ndr files */
+
+#include "nterr.h"
diff --git a/source3/include/core/nterr.h b/source3/include/core/nterr.h
new file mode 100644
index 0000000000..c56735e772
--- /dev/null
+++ b/source3/include/core/nterr.h
@@ -0,0 +1 @@
+#include "includes.h"
diff --git a/source3/include/dcerpc.h b/source3/include/dcerpc.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/source3/include/dcerpc.h
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 35dd37748a..ab85c0e75e 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -1000,7 +1000,8 @@ extern int errno;
#include "rpc_client.h"
#include "event.h"
-#include "libndr/libndr.h"
+#include "librpc/ndr/libndr.h"
+#include "librpc/gen_ndr/unixinfo.h"
/*
* Type for wide character dirent structure.
diff --git a/source3/include/ndr.h b/source3/include/ndr.h
new file mode 100644
index 0000000000..a416866ef2
--- /dev/null
+++ b/source3/include/ndr.h
@@ -0,0 +1 @@
+/* dummy file to deal with pidl autogenerated ndr files */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 741b4a9d53..6bc8680f86 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -287,8 +287,8 @@ typedef struct dom_sid {
uint32 sub_auths[MAXSUBAUTHS];
} DOM_SID;
-#include "libndr/misc.h"
-#include "libndr/security.h"
+#include "librpc/ndr/misc.h"
+#include "librpc/ndr/security.h"
struct lsa_dom_info {
BOOL valid;
diff --git a/source3/libndr/unixinfo.h b/source3/libndr/unixinfo.h
deleted file mode 100644
index 5d0434ca72..0000000000
--- a/source3/libndr/unixinfo.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* header auto-generated by pidl */
-
-#ifndef _HEADER_unixinfo
-#define _HEADER_unixinfo
-
-struct unixinfo_GetPWUidInfo {
- NTSTATUS status;
- const char *homedir;/* [unique,charset(UTF8)] */
- const char *shell;/* [unique,charset(UTF8)] */
-};
-
-
-struct unixinfo_SidToUid {
- struct {
- struct dom_sid sid;
- } in;
-
- struct {
- uint64_t *uid;/* [ref] */
- NTSTATUS result;
- } out;
-
-};
-
-
-struct unixinfo_UidToSid {
- struct {
- uint64_t uid;
- } in;
-
- struct {
- struct dom_sid *sid;/* [ref] */
- NTSTATUS result;
- } out;
-
-};
-
-
-struct unixinfo_SidToGid {
- struct {
- struct dom_sid sid;
- } in;
-
- struct {
- uint64_t *gid;/* [ref] */
- NTSTATUS result;
- } out;
-
-};
-
-
-struct unixinfo_GidToSid {
- struct {
- uint64_t gid;
- } in;
-
- struct {
- struct dom_sid *sid;/* [ref] */
- NTSTATUS result;
- } out;
-
-};
-
-
-struct unixinfo_GetPWUid {
- struct {
- uint32_t *count;/* [ref,range(0 1023)] */
- uint64_t *uids;/* [size_is(*count)] */
- } in;
-
- struct {
- uint32_t *count;/* [ref,range(0 1023)] */
- struct unixinfo_GetPWUidInfo *infos;/* [ref,size_is(*count)] */
- NTSTATUS result;
- } out;
-
-};
-
-#endif /* _HEADER_unixinfo */
diff --git a/source3/librpc/gen_ndr/ndr_dcerpc.h b/source3/librpc/gen_ndr/ndr_dcerpc.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/source3/librpc/gen_ndr/ndr_dcerpc.h
diff --git a/source3/libndr/ndr_unixinfo.c b/source3/librpc/gen_ndr/ndr_unixinfo.c
index 61b4f4696a..7d42668526 100644
--- a/source3/libndr/ndr_unixinfo.c
+++ b/source3/librpc/gen_ndr/ndr_unixinfo.c
@@ -1,8 +1,23 @@
/* parser auto-generated by pidl */
-#include "includes.h"
-#include "libndr/ndr_unixinfo.h"
-static NTSTATUS ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r)
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <stdarg.h>
+#include <string.h>
+#include <core/nterr.h>
+#include <ndr/ndr_misc.h>
+#include <ndr/ndr_dcerpc.h>
+#include "gen_ndr/ndr_unixinfo.h"
+#include <dcerpc.h>
+
+#include <ndr/ndr_security.h>
+NTSTATUS ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_flags, const struct unixinfo_GetPWUidInfo *r)
{
if (ndr_flags & NDR_SCALARS) {
NDR_CHECK(ndr_push_align(ndr, 4));
@@ -27,7 +42,7 @@ static NTSTATUS ndr_push_unixinfo_GetPWUidInfo(struct ndr_push *ndr, int ndr_fla
return NT_STATUS_OK;
}
-static NTSTATUS ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r)
+NTSTATUS ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_flags, struct unixinfo_GetPWUidInfo *r)
{
uint32_t _ptr_homedir;
TALLOC_CTX *_mem_save_homedir_0;
@@ -38,13 +53,13 @@ static NTSTATUS ndr_pull_unixinfo_GetPWUidInfo(struct ndr_pull *ndr, int ndr_fla
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_homedir));
if (_ptr_homedir) {
- NDR_PULL_ALLOC_SIZE(ndr, r->homedir, 1);
+ NDR_PULL_ALLOC(ndr, r->homedir);
} else {
r->homedir = NULL;
}
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_shell));
if (_ptr_shell) {
- NDR_PULL_ALLOC_SIZE(ndr, r->shell, 1);
+ NDR_PULL_ALLOC(ndr, r->shell);
} else {
r->shell = NULL;
}
@@ -408,8 +423,8 @@ NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unix
NDR_PULL_ALLOC_N(ndr, r->out.infos, *r->in.count);
memset(r->out.infos, 0, *r->in.count * sizeof(*r->out.infos));
if (r->in.uids) {
- if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count));
+ if (r->in.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.uids, *r->in.count));
}
}
if (flags & NDR_OUT) {
@@ -438,8 +453,8 @@ NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unix
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_infos_1, 0);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
if (r->out.infos) {
- if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
- NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count));
+ if (r->out.count == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.infos, *r->out.count));
}
}
return NT_STATUS_OK;
diff --git a/source3/libndr/ndr_unixinfo.h b/source3/librpc/gen_ndr/ndr_unixinfo.h
index 1741cfc35f..41876d70a4 100644
--- a/source3/libndr/ndr_unixinfo.h
+++ b/source3/librpc/gen_ndr/ndr_unixinfo.h
@@ -1,10 +1,11 @@
/* header auto-generated by pidl */
-#include "libndr/unixinfo.h"
+#include "/home/drizzt/jerry/bzr/samba/SAMBA_3_0/source/librpc/gen_ndr/unixinfo.h"
#ifndef _HEADER_NDR_unixinfo
#define _HEADER_NDR_unixinfo
+#include <ndr.h>
#define DCERPC_UNIXINFO_UUID "9c54e310-a955-4885-bd31-78787147dfa6"
#define DCERPC_UNIXINFO_VERSION 0.0
#define DCERPC_UNIXINFO_NAME "unixinfo"
@@ -23,19 +24,9 @@ NTSTATUS dcerpc_server_unixinfo_init(void);
#define DCERPC_UNIXINFO_CALL_COUNT (5)
void ndr_print_unixinfo_GetPWUidInfo(struct ndr_print *ndr, const char *name, const struct unixinfo_GetPWUidInfo *r);
-NTSTATUS ndr_push_unixinfo_SidToUid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToUid *r);
-NTSTATUS ndr_pull_unixinfo_SidToUid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToUid *r);
void ndr_print_unixinfo_SidToUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToUid *r);
-NTSTATUS ndr_push_unixinfo_UidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_UidToSid *r);
-NTSTATUS ndr_pull_unixinfo_UidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_UidToSid *r);
void ndr_print_unixinfo_UidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_UidToSid *r);
-NTSTATUS ndr_push_unixinfo_SidToGid(struct ndr_push *ndr, int flags, const struct unixinfo_SidToGid *r);
-NTSTATUS ndr_pull_unixinfo_SidToGid(struct ndr_pull *ndr, int flags, struct unixinfo_SidToGid *r);
void ndr_print_unixinfo_SidToGid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_SidToGid *r);
-NTSTATUS ndr_push_unixinfo_GidToSid(struct ndr_push *ndr, int flags, const struct unixinfo_GidToSid *r);
-NTSTATUS ndr_pull_unixinfo_GidToSid(struct ndr_pull *ndr, int flags, struct unixinfo_GidToSid *r);
void ndr_print_unixinfo_GidToSid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GidToSid *r);
-NTSTATUS ndr_push_unixinfo_GetPWUid(struct ndr_push *ndr, int flags, const struct unixinfo_GetPWUid *r);
-NTSTATUS ndr_pull_unixinfo_GetPWUid(struct ndr_pull *ndr, int flags, struct unixinfo_GetPWUid *r);
void ndr_print_unixinfo_GetPWUid(struct ndr_print *ndr, const char *name, int flags, const struct unixinfo_GetPWUid *r);
#endif /* _HEADER_NDR_unixinfo */
diff --git a/source3/librpc/gen_ndr/unixinfo.h b/source3/librpc/gen_ndr/unixinfo.h
new file mode 100644
index 0000000000..73e1c8fd6c
--- /dev/null
+++ b/source3/librpc/gen_ndr/unixinfo.h
@@ -0,0 +1,82 @@
+/* header auto-generated by pidl */
+
+#include <core.h>
+
+#ifndef _HEADER_unixinfo
+#define _HEADER_unixinfo
+
+#include "librpc/ndr/security.h"
+struct unixinfo_GetPWUidInfo {
+ NTSTATUS status;/* [keepref] */
+ const char *homedir;/* [unique,keepref,charset(UTF8)] */
+ const char *shell;/* [unique,keepref,charset(UTF8)] */
+};
+
+
+struct unixinfo_SidToUid {
+ struct {
+ struct dom_sid sid;/* [keepref] */
+ } in;
+
+ struct {
+ uint64_t *uid;/* [keepref,ref] */
+ NTSTATUS result;
+ } out;
+
+};
+
+
+struct unixinfo_UidToSid {
+ struct {
+ uint64_t uid;/* [keepref] */
+ } in;
+
+ struct {
+ struct dom_sid *sid;/* [keepref,ref] */
+ NTSTATUS result;
+ } out;
+
+};
+
+
+struct unixinfo_SidToGid {
+ struct {
+ struct dom_sid sid;/* [keepref] */
+ } in;
+
+ struct {
+ uint64_t *gid;/* [keepref,ref] */
+ NTSTATUS result;
+ } out;
+
+};
+
+
+struct unixinfo_GidToSid {
+ struct {
+ uint64_t gid;/* [keepref] */
+ } in;
+
+ struct {
+ struct dom_sid *sid;/* [keepref,ref] */
+ NTSTATUS result;
+ } out;
+
+};
+
+
+struct unixinfo_GetPWUid {
+ struct {
+ uint32_t *count;/* [keepref,ref,range(0 1023)] */
+ uint64_t *uids;/* [keepref,size_is(*count)] */
+ } in;
+
+ struct {
+ uint32_t *count;/* [keepref,ref,range(0 1023)] */
+ struct unixinfo_GetPWUidInfo *infos;/* [keepref,ref,size_is(*count)] */
+ NTSTATUS result;
+ } out;
+
+};
+
+#endif /* _HEADER_unixinfo */
diff --git a/source3/libndr/libndr.h b/source3/librpc/ndr/libndr.h
index 817c461075..24a0c39b3d 100644
--- a/source3/libndr/libndr.h
+++ b/source3/librpc/ndr/libndr.h
@@ -23,8 +23,8 @@
#define _PRINTF_ATTRIBUTE(a,b)
-#include "libndr/misc.h"
-#include "libndr/security.h"
+#include "librpc/ndr/misc.h"
+#include "librpc/ndr/security.h"
struct dcerpc_syntax_id {
struct GUID uuid;
diff --git a/source3/libndr/misc.h b/source3/librpc/ndr/misc.h
index d929379870..d929379870 100644
--- a/source3/libndr/misc.h
+++ b/source3/librpc/ndr/misc.h
diff --git a/source3/libndr/ndr.c b/source3/librpc/ndr/ndr.c
index 2aff7a88f0..2aff7a88f0 100644
--- a/source3/libndr/ndr.c
+++ b/source3/librpc/ndr/ndr.c
diff --git a/source3/libndr/ndr_basic.c b/source3/librpc/ndr/ndr_basic.c
index ce2af31784..ce2af31784 100644
--- a/source3/libndr/ndr_basic.c
+++ b/source3/librpc/ndr/ndr_basic.c
diff --git a/source3/librpc/ndr/ndr_dcerpc.h b/source3/librpc/ndr/ndr_dcerpc.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/source3/librpc/ndr/ndr_dcerpc.h
diff --git a/source3/libndr/ndr_misc.c b/source3/librpc/ndr/ndr_misc.c
index 2f9004ae66..2f9004ae66 100644
--- a/source3/libndr/ndr_misc.c
+++ b/source3/librpc/ndr/ndr_misc.c
diff --git a/source3/librpc/ndr/ndr_misc.h b/source3/librpc/ndr/ndr_misc.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/source3/librpc/ndr/ndr_misc.h
diff --git a/source3/libndr/ndr_sec.h b/source3/librpc/ndr/ndr_sec.h
index 0858eac72c..0858eac72c 100644
--- a/source3/libndr/ndr_sec.h
+++ b/source3/librpc/ndr/ndr_sec.h
diff --git a/source3/libndr/ndr_sec_helper.c b/source3/librpc/ndr/ndr_sec_helper.c
index edbdd9a40e..edbdd9a40e 100644
--- a/source3/libndr/ndr_sec_helper.c
+++ b/source3/librpc/ndr/ndr_sec_helper.c
diff --git a/source3/librpc/ndr/ndr_security.h b/source3/librpc/ndr/ndr_security.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/source3/librpc/ndr/ndr_security.h
diff --git a/source3/libndr/ndr_string.c b/source3/librpc/ndr/ndr_string.c
index 8f2ec10a59..8f2ec10a59 100644
--- a/source3/libndr/ndr_string.c
+++ b/source3/librpc/ndr/ndr_string.c
diff --git a/source3/libndr/security.h b/source3/librpc/ndr/security.h
index 61e0ea313f..61e0ea313f 100644
--- a/source3/libndr/security.h
+++ b/source3/librpc/ndr/security.h
diff --git a/source3/libndr/sid.c b/source3/librpc/ndr/sid.c
index f8c284e93c..f8c284e93c 100644
--- a/source3/libndr/sid.c
+++ b/source3/librpc/ndr/sid.c
diff --git a/source3/rpc_client/cli_unixinfo.h b/source3/rpc_client/cli_unixinfo.h
index 4b3dd28c2e..e854c9db9d 100644
--- a/source3/rpc_client/cli_unixinfo.h
+++ b/source3/rpc_client/cli_unixinfo.h
@@ -1,4 +1,5 @@
-#include "libndr/ndr_unixinfo.h"
+#include "librpc/gen_ndr/unixinfo.h"
+#include "librpc/gen_ndr/ndr_unixinfo.h"
#ifndef __CLI_UNIXINFO__
#define __CLI_UNIXINFO__
NTSTATUS rpccli_unixinfo_SidToUid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct dom_sid sid, uint64_t *uid);
diff --git a/source3/script/build_idl.sh b/source3/script/build_idl.sh
new file mode 100644
index 0000000000..62941f4bc5
--- /dev/null
+++ b/source3/script/build_idl.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+PIDL_ARGS="--outputdir ${srcdir}/librpc/gen_ndr --header --ndr-parser --"
+PIDL_EXTRA_ARGS="$*"
+
+oldpwd=`pwd`
+cd ${srcdir}
+
+[ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
+
+PIDL="$PERL pidl/pidl ${PIDL_ARGS} ${PIDL_EXTRA_ARGS}"
+
+list=""
+for f in ${IDL_FILES}; do
+ basename=`basename $f .idl`
+ ndr="librpc/gen_ndr/ndr_$basename.c"
+
+ if [ -f $ndr ]; then
+ if [ "x`find librpc/idl/$f -newer $ndr -print`" = "xlibrpc/idl/$f" ]; then
+ list="$list librpc/idl/$f"
+ fi
+ else
+ list="$list librpc/idl/$f"
+ fi
+done
+
+if [ "x$list" != x ]; then
+ $PIDL $list || exit 1
+fi
+
+for f in librpc/gen_ndr/ndr_*.c; do
+ cat $f | sed 's/^static //g' | sed 's/^_PUBLIC_ //g' > $f.new
+ /bin/mv -f $f.new $f
+done
+
+touch librpc/gen_ndr/ndr_dcerpc.h
+
+cd ${oldpwd}
+
+exit 0