1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r18193: Not quite to autogenerated NDR but closer thanks to Jelmer's

initial work.  I'm including the librpc/gen_ndr directory
in svn temporarily just to get some compile issues straightened
out.
This commit is contained in:
Gerald Carter 2006-09-06 22:08:06 +00:00 committed by Gerald (Jerry) Carter
parent aa62bb6b4c
commit cf271aa433
27 changed files with 189 additions and 111 deletions

View File

@ -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

3
source/include/core.h Normal file
View File

@ -0,0 +1,3 @@
/* dummy file to deal with pidl autogenerated ndr files */
#include "nterr.h"

View File

@ -0,0 +1 @@
#include "includes.h"

0
source/include/dcerpc.h Normal file
View File

View File

@ -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.

1
source/include/ndr.h Normal file
View File

@ -0,0 +1 @@
/* dummy file to deal with pidl autogenerated ndr files */

View File

@ -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;

View File

@ -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 */

View File

View File

@ -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;

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

View File

View File

View File

@ -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);

View File

@ -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