diff --git a/vfs/direntry.c b/vfs/direntry.c index 851c35fb3..6a9d01af8 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -642,7 +642,7 @@ vfs_s_chdir (struct vfs_class *me, const char *path) /* --------------------------- stat and friends ---------------------------- */ static int -vfs_s_internal_stat (struct vfs_class *me, char *path, struct stat *buf, int flag) +vfs_s_internal_stat (struct vfs_class *me, const char *path, struct stat *buf, int flag) { struct vfs_s_inode *ino; @@ -653,13 +653,13 @@ vfs_s_internal_stat (struct vfs_class *me, char *path, struct stat *buf, int fla } static int -vfs_s_stat (struct vfs_class *me, char *path, struct stat *buf) +vfs_s_stat (struct vfs_class *me, const char *path, struct stat *buf) { return vfs_s_internal_stat (me, path, buf, FL_FOLLOW); } static int -vfs_s_lstat (struct vfs_class *me, char *path, struct stat *buf) +vfs_s_lstat (struct vfs_class *me, const char *path, struct stat *buf) { return vfs_s_internal_stat (me, path, buf, FL_NONE); } diff --git a/vfs/extfs.c b/vfs/extfs.c index 0e0831e2f..d5f63cf33 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -929,14 +929,15 @@ static void extfs_stat_move( struct stat *buf, struct inode *inode ) buf->st_ctime = inode->ctime; } -static int extfs_internal_stat (char *path, struct stat *buf, int resolve) +static int extfs_internal_stat (const char *path, struct stat *buf, int resolve) { struct archive *archive; char *q; struct entry *entry; struct inode *inode; + char *path2 = g_strdup(path); - if ((q = extfs_get_path_mangle (path, &archive, 0, 0)) == NULL) + if ((q = extfs_get_path_mangle (path2, &archive, 0, 0)) == NULL) return -1; entry = extfs_find_entry (archive->root_entry, q, 0, 0); if (entry == NULL) @@ -948,12 +949,12 @@ static int extfs_internal_stat (char *path, struct stat *buf, int resolve) return 0; } -static int extfs_stat (struct vfs_class *me, char *path, struct stat *buf) +static int extfs_stat (struct vfs_class *me, const char *path, struct stat *buf) { return extfs_internal_stat (path, buf, 1); } -static int extfs_lstat (struct vfs_class *me, char *path, struct stat *buf) +static int extfs_lstat (struct vfs_class *me, const char *path, struct stat *buf) { return extfs_internal_stat (path, buf, 0); } diff --git a/vfs/local.c b/vfs/local.c index c8fbb40a8..241487602 100644 --- a/vfs/local.c +++ b/vfs/local.c @@ -107,13 +107,13 @@ local_closedir (void *data) } static int -local_stat (struct vfs_class *me, char *path, struct stat *buf) +local_stat (struct vfs_class *me, const char *path, struct stat *buf) { return stat (path, buf); } static int -local_lstat (struct vfs_class *me, char *path, struct stat *buf) +local_lstat (struct vfs_class *me, const char *path, struct stat *buf) { #ifndef HAVE_STATLSTAT return lstat (path,buf); diff --git a/vfs/mcfs.c b/vfs/mcfs.c index b27d0ad56..df0c2cde8 100644 --- a/vfs/mcfs.c +++ b/vfs/mcfs.c @@ -851,7 +851,7 @@ mcfs_get_stat_info (mcfs_connection *mc, struct stat *buf) } static int -mcfs_stat_cmd (int cmd, char *path, struct stat *buf) +mcfs_stat_cmd (int cmd, const char *path, struct stat *buf) { char *remote_file; mcfs_connection *mc; @@ -875,13 +875,13 @@ mcfs_stat_cmd (int cmd, char *path, struct stat *buf) } static int -mcfs_stat (struct vfs_class *me, char *path, struct stat *buf) +mcfs_stat (struct vfs_class *me, const char *path, struct stat *buf) { return mcfs_stat_cmd (MC_STAT, path, buf); } static int -mcfs_lstat (struct vfs_class *me, char *path, struct stat *buf) +mcfs_lstat (struct vfs_class *me, const char *path, struct stat *buf) { int path_len = strlen (path); int entry_len = strlen (mcfs_readdir_data.dent.d_name); diff --git a/vfs/sfs.c b/vfs/sfs.c index f5f8891c7..957bb80a3 100644 --- a/vfs/sfs.c +++ b/vfs/sfs.c @@ -200,13 +200,13 @@ sfs_open (struct vfs_class *me, const char *path, int flags, int mode) return sfs_info; } -static int sfs_stat (struct vfs_class *me, char *path, struct stat *buf) +static int sfs_stat (struct vfs_class *me, const char *path, struct stat *buf) { path = sfs_redirect (me, path); return stat (path, buf); } -static int sfs_lstat (struct vfs_class *me, char *path, struct stat *buf) +static int sfs_lstat (struct vfs_class *me, const char *path, struct stat *buf) { path = sfs_redirect (me, path); #ifndef HAVE_STATLSTAT diff --git a/vfs/smbfs.c b/vfs/smbfs.c index 0f07209e5..7c9c5fa17 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -1295,10 +1295,10 @@ static dir_entry *single_entry; /* stat a single file */ static int -smbfs_get_remote_stat (smbfs_connection * sc, char *path, struct stat *buf) +smbfs_get_remote_stat (smbfs_connection * sc, const char *path, struct stat *buf) { uint16 attribute = aDIR | aSYSTEM | aHIDDEN; - char *mypath = path; + char *mypath = g_strdup(path); DEBUG (3, ("smbfs_get_remote_stat(): mypath:%s\n", mypath)); @@ -1346,7 +1346,7 @@ smbfs_search_dir_entry (dir_entry *dentry, const char *text, struct stat *buf) } static int -smbfs_get_stat_info (smbfs_connection * sc, char *path, struct stat *buf) +smbfs_get_stat_info (smbfs_connection * sc, const char *path, struct stat *buf) { char *p; #if 0 @@ -1472,7 +1472,7 @@ smbfs_loaddir_by_name (struct vfs_class *me, const char *path) } static int -smbfs_stat (struct vfs_class * me, char *path, struct stat *buf) +smbfs_stat (struct vfs_class * me, const char *path, struct stat *buf) { smbfs_connection *sc; pstring server_url; diff --git a/vfs/vfs.h b/vfs/vfs.h index 18c9b2a9a..50005ffb1 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -39,8 +39,8 @@ struct vfs_class { void *(*readdir) (void *vfs_info); int (*closedir) (void *vfs_info); - int (*stat) (struct vfs_class *me, /*FIXME:const*/ char *path, struct stat * buf); - int (*lstat) (struct vfs_class *me, /*FIXME:const*/ char *path, struct stat * buf); + int (*stat) (struct vfs_class *me, const char *path, struct stat * buf); + int (*lstat) (struct vfs_class *me, const char *path, struct stat * buf); int (*fstat) (void *vfs_info, struct stat * buf); int (*chmod) (struct vfs_class *me, /*FIXME:const*/ char *path, int mode);