summaryrefslogtreecommitdiff
path: root/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-12-11 16:04:20 -0800
committerMichael Forney <mforney@mforney.org>2016-12-13 23:10:30 -0800
commit293f5a93b77d92fd65db7f3d0df654f102e46cfb (patch)
tree6ecd1170e3dd793862dd852814dc1b4cd5e44260 /pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch
parent9a506a6834df01a26795cea222b410f206efa9fa (diff)
Move to flat package hierarchy
Note to self: never try to move submodules again To migrate your existing submodules (more or less): set -x set -e mkdir .git/modules/pkg for old in */*/src ; do new="pkg/${old#*/}" if ! [ -f "$old/.git" ] || [ "${old%%/*}" = pkg ] ; then continue fi git -C ".git/modules/$old" config core.worktree "../../../../../$new" rmdir "$new" mv "$old" "$new" sed -e "s,$old,$new," "$new/.git" > "$new/.git.tmp" mv "$new/.git.tmp" "$new/.git" mkdir ".git/modules/${new%/src}" mv ".git/modules/$old" ".git/modules/$new" rm "${old%/src}"/*.ninja mv "${old%/src}"/*.tar.{gz,xz,bz2} "${new%/src}/" rmdir "${old%/src}" || true done sed -e 's,^\[submodule "[^/]*/,[submodule "pkg/,' .git/config > .git/config.tmp mv .git/config.tmp .git/config
Diffstat (limited to 'pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch')
-rw-r--r--pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch127
1 files changed, 127 insertions, 0 deletions
diff --git a/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch b/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch
new file mode 100644
index 00000000..1a232a7d
--- /dev/null
+++ b/pkg/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch
@@ -0,0 +1,127 @@
+From d12abc4b94f24c52637bcb19f6ac7819cf66af10 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sun, 5 Jun 2016 18:24:16 -0700
+Subject: [PATCH] Disable uidmap and gidmap support
+
+---
+ sshfs.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/sshfs.c b/sshfs.c
+index cd6abf6..9af8814 100644
+--- a/sshfs.c
++++ b/sshfs.c
+@@ -242,10 +242,12 @@ struct sshfs {
+ int disable_hardlink;
+ char *uid_file;
+ char *gid_file;
++#if 0
+ GHashTable *uid_map;
+ GHashTable *gid_map;
+ GHashTable *r_uid_map;
+ GHashTable *r_gid_map;
++#endif
+ unsigned max_read;
+ unsigned max_write;
+ unsigned ssh_ver;
+@@ -366,7 +368,9 @@ enum {
+ enum {
+ IDMAP_NONE,
+ IDMAP_USER,
++#if 0
+ IDMAP_FILE,
++#endif
+ };
+
+ enum {
+@@ -387,7 +391,9 @@ static struct fuse_opt sshfs_opts[] = {
+ SSHFS_OPT("workaround=%s", workarounds, 0),
+ SSHFS_OPT("idmap=none", idmap, IDMAP_NONE),
+ SSHFS_OPT("idmap=user", idmap, IDMAP_USER),
++#if 0
+ SSHFS_OPT("idmap=file", idmap, IDMAP_FILE),
++#endif
+ SSHFS_OPT("uidfile=%s", uid_file, 0),
+ SSHFS_OPT("gidfile=%s", gid_file, 0),
+ SSHFS_OPT("nomap=ignore", nomap, NOMAP_IGNORE),
+@@ -520,6 +526,7 @@ static int list_empty(const struct list_head *head)
+ return head->next == head;
+ }
+
++#if 0
+ /* given a pointer to the uid/gid, and the mapping table, remap the
+ * uid/gid, if necessary */
+ static inline int translate_id(uint32_t *id, GHashTable *map)
+@@ -537,6 +544,7 @@ static inline int translate_id(uint32_t *id, GHashTable *map)
+ abort();
+ }
+ }
++#endif
+
+ static inline void buf_init(struct buffer *buf, size_t size)
+ {
+@@ -784,12 +792,14 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp)
+ if (sshfs.remote_uid_detected && uid == sshfs.remote_uid)
+ uid = sshfs.local_uid;
+ #endif /* __APPLE__ */
++#if 0
+ if (sshfs.idmap == IDMAP_FILE && sshfs.uid_map)
+ if (translate_id(&uid, sshfs.uid_map) == -1)
+ return -EPERM;
+ if (sshfs.idmap == IDMAP_FILE && sshfs.gid_map)
+ if (translate_id(&gid, sshfs.gid_map) == -1)
+ return -EPERM;
++#endif
+
+ memset(stbuf, 0, sizeof(struct stat));
+ stbuf->st_mode = mode;
+@@ -2486,12 +2496,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid)
+ if (sshfs.remote_uid_detected && uid == sshfs.local_uid)
+ uid = sshfs.remote_uid;
+ #endif /* __APPLE__ */
++#if 0
+ if (sshfs.idmap == IDMAP_FILE && sshfs.r_uid_map)
+ if(translate_id(&uid, sshfs.r_uid_map) == -1)
+ return -EPERM;
+ if (sshfs.idmap == IDMAP_FILE && sshfs.r_gid_map)
+ if (translate_id(&gid, sshfs.r_gid_map) == -1)
+ return -EPERM;
++#endif
+
+ buf_init(&buf, 0);
+ buf_add_path(&buf, path);
+@@ -3805,6 +3817,7 @@ static int ssh_connect(void)
+ return 0;
+ }
+
++#if 0
+ /* number of ':' separated fields in a passwd/group file that we care
+ * about */
+ #define IDMAP_FIELDS 3
+@@ -3979,6 +3992,7 @@ static inline void load_gid_map(void)
+ {
+ read_id_map(sshfs.gid_file, &groupname_to_gid, "gid", &sshfs.gid_map, &sshfs.r_gid_map);
+ }
++#endif
+
+ #ifdef __APPLE__
+ int main(int argc, char *argv[], __unused char *envp[], char **exec_path)
+@@ -4046,6 +4060,7 @@ int main(int argc, char *argv[])
+
+ if (sshfs.idmap == IDMAP_USER)
+ sshfs.detect_uid = 1;
++#if 0
+ else if (sshfs.idmap == IDMAP_FILE) {
+ sshfs.uid_map = NULL;
+ sshfs.gid_map = NULL;
+@@ -4060,6 +4075,7 @@ int main(int argc, char *argv[])
+ if (sshfs.gid_file)
+ load_gid_map();
+ }
++#endif
+ free(sshfs.uid_file);
+ free(sshfs.gid_file);
+
+--
+2.9.0
+