diff options
author | Jeremy Allison <jra@samba.org> | 2001-09-06 22:42:13 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-09-06 22:42:13 +0000 |
commit | 562f054b52c6725f30964ca89ff6a2fba9550cf1 (patch) | |
tree | 607625ccea9944b1b787712ec727b2381065a1c1 /source/smbd/reply.c | |
parent | d52ecdecf33af526e837aafb5da56dc108b23635 (diff) | |
download | samba-562f054b52c6725f30964ca89ff6a2fba9550cf1.tar.gz samba-562f054b52c6725f30964ca89ff6a2fba9550cf1.tar.xz samba-562f054b52c6725f30964ca89ff6a2fba9550cf1.zip |
Fix the 62bit locking onto 32 bit NFS mounts problem generically for HPUX.
Don. please check this out.
Jeremy.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r-- | source/smbd/reply.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 3c13631e634..7d27e4707c8 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -4272,6 +4272,38 @@ SMB_BIG_UINT get_lock_count( char *data, int data_offset, BOOL large_file_format } /**************************************************************************** + Pathetically try and map a 64 bit lock offset into 31 bits. I hate Windows :-). +****************************************************************************/ + +static uint32 map_lock_offset(uint32 high, uint32 low) +{ + unsigned int i; + uint32 mask = 0; + uint32 highcopy = high; + + /* + * Try and find out how many significant bits there are in high. + */ + + for(i = 0; highcopy; i++) + highcopy >>= 1; + + /* + * We use 31 bits not 32 here as POSIX + * lock offsets may not be negative. + */ + + mask = (~0) << (31 - i); + + if(low & mask) + return 0; /* Fail. */ + + high <<= (31 - i); + + return (high|low); +} + +/**************************************************************************** Get a lock offset, dealing with large offset requests. ****************************************************************************/ |