diff options
author | Patrick Lauer <patrick@gentoo.org> | 2010-09-14 18:08:20 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2010-09-14 18:08:20 +0000 |
commit | 721e55436906c2dc9b2e7c704a2962051943ec2d (patch) | |
tree | 849cdd4a50da6ea58e33cc51eb0bea53e3aba5cf /net-fs/samba | |
parent | Marked ~ppc/~ppc64 for bug #336158. (diff) | |
download | gentoo-2-721e55436906c2dc9b2e7c704a2962051943ec2d.tar.gz gentoo-2-721e55436906c2dc9b2e7c704a2962051943ec2d.tar.bz2 gentoo-2-721e55436906c2dc9b2e7c704a2962051943ec2d.zip |
Remove old
(Portage version: 2.2_rc81/cvs/Linux x86_64)
Diffstat (limited to 'net-fs/samba')
20 files changed, 17 insertions, 3453 deletions
diff --git a/net-fs/samba/ChangeLog b/net-fs/samba/ChangeLog index 6c54d61c91e7..9fa9f1c71d74 100644 --- a/net-fs/samba/ChangeLog +++ b/net-fs/samba/ChangeLog @@ -1,6 +1,22 @@ # ChangeLog for net-fs/samba # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.439 2010/09/14 16:46:26 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.440 2010/09/14 18:08:20 patrick Exp $ + + 14 Sep 2010; Patrick Lauer <patrick@gentoo.org> + -files/3.0.26a-invalid-free-fix.patch, -samba-3.0.37.ebuild, + -samba-3.2.15.ebuild, -samba-3.2.15-r1.ebuild, -samba-3.5.3.ebuild, + -samba-3.5.4.ebuild, -files/3.0.28a-CVE-2008-1105.patch, + -files/3.0.28-inotify_include.patch, + -files/3.0.28-autoconf-2.62-fix.patch, -files/3.0.37-CVE-2010-2063.patch, + -files/3.2.15-CVE-2010-2063.patch, -files/3.0.26a-lazyldflags.patch, + -files/3.0.28-fix_broken_readdir_detection.patch, + -files/3.0.28-libcap_detection.patch, + -files/3.0.28a-wrong_python_ldflags.patch, + -files/3.0.37-allow-non-ASCII-netbios-names.patch, + -files/3.2.15-core-dump-overlapping-byte-lock-test.patch, + -files/3.2.15-smbclient-file-corruption-NT4.patch, + -samba-3.0.37-r1.ebuild: + Remove old *samba-3.5.5 (14 Sep 2010) diff --git a/net-fs/samba/files/3.0.26a-invalid-free-fix.patch b/net-fs/samba/files/3.0.26a-invalid-free-fix.patch deleted file mode 100644 index 5a4eeb5cf2f6..000000000000 --- a/net-fs/samba/files/3.0.26a-invalid-free-fix.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c -index 80b09fa..374a86a 100644 ---- a/source/libsmb/libsmbclient.c -+++ b/source/libsmb/libsmbclient.c -@@ -2644,7 +2644,11 @@ smbc_opendir_ctx(SMBCCTX *context, - return NULL; - } - -- ip_list = &server_addr; -+ ip_list = memdup(&server_addr, sizeof(server_addr)); -+ if (ip_list == NULL) { -+ errno = ENOMEM; -+ return NULL; -+ } - count = 1; - } - diff --git a/net-fs/samba/files/3.0.26a-lazyldflags.patch b/net-fs/samba/files/3.0.26a-lazyldflags.patch deleted file mode 100644 index 845624738b80..000000000000 --- a/net-fs/samba/files/3.0.26a-lazyldflags.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -Naur samba-3.0.25c.orig/source/Makefile.in samba-3.0.25c/source/Makefile.in ---- samba-3.0.25c.orig/source/Makefile.in 2007-09-01 09:14:54.000000000 +0200 -+++ samba-3.0.25c/source/Makefile.in 2007-09-01 09:17:08.000000000 +0200 -@@ -87,6 +87,8 @@ - # The permissions to give the executables - INSTALLPERMS = 0755 - -+LAZYLDFLAGS=-Wl,-z,now -+ - # set these to where to find various files - # These can be overridden by command line switches (see smbd(8)) - # or in smb.conf (see smb.conf(5)) -@@ -1008,19 +1010,19 @@ - - bin/smbmnt@EXEEXT@: proto_exists $(MNT_OBJ) bin/.dummy - @echo Linking $@ -- @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(DYNEXP) $(LDFLAGS) -+ @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LAZYLDFLAGS) - - bin/smbumount@EXEEXT@: proto_exists $(UMOUNT_OBJ) bin/.dummy - @echo Linking $@ -- @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) -+ @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LAZYLDFLAGS) - - bin/mount.cifs@EXEEXT@: $(CIFS_MOUNT_OBJ) bin/.dummy - @echo Linking $@ -- @$(CC) $(FLAGS) -o $@ $(CIFS_MOUNT_OBJ) $(DYNEXP) $(LDFLAGS) -+ @$(CC) $(FLAGS) -o $@ $(CIFS_MOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LAZYLDFLAGS) - - bin/umount.cifs@EXEEXT@: $(CIFS_UMOUNT_OBJ) bin/.dummy - @echo Linking $@ -- @$(CC) $(FLAGS) -o $@ $(CIFS_UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) -+ @$(CC) $(FLAGS) -o $@ $(CIFS_UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(LAZYLDFLAGS) - - bin/testparm@EXEEXT@: proto_exists $(TESTPARM_OBJ) @BUILD_POPT@ bin/.dummy - @echo Linking $@ diff --git a/net-fs/samba/files/3.0.28-autoconf-2.62-fix.patch b/net-fs/samba/files/3.0.28-autoconf-2.62-fix.patch deleted file mode 100644 index 2f5bc2b77f37..000000000000 --- a/net-fs/samba/files/3.0.28-autoconf-2.62-fix.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- lib/replace/autoconf-2.60.m4.orig 2008-04-19 00:26:33.000000000 -0400 -+++ lib/replace/autoconf-2.60.m4 2008-04-19 00:22:25.000000000 -0400 -@@ -179,6 +179,7 @@ - # ------------------------ - # Enable extensions on systems that normally disable them, - # typically due to standards-conformance issues. -+m4_ifndef([AC_USE_SYSTEM_EXTENSIONS],[ - AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], - [ - AC_BEFORE([$0], [AC_COMPILE_IFELSE]) -@@ -208,3 +209,4 @@ - AC_DEFINE([__EXTENSIONS__]) - AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) - ]) -+]) diff --git a/net-fs/samba/files/3.0.28-fix_broken_readdir_detection.patch b/net-fs/samba/files/3.0.28-fix_broken_readdir_detection.patch deleted file mode 100644 index 47f33d7bb920..000000000000 --- a/net-fs/samba/files/3.0.28-fix_broken_readdir_detection.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -Naur samba-3.0.28.orig/source/tests/os2_delete.c samba-3.0.28/source/tests/os2_delete.c ---- samba-3.0.28.orig/source/tests/os2_delete.c 2007-11-15 04:15:04.000000000 +0100 -+++ samba-3.0.28/source/tests/os2_delete.c 2008-02-20 20:47:53.878055947 +0100 -@@ -105,6 +105,9 @@ - - return 0; - } -+ -+#if 0 -+ - /* - test readdir/unlink pattern that OS/2 uses - tridge@samba.org July 2005 -@@ -212,3 +215,4 @@ - - return 0; - } -+#endif diff --git a/net-fs/samba/files/3.0.28-inotify_include.patch b/net-fs/samba/files/3.0.28-inotify_include.patch deleted file mode 100644 index 7ce8078b9ecd..000000000000 --- a/net-fs/samba/files/3.0.28-inotify_include.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -Naur samba-3.0.28.orig/source/configure.in samba-3.0.28/source/configure.in ---- samba-3.0.28.orig/source/configure.in 2007-11-21 04:58:01.000000000 +0100 -+++ samba-3.0.28/source/configure.in 2008-02-19 17:56:52.383852151 +0100 -@@ -2541,7 +2541,7 @@ - - AC_CACHE_CHECK([for inotify support],samba_cv_HAVE_INOTIFY,[ - AC_CHECK_HEADERS(linux/inotify.h asm/unistd.h) --AC_CHECK_FUNC(inotify_init) -+AC_CHECK_FUNCS([inotify_init]) - AC_HAVE_DECL(__NR_inotify_init, [#include <asm/unistd.h>]) - ], - samba_cv_HAVE_INOTIFY=yes, -diff -Naur samba-3.0.28.orig/source/include/config.h.in samba-3.0.28/source/include/config.h.in ---- samba-3.0.28.orig/source/include/config.h.in 2007-12-10 17:04:29.000000000 +0100 -+++ samba-3.0.28/source/include/config.h.in 2008-02-19 17:58:05.092981395 +0100 -@@ -685,6 +685,9 @@ - /* Whether kernel has inotify support */ - #undef HAVE_INOTIFY - -+/* Whether system libc defines the inotify_init function */ -+#undef HAVE_INOTIFY_INIT -+ - /* Whether int16 typedef is included by rpc/rpc.h */ - #undef HAVE_INT16_FROM_RPC_RPC_H - -diff -Naur samba-3.0.28.orig/source/smbd/notify_inotify.c samba-3.0.28/source/smbd/notify_inotify.c ---- samba-3.0.28.orig/source/smbd/notify_inotify.c 2007-11-15 04:15:04.000000000 +0100 -+++ samba-3.0.28/source/smbd/notify_inotify.c 2008-02-19 17:56:52.387155138 +0100 -@@ -30,10 +30,12 @@ - #include <asm/types.h> - #endif - -+#ifndef HAVE_INOTIFY_INIT -+ - #include <linux/inotify.h> - #include <asm/unistd.h> - --#ifndef HAVE_INOTIFY_INIT -+ - /* - glibc doesn't define these functions yet (as of March 2006) - */ -@@ -51,6 +53,10 @@ - { - return syscall(__NR_inotify_rm_watch, fd, wd); - } -+#else -+ -+#include <sys/inotify.h> -+ - #endif - - diff --git a/net-fs/samba/files/3.0.28-libcap_detection.patch b/net-fs/samba/files/3.0.28-libcap_detection.patch deleted file mode 100644 index 991375c636cd..000000000000 --- a/net-fs/samba/files/3.0.28-libcap_detection.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff -Naurb samba-3.0.28.orig/source/configure.in samba-3.0.28/source/configure.in ---- samba-3.0.28.orig/source/configure.in 2007-11-21 04:58:01.000000000 +0100 -+++ samba-3.0.28/source/configure.in 2008-02-20 14:31:05.167709211 +0100 -@@ -2663,6 +2663,7 @@ - if test x"$samba_cv_HAVE_POSIX_CAPABILITIES" = x"yes"; then - AC_DEFINE(HAVE_POSIX_CAPABILITIES, 1, - [Whether POSIX capabilities are available]) -+ AC_CHECK_DECLS([capget], , , [#include <sys/capability.h>]) - else - LIBS=$ac_save_LIBS - fi -diff -Naurb samba-3.0.28.orig/source/include/config.h.in samba-3.0.28/source/include/config.h.in ---- samba-3.0.28.orig/source/include/config.h.in 2007-12-10 17:04:29.000000000 +0100 -+++ samba-3.0.28/source/include/config.h.in 2008-02-20 14:32:41.246837408 +0100 -@@ -1211,6 +1211,9 @@ - /* Whether POSIX capabilities are available */ - #undef HAVE_POSIX_CAPABILITIES - -+/* Whether the capget (and capset) function is available (libcap-2.x has it) */ -+#undef HAVE_DECL_CAPGET -+ - /* Whether posix_fadvise is available */ - #undef HAVE_POSIX_FADVISE - -diff -Naurb samba-3.0.28.orig/source/smbd/oplock_linux.c samba-3.0.28/source/smbd/oplock_linux.c ---- samba-3.0.28.orig/source/smbd/oplock_linux.c 2007-11-15 04:15:04.000000000 +0100 -+++ samba-3.0.28/source/smbd/oplock_linux.c 2008-02-20 14:31:48.327720338 +0100 -@@ -34,10 +34,12 @@ - uint32 inheritable; - } data; - -+#if defined HAVE_DECL_CAPGET && !HAVE_DECL_CAPGET - extern int capget(struct cap_user_header * hdrp, - struct cap_user_data * datap); - extern int capset(struct cap_user_header * hdrp, - const struct cap_user_data * datap); -+#endif - - static SIG_ATOMIC_T signals_received; - #define FD_PENDING_SIZE 100 diff --git a/net-fs/samba/files/3.0.28a-CVE-2008-1105.patch b/net-fs/samba/files/3.0.28a-CVE-2008-1105.patch deleted file mode 100644 index 20712d844fa8..000000000000 --- a/net-fs/samba/files/3.0.28a-CVE-2008-1105.patch +++ /dev/null @@ -1,168 +0,0 @@ -diff --git a/source/client/client.c b/source/client/client.c -index 3f96f63..e87623a 100644 ---- a/source/client/client.c -+++ b/source/client/client.c -@@ -3626,7 +3626,7 @@ static void readline_callback(void) - session keepalives and then drop them here. - */ - if (FD_ISSET(cli->fd,&fds)) { -- if (!receive_smb(cli->fd,cli->inbuf,0)) { -+ if (!receive_smb(cli->fd,cli->inbuf,cli->bufsize,0)) { - DEBUG(0, ("Read from server failed, maybe it closed the " - "connection\n")); - return; -diff --git a/source/client/smbctool.c b/source/client/smbctool.c -index 2063418..a18505b 100644 ---- a/source/client/smbctool.c -+++ b/source/client/smbctool.c -@@ -3304,7 +3304,7 @@ static void readline_callback(void) - session keepalives and then drop them here. - */ - if (FD_ISSET(cli->fd,&fds)) { -- receive_smb(cli->fd,cli->inbuf,0); -+ receive_smb(cli->fd,cli->inbuf,cli->bufsize,0); - goto again; - } - -diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c -index 94c5e82..4715ca7 100644 ---- a/source/lib/util_sock.c -+++ b/source/lib/util_sock.c -@@ -654,14 +654,13 @@ ssize_t read_smb_length(int fd, char *inbuf, unsigned int timeout) - } - - /**************************************************************************** -- Read an smb from a fd. Note that the buffer *MUST* be of size -- BUFFER_SIZE+SAFETY_MARGIN. -+ Read an smb from a fd. - The timeout is in milliseconds. - This function will return on receipt of a session keepalive packet. - Doesn't check the MAC on signed packets. - ****************************************************************************/ - --BOOL receive_smb_raw(int fd, char *buffer, unsigned int timeout) -+BOOL receive_smb_raw(int fd, char *buffer, size_t buflen, unsigned int timeout) - { - ssize_t len,ret; - -@@ -682,25 +681,18 @@ BOOL receive_smb_raw(int fd, char *buffer, unsigned int timeout) - return False; - } - -- /* -- * A WRITEX with CAP_LARGE_WRITEX can be 64k worth of data plus 65 bytes -- * of header. Don't print the error if this fits.... JRA. -- */ -- -- if (len > (BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE)) { -+ if (len > buflen) { - DEBUG(0,("Invalid packet length! (%lu bytes).\n",(unsigned long)len)); -- if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) { - -- /* -- * Correct fix. smb_read_error may have already been -- * set. Only set it here if not already set. Global -- * variables still suck :-). JRA. -- */ -+ /* -+ * smb_read_error may have already been -+ * set. Only set it here if not already set. Global -+ * variables still suck :-). JRA. -+ */ - -- if (smb_read_error == 0) -- smb_read_error = READ_ERROR; -- return False; -- } -+ if (smb_read_error == 0) -+ smb_read_error = READ_ERROR; -+ return False; - } - - if(len > 0) { -@@ -730,9 +722,9 @@ BOOL receive_smb_raw(int fd, char *buffer, unsigned int timeout) - Checks the MAC on signed packets. - ****************************************************************************/ - --BOOL receive_smb(int fd, char *buffer, unsigned int timeout) -+BOOL receive_smb(int fd, char *buffer, size_t buflen, unsigned int timeout) - { -- if (!receive_smb_raw(fd, buffer, timeout)) { -+ if (!receive_smb_raw(fd, buffer, buflen, timeout)) { - return False; - } - -diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c -index c6cef08..7d7ab9e 100644 ---- a/source/libsmb/clientgen.c -+++ b/source/libsmb/clientgen.c -@@ -44,8 +44,7 @@ int cli_set_port(struct cli_state *cli, int port) - } - - /**************************************************************************** -- Read an smb from a fd ignoring all keepalive packets. Note that the buffer -- *MUST* be of size BUFFER_SIZE+SAFETY_MARGIN. -+ Read an smb from a fd ignoring all keepalive packets. - The timeout is in milliseconds - - This is exactly the same as receive_smb except that it never returns -@@ -54,12 +53,12 @@ int cli_set_port(struct cli_state *cli, int port) - should never go into a blocking read. - ****************************************************************************/ - --static BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout) -+static BOOL client_receive_smb(int fd,char *buffer, size_t bufsize, unsigned int timeout) - { - BOOL ret; - - for(;;) { -- ret = receive_smb_raw(fd, buffer, timeout); -+ ret = receive_smb_raw(fd, buffer, bufsize, timeout); - - if (!ret) { - DEBUG(10,("client_receive_smb failed\n")); -@@ -88,7 +87,7 @@ BOOL cli_receive_smb(struct cli_state *cli) - return False; - - again: -- ret = client_receive_smb(cli->fd,cli->inbuf,cli->timeout); -+ ret = client_receive_smb(cli->fd,cli->inbuf, cli->bufsize, cli->timeout); - - if (ret) { - /* it might be an oplock break request */ -diff --git a/source/smbd/process.c b/source/smbd/process.c -index 8dec719..3d31c29 100644 ---- a/source/smbd/process.c -+++ b/source/smbd/process.c -@@ -521,7 +521,8 @@ static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout) - goto again; - } - -- return receive_smb(smbd_server_fd(), buffer, 0); -+ return receive_smb(smbd_server_fd(), buffer, -+ BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE, 0); - } - - /* -diff --git a/source/utils/smbfilter.c b/source/utils/smbfilter.c -index 97d2223..2152e53 100644 ---- a/source/utils/smbfilter.c -+++ b/source/utils/smbfilter.c -@@ -140,7 +140,7 @@ static void filter_child(int c, struct in_addr dest_ip) - if (num <= 0) continue; - - if (c != -1 && FD_ISSET(c, &fds)) { -- if (!receive_smb(c, packet, 0)) { -+ if (!receive_smb(c, packet, BUFFER_SIZE, 0)) { - d_printf("client closed connection\n"); - exit(0); - } -@@ -151,7 +151,7 @@ static void filter_child(int c, struct in_addr dest_ip) - } - } - if (s != -1 && FD_ISSET(s, &fds)) { -- if (!receive_smb(s, packet, 0)) { -+ if (!receive_smb(s, packet, BUFFER_SIZE, 0)) { - d_printf("server closed connection\n"); - exit(0); - } diff --git a/net-fs/samba/files/3.0.28a-wrong_python_ldflags.patch b/net-fs/samba/files/3.0.28a-wrong_python_ldflags.patch deleted file mode 100644 index 6f5c8baa736e..000000000000 --- a/net-fs/samba/files/3.0.28a-wrong_python_ldflags.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur samba-3.0.28a.orig/source/Makefile.in samba-3.0.28a/source/Makefile.in ---- samba-3.0.28a.orig/source/Makefile.in 2008-05-17 12:20:23.000000000 +0200 -+++ samba-3.0.28a/source/Makefile.in 2008-05-17 12:23:38.000000000 +0200 -@@ -1666,7 +1666,8 @@ - fi - PYTHON_OBJS="$(PYTHON_OBJ)" \ - PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \ -- LIBS="$(LDFLAGS) $(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \ -+ LDFLAGS="$(LDSHFLAGS)" \ -+ LIBS="$(LDSHFLAGS) $(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \ - $(PYTHON) python/setup.py build - - python_install: $(PYTHON_OBJ) -@@ -1676,8 +1677,9 @@ - fi - PYTHON_OBJS="$(PYTHON_OBJ)" \ - PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \ -- LIBS="$(LDFLAGS) $(LIBS)" \ -- $(PYTHON) python/setup.py install --root=$(DESTDIR) -+ LDFLAGS="$(LDSHFLAGS)" \ -+ LIBS="$(LDSHFLAGS) $(LIBS)" \ -+ $(PYTHON) python/setup.py install --root="$(DESTDIR)" - - python_clean: - @-if test -n "$(PYTHON)"; then $(PYTHON) python/setup.py clean; fi diff --git a/net-fs/samba/files/3.0.37-CVE-2010-2063.patch b/net-fs/samba/files/3.0.37-CVE-2010-2063.patch deleted file mode 100644 index b4657de2c031..000000000000 --- a/net-fs/samba/files/3.0.37-CVE-2010-2063.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/source/smbd/process.c b/source/smbd/process.c -index e861e16..6499bc7 100644 ---- a/source/smbd/process.c -+++ b/source/smbd/process.c -@@ -1159,6 +1159,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) - { - static char *orig_inbuf; - static char *orig_outbuf; -+ static int orig_size; - int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0); - unsigned smb_off2 = SVAL(inbuf,smb_vwv1); - char *inbuf2, *outbuf2; -@@ -1178,6 +1179,13 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) - /* this is the first part of the chain */ - orig_inbuf = inbuf; - orig_outbuf = outbuf; -+ orig_size = size; -+ } -+ -+ /* Validate smb_off2 */ -+ if ((smb_off2 < smb_wct - 4) || orig_size < (smb_off2 + 4 - smb_wct)) { -+ exit_server_cleanly("Bad chained packet"); -+ return -1; - } - - /* -@@ -1192,6 +1200,11 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize) - SSVAL(outbuf,smb_vwv1,smb_offset(outbuf+outsize,outbuf)); - SCVAL(outbuf,smb_vwv0,smb_com2); - -+ if (outsize <= smb_wct) { -+ exit_server_cleanly("Bad chained packet"); -+ return -1; -+ } -+ - /* remember how much the caller added to the chain, only counting stuff - after the parameter words */ - chain_size += outsize - smb_wct; diff --git a/net-fs/samba/files/3.0.37-allow-non-ASCII-netbios-names.patch b/net-fs/samba/files/3.0.37-allow-non-ASCII-netbios-names.patch deleted file mode 100644 index f182d5603f5a..000000000000 --- a/net-fs/samba/files/3.0.37-allow-non-ASCII-netbios-names.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 51aaf9c6812430975dcd2cf9a632eb8d241ec41e Mon Sep 17 00:00:00 2001 -From: Andrew Bartlett <abartlet@samba.org> -Date: Thu, 3 Jun 2010 09:35:31 +1000 -Subject: [PATCH] s3:schannel client Push the domain and netbios name into the DOS charset - -If the netbios name is not just ASCII, then we have to get it into the -right character set. - -Andrew Bartlett ---- - source/rpc_parse/parse_rpc.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/source/rpc_parse/parse_rpc.c b/source/rpc_parse/parse_rpc.c -index 2d166c7..7b4b8e8 100644 ---- a/source/rpc_parse/parse_rpc.c -+++ b/source/rpc_parse/parse_rpc.c -@@ -786,8 +786,8 @@ void init_rpc_auth_schannel_neg(RPC_AUTH_SCHANNEL_NEG *neg, - { - neg->type1 = 0; - neg->type2 = 0x3; -- fstrcpy(neg->domain, domain); -- fstrcpy(neg->myname, myname); -+ push_ascii_fstring(neg->domain, domain); -+ push_ascii_fstring(neg->myname, myname); - } - - /******************************************************************* --- -1.7.0.1 - diff --git a/net-fs/samba/files/3.2.15-CVE-2010-2063.patch b/net-fs/samba/files/3.2.15-CVE-2010-2063.patch deleted file mode 100644 index 1a55e5fe36d0..000000000000 --- a/net-fs/samba/files/3.2.15-CVE-2010-2063.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/source/smbd/process.c b/source/smbd/process.c -index 446b868..403c7c6 100644 ---- a/source/smbd/process.c -+++ b/source/smbd/process.c -@@ -1645,6 +1645,7 @@ void construct_reply_common(const char *inbuf, char *outbuf) - void chain_reply(struct smb_request *req) - { - static char *orig_inbuf; -+ static int orig_size; - - /* - * Dirty little const_discard: We mess with req->inbuf, which is -@@ -1679,13 +1680,24 @@ void chain_reply(struct smb_request *req) - if (chain_size == 0) { - /* this is the first part of the chain */ - orig_inbuf = inbuf; -+ orig_size = size; - } - -+ /* Validate smb_off2 */ -+ if ((smb_off2 < smb_wct - 4) || orig_size < (smb_off2 + 4 - smb_wct)) { -+ exit_server_cleanly("Bad chained packet"); -+ return; -+ } - /* - * We need to save the output the caller added to the chain so that we - * can splice it into the final output buffer later. - */ - -+ if (outsize <= smb_wct) { -+ exit_server_cleanly("Bad chained packet"); -+ return; -+ } -+ - caller_outputlen = outsize - smb_wct; - - caller_output = (char *)memdup(outbuf + smb_wct, caller_outputlen); diff --git a/net-fs/samba/files/3.2.15-core-dump-overlapping-byte-lock-test.patch b/net-fs/samba/files/3.2.15-core-dump-overlapping-byte-lock-test.patch deleted file mode 100644 index 433a1d72241a..000000000000 --- a/net-fs/samba/files/3.2.15-core-dump-overlapping-byte-lock-test.patch +++ /dev/null @@ -1,538 +0,0 @@ -From f31bb627bff1de1f57cf38e7a1fb520639bf267d Mon Sep 17 00:00:00 2001 -From: Jeremy Allison <jra@samba.org> -Date: Mon, 5 Oct 2009 16:56:00 -0700 -Subject: [PATCH] Fix bug 6776 - Running overlapping Byte Lock test will core dump Samba daemon. Re-write core of POSIX locking logic. Jeremy. - ---- - source/locking/brlock.c | 351 ++++++++++++++++++++++++++++------------------ - 1 files changed, 214 insertions(+), 137 deletions(-) - -diff --git a/source/locking/brlock.c b/source/locking/brlock.c -index 032aaa5..909d3f8 100644 ---- a/source/locking/brlock.c -+++ b/source/locking/brlock.c -@@ -371,10 +371,9 @@ static NTSTATUS brl_lock_windows(struct byte_range_lock *br_lck, - Cope with POSIX range splits and merges. - ****************************************************************************/ - --static unsigned int brlock_posix_split_merge(struct lock_struct *lck_arr, /* Output array. */ -- const struct lock_struct *ex, /* existing lock. */ -- const struct lock_struct *plock, /* proposed lock. */ -- bool *lock_was_added) -+static unsigned int brlock_posix_split_merge(struct lock_struct *lck_arr, /* Output array. */ -+ struct lock_struct *ex, /* existing lock. */ -+ struct lock_struct *plock) /* proposed lock. */ - { - bool lock_types_differ = (ex->lock_type != plock->lock_type); - -@@ -391,21 +390,23 @@ static unsigned int brlock_posix_split_merge(struct lock_struct *lck_arr, /* Ou - /* Did we overlap ? */ - - /********************************************* -- +---------+ -- | ex | -- +---------+ -- +-------+ -- | plock | -- +-------+ -+ +---------+ -+ | ex | -+ +---------+ -+ +-------+ -+ | plock | -+ +-------+ - OR.... -- +---------+ -- | ex | -- +---------+ -+ +---------+ -+ | ex | -+ +---------+ - **********************************************/ - - if ( (ex->start > (plock->start + plock->size)) || -- (plock->start > (ex->start + ex->size))) { -+ (plock->start > (ex->start + ex->size))) { -+ - /* No overlap with this lock - copy existing. */ -+ - memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); - return 1; - } -@@ -417,26 +418,109 @@ OR.... - +---------------------------+ - | plock | -> replace with plock. - +---------------------------+ -+OR -+ +---------------+ -+ | ex | -+ +---------------+ -+ +---------------------------+ -+ | plock | -> replace with plock. -+ +---------------------------+ -+ - **********************************************/ - - if ( (ex->start >= plock->start) && -- (ex->start + ex->size <= plock->start + plock->size) ) { -- memcpy(&lck_arr[0], plock, sizeof(struct lock_struct)); -- *lock_was_added = True; -- return 1; -+ (ex->start + ex->size <= plock->start + plock->size) ) { -+ -+ /* Replace - discard existing lock. */ -+ -+ return 0; - } - - /********************************************* -+Adjacent after. -+ +-------+ -+ | ex | -+ +-------+ -+ +---------------+ -+ | plock | -+ +---------------+ -+ -+BECOMES.... -+ +---------------+-------+ -+ | plock | ex | - different lock types. -+ +---------------+-------+ -+OR.... (merge) -+ +-----------------------+ -+ | plock | - same lock type. -+ +-----------------------+ -+**********************************************/ -+ -+ if (plock->start + plock->size == ex->start) { -+ -+ /* If the lock types are the same, we merge, if different, we -+ add the remainder of the old lock. */ -+ -+ if (lock_types_differ) { -+ /* Add existing. */ -+ memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); -+ return 1; -+ } else { -+ /* Merge - adjust incoming lock as we may have more -+ * merging to come. */ -+ plock->size += ex->size; -+ return 0; -+ } -+ } -+ -+/********************************************* -+Adjacent before. -+ +-------+ -+ | ex | -+ +-------+ -+ +---------------+ -+ | plock | -+ +---------------+ -+BECOMES.... -+ +-------+---------------+ -+ | ex | plock | - different lock types -+ +-------+---------------+ -+ -+OR.... (merge) -+ +-----------------------+ -+ | plock | - same lock type. -+ +-----------------------+ -+ -+**********************************************/ -+ -+ if (ex->start + ex->size == plock->start) { -+ -+ /* If the lock types are the same, we merge, if different, we -+ add the existing lock. */ -+ -+ if (lock_types_differ) { -+ memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); -+ return 1; -+ } else { -+ /* Merge - adjust incoming lock as we may have more -+ * merging to come. */ -+ plock->start = ex->start; -+ plock->size += ex->size; -+ return 0; -+ } -+ } -+ -+/********************************************* -+Overlap after. - +-----------------------+ - | ex | - +-----------------------+ - +---------------+ - | plock | - +---------------+ --OR.... -- +-------+ -- | ex | -- +-------+ -+OR -+ +----------------+ -+ | ex | -+ +----------------+ - +---------------+ - | plock | - +---------------+ -@@ -447,60 +531,57 @@ BECOMES.... - +---------------+-------+ - OR.... (merge) - +-----------------------+ -- | ex | - same lock type. -+ | plock | - same lock type. - +-----------------------+ - **********************************************/ - - if ( (ex->start >= plock->start) && -- (ex->start <= plock->start + plock->size) && -- (ex->start + ex->size > plock->start + plock->size) ) { -- -- *lock_was_added = True; -+ (ex->start <= plock->start + plock->size) && -+ (ex->start + ex->size > plock->start + plock->size) ) { - - /* If the lock types are the same, we merge, if different, we -- add the new lock before the old. */ -+ add the remainder of the old lock. */ - - if (lock_types_differ) { -- /* Add new. */ -- memcpy(&lck_arr[0], plock, sizeof(struct lock_struct)); -- memcpy(&lck_arr[1], ex, sizeof(struct lock_struct)); -+ /* Add remaining existing. */ -+ memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); - /* Adjust existing start and size. */ -- lck_arr[1].start = plock->start + plock->size; -- lck_arr[1].size = (ex->start + ex->size) - (plock->start + plock->size); -- return 2; -- } else { -- /* Merge. */ -- memcpy(&lck_arr[0], plock, sizeof(struct lock_struct)); -- /* Set new start and size. */ -- lck_arr[0].start = plock->start; -- lck_arr[0].size = (ex->start + ex->size) - plock->start; -+ lck_arr[0].start = plock->start + plock->size; -+ lck_arr[0].size = (ex->start + ex->size) - (plock->start + plock->size); - return 1; -+ } else { -+ /* Merge - adjust incoming lock as we may have more -+ * merging to come. */ -+ plock->size += (ex->start + ex->size) - (plock->start + plock->size); -+ return 0; - } - } - - /********************************************* -- +-----------------------+ -- | ex | -- +-----------------------+ -- +---------------+ -- | plock | -- +---------------+ --OR.... -- +-------+ -- | ex | -- +-------+ -- +---------------+ -- | plock | -- +---------------+ -+Overlap before. -+ +-----------------------+ -+ | ex | -+ +-----------------------+ -+ +---------------+ -+ | plock | -+ +---------------+ -+OR -+ +-------------+ -+ | ex | -+ +-------------+ -+ +---------------+ -+ | plock | -+ +---------------+ -+ - BECOMES.... -- +-------+---------------+ -- | ex | plock | - different lock types -- +-------+---------------+ -+ +-------+---------------+ -+ | ex | plock | - different lock types -+ +-------+---------------+ - - OR.... (merge) -- +-----------------------+ -- | ex | - same lock type. -- +-----------------------+ -+ +-----------------------+ -+ | plock | - same lock type. -+ +-----------------------+ - - **********************************************/ - -@@ -508,27 +589,25 @@ OR.... (merge) - (ex->start + ex->size >= plock->start) && - (ex->start + ex->size <= plock->start + plock->size) ) { - -- *lock_was_added = True; -- - /* If the lock types are the same, we merge, if different, we -- add the new lock after the old. */ -+ add the truncated old lock. */ - - if (lock_types_differ) { - memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); -- memcpy(&lck_arr[1], plock, sizeof(struct lock_struct)); - /* Adjust existing size. */ - lck_arr[0].size = plock->start - ex->start; -- return 2; -- } else { -- /* Merge. */ -- memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); -- /* Adjust existing size. */ -- lck_arr[0].size = (plock->start + plock->size) - ex->start; - return 1; -+ } else { -+ /* Merge - adjust incoming lock as we may have more -+ * merging to come. MUST ADJUST plock SIZE FIRST ! */ -+ plock->size += (plock->start - ex->start); -+ plock->start = ex->start; -+ return 0; - } - } - - /********************************************* -+Complete overlap. - +---------------------------+ - | ex | - +---------------------------+ -@@ -541,32 +620,31 @@ BECOMES..... - +-------+---------+---------+ - OR - +---------------------------+ -- | ex | - same lock type. -+ | plock | - same lock type. - +---------------------------+ - **********************************************/ - - if ( (ex->start < plock->start) && (ex->start + ex->size > plock->start + plock->size) ) { -- *lock_was_added = True; - - if (lock_types_differ) { - - /* We have to split ex into two locks here. */ - - memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); -- memcpy(&lck_arr[1], plock, sizeof(struct lock_struct)); -- memcpy(&lck_arr[2], ex, sizeof(struct lock_struct)); -+ memcpy(&lck_arr[1], ex, sizeof(struct lock_struct)); - - /* Adjust first existing size. */ - lck_arr[0].size = plock->start - ex->start; - - /* Adjust second existing start and size. */ -- lck_arr[2].start = plock->start + plock->size; -- lck_arr[2].size = (ex->start + ex->size) - (plock->start + plock->size); -- return 3; -+ lck_arr[1].start = plock->start + plock->size; -+ lck_arr[1].size = (ex->start + ex->size) - (plock->start + plock->size); -+ return 2; - } else { -- /* Just eat plock. */ -- memcpy(&lck_arr[0], ex, sizeof(struct lock_struct)); -- return 1; -+ /* Just eat the existing locks, merge them into plock. */ -+ plock->start = ex->start; -+ plock->size = ex->size; -+ return 0; - } - } - -@@ -590,7 +668,6 @@ static NTSTATUS brl_lock_posix(struct messaging_context *msg_ctx, - unsigned int i, count; - struct lock_struct *locks = br_lck->lock_data; - struct lock_struct *tp; -- bool lock_was_added = False; - bool signal_pending_read = False; - - /* No zero-zero locks for POSIX. */ -@@ -612,8 +689,9 @@ static NTSTATUS brl_lock_posix(struct messaging_context *msg_ctx, - if (!tp) { - return NT_STATUS_NO_MEMORY; - } -- -+ - count = 0; -+ - for (i=0; i < br_lck->num_locks; i++) { - struct lock_struct *curr_lock = &locks[i]; - -@@ -648,14 +726,25 @@ static NTSTATUS brl_lock_posix(struct messaging_context *msg_ctx, - } - - /* Work out overlaps. */ -- count += brlock_posix_split_merge(&tp[count], curr_lock, plock, &lock_was_added); -+ count += brlock_posix_split_merge(&tp[count], curr_lock, plock); - } - } - -- if (!lock_was_added) { -- memcpy(&tp[count], plock, sizeof(struct lock_struct)); -- count++; -+ /* Try and add the lock in order, sorted by lock start. */ -+ for (i=0; i < count; i++) { -+ struct lock_struct *curr_lock = &tp[i]; -+ -+ if (curr_lock->start <= plock->start) { -+ continue; -+ } -+ } -+ -+ if (i < count) { -+ memmove(&tp[i+1], &tp[i], -+ (count - i)*sizeof(struct lock_struct)); - } -+ memcpy(&tp[i], plock, sizeof(struct lock_struct)); -+ count++; - - /* We can get the POSIX lock, now see if it needs to - be mapped into a lower level POSIX one, and if so can -@@ -687,11 +776,15 @@ static NTSTATUS brl_lock_posix(struct messaging_context *msg_ctx, - } - } - -- /* Realloc so we don't leak entries per lock call. */ -- tp = (struct lock_struct *)SMB_REALLOC(tp, count * sizeof(*locks)); -- if (!tp) { -- return NT_STATUS_NO_MEMORY; -+ /* If we didn't use all the allocated size, -+ * Realloc so we don't leak entries per lock call. */ -+ if (count < br_lck->num_locks + 2) { -+ tp = (struct lock_struct *)SMB_REALLOC(tp, count * sizeof(*locks)); -+ if (!tp) { -+ return NT_STATUS_NO_MEMORY; -+ } - } -+ - br_lck->num_locks = count; - SAFE_FREE(br_lck->lock_data); - br_lck->lock_data = tp; -@@ -890,7 +983,7 @@ static bool brl_unlock_windows(struct messaging_context *msg_ctx, - - static bool brl_unlock_posix(struct messaging_context *msg_ctx, - struct byte_range_lock *br_lck, -- const struct lock_struct *plock) -+ struct lock_struct *plock) - { - unsigned int i, j, count; - struct lock_struct *tp; -@@ -922,8 +1015,6 @@ static bool brl_unlock_posix(struct messaging_context *msg_ctx, - count = 0; - for (i = 0; i < br_lck->num_locks; i++) { - struct lock_struct *lock = &locks[i]; -- struct lock_struct tmp_lock[3]; -- bool lock_was_added = False; - unsigned int tmp_count; - - /* Only remove our own locks - ignore fnum. */ -@@ -934,64 +1025,50 @@ static bool brl_unlock_posix(struct messaging_context *msg_ctx, - continue; - } - -- /* Work out overlaps. */ -- tmp_count = brlock_posix_split_merge(&tmp_lock[0], &locks[i], plock, &lock_was_added); -- -- if (tmp_count == 1) { -- /* Ether the locks didn't overlap, or the unlock completely -- overlapped this lock. If it didn't overlap, then there's -- no change in the locks. */ -- if (tmp_lock[0].lock_type != UNLOCK_LOCK) { -- SMB_ASSERT(tmp_lock[0].lock_type == locks[i].lock_type); -- /* No change in this lock. */ -- memcpy(&tp[count], &tmp_lock[0], sizeof(struct lock_struct)); -- count++; -- } else { -- SMB_ASSERT(tmp_lock[0].lock_type == UNLOCK_LOCK); -- overlap_found = True; -- } -- continue; -- } else if (tmp_count == 2) { -- /* The unlock overlapped an existing lock. Copy the truncated -- lock into the lock array. */ -- if (tmp_lock[0].lock_type != UNLOCK_LOCK) { -- SMB_ASSERT(tmp_lock[0].lock_type == locks[i].lock_type); -- SMB_ASSERT(tmp_lock[1].lock_type == UNLOCK_LOCK); -- memcpy(&tp[count], &tmp_lock[0], sizeof(struct lock_struct)); -- if (tmp_lock[0].size != locks[i].size) { -- overlap_found = True; -- } -- } else { -- SMB_ASSERT(tmp_lock[0].lock_type == UNLOCK_LOCK); -- SMB_ASSERT(tmp_lock[1].lock_type == locks[i].lock_type); -- memcpy(&tp[count], &tmp_lock[1], sizeof(struct lock_struct)); -- if (tmp_lock[1].start != locks[i].start) { -- overlap_found = True; -- } -+ if (lock->lock_flav == WINDOWS_LOCK) { -+ /* Do any Windows flavour locks conflict ? */ -+ if (brl_conflict(lock, plock)) { -+ SAFE_FREE(tp); -+ return false; - } -+ /* Just copy the Windows lock into the new array. */ -+ memcpy(&tp[count], lock, sizeof(struct lock_struct)); - count++; - continue; -- } else { -- /* tmp_count == 3 - (we split a lock range in two). */ -- SMB_ASSERT(tmp_lock[0].lock_type == locks[i].lock_type); -- SMB_ASSERT(tmp_lock[1].lock_type == UNLOCK_LOCK); -- SMB_ASSERT(tmp_lock[2].lock_type == locks[i].lock_type); -+ } -+ -+ /* Work out overlaps. */ -+ tmp_count = brlock_posix_split_merge(&tp[count], lock, plock); -+ -+ if (tmp_count == 0) { -+ /* plock overlapped the existing lock completely, -+ or replaced it. Don't copy the existing lock. */ -+ overlap_found = true; -+ } else if (tmp_count == 1) { -+ /* Either no overlap, (simple copy of existing lock) or -+ * an overlap of an existing lock. */ -+ /* If the lock changed size, we had an overlap. */ -+ if (tp[count].size != lock->size) { -+ overlap_found = true; -+ } -+ count += tmp_count; -+ } else if (tmp_count == 2) { -+ /* We split a lock range in two. */ -+ overlap_found = true; -+ count += tmp_count; - -- memcpy(&tp[count], &tmp_lock[0], sizeof(struct lock_struct)); -- count++; -- memcpy(&tp[count], &tmp_lock[2], sizeof(struct lock_struct)); -- count++; -- overlap_found = True; - /* Optimisation... */ - /* We know we're finished here as we can't overlap any - more POSIX locks. Copy the rest of the lock array. */ -+ - if (i < br_lck->num_locks - 1) { -- memcpy(&tp[count], &locks[i+1], -+ memcpy(&tp[count], &locks[i+1], - sizeof(*locks)*((br_lck->num_locks-1) - i)); - count += ((br_lck->num_locks-1) - i); - } - break; - } -+ - } - - if (!overlap_found) { --- -1.6.0.2 - diff --git a/net-fs/samba/files/3.2.15-smbclient-file-corruption-NT4.patch b/net-fs/samba/files/3.2.15-smbclient-file-corruption-NT4.patch deleted file mode 100644 index 3ba2e513e37e..000000000000 --- a/net-fs/samba/files/3.2.15-smbclient-file-corruption-NT4.patch +++ /dev/null @@ -1,301 +0,0 @@ -From 6849e706469478144432fd5896f6de3f603bc825 Mon Sep 17 00:00:00 2001 -From: Volker Lendecke <vl@samba.org> -Date: Fri, 18 Sep 2009 19:45:36 +0200 -Subject: [PATCH] s3:smbclient: Fix bug 6606 (reported as 6744) in 3.2 - -This is a port of 1f34ffa0ca and 24309bdb2efc to 3.2. ---- - source/libsmb/clireadwrite.c | 188 +++++++++++++++++++++++++++++++++++++----- - 1 files changed, 168 insertions(+), 20 deletions(-) - -diff --git a/source/libsmb/clireadwrite.c b/source/libsmb/clireadwrite.c -index 057e647..40ce395 100644 ---- a/source/libsmb/clireadwrite.c -+++ b/source/libsmb/clireadwrite.c -@@ -156,6 +156,133 @@ NTSTATUS cli_read_andx_recv(struct async_req *req, ssize_t *received, - return NT_STATUS_OK; - } - -+struct cli_readall_state { -+ struct cli_state *cli; -+ uint16_t fnum; -+ off_t start_offset; -+ size_t size; -+ size_t received; -+ uint8_t *buf; -+}; -+ -+static void cli_readall_done(struct async_req *subreq); -+ -+static struct async_req *cli_readall_send(TALLOC_CTX *mem_ctx, -+ struct cli_state *cli, -+ uint16_t fnum, -+ off_t offset, size_t size) -+{ -+ struct async_req *req, *subreq; -+ struct cli_readall_state *state; -+ -+ req = async_req_new(mem_ctx, cli->event_ctx); -+ if (req == NULL) { -+ return NULL; -+ } -+ state = talloc(req, struct cli_readall_state); -+ if (state == NULL) { -+ TALLOC_FREE(req); -+ return NULL; -+ } -+ req->private_data = state; -+ -+ state->cli = cli; -+ state->fnum = fnum; -+ state->start_offset = offset; -+ state->size = size; -+ state->received = 0; -+ state->buf = NULL; -+ -+ subreq = cli_read_andx_send(state, cli, fnum, offset, size); -+ if (subreq == NULL) { -+ TALLOC_FREE(req); -+ return NULL; -+ } -+ subreq->async.fn = cli_readall_done; -+ subreq->async.priv = req; -+ return req; -+} -+ -+static void cli_readall_done(struct async_req *subreq) -+{ -+ struct async_req *req = talloc_get_type_abort( -+ subreq->async.priv, struct async_req); -+ struct cli_readall_state *state = talloc_get_type_abort( -+ req->private_data, struct cli_readall_state); -+ ssize_t received; -+ uint8_t *buf; -+ NTSTATUS status; -+ -+ status = cli_read_andx_recv(subreq, &received, &buf); -+ if (!NT_STATUS_IS_OK(status)) { -+ async_req_error(req, status); -+ return; -+ } -+ -+ if (received == 0) { -+ /* EOF */ -+ async_req_done(req); -+ return; -+ } -+ -+ if ((state->received == 0) && (received == state->size)) { -+ /* Ideal case: Got it all in one run */ -+ state->buf = buf; -+ state->received += received; -+ async_req_done(req); -+ return; -+ } -+ -+ /* -+ * We got a short read, issue a read for the -+ * rest. Unfortunately we have to allocate the buffer -+ * ourselves now, as our caller expects to receive a single -+ * buffer. cli_read_andx does it from the buffer received from -+ * the net, but with a short read we have to put it together -+ * from several reads. -+ */ -+ -+ if (state->buf == NULL) { -+ state->buf = talloc_array(state, uint8_t, state->size); -+ if (async_req_nomem(state->buf, req)) { -+ return; -+ } -+ } -+ memcpy(state->buf + state->received, buf, received); -+ state->received += received; -+ -+ TALLOC_FREE(subreq); -+ -+ if (state->received >= state->size) { -+ async_req_done(req); -+ return; -+ } -+ -+ subreq = cli_read_andx_send(state, state->cli, state->fnum, -+ state->start_offset + state->received, -+ state->size - state->received); -+ if (async_req_nomem(subreq, req)) { -+ return; -+ } -+ subreq->async.fn = cli_readall_done; -+ subreq->async.priv = req; -+} -+ -+static NTSTATUS cli_readall_recv(struct async_req *req, ssize_t *received, -+ uint8_t **rcvbuf) -+{ -+ struct cli_readall_state *state = talloc_get_type_abort( -+ req->private_data, struct cli_readall_state); -+ -+ SMB_ASSERT(req->state >= ASYNC_REQ_DONE); -+ if (req->state == ASYNC_REQ_ERROR) { -+ return req->status; -+ } -+ *received = state->received; -+ *rcvbuf = state->buf; -+ return NT_STATUS_OK; -+} -+ - /* - * Parallel read support. - * -@@ -164,6 +291,12 @@ NTSTATUS cli_read_andx_recv(struct async_req *req, ssize_t *received, - * the callback function "sink" in the right order. - */ - -+struct cli_pull_subreq { -+ struct async_req *req; -+ size_t received; -+ uint8_t *buf; -+}; -+ - struct cli_pull_state { - struct async_req *req; - -@@ -181,7 +314,7 @@ struct cli_pull_state { - * Outstanding requests - */ - int num_reqs; -- struct async_req **reqs; -+ struct cli_pull_subreq *reqs; - - /* - * For how many bytes did we send requests already? -@@ -270,7 +403,7 @@ struct async_req *cli_pull_send(TALLOC_CTX *mem_ctx, struct cli_state *cli, - state->num_reqs = MAX(window_size/state->chunk_size, 1); - state->num_reqs = MIN(state->num_reqs, cli->max_mux); - -- state->reqs = TALLOC_ZERO_ARRAY(state, struct async_req *, -+ state->reqs = TALLOC_ZERO_ARRAY(state, struct cli_pull_subreq, - state->num_reqs); - if (state->reqs == NULL) { - goto failed; -@@ -290,17 +423,17 @@ struct async_req *cli_pull_send(TALLOC_CTX *mem_ctx, struct cli_state *cli, - size_left = size - state->requested; - request_thistime = MIN(size_left, state->chunk_size); - -- state->reqs[i] = cli_read_andx_send( -+ state->reqs[i].req = cli_readall_send( - state->reqs, cli, fnum, - state->start_offset + state->requested, - request_thistime); - -- if (state->reqs[i] == NULL) { -+ if (state->reqs[i].req == NULL) { - goto failed; - } - -- state->reqs[i]->async.fn = cli_pull_read_done; -- state->reqs[i]->async.priv = result; -+ state->reqs[i].req->async.fn = cli_pull_read_done; -+ state->reqs[i].req->async.priv = result; - - state->requested += request_thistime; - } -@@ -322,16 +455,32 @@ static void cli_pull_read_done(struct async_req *read_req) - read_req->async.priv, struct async_req); - struct cli_pull_state *state = talloc_get_type_abort( - pull_req->private_data, struct cli_pull_state); -- struct cli_request *read_state = cli_request_get(read_req); -+ ssize_t received; -+ uint8_t *buf; - NTSTATUS status; -+ int i; - -- status = cli_read_andx_recv(read_req, &read_state->data.read.received, -- &read_state->data.read.rcvbuf); -+ status = cli_readall_recv(read_req, &received, &buf); - if (!NT_STATUS_IS_OK(status)) { - async_req_error(state->req, status); - return; - } - -+ for (i=0; i<state->num_reqs; i++) { -+ if (state->reqs[i].req == read_req) { -+ break; -+ } -+ } -+ -+ if (i == state->num_reqs) { -+ /* Got something we did not send. Just drop it. */ -+ TALLOC_FREE(read_req); -+ return; -+ } -+ -+ state->reqs[i].received = received; -+ state->reqs[i].buf = buf; -+ - /* - * This loop is the one to take care of out-of-order replies. All - * pending requests are in state->reqs, state->reqs[top_req] is the -@@ -341,34 +490,33 @@ static void cli_pull_read_done(struct async_req *read_req) - * requests. - */ - -- while (state->reqs[state->top_req] != NULL) { -- struct cli_request *top_read; -+ while (state->reqs[state->top_req].req != NULL) { -+ struct cli_pull_subreq *top_read; - - DEBUG(11, ("cli_pull_read_done: top_req = %d\n", - state->top_req)); - -- if (state->reqs[state->top_req]->state < ASYNC_REQ_DONE) { -+ if (state->reqs[state->top_req].req->state < ASYNC_REQ_DONE) { - DEBUG(11, ("cli_pull_read_done: top request not yet " - "done\n")); - return; - } - -- top_read = cli_request_get(state->reqs[state->top_req]); -+ top_read = &state->reqs[state->top_req]; - - DEBUG(10, ("cli_pull_read_done: Pushing %d bytes, %d already " -- "pushed\n", (int)top_read->data.read.received, -+ "pushed\n", (int)top_read->received, - (int)state->pushed)); - -- status = state->sink((char *)top_read->data.read.rcvbuf, -- top_read->data.read.received, -+ status = state->sink((char *)top_read->buf, top_read->received, - state->priv); - if (!NT_STATUS_IS_OK(status)) { - async_req_error(state->req, status); - return; - } -- state->pushed += top_read->data.read.received; -+ state->pushed += top_read->received; - -- TALLOC_FREE(state->reqs[state->top_req]); -+ TALLOC_FREE(state->reqs[state->top_req].req); - - if (state->requested < state->size) { - struct async_req *new_req; -@@ -385,7 +533,7 @@ static void cli_pull_read_done(struct async_req *read_req) - + state->requested), - state->top_req)); - -- new_req = cli_read_andx_send( -+ new_req = cli_readall_send( - state->reqs, state->cli, state->fnum, - state->start_offset + state->requested, - request_thistime); -@@ -397,7 +545,7 @@ static void cli_pull_read_done(struct async_req *read_req) - new_req->async.fn = cli_pull_read_done; - new_req->async.priv = pull_req; - -- state->reqs[state->top_req] = new_req; -+ state->reqs[state->top_req].req = new_req; - state->requested += request_thistime; - } - --- -1.6.0.2 - diff --git a/net-fs/samba/samba-3.0.37-r1.ebuild b/net-fs/samba/samba-3.0.37-r1.ebuild deleted file mode 100644 index d086a5ac7fbe..000000000000 --- a/net-fs/samba/samba-3.0.37-r1.ebuild +++ /dev/null @@ -1,351 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.37-r1.ebuild,v 1.6 2010/08/17 16:10:27 vostorga Exp $ - -inherit autotools eutils pam python multilib versionator confutils - -VSCAN_P="samba-vscan-0.3.6c-beta5" -MY_P=${PN}-${PV/_/} - -DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${MY_P}.tar.gz - mirror://samba/old-versions/${MY_P}.tar.gz - oav? ( http://www.openantivirus.org/download/${VSCAN_P}.tar.gz )" -LICENSE="GPL-3 oav? ( GPL-2 LGPL-2.1 )" -SLOT="0" -KEYWORDS="alpha amd64 arm ~hppa ia64 ~mips ~ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="acl ads async automount caps cups debug doc examples ipv6 kernel_linux ldap fam - pam python quotas readline selinux swat syslog winbind oav" - -RDEPEND="dev-libs/popt - virtual/libiconv - !sys-libs/tdb - acl? ( virtual/acl ) - cups? ( net-print/cups ) - ipv6? ( sys-apps/xinetd ) - ads? ( virtual/krb5 ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam ) - python? ( dev-lang/python ) - readline? ( sys-libs/readline ) - selinux? ( sec-policy/selinux-samba ) - swat? ( sys-apps/xinetd ) - syslog? ( virtual/logger ) - fam? ( virtual/fam ) - caps? ( sys-libs/libcap )" -DEPEND="${RDEPEND}" - -# Tests are broken now :-( -RESTRICT="test" - -S=${WORKDIR}/${MY_P} -CONFDIR=${FILESDIR}/config -PRIVATE_DST=/var/lib/samba/private - -pkg_setup() { - confutils_use_depend_all ads ldap -} - -src_unpack() { - unpack ${A} - cd "${S}/source" - - # lazyldflags.patch: adds "-Wl,-z,now" to smb{mnt,umount} - # invalid-free-fix.patch: Bug #196015 (upstream: #5021) - - epatch \ - "${FILESDIR}/3.0.26a-lazyldflags.patch" \ - "${FILESDIR}/3.0.26a-invalid-free-fix.patch" \ - "${FILESDIR}/3.0.28-fix_broken_readdir_detection.patch" \ - "${FILESDIR}/3.0.28a-wrong_python_ldflags.patch" \ - "${FILESDIR}/3.0.37-allow-non-ASCII-netbios-names.patch" \ - "${FILESDIR}/3.0.37-CVE-2010-2063.patch" - - eautoconf -I. -Ilib/replace - - # Ok, agreed, this is ugly. But it avoids a patch we - # need for every samba version and we don't need autotools - sed -i \ - -e 's|"lib32" ||' \ - -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ - configure || die "sed failed" - - rm "${S}/docs/manpages"/{mount,umount}.cifs.8 - -} - -src_compile() { - cd "${S}/source" - - local myconf - local mylangs - local mymod_shared - - myconf="--with-python=no" - use python && myconf="--with-python=$(PYTHON -a)" - - use winbind && mymod_shared="--with-shared-modules=idmap_rid" - if use ldap ; then - myconf="${myconf} $(use_with ads)" - use winbind && mymod_shared="${mymod_shared},idmap_ad" - fi - - [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" - use hppa && myconf="${myconf} --disable-pie" - - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # Otherwise we get the whole swat stuff installed - if ! use swat ; then - sed -i \ - -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ - Makefile.in || die "sed failed" - fi - - econf \ - --with-fhs \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/$(get_libdir)/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-piddir=/var/run/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-privatedir=${PRIVATE_DST} \ - --with-libsmbclient \ - --enable-socket-wrapper \ - --with-cifsmount=no \ - $(use_with acl acl-support) \ - $(use_with async aio-support) \ - $(use_with automount) \ - $(use_enable cups) \ - $(use_enable debug) \ - $(use_enable fam) \ - $(use_with ads krb5) \ - $(use_with ldap) \ - $(use_with pam) $(use_with pam pam_smbpass) \ - $(use_with quotas) $(use_with quotas sys-quotas) \ - $(use_with readline) \ - $(use_with kernel_linux smbmount) \ - $(use_with syslog) \ - $(use_with winbind) \ - ${myconf} ${mylangs} ${mymod_shared} - - emake -j1 proto || die "emake proto failed" - emake -j1 everything || die "emake everything failed" - - if use python ; then - emake -j1 python_ext || die "emake python_ext failed" - fi - - if use oav ; then - # maintainer-info: - # - there are no known releases of mks or kavdc, - # setting to builtin to disable auto-detection - cd "${WORKDIR}/${VSCAN_P}" - econf \ - --with-fhs \ - --with-samba-source="${S}/source" \ - --with-libmksd-builtin \ - --with-libkavdc-builtin \ - --without-symantec \ - --with-filetype \ - --with-fileregexp \ - $(use_enable debug) - emake -j1 || die "emake oav plugins failed" - fi -} - -src_test() { - cd "${S}/source" - emake test || die "tests failed" -} - -src_install() { - cd "${S}/source" - - emake DESTDIR="${D}" install-everything || die "emake install-everything failed" - - # Extra rpctorture progs - local extra_bins="rpctorture" - for i in ${extra_bins} ; do - [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" - done - - # remove .old stuff from /usr/bin: - rm -f "${D}"/usr/bin/*.old - - # Removing executable bits from header-files - fperms 644 /usr/include/lib{msrpc,smbclient}.h - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - dolib.so nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - if use kernel_linux ; then - # Warning: this can byte you if /usr is - # on a separate volume and you have to mount - # a smb volume before the local mount - dosym ../usr/bin/smbmount /sbin/mount.smbfs - fperms 4755 /usr/bin/smbmnt - fperms 4755 /usr/bin/smbumount - fi - - # bug #46389: samba doesn't create symlink anymore - # beaviour seems to be changed in 3.0.6, see bug #61046 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so.0 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so - - # make the smb backend symlink for cups printing support (bug #133133) - if use cups ; then - dodir $(cups-config --serverbin)/backend - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - if use python ; then - emake DESTDIR="${D}" python_install || die "emake installpython failed" - # We're doing that manually - find "${D}$(python_get_sitedir)" -iname "*.pyc" -delete - fi - - cd "${S}/source" - - # General config files - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example - - newpamd "${CONFDIR}/samba.pam" samba - use winbind && dopamd "${CONFDIR}/system-auth-winbind" - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - else - rm -f "${D}/usr/sbin/swat" - rm -f "${D}/usr/share/man/man8/swat.8" - fi - - newinitd "${FILESDIR}/samba-init" samba - newconfd "${FILESDIR}/samba-conf" samba - - if use ldap ; then - insinto /etc/openldap/schema - doins "${S}/examples/LDAP/samba.schema" - fi - - if use ipv6 ; then - insinto /etc/xinetd.d - newins "${FILESDIR}/samba-xinetd" smb - fi - - # dirs - diropts -m0700 ; keepdir "${PRIVATE_DST}" - diropts -m1777 ; keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{log,run,cache}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} - - # docs - dodoc "${FILESDIR}/README.gentoo" - dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt} - dodoc "${CONFDIR}/nsswitch.conf-wins" - use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" - - if use examples ; then - insinto /usr/share/doc/${PF} - doins -r "${S}/examples/" - find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 - find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 - if use python ; then - insinto /usr/share/doc/${PF}/python - doins -r "${S}/source/python/examples" - fi - fi - - if ! use doc ; then - if ! use swat ; then - rm -rf "${D}/usr/share/doc/${PF}/swat" - else - rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} - rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" - fi - else - cd "${S}/docs" - insinto /usr/share/doc/${PF} - doins *.pdf - doins -r registry - dohtml -r htmldocs/* - fi - - if use oav ; then - cd "${WORKDIR}/${VSCAN_P}" - emake DESTDIR="${D}" install || die "emake install oav plugins failed" - docinto samba-vscan - dodoc AUTHORS ChangeLog FAQ INSTALL NEWS README TODO - find . -iname "*.conf" -print0 | xargs -0 dodoc - fi -} - -pkg_preinst() { - local PRIVATE_SRC=/etc/samba/private - if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \ - && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then - ebegin "Copying "${ROOT}"/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" - mkdir -p "${D}/${PRIVATE_DST}" - cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/" - eend $? - fi - - if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then - touch "${D}/etc/samba/smb.conf" - fi -} - -pkg_postinst() { - if use python ; then - python_mod_optimize $(python_get_sitedir)/samba - fi - - if use swat ; then - einfo "swat must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/swat configuration" - fi - - if use ipv6 ; then - einfo "ipv6 support must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/smb configuration" - fi - - elog "It is possible to start/stop daemons separately:" - elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" - elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" - elog " the daemons configured in /etc/conf.d/samba" - - elog "The mount/umount.cifs helper applications are not included anymore." - elog "Please install net-fs/mount-cifs instead." - - if use oav ; then - elog "The configure snippets for various antivirus plugins are available here:" - elog " /usr/share/doc/${PF}/samba-vscan" - fi - - ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to" - ewarn "restart your clients to clear any cached information about the server." - ewarn "Otherwise they might not be able to connect to the volumes." -} - -pkg_postrm() { - if use python ; then - python_mod_cleanup $(python_get_sitedir)/samba - fi -} diff --git a/net-fs/samba/samba-3.0.37.ebuild b/net-fs/samba/samba-3.0.37.ebuild deleted file mode 100644 index e716bfdc6a35..000000000000 --- a/net-fs/samba/samba-3.0.37.ebuild +++ /dev/null @@ -1,348 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.37.ebuild,v 1.8 2010/04/25 15:42:48 arfrever Exp $ - -inherit autotools eutils pam python multilib versionator confutils - -VSCAN_P="samba-vscan-0.3.6c-beta5" -MY_P=${PN}-${PV/_/} - -DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${MY_P}.tar.gz - mirror://samba/old-versions/${MY_P}.tar.gz - oav? ( http://www.openantivirus.org/download/${VSCAN_P}.tar.gz )" -LICENSE="GPL-3 oav? ( GPL-2 LGPL-2.1 )" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" -IUSE="acl ads async automount caps cups debug doc examples ipv6 kernel_linux ldap fam - pam python quotas readline selinux swat syslog winbind oav" - -RDEPEND="dev-libs/popt - virtual/libiconv - acl? ( virtual/acl ) - cups? ( net-print/cups ) - ipv6? ( sys-apps/xinetd ) - ads? ( virtual/krb5 ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam ) - python? ( dev-lang/python ) - readline? ( sys-libs/readline ) - selinux? ( sec-policy/selinux-samba ) - swat? ( sys-apps/xinetd ) - syslog? ( virtual/logger ) - fam? ( virtual/fam ) - caps? ( sys-libs/libcap )" -DEPEND="${RDEPEND}" - -# Tests are broken now :-( -RESTRICT="test" - -S=${WORKDIR}/${MY_P} -CONFDIR=${FILESDIR}/config -PRIVATE_DST=/var/lib/samba/private - -pkg_setup() { - confutils_use_depend_all ads ldap -} - -src_unpack() { - unpack ${A} - cd "${S}/source" - - # lazyldflags.patch: adds "-Wl,-z,now" to smb{mnt,umount} - # invalid-free-fix.patch: Bug #196015 (upstream: #5021) - - epatch \ - "${FILESDIR}/3.0.26a-lazyldflags.patch" \ - "${FILESDIR}/3.0.26a-invalid-free-fix.patch" \ - "${FILESDIR}/3.0.28-fix_broken_readdir_detection.patch" \ - "${FILESDIR}/3.0.28a-wrong_python_ldflags.patch" - - eautoconf -I. -Ilib/replace - - # Ok, agreed, this is ugly. But it avoids a patch we - # need for every samba version and we don't need autotools - sed -i \ - -e 's|"lib32" ||' \ - -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ - configure || die "sed failed" - - rm "${S}/docs/manpages"/{mount,umount}.cifs.8 - -} - -src_compile() { - cd "${S}/source" - - local myconf - local mylangs - local mymod_shared - - myconf="--with-python=no" - use python && myconf="--with-python=$(PYTHON -a)" - - use winbind && mymod_shared="--with-shared-modules=idmap_rid" - if use ldap ; then - myconf="${myconf} $(use_with ads)" - use winbind && mymod_shared="${mymod_shared},idmap_ad" - fi - - [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" - use hppa && myconf="${myconf} --disable-pie" - - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # Otherwise we get the whole swat stuff installed - if ! use swat ; then - sed -i \ - -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ - Makefile.in || die "sed failed" - fi - - econf \ - --with-fhs \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/$(get_libdir)/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-piddir=/var/run/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-privatedir=${PRIVATE_DST} \ - --with-libsmbclient \ - --enable-socket-wrapper \ - --with-cifsmount=no \ - $(use_with acl acl-support) \ - $(use_with async aio-support) \ - $(use_with automount) \ - $(use_enable cups) \ - $(use_enable debug) \ - $(use_enable fam) \ - $(use_with ads krb5) \ - $(use_with ldap) \ - $(use_with pam) $(use_with pam pam_smbpass) \ - $(use_with quotas) $(use_with quotas sys-quotas) \ - $(use_with readline) \ - $(use_with kernel_linux smbmount) \ - $(use_with syslog) \ - $(use_with winbind) \ - ${myconf} ${mylangs} ${mymod_shared} - - emake -j1 proto || die "emake proto failed" - emake -j1 everything || die "emake everything failed" - - if use python ; then - emake -j1 python_ext || die "emake python_ext failed" - fi - - if use oav ; then - # maintainer-info: - # - there are no known releases of mks or kavdc, - # setting to builtin to disable auto-detection - cd "${WORKDIR}/${VSCAN_P}" - econf \ - --with-fhs \ - --with-samba-source="${S}/source" \ - --with-libmksd-builtin \ - --with-libkavdc-builtin \ - --without-symantec \ - --with-filetype \ - --with-fileregexp \ - $(use_enable debug) - emake -j1 || die "emake oav plugins failed" - fi -} - -src_test() { - cd "${S}/source" - emake test || die "tests failed" -} - -src_install() { - cd "${S}/source" - - emake DESTDIR="${D}" install-everything || die "emake install-everything failed" - - # Extra rpctorture progs - local extra_bins="rpctorture" - for i in ${extra_bins} ; do - [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" - done - - # remove .old stuff from /usr/bin: - rm -f "${D}"/usr/bin/*.old - - # Removing executable bits from header-files - fperms 644 /usr/include/lib{msrpc,smbclient}.h - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - dolib.so nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - if use kernel_linux ; then - # Warning: this can byte you if /usr is - # on a separate volume and you have to mount - # a smb volume before the local mount - dosym ../usr/bin/smbmount /sbin/mount.smbfs - fperms 4755 /usr/bin/smbmnt - fperms 4755 /usr/bin/smbumount - fi - - # bug #46389: samba doesn't create symlink anymore - # beaviour seems to be changed in 3.0.6, see bug #61046 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so.0 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so - - # make the smb backend symlink for cups printing support (bug #133133) - if use cups ; then - dodir $(cups-config --serverbin)/backend - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - if use python ; then - emake DESTDIR="${D}" python_install || die "emake installpython failed" - # We're doing that manually - find "${D}$(python_get_sitedir)" -iname "*.pyc" -delete - fi - - cd "${S}/source" - - # General config files - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example - - newpamd "${CONFDIR}/samba.pam" samba - use winbind && dopamd "${CONFDIR}/system-auth-winbind" - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - else - rm -f "${D}/usr/sbin/swat" - rm -f "${D}/usr/share/man/man8/swat.8" - fi - - newinitd "${FILESDIR}/samba-init" samba - newconfd "${FILESDIR}/samba-conf" samba - - if use ldap ; then - insinto /etc/openldap/schema - doins "${S}/examples/LDAP/samba.schema" - fi - - if use ipv6 ; then - insinto /etc/xinetd.d - newins "${FILESDIR}/samba-xinetd" smb - fi - - # dirs - diropts -m0700 ; keepdir "${PRIVATE_DST}" - diropts -m1777 ; keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{log,run,cache}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} - - # docs - dodoc "${FILESDIR}/README.gentoo" - dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt} - dodoc "${CONFDIR}/nsswitch.conf-wins" - use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" - - if use examples ; then - insinto /usr/share/doc/${PF} - doins -r "${S}/examples/" - find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 - find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 - if use python ; then - insinto /usr/share/doc/${PF}/python - doins -r "${S}/source/python/examples" - fi - fi - - if ! use doc ; then - if ! use swat ; then - rm -rf "${D}/usr/share/doc/${PF}/swat" - else - rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} - rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" - fi - else - cd "${S}/docs" - insinto /usr/share/doc/${PF} - doins *.pdf - doins -r registry - dohtml -r htmldocs/* - fi - - if use oav ; then - cd "${WORKDIR}/${VSCAN_P}" - emake DESTDIR="${D}" install || die "emake install oav plugins failed" - docinto samba-vscan - dodoc AUTHORS ChangeLog FAQ INSTALL NEWS README TODO - find . -iname "*.conf" -print0 | xargs -0 dodoc - fi -} - -pkg_preinst() { - local PRIVATE_SRC=/etc/samba/private - if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \ - && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then - ebegin "Copying "${ROOT}"/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" - mkdir -p "${D}/${PRIVATE_DST}" - cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/" - eend $? - fi - - if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then - touch "${D}/etc/samba/smb.conf" - fi -} - -pkg_postinst() { - if use python ; then - python_mod_optimize $(python_get_sitedir)/samba - fi - - if use swat ; then - einfo "swat must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/swat configuration" - fi - - if use ipv6 ; then - einfo "ipv6 support must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/smb configuration" - fi - - elog "It is possible to start/stop daemons separately:" - elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" - elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" - elog " the daemons configured in /etc/conf.d/samba" - - elog "The mount/umount.cifs helper applications are not included anymore." - elog "Please install net-fs/mount-cifs instead." - - if use oav ; then - elog "The configure snippets for various antivirus plugins are available here:" - elog " /usr/share/doc/${PF}/samba-vscan" - fi - - ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to" - ewarn "restart your clients to clear any cached information about the server." - ewarn "Otherwise they might not be able to connect to the volumes." -} - -pkg_postrm() { - if use python ; then - python_mod_cleanup $(python_get_sitedir)/samba - fi -} diff --git a/net-fs/samba/samba-3.2.15-r1.ebuild b/net-fs/samba/samba-3.2.15-r1.ebuild deleted file mode 100644 index eed70dd96d90..000000000000 --- a/net-fs/samba/samba-3.2.15-r1.ebuild +++ /dev/null @@ -1,294 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.2.15-r1.ebuild,v 1.3 2010/08/17 16:10:27 vostorga Exp $ - -inherit eutils pam multilib versionator confutils - -MY_P=${PN}-${PV/_/} - -DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${MY_P}.tar.gz" -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="alpha ~amd64 arm ~hppa ia64 ~mips ~ppc ~ppc64 s390 sh sparc ~x86 ~sparc-fbsd ~x86-fbsd" - -# disabled for now -#IUSE_LINGUAS="linguas_ja linguas_pl" - -IUSE="${IUSE_LINGUAS} acl ads async automount caps cifsupcall cups doc examples ipv6 kernel_linux ldap fam - pam quotas readline selinux swat syslog winbind" - -RDEPEND="dev-libs/popt - dev-libs/iniparser - virtual/libiconv - acl? ( virtual/acl ) - cifsupcall? ( sys-apps/keyutils ) - cups? ( net-print/cups ) - ipv6? ( sys-apps/xinetd ) - ads? ( virtual/krb5 sys-fs/e2fsprogs ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam ) - readline? ( sys-libs/readline ) - selinux? ( sec-policy/selinux-samba ) - swat? ( sys-apps/xinetd ) - syslog? ( virtual/logger ) - fam? ( virtual/fam ) - caps? ( sys-libs/libcap ) - !sys-libs/tdb" -DEPEND="${RDEPEND}" - -S="${WORKDIR}/${MY_P}" -CONFDIR="${FILESDIR}/config-3.2" -PRIVATE_DST=/var/lib/samba/private - -# Tests are currently broken due to hardcoded paths (due to --with-fhs) -# The problem is that --without-fhs lets samba use lockdir (which can be changed in smb.conf) -# which is wrong as well. -RESTRICT="test" - -pkg_setup() { - confutils_use_depend_all ads ldap - confutils_use_depend_all cifsupcall ads -} - -src_unpack() { - unpack ${A} - cd "${S}/source" - - epatch \ - "${FILESDIR}/3.2.15-CVE-2010-2063.patch" \ - "${FILESDIR}/3.2.15-smbclient-file-corruption-NT4.patch" \ - "${FILESDIR}/3.2.15-core-dump-overlapping-byte-lock-test.patch" - - # Ok, agreed, this is ugly. But it avoids a patch we - # need for every samba version and we don't need autotools - sed -i \ - -e 's|"lib32" ||' \ - -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ - configure || die "sed failed" - - rm "${S}/docs/manpages"/{mount,umount}.cifs.8 - - sed -i \ - -e 's|tdbsam|tdbsam:${PRIVATEDIR}/passdb.tdb|' \ - "${S}/source/script/tests/selftest.sh" || die "sed failed" -} - -src_compile() { - cd "${S}/source" - - local myconf - local mylangs - local mymod_shared - - # this doesn't seem to work ... - #mylangs="--with-manpages-langs=en" - #use linguas_ja && mylangs="${mylangs},ja" - #use linguas_pl && mylangs="${mylangs},pl" - - use winbind && mymod_shared="--with-shared-modules=idmap_rid" - if use ldap ; then - myconf="${myconf} $(use_with ads)" - use winbind && mymod_shared="${mymod_shared},idmap_ad" - fi - - [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" - use hppa && myconf="${myconf} --disable-pie" - - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # Otherwise we get the whole swat stuff installed - if ! use swat ; then - sed -i \ - -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ - Makefile.in || die "sed failed" - fi - - econf \ - --with-fhs \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/$(get_libdir)/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-piddir=/var/run/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-privatedir=${PRIVATE_DST} \ - --with-libsmbclient \ - --enable-socket-wrapper \ - --enable-nss-wrapper \ - --with-cifsmount=no \ - --disable-dnssd \ - $(use_with acl acl-support) \ - $(use_with async aio-support) \ - $(use_with automount) \ - $(use_with cifsupcall) \ - $(use_enable cups) \ - $(use_enable fam) \ - $(use_with ads krb5) \ - $(use_with ads dnsupdate) \ - $(use_with ldap) \ - $(use_with pam) $(use_with pam pam_smbpass) \ - $(use_with quotas) $(use_with quotas sys-quotas) \ - $(use_with readline) \ - $(use_with syslog) \ - $(use_with winbind) \ - ${myconf} ${mylangs} ${mymod_shared} || die "econf failed" - - emake -j1 proto || die "emake proto failed" - emake -j1 everything || die "emake everything failed" - -} - -src_test() { - cd "${S}/source" - emake test || die "tests failed" -} - -src_install() { - cd "${S}/source" - - emake -j1 DESTDIR="${D}" install-everything || die "emake install-everything failed" - - # Extra rpctorture progs - local extra_bins="rpctorture" - for i in ${extra_bins} ; do - [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" - done - - # remove .old stuff from /usr/bin: - rm -f "${D}"/usr/bin/*.old - - # Removing executable bits from header-files - fperms 644 /usr/include/libsmbclient.h - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - dolib.so nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - # bug #46389: samba doesn't create symlink anymore - # beaviour seems to be changed in 3.0.6, see bug #61046 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so - dosym samba/libsmbclient.so.0 /usr/$(get_libdir)/libsmbclient.so.0 - dosym samba/libtalloc.so /usr/$(get_libdir)/libtalloc.so - dosym samba/libtalloc.so.1 /usr/$(get_libdir)/libtalloc.so.1 - dosym samba/libtdb.so /usr/$(get_libdir)/libtdb.so - dosym samba/libtdb.so.1 /usr/$(get_libdir)/libtdb.so.1 - dosym samba/libwbclient.so.0 /usr/$(get_libdir)/libwbclient.so.0 - dosym samba/libsmbsharemodes.so.0 /usr/$(get_libdir)/libsmbsharemodes.so.0 - - # make the smb backend symlink for cups printing support (bug #133133) - if use cups ; then - dodir $(cups-config --serverbin)/backend - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - cd "${S}/source" - - # General config files - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example - - newpamd "${CONFDIR}/samba.pam" samba - use winbind && dopamd "${CONFDIR}/system-auth-winbind" - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - else - rm -f "${D}/usr/sbin/swat" - rm -f "${D}/usr/share/man/man8/swat.8" - fi - - newinitd "${FILESDIR}/samba-init" samba - newconfd "${FILESDIR}/samba-conf" samba - - if use ldap ; then - insinto /etc/openldap/schema - doins "${S}/examples/LDAP/samba.schema" - fi - - if use ipv6 ; then - insinto /etc/xinetd.d - newins "${FILESDIR}/samba-xinetd" smb - fi - - # dirs - diropts -m0700 ; keepdir "${PRIVATE_DST}" - diropts -m1777 ; keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{log,run,cache}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} - - # docs - dodoc "${FILESDIR}/README.gentoo" - dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt} - dodoc "${CONFDIR}/nsswitch.conf-wins" - use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" - - if use examples ; then - insinto /usr/share/doc/${PF} - doins -r "${S}/examples/" - find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 - find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 - fi - - if ! use doc ; then - if ! use swat ; then - rm -rf "${D}/usr/share/doc/${PF}/swat" - else - rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} - rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" - fi - fi - -} - -pkg_preinst() { - local PRIVATE_SRC=/etc/samba/private - if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \ - && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then - ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" - mkdir -p "${D}/${PRIVATE_DST}" - cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/" - eend $? - fi - - if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then - touch "${D}/etc/samba/smb.conf" - fi -} - -pkg_postinst() { - if use swat ; then - einfo "swat must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/swat configuration" - fi - - if use ipv6 ; then - einfo "ipv6 support must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/smb configuration" - fi - - elog "It is possible to start/stop daemons separately:" - elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" - elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" - elog " the daemons configured in /etc/conf.d/samba" - - elog "The mount/umount.cifs helper applications are not included anymore." - elog "Please install net-fs/mount-cifs instead." - - ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to" - ewarn "restart your clients to clear any cached information about the server." - ewarn "Otherwise they might not be able to connect to the volumes." -} diff --git a/net-fs/samba/samba-3.2.15.ebuild b/net-fs/samba/samba-3.2.15.ebuild deleted file mode 100644 index 91a3fdbbb495..000000000000 --- a/net-fs/samba/samba-3.2.15.ebuild +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.2.15.ebuild,v 1.1 2009/10/02 13:54:19 patrick Exp $ - -inherit eutils pam multilib versionator confutils - -MY_P=${PN}-${PV/_/} - -DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${MY_P}.tar.gz" -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" - -# disabled for now -#IUSE_LINGUAS="linguas_ja linguas_pl" - -IUSE="${IUSE_LINGUAS} acl ads async automount caps cifsupcall cups doc examples ipv6 kernel_linux ldap fam - pam quotas readline selinux swat syslog winbind" - -RDEPEND="dev-libs/popt - dev-libs/iniparser - virtual/libiconv - acl? ( virtual/acl ) - cifsupcall? ( sys-apps/keyutils ) - cups? ( net-print/cups ) - ipv6? ( sys-apps/xinetd ) - ads? ( virtual/krb5 sys-fs/e2fsprogs ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam ) - readline? ( sys-libs/readline ) - selinux? ( sec-policy/selinux-samba ) - swat? ( sys-apps/xinetd ) - syslog? ( virtual/logger ) - fam? ( virtual/fam ) - caps? ( sys-libs/libcap )" -DEPEND="${RDEPEND}" - -S="${WORKDIR}/${MY_P}" -CONFDIR="${FILESDIR}/config-3.2" -PRIVATE_DST=/var/lib/samba/private - -# Tests are currently broken due to hardcoded paths (due to --with-fhs) -# The problem is that --without-fhs lets samba use lockdir (which can be changed in smb.conf) -# which is wrong as well. -RESTRICT="test" - -pkg_setup() { - confutils_use_depend_all ads ldap - confutils_use_depend_all cifsupcall ads -} - -src_unpack() { - unpack ${A} - cd "${S}/source" - - # Ok, agreed, this is ugly. But it avoids a patch we - # need for every samba version and we don't need autotools - sed -i \ - -e 's|"lib32" ||' \ - -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \ - configure || die "sed failed" - - rm "${S}/docs/manpages"/{mount,umount}.cifs.8 - - sed -i \ - -e 's|tdbsam|tdbsam:${PRIVATEDIR}/passdb.tdb|' \ - "${S}/source/script/tests/selftest.sh" || die "sed failed" -} - -src_compile() { - cd "${S}/source" - - local myconf - local mylangs - local mymod_shared - - # this doesn't seem to work ... - #mylangs="--with-manpages-langs=en" - #use linguas_ja && mylangs="${mylangs},ja" - #use linguas_pl && mylangs="${mylangs},pl" - - use winbind && mymod_shared="--with-shared-modules=idmap_rid" - if use ldap ; then - myconf="${myconf} $(use_with ads)" - use winbind && mymod_shared="${mymod_shared},idmap_ad" - fi - - [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie" - use hppa && myconf="${myconf} --disable-pie" - - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # Otherwise we get the whole swat stuff installed - if ! use swat ; then - sed -i \ - -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \ - Makefile.in || die "sed failed" - fi - - econf \ - --with-fhs \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - --with-configdir=/etc/samba \ - --with-libdir=/usr/$(get_libdir)/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-piddir=/var/run/samba \ - --with-lockdir=/var/cache/samba \ - --with-logfilebase=/var/log/samba \ - --with-privatedir=${PRIVATE_DST} \ - --with-libsmbclient \ - --enable-socket-wrapper \ - --enable-nss-wrapper \ - --with-cifsmount=no \ - --disable-dnssd \ - $(use_with acl acl-support) \ - $(use_with async aio-support) \ - $(use_with automount) \ - $(use_with cifsupcall) \ - $(use_enable cups) \ - $(use_enable fam) \ - $(use_with ads krb5) \ - $(use_with ads dnsupdate) \ - $(use_with ldap) \ - $(use_with pam) $(use_with pam pam_smbpass) \ - $(use_with quotas) $(use_with quotas sys-quotas) \ - $(use_with readline) \ - $(use_with syslog) \ - $(use_with winbind) \ - ${myconf} ${mylangs} ${mymod_shared} || die "econf failed" - - emake -j1 proto || die "emake proto failed" - emake -j1 everything || die "emake everything failed" - -} - -src_test() { - cd "${S}/source" - emake test || die "tests failed" -} - -src_install() { - cd "${S}/source" - - emake -j1 DESTDIR="${D}" install-everything || die "emake install-everything failed" - - # Extra rpctorture progs - local extra_bins="rpctorture" - for i in ${extra_bins} ; do - [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}" - done - - # remove .old stuff from /usr/bin: - rm -f "${D}"/usr/bin/*.old - - # Removing executable bits from header-files - fperms 644 /usr/include/libsmbclient.h - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - dolib.so nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - # bug #46389: samba doesn't create symlink anymore - # beaviour seems to be changed in 3.0.6, see bug #61046 - dosym samba/libsmbclient.so /usr/$(get_libdir)/libsmbclient.so - dosym samba/libsmbclient.so.0 /usr/$(get_libdir)/libsmbclient.so.0 - dosym samba/libtalloc.so /usr/$(get_libdir)/libtalloc.so - dosym samba/libtalloc.so.1 /usr/$(get_libdir)/libtalloc.so.1 - dosym samba/libtdb.so /usr/$(get_libdir)/libtdb.so - dosym samba/libtdb.so.1 /usr/$(get_libdir)/libtdb.so.1 - dosym samba/libwbclient.so.0 /usr/$(get_libdir)/libwbclient.so.0 - dosym samba/libsmbsharemodes.so.0 /usr/$(get_libdir)/libsmbsharemodes.so.0 - - # make the smb backend symlink for cups printing support (bug #133133) - if use cups ; then - dodir $(cups-config --serverbin)/backend - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - cd "${S}/source" - - # General config files - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example - - newpamd "${CONFDIR}/samba.pam" samba - use winbind && dopamd "${CONFDIR}/system-auth-winbind" - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - else - rm -f "${D}/usr/sbin/swat" - rm -f "${D}/usr/share/man/man8/swat.8" - fi - - newinitd "${FILESDIR}/samba-init" samba - newconfd "${FILESDIR}/samba-conf" samba - - if use ldap ; then - insinto /etc/openldap/schema - doins "${S}/examples/LDAP/samba.schema" - fi - - if use ipv6 ; then - insinto /etc/xinetd.d - newins "${FILESDIR}/samba-xinetd" smb - fi - - # dirs - diropts -m0700 ; keepdir "${PRIVATE_DST}" - diropts -m1777 ; keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{log,run,cache}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth} - - # docs - dodoc "${FILESDIR}/README.gentoo" - dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt} - dodoc "${CONFDIR}/nsswitch.conf-wins" - use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind" - - if use examples ; then - insinto /usr/share/doc/${PF} - doins -r "${S}/examples/" - find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755 - find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644 - fi - - if ! use doc ; then - if ! use swat ; then - rm -rf "${D}/usr/share/doc/${PF}/swat" - else - rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel} - rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba" - fi - fi - -} - -pkg_preinst() { - local PRIVATE_SRC=/etc/samba/private - if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \ - && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then - ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/" - mkdir -p "${D}/${PRIVATE_DST}" - cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/" - eend $? - fi - - if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then - touch "${D}/etc/samba/smb.conf" - fi -} - -pkg_postinst() { - if use swat ; then - einfo "swat must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/swat configuration" - fi - - if use ipv6 ; then - einfo "ipv6 support must be enabled by xinetd:" - einfo " change the /etc/xinetd.d/smb configuration" - fi - - elog "It is possible to start/stop daemons separately:" - elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to" - elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start" - elog " the daemons configured in /etc/conf.d/samba" - - elog "The mount/umount.cifs helper applications are not included anymore." - elog "Please install net-fs/mount-cifs instead." - - ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to" - ewarn "restart your clients to clear any cached information about the server." - ewarn "Otherwise they might not be able to connect to the volumes." -} diff --git a/net-fs/samba/samba-3.5.3.ebuild b/net-fs/samba/samba-3.5.3.ebuild deleted file mode 100644 index 13fadb5c0113..000000000000 --- a/net-fs/samba/samba-3.5.3.ebuild +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.5.3.ebuild,v 1.6 2010/06/02 16:03:31 vostorga Exp $ - -EAPI="2" - -inherit pam confutils versionator multilib eutils - -MY_PV=${PV/_/} -MY_P="${PN}-${MY_PV}" - -DESCRIPTION="Library bits of the samba network filesystem" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${P}.tar.gz" -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="acl addns ads aio avahi caps +client cluster cups debug doc examples fam - ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes swat - syslog winbind " - -DEPEND="dev-libs/popt - !net-fs/samba-client - !net-fs/samba-libs - !net-fs/samba-server - sys-libs/talloc - sys-libs/tdb - virtual/libiconv - ads? ( virtual/krb5 sys-fs/e2fsprogs - client? ( sys-apps/keyutils ) ) - avahi? ( net-dns/avahi ) - caps? ( sys-libs/libcap ) - client? ( !net-fs/mount-cifs - dev-libs/iniparser ) - cluster? ( dev-db/ctdb ) - cups? ( net-print/cups ) - debug? ( dev-libs/dmalloc ) - fam? ( virtual/fam ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam - winbind? ( dev-libs/iniparser ) ) - readline? ( >=sys-libs/readline-5.2 ) - syslog? ( virtual/logger )" - -RDEPEND="${DEPEND}" - -# Disable tests since we don't want to build that much here -RESTRICT="test" - -SBINPROGS="" -BINPROGS="" -KRBPLUGIN="" -PLUGINEXT=".so" -SHAREDMODS="" - -if use server ; then - SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd" - BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit - bin/profiles bin/sharesec bin/eventlogadm" - - use swat && SBINPROGS="${SBINPROGS} bin/swat" - use winbind && SBINPROGS="${SBINPROGS} bin/winbindd" - use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator" -fi - -if use client ; then - BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree - bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas - bin/ntlm_auth" - - use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall" -fi - -use cups && BINPROGS="${BINPROGS} bin/smbspool" -use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename"; - -if use winbind ; then - BINPROGS="${BINPROGS} bin/wbinfo" - SHAREDMODS="${SHAREDMODS}idmap_rid" - use ads && SHAREDMODS="${SHAREDMODS},idmap_ad" - use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap" -fi - -S="${WORKDIR}/${MY_P}/source3" - -# TODO: -# - enable iPrint on Prefix/OSX and Darwin? -# - selftest-prefix? selftest? -# - AFS? - -CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)" - -pkg_setup() { - if use winbind && - [[ $(tc-getCC)$ == *gcc* ]] && - [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]] - then - eerror "It is a known issue that ${P} will not build with " - eerror "winbind use flag enabled when using gcc < 4.3 ." - eerror "Please use at least the latest stable gcc version." - die "Using sys-devel/gcc < 4.3 with winbind use flag." - fi - - confutils_use_depend_all ads ldap - confutils_use_depend_all swat server -} - -src_prepare() { - cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk" - - # ensure that winbind has correct ldflags (QA notice) - sed -i \ - -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \ - configure || die "sed failed" -} - -src_configure() { - local myconf - - # Filter out -fPIE - [[ ${CHOST} == *-*bsd* ]] || use hppa && myconf="${myconf} --disable-pie" - - # Upstream refuses to make this configurable - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # use_with doesn't accept 2 USE-flags - if use client && use ads ; then - myconf="${myconf} --with-cifsupcall" - else - myconf="${myconf} --without-cifsupcall" - fi - - # Notes: - # - automount is only needed in conjunction with NIS and we don't have that - # anymore => LDAP? - # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default - econf ${myconf} \ - --with-piddir=/var/run/samba \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - $(use_enable debug developer) \ - --enable-largefile \ - --enable-socket-wrapper \ - --enable-nss-wrapper \ - $(use_enable swat) \ - $(use_enable debug dmalloc) \ - $(use_enable cups) \ - --disable-iprint \ - $(use_enable fam) \ - --enable-shared-libs \ - --disable-dnssd \ - $(use_enable avahi) \ - --with-fhs \ - --with-privatedir=/var/lib/samba/private \ - --with-rootsbindir=/var/cache/samba \ - --with-lockdir=/var/cache/samba \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-configdir=/etc/samba \ - --with-logfilebase=/var/log/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --without-afs \ - --without-fake-kaserver \ - --without-vfs-afsacl \ - $(use_with ldap) \ - $(use_with ads) \ - $(use_with ads krb5 /usr) \ - $(use_with ads dnsupdate) \ - --without-automount \ - $(use_with client cifsmount) \ - $(use_with client cifsumount) \ - $(use_with pam) \ - $(use_with pam pam_smbpass) \ - $(use_with syslog) \ - $(use_with quota quotas) \ - $(use_with quota sys-quotas) \ - --without-utmp \ - --without-lib{talloc,tdb} \ - $(use_with netapi libnetapi) \ - $(use_with smbclient libsmbclient) \ - $(use_with smbsharemodes libsmbsharemodes) \ - $(use_with addns libaddns) \ - $(use_with cluster ctdb /usr) \ - $(use_with cluster cluster-support) \ - $(use_with acl acl-support) \ - $(use_with aio aio-support) \ - --with-sendfile-support \ - $(use_with winbind) \ - --with-shared-modules=${SHAREDMODS} \ - --without-included-popt \ - --without-included-iniparser -} - -src_compile() { - # compile libs - if use addns ; then - einfo "make addns library" - emake libaddns || die "emake libaddns failed" - fi - if use netapi ; then - einfo "make netapi library" - emake libnetapi || die "emake libnetapi failed" - fi - if use smbclient ; then - einfo "make smbclient library" - emake libsmbclient || die "emake libsmbclient failed" - fi - if use smbsharemodes ; then - einfo "make smbsharemodes library" - emake libsmbsharemodes || die "emake libsmbsharemodes failed" - fi - - # compile modules - emake modules || die "building modules failed" - - # compile pam moudles - if use pam ; then - einfo "make pam modules" - emake pam_modules || die "emake pam_modules failed"; - fi - - # compile winbind nss modules - if use winbind ; then - einfo "make nss modules" - emake nss_modules || die "emake nss_modules failed"; - fi - - # compile utilities - if [ -n "${BINPROGS}" ] ; then - einfo "make binprogs" - emake ${BINPROGS} || die "emake binprogs failed"; - fi - if [ -n "${SBINPROGS}" ] ; then - einfo "make sbinprogs" - emake ${SBINPROGS} || die "emake sbinprogs failed"; - fi - - if [ -n "${KRBPLUGIN}" ] ; then - einfo "make krbplugin" - emake ${KRBPLUGIN}${PLUGINEXT} || die "emake krbplugin failed"; - fi - - if use client ; then - einfo "make {,u}mount.cifs" - emake bin/{,u}mount.cifs || die "emake {,u}mount.cifs failed" - fi -} - -src_install() { - # install libs - if use addns ; then - einfo "install addns library" - emake installlibaddns DESTDIR="${D}" || die "emake install libaddns failed" - fi - if use netapi ; then - einfo "install netapi library" - emake installlibnetapi DESTDIR="${D}" || die "emake install libnetapi failed" - fi - if use smbclient ; then - einfo "install smbclient library" - emake installlibsmbclient DESTDIR="${D}" || die "emake install libsmbclient failed" - fi - if use smbsharemodes ; then - einfo "install smbsharemodes library" - emake installlibsmbsharemodes DESTDIR="${D}" || die "emake install libsmbsharemodes failed" - fi - - # install modules - emake installmodules DESTDIR="${D}" || die "installing modules failed" - - if use pam ; then - einfo "install pam modules" - emake installpammodules DESTDIR="${D}" || die "emake installpammodules failed" - - if use winbind ; then - newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind - doman ../docs/manpages/pam_winbind.8 - fi - - newpamd "${CONFDIR}/samba.pam" samba - dodoc pam_smbpass/README - fi - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - einfo "install libwbclient" - emake installlibwbclient DESTDIR="${D}" || die "emake installlibwbclient failed" - dolib.so ../nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so ../nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - # install binaries - insinto /usr - for prog in ${SBINPROGS} ; do - dosbin ${prog} || die "installing ${prog} failed" - doman ../docs/manpages/${prog/bin\/}* || die "doman failed" - done - - for prog in ${BINPROGS} ; do - dobin ${prog} || die "installing ${prog} failed" - doman ../docs/manpages/${prog/bin\/}* || die "doman failed" - done - - # install krbplugin - if [ -n "${KRBPLUGIN}" ] ; then - if has_version app-crypt/mit-krb5 ; then - insinto /usr/$(get_libdir)/krb5/plugins/libkrb5 - doins ${KRBPLUGIN}${PLUGINEXT} || die "installing - ${KRBPLUGIN}${PLUGINEXT} failed" - elif has_version app-crypt/heimdal ; then - insinto /usr/$(get_libdir)/plugin/krb5 - doins ${KRBPLUGIN}${PLUGINEXT} || die "installing - ${KRBPLUGIN}${PLUGINEXT} failed" - fi - insinto /usr - for prog in ${KRBPLUGIN} ; do - doman ../docs/manpages/${prog/bin\/}* || die "doman failed" - done - fi - - # install server components - if use server ; then - doman ../docs/manpages/vfs* ../docs/manpages/samba.7 - - diropts -m0700 - keepdir /var/lib/samba/private - - diropts -m1777 - keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{cache,log}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext} - - newconfd "${CONFDIR}/samba.confd" samba - newinitd "${CONFDIR}/samba.initd" samba - - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - - if use ldap ; then - insinto /etc/openldap/schema - doins ../examples/LDAP/samba.schema - fi - - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}" \ - || die "installing swat failed" - fi - - dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS - fi - - # install client files ({u,}mount.cifs into /) - if use client ; then - into / - dosbin bin/{u,}mount.cifs || die "u/mount.cifs not around" - doman ../docs/manpages/{u,}mount.cifs.8 || die "can't create man pages" - fi - - # install the spooler to cups - if use cups ; then - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - # install misc files - insinto /etc/samba - doins "${CONFDIR}"/smb.conf.default - doman ../docs/manpages/smb.conf.5 - - insinto /usr/"$(get_libdir)"/samba - doins ../codepages/{valid.dat,upcase.dat,lowcase.dat} - - # install docs - if use doc ; then - dohtml -r ../docs/htmldocs/* - dodoc ../docs/*.pdf - fi - - # install examples - if use examples ; then - insinto /usr/share/doc/${PF}/examples - - if use smbclient ; then - doins -r ../examples/libsmbclient - fi - - if use winbind ; then - doins -r ../examples/pam_winbind ../examples/nss - fi - - if use server ; then - cd ../examples - doins -r auth autofs dce-dfs LDAP logon misc pdb \ - perfcounter printer-accounting printing scripts tridge \ - validchars VFS - fi - fi - - # Remove empty installation directories - rmdir --ignore-fail-on-non-empty \ - "${D}/usr/$(get_libdir)/samba" \ - "${D}/usr"/{sbin,bin} \ - "${D}/usr/share"/{man,locale,} \ - "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \ - # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild" -} - -pkg_postinst() { - elog "The default value of 'wide links' has been changed to 'no' in samba 3.5" - elog "to avoid an insecure default configuration" - elog "('wide links = yes' and 'unix extensions = yes'). For more details," - elog "please see http://www.samba.org/samba/news/symlink_attack.html ." - elog "" - elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added." - elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new " - elog "implementation of the SMB protocol used by Windows Vista and higher" - elog "" - elog "For further information make sure to read the release notes at" - elog "http://samba.org/samba/history/${P}.html and " - elog "http://samba.org/samba/history/${PN}-3.5.0.html" -} diff --git a/net-fs/samba/samba-3.5.4.ebuild b/net-fs/samba/samba-3.5.4.ebuild deleted file mode 100644 index aa21fb90f519..000000000000 --- a/net-fs/samba/samba-3.5.4.ebuild +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.5.4.ebuild,v 1.1 2010/06/23 19:50:21 patrick Exp $ - -EAPI="2" - -inherit pam confutils versionator multilib eutils - -MY_PV=${PV/_/} -MY_P="${PN}-${MY_PV}" - -DESCRIPTION="Library bits of the samba network filesystem" -HOMEPAGE="http://www.samba.org/" -SRC_URI="mirror://samba/${P}.tar.gz" -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="acl addns ads aio avahi caps +client cluster cups debug doc examples fam - ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes swat - syslog winbind " - -DEPEND="dev-libs/popt - !net-fs/samba-client - !net-fs/samba-libs - !net-fs/samba-server - sys-libs/talloc - sys-libs/tdb - virtual/libiconv - ads? ( virtual/krb5 sys-fs/e2fsprogs - client? ( sys-apps/keyutils ) ) - avahi? ( net-dns/avahi ) - caps? ( sys-libs/libcap ) - client? ( !net-fs/mount-cifs - dev-libs/iniparser ) - cluster? ( dev-db/ctdb ) - cups? ( net-print/cups ) - debug? ( dev-libs/dmalloc ) - fam? ( virtual/fam ) - ldap? ( net-nds/openldap ) - pam? ( virtual/pam - winbind? ( dev-libs/iniparser ) ) - readline? ( >=sys-libs/readline-5.2 ) - syslog? ( virtual/logger )" - -RDEPEND="${DEPEND}" - -# Disable tests since we don't want to build that much here -RESTRICT="test" - -SBINPROGS="" -BINPROGS="" -KRBPLUGIN="" -PLUGINEXT=".so" -SHAREDMODS="" - -if use server ; then - SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd" - BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit - bin/profiles bin/sharesec bin/eventlogadm" - - use swat && SBINPROGS="${SBINPROGS} bin/swat" - use winbind && SBINPROGS="${SBINPROGS} bin/winbindd" - use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator" -fi - -if use client ; then - BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree - bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas - bin/ntlm_auth" - - use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall" -fi - -use cups && BINPROGS="${BINPROGS} bin/smbspool" -use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename"; - -if use winbind ; then - BINPROGS="${BINPROGS} bin/wbinfo" - SHAREDMODS="${SHAREDMODS}idmap_rid" - use ads && SHAREDMODS="${SHAREDMODS},idmap_ad" - use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap" -fi - -S="${WORKDIR}/${MY_P}/source3" - -# TODO: -# - enable iPrint on Prefix/OSX and Darwin? -# - selftest-prefix? selftest? -# - AFS? - -CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)" - -pkg_setup() { - if use winbind && - [[ $(tc-getCC)$ == *gcc* ]] && - [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]] - then - eerror "It is a known issue that ${P} will not build with " - eerror "winbind use flag enabled when using gcc < 4.3 ." - eerror "Please use at least the latest stable gcc version." - die "Using sys-devel/gcc < 4.3 with winbind use flag." - fi - - confutils_use_depend_all ads ldap - confutils_use_depend_all swat server -} - -src_prepare() { - cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk" - - # ensure that winbind has correct ldflags (QA notice) - sed -i \ - -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \ - configure || die "sed failed" -} - -src_configure() { - local myconf - - # Filter out -fPIE - [[ ${CHOST} == *-*bsd* ]] || use hppa && myconf="${myconf} --disable-pie" - - # Upstream refuses to make this configurable - use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no - - # use_with doesn't accept 2 USE-flags - if use client && use ads ; then - myconf="${myconf} --with-cifsupcall" - else - myconf="${myconf} --without-cifsupcall" - fi - - # Notes: - # - automount is only needed in conjunction with NIS and we don't have that - # anymore => LDAP? - # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default - econf ${myconf} \ - --with-piddir=/var/run/samba \ - --sysconfdir=/etc/samba \ - --localstatedir=/var \ - $(use_enable debug developer) \ - --enable-largefile \ - --enable-socket-wrapper \ - --enable-nss-wrapper \ - $(use_enable swat) \ - $(use_enable debug dmalloc) \ - $(use_enable cups) \ - --disable-iprint \ - $(use_enable fam) \ - --enable-shared-libs \ - --disable-dnssd \ - $(use_enable avahi) \ - --with-fhs \ - --with-privatedir=/var/lib/samba/private \ - --with-rootsbindir=/var/cache/samba \ - --with-lockdir=/var/cache/samba \ - --with-swatdir=/usr/share/doc/${PF}/swat \ - --with-configdir=/etc/samba \ - --with-logfilebase=/var/log/samba \ - --with-pammodulesdir=$(getpam_mod_dir) \ - --without-afs \ - --without-fake-kaserver \ - --without-vfs-afsacl \ - $(use_with ldap) \ - $(use_with ads) \ - $(use_with ads krb5 /usr) \ - $(use_with ads dnsupdate) \ - --without-automount \ - $(use_with client cifsmount) \ - $(use_with client cifsumount) \ - $(use_with pam) \ - $(use_with pam pam_smbpass) \ - $(use_with syslog) \ - $(use_with quota quotas) \ - $(use_with quota sys-quotas) \ - --without-utmp \ - --without-lib{talloc,tdb} \ - $(use_with netapi libnetapi) \ - $(use_with smbclient libsmbclient) \ - $(use_with smbsharemodes libsmbsharemodes) \ - $(use_with addns libaddns) \ - $(use_with cluster ctdb /usr) \ - $(use_with cluster cluster-support) \ - $(use_with acl acl-support) \ - $(use_with aio aio-support) \ - --with-sendfile-support \ - $(use_with winbind) \ - --with-shared-modules=${SHAREDMODS} \ - --without-included-popt \ - --without-included-iniparser -} - -src_compile() { - # compile libs - if use addns ; then - einfo "make addns library" - emake libaddns || die "emake libaddns failed" - fi - if use netapi ; then - einfo "make netapi library" - emake libnetapi || die "emake libnetapi failed" - fi - if use smbclient ; then - einfo "make smbclient library" - emake libsmbclient || die "emake libsmbclient failed" - fi - if use smbsharemodes ; then - einfo "make smbsharemodes library" - emake libsmbsharemodes || die "emake libsmbsharemodes failed" - fi - - # compile modules - emake modules || die "building modules failed" - - # compile pam moudles - if use pam ; then - einfo "make pam modules" - emake pam_modules || die "emake pam_modules failed"; - fi - - # compile winbind nss modules - if use winbind ; then - einfo "make nss modules" - emake nss_modules || die "emake nss_modules failed"; - fi - - # compile utilities - if [ -n "${BINPROGS}" ] ; then - einfo "make binprogs" - emake ${BINPROGS} || die "emake binprogs failed"; - fi - if [ -n "${SBINPROGS}" ] ; then - einfo "make sbinprogs" - emake ${SBINPROGS} || die "emake sbinprogs failed"; - fi - - if [ -n "${KRBPLUGIN}" ] ; then - einfo "make krbplugin" - emake ${KRBPLUGIN}${PLUGINEXT} || die "emake krbplugin failed"; - fi - - if use client ; then - einfo "make {,u}mount.cifs" - emake bin/{,u}mount.cifs || die "emake {,u}mount.cifs failed" - fi -} - -src_install() { - # install libs - if use addns ; then - einfo "install addns library" - emake installlibaddns DESTDIR="${D}" || die "emake install libaddns failed" - fi - if use netapi ; then - einfo "install netapi library" - emake installlibnetapi DESTDIR="${D}" || die "emake install libnetapi failed" - fi - if use smbclient ; then - einfo "install smbclient library" - emake installlibsmbclient DESTDIR="${D}" || die "emake install libsmbclient failed" - fi - if use smbsharemodes ; then - einfo "install smbsharemodes library" - emake installlibsmbsharemodes DESTDIR="${D}" || die "emake install libsmbsharemodes failed" - fi - - # install modules - emake installmodules DESTDIR="${D}" || die "installing modules failed" - - if use pam ; then - einfo "install pam modules" - emake installpammodules DESTDIR="${D}" || die "emake installpammodules failed" - - if use winbind ; then - newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind - doman ../docs/manpages/pam_winbind.8 - fi - - newpamd "${CONFDIR}/samba.pam" samba - dodoc pam_smbpass/README - fi - - # Nsswitch extensions. Make link for wins and winbind resolvers - if use winbind ; then - einfo "install libwbclient" - emake installlibwbclient DESTDIR="${D}" || die "emake installlibwbclient failed" - dolib.so ../nsswitch/libnss_wins.so - dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2 - dolib.so ../nsswitch/libnss_winbind.so - dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2 - fi - - # install binaries - insinto /usr - for prog in ${SBINPROGS} ; do - dosbin ${prog} || die "installing ${prog} failed" - doman ../docs/manpages/${prog/bin\/}* || die "doman failed" - done - - for prog in ${BINPROGS} ; do - dobin ${prog} || die "installing ${prog} failed" - doman ../docs/manpages/${prog/bin\/}* || die "doman failed" - done - - # install krbplugin - if [ -n "${KRBPLUGIN}" ] ; then - if has_version app-crypt/mit-krb5 ; then - insinto /usr/$(get_libdir)/krb5/plugins/libkrb5 - doins ${KRBPLUGIN}${PLUGINEXT} || die "installing - ${KRBPLUGIN}${PLUGINEXT} failed" - elif has_version app-crypt/heimdal ; then - insinto /usr/$(get_libdir)/plugin/krb5 - doins ${KRBPLUGIN}${PLUGINEXT} || die "installing - ${KRBPLUGIN}${PLUGINEXT} failed" - fi - insinto /usr - for prog in ${KRBPLUGIN} ; do - doman ../docs/manpages/${prog/bin\/}* || die "doman failed" - done - fi - - # install server components - if use server ; then - doman ../docs/manpages/vfs* ../docs/manpages/samba.7 - - diropts -m0700 - keepdir /var/lib/samba/private - - diropts -m1777 - keepdir /var/spool/samba - - diropts -m0755 - keepdir /var/{cache,log}/samba - keepdir /var/lib/samba/{netlogon,profiles} - keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR} - keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext} - - newconfd "${CONFDIR}/samba.confd" samba - newinitd "${CONFDIR}/samba.initd" samba - - insinto /etc/samba - doins "${CONFDIR}"/{smbusers,lmhosts} - - if use ldap ; then - insinto /etc/openldap/schema - doins ../examples/LDAP/samba.schema - fi - - if use swat ; then - insinto /etc/xinetd.d - newins "${CONFDIR}/swat.xinetd" swat - script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}" \ - || die "installing swat failed" - fi - - dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS - fi - - # install client files ({u,}mount.cifs into /) - if use client ; then - into / - dosbin bin/{u,}mount.cifs || die "u/mount.cifs not around" - doman ../docs/manpages/{u,}mount.cifs.8 || die "can't create man pages" - fi - - # install the spooler to cups - if use cups ; then - dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb - fi - - # install misc files - insinto /etc/samba - doins "${CONFDIR}"/smb.conf.default - doman ../docs/manpages/smb.conf.5 - - insinto /usr/"$(get_libdir)"/samba - doins ../codepages/{valid.dat,upcase.dat,lowcase.dat} - - # install docs - if use doc ; then - dohtml -r ../docs/htmldocs/* - dodoc ../docs/*.pdf - fi - - # install examples - if use examples ; then - insinto /usr/share/doc/${PF}/examples - - if use smbclient ; then - doins -r ../examples/libsmbclient - fi - - if use winbind ; then - doins -r ../examples/pam_winbind ../examples/nss - fi - - if use server ; then - cd ../examples - doins -r auth autofs dce-dfs LDAP logon misc pdb \ - perfcounter printer-accounting printing scripts tridge \ - validchars VFS - fi - fi - - # Remove empty installation directories - rmdir --ignore-fail-on-non-empty \ - "${D}/usr/$(get_libdir)/samba" \ - "${D}/usr"/{sbin,bin} \ - "${D}/usr/share"/{man,locale,} \ - "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \ - # || die "tried to remove non-empty dirs, this seems like a bug in the ebuild" -} - -pkg_postinst() { - elog "The default value of 'wide links' has been changed to 'no' in samba 3.5" - elog "to avoid an insecure default configuration" - elog "('wide links = yes' and 'unix extensions = yes'). For more details," - elog "please see http://www.samba.org/samba/news/symlink_attack.html ." - elog "" - elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added." - elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new " - elog "implementation of the SMB protocol used by Windows Vista and higher" - elog "" - elog "For further information make sure to read the release notes at" - elog "http://samba.org/samba/history/${P}.html and " - elog "http://samba.org/samba/history/${PN}-3.5.0.html" -} |