@@ -219,6 +219,7 @@ struct sshfs {
219219 int buflimit_workaround ;
220220 int unrel_append ;
221221 int fstat_workaround ;
222+ int createmode_workaround ;
222223 int transform_symlinks ;
223224 int follow_symlinks ;
224225 int no_check_root ;
@@ -455,6 +456,8 @@ static struct fuse_opt workaround_opts[] = {
455456 SSHFS_OPT ("nobuflimit" , buflimit_workaround , 0 ),
456457 SSHFS_OPT ("fstat" , fstat_workaround , 1 ),
457458 SSHFS_OPT ("nofstat" , fstat_workaround , 0 ),
459+ SSHFS_OPT ("createmode" , createmode_workaround , 1 ),
460+ SSHFS_OPT ("nocreatemode" , createmode_workaround , 0 ),
458461 FUSE_OPT_END
459462};
460463
@@ -3100,6 +3103,9 @@ static int sshfs_statfs(const char *path, struct statvfs *buf)
31003103static int sshfs_create (const char * path , mode_t mode ,
31013104 struct fuse_file_info * fi )
31023105{
3106+ if (sshfs .createmode_workaround )
3107+ mode = 0 ;
3108+
31033109 return sshfs_open_common (path , mode , fi );
31043110}
31053111
@@ -3374,6 +3380,7 @@ static void usage(const char *progname)
33743380" [no]truncate fix truncate for old servers (default: off)\n"
33753381" [no]buflimit fix buffer fillup bug in server (default: on)\n"
33763382" [no]fstat always use stat() instead of fstat() (default: off)\n"
3383+ " [no]createmode always pass mode 0 to create (default: off)\n"
33773384" -o idmap=TYPE user/group ID mapping (default: " IDMAP_DEFAULT ")\n"
33783385" none no translation of the ID space\n"
33793386" user only translate UID/GID of connecting user\n"
@@ -3860,6 +3867,7 @@ int main(int argc, char *argv[])
38603867 sshfs .renamexdev_workaround = 0 ;
38613868 sshfs .truncate_workaround = 0 ;
38623869 sshfs .buflimit_workaround = 1 ;
3870+ sshfs .createmode_workaround = 0 ;
38633871 sshfs .ssh_ver = 2 ;
38643872 sshfs .progname = argv [0 ];
38653873 sshfs .rfd = -1 ;
0 commit comments