summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-01 20:11:54 +0000
committerJeremy Allison <jra@samba.org>1998-09-01 20:11:54 +0000
commit18556274139cc5a00593471bd745354d98a35303 (patch)
treeb10b897359416e4c67bcaff75a5f21eefe20c996 /source3/smbd/trans2.c
parent6f53e2097d60d4b67f0859065cfa0fe01d63e28f (diff)
downloadsamba-18556274139cc5a00593471bd745354d98a35303.tar.gz
samba-18556274139cc5a00593471bd745354d98a35303.tar.bz2
samba-18556274139cc5a00593471bd745354d98a35303.zip
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 used to be commit 28aa182dbffaa4ffd86047e608400de4b26e80eb)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 3a851cfa8b..8871d568dd 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -202,7 +202,7 @@ static int call_trans2open(connection_struct *conn, char *inbuf, char *outbuf,
int unixmode;
int size=0,fmode=0,mtime=0,rmode;
SMB_INO_T inode = 0;
- struct stat sbuf;
+ SMB_STRUCT_STAT sbuf;
int smb_action = 0;
BOOL bad_path = False;
files_struct *fsp;
@@ -302,7 +302,7 @@ static int get_lanman2_dir_entry(connection_struct *conn,
{
char *dname;
BOOL found = False;
- struct stat sbuf;
+ SMB_STRUCT_STAT sbuf;
pstring mask;
pstring pathreal;
pstring fname;
@@ -376,7 +376,7 @@ static int get_lanman2_dir_entry(connection_struct *conn,
if(needslash)
pstrcat(pathreal,"/");
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)));
continue;
@@ -1062,13 +1062,13 @@ static int call_trans2qfsinfo(connection_struct *conn,
char *params = *pparams;
uint16 info_level = SVAL(params,0);
int data_len;
- struct stat st;
+ SMB_STRUCT_STAT st;
char *vname = volume_label(SNUM(conn));
int snum = SNUM(conn);
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)));
return (ERROR(ERRSRV,ERRinvdevice));
}
@@ -1203,7 +1203,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
int mode=0;
int size=0;
unsigned int data_size;
- struct stat sbuf;
+ SMB_STRUCT_STAT sbuf;
pstring fname1;
char *fname;
char *p;
@@ -1229,7 +1229,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
fname = &fname1[0];
pstrcpy(fname,&params[6]);
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)));
if((errno == ENOENT) && bad_path)
{
@@ -1434,7 +1434,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
int mode=0;
int size=0;
struct utimbuf tvs;
- struct stat st;
+ SMB_STRUCT_STAT st;
pstring fname1;
char *fname;
int fd = -1;
@@ -1473,7 +1473,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
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)));
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 */
- 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)));
return(ERROR(ERRDOS,ERRnoaccess));
@@ -1611,7 +1611,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
{
if (fd == -1)
{
- fd = sys_open(fname,O_RDWR,0);
+ fd = dos_open(fname,O_RDWR,0);
if (fd == -1)
{
return(ERROR(ERRDOS,ERRbadpath));
@@ -1653,7 +1653,7 @@ static int call_trans2mkdir(connection_struct *conn,
unix_convert(directory,conn,0,&bad_path,NULL);
if (check_name(directory,conn))
- ret = sys_mkdir(directory,unix_mode(conn,aDIR));
+ ret = dos_mkdir(directory,unix_mode(conn,aDIR));
if(ret < 0)
{