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 =
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
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@ \
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)
-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
--- /dev/null
+/* dummy file to deal with pidl autogenerated ndr files */
+
+#include "nterr.h"
--- /dev/null
+#include "includes.h"
#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.
--- /dev/null
+/* dummy file to deal with pidl autogenerated ndr files */
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;
+++ /dev/null
-/* 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 */
/* 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));
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;
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;
}
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) {
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;
/* 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"
#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 */
--- /dev/null
+/* 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 */
#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;
-#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);
--- /dev/null
+#!/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