diff options
author | Jeremy Allison <jra@samba.org> | 1998-09-03 18:40:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-09-03 18:40:31 +0000 |
commit | 7bb86c1b132bce31a006ea9768a54db7a45fe1a5 (patch) | |
tree | 1802e8e2741345e91187fc4b149016af75990971 /source3/passdb | |
parent | 4acd373e5bbd615141ceb5fb3c4a588a5b4581d7 (diff) | |
download | samba-7bb86c1b132bce31a006ea9768a54db7a45fe1a5.tar.gz samba-7bb86c1b132bce31a006ea9768a54db7a45fe1a5.tar.bz2 samba-7bb86c1b132bce31a006ea9768a54db7a45fe1a5.zip |
Ok - this is the 64 bit widening check in. It changes the configure
to check for stat64 and friends, and then changes much of Samba
to use the data type SMB_OFF_T for file size information.
stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide
the 64 bit calls if needed.
Note that this still does not expose 64 bit functionality to the
client, as the changes to the reply_xxx smb's are not yet done.
This code change should make these changes possible.
Still to do before full 64 bit-ness to the client:
fcntl lock code.
statfs code
widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T
types being in place).
Let me know if wierd things happen after this check-in and I'll
fix them :-).
Jeremy.
(This used to be commit 14500936c321d15995c963766aac67bf1f4e3824)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/passdb.c | 4 | ||||
-rw-r--r-- | source3/passdb/smbpass.c | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index e58d0d5b00..5e476e0227 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -930,7 +930,7 @@ BOOL pdb_generate_machine_sid(void) * Check if the file contains data. */ - if(fstat( fd, &st) < 0) { + if(sys_fstat( fd, &st) < 0) { DEBUG(0,("generate_machine_sid: unable to stat file %s. Error was %s\n", sid_file, strerror(errno) )); close(fd); @@ -1002,7 +1002,7 @@ BOOL pdb_generate_machine_sid(void) * use their data. */ - if(fstat( fd, &st) < 0) { + if(sys_fstat( fd, &st) < 0) { DEBUG(0,("generate_machine_sid: unable to stat file %s. Error was %s\n", sid_file, strerror(errno) )); close(fd); diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c index 980c54adf1..f758b7bbc4 100644 --- a/source3/passdb/smbpass.c +++ b/source3/passdb/smbpass.c @@ -434,7 +434,7 @@ static BOOL add_smbfilepwd_entry(struct smb_passwd *newpwd) int fd; int new_entry_length; char *new_entry; - long offpos; + SMB_OFF_T offpos; char *p; /* Open the smbpassword file - for update. */ @@ -466,8 +466,8 @@ static BOOL add_smbfilepwd_entry(struct smb_passwd *newpwd) */ fd = fileno(fp); - if((offpos = lseek(fd, 0, SEEK_END)) == -1) { - DEBUG(0, ("add_smbfilepwd_entry(lseek): Failed to add entry for user %s to file %s. \ + if((offpos = sys_lseek(fd, 0, SEEK_END)) == -1) { + DEBUG(0, ("add_smbfilepwd_entry(sys_lseek): Failed to add entry for user %s to file %s. \ Error was %s\n", newpwd->smb_name, pfile, strerror(errno))); endsmbfilepwent(fp); return False; @@ -531,7 +531,7 @@ Error was %s\n", newpwd->smb_name, pfile, strerror(errno))); Error was %s\n", wr_len, newpwd->smb_name, pfile, strerror(errno))); /* Remove the entry we just wrote. */ - if(ftruncate(fd, offpos) == -1) { + if(sys_ftruncate(fd, offpos) == -1) { DEBUG(0, ("add_smbfilepwd_entry: ERROR failed to ftruncate file %s. \ Error was %s. Password file may be corrupt ! Please examine by hand !\n", newpwd->smb_name, strerror(errno))); @@ -572,7 +572,7 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override) BOOL found_entry = False; BOOL got_pass_last_set_time = False; - long pwd_seekpos = 0; + SMB_OFF_T pwd_seekpos = 0; int i; int wr_len; @@ -609,7 +609,7 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override) * Scan the file, a line at a time and check if the name matches. */ while (!feof(fp)) { - pwd_seekpos = ftell(fp); + pwd_seekpos = (SMB_OFF_T)ftell(fp); linebuf[0] = '\0'; @@ -818,7 +818,7 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override) fd = fileno(fp); - if (lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) { + if (sys_lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) { DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile)); pw_file_unlock(lockfd,&pw_file_lock_depth); fclose(fp); |