Merge F9 to devel again.

Guenther
This commit is contained in:
Guenther Deschner 2008-05-26 16:31:07 +00:00
parent 26003bfbf6
commit 5d75374133
7 changed files with 131 additions and 176 deletions

View File

@ -1 +1 @@
samba-3.2.0pre3.tar.gz
samba-3.2.0rc1.tar.gz

View File

@ -1,66 +0,0 @@
commit c20c5f082162ff6c0c2931f456897334aa002e83
Author: Simo Sorce <idra@samba.org>
Date: Fri Mar 7 11:33:26 2008 -0500
Enable use of Relocations Read-Only, if supported, for enhanced security.
diff --git a/source/Makefile.in b/source/Makefile.in
index ac33a11..376d24c 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -43,8 +43,8 @@ CPPFLAGS=-DHAVE_CONFIG_H @CPPFLAGS@
EXEEXT=@EXEEXT@
AR=@AR@
-LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@
-LDFLAGS=@PIE_LDFLAGS@ @LDFLAGS@
+LDSHFLAGS=@LDSHFLAGS@ @RELRO_LDFLAGS@ @LDFLAGS@
+LDFLAGS=@PIE_LDFLAGS@ @RELRO_LDFLAGS@ @LDFLAGS@
WINBIND_NSS_LDSHFLAGS=@WINBIND_NSS_LDSHFLAGS@ @LDFLAGS@
AWK=@AWK@
diff --git a/source/configure.in b/source/configure.in
index 056c0f8..f884d93 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -73,6 +73,7 @@ AC_SUBST(HOST_OS)
AC_SUBST(PICFLAG)
AC_SUBST(PIE_CFLAGS)
AC_SUBST(PIE_LDFLAGS)
+AC_SUBST(RELRO_LDFLAGS)
AC_SUBST(SHLIBEXT)
AC_SUBST(INSTALLLIBCMD_SH)
AC_SUBST(INSTALLLIBCMD_A)
@@ -1513,6 +1514,32 @@ EOF
fi
fi
+# Set defaults
+RELRO_LDFLAGS=""
+AC_ARG_ENABLE(relro, [AS_HELP_STRING([--enable-relro], [Turn on Relocations Read-Only (relro) support if available (default=yes)])])
+
+if test "x$enable_relro" != xno
+then
+ AC_CACHE_CHECK([for -Wl,-z,relro], samba_cv_relro,
+ [
+ cat > conftest.c <<EOF
+int foo;
+main () { return 0;}
+EOF
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Wl,-z,relro -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
+ then
+ samba_cv_relro=yes
+ else
+ samba_cv_relro=no
+ fi
+ rm -f conftest*
+ ])
+ if test x"${samba_cv_relro}" = x"yes"
+ then
+ RELRO_LDFLAGS="-Wl,-z,relro"
+ fi
+fi
+
# Assume non-shared by default and override below
BLDSHARED="false"

View File

