Applying patch for CVE-2010-2063 , bug #323785, fixing domain and netbios name in...
authorVictor Ostorga <vostorga@gentoo.org>
Wed, 23 Jun 2010 17:11:00 +0000 (17:11 +0000)
committerVictor Ostorga <vostorga@gentoo.org>
Wed, 23 Jun 2010 17:11:00 +0000 (17:11 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux i686

net-fs/samba/ChangeLog
net-fs/samba/Manifest
net-fs/samba/files/3.0.37-CVE-2010-2063.patch [new file with mode: 0644]
net-fs/samba/files/3.0.37-allow-non-ASCII-netbios-names.patch [new file with mode: 0644]
net-fs/samba/files/3.2.15-CVE-2010-2063.patch [new file with mode: 0644]
net-fs/samba/files/3.2.15-core-dump-overlapping-byte-lock-test.patch [new file with mode: 0644]
net-fs/samba/files/3.2.15-smbclient-file-corruption-NT4.patch [new file with mode: 0644]
net-fs/samba/samba-3.0.37-r1.ebuild [new file with mode: 0644]
net-fs/samba/samba-3.2.15-r1.ebuild [new file with mode: 0644]

index e8dd3536da60c3e49aa35a0ccf3f934bdf7e0936..7d28df06b5b44f12e32da29f3572c8ad90f5164e 100644 (file)
@@ -1,6 +1,24 @@
 # 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.423 2010/06/05 19:11:18 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.424 2010/06/23 17:10:59 vostorga Exp $
+
+*samba-3.2.15-r1 (23 Jun 2010)
+*samba-3.0.37-r1 (23 Jun 2010)
+
+  23 Jun 2010; Víctor Ostorga <vostorga@gentoo.org>
+  +files/3.0.37-CVE-2010-2063.patch,
+  +files/3.2.15-smbclient-file-corruption-NT4.patch,
+  +samba-3.0.37-r1.ebuild, +samba-3.2.15-r1.ebuild,
+  +files/3.2.15-CVE-2010-2063.patch,
+  +files/3.0.37-allow-non-ASCII-netbios-names.patch,
+  +files/3.2.15-core-dump-overlapping-byte-lock-test.patch:
+  Samba 3.0.37 and 3.2.15
+  Adding patches fixing CVE-2010-2063 , bug #323785
+  Samba 3.0.37
+  Fixing domain and netbios name in DOS charset
+  Samba 3.2.15
+  Fix file corruption using smbclient with NT4 server
+  Fix core dump when running overlapping Byte Lock test
 
   05 Jun 2010; Raúl Porcel <armin76@gentoo.org> samba-3.4.6.ebuild:
   alpha/arm/ia64/s390/sh/sparc stable wrt #300158
index e37dd2ac8fd4f68f1e03754350b7198ad3a2daff..521e7d25b0c9c7d9063bcca72110023e395d8fbd 100644 (file)
@@ -6,6 +6,11 @@ AUX 3.0.28-inotify_include.patch 1675 RMD160 056cde16ad2b1e2e84a184b8c07002bd25a
 AUX 3.0.28-libcap_detection.patch 1676 RMD160 72cb751432db3911aedb32cf21a822bf9fceb278 SHA1 0348cc988150169b42a420a52fbf418aaf90e9e6 SHA256 73540a245115288f43dfd6abe6983a015886c93a14d906f38d59732e390cd070
 AUX 3.0.28a-CVE-2008-1105.patch 5774 RMD160 09a38e2a0e72e25f575789a3ded62fe00217dbc9 SHA1 9f7491b6ae88941881243445e35087b9bc811b5b SHA256 fba679976538265312d2545944e78b20442774d3ff54509d015a11867c15c0ff
 AUX 3.0.28a-wrong_python_ldflags.patch 996 RMD160 9514ef1b21129a950388ccabf797243dc92b390c SHA1 432366d841bbd2ec97c7a529c0c48d352aace356 SHA256 6f75e2e797d4a7a9f8758c5b3066cc1af86d392457d6f9ae8804427d74be4696
+AUX 3.0.37-CVE-2010-2063.patch 1226 RMD160 5eb628651e5a9cf54f0497d84f33aae7b4517663 SHA1 ad76714889ae9cbde80e8bc97074e5424470e655 SHA256 59658d0d2ef6479d40a4c809576db48107c284b6470bc9c2babebfeec8aa9c07
+AUX 3.0.37-allow-non-ASCII-netbios-names.patch 980 RMD160 82cf9f2b7b9fd8c4a8077a5f11bd7d12e95bfe6c SHA1 32aec220903fb64c8d5632b5fa3398ebda86a679 SHA256 ad9a4c295ad410c99ea68986477545c6e2e7be1d7b78cc911458027078b35804
+AUX 3.2.15-CVE-2010-2063.patch 1090 RMD160 cd425bddb2160a44f46a07bf9e97303084c45e4a SHA1 b67171c610c4bdc2211e26aedf55ffda0e97d69f SHA256 f57bca908ea326b6f3a466fb43183606ef7d591f4f2f5c0768cff9d199baeee2
+AUX 3.2.15-core-dump-overlapping-byte-lock-test.patch 17575 RMD160 a6e8771344aa0dc224d9c53cc934cbad8ba8c208 SHA1 907eab83d914938674b35ce47fd4f2274b1fbc2d SHA256 3db9221f4f40bfa11edd902a58220faa2a0f6911c19bd4b702265082a8674322
+AUX 3.2.15-smbclient-file-corruption-NT4.patch 8579 RMD160 918d18a9452519c2be3097783245d0b7067ee993 SHA1 a810f025ff01eefb8905fdf9a010983799ef05f2 SHA256 baba6d65621033183f5ff7167065b7b87dd66db71eaea08a3dda1bd3e28aaed2
 AUX 3.4/lmhosts 126 RMD160 c4ff63cf01158809311c97c768463826aa02127b SHA1 2d5be4b38357287050b25bbd9fdc3263801676ce SHA256 b4b9cad6cd728dac260f4716270bb5df09da5c84c76526ccbe6cccdb8818c56c
 AUX 3.4/nsswitch.conf-winbind 406 RMD160 7bbc3f7a4bdc4907bc45ad71fc0e17cc376d4e1e SHA1 0cd4966690d98802de94f0353ecf760c1a6d5245 SHA256 342657852ec465f78b1450a522211c2102ee07a65f8cb167a19ca5e277220867
 AUX 3.4/nsswitch.conf-wins 392 RMD160 bf1c0b6c3128be82a3f901eb3ef70d6d621df334 SHA1 2742757c188bfeae94d272eed66405e1a5417540 SHA256 508f76bc1abe15b49ef97b6033ae873f6d630bbcb99cd69b9babe55dc2554ea0
@@ -59,11 +64,13 @@ DIST samba-3.4.8.tar.gz 34851288 RMD160 a43d6fcfa3745754afca9d2c35682f69217b3040
 DIST samba-3.5.3.tar.gz 30801998 RMD160 0ab444b3d1aa8c1fc0d85cf8d1c8cb6cbd9e98ad SHA1 e9de369de7c8a17db18d3b7a315d1d5305f3b509 SHA256 cc8d6c6fe857ee1f5d0e1b7a8280dabb8c9b01e2d81aa707dbf6ceebe1e884d0
 DIST samba-4.0.0alpha11.tar.gz 13917363 RMD160 3ec5597de6a2c80eaa426712101777fa92786b5c SHA1 8ed2befbbd45f6501d9e6036bcdfb332431a7b4f SHA256 ec9f4a9153b9e2c233420642ee98a8b944322e8b39a9b6912430fb24e88b81b9
 DIST samba-vscan-0.3.6c-beta5.tar.gz 248183 RMD160 6929c30b57e342c4bdf6a6b432fbe41c2ac70a74 SHA1 9e1b37225246ff2f19e37aceb97a680afc82cdda SHA256 bfe910d54add8dcb87d5babdf50127a6dcf079e0e90ad9947b4cbfdbe3e3037d
+EBUILD samba-3.0.37-r1.ebuild 10115 RMD160 6a5159abefe4afd41cce37a16aef6cec3c39b083 SHA1 69b88b8b67b6b3dfd17ab1db8d20dec4e4942943 SHA256 14930db09b6ef10c82009eb41bf5292c3ab6e164507edeae489a8149daf15a52
 EBUILD samba-3.0.37.ebuild 9995 RMD160 84b79edc774ea3053755016756724cf14e757691 SHA1 0676513a746314c5e537b4406e30da43f9531bc4 SHA256 f60a6f01b09319539da9fedb24652e4c0104d0ead9d3ae7fe741bf0910a5bb77
+EBUILD samba-3.2.15-r1.ebuild 8783 RMD160 01c7b18403aa0731ad50db4776b4caba775fa3c0 SHA1 f96818dead7aff6e40df4565cc1e730e1baa5375 SHA256 2a4a06fe6cbafbb2248a9edfd0213b010259ec8b4b3441b9da2483d1984e236a
 EBUILD samba-3.2.15.ebuild 8586 RMD160 1b4e8d899150a548892ac7c91f0e6165f8ca0171 SHA1 660bdcb314a0d5fc0988fecf806952f0356e4065 SHA256 d5d9c1a5f56bb7c936c4aeae7c72cb16e1c1a92313670cd5131e56c20873a8b1
 EBUILD samba-3.4.6.ebuild 11255 RMD160 c9fe3f8f31a996eb8cc792f87b8b42301b74f4ce SHA1 2028b5a98f596d80e79d1965eb9a657e28193d88 SHA256 f10dd299257aed935e170027b2151e5c4ed2bf643e76865e644b5ba423d7bc07
 EBUILD samba-3.4.8.ebuild 11265 RMD160 08a3276148c2bc5e9f813c08eb119d850875b43c SHA1 4df890ac7840c326dea6309d0a2db5f0a3b3d89d SHA256 ad7735f9834912492d39575980a5f6f0a2894624dc48656ed107d9b74367ca8a
 EBUILD samba-3.5.3.ebuild 12312 RMD160 5b62ea0257a9f3a251abb2fb7035cdaad9a03972 SHA1 2fecbf6e0cbb8198d1618b8fc2f19d040bbc69fc SHA256 c6968e79387358b29c6218bb74ba3d1945dbb6069cf97b41bda4e55199746c65
 EBUILD samba-4.0.0_alpha11.ebuild 4156 RMD160 d63bbf124c3fde8d264da490122a0826dda1aa13 SHA1 4bd67529b6094b91349e138614ba36075e5912c5 SHA256 619c7c38aa499083e3ee7ba06f681851b76a4456c1b8e8f3d4f3c998eaccda58
-MISC ChangeLog 70567 RMD160 e37ea34ae675df557d75a223b13e4958e2e506a2 SHA1 44ed49e0d11c0d11487e395403e49415f332535e SHA256 93c641ae81a7447e1c9a9fb3121b8cdb903e151253a16230e20ba10547468e43
+MISC ChangeLog 71243 RMD160 92f5fcaa059be3154481c2e11092260709e575d2 SHA1 4a7aa027029c67e04400960995c5f314c6b1b1b2 SHA256 b2b659f186fea4073937168b066a9499de86c19a0a863abc091203732a11d8c4
 MISC metadata.xml 1678 RMD160 fc5f6a9674053523edb993fda99f75789e995231 SHA1 7a3f710083ab340eb139281a0d9d94af1aaa4927 SHA256 afeddf0c54227bcdd40ccc67c65b5ee8809cbba447d0500773270d89de7d044e
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
new file mode 100644 (file)
index 0000000..b4657de
--- /dev/null
@@ -0,0 +1,38 @@
+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
new file mode 100644 (file)
index 0000000..f182d56
--- /dev/null
@@ -0,0 +1,31 @@
+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
new file mode 100644 (file)
index 0000000..1a55e5f
--- /dev/null
@@ -0,0 +1,37 @@
+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
new file mode 100644 (file)
index 0000000..433a1d7
--- /dev/null
@@ -0,0 +1,538 @@
+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
new file mode 100644 (file)
index 0000000..3ba2e51
--- /dev/null
@@ -0,0 +1,301 @@
+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
new file mode 100644 (file)
index 0000000..ae58d65
--- /dev/null
@@ -0,0 +1,350 @@
+# 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.1 2010/06/23 17:10:59 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
+       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.2.15-r1.ebuild b/net-fs/samba/samba-3.2.15-r1.ebuild
new file mode 100644 (file)
index 0000000..b98a9fd
--- /dev/null
@@ -0,0 +1,293 @@
+# 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.1 2010/06/23 17:11:00 vostorga Exp $
+
+inherit eutils pam multilib versionator confutils autotools
+
+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"
+
+       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."
+}