From 9f8fc29ea418c7ed2e2f206eb4789080ec9ab3f1 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Feb 2008 10:21:39 +0100 Subject: pvfs_open: pass NTCREATEX_DISP_OPEN to odb_can_open() As 0 is NTCREATEX_DISP_SUPERSEDE and that's not what we want here. metze (This used to be commit 10c42e3d4ab71a71dfe620b40841dfe98f458c1a) --- source4/ntvfs/posix/pvfs_open.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 12b70c00fd..ef05db5eac 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -1530,7 +1530,7 @@ NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs, status = odb_can_open(lck, name->stream_id, share_access, access_mask, delete_on_close, - 0, false); + NTCREATEX_DISP_OPEN, false); if (NT_STATUS_IS_OK(status)) { status = pvfs_access_check_simple(pvfs, req, name, access_mask); @@ -1594,7 +1594,7 @@ NTSTATUS pvfs_can_rename(struct pvfs_state *pvfs, status = odb_can_open(lck, name->stream_id, share_access, access_mask, delete_on_close, - 0, false); + NTCREATEX_DISP_OPEN, false); /* * if it's a sharing violation or we got no oplock @@ -1656,7 +1656,7 @@ NTSTATUS pvfs_can_update_file_size(struct pvfs_state *pvfs, status = odb_can_open(lck, name->stream_id, share_access, access_mask, delete_on_close, - 0, break_to_none); + NTCREATEX_DISP_OPEN, break_to_none); /* * if it's a sharing violation or we got no oplock @@ -1715,7 +1715,7 @@ NTSTATUS pvfs_can_stat(struct pvfs_state *pvfs, status = odb_can_open(lck, name->stream_id, share_access, access_mask, delete_on_close, - 0, false); + NTCREATEX_DISP_OPEN, false); if (!NT_STATUS_IS_OK(status)) { talloc_free(lck); -- cgit From b40be554e7775687a01704b9af0aa272cc9019d0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Feb 2008 10:28:07 +0100 Subject: pvfs_open: pass down an access mask in pvfs_can_stat() metze (This used to be commit 6c34c7bc6801e470e5ec50aa93d0a07f7ad59314) --- source4/ntvfs/posix/pvfs_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index ef05db5eac..0e4250d744 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -1710,7 +1710,7 @@ NTSTATUS pvfs_can_stat(struct pvfs_state *pvfs, share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE; - access_mask = 0; + access_mask = SEC_FILE_READ_ATTRIBUTE; delete_on_close = false; status = odb_can_open(lck, name->stream_id, -- cgit From c62faaa75e2bf2c82b7a905b27d29f70ae0c7591 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Feb 2008 10:29:07 +0100 Subject: pvfs_qfileinfo: down discard the return value of pvfs_can_stat() The odb_can_open() code returns DELETE_PENDING if a delete is really pending. metze (This used to be commit 066ba3c7cfff12cb0b5298fc45eabb5fc097d056) --- source4/ntvfs/posix/pvfs_qfileinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c index 2f01c08fb0..8d23d707a4 100644 --- a/source4/ntvfs/posix/pvfs_qfileinfo.c +++ b/source4/ntvfs/posix/pvfs_qfileinfo.c @@ -330,7 +330,7 @@ NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs, status = pvfs_can_stat(pvfs, req, name); if (!NT_STATUS_IS_OK(status)) { - return NT_STATUS_DELETE_PENDING; + return status; } status = pvfs_access_check_simple(pvfs, req, name, -- cgit From 55377f0352d73fa354e8abcf3e644c63c78d0ca6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Feb 2008 10:26:33 +0100 Subject: pvfs_open: pass down an access mask to pvfs_can_update_file_size() You just need SEC_FILE_WRITE_ATTRIBUTE to change the filesize... metze (This used to be commit 27e39063a0b759c7bced1cc9d7a6cb9192820c70) --- source4/ntvfs/posix/pvfs_open.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 0e4250d744..a01352f60c 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -1648,9 +1648,19 @@ NTSTATUS pvfs_can_update_file_size(struct pvfs_state *pvfs, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - /* TODO: this may needs some more flags */ - share_access = NTCREATEX_SHARE_ACCESS_WRITE; - access_mask = 0; + share_access = NTCREATEX_SHARE_ACCESS_READ | + NTCREATEX_SHARE_ACCESS_WRITE | + NTCREATEX_SHARE_ACCESS_DELETE; + /* + * I would have thought that we would need to pass + * SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA here too + * + * But you only need SEC_FILE_WRITE_ATTRIBUTE permissions + * to set the filesize. + * + * --metze + */ + access_mask = SEC_FILE_WRITE_ATTRIBUTE; delete_on_close = false; break_to_none = true; -- cgit From 2b94ffe5e7303c1d321b9a9c6a612f77f1ac58b2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Feb 2008 12:52:46 +0100 Subject: opendb_tdb: with break_to_none attribute only opens also break oplocks metze (This used to be commit c475353e34154eb13e35cc8b6cf553e3986f8677) --- source4/ntvfs/common/opendb_tdb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c index 73c04b7c4f..fe5a0a8864 100644 --- a/source4/ntvfs/common/opendb_tdb.c +++ b/source4/ntvfs/common/opendb_tdb.c @@ -288,7 +288,8 @@ static NTSTATUS odb_oplock_break_send(struct odb_context *odb, } static bool access_attributes_only(uint32_t access_mask, - uint32_t open_disposition) + uint32_t open_disposition, + bool break_to_none) { switch (open_disposition) { case NTCREATEX_DISP_SUPERSEDE: @@ -298,6 +299,11 @@ static bool access_attributes_only(uint32_t access_mask, default: break; } + + if (break_to_none) { + return false; + } + #define CHECK_MASK(m,g) ((m) && (((m) & ~(g))==0) && (((m) & (g)) != 0)) return CHECK_MASK(access_mask, SEC_STD_SYNCHRONIZE | @@ -326,7 +332,8 @@ static NTSTATUS odb_tdb_open_can_internal(struct odb_context *odb, * but we'll not grant the oplock below */ attrs_only = access_attributes_only(access_mask, - open_disposition); + open_disposition, + break_to_none); if (attrs_only) { break; } -- cgit From 39eb63039163cf7625edf5c0a33112a0659c3eca Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 26 Feb 2008 14:20:31 +0100 Subject: Rely on GNU make to build static libraries. Conflicts: source/build/smb_build/makefile.pm (This used to be commit f34a17a92bcc9a27b629a6ec9ed9a818bd13acc0) --- source4/build/smb_build/makefile.pm | 11 +---------- source4/rules.mk | 7 +++++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 17474db00e..29da771353 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -281,16 +281,7 @@ sub StaticLibrary($$) $self->output("$ctx->{NAME}_OUTPUT = $ctx->{OUTPUT}\n"); $self->_prepare_list($ctx, "FULL_OBJ_LIST"); - $self->output(<< "__EOD__" -# -$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST) - \@echo Linking \$@ - \@rm -f \$@ - \@mkdir -p $ctx->{STATICDIR} - \@\$(STLD) \$(STLD_FLAGS) \$@ \$($ctx->{NAME}_FULL_OBJ_LIST) - -__EOD__ -); + $self->output("$ctx->{RESULT_STATIC_LIBRARY}: \$($ctx->{NAME}_FULL_OBJ_LIST)\n"); } sub Header($$) diff --git a/source4/rules.mk b/source4/rules.mk index b6a54fae25..9791466712 100644 --- a/source4/rules.mk +++ b/source4/rules.mk @@ -100,6 +100,13 @@ check:: test unused_macros: $(srcdir)/script/find_unused_macros.pl `find . -name "*.[ch]"` | sort +# Create a static library +%.a: + @echo Linking $@ + @rm -f $@ + @mkdir -p $(@D) + @$(STLD) $(STLD_FLAGS) $@ $^ + ############################################################################### # File types ############################################################################### -- cgit From 9d6ce7efaabd2554519afdccd6e12fbba05930da Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Feb 2008 14:52:50 +0100 Subject: RAW-OPLOCK: BATCH15: make sure a qpathinfo doesn't break batch oplocks metze (This used to be commit 4d17d44d3f418216a40c80f290f97a4dc29147b0) --- source4/torture/raw/oplock.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 3edd0c6820..e81b634161 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -1279,6 +1279,79 @@ done: return ret; } +static bool test_raw_oplock_batch15(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2) +{ + const char *fname = BASEDIR "\\test_batch15.dat"; + NTSTATUS status; + bool ret = true; + union smb_open io; + union smb_fileinfo qfi; + uint16_t fnum=0; + + if (!torture_setup_dir(cli1, BASEDIR)) { + return false; + } + + /* cleanup */ + smbcli_unlink(cli1->tree, fname); + + smbcli_oplock_handler(cli1->transport, oplock_handler_ack_to_levelII, cli1->tree); + + /* + base ntcreatex parms + */ + io.generic.level = RAW_OPEN_NTCREATEX; + io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + io.ntcreatex.in.alloc_size = 0; + io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE; + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.ntcreatex.in.create_options = 0; + io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS; + io.ntcreatex.in.security_flags = 0; + io.ntcreatex.in.fname = fname; + + /* Test if a qpathinfo all info on pathname breaks a batch oplock. */ + torture_comment(tctx, "Test if qpathinfo all info breaks a batch oplock (should not).\n"); + + ZERO_STRUCT(break_info); + smbcli_oplock_handler(cli1->transport, oplock_handler_ack_to_levelII, cli1->tree); + + io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | + NTCREATEX_FLAGS_REQUEST_OPLOCK | + NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK; + io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE| + NTCREATEX_SHARE_ACCESS_DELETE; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE; + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE; + status = smb_raw_open(cli1->tree, tctx, &io); + CHECK_STATUS(tctx, status, NT_STATUS_OK); + fnum = io.ntcreatex.out.file.fnum; + CHECK_VAL(break_info.count, 0); + CHECK_VAL(break_info.failures, 0); + CHECK_VAL(io.ntcreatex.out.oplock_level, BATCH_OPLOCK_RETURN); + + ZERO_STRUCT(qfi); + qfi.generic.level = RAW_FILEINFO_ALL_INFORMATION; + qfi.generic.in.file.path = fname; + + status = smb_raw_pathinfo(cli2->tree, tctx, &qfi); + + CHECK_STATUS(tctx, status, NT_STATUS_OK); + CHECK_VAL(break_info.count, 0); + + smbcli_close(cli1->tree, fnum); + +done: + smb_raw_exit(cli1->session); + smb_raw_exit(cli2->session); + smbcli_deltree(cli1->tree, BASEDIR); + return ret; +} + /* basic testing of oplocks */ @@ -1301,6 +1374,7 @@ struct torture_suite *torture_raw_oplock(TALLOC_CTX *mem_ctx) torture_suite_add_2smb_test(suite, "BATCH12", test_raw_oplock_batch12); torture_suite_add_2smb_test(suite, "BATCH13", test_raw_oplock_batch13); torture_suite_add_2smb_test(suite, "BATCH14", test_raw_oplock_batch14); + torture_suite_add_2smb_test(suite, "BATCH15", test_raw_oplock_batch15); return suite; } -- cgit From bcca7d43c8dc1c96f060a3daff8f0e43c43129c2 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Feb 2008 15:38:45 +0100 Subject: pidl: Remove superfluous semicolon in perl code. Michael (This used to be commit 85f707c6abc48739c0c3b423ac0b196d2b75e40c) --- source4/pidl/idl.yp | 2 +- source4/pidl/lib/Parse/Pidl/IDL.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source4/pidl/idl.yp b/source4/pidl/idl.yp index 028b628e18..c7ca0c7604 100644 --- a/source4/pidl/idl.yp +++ b/source4/pidl/idl.yp @@ -391,7 +391,7 @@ sub _Error { error($_[0]->YYData, $_[0]->YYData->{ERRMSG}); delete $_[0]->YYData->{ERRMSG}; return; - }; + } my $last_token = $_[0]->YYData->{LAST_TOKEN}; error($_[0]->YYData, "Syntax error near '$last_token'"); diff --git a/source4/pidl/lib/Parse/Pidl/IDL.pm b/source4/pidl/lib/Parse/Pidl/IDL.pm index aeee69e306..4adb4dcea8 100644 --- a/source4/pidl/lib/Parse/Pidl/IDL.pm +++ b/source4/pidl/lib/Parse/Pidl/IDL.pm @@ -2408,7 +2408,7 @@ sub _Error { error($_[0]->YYData, $_[0]->YYData->{ERRMSG}); delete $_[0]->YYData->{ERRMSG}; return; - }; + } my $last_token = $_[0]->YYData->{LAST_TOKEN}; error($_[0]->YYData, "Syntax error near '$last_token'"); -- cgit From 28464179174d2c3d1c1bc124ba9c2519e08a5fc9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 26 Feb 2008 13:24:54 +0100 Subject: libreplace: Add tests for connect and gethostbyname. Provide dummy replacements when a function isnt found. The functions are also searched for in certain libraries, and variables SOCKET_LIBS and NSL_LIBS are set accordingly. One purpose of this is to fix the getifaddrs tests on systems where e.g. the socket calls require special libs for linking. Michael (This used to be commit 900d17acb95f1becfc46656a12c107336c027ef7) --- source4/lib/replace/libreplace.m4 | 1 + source4/lib/replace/replace.h | 10 +++++++++ source4/lib/replace/socket.c | 35 +++++++++++++++++++++++++++++++ source4/lib/replace/socket.m4 | 40 ++++++++++++++++++++++++++++++++++++ source4/lib/replace/system/network.h | 10 +++++++++ 5 files changed, 96 insertions(+) create mode 100644 source4/lib/replace/socket.c create mode 100644 source4/lib/replace/socket.m4 diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4 index 2e0cd34f4a..e0cc57f4c8 100644 --- a/source4/lib/replace/libreplace.m4 +++ b/source4/lib/replace/libreplace.m4 @@ -344,6 +344,7 @@ m4_include(getpass.m4) m4_include(strptime.m4) m4_include(win32.m4) m4_include(timegm.m4) +m4_include(socket.m4) m4_include(inet_ntop.m4) m4_include(inet_pton.m4) m4_include(getaddrinfo.m4) diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h index 3f91544e97..0d16f4ffd0 100644 --- a/source4/lib/replace/replace.h +++ b/source4/lib/replace/replace.h @@ -340,6 +340,16 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset) /* prototype is in "system/network.h" */ #endif +#ifndef HAVE_CONNECT +#define connect rep_connect +/* prototype is in "system/network.h" */ +#endif + +#ifndef HAVE_GETHOSTBYNAME +#define gethostbyname rep_gethostbyname +/* prototype is in "system/network.h" */ +#endif + #ifndef HAVE_GETIFADDRS #define getifaddrs rep_getifaddrs /* prototype is in "system/network.h" */ diff --git a/source4/lib/replace/socket.c b/source4/lib/replace/socket.c new file mode 100644 index 0000000000..35e975fce7 --- /dev/null +++ b/source4/lib/replace/socket.c @@ -0,0 +1,35 @@ +/* + * Unix SMB/CIFS implementation. + * + * Dummy replacements for socket functions. + * + * Copyright (C) Michael Adam 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "replace.h" +#include "system/network.h" + +int rep_connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) +{ + errno = ENOSYS; + return -1; +} + +struct hostent *rep_gethostbyname(const char *name) +{ + errno = ENOSYS; + return NULL; +} diff --git a/source4/lib/replace/socket.m4 b/source4/lib/replace/socket.m4 new file mode 100644 index 0000000000..c0c8f93e81 --- /dev/null +++ b/source4/lib/replace/socket.m4 @@ -0,0 +1,40 @@ +dnl The following test is roughl taken from the cvs sources. +dnl +dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet. +dnl The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has +dnl libsocket.so which has a bad implementation of gethostbyname (it +dnl only looks in /etc/hosts), so we only look for -lsocket if we need +dnl it. +AC_CHECK_FUNCS(connect) +if test x"$ac_cv_func_connect" = x"no"; then + AC_CHECK_LIB_EXT(nsl_s, SOCKET_LIBS, connect) + AC_CHECK_LIB_EXT(nsl, SOCKET_LIBS, connect) + AC_CHECK_LIB_EXT(socket, SOCKET_LIBS, connect) + AC_CHECK_LIB_EXT(inet, SOCKET_LIBS, connect) + dnl We can't just call AC_CHECK_FUNCS(connect) here, + dnl because the value has been cached. + if test x"$ac_cv_lib_ext_nsl_s_connect" = x"yes" || + test x"$ac_cv_lib_ext_nsl_connect" = x"yes" || + test x"$ac_cv_lib_ext_socket_connect" = x"yes" || + test x"$ac_cv_lib_ext_inet_connect" = x"yes" + then + AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()]) + fi +fi + +AC_CHECK_FUNCS(gethostbyname) +if test x"$ac_cv_func_gethostbyname" = x"no"; then + AC_CHECK_LIB_EXT(nsl_s, NSL_LIBS, gethostbyname) + AC_CHECK_LIB_EXT(nsl, NSL_LIBS, gethostbyname) + AC_CHECK_LIB_EXT(socket, NSL_LIBS, gethostbyname) + dnl We can't just call AC_CHECK_FUNCS(gethostbyname) here, + dnl because the value has been cached. + if test x"$ac_cv_lib_ext_nsl_s_gethostbyname" = x"yes" || + test x"$ac_cv_lib_ext_nsl_gethostbyname" = x"yes" || + test x"$ac_cv_lib_ext_socket_gethostbyname" = x"yes" + then + AC_DEFINE(HAVE_GETHOSTBYNAME,1, + [Whether the system has gethostbyname()]) + fi +fi + diff --git a/source4/lib/replace/system/network.h b/source4/lib/replace/system/network.h index a84b22e5d0..410c6d7cca 100644 --- a/source4/lib/replace/system/network.h +++ b/source4/lib/replace/system/network.h @@ -103,6 +103,16 @@ int rep_inet_pton(int af, const char *src, void *dst); const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif +#ifndef HAVE_CONNECT +/* define is in "replace.h" */ +int rep_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); +#endif + +#ifndef HAVE_GETHOSTBYNAME +/* define is in "replace.h" */ +struct hostent *rep_gethostbyname(const char *name); +#endif + #ifdef HAVE_IFADDRS_H #include #endif -- cgit From 3a90bed29f6ddb2566f73f02a59eef1b0f1b7554 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 27 Feb 2008 01:29:12 +0100 Subject: libreplace: fix standalone build on some systems. getifaddr tests include system/network.h, which does not find getaddrinfo.h without "-I.". Michael (This used to be commit cd95c702ed90128f659e27709c61d4c6abc969ef) --- source4/lib/replace/configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source4/lib/replace/configure.ac b/source4/lib/replace/configure.ac index beeb77e152..72d788ddcc 100644 --- a/source4/lib/replace/configure.ac +++ b/source4/lib/replace/configure.ac @@ -3,6 +3,8 @@ AC_INIT(replace.c) AC_CONFIG_SRCDIR([replace.c]) AC_CONFIG_HEADER(config.h) +CFLAGS="$CFLAGS -I." + AC_LIBREPLACE_ALL_CHECKS if test "$ac_cv_prog_gcc" = yes; then -- cgit From b6f8132e928509e751f0dc35c93fb024105709ee Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 27 Feb 2008 01:41:30 +0100 Subject: libreplace: fix standalone build - add necessary libs. The libs needed for getifaddrs replacements have to be added to LIBS and used for the testsuite target. Michael (This used to be commit e7c1d6513b945b205abe84b18a251d06e737e659) --- source4/lib/replace/Makefile.in | 4 +++- source4/lib/replace/getifaddrs.m4 | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source4/lib/replace/Makefile.in b/source4/lib/replace/Makefile.in index 30f39ac6cb..af9522f3a6 100644 --- a/source4/lib/replace/Makefile.in +++ b/source4/lib/replace/Makefile.in @@ -10,6 +10,7 @@ VPATH = @libreplacedir@ srcdir = @srcdir@ builddir = @builddir@ INSTALL = @INSTALL@ +LIBS = @LIBS@ .PHONY: test all showflags install installcheck clean distclean realdistclean @@ -25,6 +26,7 @@ showflags: @echo ' CC = $(CC)' @echo ' CFLAGS = $(CFLAGS)' @echo ' LDFLAGS= $(LDFLAGS)' + @echo ' LIBS = $(LIBS)' install: all mkdir -p $(libdir) @@ -41,7 +43,7 @@ installcheck: install test TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o testsuite: libreplace.a $(TEST_OBJS) - $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) + $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) $(LIBS) .c.o: @echo Compiling $*.c diff --git a/source4/lib/replace/getifaddrs.m4 b/source4/lib/replace/getifaddrs.m4 index dd2a95cb81..767797e8d2 100644 --- a/source4/lib/replace/getifaddrs.m4 +++ b/source4/lib/replace/getifaddrs.m4 @@ -71,6 +71,7 @@ AC_TRY_RUN([ libreplace_cv_HAVE_IFACE_AIX=yes,libreplace_cv_HAVE_IFACE_AIX=no,libreplace_cv_HAVE_IFACE_AIX=cross)]) if test x"$libreplace_cv_HAVE_IFACE_AIX" = x"yes"; then iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available]) + old_LIBS="$old_LIBS $LIBS" fi fi @@ -87,6 +88,7 @@ AC_TRY_RUN([ libreplace_cv_HAVE_IFACE_IFCONF=yes,libreplace_cv_HAVE_IFACE_IFCONF=no,libreplace_cv_HAVE_IFACE_IFCONF=cross)]) if test x"$libreplace_cv_HAVE_IFACE_IFCONF" = x"yes"; then iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available]) + old_LIBS="$old_LIBS $LIBS" fi fi @@ -102,6 +104,7 @@ AC_TRY_RUN([ libreplace_cv_HAVE_IFACE_IFREQ=yes,libreplace_cv_HAVE_IFACE_IFREQ=no,libreplace_cv_HAVE_IFACE_IFREQ=cross)]) if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available]) + old_LIBS="$old_LIBS $LIBS" fi fi -- cgit From c9009b9876e14ce9bd9e6941a8344e1f5e47dd21 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 27 Feb 2008 10:33:32 +0100 Subject: libreplace: standalone build: use -I$srcdir instead of -I. Michael (This used to be commit ff311e613226e660998824b887cb9595ffbe0275) --- source4/lib/replace/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/lib/replace/configure.ac b/source4/lib/replace/configure.ac index 72d788ddcc..f5e054f476 100644 --- a/source4/lib/replace/configure.ac +++ b/source4/lib/replace/configure.ac @@ -3,7 +3,7 @@ AC_INIT(replace.c) AC_CONFIG_SRCDIR([replace.c]) AC_CONFIG_HEADER(config.h) -CFLAGS="$CFLAGS -I." +CFLAGS="$CFLAGS -I$srcdir" AC_LIBREPLACE_ALL_CHECKS -- cgit