r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
[vlendec/samba-autobuild/.git] / source3 / smbd / posix_acls.c
index 40cb6698a02fe34eab60ef04b50a1069f8e58388..73744cf26e77b0e7e66416b2863db07ca2e5fa8a 100644 (file)
@@ -1483,7 +1483,7 @@ Deny entry after Allow entry. Failing to set on file %s.\n", fsp->fsp_name ));
                 * Only add to the file ACL if not inherit only.
                 */
 
-               if (!(psa->flags & SEC_ACE_FLAG_INHERIT_ONLY)) {
+               if (current_ace && !(psa->flags & SEC_ACE_FLAG_INHERIT_ONLY)) {
                        DLIST_ADD_END(file_ace, current_ace, tmp_ace);
 
                        /*
@@ -3043,8 +3043,7 @@ static int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_
                return -1;
        }
 
-       fsp = open_file_fchmod(conn,fname,&st);
-       if (!fsp) {
+       if (!NT_STATUS_IS_OK(open_file_fchmod(conn,fname,&st,&fsp))) {
                return -1;
        }
 
@@ -4236,12 +4235,19 @@ SEC_DESC* get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname)
        pstring filename;
        
        ZERO_STRUCT( conn );
-       conn.service = -1;
        
        if ( !(conn.mem_ctx = talloc_init( "novfs_get_nt_acl" )) ) {
                DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n"));
                return NULL;
        }
+
+       if (!(conn.params = TALLOC_P(conn.mem_ctx, struct share_params))) {
+               DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n"));
+               TALLOC_FREE(conn.mem_ctx);
+               return NULL;
+       }
+
+       conn.params->service = -1;
        
        pstrcpy( path, "/" );
        set_conn_connectpath(&conn, path);