Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 292313 Details for
Bug 390293
sys-fs/sshfs-fuse: Improve remote permissions when files and directories are created
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Port of André Frimberger's patch to sshfs-fuse 2.3
sshfs-remote-mask.patch (text/plain), 2.77 KB, created by
Richard
on 2011-11-12 19:25:30 UTC
(
hide
)
Description:
Port of André Frimberger's patch to sshfs-fuse 2.3
Filename:
MIME Type:
Creator:
Richard
Created:
2011-11-12 19:25:30 UTC
Size:
2.77 KB
patch
obsolete
>diff -uNr a/sshfs-fuse-2.3/sshfs.c b/sshfs-fuse-2.3/sshfs.c >--- a/sshfs-fuse-2.3/sshfs.c 2011-11-12 13:50:46.246310743 -0500 >+++ b/sshfs-fuse-2.3/sshfs.c 2011-11-12 13:51:59.940314851 -0500 >@@ -220,6 +220,8 @@ > int ext_statvfs; > int ext_hardlink; > mode_t mnt_mode; >+ unsigned int remote_dmask; >+ unsigned int remote_fmask; > > /* statistics */ > uint64_t bytes_sent; >@@ -314,6 +316,8 @@ > SSHFS_OPT("no_check_root", no_check_root, 1), > SSHFS_OPT("password_stdin", password_stdin, 1), > SSHFS_OPT("delay_connect", delay_connect, 1), >+ SSHFS_OPT("remote_dmask=%o", remote_dmask, 0), >+ SSHFS_OPT("remote_fmask=%o", remote_fmask, 0), > > FUSE_OPT_KEY("-p ", KEY_PORT), > FUSE_OPT_KEY("-C", KEY_COMPRESS), >@@ -1939,6 +1943,22 @@ > return err; > } > >+ >+ >+static int sshfs_chmod(const char *path, mode_t mode) >+{ >+ int err; >+ struct buffer buf; >+ buf_init(&buf, 0); >+ buf_add_path(&buf, path); >+ buf_add_uint32(&buf, SSH_FILEXFER_ATTR_PERMISSIONS); >+ buf_add_uint32(&buf, mode); >+ err = sftp_request(SSH_FXP_SETSTAT, &buf, SSH_FXP_STATUS, NULL); >+ buf_free(&buf); >+ return err; >+} >+ >+ > static int sshfs_mkdir(const char *path, mode_t mode) > { > int err; >@@ -1949,6 +1969,10 @@ > buf_add_uint32(&buf, mode); > err = sftp_request(SSH_FXP_MKDIR, &buf, SSH_FXP_STATUS, NULL); > buf_free(&buf); >+ if (!err && sshfs.remote_dmask > 0) { >+ err = sshfs_chmod(path, sshfs.remote_dmask); >+ } >+ > return err; > } > >@@ -1978,6 +2002,7 @@ > buf_free(&handle); > } > buf_free(&buf); >+ > return err; > } > >@@ -2100,18 +2125,6 @@ > return err; > } > >-static int sshfs_chmod(const char *path, mode_t mode) >-{ >- int err; >- struct buffer buf; >- buf_init(&buf, 0); >- buf_add_path(&buf, path); >- buf_add_uint32(&buf, SSH_FILEXFER_ATTR_PERMISSIONS); >- buf_add_uint32(&buf, mode); >- err = sftp_request(SSH_FXP_SETSTAT, &buf, SSH_FXP_STATUS, NULL); >- buf_free(&buf); >- return err; >-} > > static int sshfs_chown(const char *path, uid_t uid, gid_t gid) > { >@@ -2649,8 +2662,14 @@ > #if FUSE_VERSION >= 25 > static int sshfs_create(const char *path, mode_t mode, > struct fuse_file_info *fi) >-{ >- return sshfs_open_common(path, mode, fi); >+{ >+ int err; >+ err = sshfs_open_common(path, mode, fi); >+ if (!err && sshfs.remote_fmask > 0) { >+ err = sshfs_chmod(path, sshfs.remote_fmask); >+ } >+ return err; >+ > } > > static int sshfs_ftruncate(const char *path, off_t size, >@@ -2919,6 +2938,8 @@ > " -o no_check_root don't check for existence of 'dir' on server\n" > " -o password_stdin read password from stdin (only for pam_mount!)\n" > " -o SSHOPT=VAL ssh options (see man ssh_config)\n" >+" -o remote_dmask=M force directory permissions for remote directory (octal)\n" >+" -o remote_fmask=M force file permissions for remote file (octal)\n" > "\n", progname); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 390293
: 292313