@ -1,66 +0,0 @@
commit f3251ba03a69c2fd0335861177159a32b2bc9477
Author: Günther Deschner <gd@samba.org>
Date: Wed May 14 23:50:25 2008 +0200
Fix Bug #5465 (joining with createcomputer=ou1/ou2/ou3).
Guenther
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index 24eb114..99fd645 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -3595,18 +3595,18 @@ const char *ads_get_extended_right_name_by_guid(ADS_STRUCT *ads,
ADS_STATUS ads_check_ou_dn(TALLOC_CTX *mem_ctx,
ADS_STRUCT *ads,
- const char *account_ou)
+ const char **account_ou)
{
struct ldb_dn *name_dn = NULL;
const char *name = NULL;
char *ou_string = NULL;
- name_dn = ldb_dn_explode(mem_ctx, account_ou);
+ name_dn = ldb_dn_explode(mem_ctx, *account_ou);
if (name_dn) {
return ADS_SUCCESS;
}
- ou_string = ads_ou_string(ads, account_ou);
+ ou_string = ads_ou_string(ads, *account_ou);
if (!ou_string) {
return ADS_ERROR_LDAP(LDAP_INVALID_DN_SYNTAX);
}
@@ -3623,8 +3623,8 @@ ADS_STATUS ads_check_ou_dn(TALLOC_CTX *mem_ctx,
return ADS_ERROR_LDAP(LDAP_INVALID_DN_SYNTAX);
}
- account_ou = talloc_strdup(mem_ctx, name);
- if (!account_ou) {
+ *account_ou = talloc_strdup(mem_ctx, name);
+ if (!*account_ou) {
return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
}
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 36700b2..4cfdd50 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -207,7 +207,7 @@ static ADS_STATUS libnet_join_precreate_machine_acct(TALLOC_CTX *mem_ctx,
const char *attrs[] = { "dn", NULL };
bool moved = false;
- status = ads_check_ou_dn(mem_ctx, r->in.ads, r->in.account_ou);
+ status = ads_check_ou_dn(mem_ctx, r->in.ads, &r->in.account_ou);
if (!ADS_ERR_OK(status)) {
return status;
}
@@ -1486,7 +1486,6 @@ static int libnet_destroy_UnjoinCtx(struct libnet_UnjoinCtx *r)
unsetenv(KRB5_ENV_CCNAME);
}
-
return 0;
}

View File

@ -1,29 +0,0 @@
commit 687275cd532f8f8ad710acd222a0c76625da53c6
Author: Jeremy Allison <jra@samba.org>
Date: Thu May 8 22:07:35 2008 -0700
Fix bug #5452 - smbclient put always creates zero length
files. Thanks to Kai Engert <kengert@redhat.com> for
reporting.
Jeremy.
diff --git a/source/lib/xfile.c b/source/lib/xfile.c
index d20a95b..e44a92d 100644
--- a/source/lib/xfile.c
+++ b/source/lib/xfile.c
@@ -263,13 +263,13 @@ int x_fflush(XFILE *f)
if (f->flags & X_FLAG_ERROR) return -1;
+ if (f->bufused == 0 || !f->buf) return 0;
+
if ((f->open_flags & O_ACCMODE) != O_WRONLY) {
errno = EINVAL;
return -1;
}
- if (f->bufused == 0 || !f->buf) return 0;
-
ret = write(f->fd, f->buf, f->bufused);
if (ret == -1) return -1;

113
samba-3.2.0rc1-capget.diff Normal file
View File

@ -0,0 +1,113 @@
source/include/smb.h | 3 +-
source/lib/system.c | 5 ++++
source/smbd/oplock_linux.c | 48 +------------------------------------------
3 files changed, 9 insertions(+), 47 deletions(-)
diff --git a/source/include/smb.h b/source/include/smb.h
index d6b026d..38d9b7b 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -1703,7 +1703,8 @@ minimum length == 18.
enum smbd_capability {
KERNEL_OPLOCK_CAPABILITY,
- DMAPI_ACCESS_CAPABILITY
+ DMAPI_ACCESS_CAPABILITY,
+ LEASE_CAPABILITY
};
/* if a kernel does support oplocks then a structure of the following
diff --git a/source/lib/system.c b/source/lib/system.c
index fa50955..eabb6d6 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -733,6 +733,11 @@ static bool set_process_capability(enum smbd_capability capability,
cap_vals[num_cap_vals++] = CAP_MKNOD;
#endif
break;
+ case LEASE_CAPABILITY:
+#ifdef CAP_LEASE
+ cap_vals[num_cap_vals++] = CAP_LEASE;
+#endif
+ break;
}
SMB_ASSERT(num_cap_vals <= ARRAY_SIZE(cap_vals));
diff --git a/source/smbd/oplock_linux.c b/source/smbd/oplock_linux.c
index fa7cb42..08df228 100644
--- a/source/smbd/oplock_linux.c
+++ b/source/smbd/oplock_linux.c
@@ -22,22 +22,6 @@
#if HAVE_KERNEL_OPLOCKS_LINUX
-/* these can be removed when they are in glibc headers */
-struct cap_user_header {
- uint32 version;
- int pid;
-} header;
-struct cap_user_data {
- uint32 effective;
- uint32 permitted;
- uint32 inheritable;
-} data;
-
-extern int capget(struct cap_user_header * hdrp,
- struct cap_user_data * datap);
-extern int capset(struct cap_user_header * hdrp,
- const struct cap_user_data * datap);
-
static SIG_ATOMIC_T signals_received;
#define FD_PENDING_SIZE 100
static SIG_ATOMIC_T fd_pending_array[FD_PENDING_SIZE];
@@ -75,40 +59,12 @@ static void signal_handler(int sig, siginfo_t *info, void *unused)
sys_select_signal(RT_SIGNAL_LEASE);
}
-/****************************************************************************
- Try to gain a linux capability.
-****************************************************************************/
-
-static void set_capability(unsigned capability)
-{
-#ifndef _LINUX_CAPABILITY_VERSION
-#define _LINUX_CAPABILITY_VERSION 0x19980330
-#endif
- header.version = _LINUX_CAPABILITY_VERSION;
- header.pid = 0;
-
- if (capget(&header, &data) == -1) {
- DEBUG(3,("Unable to get kernel capabilities (%s)\n",
- strerror(errno)));
- return;
- }
-
- if (0 == (data.effective & (1<<capability))) {
- data.effective |= (1<<capability);
-
- if (capset(&header, &data) == -1) {
- DEBUG(3,("Unable to set %d capability (%s)\n",
- capability, strerror(errno)));
- }
- }
-}
-
/*
* public function to get linux lease capability. Needed by some VFS modules (eg. gpfs.c)
*/
void linux_set_lease_capability(void)
{
- set_capability(CAP_LEASE);
+ set_effective_capability(LEASE_CAPABILITY);
}
/*
@@ -136,7 +92,7 @@ int linux_setlease(int fd, int leasetype)
ret = fcntl(fd, F_SETLEASE, leasetype);
if (ret == -1 && errno == EACCES) {
- set_capability(CAP_LEASE);
+ set_effective_capability(LEASE_CAPABILITY);
ret = fcntl(fd, F_SETLEASE, leasetype);
}

View File

@ -1,5 +1,5 @@
%define main_release 11
%define samba_version 3.2.0pre3
%define main_release 13
%define samba_version 3.2.0rc1
%define tdb_version 1.1.1
%define talloc_version 1.2.0
@ -7,13 +7,13 @@ Summary: The Samba Suite of programs
Name: samba
Epoch: 0
Version: 3.2.0
Release: 1.pre3.%{main_release}%{?dist}
Release: 1.rc1.%{main_release}%{?dist}
License: GPLv3+ and LGPLv3+
Group: System Environment/Daemons
URL: http://www.samba.org/
#TAG: change for non-pre
Source: http://download.samba.org/samba/ftp/pre/%{name}-%{version}pre3.tar.gz
Source: http://download.samba.org/samba/ftp/rc/%{name}-%{version}rc1.tar.gz
#Source: http://www.samba.org/samba/ftp/samba/%{name}-%{version}.tar.gz
# Red Hat specific replacement-files
@ -46,9 +46,7 @@ Patch107: samba-3.2.0pre1-grouppwd.patch
Patch110: samba-3.0.21pre1-smbspool.patch
Patch111: samba-3.0.13-smbclient.patch
Patch200: samba-3.0.25rc1-inotifiy.patch
Patch207: samba-3.2.0pre2-roreloc.diff
Patch208: samba-3.2.0pre3-smbclient.diff
Patch209: samba-3.2.0pre3-join.diff
Patch220: samba-3.2.0rc1-capget.diff
Requires(pre): samba-common = %{epoch}:%{version}-%{release}
Requires: pam >= 0:0.64
@ -252,12 +250,10 @@ cp %{SOURCE11} packaging/Fedora/
#%patch104 -p1 -b .nmbd-netbiosname # FIXME: does not apply
%patch107 -p1 -b .grouppwd
#%patch108 -p1 -b .non-ascii-domain
%patch110 -p1 -b .smbspool
#%patch110 -p1 -b .smbspool # FIXME: does not apply
#%patch111 -p1 -b .smbclient # FIXME: does not apply
#%patch200 -p0 -b .inotify # FIXME: does not compile
%patch207 -p1 -b .roreloc
%patch208 -p1 -b .smbclient
%patch209 -p1 -b .join
%patch220 -p1 -b .capget
mv source/VERSION source/VERSION.orig
sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&\"%{release}\"/' < source/VERSION.orig > source/VERSION
@ -434,9 +430,9 @@ install -m 644 source/lib/talloc/talloc.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/t
ln -s libtalloc.so.1 $RPM_BUILD_ROOT%{_libdir}/libtalloc.so
rm -f $RPM_BUILD_ROOT%{_libdir}/samba/libtdb.so $RPM_BUILD_ROOT%{_libdir}/samba/libtdb.a || true
install -m 755 source/bin/libtdb.so $RPM_BUILD_ROOT%{_libdir}/libtdb.so.0
install -m 755 source/bin/libtdb.so $RPM_BUILD_ROOT%{_libdir}/libtdb.so.1
install -m 644 source/lib/tdb/tdb.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/tdb.pc
ln -s libtdb.so.0 $RPM_BUILD_ROOT%{_libdir}/libtdb.so
ln -s libtdb.so.1 $RPM_BUILD_ROOT%{_libdir}/libtdb.so
rm -f $RPM_BUILD_ROOT%{_libdir}/samba/libwbclient.so $RPM_BUILD_ROOT%{_libdir}/samba/libwbclient.a || true
install -m 755 source/bin/libwbclient.so $RPM_BUILD_ROOT%{_libdir}/libwbclient.so.0
@ -852,6 +848,13 @@ exit 0
%{_datadir}/pixmaps/samba/logo-small.png
%changelog
* Fri May 23 2008 Guenther Deschner <gdeschner@redhat.com> - 3.2.0-1.pre3.13
- Update to 3.2.0rc1
* Wed May 21 2008 Simo Sorce <ssorce@redhat.com> - 3.2.0-1.pre3.12
- impossit made iimpossible to print against Vista and XP SP3 as servers
- resolves: #439154
* Thu May 15 2008 Guenther Deschner <gdeschner@redhat.com> - 3.2.0-1.pre3.11
- Add "net ads join createcomputer=ou1/ou2/ou3" fix (BZO #5465)

View File

@ -1 +1 @@
b8d013bdb8f65f494778ffcb50cf0215 samba-3.2.0pre3.tar.gz
df46b81d4921136af3aaade65c054d31 samba-3.2.0rc1.tar.gz