summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-09-03 16:40:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:03:30 -0500
commita44e97c99f61916db3f7cc02cd2581c8d64be73a (patch)
treeeddb0858f3c436be25c984ec686aad6c04048ce1
parent99c909c2fa2b847e6f55f6f5706d5f46014f8b86 (diff)
downloadsamba-a44e97c99f61916db3f7cc02cd2581c8d64be73a.tar.gz
samba-a44e97c99f61916db3f7cc02cd2581c8d64be73a.tar.bz2
samba-a44e97c99f61916db3f7cc02cd2581c8d64be73a.zip
r10001: adding in libmsrpc from Chris Nicholls (SoC project). not built by default per conversation with Jeremy until the rpc changes from trunk are merged back
(This used to be commit e813de1e522692a6471828bf1fdf503d33f8cd72)
-rw-r--r--source3/Makefile.in27
-rw-r--r--source3/libsmb/libsmbclient.c43
2 files changed, 45 insertions, 25 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index e807839032..ff0d0ff61d 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -137,7 +137,7 @@ BIN_PROGS = $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) @EXTRA_BIN_PROGS@
EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ bin/talloctort@EXEEXT@ \
bin/log2pcap@EXEEXT@
-SHLIBS = @SHLIB_PROGS@ @LIBSMBCLIENT@
+SHLIBS = @SHLIB_PROGS@ @LIBSMBCLIENT@
SCRIPTS = $(srcdir)/script/smbtar $(builddir)/script/findsmb
@@ -513,6 +513,11 @@ LIBSMBCLIENT_OBJ = libsmb/libsmbclient.o libsmb/libsmb_compat.o \
$(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
$(SECRETS_OBJ) $(PASSDB_OBJ) $(SMBLDAP_OBJ) $(GROUPDB_OBJ)
+CAC_OBJ = $(LIBSMBCLIENT_OBJ) \
+ libmsrpc/libmsrpc.o libmsrpc/libmsrpc_internal.o \
+ libmsrpc/cac_lsarpc.o libmsrpc/cac_winreg.o libmsrpc/cac_samr.o \
+ libmsrpc/cac_svcctl.o
+
# This shared library is intended for linking with unit test programs
# to test Samba internals. It's called libbigballofmud.so to
# discourage casual usage.
@@ -637,6 +642,8 @@ WINBIND_WINS_NSS_PICOBJS = $(WINBIND_WINS_NSS_OBJ:.o=.@PICSUFFIX@)
PICOBJS = $(SMBWRAPPER_OBJ:.o=.@PICSUFFIX@)
LIBSMBCLIENT_PICOBJS = $(LIBSMBCLIENT_OBJ:.o=.@PICSUFFIX@)
+CAC_PICOBJS = $(CAC_OBJ:.o=.@PICSUFFIX@)
+
PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
$(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
@@ -738,7 +745,9 @@ wins : SHOWFLAGS @WINBIND_WINS_NSS@
modules: SHOWFLAGS proto_exists $(MODULES)
-everything: all libsmbclient debug2html smbfilter talloctort modules torture \
+cac: SHOWFLAGS bin/libmsrpc.@SHLIBEXT@ bin/libmsrpc.a
+
+everything: all libsmbclient debug2html smbfilter talloctort modules torture cac \
$(EVERYTHING_PROGS)
.SUFFIXES:
@@ -1007,6 +1016,17 @@ bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS)
@echo Linking libsmbclient non-shared library $@
@-$(AR) -rc $@ $(LIBSMBCLIENT_PICOBJS)
+
+bin/libmsrpc.@SHLIBEXT@: $(CAC_PICOBJS)
+ @echo Linking libmsrpc shared library $@
+ @$(SHLD) $(LDSHFLAGS) -o $@ $(CAC_PICOBJS) $(LDFLAGS) $(LIBS) \
+ @SONAMEFLAG@`basename $@`
+
+bin/libmsrpc.a: $(CAC_PICOBJS)
+ @echo Linking libmsrpc non-shared library $@
+ @-$(AR) -rc $@ $(CAC_PICOBJS)
+
+
# This is probably wrong for anything other than the GNU linker.
bin/libbigballofmud.@SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS)
@echo Linking bigballofmud shared library $@
@@ -1275,9 +1295,6 @@ bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_PICOOBJ)
@echo "Linking shared library $@"
@$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_PICOOBJ) -lpam $(DYNEXP) $(LIBS) -lc $(LDAP_LIBS) $(KRB5LIBS)
-bin/libmsrpc.a: $(LIBMSRPC_PICOBJ)
- @-$(AR) -rc $@ $(LIBMSRPC_PICOBJ)
-
bin/tdbbackup@EXEEXT@: $(TDBBACKUP_OBJ) bin/.dummy
@echo Linking $@
@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) $(LIBS) $(TDBBACKUP_OBJ) @SOCKWRAP@
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 9104a083f5..ce47277c26 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -835,26 +835,29 @@ SMBCSRV *smbc_attr_server(SMBCCTX *context,
return NULL;
}
- if (!cli_nt_session_open(ipc_cli, PI_LSARPC)) {
- DEBUG(1, ("cli_nt_session_open fail!\n"));
- errno = ENOTSUP;
- cli_shutdown(ipc_cli);
- return NULL;
- }
-
- /* Some systems don't support SEC_RIGHTS_MAXIMUM_ALLOWED,
- but NT sends 0x2000000 so we might as well do it too. */
-
- nt_status = cli_lsa_open_policy(ipc_cli,
- ipc_cli->mem_ctx,
- True,
- GENERIC_EXECUTE_ACCESS,
- pol);
-
- if (!NT_STATUS_IS_OK(nt_status)) {
- errno = smbc_errno(context, ipc_cli);
- cli_shutdown(ipc_cli);
- return NULL;
+ if(pol) {
+
+ if (!cli_nt_session_open(ipc_cli, PI_LSARPC)) {
+ DEBUG(1, ("cli_nt_session_open fail!\n"));
+ errno = ENOTSUP;
+ cli_shutdown(ipc_cli);
+ return NULL;
+ }
+
+ /* Some systems don't support SEC_RIGHTS_MAXIMUM_ALLOWED,
+ but NT sends 0x2000000 so we might as well do it too. */
+
+ nt_status = cli_lsa_open_policy(ipc_cli,
+ ipc_cli->mem_ctx,
+ True,
+ GENERIC_EXECUTE_ACCESS,
+ pol);
+
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ errno = smbc_errno(context, ipc_cli);
+ cli_shutdown(ipc_cli);
+ return NULL;
+ }
}
ipc_srv = SMB_MALLOC_P(SMBCSRV);