diff -Nru 9mount-1.3/9mount.1 9mount-1.3+hg20170412/9mount.1 --- 9mount-1.3/9mount.1 2008-07-22 15:53:31.000000000 +0000 +++ 9mount-1.3+hg20170412/9mount.1 2017-04-12 03:54:06.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "9mount" "1" "04 September 2007" "9mount" "User commands" +.TH "9mount" "1" "23 July 2008" "9mount" "User commands" .SH NAME 9mount, 9bind, 9umount \- mount/unmount 9p filesystems .SH SYNOPSIS @@ -55,16 +55,20 @@ export multiple trees .TP -c CACHE -turns on caching using CACHE mode. Currently only +turns on caching using CACHE mode. Supported modes are .I loose -cache mode is available, which is suitable for exclusive read-only mounts. +(suitable for exclusive read-only mounts), +.IR fscache , +and +.IR mmap . .TP -d DEBUG comma seperated list of channels for which to enable debug output. Possible channels include: err, devel, 9p, vfs, conv, mux, trans, alloc, fcall. .TP -m MSIZE -specifies the maximum length of a single 9p message in bytes. +specifies the maximum length of a single 9p message in bytes. Must be less +than or equal to 8192 for non-root users. .PP .B 9bind performs a bind mount, making the tree visible at directory OLD also visible diff -Nru 9mount-1.3/9mount.c 9mount-1.3+hg20170412/9mount.c --- 9mount-1.3/9mount.c 2008-07-22 15:53:31.000000000 +0000 +++ 9mount-1.3+hg20170412/9mount.c 2017-04-12 03:54:06.000000000 +0000 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -18,6 +19,10 @@ #define nelem(x) (sizeof(x)/sizeof(*(x))) +enum { + Maxmsize = 8192, +}; + struct {char *mnemonic; int mask;} debug_flags[] = { {"err", 0x001}, {"devel", 0x002}, @@ -92,6 +97,11 @@ if ((cp=strtok(NULL, "!"))) { errx(1, "%s: junk trailing dial string", cp); } + if (strcmp(*network, "unix") == 0) { + if (access(*netaddr, R_OK | W_OK)) { + err(1, "%s", *netaddr); + } + } } int @@ -134,6 +144,8 @@ msize = getarg('m', cp, &argv); *cp-- = '\0'; break; + default: + errx(1, "unrecognised argument '%c'", *cp); } } } else if (!dial) { @@ -163,7 +175,7 @@ if (strcmp(dial, "-") == 0) { proto = "fd"; addr = "nodev"; - append(&opts, "rfdno=0,wrfdno=1", &optlen); + append(&opts, "rfdno=0,wfdno=1", &optlen); } else { parsedial(dial, &proto, &addr, &port); } @@ -182,8 +194,10 @@ } if (cache) { - if (strcmp(cache, "loose") != 0) { - errx(1, "%s: unknown cache mode (expecting loose)", cache); + if (strcmp(cache, "loose") != 0 + && strcmp(cache, "fscache") != 0 + && strcmp(cache, "mmap") != 0) { + errx(1, "%s: unknown cache mode (expecting loose, fscache, or mmap)", cache); } snprintf(buf, sizeof(buf), "cache=%s", cache); append(&opts, buf, &optlen); @@ -206,10 +220,16 @@ } if (msize) { - if (strspn(msize, "0123456789") < strlen(msize)) { - errx(1, "%s: msize must be an integer", msize); + unsigned long nmsize; + char *end = NULL; + nmsize = strtoul(msize, &end, 10); + if (*end || nmsize == 0 || nmsize > INT_MAX) { + errx(1, "%s: msize must be a positive integer", msize); + } + if (pw->pw_uid != 0 && nmsize > Maxmsize) { + nmsize = Maxmsize; } - snprintf(buf, sizeof(buf), "msize=%s", msize); + snprintf(buf, sizeof(buf), "msize=%lu", nmsize); append(&opts, buf, &optlen); } @@ -238,6 +258,9 @@ if (!dev) { append(&opts, "nodev", &optlen); } + if (pw->pw_uid != 0) { + append(&opts, "nosuid", &optlen); + } if (uidgid) { snprintf(buf, sizeof(buf), "uid=%d,gid=%d", getuid(), getgid()); append(&opts, buf, &optlen); /* < 2.6.24 */ @@ -251,8 +274,12 @@ if (strcmp(proto, "tcp") == 0) { struct addrinfo *ai; + struct addrinfo aihints; int r; - if ((r=getaddrinfo(addr, NULL, NULL, &ai))) { + memset(&aihints, 0, sizeof(aihints)); + aihints.ai_family = AF_INET; + aihints.ai_socktype = SOCK_STREAM; + if ((r=getaddrinfo(addr, NULL, &aihints, &ai))) { errx(1, "getaddrinfo: %s", gai_strerror(r)); } if ((r=getnameinfo(ai->ai_addr, ai->ai_addrlen, buf, diff -Nru 9mount-1.3/debian/changelog 9mount-1.3+hg20170412/debian/changelog --- 9mount-1.3/debian/changelog 2018-04-03 12:11:41.000000000 +0000 +++ 9mount-1.3+hg20170412/debian/changelog 2018-09-05 08:54:25.000000000 +0000 @@ -1,8 +1,13 @@ -9mount (1.3-10build1) bionic; urgency=high +9mount (1.3+hg20170412-1) unstable; urgency=medium - * No change rebuild to pick up -fPIE compiler default + * New upstream snapshot. + * Bump Standard-Version, no changes. + * Use dh and compat level 11. + * Update the description. + * Refresh the manpage patch. + * Point Vcs-* to dgit. - -- Balint Reczey Tue, 03 Apr 2018 12:11:41 +0000 + -- Andrej Shadura Wed, 05 Sep 2018 10:54:25 +0200 9mount (1.3-10) unstable; urgency=low diff -Nru 9mount-1.3/debian/compat 9mount-1.3+hg20170412/debian/compat --- 9mount-1.3/debian/compat 2013-11-11 10:25:51.000000000 +0000 +++ 9mount-1.3+hg20170412/debian/compat 2018-09-05 08:54:25.000000000 +0000 @@ -1 +1 @@ -9 +11 diff -Nru 9mount-1.3/debian/control 9mount-1.3+hg20170412/debian/control --- 9mount-1.3/debian/control 2018-04-03 12:11:41.000000000 +0000 +++ 9mount-1.3+hg20170412/debian/control 2018-09-05 08:54:25.000000000 +0000 @@ -1,19 +1,21 @@ Source: 9mount Section: admin Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Andrew Shadura -Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.4 +Maintainer: Andrej Shadura +Build-Depends: debhelper (>= 11) +Standards-Version: 4.1.2 Homepage: http://sqweek.net/code/9mount/ +Vcs-Browser: https://browse.dgit.debian.org/9mount.git/ +Vcs-Git: https://git.dgit.debian.org/9mount Package: 9mount Architecture: linux-any Depends: ${misc:Depends}, ${shlibs:Depends} -Description: plan9 filesystem (v9fs) user mount utilities - 9mount is a set of SUID mounting tools for use with v9fs to help cope with - linux's poor mount support. +Description: Plan 9 filesystem (v9fs) user mount utilities + 9mount is a set of SUID mounting tools for use with v9fs to help + cope with Linux's poor mount support. . - The tools offer a level of security - 9mount will only let you mount over - non-sticky directories you have write access to, and 9umount will only let you - unmount 9p partitions that you mounted yourself. + The tools offer a level of security - 9mount will only let you + mount over non-sticky directories you have write access to, and + 9umount will only let you unmount 9p partitions that you mounted + yourself. diff -Nru 9mount-1.3/debian/patches/manpages.patch 9mount-1.3+hg20170412/debian/patches/manpages.patch --- 9mount-1.3/debian/patches/manpages.patch 2013-11-30 20:45:06.000000000 +0000 +++ 9mount-1.3+hg20170412/debian/patches/manpages.patch 2018-09-05 08:54:25.000000000 +0000 @@ -9,7 +9,7 @@ .PP .B 9bind OLD NEW -@@ -22,48 +22,48 @@ +@@ -22,39 +22,39 @@ .br virtio!CHANNEL .br @@ -47,8 +47,9 @@ use device mapping .TP --x +-exclusive access - other users cannot access the mount point +\-x - exclusive access - other users cannot access the mount point ++exclusive access \- other users cannot access the mount point .TP --a SPEC +\-a SPEC @@ -57,22 +58,24 @@ .TP --c CACHE +\-c CACHE - turns on caching using CACHE mode. Currently only + turns on caching using CACHE mode. Supported modes are .I loose - cache mode is available, which is suitable for exclusive read-only mounts. + (suitable for exclusive read-only mounts), +@@ -62,11 +62,11 @@ + and + .IR mmap . .TP --d DEBUG --comma seperated list of channels for which to enable debug output. Possible +\-d DEBUG -+comma separated list of channels for which to enable debug output. Possible + comma seperated list of channels for which to enable debug output. Possible channels include: err, devel, 9p, vfs, conv, mux, trans, alloc, fcall. .TP --m MSIZE +\-m MSIZE - specifies the maximum length of a single 9p message in bytes. + specifies the maximum length of a single 9p message in bytes. Must be less + than or equal to 8192 for non-root users. .PP - .B 9bind -@@ -78,16 +78,16 @@ +@@ -82,16 +82,16 @@ the uname to provide to the server. .SH EXAMPLES .TP @@ -92,3 +95,12 @@ again importing my maildir, this time serving via u9fs .SH BUGS .B 9mount +@@ -105,7 +105,7 @@ + doesn't update /etc/mtab. + .PP + .B 9bind +-only does a "shallow", non-recursive bind - any mounted filesystems ++only does a "shallow", non-recursive bind \- any mounted filesystems + under the OLD tree will not appear mounted in the NEW tree. + .PP + If you