Merge branch 'master' of ssh://git.samba.org/data/git/samba into wmi
authorJelmer Vernooij <jelmer@samba.org>
Tue, 16 Sep 2008 05:54:49 +0000 (07:54 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 16 Sep 2008 05:54:49 +0000 (07:54 +0200)
.gitignore
source3/client/client.c
source3/configure.in
source3/libnet/libnet_samsync_keytab.c
source3/smbd/aio.c
source3/smbd/open.c
source3/smbd/quotas.c
source3/torture/cmd_vfs.c
source3/utils/sharesec.c
source3/winbindd/idmap_ad.c

index 0b94be52a022f6b6dac10f7847fdcd6661737b34..b87f786678e7ac0496a7975063141b2985213415 100644 (file)
@@ -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
index 1c05c4035d1ae00dc211b6cf34fbc7e9c7766707..7af7d301084018a0438f03fe4bac03dddb8c8321 100644 (file)
@@ -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::");
index 248c39ac4c1da1299b202e5bcf2079f43deca7a2..d9766e49d034525be11ec286c1c1cdfb2d7f55a3 100644 (file)
@@ -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>
index f284f08ad986be3110d906db23bf33dcaae99b7f..9e666ced3232032908689aea3c09e5142f093a78 100644 (file)
@@ -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);
index 74275368bdd2c2f119ca022a58f17f5ee72a81f5..c3fd0a2bc0e3f1c3a448b72c4f0738401ca1f426 100644 (file)
 
 /* 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 "
index 8b32907a4b6e7e80362b00c60d4ff007c3a00f42..71191475b365572ce212b106babc8bc07653f772 100644 (file)
@@ -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;
                        }
index f47e89bd220348a7516e0aa68fbec53122a0ea73..b6f748da33b784b9fb4f7c0cf668c0db8ef8ee8a 100644 (file)
@@ -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) {
index 28400887ef720f4331a7f738ea419e4b7826cfa0..dddd5bef29f4b7eeef7380888ceeca17cd90fae6 100644 (file)
@@ -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;
        }
index 9409690c8be223291d780861dbea8d90aaccdbdb..46f9ecdc7df4578935f8805e7d5d2bf795e69401 100644 (file)
@@ -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;
index 9fefb1bba70d125fd91671ab3ecc793fca232d91..d7c87497a925827ee0b88e1ef8ab714dd4a0f7e2 100644 (file)
@@ -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;
 }
 
 /************************************************************************