summaryrefslogtreecommitdiff
path: root/net-fs
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2008-02-27 19:19:49 +0000
committerTiziano Müller <dev-zero@gentoo.org>2008-02-27 19:19:49 +0000
commit29b872cc6eb792bdf51c3612b51f86325499245d (patch)
treef396f6e321de5863d877b4e2440254c33a5e84fa /net-fs
parentVersion bump (diff)
downloadhistorical-29b872cc6eb792bdf51c3612b51f86325499245d.tar.gz
historical-29b872cc6eb792bdf51c3612b51f86325499245d.tar.bz2
historical-29b872cc6eb792bdf51c3612b51f86325499245d.zip
Fixed double pam_*.so installation (bug #207021, thanks to flameeyes). Dropped old version and patches.
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'net-fs')
-rw-r--r--net-fs/samba/ChangeLog10
-rw-r--r--net-fs/samba/Manifest11
-rw-r--r--net-fs/samba/files/3.0.24-heap_overflow_v2.patch785
-rw-r--r--net-fs/samba/files/3.0.24-shell_escape.patch252
-rw-r--r--net-fs/samba/files/3.0.24-sid2name_elevation_v2.patch168
-rw-r--r--net-fs/samba/samba-3.0.24-r3.ebuild304
-rw-r--r--net-fs/samba/samba-3.0.28.ebuild8
7 files changed, 13 insertions, 1525 deletions
diff --git a/net-fs/samba/ChangeLog b/net-fs/samba/ChangeLog
index 078703e39aa5..7365aed7a3c9 100644
--- a/net-fs/samba/ChangeLog
+++ b/net-fs/samba/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-fs/samba
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.328 2008/02/20 20:02:53 dev-zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.329 2008/02/27 19:19:48 dev-zero Exp $
+
+ 27 Feb 2008; Tiziano Müller <dev-zero@gentoo.org>
+ -files/3.0.24-heap_overflow_v2.patch,
+ -files/3.0.24-sid2name_elevation_v2.patch,
+ -files/3.0.24-shell_escape.patch, -samba-3.0.24-r3.ebuild,
+ samba-3.0.28.ebuild:
+ Fixed double pam_*.so installation (bug #207021, thanks to flameeyes).
+ Dropped old version and patches.
20 Feb 2008; Tiziano Müller <dev-zero@gentoo.org>
+files/3.0.28-fix_broken_readdir_detection.patch,
diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest
index 09fa91874303..c1d42d0b1998 100644
--- a/net-fs/samba/Manifest
+++ b/net-fs/samba/Manifest
@@ -1,6 +1,3 @@
-AUX 3.0.24-heap_overflow_v2.patch 24130 RMD160 460c29604bbd621ee3d62a3ebba559291821885c SHA1 a3caceb5ab08dcdf5bf5784243422ef16b3978b1 SHA256 6eb325db790dd5ace66a309c0f03d405b8d7af1a8a9dcc5ff1f1a90fb698fa94
-AUX 3.0.24-shell_escape.patch 6234 RMD160 96af89d98f71bda674e92e57c0afb867dbda9252 SHA1 15e4061e4883c195101078bbcf772be9c23d75e2 SHA256 2d2bbf5abe60ec9623a5573cf6b3355ac277a6967f06631a7bd52907dc28b98b
-AUX 3.0.24-sid2name_elevation_v2.patch 4776 RMD160 8a0e4c444fbe12a4487d02953026c8182cd4da8b SHA1 42bec6aa048ac4fa0ea178449ae3354212c8a790 SHA256 069954e3dbcc2904a673a19269b65f1f8b6b64d08de7d8d44d3462f349aa3c85
AUX 3.0.26a-CVE-2007-5398.patch 1232 RMD160 b547196a44437d6336495ea727f9abfcfd41e79c SHA1 e2b7d91446e07bf1be5930187417f26841995743 SHA256 37a0181aa647de7feb888d675ea726e135bbe53bc3099076eaf0682fc1b11b05
AUX 3.0.26a-invalid-free-fix.patch 541 RMD160 13e1b0420ae9c06a2e6d4f9a8a0a3af8c32318b9 SHA1 0457c901f55b86b9b3751dc67b86a26cb19ec4e7 SHA256 4a727b9a02cbc7e2efc00190d5068c82e12a0b9fdad2a50869a2f10bc39a06f2
AUX 3.0.26a-lazyldflags.patch 1466 RMD160 12a3d97c8b84af5dea7c70173e4613bc663d4e8d SHA1 35742557c810ae4bfbbfecc3a6c3549c392fd313 SHA256 07eb35a567540bc88657f75881c8daf10de3697b64ec9bd7167f1df80cfb0d55
@@ -20,13 +17,9 @@ AUX config/system-auth-winbind 873 RMD160 7392d93abc16dd5e1caaebe8bbe3aa786b1122
AUX samba-conf 1291 RMD160 326fb4beee8105d839d23e37f4989d7e332c996b SHA1 af7cd695f212d7ec022df05ba2f821a8f9878ab2 SHA256 dfaf474c3cbfa3d3b26d1531c6f5913739d5815c4b8083063934ee4fd6b38861
AUX samba-init 1133 RMD160 77a084e8f78665af0233f19dc9c4a49693360da1 SHA1 09d7f1d676856289b61e890396a9976e2ccc794a SHA256 3b41d16daf02f9a1ab12e62c4c915f58e7801c07be48e2a94086eb288bb86aad
AUX samba-xinetd 286 RMD160 c90bd8518082eb4c182d5f7bd223a76f8e3c7fab SHA1 b250c5ca539187d8b481bcfb6ea3a915d7e8b26b SHA256 964d06dc33beff38978a8f03cd12b05c33d8258ed73aa9ffbf137fe226de25b8
-DIST samba-3-gentoo-0.3.16.tar.bz2 14291 RMD160 c8388239352e981c03f7e99ff02dbaa13ad77e2a SHA1 66c5296801c530e22c86aee424410c71cfe93c80 SHA256 fe0ae6f8c2833cfdbab82a5ae2087045da4f27f6f07daba6fdc829a93b4e6508
-DIST samba-3.0.24.tar.gz 17708128 RMD160 f208dca645d07a195169e005a50fb4c4879254eb SHA1 216020b58abca191b8146f76f98a8bda3508fcd3 SHA256 c4e8de3426fbbcee7f338f5cf09052cbdf9a36ae638aeeeca10498ef8d5343e2
DIST samba-3.0.27.tar.gz 18135175 RMD160 e81cbcfc7d5b1768f78d1e7a6908695207543dac SHA1 d1157992adbab1f5d5aff54f370d1797fcf8927e SHA256 a8fe4c4b8dde879c61d6989015dafde240c461051a0769f739d8227597825859
DIST samba-3.0.28.tar.gz 18159912 RMD160 816b57bff30a968c56be0c6864e6ea9f18981737 SHA1 4fcad8134f89a123a254138de0ace4a13993b007 SHA256 dcaf9213b9f7c749b346214ae21808cd336947c71693b4eca1af6f037725d98e
-DIST samba-vscan-0.3.6b.tar.bz2 164471 RMD160 5cd81345b06f44b2febf3f24e62325322b1c6a3b SHA1 b11e8303380ee8d271a916a17a16cbab9d0d36f8 SHA256 14f78b624b047b90ddf4965998e7115d3b3ac97b3229154a302637d8e49adcd4
-EBUILD samba-3.0.24-r3.ebuild 8558 RMD160 8639eaba80f753d5da2bbfa7c2b451c954b563f3 SHA1 c4724b60f864312b33497f14dc44c05dcea8ca5a SHA256 b7179360d8560f2d28d1404bf64cb45d01af910668f4b017f2c0e127202ead4f
EBUILD samba-3.0.27.ebuild 8773 RMD160 a3a889c643267c254309f36d2bd08447186bb6b5 SHA1 aa91fab445d3e3f94c4cbbd35cddf0df84f0c956 SHA256 e3d330432891f3f3b6ef441587f283e3c72b6364207e7eaea0d1346b1e72fb2b
-EBUILD samba-3.0.28.ebuild 9291 RMD160 190e9fe6a308218dab725e05f458705688f78ca5 SHA1 9a3dc9258a53bf606762a40cbcc1c7613cb3a40b SHA256 01938570ae214f9b2c7b4638b7529556a3d8c40327a943c097a27220d906785d
-MISC ChangeLog 55648 RMD160 871a58b190c6bd7deea8ac4cc6e027d3fcd9634e SHA1 9c60fffdb9e4e96d7628661fb481dcee8177a7a9 SHA256 a5f230841b0520f352c3a4a3ee4d846de1628e88b270895a10e7da305cd46be4
+EBUILD samba-3.0.28.ebuild 9235 RMD160 94456ea5555dbc3033189cc22c07d4f46b0b44ff SHA1 9c3b4dba5367a5a7ff07e90971296173c4566869 SHA256 01aea306fbf660735332f1e467e041dfde1a60b7f214b635465df57e8d62baaf
+MISC ChangeLog 55979 RMD160 8892d66b191b24efa30aa51cb8ef75e729f7c5b0 SHA1 819720cc56c1367a1d36ff79fb347fc2c8e67bd4 SHA256 c9f4ea11b25b0cf779f5a5c13d168181ff4a16225e40f8fd7044faaef0d047a2
MISC metadata.xml 489 RMD160 36eed0edca609c521314ae415efd57ca9acfecb4 SHA1 317e61704a10a3bd888d32c6834721f5d40d00ff SHA256 6f35f13dd39bb51d304fd59b5352c92bc35a957c9c9412c5c1f3f58e98519792
diff --git a/net-fs/samba/files/3.0.24-heap_overflow_v2.patch b/net-fs/samba/files/3.0.24-heap_overflow_v2.patch
deleted file mode 100644
index 54b5cbbc2dae..000000000000
--- a/net-fs/samba/files/3.0.24-heap_overflow_v2.patch
+++ /dev/null
@@ -1,785 +0,0 @@
-Index: samba-3.0.24/source/include/smb_macros.h
-===================================================================
---- samba-3.0.24.orig/source/include/smb_macros.h 2006-04-19 21:29:39.000000000 -0500
-+++ samba-3.0.24/source/include/smb_macros.h 2007-05-25 12:40:05.000000000 -0500
-@@ -310,7 +310,6 @@
- #if defined(PARANOID_MALLOC_CHECKER)
-
- #define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem_((ps),sizeof(type),(count))
--#define PRS_ALLOC_MEM_VOID(ps, size) prs_alloc_mem_((ps),(size),1)
-
- /* Get medieval on our ass about malloc.... */
-
-@@ -354,7 +353,6 @@
- #define __location__ __FILE__ ":" __LINESTR__
-
- #define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem((ps),sizeof(type),(count))
--#define PRS_ALLOC_MEM_VOID(ps, size) prs_alloc_mem((ps),(size),1)
-
- /* Regular malloc code. */
-
-Index: samba-3.0.24/source/rpc_parse/parse_dfs.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_dfs.c 2007-02-04 12:59:22.000000000 -0600
-+++ samba-3.0.24/source/rpc_parse/parse_dfs.c 2007-05-25 12:40:05.000000000 -0500
-@@ -325,7 +325,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores);
-+ v->stores = PRS_ALLOC_MEM(ps,NETDFS_DFS_STORAGEINFO,v->num_stores);
-+ if (!v->stores)
-+ return False;
- }
- for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) {
- if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth))
-@@ -447,7 +449,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores);
-+ v->stores = PRS_ALLOC_MEM(ps,NETDFS_DFS_STORAGEINFO,v->num_stores);
-+ if (!v->stores)
-+ return False;
- }
- for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) {
- if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth))
-@@ -920,7 +924,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
-+ v->s = PRS_ALLOC_MEM(ps,NETDFS_DFS_INFO1,v->count);
-+ if (!v->s)
-+ return False;
- }
- for (i_s_1=0; i_s_1<v->count;i_s_1++) {
- if (!netdfs_io_dfs_Info1_p("s", &v->s[i_s_1], ps, depth))
-@@ -986,7 +992,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
-+ v->s = PRS_ALLOC_MEM(ps,NETDFS_DFS_INFO2,v->count);
-+ if (!v->s)
-+ return False;
- }
- for (i_s_1=0; i_s_1<v->count;i_s_1++) {
- if (!netdfs_io_dfs_Info2_p("s", &v->s[i_s_1], ps, depth))
-@@ -1052,7 +1060,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
-+ v->s = PRS_ALLOC_MEM(ps,NETDFS_DFS_INFO3,v->count);
-+ if (!v->s)
-+ return False;
- }
- for (i_s_1=0; i_s_1<v->count;i_s_1++) {
- if (!netdfs_io_dfs_Info3_p("s", &v->s[i_s_1], ps, depth))
-@@ -1118,7 +1128,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
-+ v->s = PRS_ALLOC_MEM(ps,NETDFS_DFS_INFO4,v->count);
-+ if (!v->s)
-+ return False;
- }
- for (i_s_1=0; i_s_1<v->count;i_s_1++) {
- if (!netdfs_io_dfs_Info4_p("s", &v->s[i_s_1], ps, depth))
-@@ -1184,7 +1196,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
-+ v->s = PRS_ALLOC_MEM(ps,NETDFS_DFS_INFO200,v->count);
-+ if (!v->s)
-+ return False;
- }
- for (i_s_1=0; i_s_1<v->count;i_s_1++) {
- if (!netdfs_io_dfs_Info200_p("s", &v->s[i_s_1], ps, depth))
-@@ -1250,7 +1264,9 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count);
-+ v->s = PRS_ALLOC_MEM(ps,NETDFS_DFS_INFO300,v->count);
-+ if (!v->s)
-+ return False;
- }
- for (i_s_1=0; i_s_1<v->count;i_s_1++) {
- if (!netdfs_io_dfs_Info300_p("s", &v->s[i_s_1], ps, depth))
-Index: samba-3.0.24/source/rpc_parse/parse_lsa.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_lsa.c 2007-02-04 12:59:22.000000000 -0600
-+++ samba-3.0.24/source/rpc_parse/parse_lsa.c 2007-05-25 12:41:06.000000000 -0500
-@@ -1171,7 +1171,7 @@
-
- /* Mallocate memory if we're unpacking from the wire */
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && sen->num_entries) {
- if ((sen->ptr_sid = PRS_ALLOC_MEM( ps, uint32, sen->num_entries)) == NULL) {
- DEBUG(3, ("init_lsa_sid_enum(): out of memory for "
- "ptr_sid\n"));
-@@ -1349,12 +1349,17 @@
- &trn->num_entries2))
- return False;
-
-- if (UNMARSHALLING(ps)) {
-- if ((trn->name = PRS_ALLOC_MEM(ps, LSA_TRANS_NAME, trn->num_entries)) == NULL) {
-+ if (trn->num_entries2 != trn->num_entries) {
-+ /* RPC fault */
-+ return False;
-+ }
-+
-+ if (UNMARSHALLING(ps) && trn->num_entries2) {
-+ if ((trn->name = PRS_ALLOC_MEM(ps, LSA_TRANS_NAME, trn->num_entries2)) == NULL) {
- return False;
- }
-
-- if ((trn->uni_name = PRS_ALLOC_MEM(ps, UNISTR2, trn->num_entries)) == NULL) {
-+ if ((trn->uni_name = PRS_ALLOC_MEM(ps, UNISTR2, trn->num_entries2)) == NULL) {
- return False;
- }
- }
-@@ -1406,12 +1411,17 @@
- &trn->num_entries2))
- return False;
-
-- if (UNMARSHALLING(ps)) {
-- if ((trn->name = PRS_ALLOC_MEM(ps, LSA_TRANS_NAME2, trn->num_entries)) == NULL) {
-+ if (trn->num_entries2 != trn->num_entries) {
-+ /* RPC fault */
-+ return False;
-+ }
-+
-+ if (UNMARSHALLING(ps) && trn->num_entries2) {
-+ if ((trn->name = PRS_ALLOC_MEM(ps, LSA_TRANS_NAME2, trn->num_entries2)) == NULL) {
- return False;
- }
-
-- if ((trn->uni_name = PRS_ALLOC_MEM(ps, UNISTR2, trn->num_entries)) == NULL) {
-+ if ((trn->uni_name = PRS_ALLOC_MEM(ps, UNISTR2, trn->num_entries2)) == NULL) {
- return False;
- }
- }
-@@ -1678,7 +1688,7 @@
- return False;
- }
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && out->num_entries2) {
- if ((out->dom_rid = PRS_ALLOC_MEM(ps, DOM_RID, out->num_entries2))
- == NULL) {
- DEBUG(3, ("lsa_io_r_lookup_names(): out of memory\n"));
-@@ -1803,7 +1813,7 @@
- return False;
- }
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && out->num_entries2) {
- if ((out->dom_rid = PRS_ALLOC_MEM(ps, DOM_RID2, out->num_entries2))
- == NULL) {
- DEBUG(3, ("lsa_io_r_lookup_names2(): out of memory\n"));
-@@ -1956,7 +1966,7 @@
- return False;
- }
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && out->num_entries2) {
- if ((out->trans_sids = PRS_ALLOC_MEM(ps, LSA_TRANSLATED_SID3, out->num_entries2))
- == NULL) {
- DEBUG(3, ("lsa_io_r_lookup_names3(): out of memory\n"));
-@@ -2085,7 +2095,7 @@
- return False;
- }
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && out->num_entries2) {
- if ((out->trans_sids = PRS_ALLOC_MEM(ps, LSA_TRANSLATED_SID3, out->num_entries2))
- == NULL) {
- DEBUG(3, ("lsa_io_r_lookup_names4(): out of memory\n"));
-@@ -2324,7 +2334,7 @@
- if(!prs_uint32("count1", ps, depth, &out->count1))
- return False;
-
-- if (UNMARSHALLING(ps))
-+ if (UNMARSHALLING(ps) && out->count1)
- if (!(out->privs = PRS_ALLOC_MEM(ps, LSA_PRIV_ENTRY, out->count1)))
- return False;
-
-@@ -2759,7 +2769,7 @@
-
- static BOOL lsa_io_privilege_set(const char *desc, PRIVILEGE_SET *out, prs_struct *ps, int depth)
- {
-- uint32 i;
-+ uint32 i, dummy;
-
- prs_debug(ps, depth, desc, "lsa_io_privilege_set");
- depth++;
-@@ -2767,7 +2777,7 @@
- if(!prs_align(ps))
- return False;
-
-- if(!prs_uint32("count", ps, depth, &out->count))
-+ if(!prs_uint32("count", ps, depth, &dummy))
- return False;
- if(!prs_uint32("control", ps, depth, &out->control))
- return False;
-@@ -3886,7 +3896,7 @@
- prs_debug(ps, depth, desc, "smb_io_lsa_data_buf");
- depth++;
-
-- if ( UNMARSHALLING(ps) ) {
-+ if ( UNMARSHALLING(ps) && length ) {
- if ( !(buf->data = PRS_ALLOC_MEM( ps, uint8, length )) )
- return False;
- }
-@@ -3900,7 +3910,7 @@
- if (!prs_uint32("length", ps, depth, &buf->length))
- return False;
-
-- if(!prs_uint8s(False, "data", ps, depth, buf->data, size))
-+ if(!prs_uint8s(False, "data", ps, depth, buf->data, length))
- return False;
-
- return True;
-Index: samba-3.0.24/source/rpc_parse/parse_prs.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_prs.c 2007-02-04 12:59:22.000000000 -0600
-+++ samba-3.0.24/source/rpc_parse/parse_prs.c 2007-05-25 12:41:06.000000000 -0500
-@@ -156,7 +156,7 @@
- {
- char *ret = NULL;
-
-- if (size) {
-+ if (size && count) {
- /* We can't call the type-safe version here. */
- ret = _talloc_zero_array(ps->mem_ctx, size, count, "parse_prs");
- }
-@@ -642,9 +642,13 @@
- return True;
-
- if (UNMARSHALLING(ps)) {
-- if ( !(*data = PRS_ALLOC_MEM_VOID(ps, data_size)) )
-- return False;
-- }
-+ if (data_size) {
-+ if ( !(*data = (void *)PRS_ALLOC_MEM(ps, char, data_size)) )
-+ return False;
-+ } else {
-+ *data = NULL;
-+ }
-+ }
-
- return prs_fn(name, ps, depth, *data);
- }
-@@ -1014,16 +1018,16 @@
- if (q == NULL)
- return False;
-
-+ /* If the string is empty, we don't have anything to stream */
-+ if (str->buf_len==0)
-+ return True;
-+
- if (UNMARSHALLING(ps)) {
- str->buffer = PRS_ALLOC_MEM(ps,uint16,str->buf_len);
- if (str->buffer == NULL)
- return False;
- }
-
-- /* If the string is empty, we don't have anything to stream */
-- if (str->buf_len==0)
-- return True;
--
- p = (char *)str->buffer;
-
- dbg_rw_punival(charmode, name, depth, ps, q, p, str->buf_len);
-@@ -1053,6 +1057,8 @@
- buf->buffer = PRS_ALLOC_MEM(ps, uint16, buf->buf_max_len);
- if ( buf->buffer == NULL )
- return False;
-+ } else {
-+ buf->buffer = NULL;
- }
- }
-
-@@ -1080,9 +1086,13 @@
- if (str->str_str_len > str->str_max_len) {
- return False;
- }
-- str->buffer = PRS_ALLOC_MEM(ps,unsigned char, str->str_max_len);
-- if (str->buffer == NULL)
-- return False;
-+ if (str->str_max_len) {
-+ str->buffer = PRS_ALLOC_MEM(ps,unsigned char, str->str_max_len);
-+ if (str->buffer == NULL)
-+ return False;
-+ } else {
-+ str->buffer = NULL;
-+ }
- }
-
- if (UNMARSHALLING(ps)) {
-@@ -1127,9 +1137,13 @@
- if (str->uni_str_len > str->uni_max_len) {
- return False;
- }
-- str->buffer = PRS_ALLOC_MEM(ps,uint16,str->uni_max_len);
-- if (str->buffer == NULL)
-- return False;
-+ if (str->uni_max_len) {
-+ str->buffer = PRS_ALLOC_MEM(ps,uint16,str->uni_max_len);
-+ if (str->buffer == NULL)
-+ return False;
-+ } else {
-+ str->buffer = NULL;
-+ }
- }
-
- p = (char *)str->buffer;
-@@ -1154,9 +1168,13 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- str->str.buffer = PRS_ALLOC_MEM(ps,uint16,str->uni_str_len);
-- if (str->str.buffer == NULL)
-- return False;
-+ if (str->uni_str_len) {
-+ str->str.buffer = PRS_ALLOC_MEM(ps,uint16,str->uni_str_len);
-+ if (str->str.buffer == NULL)
-+ return False;
-+ } else {
-+ str->str.buffer = NULL;
-+ }
- }
-
- p = (char *)str->str.buffer;
-Index: samba-3.0.24/source/rpc_parse/parse_sec.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_sec.c 2005-04-18 11:38:20.000000000 -0500
-+++ samba-3.0.24/source/rpc_parse/parse_sec.c 2007-05-25 12:40:05.000000000 -0500
-@@ -122,7 +122,7 @@
- for you as it reads them.
- ********************************************************************/
-
--BOOL sec_io_acl(const char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth)
-+static BOOL sec_io_acl(const char *desc, SEC_ACL **ppsa, prs_struct *ps, int depth)
- {
- unsigned int i;
- uint32 old_offset;
-@@ -165,13 +165,10 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- /*
-- * Even if the num_aces is zero, allocate memory as there's a difference
-- * between a non-present DACL (allow all access) and a DACL with no ACE's
-- * (allow no access).
-- */
-- if((psa->ace = PRS_ALLOC_MEM(ps, SEC_ACE, psa->num_aces+1)) == NULL)
-- return False;
-+ if (psa->num_aces) {
-+ if((psa->ace = PRS_ALLOC_MEM(ps, SEC_ACE, psa->num_aces)) == NULL)
-+ return False;
-+ }
- }
-
- for (i = 0; i < psa->num_aces; i++) {
-Index: samba-3.0.24/source/rpc_parse/parse_spoolss.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_spoolss.c 2007-02-04 12:59:22.000000000 -0600
-+++ samba-3.0.24/source/rpc_parse/parse_spoolss.c 2007-05-25 12:41:06.000000000 -0500
-@@ -227,8 +227,13 @@
- if(!prs_uint32("count2", ps, depth, &type->count2))
- return False;
-
-- if (type->count2 != type->count)
-+ if (type->count2 != type->count) {
- DEBUG(4,("What a mess, count was %x now is %x !\n", type->count, type->count2));
-+ return False;
-+ }
-+ if (type->count2 > MAX_NOTIFY_TYPE_FOR_NOW) {
-+ return False;
-+ }
-
- /* parse the option type data */
- for(i=0;i<type->count2;i++)
-@@ -252,7 +257,7 @@
- return False;
-
- /* reading */
-- if (UNMARSHALLING(ps))
-+ if (UNMARSHALLING(ps) && ctr->count)
- if((ctr->type=PRS_ALLOC_MEM(ps,SPOOL_NOTIFY_OPTION_TYPE,ctr->count)) == NULL)
- return False;
-
-@@ -411,7 +416,7 @@
- if(!prs_uint32("string length", ps, depth, &data->notify_data.data.length))
- return False;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && data->notify_data.data.length) {
- data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16,
- data->notify_data.data.length);
-
-@@ -430,7 +435,7 @@
-
- case NOTIFY_POINTER:
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && data->notify_data.data.length) {
- data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16,
- data->notify_data.data.length);
-
-@@ -490,9 +495,13 @@
-
- /* Tallocate memory for string */
-
-- data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16, x * 2);
-- if (!data->notify_data.data.string)
-- return False;
-+ if (x) {
-+ data->notify_data.data.string = PRS_ALLOC_MEM(ps, uint16, x * 2);
-+ if (!data->notify_data.data.string)
-+ return False;
-+ } else {
-+ data->notify_data.data.string = NULL;
-+ }
-
- if(!prs_uint16uni(True,"string",ps,depth,data->notify_data.data.string,x))
- return False;
-@@ -5931,14 +5940,14 @@
- case REG_BINARY:
- case REG_DWORD:
- case REG_MULTI_SZ:
-- if (q_u->max_len) {
-- if (UNMARSHALLING(ps))
-- q_u->data=PRS_ALLOC_MEM(ps, uint8, q_u->max_len);
-- if(q_u->data == NULL)
-- return False;
-- if(!prs_uint8s(False,"data", ps, depth, q_u->data, q_u->max_len))
-- return False;
-- }
-+ if (q_u->max_len) {
-+ if (UNMARSHALLING(ps))
-+ q_u->data=PRS_ALLOC_MEM(ps, uint8, q_u->max_len);
-+ if(q_u->data == NULL)
-+ return False;
-+ if(!prs_uint8s(False,"data", ps, depth, q_u->data, q_u->max_len))
-+ return False;
-+ }
- if(!prs_align(ps))
- return False;
- break;
-@@ -6956,7 +6965,7 @@
-
- /* first loop to write basic enum_value information */
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && ctr->size_of_array) {
- ctr->values = PRS_ALLOC_MEM(ps, PRINTER_ENUM_VALUES, ctr->size_of_array);
- if (!ctr->values)
- return False;
-Index: samba-3.0.24/source/libads/authdata.c
-===================================================================
---- samba-3.0.24.orig/source/libads/authdata.c 2006-02-23 10:29:34.000000000 -0600
-+++ samba-3.0.24/source/libads/authdata.c 2007-05-25 12:41:06.000000000 -0500
-@@ -120,10 +120,14 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- array->krb_sid_and_attrs = PRS_ALLOC_MEM(ps, KRB_SID_AND_ATTRS, num);
-- if (!array->krb_sid_and_attrs) {
-- DEBUG(3, ("No memory available\n"));
-- return False;
-+ if (num) {
-+ array->krb_sid_and_attrs = PRS_ALLOC_MEM(ps, KRB_SID_AND_ATTRS, num);
-+ if (!array->krb_sid_and_attrs) {
-+ DEBUG(3, ("No memory available\n"));
-+ return False;
-+ }
-+ } else {
-+ array->krb_sid_and_attrs = NULL;
- }
- }
-
-@@ -184,10 +188,14 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- array->group_membership = PRS_ALLOC_MEM(ps, GROUP_MEMBERSHIP, num);
-- if (!array->group_membership) {
-- DEBUG(3, ("No memory available\n"));
-- return False;
-+ if (num) {
-+ array->group_membership = PRS_ALLOC_MEM(ps, GROUP_MEMBERSHIP, num);
-+ if (!array->group_membership) {
-+ DEBUG(3, ("No memory available\n"));
-+ return False;
-+ }
-+ } else {
-+ array->group_membership = NULL;
- }
- }
-
-@@ -456,10 +464,14 @@
- return False;
-
- if (UNMARSHALLING(ps) && length) {
-- data->signature.buffer = PRS_ALLOC_MEM(ps, uint8, siglen);
-- if (!data->signature.buffer) {
-- DEBUG(3, ("No memory available\n"));
-- return False;
-+ if (siglen) {
-+ data->signature.buffer = PRS_ALLOC_MEM(ps, uint8, siglen);
-+ if (!data->signature.buffer) {
-+ DEBUG(3, ("No memory available\n"));
-+ return False;
-+ }
-+ } else {
-+ data->signature.buffer = NULL;
- }
- }
-
-Index: samba-3.0.24/source/registry/regfio.c
-===================================================================
---- samba-3.0.24.orig/source/registry/regfio.c 2007-02-04 12:59:26.000000000 -0600
-+++ samba-3.0.24/source/registry/regfio.c 2007-05-25 12:41:06.000000000 -0500
-@@ -642,8 +642,12 @@
- return False;
-
- if ( UNMARSHALLING(&hbin->ps) ) {
-- if ( !(lf->hashes = PRS_ALLOC_MEM( &hbin->ps, REGF_HASH_REC, lf->num_keys )) )
-- return False;
-+ if (lf->num_keys) {
-+ if ( !(lf->hashes = PRS_ALLOC_MEM( &hbin->ps, REGF_HASH_REC, lf->num_keys )) )
-+ return False;
-+ } else {
-+ lf->hashes = NULL;
-+ }
- }
-
- for ( i=0; i<lf->num_keys; i++ ) {
-Index: samba-3.0.24/source/rpc_parse/parse_net.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_net.c 2007-02-04 12:59:22.000000000 -0600
-+++ samba-3.0.24/source/rpc_parse/parse_net.c 2007-05-25 12:41:06.000000000 -0500
-@@ -1721,9 +1721,13 @@
- }
-
- if (UNMARSHALLING(ps)) {
-- usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups);
-- if (usr->gids == NULL)
-- return False;
-+ if (usr->num_groups) {
-+ usr->gids = PRS_ALLOC_MEM(ps, DOM_GID, usr->num_groups);
-+ if (usr->gids == NULL)
-+ return False;
-+ } else {
-+ usr->gids = NULL;
-+ }
- }
-
- for (i = 0; i < usr->num_groups; i++) {
-@@ -1756,10 +1760,15 @@
- return False;
-
- if (UNMARSHALLING(ps)) {
-- usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids);
-- usr->other_sids_attrib =
-- PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids);
--
-+ if (usr->num_other_sids) {
-+ usr->other_sids = PRS_ALLOC_MEM(ps, DOM_SID2, usr->num_other_sids);
-+ usr->other_sids_attrib =
-+ PRS_ALLOC_MEM(ps, uint32, usr->num_other_sids);
-+ } else {
-+ usr->other_sids = NULL;
-+ usr->other_sids_attrib = NULL;
-+ }
-+
- if ((num_other_sids != 0) &&
- ((usr->other_sids == NULL) ||
- (usr->other_sids_attrib == NULL)))
-Index: samba-3.0.24/source/rpc_parse/parse_samr.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_samr.c 2007-02-04 12:59:22.000000000 -0600
-+++ samba-3.0.24/source/rpc_parse/parse_samr.c 2007-05-25 12:41:06.000000000 -0500
-@@ -3337,7 +3337,7 @@
- if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
- return False;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && r_u->num_entries2) {
- r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
- r_u->uni_dom_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
- }
-@@ -3476,7 +3476,7 @@
- if(!prs_uint32("num_entries3", ps, depth, &r_u->num_entries3))
- return False;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && r_u->num_entries2) {
- r_u->sam = PRS_ALLOC_MEM(ps,SAM_ENTRY,r_u->num_entries2);
- r_u->uni_grp_name = PRS_ALLOC_MEM(ps,UNISTR2,r_u->num_entries2);
- }
-@@ -4980,12 +4980,13 @@
- return False;
- }
-
-- if (UNMARSHALLING(ps))
-+ if (UNMARSHALLING(ps) && r_u->num_rids2) {
- r_u->rids = PRS_ALLOC_MEM(ps, uint32, r_u->num_rids2);
-
-- if (!r_u->rids) {
-- DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
-- return False;
-+ if (!r_u->rids) {
-+ DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
-+ return False;
-+ }
- }
-
- for (i = 0; i < r_u->num_rids2; i++) {
-@@ -5009,12 +5010,13 @@
- return False;
- }
-
-- if (UNMARSHALLING(ps))
-+ if (UNMARSHALLING(ps) && r_u->num_types2) {
- r_u->types = PRS_ALLOC_MEM(ps, uint32, r_u->num_types2);
-
-- if (!r_u->types) {
-- DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
-- return False;
-+ if (!r_u->types) {
-+ DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
-+ return False;
-+ }
- }
-
- for (i = 0; i < r_u->num_types2; i++) {
-Index: samba-3.0.24/source/rpc_parse/parse_srv.c
-===================================================================
---- samba-3.0.24.orig/source/rpc_parse/parse_srv.c 2005-04-18 11:38:20.000000000 -0500
-+++ samba-3.0.24/source/rpc_parse/parse_srv.c 2007-05-25 12:41:06.000000000 -0500
-@@ -782,7 +782,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info0 = PRS_ALLOC_MEM(ps, SRV_SHARE_INFO_0, num_entries)))
- return False;
- ctr->share.info0 = info0;
-@@ -808,7 +808,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info1 = PRS_ALLOC_MEM(ps, SRV_SHARE_INFO_1, num_entries)))
- return False;
- ctr->share.info1 = info1;
-@@ -834,7 +834,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info2 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_2,num_entries)))
- return False;
- ctr->share.info2 = info2;
-@@ -859,7 +859,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info501 = PRS_ALLOC_MEM(ps, SRV_SHARE_INFO_501, num_entries)))
- return False;
- ctr->share.info501 = info501;
-@@ -884,7 +884,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info502 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_502,num_entries)))
- return False;
- ctr->share.info502 = info502;
-@@ -910,7 +910,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info1004 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1004,num_entries)))
- return False;
- ctr->share.info1004 = info1004;
-@@ -936,7 +936,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info1005 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1005,num_entries)))
- return False;
- ctr->share.info1005 = info1005;
-@@ -956,7 +956,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info1006 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1006,num_entries)))
- return False;
- ctr->share.info1006 = info1006;
-@@ -976,7 +976,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info1007 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1007,num_entries)))
- return False;
- ctr->share.info1007 = info1007;
-@@ -1002,7 +1002,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info1501 = PRS_ALLOC_MEM(ps,SRV_SHARE_INFO_1501,num_entries)))
- return False;
- ctr->share.info1501 = info1501;
-@@ -2558,7 +2558,7 @@
- int num_entries = ctr->num_entries;
- int i;
-
-- if (UNMARSHALLING(ps)) {
-+ if (UNMARSHALLING(ps) && num_entries) {
- if (!(info3 = PRS_ALLOC_MEM(ps, SRV_FILE_INFO_3, num_entries)))
- return False;
- ctr->file.info3 = info3;
-@@ -3377,7 +3377,7 @@
-
- r_n->disk_enum_ctr.entries_read = entries_read3;
-
-- if(UNMARSHALLING(ps)) {
-+ if(UNMARSHALLING(ps) && entries_read3) {
-
- DISK_INFO *dinfo;
-
-@@ -3386,7 +3386,7 @@
- r_n->disk_enum_ctr.disk_info = dinfo;
- }
-
-- for(i=0; i < r_n->disk_enum_ctr.entries_read; i++) {
-+ for(i=0; i < entries_read3; i++) {
-
- if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.disk_info[i].unknown))
- return False;
diff --git a/net-fs/samba/files/3.0.24-shell_escape.patch b/net-fs/samba/files/3.0.24-shell_escape.patch
deleted file mode 100644
index dc7fd94ebddd..000000000000
--- a/net-fs/samba/files/3.0.24-shell_escape.patch
+++ /dev/null
@@ -1,252 +0,0 @@
-Only in source-orig/: configure
-diff -u -r source-orig/lib/charcnv.c source/lib/charcnv.c
---- source-orig/lib/charcnv.c 2006-04-19 19:29:23.000000000 -0700
-+++ source/lib/charcnv.c 2007-05-10 09:59:49.023262000 -0700
-@@ -1398,5 +1398,5 @@
- /* We're hosed - we don't know how big this is... */
- DEBUG(10,("next_mb_char_size: unknown size at string %s\n", s));
- conv_silent = False;
-- return 1;
-+ return (size_t)-1;
- }
-diff -u -r source-orig/lib/smbrun.c source/lib/smbrun.c
---- source-orig/lib/smbrun.c 2006-04-19 19:29:23.000000000 -0700
-+++ source/lib/smbrun.c 2007-05-10 09:57:03.305061000 -0700
-@@ -55,7 +55,7 @@
- outfd (or discard it if outfd is NULL).
- ****************************************************************************/
-
--int smbrun(const char *cmd, int *outfd)
-+static int smbrun_internal(const char *cmd, int *outfd, BOOL sanitize)
- {
- pid_t pid;
- uid_t uid = current_user.ut.uid;
-@@ -173,13 +173,36 @@
- }
- #endif
-
-- execl("/bin/sh","sh","-c",cmd,NULL);
-+ {
-+ const char *newcmd = sanitize ? escape_shell_string(cmd) : cmd;
-+ if (!newcmd) {
-+ exit(82);
-+ }
-+ execl("/bin/sh","sh","-c",newcmd,NULL);
-+ }
-
- /* not reached */
-- exit(82);
-+ exit(83);
- return 1;
- }
-
-+/****************************************************************************
-+ Use only in known safe shell calls (printing).
-+****************************************************************************/
-+
-+int smbrun_no_sanitize(const char *cmd, int *outfd)
-+{
-+ return smbrun_internal(cmd, outfd, False);
-+}
-+
-+/****************************************************************************
-+ By default this now sanitizes shell expansion.
-+****************************************************************************/
-+
-+int smbrun(const char *cmd, int *outfd)
-+{
-+ return smbrun_internal(cmd, outfd, True);
-+}
-
- /****************************************************************************
- run a command being careful about uid/gid handling and putting the output in
-@@ -302,7 +325,7 @@
- #endif
-
- execl("/bin/sh", "sh", "-c", cmd, NULL);
--
-+
- /* not reached */
- exit(82);
- return 1;
-diff -u -r source-orig/lib/util_str.c source/lib/util_str.c
---- source-orig/lib/util_str.c 2007-02-04 10:59:17.000000000 -0800
-+++ source/lib/util_str.c 2007-05-10 09:59:36.718762000 -0700
-@@ -2426,3 +2426,165 @@
- return True;
- }
-
-+
-+/*******************************************************************
-+ Add a shell escape character '\' to any character not in a known list
-+ of characters. UNIX charset format.
-+*******************************************************************/
-+
-+#define INCLUDE_LIST "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabdefghijklmnopqrstuvwxyz_/ \t.,"
-+#define INSIDE_DQUOTE_LIST "$`\n\"\\"
-+
-+char *escape_shell_string(const char *src)
-+{
-+ size_t srclen = strlen(src);
-+ char *ret = SMB_MALLOC((srclen * 2) + 1);
-+ char *dest = ret;
-+ BOOL in_s_quote = False;
-+ BOOL in_d_quote = False;
-+ BOOL next_escaped = False;
-+
-+ if (!ret) {
-+ return NULL;
-+ }
-+
-+ while (*src) {
-+ size_t c_size = next_mb_char_size(src);
-+
-+ if (c_size == (size_t)-1) {
-+ SAFE_FREE(ret);
-+ return NULL;
-+ }
-+
-+ if (c_size > 1) {
-+ memcpy(dest, src, c_size);
-+ src += c_size;
-+ dest += c_size;
-+ next_escaped = False;
-+ continue;
-+ }
-+
-+ /*
-+ * Deal with backslash escaped state.
-+ * This only lasts for one character.
-+ */
-+
-+ if (next_escaped) {
-+ *dest++ = *src++;
-+ next_escaped = False;
-+ continue;
-+ }
-+
-+ /*
-+ * Deal with single quote state. The
-+ * only thing we care about is exiting
-+ * this state.
-+ */
-+
-+ if (in_s_quote) {
-+ if (*src == '\'') {
-+ in_s_quote = False;
-+ }
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ /*
-+ * Deal with double quote state. The most
-+ * complex state. We must cope with \, meaning
-+ * possibly escape next char (depending what it
-+ * is), ", meaning exit this state, and possibly
-+ * add an \ escape to any unprotected character
-+ * (listed in INSIDE_DQUOTE_LIST).
-+ */
-+
-+ if (in_d_quote) {
-+ if (*src == '\\') {
-+ /*
-+ * Next character might be escaped.
-+ * We have to peek. Inside double
-+ * quotes only INSIDE_DQUOTE_LIST
-+ * characters are escaped by a \.
-+ */
-+
-+ char nextchar;
-+
-+ c_size = next_mb_char_size(&src[1]);
-+ if (c_size == (size_t)-1) {
-+ SAFE_FREE(ret);
-+ return NULL;
-+ }
-+ if (c_size > 1) {
-+ /*
-+ * Don't escape the next char.
-+ * Just copy the \.
-+ */
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ nextchar = src[1];
-+
-+ if (nextchar && strchr(INSIDE_DQUOTE_LIST, (int)nextchar)) {
-+ next_escaped = True;
-+ }
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ if (*src == '\"') {
-+ /* Exit double quote state. */
-+ in_d_quote = False;
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ /*
-+ * We know the character isn't \ or ",
-+ * so escape it if it's any of the other
-+ * possible unprotected characters.
-+ */
-+
-+ if (strchr(INSIDE_DQUOTE_LIST, (int)*src)) {
-+ *dest++ = '\\';
-+ }
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ /*
-+ * From here to the end of the loop we're
-+ * not in the single or double quote state.
-+ */
-+
-+ if (*src == '\\') {
-+ /* Next character must be escaped. */
-+ next_escaped = True;
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ if (*src == '\'') {
-+ /* Go into single quote state. */
-+ in_s_quote = True;
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ if (*src == '\"') {
-+ /* Go into double quote state. */
-+ in_d_quote = True;
-+ *dest++ = *src++;
-+ continue;
-+ }
-+
-+ /* Check if we need to escape the character. */
-+
-+ if (!strchr(INCLUDE_LIST, (int)*src)) {
-+ *dest++ = '\\';
-+ }
-+ *dest++ = *src++;
-+ }
-+ *dest++ = '\0';
-+ return ret;
-+}
-diff -u -r source-orig/printing/print_generic.c source/printing/print_generic.c
---- source-orig/printing/print_generic.c 2007-02-04 10:59:13.000000000 -0800
-+++ source/printing/print_generic.c 2007-05-10 09:57:03.292061000 -0700
-@@ -58,7 +58,7 @@
- if ( do_sub && snum != -1 )
- standard_sub_snum(snum,syscmd,sizeof(syscmd));
-
-- ret = smbrun(syscmd,outfd);
-+ ret = smbrun_no_sanitize(syscmd,outfd);
-
- DEBUG(3,("Running the command `%s' gave %d\n",syscmd,ret));
-
diff --git a/net-fs/samba/files/3.0.24-sid2name_elevation_v2.patch b/net-fs/samba/files/3.0.24-sid2name_elevation_v2.patch
deleted file mode 100644
index 7bf5a1a4ca04..000000000000
--- a/net-fs/samba/files/3.0.24-sid2name_elevation_v2.patch
+++ /dev/null
@@ -1,168 +0,0 @@
-Index: samba-3.0.24/source/lib/util_sec.c
-===================================================================
---- samba-3.0.24.orig/source/lib/util_sec.c 2007-05-25 12:36:10.000000000 -0500
-+++ samba-3.0.24/source/lib/util_sec.c 2007-05-25 12:36:38.000000000 -0500
-@@ -286,28 +286,6 @@
- }
-
- /****************************************************************************
-- Lightweight become root - no group change.
--****************************************************************************/
--
--void become_root_uid_only(void)
--{
-- save_re_uid();
-- set_effective_uid(0);
--}
--
--/****************************************************************************
-- Lightweight unbecome root - no group change. Expects we are root already,
-- saves errno across call boundary.
--****************************************************************************/
--
--void unbecome_root_uid_only(void)
--{
-- int saved_errno = errno;
-- restore_re_uid_fromroot();
-- errno = saved_errno;
--}
--
--/****************************************************************************
- save the real and effective gid for later restoration. Used by the
- getgroups code
- ****************************************************************************/
-Index: samba-3.0.24/source/passdb/lookup_sid.c
-===================================================================
---- samba-3.0.24.orig/source/passdb/lookup_sid.c 2007-05-25 12:36:10.000000000 -0500
-+++ samba-3.0.24/source/passdb/lookup_sid.c 2007-05-25 12:36:38.000000000 -0500
-@@ -421,10 +421,10 @@
- return False;
- }
-
-- become_root_uid_only();
-+ become_root();
- result = pdb_lookup_rids(domain_sid, num_rids, rids,
- *names, *types);
-- unbecome_root_uid_only();
-+ unbecome_root();
-
- return (NT_STATUS_IS_OK(result) ||
- NT_STATUS_EQUAL(result, NT_STATUS_NONE_MAPPED) ||
-@@ -1085,9 +1085,9 @@
- goto done;
- }
-
-- become_root_uid_only();
-+ become_root();
- ret = pdb_uid_to_rid(uid, &rid);
-- unbecome_root_uid_only();
-+ unbecome_root();
-
- if (ret) {
- /* This is a mapped user */
-@@ -1131,9 +1131,9 @@
- goto done;
- }
-
-- become_root_uid_only();
-+ become_root();
- ret = pdb_gid_to_sid(gid, psid);
-- unbecome_root_uid_only();
-+ unbecome_root();
-
- if (ret) {
- /* This is a mapped group */
-@@ -1179,9 +1179,9 @@
- union unid_t id;
- BOOL ret;
-
-- become_root_uid_only();
-+ become_root();
- ret = pdb_sid_to_id(psid, &id, &type);
-- unbecome_root_uid_only();
-+ unbecome_root();
-
- if (ret) {
- if (type != SID_NAME_USER) {
-@@ -1259,9 +1259,9 @@
- sid_check_is_in_wellknown_domain(psid))) {
- BOOL ret;
-
-- become_root_uid_only();
-+ become_root();
- ret = pdb_getgrsid(&map, *psid);
-- unbecome_root_uid_only();
-+ unbecome_root();
-
- if (ret) {
- *pgid = map.gid;
-@@ -1273,9 +1273,9 @@
- if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) {
- BOOL ret;
-
-- become_root_uid_only();
-+ become_root();
- ret = pdb_sid_to_id(psid, &id, &type);
-- unbecome_root_uid_only();
-+ unbecome_root();
-
- if (ret) {
- if ((type != SID_NAME_DOM_GRP) &&
-Index: samba-3.0.24/source/smbd/uid.c
-===================================================================
---- samba-3.0.24.orig/source/smbd/uid.c 2007-05-25 12:36:28.000000000 -0500
-+++ samba-3.0.24/source/smbd/uid.c 2007-05-25 12:36:46.000000000 -0500
-@@ -151,7 +151,9 @@
- char group_c;
- BOOL must_free_token = False;
- NT_USER_TOKEN *token = NULL;
--
-+ int num_groups = 0;
-+ gid_t *group_list = NULL;
-+
- if (!conn) {
- DEBUG(2,("change_to_user: Connection not open\n"));
- return(False);
-@@ -190,14 +192,14 @@
- if (conn->force_user) /* security = share sets this too */ {
- uid = conn->uid;
- gid = conn->gid;
-- current_user.ut.groups = conn->groups;
-- current_user.ut.ngroups = conn->ngroups;
-+ group_list = conn->groups;
-+ num_groups = conn->ngroups;
- token = conn->nt_user_token;
- } else if (vuser) {
- uid = conn->admin_user ? 0 : vuser->uid;
- gid = vuser->gid;
-- current_user.ut.ngroups = vuser->n_groups;
-- current_user.ut.groups = vuser->groups;
-+ num_groups = vuser->n_groups;
-+ group_list = vuser->groups;
- token = vuser->nt_user_token;
- } else {
- DEBUG(2,("change_to_user: Invalid vuid used %d in accessing "
-@@ -230,8 +232,8 @@
- */
-
- int i;
-- for (i = 0; i < current_user.ut.ngroups; i++) {
-- if (current_user.ut.groups[i] == conn->gid) {
-+ for (i = 0; i < num_groups; i++) {
-+ if (group_list[i] == conn->gid) {
- gid = conn->gid;
- gid_to_sid(&token->user_sids[1], gid);
- break;
-@@ -243,6 +245,12 @@
- }
- }
-
-+ /* Now set current_user since we will immediately also call
-+ set_sec_ctx() */
-+
-+ current_user.ut.ngroups = num_groups;
-+ current_user.ut.groups = group_list;
-+
- set_sec_ctx(uid, gid, current_user.ut.ngroups, current_user.ut.groups,
- token);
-
diff --git a/net-fs/samba/samba-3.0.24-r3.ebuild b/net-fs/samba/samba-3.0.24-r3.ebuild
deleted file mode 100644
index cc3ad00896d2..000000000000
--- a/net-fs/samba/samba-3.0.24-r3.ebuild
+++ /dev/null
@@ -1,304 +0,0 @@
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.24-r3.ebuild,v 1.9 2007/06/24 22:07:15 vapier Exp $
-
-WANT_AUTOCONF="latest"
-WANT_AUTOMAKE="none"
-
-inherit eutils autotools versionator pam
-
-IUSE_LINGUAS="ja pl"
-IUSE="acl async automount caps cups doc examples kerberos kernel_linux ldap fam
- linguas_ja linguas_pl
- oav pam python quotas readline selinux swat syslog winbind"
-
-VSCAN_VER="0.3.6b"
-PATCH_VER="0.3.16"
-MY_P=${PN}-${PV/_/}
-MY_PP=${PN}-$(get_major_version)-gentoo-${PATCH_VER}
-S2=${WORKDIR}/${MY_P}
-S=${S2}/source
-PFVSCAN=${PN}-vscan-${VSCAN_VER}
-
-DESCRIPTION="SAMBA is a suite of SMB and CIFS client/server programs for UNIX"
-HOMEPAGE="http://www.samba.org/ http://www.openantivirus.org/projects.php"
-SRC_URI="mirror://gentoo/${MY_PP}.tar.bz2
- mirror://samba/${MY_P}.tar.gz
- mirror://samba/old-versions/${MY_P}.tar.gz
- oav? ( mirror://sourceforge/openantivirus/${PFVSCAN}.tar.bz2 )"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
-
-RDEPEND="dev-libs/popt
- virtual/libiconv
- acl? ( kernel_linux? ( sys-apps/acl ) )
- cups? ( net-print/cups )
- ldap? ( kerberos? ( virtual/krb5 ) 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}"
-
-PRIVATE_DST=/var/lib/samba/private
-PATCHDIR=${WORKDIR}/patches
-CONFDIR=${WORKDIR}/configs
-
-src_unpack() {
- unpack ${A}
- cd "${S2}"
-
- epatch "${FILESDIR}/${PV}-sid2name_elevation_v2.patch"
- epatch "${FILESDIR}/${PV}-shell_escape.patch"
- epatch "${FILESDIR}/${PV}-heap_overflow_v2.patch"
-
- export EPATCH_SUFFIX="patch"
- epatch ${PATCHDIR}/general
-
- if use oav ; then
- cd ${WORKDIR}
- if [[ -d ${PATCHDIR}/vscan ]] ; then
- epatch ${PATCHDIR}/vscan
- fi
- cp -pPR ${WORKDIR}/${PFVSCAN} ${S2}/examples/VFS
- fi
-
- # patches screw with autotool files
- cd "${S}"
- eautoconf
-}
-
-src_compile() {
- local myconf
- local mylangs
- local mymod_shared
-
- 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 kerberos ads)"
- use winbind && mymod_shared="${mymod_shared},idmap_ad"
- fi
-
- [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie"
- use hppa && myconf="${myconf} --disable-pie"
-
- use fam && export ac_cv_header_fam_h=yes || export ac_cv_header_fam_h=no
- use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
-
- econf \
- --with-fhs \
- --sysconfdir=/etc/samba \
- --localstatedir=/var \
- --with-configdir=/etc/samba \
- --with-libdir=/usr/$(get_libdir)/samba \
- --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 \
- --without-spinlocks \
- --enable-socket-wrapper \
- $(use_with acl acl-support) \
- $(use_with async aio-support) \
- $(use_with automount) \
- $(use_enable cups) \
- $(use_with kerberos krb5) \
- $(use_with ldap) \
- $(use_with pam) $(use_with pam pam_smbpass) \
- $(use_with python) \
- $(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} || die
-
- emake proto || die "SAMBA make proto error"
- emake everything || die "SAMBA make everything error"
-
- emake rpctorture >& rpctorture.log || ewarn "rpctorture didn't build [that's ok!]"
-
- if use python ; then
- python python/setup.py build
- fi
-
- # Build samba-vscan plugins
- if use oav ; then
- cd ${S2}/examples/VFS/${PFVSCAN}
- econf \
- --with-fhs \
- --libdir=/usr/$(get_libdir)/samba \
- || die "${PFVSCAN} ./configure failed"
- emake || die "Failed to make ${PFVSCAN}"
- fi
-
-}
-
-src_install() {
- local extra_bins="rpctorture"
-
- emake DESTDIR="${D}" install-everything || die
-
- # Extra rpctorture progs
- 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
-
- # Nsswitch extensions. Make link for wins and winbind resolvers
- if use winbind ; then
- dolib.so "${S}"/nsswitch/libnss_wins.so || die
- dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
- dolib.so "${S}"/nsswitch/libnss_winbind.so || die
- dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
- fi
-
- if use pam ; then
- exeinto /$(get_libdir)/security
- doexe "${S}"/bin/pam_smbpass.so || die
- if use winbind ; then
- exeinto /$(get_libdir)/security
- doexe "${S}"/bin/pam_winbind.so || die
- fi
- fi
-
- if use kernel_linux ; then
- # mount backend
- dodir /sbin
- dosym ../usr/bin/smbmount /sbin/mount.smbfs
- dosym ../usr/bin/mount.cifs /sbin/mount.cifs
- 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
-
- # VFS plugin modules
- if use oav ; then
- cd ${S2}/examples/VFS/${PFVSCAN}
- make install DESTDIR=${D} || die "VFS: vscan error"
- insinto /etc/samba
- doins ${S2}/examples/VFS/${PFVSCAN}/openantivirus/*conf
- fi
-
- # Python extensions
- if use python ; then
- cd ${S}
- python python/setup.py install --root=${D} || die
- fi
-
- # General config files
- insinto /etc/samba
- doins ${CONFDIR}/smbusers
- newins ${CONFDIR}/smb.conf.example-samba3 smb.conf.example
- doins ${CONFDIR}/lmhosts
-
- newpamd ${CONFDIR}/samba.pam samba
- use winbind && doins ${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 ${S2}/examples/LDAP/samba.schema
- 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}
- keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth}
-
- # docs
- dodoc ${FILESDIR}/README.gentoo
- dodoc ${S2}/{COPYING,Manifest,README,Roadmap,WHATSNEW.txt}
- dodoc ${CONFDIR}/nsswitch.conf-wins
- use winbind && dodoc ${CONFDIR}/nsswitch.conf-winbind
-
- if use oav ; then
- docinto ${PFVSCAN}
- cd ${WORKDIR}/${PFVSCAN}
- dodoc AUTHORS COPYING ChangeLog FAQ INSTALL NEWS README TODO
- dodoc */*.conf
- fi
-
- if use examples ; then
- docinto examples
- cp -pPR ${S2}/examples/* "${D}"/usr/share/doc/${PF}/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
-
- # Patch ChangeLog
- docinto gentoo
- dodoc ${PATCHDIR}/ChangeLog
-}
-
-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
- einfo "Latest info: README.gentoo in documentation directory"
-}
-
-pkg_postrm(){
- # If stale docs, and one isn't re-emerging the latest version, removes
- # (this is actually a portage bug, though)
- [[ -n ${PF} && ! -f ${ROOT}/usr/lib/${PN}/en.msg ]] && \
- rm -rf "${ROOT}"/usr/share/doc/${PF}
-}
diff --git a/net-fs/samba/samba-3.0.28.ebuild b/net-fs/samba/samba-3.0.28.ebuild
index d6ce6f04257f..eae800471a05 100644
--- a/net-fs/samba/samba-3.0.28.ebuild
+++ b/net-fs/samba/samba-3.0.28.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.28.ebuild,v 1.4 2008/02/20 20:02:53 dev-zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.0.28.ebuild,v 1.5 2008/02/27 19:19:48 dev-zero Exp $
inherit autotools eutils pam python multilib versionator confutils
@@ -109,6 +109,7 @@ src_compile() {
--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 \
@@ -171,11 +172,6 @@ src_install() {
dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
fi
- if use pam ; then
- dopammod bin/pam_smbpass.so
- use winbind && dopammod bin/pam_winbind.so
- fi
-
if use kernel_linux ; then
# Warning: this can byte you if /usr is
# on a separate volume and you have to mount