Ignore:
Timestamp:
May 15, 2014, 10:28:32 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: create file with the right permission

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/tdb/common/open.c

    r864 r865  
    684684        // name could be null, so handle it
    685685        if (name == NULL)
    686                 return -1;
     686                return 0;
    687687
    688688        char activeLockName[_MAX_PATH];
    689689        sprintf(activeLockName, "%s_AL", name);
    690         tdb->hActiveLock = open(activeLockName, tdb->open_flags | O_CREAT, mode);
     690        tdb->hActiveLock = open(activeLockName, tdb->open_flags | O_CREAT, 0777);
    691691        if (tdb->hActiveLock == -1) {
    692692                TDB_LOG((tdb, TDB_DEBUG_ERROR, "os2_crtActiveLock: cannot create activeLock %s called from %s %s\n",
     
    696696        }
    697697
     698        // we try to truncate the db when called from tdb_open_ex
     699        // but if it's not working it's ok as well
    698700        if (truncate) {
    699701                if (lseek(tdb->hActiveLock, 0, SEEK_SET) == -1)
    700                         return -1;
     702                        return 0;
    701703
    702704                if (ftruncate(tdb->hActiveLock, 0) == -1)
    703                         return -1;
     705                        return 0;
    704706
    705707                tdb_write_all(tdb->hActiveLock, "used for active lock\n", 21);
Note: See TracChangeset for help on using the changeset viewer.