1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

More abstraction of file system data types, to move to a 64

bit file interface for the NT SMB's.

Created a new define, SMB_STRUCT_STAT that currently is
defined to be struct stat - this wil change to a user
defined type containing 64 bit info when the correct
wrappers are written for 64 bit stat(), fstat() and lstat()
calls.

Also changed all sys_xxxx() calls that were previously just
wrappers to the same call prefixed by a dos_to_unix() call
into dos_xxxx() calls. This makes it explicit when a pathname
translation is being done, and when it is not.

Now, all sys_xxx() calls are meant to be wrappers to mask
OS differences, and not silently converting filenames on
the fly.

Jeremy.
This commit is contained in:
Jeremy Allison
-
parent 8bd2cf0eb7
commit 28aa182dbf
32 changed files with 196 additions and 185 deletions

View File

@ -1528,7 +1528,7 @@ static void do_mget(file_info *finfo)
strlower(finfo->name); strlower(finfo->name);
if (!directory_exist(finfo->name,NULL) && if (!directory_exist(finfo->name,NULL) &&
sys_mkdir(finfo->name,0777) != 0) dos_mkdir(finfo->name,0777) != 0)
{ {
DEBUG(0,("failed to create directory %s\n",CNV_LANG(finfo->name))); DEBUG(0,("failed to create directory %s\n",CNV_LANG(finfo->name)));
pstrcpy(cur_dir,saved_curdir); pstrcpy(cur_dir,saved_curdir);
@ -1536,7 +1536,7 @@ static void do_mget(file_info *finfo)
return; return;
} }
if (sys_chdir(finfo->name) != 0) if (dos_chdir(finfo->name) != 0)
{ {
DEBUG(0,("failed to chdir to directory %s\n",CNV_LANG(finfo->name))); DEBUG(0,("failed to chdir to directory %s\n",CNV_LANG(finfo->name)));
pstrcpy(cur_dir,saved_curdir); pstrcpy(cur_dir,saved_curdir);
@ -1998,7 +1998,7 @@ static void cmd_put(char *dum_in, char *dum_out)
dos_clean_name(rname); dos_clean_name(rname);
{ {
struct stat st; SMB_STRUCT_STAT st;
/* allow '-' to represent stdin /* allow '-' to represent stdin
jdblair, 24.jun.98 */ jdblair, 24.jun.98 */
if (!file_exist(lname,&st) && if (!file_exist(lname,&st) &&
@ -2060,7 +2060,7 @@ static void cmd_mput(char *dum_in, char *dum_out)
while (next_token(NULL,p,NULL,sizeof(buf))) while (next_token(NULL,p,NULL,sizeof(buf)))
{ {
struct stat st; SMB_STRUCT_STAT st;
pstring cmd; pstring cmd;
pstring tmpname; pstring tmpname;
FILE *f; FILE *f;
@ -2816,10 +2816,10 @@ static void cmd_newer(char *dum_in, char *dum_out)
{ {
fstring buf; fstring buf;
BOOL ok; BOOL ok;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
ok = next_token(NULL,buf,NULL,sizeof(buf)); ok = next_token(NULL,buf,NULL,sizeof(buf));
if (ok && (sys_stat(buf,&sbuf) == 0)) if (ok && (dos_stat(buf,&sbuf) == 0))
{ {
newer_than = sbuf.st_mtime; newer_than = sbuf.st_mtime;
DEBUG(1,("Getting files newer than %s", DEBUG(1,("Getting files newer than %s",
@ -2923,7 +2923,7 @@ static void cmd_lcd(char *dum_in, char *dum_out)
pstring d; pstring d;
if (next_token(NULL,buf,NULL,sizeof(buf))) if (next_token(NULL,buf,NULL,sizeof(buf)))
sys_chdir(buf); dos_chdir(buf);
DEBUG(2,("the local directory is now %s\n",GetWd(d))); DEBUG(2,("the local directory is now %s\n",GetWd(d)));
} }

View File

@ -440,7 +440,7 @@ Write two zero blocks at end of file
****************************************************************************/ ****************************************************************************/
static void dotareof(int f) static void dotareof(int f)
{ {
struct stat stbuf; SMB_STRUCT_STAT stbuf;
/* Two zero blocks at end of file, write out full buffer */ /* Two zero blocks at end of file, write out full buffer */
(void) dozerobuf(f, TBLOCK); (void) dozerobuf(f, TBLOCK);
@ -2462,10 +2462,10 @@ int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind)
DEBUG(0,("Option N must be followed by valid file name\n")); DEBUG(0,("Option N must be followed by valid file name\n"));
return 0; return 0;
} else { } else {
struct stat stbuf; SMB_STRUCT_STAT stbuf;
extern time_t newer_than; extern time_t newer_than;
if (sys_stat(argv[Optind], &stbuf) == 0) { if (dos_stat(argv[Optind], &stbuf) == 0) {
newer_than = stbuf.st_mtime; newer_than = stbuf.st_mtime;
DEBUG(1,("Getting files newer than %s", DEBUG(1,("Getting files newer than %s",
asctime(LocalTime(&newer_than)))); asctime(LocalTime(&newer_than))));

View File

@ -138,7 +138,7 @@ fullpath(const char *p)
/* Check whether user is allowed to mount on the specified mount point */ /* Check whether user is allowed to mount on the specified mount point */
static int static int
mount_ok(struct stat *st) mount_ok(SMB_STRUCT_STAT *st)
{ {
if (!S_ISDIR(st->st_mode)) if (!S_ISDIR(st->st_mode))
{ {
@ -165,7 +165,7 @@ main(int argc, char *argv[])
int fd, um; int fd, um;
unsigned int flags; unsigned int flags;
struct smb_mount_data data; struct smb_mount_data data;
struct stat st; SMB_STRUCT_STAT st;
struct mntent ment; struct mntent ment;
progname = argv[0]; progname = argv[0];

View File

@ -329,6 +329,17 @@
#define SMB_INO_T uint32 #define SMB_INO_T uint32
#endif #endif
/*
* Type for stat structure. This will
* soon change to a user defined type
* once we wrap stat(), fstat() and lstat()
* for 64 bit file sizes. JRA.
*/
#ifndef SMB_STRUCT_STAT
#define SMB_STRUCT_STAT struct stat
#endif
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b))
#endif #endif

View File

@ -165,18 +165,18 @@ int smbrun(char *cmd,char *outfile,BOOL shared);
int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_select(int maxfd, fd_set *fds,struct timeval *tval);
int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_select(int maxfd, fd_set *fds,struct timeval *tval);
int sys_unlink(char *fname); int dos_unlink(char *fname);
int sys_open(char *fname,int flags,int mode); int dos_open(char *fname,int flags,int mode);
DIR *sys_opendir(char *dname); DIR *dos_opendir(char *dname);
int sys_stat(char *fname,struct stat *sbuf); int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf);
int sys_waitpid(pid_t pid,int *status,int options); int sys_waitpid(pid_t pid,int *status,int options);
int sys_lstat(char *fname,struct stat *sbuf); int dos_lstat(char *fname,struct stat *sbuf);
int sys_mkdir(char *dname,int mode); int dos_mkdir(char *dname,int mode);
int sys_rmdir(char *dname); int dos_rmdir(char *dname);
int sys_chdir(char *dname); int dos_chdir(char *dname);
int sys_utime(char *fname,struct utimbuf *times); int dos_utime(char *fname,struct utimbuf *times);
int sys_rename(char *from, char *to); int dos_rename(char *from, char *to);
int sys_chmod(char *fname,int mode); int dos_chmod(char *fname,int mode);
char *sys_getwd(char *s); char *sys_getwd(char *s);
int sys_chown(char *fname,int uid,int gid); int sys_chown(char *fname,int uid,int gid);
int sys_chroot(char *dname); int sys_chroot(char *dname);
@ -199,7 +199,7 @@ time_t make_unix_date2(void *date_ptr);
time_t make_unix_date3(void *date_ptr); time_t make_unix_date3(void *date_ptr);
char *http_timestring(time_t t); char *http_timestring(time_t t);
char *timestring(void ); char *timestring(void );
time_t get_create_time(struct stat *st,BOOL fake_dirs); time_t get_create_time(SMB_STRUCT_STAT *st,BOOL fake_dirs);
/*The following definitions come from lib/ufc.c */ /*The following definitions come from lib/ufc.c */
@ -227,9 +227,9 @@ char *StrCpy(char *dest,char *src);
char *StrnCpy(char *dest,char *src,int n); char *StrnCpy(char *dest,char *src,int n);
void putip(void *dest,void *src); void putip(void *dest,void *src);
int name_mangle( char *In, char *Out, char name_type ); int name_mangle( char *In, char *Out, char name_type );
BOOL file_exist(char *fname,struct stat *sbuf); BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf);
time_t file_modtime(char *fname); time_t file_modtime(char *fname);
BOOL directory_exist(char *dname,struct stat *st); BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st);
uint32 file_size(char *file_name); uint32 file_size(char *file_name);
char *attrib_string(int mode); char *attrib_string(int mode);
int StrCaseCmp(char *s, char *t); int StrCaseCmp(char *s, char *t);
@ -1977,7 +1977,7 @@ BOOL dptr_fill(char *buf1,unsigned int key);
BOOL dptr_zero(char *buf); BOOL dptr_zero(char *buf);
void *dptr_fetch(char *buf,int *num); void *dptr_fetch(char *buf,int *num);
void *dptr_fetch_lanman2(int dptr_num); void *dptr_fetch_lanman2(int dptr_num);
BOOL dir_check_ftype(connection_struct *conn,int mode,struct stat *st,int dirtype); BOOL dir_check_ftype(connection_struct *conn,int mode,SMB_STRUCT_STAT *st,int dirtype);
BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
void *OpenDir(connection_struct *conn, char *name, BOOL use_veto); void *OpenDir(connection_struct *conn, char *name, BOOL use_veto);
void CloseDir(void *p); void CloseDir(void *p);
@ -1991,8 +1991,8 @@ void DirCacheFlush(int snum);
/*The following definitions come from smbd/dosmode.c */ /*The following definitions come from smbd/dosmode.c */
mode_t unix_mode(connection_struct *conn,int dosmode); mode_t unix_mode(connection_struct *conn,int dosmode);
int dos_mode(connection_struct *conn,char *path,struct stat *sbuf); int dos_mode(connection_struct *conn,char *path,SMB_STRUCT_STAT *sbuf);
int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st); int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT *st);
int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); int file_utime(connection_struct *conn, char *fname, struct utimbuf *times);
BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime);
@ -2015,14 +2015,14 @@ BOOL fname_equal(char *name1, char *name2);
BOOL mangled_equal(char *name1, char *name2); BOOL mangled_equal(char *name1, char *name2);
void print_stat_cache_statistics(void); void print_stat_cache_statistics(void);
BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
BOOL *bad_path, struct stat *pst); BOOL *bad_path, SMB_STRUCT_STAT *pst);
BOOL check_name(char *name,connection_struct *conn); BOOL check_name(char *name,connection_struct *conn);
BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache);
/*The following definitions come from smbd/files.c */ /*The following definitions come from smbd/files.c */
files_struct *file_new(void ); files_struct *file_new(void );
file_fd_struct *fd_get_already_open(struct stat *sbuf); file_fd_struct *fd_get_already_open(SMB_STRUCT_STAT *sbuf);
file_fd_struct *fd_get_new(void); file_fd_struct *fd_get_new(void);
void file_close_conn(connection_struct *conn); void file_close_conn(connection_struct *conn);
void file_init(void); void file_init(void);

View File

@ -191,7 +191,7 @@ static codepage_p load_client_codepage( int client_codepage )
FILE *fp = NULL; FILE *fp = NULL;
unsigned int size; unsigned int size;
codepage_p cp_p = NULL; codepage_p cp_p = NULL;
struct stat st; SMB_STRUCT_STAT st;
DEBUG(5, ("load_client_codepage: loading codepage %d.\n", client_codepage)); DEBUG(5, ("load_client_codepage: loading codepage %d.\n", client_codepage));

View File

@ -249,7 +249,7 @@ void force_check_log_size( void )
static void check_log_size( void ) static void check_log_size( void )
{ {
int maxlog; int maxlog;
struct stat st; SMB_STRUCT_STAT st;
if( debug_count++ < 100 || getuid() != 0 ) if( debug_count++ < 100 || getuid() != 0 )
return; return;

View File

@ -56,7 +56,7 @@ static void do_filehash(char *fname, unsigned char *hash)
static void do_dirrand(char *name, unsigned char *buf, int buf_len) static void do_dirrand(char *name, unsigned char *buf, int buf_len)
{ {
void *dp = sys_opendir(name); void *dp = dos_opendir(name);
pstring fullname; pstring fullname;
int len_left; int len_left;
int fullname_len; int fullname_len;
@ -81,12 +81,12 @@ static void do_dirrand(char *name, unsigned char *buf, int buf_len)
char *p; char *p;
while ((p = readdirname(dp))) { while ((p = readdirname(dp))) {
struct stat st; SMB_STRUCT_STAT st;
if(strlen(p) <= len_left) if(strlen(p) <= len_left)
pstrcpy(pos, p); pstrcpy(pos, p);
if(sys_stat(fullname,&st) == 0) { if(dos_stat(fullname,&st) == 0) {
SIVAL(buf, ((counter * 4)%(buf_len-4)), SIVAL(buf, ((counter * 4)%(buf_len-4)),
IVAL(buf,((counter * 4)%(buf_len-4))) ^ st.st_atime); IVAL(buf,((counter * 4)%(buf_len-4))) ^ st.st_atime);
counter++; counter++;

View File

@ -82,7 +82,7 @@ int ntalk_mkresdir(const char *fname)
char fdir[255]; char fdir[255];
int i; int i;
int lastslash; int lastslash;
struct stat dirstats; SMB_STRUCT_STAT dirstats;
char appledouble[] = APPLEDOUBLE; char appledouble[] = APPLEDOUBLE;
/* find directory containing fname */ /* find directory containing fname */

View File

@ -33,7 +33,7 @@ the child as it may leave the caller in a privilaged state.
static BOOL setup_stdout_file(char *outfile,BOOL shared) static BOOL setup_stdout_file(char *outfile,BOOL shared)
{ {
int fd; int fd;
struct stat st; SMB_STRUCT_STAT st;
mode_t mode = S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH; mode_t mode = S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH;
int flags = O_RDWR|O_CREAT|O_TRUNC|O_EXCL; int flags = O_RDWR|O_CREAT|O_TRUNC|O_EXCL;

View File

@ -141,36 +141,36 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval)
/******************************************************************* /*******************************************************************
just a unlink wrapper just a unlink wrapper that calls dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_unlink(char *fname) int dos_unlink(char *fname)
{ {
return(unlink(dos_to_unix(fname,False))); return(unlink(dos_to_unix(fname,False)));
} }
/******************************************************************* /*******************************************************************
a simple open() wrapper a simple open() wrapper that calls dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_open(char *fname,int flags,int mode) int dos_open(char *fname,int flags,int mode)
{ {
return(open(dos_to_unix(fname,False),flags,mode)); return(open(dos_to_unix(fname,False),flags,mode));
} }
/******************************************************************* /*******************************************************************
a simple opendir() wrapper a simple opendir() wrapper that calls dos_to_unix
********************************************************************/ ********************************************************************/
DIR *sys_opendir(char *dname) DIR *dos_opendir(char *dname)
{ {
return(opendir(dos_to_unix(dname,False))); return(opendir(dos_to_unix(dname,False)));
} }
/******************************************************************* /*******************************************************************
and a stat() wrapper and a stat() wrapper that calls dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_stat(char *fname,struct stat *sbuf) int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf)
{ {
return(stat(dos_to_unix(fname,False),sbuf)); return(stat(dos_to_unix(fname,False),sbuf));
} }
@ -188,45 +188,45 @@ int sys_waitpid(pid_t pid,int *status,int options)
} }
/******************************************************************* /*******************************************************************
don't forget lstat() don't forget lstat() that calls dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_lstat(char *fname,struct stat *sbuf) int dos_lstat(char *fname,struct stat *sbuf)
{ {
return(lstat(dos_to_unix(fname,False),sbuf)); return(lstat(dos_to_unix(fname,False),sbuf));
} }
/******************************************************************* /*******************************************************************
mkdir() gets a wrapper mkdir() gets a wrapper that calls dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_mkdir(char *dname,int mode) int dos_mkdir(char *dname,int mode)
{ {
return(mkdir(dos_to_unix(dname,False),mode)); return(mkdir(dos_to_unix(dname,False),mode));
} }
/******************************************************************* /*******************************************************************
do does rmdir() do does rmdir() - call dos_to_unix
********************************************************************/ ********************************************************************/
int sys_rmdir(char *dname) int dos_rmdir(char *dname)
{ {
return(rmdir(dos_to_unix(dname,False))); return(rmdir(dos_to_unix(dname,False)));
} }
/******************************************************************* /*******************************************************************
I almost forgot chdir() I almost forgot chdir() - call dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_chdir(char *dname) int dos_chdir(char *dname)
{ {
return(chdir(dos_to_unix(dname,False))); return(chdir(dos_to_unix(dname,False)));
} }
/******************************************************************* /*******************************************************************
now for utime() now for utime() - call dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_utime(char *fname,struct utimbuf *times) int dos_utime(char *fname,struct utimbuf *times)
{ {
/* if the modtime is 0 or -1 then ignore the call and /* if the modtime is 0 or -1 then ignore the call and
return success */ return success */
@ -344,9 +344,9 @@ static int copy_reg(char *source, const char *dest)
} }
/******************************************************************* /*******************************************************************
for rename() for rename() - call dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_rename(char *from, char *to) int dos_rename(char *from, char *to)
{ {
int rcode; int rcode;
pstring zfrom, zto; pstring zfrom, zto;
@ -364,9 +364,9 @@ int sys_rename(char *from, char *to)
} }
/******************************************************************* /*******************************************************************
for chmod for chmod - call dos_to_unix.
********************************************************************/ ********************************************************************/
int sys_chmod(char *fname,int mode) int dos_chmod(char *fname,int mode)
{ {
return(chmod(dos_to_unix(fname,False),mode)); return(chmod(dos_to_unix(fname,False),mode));
} }

View File

@ -513,7 +513,7 @@ char *timestring(void )
structure. structure.
****************************************************************************/ ****************************************************************************/
time_t get_create_time(struct stat *st,BOOL fake_dirs) time_t get_create_time(SMB_STRUCT_STAT *st,BOOL fake_dirs)
{ {
time_t ret, ret1; time_t ret, ret1;

View File

@ -520,12 +520,12 @@ int name_mangle( char *In, char *Out, char name_type )
/******************************************************************* /*******************************************************************
check if a file exists check if a file exists
********************************************************************/ ********************************************************************/
BOOL file_exist(char *fname,struct stat *sbuf) BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf)
{ {
struct stat st; SMB_STRUCT_STAT st;
if (!sbuf) sbuf = &st; if (!sbuf) sbuf = &st;
if (sys_stat(fname,sbuf) != 0) if (dos_stat(fname,sbuf) != 0)
return(False); return(False);
return(S_ISREG(sbuf->st_mode)); return(S_ISREG(sbuf->st_mode));
@ -536,9 +536,9 @@ check a files mod time
********************************************************************/ ********************************************************************/
time_t file_modtime(char *fname) time_t file_modtime(char *fname)
{ {
struct stat st; SMB_STRUCT_STAT st;
if (sys_stat(fname,&st) != 0) if (dos_stat(fname,&st) != 0)
return(0); return(0);
return(st.st_mtime); return(st.st_mtime);
@ -547,14 +547,14 @@ time_t file_modtime(char *fname)
/******************************************************************* /*******************************************************************
check if a directory exists check if a directory exists
********************************************************************/ ********************************************************************/
BOOL directory_exist(char *dname,struct stat *st) BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st)
{ {
struct stat st2; SMB_STRUCT_STAT st2;
BOOL ret; BOOL ret;
if (!st) st = &st2; if (!st) st = &st2;
if (sys_stat(dname,st) != 0) if (dos_stat(dname,st) != 0)
return(False); return(False);
ret = S_ISDIR(st->st_mode); ret = S_ISDIR(st->st_mode);
@ -568,9 +568,9 @@ returns the size in bytes of the named file
********************************************************************/ ********************************************************************/
uint32 file_size(char *file_name) uint32 file_size(char *file_name)
{ {
struct stat buf; SMB_STRUCT_STAT buf;
buf.st_size = 0; buf.st_size = 0;
sys_stat(file_name,&buf); dos_stat(file_name,&buf);
return(buf.st_size); return(buf.st_size);
} }
@ -1205,7 +1205,7 @@ int ChDir(char *path)
if (*path == '/' && strcsequal(LastDir,path)) return(0); if (*path == '/' && strcsequal(LastDir,path)) return(0);
DEBUG(3,("chdir to %s\n",path)); DEBUG(3,("chdir to %s\n",path));
res = sys_chdir(path); res = dos_chdir(path);
if (!res) if (!res)
pstrcpy(LastDir,path); pstrcpy(LastDir,path);
return(res); return(res);
@ -1233,7 +1233,7 @@ char *GetWd(char *str)
{ {
pstring s; pstring s;
static BOOL getwd_cache_init = False; static BOOL getwd_cache_init = False;
struct stat st, st2; SMB_STRUCT_STAT st, st2;
int i; int i;
*s = 0; *s = 0;
@ -3270,7 +3270,7 @@ int set_filelen(int fd, long len)
#ifdef HAVE_FTRUNCATE_EXTEND #ifdef HAVE_FTRUNCATE_EXTEND
return ftruncate(fd, len); return ftruncate(fd, len);
#else #else
struct stat st; SMB_STRUCT_STAT st;
char c = 0; char c = 0;
long currpos = lseek(fd, 0L, SEEK_CUR); long currpos = lseek(fd, 0L, SEEK_CUR);

View File

@ -159,7 +159,7 @@ static BOOL slow_lock_share_entry(connection_struct *conn,
do do
{ {
struct stat dummy_stat; SMB_STRUCT_STAT dummy_stat;
fd = (int)open(fname,read_only?O_RDONLY:(O_RDWR|O_CREAT), fd = (int)open(fname,read_only?O_RDONLY:(O_RDWR|O_CREAT),
SHARE_FILE_MODE); SHARE_FILE_MODE);
@ -221,7 +221,7 @@ static BOOL slow_unlock_share_entry(connection_struct *conn,
{ {
int fd = token; int fd = token;
int ret = True; int ret = True;
struct stat sb; SMB_STRUCT_STAT sb;
pstring fname; pstring fname;
if (read_only) return True; if (read_only) return True;
@ -267,7 +267,7 @@ Read a share file into a buffer.
********************************************************************/ ********************************************************************/
static int read_share_file(connection_struct *conn, int fd, char *fname, char **out, BOOL *p_new_file) static int read_share_file(connection_struct *conn, int fd, char *fname, char **out, BOOL *p_new_file)
{ {
struct stat sb; SMB_STRUCT_STAT sb;
char *buf; char *buf;
int size; int size;
@ -680,7 +680,7 @@ static BOOL slow_set_share_mode(int token,files_struct *fsp, uint16 port, uint16
pstring fname; pstring fname;
int fd = (int)token; int fd = (int)token;
int pid = (int)getpid(); int pid = (int)getpid();
struct stat sb; SMB_STRUCT_STAT sb;
char *buf; char *buf;
int num_entries; int num_entries;
int header_size; int header_size;

View File

@ -901,7 +901,7 @@ BOOL pdb_generate_machine_sid(void)
char *p; char *p;
pstring sid_file; pstring sid_file;
fstring sid_string; fstring sid_string;
struct stat st; SMB_STRUCT_STAT st;
uchar raw_sid_data[12]; uchar raw_sid_data[12];
pstrcpy(sid_file, lp_smb_passwd_file()); pstrcpy(sid_file, lp_smb_passwd_file());
@ -911,7 +911,7 @@ BOOL pdb_generate_machine_sid(void)
} }
if (!directory_exist(sid_file, NULL)) { if (!directory_exist(sid_file, NULL)) {
if (sys_mkdir(sid_file, 0700) != 0) { if (dos_mkdir(sid_file, 0700) != 0) {
DEBUG(0,("generate_machine_sid: can't create private directory %s : %s\n", DEBUG(0,("generate_machine_sid: can't create private directory %s : %s\n",
sid_file, strerror(errno))); sid_file, strerror(errno)));
return False; return False;

View File

@ -112,7 +112,7 @@ void print_file(connection_struct *conn, files_struct *file)
if (file_size(file->fsp_name) <= 0) { if (file_size(file->fsp_name) <= 0) {
DEBUG(3,("Discarding null print job %s\n",file->fsp_name)); DEBUG(3,("Discarding null print job %s\n",file->fsp_name));
sys_unlink(file->fsp_name); dos_unlink(file->fsp_name);
return; return;
} }
@ -1033,7 +1033,7 @@ int get_printqueue(int snum,
fstring outfile; fstring outfile;
pstring line; pstring line;
FILE *f; FILE *f;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
BOOL dorun=True; BOOL dorun=True;
int cachetime = lp_lpqcachetime(); int cachetime = lp_lpqcachetime();

View File

@ -408,7 +408,7 @@ void *dptr_fetch_lanman2(int dptr_num)
/**************************************************************************** /****************************************************************************
check a filetype for being valid check a filetype for being valid
****************************************************************************/ ****************************************************************************/
BOOL dir_check_ftype(connection_struct *conn,int mode,struct stat *st,int dirtype) BOOL dir_check_ftype(connection_struct *conn,int mode,SMB_STRUCT_STAT *st,int dirtype)
{ {
if (((mode & ~dirtype) & (aHIDDEN | aSYSTEM | aDIR)) != 0) if (((mode & ~dirtype) & (aHIDDEN | aSYSTEM | aDIR)) != 0)
return False; return False;
@ -422,7 +422,7 @@ BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,in
{ {
char *dname; char *dname;
BOOL found = False; BOOL found = False;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
pstring path; pstring path;
pstring pathreal; pstring pathreal;
BOOL isrootdir; BOOL isrootdir;
@ -471,7 +471,7 @@ BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,in
pstrcpy(pathreal,path); pstrcpy(pathreal,path);
pstrcat(path,fname); pstrcat(path,fname);
pstrcat(pathreal,dname); pstrcat(pathreal,dname);
if (sys_stat(pathreal,&sbuf) != 0) if (dos_stat(pathreal,&sbuf) != 0)
{ {
DEBUG(5,("Couldn't stat 1 [%s]\n",path)); DEBUG(5,("Couldn't stat 1 [%s]\n",path));
continue; continue;
@ -519,7 +519,7 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto)
{ {
Dir *dirp; Dir *dirp;
char *n; char *n;
void *p = sys_opendir(name); void *p = dos_opendir(name);
int used=0; int used=0;
if (!p) return(NULL); if (!p) return(NULL);

View File

@ -75,7 +75,7 @@ mode_t unix_mode(connection_struct *conn,int dosmode)
/**************************************************************************** /****************************************************************************
change a unix mode to a dos mode change a unix mode to a dos mode
****************************************************************************/ ****************************************************************************/
int dos_mode(connection_struct *conn,char *path,struct stat *sbuf) int dos_mode(connection_struct *conn,char *path,SMB_STRUCT_STAT *sbuf)
{ {
int result = 0; int result = 0;
@ -139,16 +139,16 @@ int dos_mode(connection_struct *conn,char *path,struct stat *sbuf)
/******************************************************************* /*******************************************************************
chmod a file - but preserve some bits chmod a file - but preserve some bits
********************************************************************/ ********************************************************************/
int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st) int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT *st)
{ {
struct stat st1; SMB_STRUCT_STAT st1;
int mask=0; int mask=0;
int tmp; int tmp;
int unixmode; int unixmode;
if (!st) { if (!st) {
st = &st1; st = &st1;
if (sys_stat(fname,st)) return(-1); if (dos_stat(fname,st)) return(-1);
} }
if (S_ISDIR(st->st_mode)) dosmode |= aDIR; if (S_ISDIR(st->st_mode)) dosmode |= aDIR;
@ -186,23 +186,23 @@ int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st)
unixmode |= tmp; unixmode |= tmp;
} }
return(sys_chmod(fname,unixmode)); return(dos_chmod(fname,unixmode));
} }
/******************************************************************* /*******************************************************************
Wrapper around sys_utime that possibly allows DOS semantics rather Wrapper around dos_utime that possibly allows DOS semantics rather
than POSIX. than POSIX.
*******************************************************************/ *******************************************************************/
int file_utime(connection_struct *conn, char *fname, struct utimbuf *times) int file_utime(connection_struct *conn, char *fname, struct utimbuf *times)
{ {
extern struct current_user current_user; extern struct current_user current_user;
struct stat sb; SMB_STRUCT_STAT sb;
int ret = -1; int ret = -1;
errno = 0; errno = 0;
if(sys_utime(fname, times) == 0) if(dos_utime(fname, times) == 0)
return 0; return 0;
if((errno != EPERM) && (errno != EACCES)) if((errno != EPERM) && (errno != EACCES))
@ -217,7 +217,7 @@ int file_utime(connection_struct *conn, char *fname, struct utimbuf *times)
(as DOS does). (as DOS does).
*/ */
if(sys_stat(fname,&sb) != 0) if(dos_stat(fname,&sb) != 0)
return -1; return -1;
/* Check if we have write access. */ /* Check if we have write access. */
@ -230,7 +230,7 @@ int file_utime(connection_struct *conn, char *fname, struct utimbuf *times)
current_user.ngroups,current_user.groups)))) { current_user.ngroups,current_user.groups)))) {
/* We are allowed to become root and change the filetime. */ /* We are allowed to become root and change the filetime. */
become_root(False); become_root(False);
ret = sys_utime(fname, times); ret = dos_utime(fname, times);
unbecome_root(False); unbecome_root(False);
} }
} }

View File

@ -102,12 +102,12 @@ int write_file(files_struct *fsp,char *data,int n)
} }
if (!fsp->modified) { if (!fsp->modified) {
struct stat st; SMB_STRUCT_STAT st;
fsp->modified = True; fsp->modified = True;
if (fstat(fsp->fd_ptr->fd,&st) == 0) { if (fstat(fsp->fd_ptr->fd,&st) == 0) {
int dosmode = dos_mode(fsp->conn,fsp->fsp_name,&st); int dosmode = dos_mode(fsp->conn,fsp->fsp_name,&st);
if (MAP_ARCHIVE(fsp->conn) && !IS_DOS_ARCHIVE(dosmode)) { if (MAP_ARCHIVE(fsp->conn) && !IS_DOS_ARCHIVE(dosmode)) {
dos_chmod(fsp->conn,fsp->fsp_name,dosmode | aARCH,&st); file_chmod(fsp->conn,fsp->fsp_name,dosmode | aARCH,&st);
} }
} }
} }

View File

@ -231,7 +231,7 @@ static void stat_cache_add( char *full_orig_name, char *orig_translated_path)
Return True if we translated (and did a scuccessful stat on) the entire name. Return True if we translated (and did a scuccessful stat on) the entire name.
*****************************************************************************/ *****************************************************************************/
static BOOL stat_cache_lookup( char *name, char *dirpath, char **start, struct stat *pst) static BOOL stat_cache_lookup( char *name, char *dirpath, char **start, SMB_STRUCT_STAT *pst)
{ {
stat_cache_entry *scp; stat_cache_entry *scp;
stat_cache_entry *longest_hit = NULL; stat_cache_entry *longest_hit = NULL;
@ -275,7 +275,7 @@ static BOOL stat_cache_lookup( char *name, char *dirpath, char **start, struct s
* and then promote it to the top. * and then promote it to the top.
*/ */
if(sys_stat( longest_hit->translated_name, pst) != 0) { if(dos_stat( longest_hit->translated_name, pst) != 0) {
/* /*
* Discard this entry. * Discard this entry.
*/ */
@ -322,9 +322,9 @@ of a pathname does not exist.
****************************************************************************/ ****************************************************************************/
BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
BOOL *bad_path, struct stat *pst) BOOL *bad_path, SMB_STRUCT_STAT *pst)
{ {
struct stat st; SMB_STRUCT_STAT st;
char *start, *end, *orig_start; char *start, *end, *orig_start;
pstring dirpath; pstring dirpath;
pstring orig_path; pstring orig_path;
@ -335,7 +335,7 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
*dirpath = 0; *dirpath = 0;
*bad_path = False; *bad_path = False;
if(pst) if(pst)
memset( (char *)pst, '\0', sizeof(struct stat)); memset( (char *)pst, '\0', sizeof(SMB_STRUCT_STAT));
if(saved_last_component) if(saved_last_component)
*saved_last_component = 0; *saved_last_component = 0;
@ -406,7 +406,7 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
* stat the name - if it exists then we are all done! * stat the name - if it exists then we are all done!
*/ */
if (sys_stat(name,&st) == 0) { if (dos_stat(name,&st) == 0) {
stat_cache_add(orig_path, name); stat_cache_add(orig_path, name);
DEBUG(5,("conversion finished %s -> %s\n",orig_path, name)); DEBUG(5,("conversion finished %s -> %s\n",orig_path, name));
if(pst) if(pst)
@ -459,7 +459,7 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
/* /*
* Check if the name exists up to this point. * Check if the name exists up to this point.
*/ */
if (sys_stat(name, &st) == 0) { if (dos_stat(name, &st) == 0) {
/* /*
* It exists. it must either be a directory or this must be * It exists. it must either be a directory or this must be
* the last part of the path for it to be OK. * the last part of the path for it to be OK.
@ -611,8 +611,8 @@ BOOL check_name(char *name,connection_struct *conn)
#ifdef S_ISLNK #ifdef S_ISLNK
if (!lp_symlinks(SNUM(conn))) if (!lp_symlinks(SNUM(conn)))
{ {
struct stat statbuf; SMB_STRUCT_STAT statbuf;
if ( (sys_lstat(name,&statbuf) != -1) && if ( (dos_lstat(name,&statbuf) != -1) &&
(S_ISLNK(statbuf.st_mode)) ) (S_ISLNK(statbuf.st_mode)) )
{ {
DEBUG(3,("check_name: denied: file path name %s is a symlink\n",name)); DEBUG(3,("check_name: denied: file path name %s is a symlink\n",name));

View File

@ -117,7 +117,7 @@ files_struct *file_new(void )
fd support routines - attempt to find an already open file by dev fd support routines - attempt to find an already open file by dev
and inode - increments the ref_count of the returned file_fd_struct *. and inode - increments the ref_count of the returned file_fd_struct *.
****************************************************************************/ ****************************************************************************/
file_fd_struct *fd_get_already_open(struct stat *sbuf) file_fd_struct *fd_get_already_open(SMB_STRUCT_STAT *sbuf)
{ {
file_fd_struct *fd_ptr; file_fd_struct *fd_ptr;

View File

@ -68,7 +68,7 @@ void load_groupname_map(void)
static time_t groupmap_file_last_modified = (time_t)0; static time_t groupmap_file_last_modified = (time_t)0;
static BOOL initialized = False; static BOOL initialized = False;
char *groupname_map_file = lp_groupname_map(); char *groupname_map_file = lp_groupname_map();
struct stat st; SMB_STRUCT_STAT st;
FILE *fp; FILE *fp;
char *s; char *s;
pstring buf; pstring buf;

View File

@ -1985,7 +1985,7 @@ static BOOL api_PrintJobInfo(connection_struct *conn,uint16 vuid,char *param,cha
!become_service(fconn,True)) !become_service(fconn,True))
break; break;
if (sys_rename(fsp->fsp_name,name) == 0) { if (dos_rename(fsp->fsp_name,name) == 0) {
string_set(&fsp->fsp_name,name); string_set(&fsp->fsp_name,name);
} }
break; break;

View File

@ -416,7 +416,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
int unixmode, pnum = -1; int unixmode, pnum = -1;
int fmode=0,mtime=0,rmode=0; int fmode=0,mtime=0,rmode=0;
off_t file_len = 0; off_t file_len = 0;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int smb_action = 0; int smb_action = 0;
BOOL bad_path = False; BOOL bad_path = False;
files_struct *fsp=NULL; files_struct *fsp=NULL;
@ -596,7 +596,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
} }
if(fsp->is_directory) { if(fsp->is_directory) {
if(sys_stat(fsp->fsp_name, &sbuf) != 0) { if(dos_stat(fsp->fsp_name, &sbuf) != 0) {
close_directory(fsp); close_directory(fsp);
restore_case_semantics(file_attributes); restore_case_semantics(file_attributes);
return(ERROR(ERRDOS,ERRnoaccess)); return(ERROR(ERRDOS,ERRnoaccess));
@ -701,7 +701,7 @@ static int call_nt_transact_create(connection_struct *conn,
int unixmode, pnum = -1; int unixmode, pnum = -1;
int fmode=0,mtime=0,rmode=0; int fmode=0,mtime=0,rmode=0;
off_t file_len = 0; off_t file_len = 0;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int smb_action = 0; int smb_action = 0;
BOOL bad_path = False; BOOL bad_path = False;
files_struct *fsp = NULL; files_struct *fsp = NULL;
@ -1084,7 +1084,7 @@ void process_pending_change_notify_queue(time_t t)
*/ */
while((cnbp != NULL) && (cnbp->next_check_time <= t)) { while((cnbp != NULL) && (cnbp->next_check_time <= t)) {
struct stat st; SMB_STRUCT_STAT st;
files_struct *fsp = cnbp->fsp; files_struct *fsp = cnbp->fsp;
connection_struct *conn = cnbp->conn; connection_struct *conn = cnbp->conn;
uint16 vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID : uint16 vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID :
@ -1121,7 +1121,7 @@ void process_pending_change_notify_queue(time_t t)
continue; continue;
} }
if(sys_stat(fsp->fsp_name, &st) < 0) { if(dos_stat(fsp->fsp_name, &st) < 0) {
DEBUG(0,("process_pending_change_notify_queue: Unable to stat directory %s. \ DEBUG(0,("process_pending_change_notify_queue: Unable to stat directory %s. \
Error was %s.\n", fsp->fsp_name, strerror(errno) )); Error was %s.\n", fsp->fsp_name, strerror(errno) ));
/* /*
@ -1171,7 +1171,7 @@ static int call_nt_transact_notify_change(connection_struct *conn,
char *setup = *ppsetup; char *setup = *ppsetup;
files_struct *fsp; files_struct *fsp;
change_notify_buf *cnbp; change_notify_buf *cnbp;
struct stat st; SMB_STRUCT_STAT st;
fsp = file_fsp(setup,4); fsp = file_fsp(setup,4);
@ -1200,7 +1200,7 @@ static int call_nt_transact_notify_change(connection_struct *conn,
* Store the current timestamp on the directory we are monitoring. * Store the current timestamp on the directory we are monitoring.
*/ */
if(sys_stat(fsp->fsp_name, &st) < 0) { if(dos_stat(fsp->fsp_name, &st) < 0) {
DEBUG(0,("call_nt_transact_notify_change: Unable to stat name = %s. \ DEBUG(0,("call_nt_transact_notify_change: Unable to stat name = %s. \
Error was %s\n", fsp->fsp_name, strerror(errno) )); Error was %s\n", fsp->fsp_name, strerror(errno) ));
free((char *)cnbp); free((char *)cnbp);

View File

@ -29,18 +29,18 @@ extern uint16 oplock_port;
/**************************************************************************** /****************************************************************************
fd support routines - attempt to do a sys_open fd support routines - attempt to do a dos_open
****************************************************************************/ ****************************************************************************/
static int fd_attempt_open(char *fname, int flags, int mode) static int fd_attempt_open(char *fname, int flags, int mode)
{ {
int fd = sys_open(fname,flags,mode); int fd = dos_open(fname,flags,mode);
/* Fix for files ending in '.' */ /* Fix for files ending in '.' */
if((fd == -1) && (errno == ENOENT) && if((fd == -1) && (errno == ENOENT) &&
(strchr(fname,'.')==NULL)) (strchr(fname,'.')==NULL))
{ {
pstrcat(fname,"."); pstrcat(fname,".");
fd = sys_open(fname,flags,mode); fd = dos_open(fname,flags,mode);
} }
#if (defined(ENAMETOOLONG) && defined(HAVE_PATHCONF)) #if (defined(ENAMETOOLONG) && defined(HAVE_PATHCONF))
@ -71,7 +71,7 @@ static int fd_attempt_open(char *fname, int flags, int mode)
char tmp = p[max_len]; char tmp = p[max_len];
p[max_len] = '\0'; p[max_len] = '\0';
if ((fd = sys_open(fname,flags,mode)) == -1) if ((fd = dos_open(fname,flags,mode)) == -1)
p[max_len] = tmp; p[max_len] = tmp;
} }
} }
@ -127,7 +127,7 @@ Save the already open fd (we cannot close due to POSIX file locking braindamage.
****************************************************************************/ ****************************************************************************/
static void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr) static void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr)
{ {
int fd = sys_open( fname, O_RDWR, mode); int fd = dos_open( fname, O_RDWR, mode);
if(fd == -1) if(fd == -1)
return; return;
@ -266,11 +266,11 @@ static void check_for_pipe(char *fname)
open a file open a file
****************************************************************************/ ****************************************************************************/
static void open_file(files_struct *fsp,connection_struct *conn, static void open_file(files_struct *fsp,connection_struct *conn,
char *fname1,int flags,int mode, struct stat *sbuf) char *fname1,int flags,int mode, SMB_STRUCT_STAT *sbuf)
{ {
extern struct current_user current_user; extern struct current_user current_user;
pstring fname; pstring fname;
struct stat statbuf; SMB_STRUCT_STAT statbuf;
file_fd_struct *fd_ptr; file_fd_struct *fd_ptr;
int accmode = (flags & (O_RDONLY | O_WRONLY | O_RDWR)); int accmode = (flags & (O_RDONLY | O_WRONLY | O_RDWR));
@ -324,7 +324,7 @@ static void open_file(files_struct *fsp,connection_struct *conn,
* open fd table. * open fd table.
*/ */
if(sbuf == 0) { if(sbuf == 0) {
if(sys_stat(fname, &statbuf) < 0) { if(dos_stat(fname, &statbuf) < 0) {
if(errno != ENOENT) { if(errno != ENOENT) {
DEBUG(3,("Error doing stat on file %s (%s)\n", DEBUG(3,("Error doing stat on file %s (%s)\n",
fname,strerror(errno))); fname,strerror(errno)));
@ -452,7 +452,7 @@ static void open_file(files_struct *fsp,connection_struct *conn,
fd_attempt_close(fd_ptr); fd_attempt_close(fd_ptr);
fsp->fd_ptr = 0; fsp->fd_ptr = 0;
if(fd_ptr->ref_count == 0) if(fd_ptr->ref_count == 0)
sys_unlink(fname); dos_unlink(fname);
errno = ENOSPC; errno = ENOSPC;
return; return;
} }
@ -591,7 +591,7 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int
int flags=0; int flags=0;
int flags2=0; int flags2=0;
int deny_mode = (share_mode>>4)&7; int deny_mode = (share_mode>>4)&7;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
BOOL file_existed = file_exist(fname,&sbuf); BOOL file_existed = file_exist(fname,&sbuf);
BOOL share_locked = False; BOOL share_locked = False;
BOOL fcbopen = False; BOOL fcbopen = False;
@ -856,14 +856,14 @@ int open_directory(files_struct *fsp,connection_struct *conn,
char *fname, int smb_ofun, int unixmode, int *action) char *fname, int smb_ofun, int unixmode, int *action)
{ {
extern struct current_user current_user; extern struct current_user current_user;
struct stat st; SMB_STRUCT_STAT st;
if (smb_ofun & 0x10) { if (smb_ofun & 0x10) {
/* /*
* Create the directory. * Create the directory.
*/ */
if(sys_mkdir(fname, unixmode) < 0) { if(dos_mkdir(fname, unixmode) < 0) {
DEBUG(0,("open_directory: unable to create %s. Error was %s\n", DEBUG(0,("open_directory: unable to create %s. Error was %s\n",
fname, strerror(errno) )); fname, strerror(errno) ));
return -1; return -1;
@ -875,7 +875,7 @@ int open_directory(files_struct *fsp,connection_struct *conn,
* Check that it *was* a directory. * Check that it *was* a directory.
*/ */
if(sys_stat(fname, &st) < 0) { if(dos_stat(fname, &st) < 0) {
DEBUG(0,("open_directory: unable to stat name = %s. Error was %s\n", DEBUG(0,("open_directory: unable to stat name = %s. Error was %s\n",
fname, strerror(errno) )); fname, strerror(errno) ));
return -1; return -1;
@ -991,7 +991,7 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op)
int ret = False; int ret = False;
share_mode_entry *old_shares = 0; share_mode_entry *old_shares = 0;
int num_share_modes; int num_share_modes;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int token; int token;
int pid = getpid(); int pid = getpid();
SMB_DEV_T dev; SMB_DEV_T dev;
@ -1000,7 +1000,7 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op)
if(!lp_share_modes(SNUM(conn))) if(!lp_share_modes(SNUM(conn)))
return True; return True;
if (sys_stat(fname,&sbuf) == -1) return(True); if (dos_stat(fname,&sbuf) == -1) return(True);
dev = sbuf.st_dev; dev = sbuf.st_dev;
inode = sbuf.st_ino; inode = sbuf.st_ino;

View File

@ -66,7 +66,7 @@ int read_predict(int fd,int offset,char *buf,char **ptr,int num)
if (ret == num) { if (ret == num) {
predict_skip = True; predict_skip = True;
} else { } else {
struct stat rp_stat; SMB_STRUCT_STAT rp_stat;
/* Find the end of the file - ensure we don't /* Find the end of the file - ensure we don't
read predict beyond it. */ read predict beyond it. */

View File

@ -51,7 +51,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
uid_t euser_id; uid_t euser_id;
int r; int r;
struct dqblk D; struct dqblk D;
struct stat S; SMB_STRUCT_STAT S;
FILE *fp; FILE *fp;
struct mntent *mnt; struct mntent *mnt;
int devno; int devno;
@ -135,7 +135,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
{ {
struct mntent *mnt; struct mntent *mnt;
FILE *fd; FILE *fd;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
dev_t devno ; dev_t devno ;
static dev_t devno_cached = 0 ; static dev_t devno_cached = 0 ;
static pstring name; static pstring name;
@ -255,7 +255,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
static pstring name; static pstring name;
#endif #endif
FILE *fd; FILE *fd;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
dev_t devno ; dev_t devno ;
static dev_t devno_cached = 0 ; static dev_t devno_cached = 0 ;
int found ; int found ;
@ -377,7 +377,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
uid_t user_id, euser_id; uid_t user_id, euser_id;
int r, save_errno; int r, save_errno;
struct dqblk D; struct dqblk D;
struct stat S; SMB_STRUCT_STAT S;
euser_id = geteuid(); euser_id = geteuid();
user_id = getuid(); user_id = getuid();
@ -433,7 +433,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
int r; int r;
struct dqblk D; struct dqblk D;
struct fs_disk_quota F; struct fs_disk_quota F;
struct stat S; SMB_STRUCT_STAT S;
FILE *fp; FILE *fp;
struct mntent *mnt; struct mntent *mnt;
int devno; int devno;
@ -573,7 +573,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
struct dqblk D; struct dqblk D;
#if !defined(__FreeBSD__) && !defined(AIX) && !defined(__OpenBSD__) #if !defined(__FreeBSD__) && !defined(AIX) && !defined(__OpenBSD__)
char dev_disk[256]; char dev_disk[256];
struct stat S; SMB_STRUCT_STAT S;
/* find the block device file */ /* find the block device file */
if ((stat(path, &S)<0) || if ((stat(path, &S)<0) ||
(devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) return (False); (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) return (False);

View File

@ -751,7 +751,7 @@ int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
pstring name; pstring name;
BOOL ok = False; BOOL ok = False;
BOOL bad_path = False; BOOL bad_path = False;
struct stat st; SMB_STRUCT_STAT st;
pstrcpy(name,smb_buf(inbuf) + 1); pstrcpy(name,smb_buf(inbuf) + 1);
unix_convert(name,conn,0,&bad_path,&st); unix_convert(name,conn,0,&bad_path,&st);
@ -806,7 +806,7 @@ int reply_getatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
{ {
pstring fname; pstring fname;
int outsize = 0; int outsize = 0;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
BOOL ok = False; BOOL ok = False;
int mode=0; int mode=0;
uint32 size=0; uint32 size=0;
@ -829,7 +829,7 @@ int reply_getatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
else else
if (check_name(fname,conn)) if (check_name(fname,conn))
{ {
if (VALID_STAT(sbuf) || sys_stat(fname,&sbuf) == 0) if (VALID_STAT(sbuf) || dos_stat(fname,&sbuf) == 0)
{ {
mode = dos_mode(conn,fname,&sbuf); mode = dos_mode(conn,fname,&sbuf);
size = sbuf.st_size; size = sbuf.st_size;
@ -886,7 +886,7 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
BOOL ok=False; BOOL ok=False;
int mode; int mode;
time_t mtime; time_t mtime;
struct stat st; SMB_STRUCT_STAT st;
BOOL bad_path = False; BOOL bad_path = False;
pstrcpy(fname,smb_buf(inbuf) + 1); pstrcpy(fname,smb_buf(inbuf) + 1);
@ -898,7 +898,7 @@ int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if (VALID_STAT_OF_DIR(st) || directory_exist(fname,NULL)) if (VALID_STAT_OF_DIR(st) || directory_exist(fname,NULL))
mode |= aDIR; mode |= aDIR;
if (check_name(fname,conn)) if (check_name(fname,conn))
ok = (dos_chmod(conn,fname,mode,NULL) == 0); ok = (file_chmod(conn,fname,mode,NULL) == 0);
if (ok) if (ok)
ok = set_filetime(conn,fname,mtime); ok = set_filetime(conn,fname,mtime);
@ -1248,7 +1248,7 @@ int reply_open(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
time_t mtime=0; time_t mtime=0;
int unixmode; int unixmode;
int rmode=0; int rmode=0;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
BOOL bad_path = False; BOOL bad_path = False;
files_struct *fsp; files_struct *fsp;
int oplock_request = CORE_OPLOCK_REQUEST(inbuf); int oplock_request = CORE_OPLOCK_REQUEST(inbuf);
@ -1345,7 +1345,7 @@ int reply_open_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
int smb_ofun = SVAL(inbuf,smb_vwv8); int smb_ofun = SVAL(inbuf,smb_vwv8);
int unixmode; int unixmode;
int size=0,fmode=0,mtime=0,rmode=0; int size=0,fmode=0,mtime=0,rmode=0;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int smb_action = 0; int smb_action = 0;
BOOL bad_path = False; BOOL bad_path = False;
files_struct *fsp; files_struct *fsp;
@ -1638,12 +1638,12 @@ check if a user is allowed to delete a file
********************************************************************/ ********************************************************************/
static BOOL can_delete(char *fname,connection_struct *conn, int dirtype) static BOOL can_delete(char *fname,connection_struct *conn, int dirtype)
{ {
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int fmode; int fmode;
if (!CAN_WRITE(conn)) return(False); if (!CAN_WRITE(conn)) return(False);
if (sys_lstat(fname,&sbuf) != 0) return(False); if (dos_lstat(fname,&sbuf) != 0) return(False);
fmode = dos_mode(conn,fname,&sbuf); fmode = dos_mode(conn,fname,&sbuf);
if (fmode & aDIR) return(False); if (fmode & aDIR) return(False);
if (!lp_delete_readonly(SNUM(conn))) { if (!lp_delete_readonly(SNUM(conn))) {
@ -1700,7 +1700,7 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
if (!has_wild) { if (!has_wild) {
pstrcat(directory,"/"); pstrcat(directory,"/");
pstrcat(directory,mask); pstrcat(directory,mask);
if (can_delete(directory,conn,dirtype) && !sys_unlink(directory)) count++; if (can_delete(directory,conn,dirtype) && !dos_unlink(directory)) count++;
if (!count) exists = file_exist(directory,NULL); if (!count) exists = file_exist(directory,NULL);
} else { } else {
void *dirptr = NULL; void *dirptr = NULL;
@ -1731,7 +1731,7 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
error = ERRnoaccess; error = ERRnoaccess;
slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname); slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname);
if (!can_delete(fname,conn,dirtype)) continue; if (!can_delete(fname,conn,dirtype)) continue;
if (!sys_unlink(fname)) count++; if (!dos_unlink(fname)) count++;
DEBUG(3,("reply_unlink : doing unlink on %s\n",fname)); DEBUG(3,("reply_unlink : doing unlink on %s\n",fname));
} }
CloseDir(dirptr); CloseDir(dirptr);
@ -1813,7 +1813,7 @@ int reply_readbraw(connection_struct *conn, char *inbuf, char *outbuf, int dum_s
int sizeneeded = startpos + maxcount; int sizeneeded = startpos + maxcount;
if (size < sizeneeded) { if (size < sizeneeded) {
struct stat st; SMB_STRUCT_STAT st;
if (fstat(fsp->fd_ptr->fd,&st) == 0) if (fstat(fsp->fd_ptr->fd,&st) == 0)
size = st.st_size; size = st.st_size;
if (!fsp->can_write) if (!fsp->can_write)
@ -2787,7 +2787,7 @@ int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
unix_convert(directory,conn,0,&bad_path,NULL); unix_convert(directory,conn,0,&bad_path,NULL);
if (check_name(directory, conn)) if (check_name(directory, conn))
ret = sys_mkdir(directory,unix_mode(conn,aDIR)); ret = dos_mkdir(directory,unix_mode(conn,aDIR));
if (ret < 0) if (ret < 0)
{ {
@ -2822,7 +2822,7 @@ static BOOL recursive_rmdir(char *directory)
while((dname = ReadDirName(dirptr))) while((dname = ReadDirName(dirptr)))
{ {
pstring fullname; pstring fullname;
struct stat st; SMB_STRUCT_STAT st;
if((strcmp(dname, ".") == 0) || (strcmp(dname, "..")==0)) if((strcmp(dname, ".") == 0) || (strcmp(dname, "..")==0))
continue; continue;
@ -2838,7 +2838,7 @@ static BOOL recursive_rmdir(char *directory)
pstrcat(fullname, "/"); pstrcat(fullname, "/");
pstrcat(fullname, dname); pstrcat(fullname, dname);
if(sys_lstat(fullname, &st) != 0) if(dos_lstat(fullname, &st) != 0)
{ {
ret = True; ret = True;
break; break;
@ -2851,13 +2851,13 @@ static BOOL recursive_rmdir(char *directory)
ret = True; ret = True;
break; break;
} }
if(sys_rmdir(fullname) != 0) if(dos_rmdir(fullname) != 0)
{ {
ret = True; ret = True;
break; break;
} }
} }
else if(sys_unlink(fullname) != 0) else if(dos_unlink(fullname) != 0)
{ {
ret = True; ret = True;
break; break;
@ -2884,7 +2884,7 @@ int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
{ {
dptr_closepath(directory,SVAL(inbuf,smb_pid)); dptr_closepath(directory,SVAL(inbuf,smb_pid));
ok = (sys_rmdir(directory) == 0); ok = (dos_rmdir(directory) == 0);
if(!ok && (errno == ENOTEMPTY) && lp_veto_files(SNUM(conn))) if(!ok && (errno == ENOTEMPTY) && lp_veto_files(SNUM(conn)))
{ {
/* Check to see if the only thing in this directory are /* Check to see if the only thing in this directory are
@ -2914,7 +2914,7 @@ int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
while ((dname = ReadDirName(dirptr))) while ((dname = ReadDirName(dirptr)))
{ {
pstring fullname; pstring fullname;
struct stat st; SMB_STRUCT_STAT st;
if((strcmp(dname, ".") == 0) || (strcmp(dname, "..")==0)) if((strcmp(dname, ".") == 0) || (strcmp(dname, "..")==0))
continue; continue;
@ -2929,7 +2929,7 @@ int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
pstrcat(fullname, "/"); pstrcat(fullname, "/");
pstrcat(fullname, dname); pstrcat(fullname, dname);
if(sys_lstat(fullname, &st) != 0) if(dos_lstat(fullname, &st) != 0)
break; break;
if(st.st_mode & S_IFDIR) if(st.st_mode & S_IFDIR)
{ {
@ -2938,15 +2938,15 @@ int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
if(recursive_rmdir(fullname) != 0) if(recursive_rmdir(fullname) != 0)
break; break;
} }
if(sys_rmdir(fullname) != 0) if(dos_rmdir(fullname) != 0)
break; break;
} }
else if(sys_unlink(fullname) != 0) else if(dos_unlink(fullname) != 0)
break; break;
} }
CloseDir(dirptr); CloseDir(dirptr);
/* Retry the rmdir */ /* Retry the rmdir */
ok = (sys_rmdir(directory) == 0); ok = (dos_rmdir(directory) == 0);
} }
else else
CloseDir(dirptr); CloseDir(dirptr);
@ -3047,11 +3047,11 @@ check if a user is allowed to rename a file
********************************************************************/ ********************************************************************/
static BOOL can_rename(char *fname,connection_struct *conn) static BOOL can_rename(char *fname,connection_struct *conn)
{ {
struct stat sbuf; SMB_STRUCT_STAT sbuf;
if (!CAN_WRITE(conn)) return(False); if (!CAN_WRITE(conn)) return(False);
if (sys_lstat(fname,&sbuf) != 0) return(False); if (dos_lstat(fname,&sbuf) != 0) return(False);
if (!check_file_sharing(conn,fname,True)) return(False); if (!check_file_sharing(conn,fname,True)) return(False);
return(True); return(True);
@ -3171,13 +3171,13 @@ int rename_internals(connection_struct *conn,
*/ */
if(resolve_wildcards(directory,newname) && if(resolve_wildcards(directory,newname) &&
can_rename(directory,conn) && can_rename(directory,conn) &&
!sys_rename(directory,newname)) !dos_rename(directory,newname))
count++; count++;
} else { } else {
if (resolve_wildcards(directory,newname) && if (resolve_wildcards(directory,newname) &&
can_rename(directory,conn) && can_rename(directory,conn) &&
!file_exist(newname,NULL) && !file_exist(newname,NULL) &&
!sys_rename(directory,newname)) !dos_rename(directory,newname))
count++; count++;
} }
@ -3232,7 +3232,7 @@ int rename_internals(connection_struct *conn,
continue; continue;
} }
if (!sys_rename(fname,destname)) if (!dos_rename(fname,destname))
count++; count++;
DEBUG(3,("rename_internals: doing rename on %s -> %s\n",fname,destname)); DEBUG(3,("rename_internals: doing rename on %s -> %s\n",fname,destname));
} }
@ -3284,7 +3284,7 @@ static BOOL copy_file(char *src,char *dest1,connection_struct *conn, int ofun,
int count,BOOL target_is_directory) int count,BOOL target_is_directory)
{ {
int Access,action; int Access,action;
struct stat st; SMB_STRUCT_STAT st;
int ret=0; int ret=0;
files_struct *fsp1,*fsp2; files_struct *fsp1,*fsp2;
pstring dest; pstring dest;
@ -3940,7 +3940,7 @@ int reply_setattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_si
****************************************************************************/ ****************************************************************************/
int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize) int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
{ {
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int outsize = 0; int outsize = 0;
int mode; int mode;
files_struct *fsp = file_fsp(inbuf,smb_vwv0); files_struct *fsp = file_fsp(inbuf,smb_vwv0);

View File

@ -202,7 +202,7 @@ static int call_trans2open(connection_struct *conn, char *inbuf, char *outbuf,
int unixmode; int unixmode;
int size=0,fmode=0,mtime=0,rmode; int size=0,fmode=0,mtime=0,rmode;
SMB_INO_T inode = 0; SMB_INO_T inode = 0;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
int smb_action = 0; int smb_action = 0;
BOOL bad_path = False; BOOL bad_path = False;
files_struct *fsp; files_struct *fsp;
@ -302,7 +302,7 @@ static int get_lanman2_dir_entry(connection_struct *conn,
{ {
char *dname; char *dname;
BOOL found = False; BOOL found = False;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
pstring mask; pstring mask;
pstring pathreal; pstring pathreal;
pstring fname; pstring fname;
@ -376,7 +376,7 @@ static int get_lanman2_dir_entry(connection_struct *conn,
if(needslash) if(needslash)
pstrcat(pathreal,"/"); pstrcat(pathreal,"/");
pstrcat(pathreal,dname); pstrcat(pathreal,dname);
if (sys_stat(pathreal,&sbuf) != 0) if (dos_stat(pathreal,&sbuf) != 0)
{ {
DEBUG(5,("get_lanman2_dir_entry:Couldn't stat [%s] (%s)\n",pathreal,strerror(errno))); DEBUG(5,("get_lanman2_dir_entry:Couldn't stat [%s] (%s)\n",pathreal,strerror(errno)));
continue; continue;
@ -1062,13 +1062,13 @@ static int call_trans2qfsinfo(connection_struct *conn,
char *params = *pparams; char *params = *pparams;
uint16 info_level = SVAL(params,0); uint16 info_level = SVAL(params,0);
int data_len; int data_len;
struct stat st; SMB_STRUCT_STAT st;
char *vname = volume_label(SNUM(conn)); char *vname = volume_label(SNUM(conn));
int snum = SNUM(conn); int snum = SNUM(conn);
DEBUG(3,("call_trans2qfsinfo: level = %d\n", info_level)); DEBUG(3,("call_trans2qfsinfo: level = %d\n", info_level));
if(sys_stat(".",&st)!=0) { if(dos_stat(".",&st)!=0) {
DEBUG(2,("call_trans2qfsinfo: stat of . failed (%s)\n", strerror(errno))); DEBUG(2,("call_trans2qfsinfo: stat of . failed (%s)\n", strerror(errno)));
return (ERROR(ERRSRV,ERRinvdevice)); return (ERROR(ERRSRV,ERRinvdevice));
} }
@ -1203,7 +1203,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
int mode=0; int mode=0;
int size=0; int size=0;
unsigned int data_size; unsigned int data_size;
struct stat sbuf; SMB_STRUCT_STAT sbuf;
pstring fname1; pstring fname1;
char *fname; char *fname;
char *p; char *p;
@ -1229,7 +1229,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
fname = &fname1[0]; fname = &fname1[0];
pstrcpy(fname,&params[6]); pstrcpy(fname,&params[6]);
unix_convert(fname,conn,0,&bad_path,&sbuf); unix_convert(fname,conn,0,&bad_path,&sbuf);
if (!check_name(fname,conn) || (!VALID_STAT(sbuf) && sys_stat(fname,&sbuf))) { if (!check_name(fname,conn) || (!VALID_STAT(sbuf) && dos_stat(fname,&sbuf))) {
DEBUG(3,("fileinfo of %s failed (%s)\n",fname,strerror(errno))); DEBUG(3,("fileinfo of %s failed (%s)\n",fname,strerror(errno)));
if((errno == ENOENT) && bad_path) if((errno == ENOENT) && bad_path)
{ {
@ -1434,7 +1434,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
int mode=0; int mode=0;
int size=0; int size=0;
struct utimbuf tvs; struct utimbuf tvs;
struct stat st; SMB_STRUCT_STAT st;
pstring fname1; pstring fname1;
char *fname; char *fname;
int fd = -1; int fd = -1;
@ -1473,7 +1473,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
return(UNIXERROR(ERRDOS,ERRbadpath)); return(UNIXERROR(ERRDOS,ERRbadpath));
} }
if(!VALID_STAT(st) && sys_stat(fname,&st)!=0) { if(!VALID_STAT(st) && dos_stat(fname,&st)!=0) {
DEBUG(3,("stat of %s failed (%s)\n", fname, strerror(errno))); DEBUG(3,("stat of %s failed (%s)\n", fname, strerror(errno)));
if((errno == ENOENT) && bad_path) if((errno == ENOENT) && bad_path)
{ {
@ -1601,7 +1601,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
} }
/* check the mode isn't different, before changing it */ /* check the mode isn't different, before changing it */
if (mode != dos_mode(conn, fname, &st) && dos_chmod(conn, fname, mode, NULL)) if (mode != dos_mode(conn, fname, &st) && file_chmod(conn, fname, mode, NULL))
{ {
DEBUG(2,("chmod of %s failed (%s)\n", fname, strerror(errno))); DEBUG(2,("chmod of %s failed (%s)\n", fname, strerror(errno)));
return(ERROR(ERRDOS,ERRnoaccess)); return(ERROR(ERRDOS,ERRnoaccess));
@ -1611,7 +1611,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
{ {
if (fd == -1) if (fd == -1)
{ {
fd = sys_open(fname,O_RDWR,0); fd = dos_open(fname,O_RDWR,0);
if (fd == -1) if (fd == -1)
{ {
return(ERROR(ERRDOS,ERRbadpath)); return(ERROR(ERRDOS,ERRbadpath));
@ -1653,7 +1653,7 @@ static int call_trans2mkdir(connection_struct *conn,
unix_convert(directory,conn,0,&bad_path,NULL); unix_convert(directory,conn,0,&bad_path,NULL);
if (check_name(directory,conn)) if (check_name(directory,conn))
ret = sys_mkdir(directory,unix_mode(conn,aDIR)); ret = dos_mkdir(directory,unix_mode(conn,aDIR));
if(ret < 0) if(ret < 0)
{ {

View File

@ -170,7 +170,7 @@ int do_compile(int codepage, char *input_file, char *output_file)
char output_buf[CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES]; char output_buf[CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES];
int num_lines = 0; int num_lines = 0;
int i = 0; int i = 0;
struct stat st; SMB_STRUCT_STAT st;
/* Get the size of the input file. Read the entire thing into memory. */ /* Get the size of the input file. Read the entire thing into memory. */
if(stat((char *)input_file, &st)!= 0) if(stat((char *)input_file, &st)!= 0)
@ -310,7 +310,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
int do_decompile( int codepage, char *input_file, char *output_file) int do_decompile( int codepage, char *input_file, char *output_file)
{ {
uint32 size = 0; uint32 size = 0;
struct stat st; SMB_STRUCT_STAT st;
char header_buf[CODEPAGE_HEADER_SIZE]; char header_buf[CODEPAGE_HEADER_SIZE];
char *buf = NULL; char *buf = NULL;
FILE *fp = NULL; FILE *fp = NULL;

View File

@ -47,7 +47,7 @@ extern pstring myhostname;
void do_global_checks(void) void do_global_checks(void)
{ {
struct stat st; SMB_STRUCT_STAT st;
if (lp_security() > SEC_SHARE && lp_revalidate(-1)) { if (lp_security() > SEC_SHARE && lp_revalidate(-1)) {
printf("WARNING: the 'revalidate' parameter is ignored in all but \ printf("WARNING: the 'revalidate' parameter is ignored in all but \
'security=share' mode.\n"); 'security=share' mode.\n");

View File

@ -496,7 +496,7 @@ handle a file download
***************************************************************************/ ***************************************************************************/
static void cgi_download(char *file) static void cgi_download(char *file)
{ {
struct stat st; SMB_STRUCT_STAT st;
char buf[1024]; char buf[1024];
int fd, l, i; int fd, l, i;
char *p; char *p;