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/modules/vfs_default.c

    r745 r751  
    10451045
    10461046#ifdef HAVE_KERNEL_OPLOCKS_LINUX
    1047         /* first set the signal handler */
    1048         if(linux_set_lease_sighandler(fsp->fh->fd) == -1) {
    1049                 return -1;
    1050         }
    1051 
    10521047        result = linux_setlease(fsp->fh->fd, leasetype);
    10531048#else
     
    11831178{
    11841179        SMB_STRUCT_STAT sbuf;
    1185         unsigned int num_streams = 0;
    1186         struct stream_struct *streams = NULL;
     1180        struct stream_struct *tmp_streams = NULL;
    11871181        int ret;
    11881182
     
    12191213        }
    12201214
    1221         streams = talloc(mem_ctx, struct stream_struct);
    1222 
    1223         if (streams == NULL) {
     1215        tmp_streams = talloc_realloc(mem_ctx, *pstreams, struct stream_struct,
     1216                                        (*pnum_streams) + 1);
     1217        if (tmp_streams == NULL) {
    12241218                return NT_STATUS_NO_MEMORY;
    12251219        }
    1226 
    1227         streams->size = sbuf.st_ex_size;
    1228         streams->alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf);
    1229 
    1230         streams->name = talloc_strdup(streams, "::$DATA");
    1231         if (streams->name == NULL) {
    1232                 TALLOC_FREE(streams);
     1220        tmp_streams[*pnum_streams].name = talloc_strdup(tmp_streams, "::$DATA");
     1221        if (tmp_streams[*pnum_streams].name == NULL) {
    12331222                return NT_STATUS_NO_MEMORY;
    12341223        }
    1235 
    1236         num_streams = 1;
     1224        tmp_streams[*pnum_streams].size = sbuf.st_ex_size;
     1225        tmp_streams[*pnum_streams].alloc_size = SMB_VFS_GET_ALLOC_SIZE(handle->conn, fsp, &sbuf);
     1226
     1227        *pnum_streams += 1;
     1228        *pstreams = tmp_streams;
    12371229 done:
    1238         *pnum_streams = num_streams;
    1239         *pstreams = streams;
    12401230        return NT_STATUS_OK;
    12411231}
Note: See TracChangeset for help on using the changeset viewer.