Ignore:
Timestamp:
Jun 17, 2009, 2:19:52 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 branch to 3.3.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/smbd/file_access.c

    r222 r274  
    9393
    9494#ifdef S_ISVTX
    95         /* sticky bit means delete only by owner or root. */
     95        /* sticky bit means delete only by owner of file or by root or
     96         * by owner of directory. */
    9697        if (sbuf.st_mode & S_ISVTX) {
    9798                SMB_STRUCT_STAT sbuf_file;
     
    102103                                return True;
    103104                        }
     105                        DEBUG(10,("can_delete_file_in_directory: can't "
     106                                "stat file %s (%s)",
     107                                fname, strerror(errno) ));
    104108                        return False;
    105109                }
     
    108112                 * for bug #3348. Don't assume owning sticky bit
    109113                 * directory means write access allowed.
     114                 * Fail to delete if we're not the owner of the file,
     115                 * or the owner of the directory as we have no possible
     116                 * chance of deleting. Otherwise, go on and check the ACL.
    110117                 */
    111                 if (conn->server_info->utok.uid != sbuf_file.st_uid) {
     118                if ((conn->server_info->utok.uid != sbuf.st_uid) &&
     119                                (conn->server_info->utok.uid != sbuf_file.st_uid)) {
     120                        DEBUG(10,("can_delete_file_in_directory: not "
     121                                "owner of file %s or directory %s",
     122                                fname, dname));
    112123                        return False;
    113124                }
Note: See TracChangeset for help on using the changeset viewer.