Ignore:
Timestamp:
Mar 12, 2008, 9:08:18 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to 3.0.28a

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/smbd/dosmode.c

    r57 r124  
    453453
    454454        DEBUG(10,("file_set_dosmode: setting dos mode 0x%x on file %s\n", dosmode, fname));
    455         if (!st || (st && !VALID_STAT(*st))) {
     455
     456        if (st == NULL) {
     457                SET_STAT_INVALID(st1);
    456458                st = &st1;
     459        }
     460
     461        if (!VALID_STAT(*st)) {
    457462                if (SMB_VFS_STAT(conn,fname,st))
    458463                        return(-1);
    459464        }
     465
     466        unixmode = st->st_mode;
    460467
    461468        get_acl_group_bits(conn, fname, &st->st_mode);
     
    466473                dosmode &= ~aDIR;
    467474
    468         if (dos_mode(conn,fname,st) == dosmode)
     475        if (dos_mode(conn,fname,st) == dosmode) {
     476                st->st_mode = unixmode;
    469477                return(0);
     478        }
    470479
    471480        /* Store the DOS attributes in an EA by preference. */
    472481        if (set_ea_dos_attribute(conn, fname, st, dosmode)) {
     482                st->st_mode = unixmode;
    473483                return 0;
    474484        }
     
    509519                notify_fname(conn, NOTIFY_ACTION_MODIFIED,
    510520                             FILE_NOTIFY_CHANGE_ATTRIBUTES, fname);
     521                st->st_mode = unixmode;
    511522                return 0;
    512523        }
     
    541552                notify_fname(conn, NOTIFY_ACTION_MODIFIED,
    542553                             FILE_NOTIFY_CHANGE_ATTRIBUTES, fname);
     554                if (ret == 0) {
     555                        st->st_mode = unixmode;
     556                }
    543557        }
    544558
Note: See TracChangeset for help on using the changeset viewer.