Ignore:
Timestamp:
Nov 29, 2012, 1:59:04 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/smbd/file_access.c

    r745 r751  
    4242        if (get_current_uid(conn) == (uid_t)0) {
    4343                /* I'm sorry sir, I didn't know you were root... */
     44                return true;
     45        }
     46
     47        if (access_mask == DELETE_ACCESS &&
     48                        VALID_STAT(smb_fname->st) &&
     49                        S_ISLNK(smb_fname->st.st_ex_mode)) {
     50                /* We can always delete a symlink. */
    4451                return true;
    4552        }
     
    8188
    8289bool can_delete_file_in_directory(connection_struct *conn,
    83                                   struct smb_filename *smb_fname)
     90                                  const struct smb_filename *smb_fname)
    8491{
    8592        TALLOC_CTX *ctx = talloc_tos();
     
    131138         * by owner of directory. */
    132139        if (smb_fname_parent->st.st_ex_mode & S_ISVTX) {
    133                 if(SMB_VFS_STAT(conn, smb_fname) != 0) {
    134                         if (errno == ENOENT) {
    135                                 /* If the file doesn't already exist then
    136                                  * yes we'll be able to delete it. */
    137                                 ret = true;
    138                                 goto out;
    139                         }
    140                         DEBUG(10,("can_delete_file_in_directory: can't "
    141                                   "stat file %s (%s)",
    142                                   smb_fname_str_dbg(smb_fname),
    143                                   strerror(errno) ));
    144                         ret = false;
     140                if (!VALID_STAT(smb_fname->st)) {
     141                        /* If the file doesn't already exist then
     142                         * yes we'll be able to delete it. */
     143                        ret = true;
    145144                        goto out;
    146145                }
     
    263262                                SECINFO_DACL, &secdesc);
    264263
    265         if (!NT_STATUS_IS_OK(status) || secdesc == NULL) {
     264        if (!NT_STATUS_IS_OK(status) ||
     265                        secdesc == NULL ||
     266                        secdesc->dacl == NULL) {
     267                TALLOC_FREE(secdesc);
    266268                return false;
    267269        }
Note: See TracChangeset for help on using the changeset viewer.