diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-08 15:43:11 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-08 15:43:11 +0100 |
commit | bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7 (patch) | |
tree | 4edbacab40c67bb5d9d6bebe66a22949349cbf9a /source3/locking | |
parent | 8dbeca6e9d06d573adebe8d9c5114b24d8782e43 (diff) | |
parent | 62c91987d902d4dfe27023ff2ec2fb73e602105b (diff) | |
download | samba-bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7.tar.gz samba-bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7.tar.bz2 samba-bfab6ab14bd2ba69fde8bbe32f56f308010c8ea7.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit ea36c3add588061cf338deabb2d8952f2213a8bd)
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); } } |