diff options
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 24 | ||||
-rw-r--r-- | source3/locking/posix.c | 8 |
2 files changed, 12 insertions, 20 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 270c6d2261..2ec8cd2938 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -585,22 +585,14 @@ static bool parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) } /* Save off the associated service path and filename. */ - lck->servicepath = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) + - (lck->num_share_modes * - sizeof(struct share_mode_entry)) + - data->u.s.delete_token_size ); - if (lck->servicepath == NULL) { - smb_panic("parse_share_modes: talloc_strdup failed"); - } - - lck->filename = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) + - (lck->num_share_modes * - sizeof(struct share_mode_entry)) + - data->u.s.delete_token_size + - strlen(lck->servicepath) + 1 ); - if (lck->filename == NULL) { - smb_panic("parse_share_modes: talloc_strdup failed"); - } + lck->servicepath = (const char *)dbuf.dptr + sizeof(*data) + + (lck->num_share_modes * sizeof(struct share_mode_entry)) + + data->u.s.delete_token_size; + + lck->filename = (const char *)dbuf.dptr + sizeof(*data) + + (lck->num_share_modes * sizeof(struct share_mode_entry)) + + data->u.s.delete_token_size + + strlen(lck->servicepath) + 1; /* * Ensure that each entry has a real process attached. diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 207ee57ce1..1b88c472b0 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -188,7 +188,7 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OF DEBUG(8,("posix_fcntl_lock %d %d %.0f %.0f %d\n",fsp->fh->fd,op,(double)offset,(double)count,type)); - ret = SMB_VFS_LOCK(fsp,fsp->fh->fd,op,offset,count,type); + ret = SMB_VFS_LOCK(fsp, op, offset, count, type); if (!ret && ((errno == EFBIG) || (errno == ENOLCK) || (errno == EINVAL))) { @@ -212,7 +212,7 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, SMB_OF DEBUG(0,("Count greater than 31 bits - retrying with 31 bit truncated length.\n")); errno = 0; count &= 0x7fffffff; - ret = SMB_VFS_LOCK(fsp,fsp->fh->fd,op,offset,count,type); + ret = SMB_VFS_LOCK(fsp, op, offset, count, type); } } @@ -233,7 +233,7 @@ static bool posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T DEBUG(8,("posix_fcntl_getlock %d %.0f %.0f %d\n", fsp->fh->fd,(double)*poffset,(double)*pcount,*ptype)); - ret = SMB_VFS_GETLOCK(fsp,fsp->fh->fd,poffset,pcount,ptype,&pid); + ret = SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, &pid); if (!ret && ((errno == EFBIG) || (errno == ENOLCK) || (errno == EINVAL))) { @@ -257,7 +257,7 @@ static bool posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T DEBUG(0,("Count greater than 31 bits - retrying with 31 bit truncated length.\n")); errno = 0; *pcount &= 0x7fffffff; - ret = SMB_VFS_GETLOCK(fsp,fsp->fh->fd,poffset,pcount,ptype,&pid); + ret = SMB_VFS_GETLOCK(fsp,poffset,pcount,ptype,&pid); } } |