summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-16 07:54:49 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-16 07:54:49 +0200
commitec1c854f2175823bd1ad39c2e272d1b3fab80bf1 (patch)
treebb2946e678ce5f5e761f11299abca0179d65913a
parent0016bc40918fb6de71c670b3dd93934690dcee4f (diff)
parent4dfa72423ef96b411e797eb1b5b4cb3ebd8e3d32 (diff)
downloadsamba-ec1c854f2175823bd1ad39c2e272d1b3fab80bf1.tar.gz
samba-ec1c854f2175823bd1ad39c2e272d1b3fab80bf1.tar.bz2
samba-ec1c854f2175823bd1ad39c2e272d1b3fab80bf1.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into wmi
-rw-r--r--.gitignore3
-rw-r--r--source3/client/client.c4
-rw-r--r--source3/configure.in15
-rw-r--r--source3/libnet/libnet_samsync_keytab.c1
-rw-r--r--source3/smbd/aio.c17
-rw-r--r--source3/smbd/open.c10
-rw-r--r--source3/smbd/quotas.c4
-rw-r--r--source3/torture/cmd_vfs.c4
-rw-r--r--source3/utils/sharesec.c2
-rw-r--r--source3/winbindd/idmap_ad.c81
10 files changed, 118 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore
index 0b94be52a0..b87f786678 100644
--- a/.gitignore
+++ b/.gitignore
@@ -305,3 +305,6 @@ source4/ntvfs/posix/vfs_acl_proto.h
*.swp
tags
*.x
+packaging/RHEL-CTDB/samba.spec
+packaging/RHEL/samba.spec
+packaging/RHEL/makerpms.sh
diff --git a/source3/client/client.c b/source3/client/client.c
index 1c05c4035d..7af7d30108 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -3038,7 +3038,7 @@ static int cmd_getfacl(void)
break;
case SMB_POSIX_ACL_GROUP:
uorg = IVAL(retbuf,SMB_POSIX_ACL_HEADER_SIZE+(i*SMB_POSIX_ACL_ENTRY_SIZE)+2);
- d_printf("group:%u", uorg);
+ d_printf("group:%u:", uorg);
break;
case SMB_POSIX_ACL_MASK:
d_printf("mask::");
@@ -3075,7 +3075,7 @@ static int cmd_getfacl(void)
break;
case SMB_POSIX_ACL_GROUP:
uorg = IVAL(retbuf,SMB_POSIX_ACL_HEADER_SIZE+((i+num_file_acls)*SMB_POSIX_ACL_ENTRY_SIZE)+2);
- d_printf("default:group:%u", uorg);
+ d_printf("default:group:%u:", uorg);
break;
case SMB_POSIX_ACL_MASK:
d_printf("default:mask::");
diff --git a/source3/configure.in b/source3/configure.in
index 248c39ac4c..d9766e49d0 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -876,6 +876,21 @@ if test x"$samba_cv_sig_atomic_t" = x"yes"; then
AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
fi
+AC_CACHE_CHECK([for struct sigevent type],samba_cv_struct_sigevent, [
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>],[struct sigevent s;],
+ samba_cv_struct_sigevent=yes,samba_cv_struct_sigevent=no)])
+if test x"$samba_cv_struct_sigevent" = x"yes"; then
+ AC_DEFINE(HAVE_STRUCT_SIGEVENT,1,[Whether we have the struct sigevent])
+ AC_CHECK_MEMBERS([struct sigevent.sigev_value.sival_ptr,struct sigevent.sigev_value.sigval_ptr], , ,
+ [#include <signal.h>])
+fi
+
AC_CACHE_CHECK([for struct timespec type],samba_cv_struct_timespec, [
AC_TRY_COMPILE([
#include <sys/types.h>
diff --git a/source3/libnet/libnet_samsync_keytab.c b/source3/libnet/libnet_samsync_keytab.c
index f284f08ad9..9e666ced32 100644
--- a/source3/libnet/libnet_samsync_keytab.c
+++ b/source3/libnet/libnet_samsync_keytab.c
@@ -93,6 +93,7 @@ static NTSTATUS fetch_sam_entry_keytab(TALLOC_CTX *mem_ctx,
ctx->dns_domain_name);
entry.password = data_blob_talloc(mem_ctx, nt_passwd, 16);
entry.kvno = ads_get_kvno(ctx->ads, entry.name);
+ entry.enctype = ENCTYPE_NULL;
NT_STATUS_HAVE_NO_MEMORY(entry.name);
NT_STATUS_HAVE_NO_MEMORY(entry.principal);
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index 74275368bd..c3fd0a2bc0 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -24,7 +24,17 @@
/* The signal we'll use to signify aio done. */
#ifndef RT_SIGNAL_AIO
-#define RT_SIGNAL_AIO (SIGRTMIN+3)
+#ifndef SIGRTMIN
+#define SIGRTMIN NSIG
+#endif
+#define RT_SIGNAL_AIO (SIGRTMIN+3)
+#endif
+
+#ifndef HAVE_STRUCT_SIGEVENT_SIGEV_VALUE_SIVAL_PTR
+#ifdef HAVE_STRUCT_SIGEVENT_SIGEV_VALUE_SIGVAL_PTR
+#define sival_int sigval_int
+#define sival_ptr sigval_ptr
+#endif
#endif
/****************************************************************************
@@ -581,6 +591,11 @@ static bool handle_aio_completed(struct aio_extra *aio_ex, int *perr)
{
int err;
+ if(!aio_ex) {
+ DEBUG(3, ("handle_aio_completed: Non-existing aio_ex passed\n"));
+ return false;
+ }
+
/* Ensure the operation has really completed. */
if (SMB_VFS_AIO_ERROR(aio_ex->fsp, &aio_ex->acb) == EINPROGRESS) {
DEBUG(10,( "handle_aio_completed: operation mid %u still in "
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8b32907a4b..71191475b3 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1852,7 +1852,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
/* Handle strange delete on close create semantics. */
if ((create_options & FILE_DELETE_ON_CLOSE)
- && (is_ntfs_stream_name(fname)
+ && (((conn->fs_capabilities & FILE_NAMED_STREAMS)
+ && is_ntfs_stream_name(fname))
|| can_set_initial_delete_on_close(lck))) {
status = can_set_delete_on_close(fsp, True, new_dos_attributes);
@@ -2116,7 +2117,9 @@ NTSTATUS open_directory(connection_struct *conn,
(unsigned int)create_disposition,
(unsigned int)file_attributes));
- if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS) && is_ntfs_stream_name(fname)) {
+ if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS) &&
+ (conn->fs_capabilities & FILE_NAMED_STREAMS) &&
+ is_ntfs_stream_name(fname)) {
DEBUG(2, ("open_directory: %s is a stream name!\n", fname));
return NT_STATUS_NOT_A_DIRECTORY;
}
@@ -2907,7 +2910,8 @@ NTSTATUS create_file(connection_struct *conn,
* Check to see if this is a mac fork of some kind.
*/
- if (is_ntfs_stream_name(fname)) {
+ if ((conn->fs_capabilities & FILE_NAMED_STREAMS) &&
+ is_ntfs_stream_name(fname)) {
status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
goto fail;
}
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index f47e89bd22..b6f748da33 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -544,7 +544,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
*bsize = gqr.getquota_rslt_u.gqr_rquota.rq_bsize;
*dsize = D.dqb_bsoftlimit;
- if (D.dqb_curblocks == D.dqb_curblocks == 1)
+ if (D.dqb_curblocks == 1)
*bsize = 512;
if (D.dqb_curblocks > D.dqb_bsoftlimit) {
@@ -1104,7 +1104,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
*bsize = gqr.getquota_rslt_u.gqr_rquota.rq_bsize;
*dsize = D.dqb_bsoftlimit;
- if (D.dqb_curblocks == D.dqb_curblocks == 1)
+ if (D.dqb_curblocks == 1)
*bsize = DEV_BSIZE;
if (D.dqb_curblocks > D.dqb_bsoftlimit) {
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 28400887ef..dddd5bef29 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -272,7 +272,7 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
flagstr++;
}
if ((flags & O_CREAT) && argc == 4) {
- if (sscanf(argv[3], "%o", &mode) == 0) {
+ if (sscanf(argv[3], "%ho", (unsigned short *)&mode) == 0) {
printf("open: error=-1 (invalid mode!)\n");
return NT_STATUS_UNSUCCESSFUL;
}
@@ -989,7 +989,7 @@ static NTSTATUS cmd_mknod(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
return NT_STATUS_OK;
}
- if (sscanf(argv[2], "%o", &mode) == 0) {
+ if (sscanf(argv[2], "%ho", (unsigned short *)&mode) == 0) {
printf("open: error=-1 (invalid mode!)\n");
return NT_STATUS_UNSUCCESSFUL;
}
diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c
index 9409690c8b..46f9ecdc7d 100644
--- a/source3/utils/sharesec.c
+++ b/source3/utils/sharesec.c
@@ -401,7 +401,7 @@ static void sort_acl(SEC_ACL *the_acl)
static int change_share_sec(TALLOC_CTX *mem_ctx, const char *sharename, char *the_acl, enum acl_mode mode)
{
- SEC_DESC *sd;
+ SEC_DESC *sd = NULL;
SEC_DESC *old = NULL;
size_t sd_size = 0;
uint32 i, j;
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 9fefb1bba7..d7c87497a9 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -732,6 +732,16 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
uint32 *gid )
{
ADS_STRUCT *ads_internal = NULL;
+ const char *attrs[] = {NULL, /* attr_homedir */
+ NULL, /* attr_shell */
+ NULL, /* attr_gecos */
+ NULL, /* attr_gidnumber */
+ NULL };
+ char *filter = NULL;
+ LDAPMessage *msg_internal = NULL;
+ ADS_STATUS ads_status = ADS_ERROR_NT(NT_STATUS_UNSUCCESSFUL);
+ NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
+ char *sidstr = NULL;
/* Only do query if we are online */
if (idmap_is_offline()) {
@@ -743,22 +753,69 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
ads_internal = ad_idmap_cached_connection();
- if ( !ads_internal || !ad_schema )
+ if ( !ads_internal || !ad_schema ) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
-
- if ( !homedir || !shell || !gecos )
+ }
+
+ if (!sid || !homedir || !shell || !gecos) {
return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ /* See if we can use the ADS connection struct swe were given */
- *homedir = ads_pull_string( ads, ctx, msg, ad_schema->posix_homedir_attr );
- *shell = ads_pull_string( ads, ctx, msg, ad_schema->posix_shell_attr );
- *gecos = ads_pull_string( ads, ctx, msg, ad_schema->posix_gecos_attr );
-
- if ( gid ) {
- if ( !ads_pull_uint32(ads, msg, ad_schema->posix_gidnumber_attr, gid ) )
- *gid = (uint32)-1;
+ if (ads) {
+ *homedir = ads_pull_string( ads, ctx, msg, ad_schema->posix_homedir_attr );
+ *shell = ads_pull_string( ads, ctx, msg, ad_schema->posix_shell_attr );
+ *gecos = ads_pull_string( ads, ctx, msg, ad_schema->posix_gecos_attr );
+
+ if (gid) {
+ if ( !ads_pull_uint32(ads, msg, ad_schema->posix_gidnumber_attr, gid ) )
+ *gid = (uint32)-1;
+ }
+
+ nt_status = NT_STATUS_OK;
+ goto done;
}
-
- return NT_STATUS_OK;
+
+ /* Have to do our own query */
+
+ attrs[0] = ad_schema->posix_homedir_attr;
+ attrs[1] = ad_schema->posix_shell_attr;
+ attrs[2] = ad_schema->posix_gecos_attr;
+ attrs[3] = ad_schema->posix_gidnumber_attr;
+
+ sidstr = sid_binstring(sid);
+ filter = talloc_asprintf(ctx, "(objectSid=%s)", sidstr);
+ SAFE_FREE(sidstr);
+
+ if (!filter) {
+ nt_status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+
+ ads_status = ads_search_retry(ads_internal, &msg_internal, filter, attrs);
+ if (!ADS_ERR_OK(ads_status)) {
+ nt_status = ads_ntstatus(ads_status);
+ goto done;
+ }
+
+ *homedir = ads_pull_string(ads_internal, ctx, msg_internal, ad_schema->posix_homedir_attr);
+ *shell = ads_pull_string(ads_internal, ctx, msg_internal, ad_schema->posix_shell_attr);
+ *gecos = ads_pull_string(ads_internal, ctx, msg_internal, ad_schema->posix_gecos_attr);
+
+ if (gid) {
+ if (!ads_pull_uint32(ads_internal, msg_internal, ad_schema->posix_gidnumber_attr, gid))
+ *gid = (uint32)-1;
+ }
+
+ nt_status = NT_STATUS_OK;
+
+done:
+ if (msg_internal) {
+ ads_msgfree(ads_internal, msg_internal);
+ }
+
+ return nt_status;
}
/************************************************************************