From ac9b687cc2496409e1c8d86393812faf94ec7550 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Sep 1998 19:16:12 +0000 Subject: configure configure.in: Added tests for fseek64 and ftell64. config.h.in: Added fseek64 and ftell64. includes.h: Added definition of SMB_BIG_INTEGER. smb.h: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. access.c: Tidyup of dbug statement. system.c: Added sys_fseek and sys_ftell. Changed mode calls to use mode_t. asyncdns.c: Tidyup of comment. loadparm.c: Tidyup of set_default_server_announce_type() function definition. ldap.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. nispass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpassfile.c: Use sys_fseek(). chgpasswd.c: Tidyup of debug statement. dosmode.c: Changed mode calls to use mode_t. ipc.c: Removal of dead code. nttrans.c: Changed mode calls to use mode_t. open.c: Changed mode calls to use mode_t. pipes.c: Removal of dead code. reply.c: Removal of dead code. trans2.c: Removal of dead code. Changed mode calls to use mode_t. Jeremy. (This used to be commit c381d32e3dc23fe887408016cae821aceb30da2c) --- source3/lib/access.c | 2 +- source3/lib/system.c | 32 +++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/access.c b/source3/lib/access.c index 2e1eb8df55..31f9db4e55 100644 --- a/source3/lib/access.c +++ b/source3/lib/access.c @@ -31,7 +31,7 @@ static int masked_match(char *tok, char *slash, char *s) *slash = '/'; if (net == INADDR_NONE || (mask = interpret_addr(slash + 1)) == INADDR_NONE) { - DEBUG(0,("access: bad net/mask access control: %s", tok)); + DEBUG(0,("access: bad net/mask access control: %s\n", tok)); return (False); } return ((addr & mask) == net); diff --git a/source3/lib/system.c b/source3/lib/system.c index 215bfd0c1d..c3d97e0350 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -204,6 +204,32 @@ SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence) #endif } +/******************************************************************* + An fseek() wrapper that will deal with 64 bit filesizes. +********************************************************************/ + +int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence) +{ +#if defined(LARGE_SMB_OFF_T) && defined(HAVE_FSEEK64) + return fseek64(fp, offset, whence); +#else + return fseek(fp, offset, whence); +#endif +} + +/******************************************************************* + An ftell() wrapper that will deal with 64 bit filesizes. +********************************************************************/ + +SMB_OFF_T sys_ftell(FILE *fp) +{ +#if defined(LARGE_SMB_OFF_T) && defined(HAVE_FTELL64) + return (SMB_OFF_T)ftell64(fp); +#else + return (SMB_OFF_T)ftell(fp); +#endif +} + /******************************************************************* just a unlink wrapper that calls dos_to_unix. ********************************************************************/ @@ -216,7 +242,7 @@ int dos_unlink(char *fname) /******************************************************************* a simple open() wrapper that calls dos_to_unix. ********************************************************************/ -int dos_open(char *fname,int flags,int mode) +int dos_open(char *fname,int flags,mode_t mode) { return(open(dos_to_unix(fname,False),flags,mode)); } @@ -261,7 +287,7 @@ int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf) /******************************************************************* mkdir() gets a wrapper that calls dos_to_unix. ********************************************************************/ -int dos_mkdir(char *dname,int mode) +int dos_mkdir(char *dname,mode_t mode) { return(mkdir(dos_to_unix(dname,False),mode)); } @@ -413,7 +439,7 @@ int dos_rename(char *from, char *to) /******************************************************************* for chmod - call dos_to_unix. ********************************************************************/ -int dos_chmod(char *fname,int mode) +int dos_chmod(char *fname,mode_t mode) { return(chmod(dos_to_unix(fname,False),mode)); } -- cgit