Bug 3270 - tdb use of tdb_off is not 64bit clean
Summary: tdb use of tdb_off is not 64bit clean
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.20b
Hardware: x86 All
: P3 major
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-18 02:48 UTC by Kristian Van Der Vliet
Modified: 2019-06-11 21:24 UTC (History)
1 user (show)

See Also:


Attachments
Cast tdb_off to off_t for 64bit cleanlyness (1.91 KB, patch)
2005-11-18 02:51 UTC, Kristian Van Der Vliet
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kristian Van Der Vliet 2005-11-18 02:48:56 UTC
The tdb functions use an internal type to represent file offsets; tdb_off.  This is always defined as a unsigned int (u32) type.  On certain OSes where off_t is 64bit (Syllable for example), when a tdb_off type is passed directly to pwrite(), pread() or lseek() where off_t is expected the seek may fail.

The obvious fix is to cast tdb_off to off_t whenever it is passed to an external function expecting off_t
Comment 1 Kristian Van Der Vliet 2005-11-18 02:51:47 UTC
Created attachment 1579 [details]
Cast tdb_off to off_t for 64bit cleanlyness
Comment 2 Andrew Bartlett 2019-06-11 12:38:31 UTC
Fixed by fbdcf2663b56007a438ac4f0d8d82436b1bfe688 in Samba 3.0.24 when tdb changed to use libreplace wrappers for pread() and pwrite() and so never calling lseek() directly.