Fix for bug #60270
authorStuart Herbert <stuart@gentoo.org>
Sun, 19 Dec 2004 19:13:36 +0000 (19:13 +0000)
committerStuart Herbert <stuart@gentoo.org>
Sun, 19 Dec 2004 19:13:36 +0000 (19:13 +0000)
net-fs/shfs/ChangeLog
net-fs/shfs/Manifest
net-fs/shfs/files/0.35/df.patch [new file with mode: 0644]
net-fs/shfs/files/0.35/space_chars.patch [new file with mode: 0644]
net-fs/shfs/files/0.35/uidgid32.patch [new file with mode: 0644]
net-fs/shfs/files/digest-shfs-0.35-r1 [new file with mode: 0644]
net-fs/shfs/shfs-0.35-r1.ebuild [new file with mode: 0644]

index f4bf7cf57338d88607a23286a2863d02fd06e425..f3b915ffc515118423dee8d9e0d7aea4b1d9c5d6 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for net-fs/shfs
 # Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/ChangeLog,v 1.16 2004/12/15 06:40:23 stuart Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/ChangeLog,v 1.17 2004/12/19 19:13:36 stuart Exp $
+
+  19 Dec 2004; Stuart Herbert <stuart@gentoo.org> +files/0.35/df.patch,
+  +files/0.35/space_chars.patch, +files/0.35/uidgid32.patch:
+  Added patches; see bug #60270; thanks to S.Caglar Onur
+  <caglar.onur@tubitak.gov.tr>
 
   14 Dec 2004; Stuart Herbert <stuart@gentoo.org> shfs-0.35.ebuild:
   Marked stable on x86 after plenty of user feedback ;)
index f95725a8fee6e86b3a44a3dcc308fea44d5c12a3..dbaa938aa9884b09682134ce0e62aedc447a6131 100644 (file)
@@ -1,4 +1,4 @@
-MD5 674e1f818a760eb4114a8c4c20592e1c ChangeLog 2738
+MD5 b552143e5041662b8a04da6da9a7ffbb ChangeLog 2960
 MD5 9e3de9f34b9e3248eb5ff2e24ad1c819 metadata.xml 281
 MD5 696adcd66d7fd7cba917e108a97e518b shfs-0.31-r1.ebuild 2657
 MD5 d651ff3bd72489e0257c8b1f53c73056 shfs-0.31.ebuild 1757
@@ -6,6 +6,7 @@ MD5 06cff9b9f98d439bc3605a70a2cd5945 shfs-0.32-r1.ebuild 3037
 MD5 d260d17c23662e71251cf89929fe2a04 shfs-0.32.ebuild 2951
 MD5 6fb46052947475dc72b282ad2f594602 shfs-0.34.ebuild 3074
 MD5 134fdbd9defa0abc3e820e80d1800399 shfs-0.35.ebuild 3071
+MD5 d957ce9484370cb2a9e444e90b3fe0f9 shfs-0.35-r1.ebuild 3107
 MD5 d9c3f912bc5642882b84fa7f3edd8db8 files/amd.conf 842
 MD5 97e8d1e483ac538a072e0e82af787eeb files/amd.shfs 152
 MD5 6c1fade43f037362288f5f508ba5fe47 files/digest-shfs-0.31 62
@@ -19,3 +20,7 @@ MD5 a47ecfb8f1ab11f208660d0b45c1a3d7 files/shfs-gentoo-0.31-makefile-root.diff 6
 MD5 dadc96e2e75365f207cbb3e90f565821 files/shfs-gentoo-0.31-ppc.diff 707
 MD5 6313c7875b293c2a942bdad09f3937cc files/shfs-gentoo-0.32-makefile-debug.diff 657
 MD5 bdf9a4a620ff5bcd7828251c144ec02b files/shfs.mount 1346
