summaryrefslogtreecommitdiff
path: root/source3/smbd/dosmode.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/dosmode.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/dosmode.c')
-rw-r--r--source3/smbd/dosmode.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index da7fdfb973..1336e27281 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -75,7 +75,7 @@ mode_t unix_mode(connection_struct *conn,int dosmode)
/****************************************************************************
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;
@@ -139,16 +139,16 @@ int dos_mode(connection_struct *conn,char *path,struct stat *sbuf)
/*******************************************************************
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 tmp;
int unixmode;
if (!st) {
st = &st1;
- if (sys_stat(fname,st)) return(-1);
+ if (dos_stat(fname,st)) return(-1);
}
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;
}
- 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.
*******************************************************************/
int file_utime(connection_struct *conn, char *fname, struct utimbuf *times)
{
extern struct current_user current_user;
- struct stat sb;
+ SMB_STRUCT_STAT sb;
int ret = -1;
errno = 0;
- if(sys_utime(fname, times) == 0)
+ if(dos_utime(fname, times) == 0)
return 0;
if((errno != EPERM) && (errno != EACCES))
@@ -217,7 +217,7 @@ int file_utime(connection_struct *conn, char *fname, struct utimbuf *times)
(as DOS does).
*/
- if(sys_stat(fname,&sb) != 0)
+ if(dos_stat(fname,&sb) != 0)
return -1;
/* 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)))) {
/* We are allowed to become root and change the filetime. */
become_root(False);
- ret = sys_utime(fname, times);
+ ret = dos_utime(fname, times);
unbecome_root(False);
}
}