diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-06-27 12:03:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-06-27 12:03:23 +1000 |
commit | 7a295c66c056bc6eeb26d2176584fff4152b90b8 (patch) | |
tree | 6d18c2cb68f89f36e8085689e282fbf1cbc3e95f | |
parent | 1e36856ae50762ebad2d16e81b7ad604509b0d52 (diff) | |
parent | d4172dac2c122bc2cf5f419d5687168468a9a141 (diff) | |
download | samba-7a295c66c056bc6eeb26d2176584fff4152b90b8.tar.gz samba-7a295c66c056bc6eeb26d2176584fff4152b90b8.tar.bz2 samba-7a295c66c056bc6eeb26d2176584fff4152b90b8.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit 9607e79c3db9743617397c347bb69f87f6525801)
21 files changed, 162 insertions, 207 deletions
diff --git a/source4/Makefile b/source4/Makefile index 37d601f4f3..3c2efe35af 100644 --- a/source4/Makefile +++ b/source4/Makefile @@ -71,6 +71,7 @@ smbreadlinesrcdir := lib/smbreadline libmessagingsrcdir := lib/messaging libeventssrcdir := lib/events libcmdlinesrcdir := lib/cmdline +poptsrcdir := lib/popt socketwrappersrcdir := lib/socket_wrapper nsswrappersrcdir := lib/nss_wrapper appwebsrcdir := lib/appweb @@ -105,8 +106,6 @@ ntp_signdsrcdir := ntp_signd include data.mk -BINARIES += $(BIN_PROGS) $(SBIN_PROGS) - pythonmods:: $(PYTHON_PYS) $(PYTHON_SO) DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \ @@ -135,7 +134,6 @@ endif DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \ $(srcdir)/version.h -binaries:: $(BINARIES) libraries:: $(STATIC_LIBS) $(SHARED_LIBS) modules:: $(PLUGINS) headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS) @@ -212,20 +210,6 @@ installdirs:: $(DESTDIR)$(sysconfdir) \ installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs - @$(SHELL) $(srcdir)/script/installbin.sh \ - $(INSTALLPERMS) \ - $(DESTDIR)$(BASEDIR) \ - $(DESTDIR)$(sbindir) \ - $(DESTDIR)$(libdir) \ - $(DESTDIR)$(localstatedir) \ - $(SBIN_PROGS) - @$(SHELL) $(srcdir)/script/installbin.sh \ - $(INSTALLPERMS) \ - $(DESTDIR)$(BASEDIR) \ - $(DESTDIR)$(bindir) \ - $(DESTDIR)$(libdir) \ - $(DESTDIR)$(localstatedir) \ - $(BIN_PROGS) @$(SHELL) $(srcdir)/script/installtorture.sh \ $(INSTALLPERMS) \ $(DESTDIR)$(TORTUREDIR) \ @@ -262,6 +246,20 @@ uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader uninstallmisc:: #FIXME +$(DESTDIR)$(bindir)/%: bin/% installdirs + @mkdir -p $(@D) + @echo Installing $(@F) as $@ + @if test -f $@; then; rm -f $@.old; mv $@ $@.old; fi + @cp $< $@ + @chmod $(INSTALLPERMS) $@ + +$(DESTDIR)$(sbindir)/%: bin/% installdirs + @mkdir -p $(@D) + @echo Installing $(@F) as $@ + @if test -f $@; then; rm -f $@.old; mv $@ $@.old; fi + @cp $< $@ + @chmod $(INSTALLPERMS) $@ + uninstallbin:: @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS) @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS) @@ -289,7 +287,8 @@ data.mk: config.status $(MK_FILES) testcov-html:: include $(pidldir)/config.mk -include $(srcdir)/selftest/config.mk +selftestdir := $(srcdir)/selftest +include $(selftestdir)/config.mk showflags:: @echo ' pwd = '`/bin/pwd` diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk index 27a214459a..f8df8f0b53 100644 --- a/source4/build/make/rules.mk +++ b/source4/build/make/rules.mk @@ -43,8 +43,6 @@ clean:: clean_pch @-find . -name '*.o' -exec rm -f '{}' \; @echo Removing hostcc objects @-find . -name '*.ho' -exec rm -f '{}' \; - @echo Removing binaries - @-rm -f $(BIN_PROGS) $(SBIN_PROGS) $(BINARIES) $(TORTURE_PROGS) @echo Removing libraries @-rm -f $(STATIC_LIBS) $(SHARED_LIBS) @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o diff --git a/source4/build/make/templates.mk b/source4/build/make/templates.mk index 41a7ccd0a5..d4973e7dd6 100644 --- a/source4/build/make/templates.mk +++ b/source4/build/make/templates.mk @@ -22,6 +22,12 @@ define binary_link_template $(1): $(2) ; @echo Linking $$@ @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +clean:: + @rm -f $(1) + +binaries:: $(1) + endef # Link a host-machine binary @@ -30,6 +36,12 @@ define host_binary_link_template $(1): $(2) ; @echo Linking $$@ @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3) + +clean:: + rm -f $(1) + +binaries:: $(1) + endef # Create a prototype header @@ -106,3 +118,24 @@ uninstallplugins:: @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2) endef + +# abspath for older makes +abspath := $(shell cd $(1); pwd) + +# Install a binary +# Arguments: path to binary to install +define binary_install_template +installbin:: $$(DESTDIR)$$(bindir)/$(notdir $(1)) + +uninstallbin:: + @echo "Removing $(notdir $(1))" + @rm -f $$(DESTDIR)$$(bindir)/$(1) +endef + +define sbinary_install_template +installsbin:: $$(DESTDIR)$$(sbindir)/$(notdir $(1)) installdirs + +uninstallsbin:: + @echo "Removing $(notdir $(1))" + @rm -f $$(DESTDIR)$$(sbindir)/$(1) +endef diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 0ea31062f7..d9cbca0614 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -196,11 +196,10 @@ sub Binary($$) my ($self,$ctx) = @_; unless (defined($ctx->{INSTALLDIR})) { - $self->output("BINARIES += $ctx->{TARGET_BINARY}\n"); } elsif ($ctx->{INSTALLDIR} eq "SBINDIR") { - $self->output("SBIN_PROGS += $ctx->{RESULT_BINARY}\n"); + $self->output("\$(eval \$(call sbinary_install_template,$ctx->{RESULT_BINARY}))\n"); } elsif ($ctx->{INSTALLDIR} eq "BINDIR") { - $self->output("BIN_PROGS += $ctx->{RESULT_BINARY}\n"); + $self->output("\$(eval \$(call binary_install_template,$ctx->{RESULT_BINARY}))\n"); } $self->_prepare_list($ctx, "FULL_OBJ_LIST"); @@ -208,9 +207,9 @@ sub Binary($$) $self->_prepare_list($ctx, "LINK_FLAGS"); if (defined($ctx->{USE_HOSTCC}) && $ctx->{USE_HOSTCC} eq "YES") { -$self->output("\$(call host_binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NAME}_FULL_OBJ_LIST) \$($ctx->{NAME}_DEPEND_LIST), \$($ctx->{NAME}_LINK_FLAGS))\n"); +$self->output("\$(eval \$(call host_binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NAME}_FULL_OBJ_LIST) \$($ctx->{NAME}_DEPEND_LIST), \$($ctx->{NAME}_LINK_FLAGS)))\n"); } else { -$self->output("\$(call binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NAME}_FULL_OBJ_LIST) \$($ctx->{NAME}_DEPEND_LIST), \$($ctx->{NAME}_LINK_FLAGS))\n"); +$self->output("\$(eval \$(call binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NAME}_FULL_OBJ_LIST) \$($ctx->{NAME}_DEPEND_LIST), \$($ctx->{NAME}_LINK_FLAGS)))\n"); } } diff --git a/testprogs/blackbox/test_cifsdd.sh b/source4/client/tests/test_cifsdd.sh index 43564a0c77..08bfb25e80 100755 --- a/testprogs/blackbox/test_cifsdd.sh +++ b/source4/client/tests/test_cifsdd.sh @@ -14,9 +14,9 @@ USERNAME=$2 PASSWORD=$3 DOMAIN=$4 -. `dirname $0`/subunit.sh +. `dirname $0`/../../../testprogs/blackbox/subunit.sh -samba4bindir=`dirname $0`/../../source/bin +samba4bindir=`dirname $0`/../../bin DD=$samba4bindir/cifsdd SHARE=tmp diff --git a/testprogs/blackbox/test_smbclient.sh b/source4/client/tests/test_smbclient.sh index d2c5c675e2..27a3488c88 100755 --- a/testprogs/blackbox/test_smbclient.sh +++ b/source4/client/tests/test_smbclient.sh @@ -18,10 +18,10 @@ PREFIX=$5 shift 5 failed=0 -samba4bindir=`dirname $0`/../../source/bin +samba4bindir=`dirname $0`/../../bin smbclient=$samba4bindir/smbclient -. `dirname $0`/subunit.sh +. `dirname $0`/../../../testprogs/blackbox/subunit.sh runcmd() { name="$1" diff --git a/source4/heimdal_build/asn1_deps.pl b/source4/heimdal_build/asn1_deps.pl index 80334328fc..6b7181c4dd 100755 --- a/source4/heimdal_build/asn1_deps.pl +++ b/source4/heimdal_build/asn1_deps.pl @@ -6,7 +6,6 @@ # GPL use File::Basename; -use Cwd 'getcwd'; my $file = shift; my $prefix = shift; @@ -32,7 +31,7 @@ my $header = "$dirname/$prefix.h"; print "$header: \$(heimdalsrcdir)/$file \$(ASN1C)\n"; print "\t\@echo \"Compiling ASN1 file \$(heimdalsrcdir)/$file\"\n"; -print "\t\@\$(heimdalbuildsrcdir)/asn1_compile_wrapper.sh \$(builddir) $dirname \$(ASN1C) " . getcwd() . "/\$(heimdalsrcdir)/$file $prefix $options\n\n"; +print "\t\@\$(heimdalbuildsrcdir)/asn1_compile_wrapper.sh \$(builddir) $dirname \$(ASN1C) \$(call abspath,\$(heimdalsrcdir)/$file) $prefix $options\n\n"; open(IN,"heimdal/$file") or die("Can't open heimdal/$file: $!"); my @lines = <IN>; diff --git a/source4/heimdal_build/config.h b/source4/heimdal_build/config.h index e2c735a65f..38cdfbb6a6 100644 --- a/source4/heimdal_build/config.h +++ b/source4/heimdal_build/config.h @@ -21,4 +21,6 @@ #define HDB_DB_DIR "" +#undef HAVE_KRB5_ENCRYPT_BLOCK + #endif diff --git a/source4/heimdal_build/et_deps.pl b/source4/heimdal_build/et_deps.pl index 5deabe82b5..5032d471c7 100755 --- a/source4/heimdal_build/et_deps.pl +++ b/source4/heimdal_build/et_deps.pl @@ -1,7 +1,6 @@ #!/usr/bin/perl use File::Basename; -use Cwd 'getcwd'; my $file = shift; my $dirname = shift; @@ -11,7 +10,7 @@ my $header = "$dirname/$basename"; $header =~ s/\.et$/.h/; my $source = "$dirname/$basename"; $source =~ s/\.et$/.c/; print "$header $source: \$(heimdalsrcdir)/$file \$(ET_COMPILER)\n"; print "\t\@echo \"Compiling error table $file\"\n"; -print "\t\@\$(heimdalbuildsrcdir)/et_compile_wrapper.sh \$(builddir) $dirname \$(ET_COMPILER) " . getcwd() . "/\$(heimdalsrcdir)/$file $source\n\n"; +print "\t\@\$(heimdalbuildsrcdir)/et_compile_wrapper.sh \$(builddir) $dirname \$(ET_COMPILER) \$(call abspath,\$(heimdalsrcdir)/$file) $source\n\n"; print "clean:: \n"; print "\t\@rm -f $header $source\n\n"; diff --git a/source4/lib/events/libevents.m4 b/source4/lib/events/libevents.m4 index 552dc7c43e..d17da64b32 100644 --- a/source4/lib/events/libevents.m4 +++ b/source4/lib/events/libevents.m4 @@ -1,16 +1,18 @@ dnl find the events sources. This is meant to work both for dnl standalone builds, and builds of packages using libevents -eventsdir="" -eventspaths="$srcdir $srcdir/lib/events $srcdir/events $srcdir/../events" -for d in $eventspaths; do - if test -f "$d/events.c"; then - eventsdir="$d" - AC_SUBST(eventsdir) - break; - fi -done if test x"$eventsdir" = "x"; then - AC_MSG_ERROR([cannot find libevents source in $eventspaths]) + eventsdir="" + eventspaths="$srcdir $srcdir/../samba4/source/lib/events $srcdir/lib/events $srcdir/events $srcdir/../events" + for d in $eventspaths; do + if test -f "$d/events.c"; then + eventsdir="$d" + AC_SUBST(eventsdir) + break; + fi + done + if test x"$eventsdir" = "x"; then + AC_MSG_ERROR([cannot find libevents source in $eventspaths]) + fi fi EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_debug.o events_util.o" diff --git a/source4/lib/ldb/config.mk b/source4/lib/ldb/config.mk index 40b4e31cc7..36a5870a3e 100644 --- a/source4/lib/ldb/config.mk +++ b/source4/lib/ldb/config.mk @@ -2,11 +2,11 @@ # Start MODULE ldb_asq [MODULE::ldb_asq] PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include INIT_FUNCTION = LDB_MODULE(asq) SUBSYSTEM = LIBLDB -ldb_asq_OBJ_FILES = $(ldbdir)/modules/asq.o +ldb_asq_OBJ_FILES = $(ldbsrcdir)/modules/asq.o # End MODULE ldb_asq ################################################ @@ -14,113 +14,113 @@ ldb_asq_OBJ_FILES = $(ldbdir)/modules/asq.o # Start MODULE ldb_server_sort [MODULE::ldb_server_sort] PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include INIT_FUNCTION = LDB_MODULE(server_sort) SUBSYSTEM = LIBLDB # End MODULE ldb_sort ################################################ -ldb_server_sort_OBJ_FILES = $(ldbdir)/modules/sort.o +ldb_server_sort_OBJ_FILES = $(ldbsrcdir)/modules/sort.o ################################################ # Start MODULE ldb_paged_results [MODULE::ldb_paged_results] INIT_FUNCTION = LDB_MODULE(paged_results) -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SUBSYSTEM = LIBLDB # End MODULE ldb_paged_results ################################################ -ldb_paged_results_OBJ_FILES = $(ldbdir)/modules/paged_results.o +ldb_paged_results_OBJ_FILES = $(ldbsrcdir)/modules/paged_results.o ################################################ # Start MODULE ldb_paged_results [MODULE::ldb_paged_searches] INIT_FUNCTION = LDB_MODULE(paged_searches) -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS SUBSYSTEM = LIBLDB # End MODULE ldb_paged_results ################################################ -ldb_paged_searches_OBJ_FILES = $(ldbdir)/modules/paged_searches.o +ldb_paged_searches_OBJ_FILES = $(ldbsrcdir)/modules/paged_searches.o ################################################ # Start MODULE ldb_operational [MODULE::ldb_operational] SUBSYSTEM = LIBLDB -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS INIT_FUNCTION = LDB_MODULE(operational) # End MODULE ldb_operational ################################################ -ldb_operational_OBJ_FILES = $(ldbdir)/modules/operational.o +ldb_operational_OBJ_FILES = $(ldbsrcdir)/modules/operational.o ################################################ # Start MODULE ldb_rdn_name [MODULE::ldb_rdn_name] SUBSYSTEM = LIBLDB -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS INIT_FUNCTION = LDB_MODULE(rdn_name) # End MODULE ldb_rdn_name ################################################ -ldb_rdn_name_OBJ_FILES = $(ldbdir)/modules/rdn_name.o +ldb_rdn_name_OBJ_FILES = $(ldbsrcdir)/modules/rdn_name.o -ldb_map_OBJ_FILES = $(addprefix $(ldbdir)/ldb_map/, ldb_map_inbound.o ldb_map_outbound.o ldb_map.o) +ldb_map_OBJ_FILES = $(addprefix $(ldbsrcdir)/ldb_map/, ldb_map_inbound.o ldb_map_outbound.o ldb_map.o) -$(ldb_map_OBJ_FILES): CFLAGS+=-I$(ldbdir)/ldb_map +$(ldb_map_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir)/ldb_map ################################################ # Start MODULE ldb_skel [MODULE::ldb_skel] SUBSYSTEM = LIBLDB -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include PRIVATE_DEPENDENCIES = LIBTALLOC LIBEVENTS INIT_FUNCTION = LDB_MODULE(skel) # End MODULE ldb_skel ################################################ -ldb_skel_OBJ_FILES = $(ldbdir)/modules/skel.o +ldb_skel_OBJ_FILES = $(ldbsrcdir)/modules/skel.o ################################################ # Start MODULE ldb_sqlite3 [MODULE::ldb_sqlite3] SUBSYSTEM = LIBLDB -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include PRIVATE_DEPENDENCIES = LIBTALLOC SQLITE3 LIBEVENTS # End MODULE ldb_sqlite3 ################################################ -ldb_sqlite3_OBJ_FILES = $(ldbdir)/ldb_sqlite3/ldb_sqlite3.o +ldb_sqlite3_OBJ_FILES = $(ldbsrcdir)/ldb_sqlite3/ldb_sqlite3.o ################################################ # Start MODULE ldb_tdb [MODULE::ldb_tdb] SUBSYSTEM = LIBLDB -CFLAGS = -I$(ldbdir)/include -I$(ldbdir)/ldb_tdb +CFLAGS = -I$(ldbsrcdir)/include -I$(ldbsrcdir)/ldb_tdb PRIVATE_DEPENDENCIES = \ LIBTDB LIBTALLOC LIBEVENTS # End MODULE ldb_tdb ################################################ -ldb_tdb_OBJ_FILES = $(addprefix $(ldbdir)/ldb_tdb/, ldb_tdb.o ldb_search.o ldb_pack.o ldb_index.o ldb_cache.o ldb_tdb_wrap.o) +ldb_tdb_OBJ_FILES = $(addprefix $(ldbsrcdir)/ldb_tdb/, ldb_tdb.o ldb_search.o ldb_pack.o ldb_index.o ldb_cache.o ldb_tdb_wrap.o) ################################################ # Start SUBSYSTEM ldb [LIBRARY::LIBLDB] -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include INIT_FUNCTION_TYPE = extern const struct ldb_module_ops PUBLIC_DEPENDENCIES = \ LIBTALLOC LIBEVENTS PRIVATE_DEPENDENCIES = \ SOCKET_WRAPPER -PC_FILES += $(ldbdir)/ldb.pc +PC_FILES += $(ldbsrcdir)/ldb.pc # # End SUBSYSTEM ldb ################################################ @@ -128,13 +128,13 @@ PC_FILES += $(ldbdir)/ldb.pc LIBLDB_VERSION = 0.0.1 LIBLDB_SOVERSION = 0 -LIBLDB_OBJ_FILES = $(addprefix $(ldbdir)/common/, ldb.o ldb_ldif.o ldb_parse.o ldb_msg.o ldb_utf8.o ldb_debug.o ldb_modules.o ldb_match.o ldb_attributes.o attrib_handlers.o ldb_dn.o ldb_controls.o qsort.o) $(ldb_map_OBJ_FILES) +LIBLDB_OBJ_FILES = $(addprefix $(ldbsrcdir)/common/, ldb.o ldb_ldif.o ldb_parse.o ldb_msg.o ldb_utf8.o ldb_debug.o ldb_modules.o ldb_match.o ldb_attributes.o attrib_handlers.o ldb_dn.o ldb_controls.o qsort.o) $(ldb_map_OBJ_FILES) -$(LIBLDB_OBJ_FILES): CFLAGS+=-I$(ldbdir)/include +$(LIBLDB_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir)/include -PUBLIC_HEADERS += $(ldbdir)/include/ldb.h $(ldbdir)/include/ldb_errors.h +PUBLIC_HEADERS += $(ldbsrcdir)/include/ldb.h $(ldbsrcdir)/include/ldb_errors.h -MANPAGES += $(ldbdir)/man/ldb.3 +MANPAGES += $(ldbsrcdir)/man/ldb.3 ################################################ # Start BINARY ldbtest @@ -144,7 +144,7 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ldbtest ################################################ -ldbtest_OBJ_FILES = $(ldbdir)/tools/ldbtest.o +ldbtest_OBJ_FILES = $(ldbsrcdir)/tools/ldbtest.o ################################################ # Start BINARY oLschema2ldif @@ -156,9 +156,9 @@ PRIVATE_DEPENDENCIES = \ ################################################ -oLschema2ldif_OBJ_FILES = $(addprefix $(ldbdir)/tools/, convert.o oLschema2ldif.o) +oLschema2ldif_OBJ_FILES = $(addprefix $(ldbsrcdir)/tools/, convert.o oLschema2ldif.o) -MANPAGES += $(ldbdir)/man/oLschema2ldif.1 +MANPAGES += $(ldbsrcdir)/man/oLschema2ldif.1 ################################################ # Start BINARY ad2oLschema @@ -169,9 +169,9 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ad2oLschema ################################################ -ad2oLschema_OBJ_FILES = $(addprefix $(ldbdir)/tools/, convert.o ad2oLschema.o) +ad2oLschema_OBJ_FILES = $(addprefix $(ldbsrcdir)/tools/, convert.o ad2oLschema.o) -MANPAGES += $(ldbdir)/man/ad2oLschema.1 +MANPAGES += $(ldbsrcdir)/man/ad2oLschema.1 mkinclude tools/config.mk mkinclude ldb_ildap/config.mk diff --git a/source4/lib/ldb/ldb_ildap/config.mk b/source4/lib/ldb/ldb_ildap/config.mk index 94e3380038..4247bd96b7 100644 --- a/source4/lib/ldb/ldb_ildap/config.mk +++ b/source4/lib/ldb/ldb_ildap/config.mk @@ -2,12 +2,12 @@ # Start MODULE ldb_ildap [MODULE::ldb_ildap] SUBSYSTEM = LIBLDB -CFLAGS = -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir)/include OUTPUT_TYPE = SHARED_LIBRARY PRIVATE_DEPENDENCIES = LIBTALLOC LIBCLI_LDAP CREDENTIALS ALIASES = ldapi ldaps ldap # End MODULE ldb_ildap ################################################ -ldb_ildap_OBJ_FILES = $(ldbdir)/ldb_ildap/ldb_ildap.o +ldb_ildap_OBJ_FILES = $(ldbsrcdir)/ldb_ildap/ldb_ildap.o diff --git a/source4/lib/ldb/tools/config.mk b/source4/lib/ldb/tools/config.mk index 051fd0c57b..6b57929df0 100644 --- a/source4/lib/ldb/tools/config.mk +++ b/source4/lib/ldb/tools/config.mk @@ -1,13 +1,13 @@ ################################################ # Start SUBSYSTEM LIBLDB_CMDLINE [SUBSYSTEM::LIBLDB_CMDLINE] -CFLAGS = -I$(ldbdir) -I$(ldbdir)/include +CFLAGS = -I$(ldbsrcdir) -I$(ldbsrcdir)/include PUBLIC_DEPENDENCIES = LIBLDB LIBPOPT PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL POPT_SAMBA POPT_CREDENTIALS gensec # End SUBSYSTEM LIBLDB_CMDLINE ################################################ -LIBLDB_CMDLINE_OBJ_FILES = $(ldbdir)/tools/cmdline.o +LIBLDB_CMDLINE_OBJ_FILES = $(ldbsrcdir)/tools/cmdline.o ################################################ # Start BINARY ldbadd @@ -19,9 +19,9 @@ PRIVATE_DEPENDENCIES = \ ################################################ -ldbadd_OBJ_FILES = $(ldbdir)/tools/ldbadd.o +ldbadd_OBJ_FILES = $(ldbsrcdir)/tools/ldbadd.o -MANPAGES += $(ldbdir)/man/ldbadd.1 +MANPAGES += $(ldbsrcdir)/man/ldbadd.1 ################################################ # Start BINARY ldbdel @@ -32,9 +32,9 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ldbdel ################################################ -ldbdel_OBJ_FILES = $(ldbdir)/tools/ldbdel.o +ldbdel_OBJ_FILES = $(ldbsrcdir)/tools/ldbdel.o -MANPAGES += $(ldbdir)/man/ldbdel.1 +MANPAGES += $(ldbsrcdir)/man/ldbdel.1 ################################################ # Start BINARY ldbmodify @@ -45,8 +45,8 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ldbmodify ################################################ -ldbmodify_OBJ_FILES = $(ldbdir)/tools/ldbmodify.o -MANPAGES += $(ldbdir)/man/ldbmodify.1 +ldbmodify_OBJ_FILES = $(ldbsrcdir)/tools/ldbmodify.o +MANPAGES += $(ldbsrcdir)/man/ldbmodify.1 ################################################ # Start BINARY ldbsearch @@ -57,9 +57,9 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ldbsearch ################################################ -ldbsearch_OBJ_FILES = $(ldbdir)/tools/ldbsearch.o +ldbsearch_OBJ_FILES = $(ldbsrcdir)/tools/ldbsearch.o -MANPAGES += $(ldbdir)/man/ldbsearch.1 +MANPAGES += $(ldbsrcdir)/man/ldbsearch.1 ################################################ # Start BINARY ldbedit @@ -70,9 +70,9 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ldbedit ################################################ -ldbedit_OBJ_FILES = $(ldbdir)/tools/ldbedit.o +ldbedit_OBJ_FILES = $(ldbsrcdir)/tools/ldbedit.o -MANPAGES += $(ldbdir)/man/ldbedit.1 +MANPAGES += $(ldbsrcdir)/man/ldbedit.1 ################################################ # Start BINARY ldbrename @@ -83,8 +83,8 @@ PRIVATE_DEPENDENCIES = \ # End BINARY ldbrename ################################################ -ldbrename_OBJ_FILES = $(ldbdir)/tools/ldbrename.o +ldbrename_OBJ_FILES = $(ldbsrcdir)/tools/ldbrename.o -MANPAGES += $(ldbdir)/man/ldbrename.1 +MANPAGES += $(ldbsrcdir)/man/ldbrename.1 diff --git a/source4/lib/popt/config.mk b/source4/lib/popt/config.mk index 86d440ac78..e015577aea 100644 --- a/source4/lib/popt/config.mk +++ b/source4/lib/popt/config.mk @@ -1,5 +1,5 @@ [SUBSYSTEM::LIBPOPT] CFLAGS = -Ilib/popt -LIBPOPT_OBJ_FILES = $(addprefix lib/popt/, findme.o popt.o poptconfig.o popthelp.o poptparse.o) +LIBPOPT_OBJ_FILES = $(addprefix $(poptsrcdir)/, findme.o popt.o poptconfig.o popthelp.o poptparse.o) diff --git a/testprogs/blackbox/test_wbinfo.sh b/source4/nsswitch/tests/test_wbinfo.sh index ec8b9ebd44..dfd633b656 100755 --- a/testprogs/blackbox/test_wbinfo.sh +++ b/source4/nsswitch/tests/test_wbinfo.sh @@ -14,10 +14,10 @@ TARGET=$4 shift 4 failed=0 -samba4bindir=`dirname $0`/../../source/bin +samba4bindir=`dirname $0`/../../bin wbinfo=$samba4bindir/wbinfo -. `dirname $0`/subunit.sh +. `dirname $0`/../../../testprogs/blackbox/subunit.sh testfail() { name="$1" diff --git a/source4/nsswitch/wbinfo.c b/source4/nsswitch/wbinfo.c index 21c178cc7b..150d9a68ee 100644 --- a/source4/nsswitch/wbinfo.c +++ b/source4/nsswitch/wbinfo.c @@ -614,6 +614,23 @@ static bool wbinfo_sid_to_gid(char *sid) return true; } +static const char *sid_type_lookup(enum lsa_SidType r) +{ + switch (r) { + case SID_NAME_USE_NONE: return "SID_NAME_USE_NONE"; break; + case SID_NAME_USER: return "SID_NAME_USER"; break; + case SID_NAME_DOM_GRP: return "SID_NAME_DOM_GRP"; break; + case SID_NAME_DOMAIN: return "SID_NAME_DOMAIN"; break; + case SID_NAME_ALIAS: return "SID_NAME_ALIAS"; break; + case SID_NAME_WKN_GRP: return "SID_NAME_WKN_GRP"; break; + case SID_NAME_DELETED: return "SID_NAME_DELETED"; break; + case SID_NAME_INVALID: return "SID_NAME_INVALID"; break; + case SID_NAME_UNKNOWN: return "SID_NAME_UNKNOWN"; break; + case SID_NAME_COMPUTER: return "SID_NAME_COMPUTER"; break; + } + return "Invalid sid type\n"; +} + /* Convert sid to string */ static bool wbinfo_lookupsid(char *sid) @@ -634,30 +651,13 @@ static bool wbinfo_lookupsid(char *sid) /* Display response */ - d_printf("%s%c%s %d\n", response.data.name.dom_name, - winbind_separator(), response.data.name.name, - response.data.name.type); + d_printf("%s%c%s %s\n", response.data.name.dom_name, + winbind_separator(), response.data.name.name, + sid_type_lookup(response.data.name.type)); return true; } -static const char *sid_type_lookup(enum lsa_SidType r) -{ - switch (r) { - case SID_NAME_USE_NONE: return "SID_NAME_USE_NONE"; break; - case SID_NAME_USER: return "SID_NAME_USER"; break; - case SID_NAME_DOM_GRP: return "SID_NAME_DOM_GRP"; break; - case SID_NAME_DOMAIN: return "SID_NAME_DOMAIN"; break; - case SID_NAME_ALIAS: return "SID_NAME_ALIAS"; break; - case SID_NAME_WKN_GRP: return "SID_NAME_WKN_GRP"; break; - case SID_NAME_DELETED: return "SID_NAME_DELETED"; break; - case SID_NAME_INVALID: return "SID_NAME_INVALID"; break; - case SID_NAME_UNKNOWN: return "SID_NAME_UNKNOWN"; break; - case SID_NAME_COMPUTER: return "SID_NAME_COMPUTER"; break; - } - return "Invalid sid type\n"; -} - /* Convert string to sid */ static bool wbinfo_lookupname(char *name) diff --git a/source4/script/installbin.sh b/source4/script/installbin.sh deleted file mode 100755 index c2f34082dd..0000000000 --- a/source4/script/installbin.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -INSTALLPERMS=$1 -BASEDIR=$2 -BINDIR=$3 -LIBDIR=$4 -VARDIR=$5 -shift -shift -shift -shift -shift - -for p in $*; do - p2=`basename $p` - echo Installing $p as $BINDIR/$p2 - if [ -f $BINDIR/$p2 ]; then - rm -f $BINDIR/$p2.old - mv $BINDIR/$p2 $BINDIR/$p2.old - fi - cp $p $BINDIR/ - chmod $INSTALLPERMS $BINDIR/$p2 - - # this is a special case, mount needs this in a specific location - if [ $p2 = smbmount ]; then - ln -sf $BINDIR/$p2 /sbin/mount.smbfs - fi -done - - -cat << EOF -====================================================================== -The binaries are installed. You may restore the old binaries (if there -were any) using the command "make revert". You may uninstall the binaries -using the command "make uninstallbin" or "make uninstall" to uninstall -binaries, man pages and shell scripts. -====================================================================== -EOF - -exit 0 diff --git a/source4/script/uninstallbin.sh b/source4/script/uninstallbin.sh deleted file mode 100755 index a8bbdea7af..0000000000 --- a/source4/script/uninstallbin.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -#4 July 96 Dan.Shearer@UniSA.edu.au - -INSTALLPERMS=$1 -BASEDIR=$2 -BINDIR=$3 -LIBDIR=$4 -VARDIR=$5 -shift -shift -shift -shift -shift - -if [ ! -d $BINDIR ]; then - echo Directory $BINDIR does not exist! - echo Do a "make installbin" or "make install" first. - exit 1 -fi - -for p in $*; do - p2=`basename $p` - if [ -f $BINDIR/$p2 ]; then - echo Removing $BINDIR/$p2 - rm -f $BINDIR/$p2 - if [ -f $BINDIR/$p2 ]; then - echo Cannot remove $BINDIR/$p2 ... does $USER have privileges? - fi - fi -done - - -cat << EOF -====================================================================== -The binaries have been uninstalled. You may restore the binaries using -the command "make installbin" or "make install" to install binaries, -man pages, modules and shell scripts. You can restore a previous -version of the binaries (if there were any) using "make revert". -====================================================================== -EOF - -exit 0 diff --git a/source4/selftest/config.mk b/source4/selftest/config.mk index 2ae49b244b..871c14898f 100644 --- a/source4/selftest/config.mk +++ b/source4/selftest/config.mk @@ -1,6 +1,6 @@ TEST_FORMAT = plain -SELFTEST = $(LD_LIBPATH_OVERRIDE) $(PERL) $(srcdir)/selftest/selftest.pl --prefix=${selftest_prefix} \ +SELFTEST = $(LD_LIBPATH_OVERRIDE) $(PERL) $(selftestdir)/selftest.pl --prefix=${selftest_prefix} \ --builddir=$(builddir) --srcdir=$(srcdir) \ --expected-failures=$(srcdir)/samba4-knownfail \ --format=$(TEST_FORMAT) \ diff --git a/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh index 79ebc7b0f7..e67e035c31 100755 --- a/source4/selftest/samba4_tests.sh +++ b/source4/selftest/samba4_tests.sh @@ -268,16 +268,16 @@ fi bbdir=$incdir/../../testprogs/blackbox plantest "blackbox.ndrdump" dc $bbdir/test_ndrdump.sh -plantest "blackbox.smbclient" dc $bbdir/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" +plantest "blackbox.smbclient" dc $samba4srcdir/client/tests/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" $CONFIGURATION -plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" +plantest "blackbox.cifsdd" dc $samba4srcdir/client/tests/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" plantest "blackbox.nmblookup" dc $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" plantest "blackbox.nmblookup" member $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" plantest "blackbox.locktest" dc $bbdir/test_locktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" plantest "blackbox.masktest" dc $bbdir/test_masktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" plantest "blackbox.gentest" dc $bbdir/test_gentest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" -plantest "blackbox.wbinfo" dc $bbdir/test_wbinfo.sh "\$DOMAIN" "\$USERNAME" "\$PASSWORD" "dc" -plantest "blackbox.wbinfo" member $bbdir/test_wbinfo.sh "\$DOMAIN" "\$DC_USERNAME" "\$DC_PASSWORD" "member" +plantest "blackbox.wbinfo" dc $samba4srcdir/nsswitch/tests/test_wbinfo.sh "\$DOMAIN" "\$USERNAME" "\$PASSWORD" "dc" +plantest "blackbox.wbinfo" member $samba4srcdir/nsswitch/tests/test_wbinfo.sh "\$DOMAIN" "\$DC_USERNAME" "\$DC_PASSWORD" "member" plantest "blackbox.wintest" none $bbdir/test_wintest.sh "$TORTURE_OPTIONS" # Tests using the "Simple" NTVFS backend diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 74c87c68a4..5bd5568913 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -202,6 +202,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ init_module_fn static_init[] = { STATIC_smbd_MODULES }; init_module_fn *shared_init; struct event_context *event_ctx; + uint16_t stdin_event_flags; NTSTATUS status; const char *model = "standard"; int max_runtime = 0; @@ -324,15 +325,20 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ cluster_ctdb_init(cmdline_lp_ctx, event_ctx, model); if (opt_interactive) { - /* catch EOF on stdin */ -#ifdef SIGTTIN - signal(SIGTTIN, SIG_IGN); -#endif - event_add_fd(event_ctx, event_ctx, 0, EVENT_FD_READ, - server_stdin_handler, - discard_const(binary_name)); + /* terminate when stdin goes away */ + stdin_event_flags = EVENT_FD_READ; + } else { + /* stay alive forever */ + stdin_event_flags = 0; } + /* catch EOF on stdin */ +#ifdef SIGTTIN + signal(SIGTTIN, SIG_IGN); +#endif + event_add_fd(event_ctx, event_ctx, 0, stdin_event_flags, + server_stdin_handler, + discard_const(binary_name)); if (max_runtime) { event_add_timed(event_ctx, event_ctx, |