+MD5 8bdaeb75d54befa6b5d6f2bfe6657a60 files/digest-shfs-0.35-r1 61
+MD5 29b3f063e5feb8c259abc86d07f92f85 files/0.35/df.patch 1652
+MD5 e5f37f793e95acdfd8e89affe9949160 files/0.35/space_chars.patch 1276
+MD5 29e5b080a1744f8283b8f55d5b904a60 files/0.35/uidgid32.patch 940
diff --git a/net-fs/shfs/files/0.35/df.patch b/net-fs/shfs/files/0.35/df.patch
new file mode 100644 (file)
index 0000000..0258dc4
--- /dev/null
@@ -0,0 +1,45 @@
+--- TODO       1 Jun 2004 13:03:21 -0000       1.10
++++ TODO       18 Jun 2004 12:19:52 -0000
+@@ -1,5 +1,8 @@
+ TODO for shfs:
+ 
++* revise 2.6 kernel module install (according to lk post)
++* more comprehensive error messages
++* local uid preserve..
+ * rewrite stack allocations -> kmalloc
+ * sftp server code support
+ * autoconf
+--- shfs/Linux-2.4/shell.c     3 Jun 2004 13:20:44 -0000       1.8
++++ shfs/Linux-2.4/shell.c     18 Jun 2004 12:19:52 -0000
+@@ -961,11 +961,11 @@
+ 
+       s = info->sockbuf;
+       if ((p = strsep(&s, " ")))
+-              attr->f_blocks = simple_strtoull(p, NULL, 10);
++              attr->f_blocks = simple_strtoull(p, NULL, 10) >> 2;
+       if ((p = strsep(&s, " ")))
+-              attr->f_bfree = attr->f_blocks - simple_strtoull(p, NULL, 10);
++              attr->f_bfree = attr->f_blocks - (simple_strtoull(p, NULL, 10) >> 2);
+       if ((p = strsep(&s, " ")))
+-              attr->f_bavail = simple_strtoull(p, NULL, 10);
++              attr->f_bavail = simple_strtoull(p, NULL, 10) >> 2;
+ 
+       result = sock_readln(info, info->sockbuf, SOCKBUF_SIZE);
+       if (result < 0)
+--- shfs/Linux-2.6/shell.c     3 Jun 2004 13:20:47 -0000       1.9
++++ shfs/Linux-2.6/shell.c     18 Jun 2004 12:19:53 -0000
+@@ -974,11 +974,11 @@
+ 
+       s = info->sockbuf;
+       if ((p = strsep(&s, " ")))
+-              attr->f_blocks = simple_strtoull(p, NULL, 10);
++              attr->f_blocks = simple_strtoull(p, NULL, 10) >> 2;
+       if ((p = strsep(&s, " ")))
+-              attr->f_bfree = attr->f_blocks - simple_strtoull(p, NULL, 10);
++              attr->f_bfree = attr->f_blocks - (simple_strtoull(p, NULL, 10) >> 2);
+       if ((p = strsep(&s, " ")))
+-              attr->f_bavail = simple_strtoull(p, NULL, 10);
++              attr->f_bavail = simple_strtoull(p, NULL, 10) >> 2;
+ 
+       result = sock_readln(info, info->sockbuf, SOCKBUF_SIZE);
+       if (result < 0)
diff --git a/net-fs/shfs/files/0.35/space_chars.patch b/net-fs/shfs/files/0.35/space_chars.patch
new file mode 100644 (file)
index 0000000..1c47a20
--- /dev/null
@@ -0,0 +1,66 @@
+--- shfs/Linux-2.4/shell.c     31 May 2004 16:32:13 -0000      1.6
++++ shfs/Linux-2.4/shell.c     3 Jun 2004 09:09:54 -0000
+@@ -213,6 +213,7 @@
+       int c = 0;
+       int is_space = 1;
+       int device = 0;
++      char *start = s;
+ 
+       while (*s) {
+               if (c == DIR_COLS)
+@@ -227,17 +228,20 @@
+                                               s++;
+                               }
+                               *s = '\0';
++                              start = s+1;
+                               is_space = 1;
++                      } else {
++                              if (c != DIR_NAME)
++                                      start = s+1;
+                       }
+               } else {
+                       if (is_space) {
+                               /* (b)lock/(c)haracter device hack */
+-                              col[c++] = s;
++                              col[c++] = start;
+                               is_space = 0;
+                               if ((c-1 == DIR_PERM) && ((*s == 'b')||(*s == 'c'))) {
+                                       device = 1;
+                               }
+-
+                       }
+               }
+               s++;
+--- shfs/Linux-2.6/shell.c     31 May 2004 16:32:13 -0000      1.7
++++ shfs/Linux-2.6/shell.c     3 Jun 2004 09:09:57 -0000
+@@ -225,6 +225,7 @@
+       int c = 0;
+       int is_space = 1;
+       int device = 0;
++      char *start = s;
+ 
+       while (*s) {
+               if (c == DIR_COLS)
+@@ -239,17 +240,20 @@
+                                               s++;
+                               }
+                               *s = '\0';
++                              start = s+1;
+                               is_space = 1;
++                      } else {
++                              if (c != DIR_NAME)
++                                      start = s+1;
+                       }
+               } else {
+                       if (is_space) {
+                               /* (b)lock/(c)haracter device hack */
+-                              col[c++] = s;
++                              col[c++] = start;
+                               is_space = 0;
+                               if ((c-1 == DIR_PERM) && ((*s == 'b')||(*s == 'c'))) {
+                                       device = 1;
+                               }
+-
+                       }
+               }
+               s++;
diff --git a/net-fs/shfs/files/0.35/uidgid32.patch b/net-fs/shfs/files/0.35/uidgid32.patch
new file mode 100644 (file)
index 0000000..3edb47a
--- /dev/null
@@ -0,0 +1,34 @@
+--- shfs/Linux-2.4/shfs_fs_sb.h        24 Mar 2004 13:40:02 -0000      1.2
++++ shfs/Linux-2.4/shfs_fs_sb.h        3 Jun 2004 17:12:28 -0000
+@@ -38,10 +38,10 @@
+       struct shfs_fileops fops;
+       int version;
+       int ttl;
+-      __kernel_uid_t uid;
+-      __kernel_gid_t gid;
+-      __kernel_mode_t root_mode;
+-      __kernel_mode_t fmask;
++      uid_t uid;
++      gid_t gid;
++      mode_t root_mode;
++      mode_t fmask;
+       char mount_point[SHFS_PATH_MAX];
+       struct semaphore sock_sem;      /* next 4 vars are guarded */
+       struct file *sock;
+--- shfs/Linux-2.6/shfs_fs_sb.h        24 Mar 2004 13:40:02 -0000      1.2
++++ shfs/Linux-2.6/shfs_fs_sb.h        3 Jun 2004 17:12:28 -0000
+@@ -38,10 +38,10 @@
+       struct shfs_fileops fops;
+       int version;
+       int ttl;
+-      __kernel_uid_t uid;
+-      __kernel_gid_t gid;
+-      __kernel_mode_t root_mode;
+-      __kernel_mode_t fmask;
++      uid_t uid;
++      gid_t gid;
++      mode_t root_mode;
++      mode_t fmask;
+       char mount_point[SHFS_PATH_MAX];
+       struct semaphore sock_sem;      /* next 4 vars are guarded */
+       struct file *sock;
diff --git a/net-fs/shfs/files/digest-shfs-0.35-r1 b/net-fs/shfs/files/digest-shfs-0.35-r1
new file mode 100644 (file)
index 0000000..88af63a
--- /dev/null
@@ -0,0 +1 @@
+MD5 016f49d71bc32eee2b5d11fc1600cfbe shfs-0.35.tar.gz 128656
diff --git a/net-fs/shfs/shfs-0.35-r1.ebuild b/net-fs/shfs/shfs-0.35-r1.ebuild
new file mode 100644 (file)
index 0000000..56f9513
--- /dev/null
@@ -0,0 +1,113 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/shfs/shfs-0.35-r1.ebuild,v 1.1 2004/12/19 19:13:36 stuart Exp $
+
+inherit eutils
+
+IUSE="amd doc"
+
+DESCRIPTION="Secure Shell File System"
+HOMEPAGE="http://shfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 ~ppc ~amd64"
+DEPEND="virtual/linux-sources
+               net-misc/openssh
+               amd? ( net-fs/am-utils )"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       # epatch ${FILESDIR}/shfs-gentoo-${PV}-makefile-debug.diff
+       epatch ${FILESDIR}/0.35/*.patch
+}
+
+src_compile() {
+
+       cd ${S}/shfsmount
+       emake ROOT=${D} MODULESDIR=${D}/lib/modules/${KV} \
+       KERNEL_SOURCES=/usr/src/linux || die
+
+       if [ "`echo ${KV}|grep 2.6`" ] ; then
+               cd ${S}/shfs/Linux-2.6/
+               GENTOO_ARCH=${ARCH}
+               unset ARCH
+               addwrite "/usr/src/${FK}"
+               export _POSIX2_VERSION=199209
+               emake -j1 -C /usr/src/linux SUBDIRS="`pwd`" modules     || die
+               export ARCH=GENTOO_ARCH
+       else
+               cd ${S}/shfs/Linux-2.4/
+               emake ROOT=${D} MODULESDIR=${D}/lib/modules/${KV} \
+               KERNEL_SOURCES=/usr/src/linux || die
+       fi
+
+       cd ${S}
+       emake docs || die
+}
+
+src_install() {
+       # Install kernel module
+       cd ${S}/shfs/Linux-`echo ${KV}|sed "s/^\([0-9]*\.[0-9]*\).*/\1/"`
+
+       dodir /lib/modules/${KV}/kernel/fs/shfs/
+       insinto /lib/modules/${KV}/kernel/fs/shfs/
+
+       if [ "`echo ${KV}|grep 2.6`" ] ; then
+       doins shfs.ko || die
+       else
+       doins shfs.o || die
+       fi
+
+# Install binaries
+       cd ${S}/shfsmount
+       dobin shfsmount
+       dobin shfsumount
+
+       # Allows users to mount/umount
+       einfo " Setting suid bit on /usr/bin executables..."
+       fperms 4511 /usr/bin/shfsmount
+       fperms 4511 /usr/bin/shfsumount
+
+       # Performs symlink to support use of mount(8)
+       dodir /sbin
+       einfo " Adding /sbin/mount.shfs symlink..."
+       dosym /usr/bin/shfsmount /sbin/mount.shfs
+
+       # Install docs
+       doman ${S}/docs/manpages/shfsmount.8 ${S}/docs/manpages/shfsumount.8
+       use doc && dohtml -r ${S}/docs/html
+
+       # Install automount support (if desired)
+       if use amd ; then
+               einfo " Installing am-utils config files..."
+               insinto /etc/amd
+               doins ${FILESDIR}/amd.conf
+               doins ${FILESDIR}/amd.shfs
+               exeinto /etc/amd
+               doexe ${FILESDIR}/shfs.mount
+               dosym /etc/amd/shfs.mount /etc/amd/shfs.unmount
+       fi
+}
+
+pkg_postinst() {
+       echo "running depmod...."
+       depmod -aq || die
+
+       echo " "
+       einfo " Use either 'shfsmount' or 'mount -t shfs' to mount remote"
+       einfo " filesystems to into your local filesystem.               "
+       echo " "
+       echo " "
+       einfo " Note the following:                                      "
+       einfo "                                                          "
+       einfo "   1.  The shfs kernel module has to be loaded first    "
+       einfo "       before you can start mounting filesystems.         "
+       einfo "       Try: 'modprobe shfs' as root.                        "
+       einfo "                                                          "
+       einfo "   2.  When mounting, you must enter the absolute path of "
+       einfo "       the remote filesystem without any special chars,   "
+       einfo "       such as tilde (~), for example.                    "
+       echo " "
+}