Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: fuse-umfuse-ext2

fuse-umfuse-ext2 (0.4-1.2ubuntu1) disco; urgency=medium * Merge with Debian unstable; remaining changes: - Correctly release locks in op_link (LP #1674868) -- Adam Conrad <adconrad@ubuntu.com> Fri, 01 Feb 2019 14:51:03 -0700

Modifications :
  1. Download patch debian/control

    --- 0.4-1.2/debian/control 2019-02-02 00:07:14.000000000 +0000 +++ 0.4-1.2ubuntu1/debian/control 2019-02-02 00:07:14.000000000 +0000 @@ -1,8 +1,9 @@ Source: fuse-umfuse-ext2 Priority: optional -Maintainer: Debian VSquare Team <virtualsquare@cs.unibo.it> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian VSquare Team <virtualsquare@cs.unibo.it> Uploaders: Ludovico Gardenghi <garden@debian.org>, Guido Trotter <ultrotter@debian.org>, Filippo Giunchedi <filippo@debian.org> -Build-Depends: debhelper (>= 5), libumlib-dev, libfuse-dev, e2fslibs-dev, cdbs +Build-Depends: debhelper (>= 5), quilt, libumlib-dev, libfuse-dev, e2fslibs-dev, cdbs Standards-Version: 3.9.3 Homepage: http://view-os.sourceforge.net Section: misc
  2. Download patch debian/patches/series

    --- 0.4-1.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ 0.4-1.2ubuntu1/debian/patches/series 2019-02-02 00:07:14.000000000 +0000 @@ -0,0 +1 @@ +prevent-deadlock-in-symlink.diff
  3. Download patch debian/patches/prevent-deadlock-in-symlink.diff

    --- 0.4-1.2/debian/patches/prevent-deadlock-in-symlink.diff 1970-01-01 00:00:00.000000000 +0000 +++ 0.4-1.2ubuntu1/debian/patches/prevent-deadlock-in-symlink.diff 2019-02-02 00:07:14.000000000 +0000 @@ -0,0 +1,28 @@ +Description: Fix deadlock in symlink code + The existing code accidentally re-locked the global lock after manipulating + symlinks, rather than releasing it. Since the lock isn't re-entrant this + caused an immediate deadlock. This patch replaces the extra locks to unlocks + as was clearly originally intended. +Author: Andy Caldwell <andy.m.caldwell@googlemail.com> +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/fuse-umfuse-ext2/+bug/1674868 +Forwarded: no +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: fuse-umfuse-ext2-0.4/fuse-ext2/op_link.c +=================================================================== +--- fuse-umfuse-ext2-0.4.orig/fuse-ext2/op_link.c 2017-08-30 17:17:54.653157002 +0100 ++++ fuse-umfuse-ext2-0.4/fuse-ext2/op_link.c 2017-08-30 17:22:28.103157002 +0100 +@@ -101,11 +101,11 @@ + } + free_split(p_path, r_path); + debugf("done"); +- FUSE_EXT2_LOCK; ++ FUSE_EXT2_UNLOCK; + return 0; + err_free_split: + free_split(p_path, r_path); + err: +- FUSE_EXT2_LOCK; ++ FUSE_EXT2_UNLOCK; + return rc; + }

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: fuse-zip

fuse-zip (0.6.0-0ubuntu1) disco; urgency=medium * New upstream release -- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 15 Mar 2019 00:03:47 +0000 fuse-zip (0.5.0-1ubuntu1) disco; urgency=medium * implicit-read-only-dir doesn't clean up after itself Move it to the end of the run, to pass all tests. -- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 14 Mar 2019 16:49:03 +0000

Modifications :
  1. Download patch README.md

    --- 0.5.0-1/README.md 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/README.md 2019-03-12 17:56:15.000000000 +0000 @@ -13,7 +13,7 @@ paths are displayed under "ROOT" directo in directory name and "normal" files are placed under "CUR" directory. Unlike other FUSE filesystems, _only_ fuse-zip provides write support to ZIP -archives. Also, fuse-zip is faster that all known implementations on large +archives. Also, fuse-zip is faster than all known implementations on large archives with many files. You can download fuse-zip at https://bitbucket.org/agalanin/fuse-zip
  2. Download patch utils/README

    --- 0.5.0-1/utils/README 1970-01-01 00:00:00.000000000 +0000 +++ 0.6.0-0ubuntu1/utils/README 2019-03-12 17:56:15.000000000 +0000 @@ -0,0 +1 @@ +Various utils that are not a part of fuse-zip.
  3. Download patch tests/whitebox/fuseInterfaceTest.cpp

    --- 0.5.0-1/tests/whitebox/fuseInterfaceTest.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/tests/whitebox/fuseInterfaceTest.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -110,7 +110,16 @@ zip_int64_t zip_get_num_entries(zip_t *, return 0; } -int zip_error_to_str(char *, zip_uint64_t, int, int) { +void zip_error_init_with_code(zip_error_t *, int) { + assert(false); +} + +const char *zip_error_strerror(zip_error_t *) { + assert(false); + return NULL; +} + +void zip_error_fini(zip_error_t *) { assert(false); }
  4. Download patch lib/fuseZipData.h

    --- 0.5.0-1/lib/fuseZipData.h 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/fuseZipData.h 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2017 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -114,7 +114,7 @@ public: /** * Return number of files in tree */ - int numFiles () const { + size_t numFiles () const { return files.size() - 1; }
  5. Download patch config.h

    --- 0.5.0-1/config.h 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/config.h 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2018 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -22,7 +22,7 @@ #define FUSE_USE_VERSION 27 #define PROGRAM "fuse-zip" -#define VERSION "0.5.0" +#define VERSION "0.6.0" #endif
  6. Download patch lib/fileNode.cpp
  7. Download patch tests/blackbox/fuse-zip.test

    --- 0.5.0-1/tests/blackbox/fuse-zip.test 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/tests/blackbox/fuse-zip.test 2019-03-12 17:56:15.000000000 +0000 @@ -193,12 +193,17 @@ namespace eval ::fusezip::test { upvar fname fname variable binary variable mountdir + variable tmpdir variable stopped variable output variable error variable mounted variable initializationState + if {$fname eq ""} { + set fname "$tmpdir/test.zip" + } + set ns [ namespace current ] set ${ns}::status {STARTED} # if file system stopped in abnormal way, variable @@ -763,7 +768,6 @@ namespace eval ::fusezip::test { file delete $mountdir/filename.ext umount if {[ file exist $fname ]} { - puts [ exec cat $fname ] error "Archive should not exist!" } } @@ -1331,7 +1335,7 @@ namespace eval ::fusezip::test { mount -o modules=iconv,from_code=cp866 - if {[ lsort [ glob -directory $mountdir -tails * ] ] ne + if {[ lsort [ glob -directory $mountdir -nocomplain -tails * ] ] ne [ lsort "{\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.txt} \u0414\u0430\u0442\u0430" ]} { error "File names incorrectly decoded: [ glob -directory $mountdir * ]" } @@ -1339,6 +1343,25 @@ namespace eval ::fusezip::test { umount } + fstest iconv-create {Archive creation with iconv module} { + set natName "\u041B\u0435\u043D\u0438\u043D/\u041F\u0430\u0440\u0442\u0438\u044F/\u041A\u043E\u043C\u0441\u043E\u043C\u043E\u043B" + mount -o modules=iconv,from_code=cp866 + makeFile "111" $natName $mountdir + umount + + mount -o modules=iconv,from_code=cp866 + try { + set f [open "$mountdir/$natName" r] + try { + assert {[read $f] eq "111"} "bad file content" + } finally { + close $f + } + } finally { + umount + } + } + fstest rename-file {Rename file} { create { foo.bar foobar @@ -2086,7 +2109,7 @@ namespace eval ::fusezip::test { umount } - fstest special-files {Chech that special files creation is forbidden} { + fstest special-files {check that special files creation is forbidden} { mount catch { @@ -2113,6 +2136,31 @@ namespace eval ::fusezip::test { umount } + fstest inode {different files must have different inode numbers} { + create { + foo bar + moo woof + } + mount -o use_ino + + makeFile deer bee $mountdir + makeFile elks see $mountdir + + file stat $mountdir/foo stat1 + file stat $mountdir/moo stat2 + file stat $mountdir/bee stat3 + file stat $mountdir/see stat4 + + umount + + assert {$stat1(ino) != $stat2(ino)} "existing file inodes must be different" + assert {$stat3(ino) != $stat4(ino)} "new file inodes must be different" + assert {$stat1(ino) != $stat3(ino)} "all inodes must be different, 1" + assert {$stat1(ino) != $stat4(ino)} "all inodes must be different, 2" + assert {$stat2(ino) != $stat3(ino)} "all inodes must be different, 3" + assert {$stat2(ino) != $stat4(ino)} "all inodes must be different, 4" + } + finalize } namespace delete ::util::test
  8. Download patch debian/control

    --- 0.5.0-1/debian/control 2019-01-12 04:55:56.000000000 +0000 +++ 0.6.0-0ubuntu1/debian/control 2019-03-14 16:49:03.000000000 +0000 @@ -1,7 +1,8 @@ Source: fuse-zip Section: utils Priority: optional -Maintainer: Matthew Harm Bekkema <mbekkema97@gmail.com> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Matthew Harm Bekkema <mbekkema97@gmail.com> Build-Depends: debhelper (>= 10), debhelper-compat (= 12), libfuse-dev (>= 2.7),
  9. Download patch .hg_archival.txt

    --- 0.5.0-1/.hg_archival.txt 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/.hg_archival.txt 2019-03-12 17:56:15.000000000 +0000 @@ -1,4 +1,4 @@ repo: 38472f434ab14d41686baaa73679d7fe4773f0f2 -node: 046c4fa4a30abfea3e9299043e3041684e076a19 +node: 3a908d9f5e9818b2b54d273f01e4cc14d817cfed branch: default -tag: 0.5.0 +tag: 0.6.0
  10. Download patch utils/create-content-size.cpp

    --- 0.5.0-1/utils/create-content-size.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 0.6.0-0ubuntu1/utils/create-content-size.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -0,0 +1,79 @@ +#include <cerrno> +#include <cstdlib> +#include <cstring> +#include <limits> + +#include <zip.h> + +struct context +{ + zip_uint64_t offset; + long long size; +}; + +zip_int64_t callback(void *user, void *data, zip_uint64_t len, enum zip_source_cmd cmd) +{ + struct context *ctx = (struct context*)user; + switch (cmd) { + case ZIP_SOURCE_OPEN: + ctx->offset = 0; + return 0; + case ZIP_SOURCE_READ: + { + size_t nr = std::numeric_limits<size_t>::max(); + if (len < nr) + nr = static_cast<size_t>(len); + if (ctx->size - ctx->offset < nr) + nr = static_cast<size_t>(ctx->size - ctx->offset); + memset(data, 0, nr); + ctx->offset += nr; + return nr; + } + case ZIP_SOURCE_STAT: + { + struct zip_stat *st = (struct zip_stat*)data; + zip_stat_init(st); + st->valid = ZIP_STAT_SIZE | ZIP_STAT_MTIME; + st->size = ctx->size; + st->mtime = time(NULL); + return sizeof(struct zip_stat); + } + case ZIP_SOURCE_FREE: + return 0; + case ZIP_SOURCE_CLOSE: + return 0; + case ZIP_SOURCE_ERROR: + { + int *errs = static_cast<int *>(data); + errs[0] = ZIP_ER_OPNOTSUPP; + errs[1] = EINVAL; + return 2 * sizeof(int); + } + case ZIP_SOURCE_SUPPORTS: + return ZIP_SOURCE_SUPPORTS_READABLE; + default: + // indicate unsupported operation + return -1; + } +} + + +int main(int argc, char **argv) { + if (argc != 3) { + fprintf(stderr, "usage: %s <output-zip-file> <size>\n", argv[0]); + return EXIT_FAILURE; + } + + struct context ctx; + ctx.size = atoll(argv[2]); + printf("creating %s of size %llx bytes\n", argv[1], ctx.size); + + int err; + struct zip *z = zip_open(argv[1], ZIP_CREATE | ZIP_TRUNCATE, &err); + + struct zip_source *s = zip_source_function(z, callback, &ctx); + zip_add(z, "content", s); + + zip_close(z); + return 0; +}
  11. Download patch .hgsubstate

    --- 0.5.0-1/.hgsubstate 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/.hgsubstate 2019-03-12 17:56:15.000000000 +0000 @@ -1 +1 @@ -b19de5d48919f06b2dbef906515eb4b4bf3de002 wiki +eb94cae0dbea28c6ef34e59be275375c48c04062 wiki
  12. Download patch lib/bigBuffer.h

    --- 0.5.0-1/lib/bigBuffer.h 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/bigBuffer.h 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2017 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -52,28 +52,28 @@ private: zip_uint64_t len, enum zip_source_cmd cmd); /** - * Return number of chunks needed to keep 'offset' bytes. + * Return number of chunks needed to keep 'size' bytes. */ - inline static unsigned int chunksCount(zip_uint64_t offset) { - return (offset + chunkSize - 1) / chunkSize; + inline static size_t chunksCount(size_t size) { + return (size + chunkSize - 1) / chunkSize; } /** * Return number of chunk where 'offset'-th byte is located. */ - inline static unsigned int chunkNumber(zip_uint64_t offset) { + inline static size_t chunkNumber(size_t offset) { return offset / chunkSize; } /** * Return offset inside chunk to 'offset'-th byte. */ - inline static int chunkOffset(zip_uint64_t offset) { + inline static unsigned int chunkOffset(size_t offset) { return offset % chunkSize; } public: - zip_uint64_t len; + size_t len; /** * Create new file buffer without mapping to file in a zip archive @@ -90,7 +90,7 @@ public: * std::exception On file read error * std::bad_alloc On memory insufficiency */ - BigBuffer(struct zip *z, zip_uint64_t nodeId, zip_uint64_t length); + BigBuffer(struct zip *z, zip_uint64_t nodeId, size_t length); ~BigBuffer(); @@ -105,7 +105,7 @@ public: * @param offset offset to start reading from * @return number of bytes read */ - int read(char *buf, size_t size, zip_uint64_t offset) const; + int read(char *buf, size_t size, size_t offset) const; /** * Dispatch write request to chunks of a file and grow 'chunks' vector if @@ -119,7 +119,7 @@ public: * @throws * std::bad_alloc If there are no memory for buffer */ - int write(const char *buf, size_t size, zip_uint64_t offset); + int write(const char *buf, size_t size, size_t offset); /** * Create (or replace) file element in zip file. Class instance should @@ -147,7 +147,7 @@ public: * @throws * std::bad_alloc If insufficient memory available */ - void truncate(zip_uint64_t offset); + void truncate(size_t offset); }; #endif
  13. Download patch lib/fuse-zip.cpp

    --- 0.5.0-1/lib/fuse-zip.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/fuse-zip.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2017 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -22,7 +22,13 @@ #include "../config.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" + #include <fuse.h> + +#pragma GCC diagnostic pop + #include <zip.h> #include <unistd.h> #include <limits.h> @@ -51,9 +57,10 @@ FuseZipData *initFuseZip(const char *pro int flags = (readonly) ? ZIP_RDONLY : ZIP_CREATE; if ((zip_file = zip_open(fileName, flags, &err)) == NULL) { - char err_str[ERROR_STR_BUF_LEN]; - zip_error_to_str(err_str, ERROR_STR_BUF_LEN, err, errno); - fprintf(stderr, "%s: cannot open ZIP archive %s: %s\n", program, fileName, err_str); + zip_error_t error; + zip_error_init_with_code(&error, err); + fprintf(stderr, "%s: cannot open ZIP archive %s: %s\n", program, fileName, zip_error_strerror(&error)); + zip_error_fini(&error); return data; } @@ -137,9 +144,11 @@ int fusezip_getattr(const char *path, st } stbuf->st_mode = node->mode(); stbuf->st_blksize = STANDARD_BLOCK_SIZE; - stbuf->st_ino = node->id; - stbuf->st_blocks = (node->size() + STANDARD_BLOCK_SIZE - 1) / STANDARD_BLOCK_SIZE; - stbuf->st_size = node->size(); + // Interpreting pointer as ulong without loss of data is valid for LP32, ILP32, LP64 and ILP64 data models. + // The only well-known data model that break this is LLP64 (Win64 API). + stbuf->st_ino = reinterpret_cast<unsigned long>(node); + stbuf->st_blocks = static_cast<blkcnt_t>((node->size() + STANDARD_BLOCK_SIZE - 1) / STANDARD_BLOCK_SIZE); + stbuf->st_size = static_cast<off_t>(node->size()); stbuf->st_atime = node->atime(); stbuf->st_mtime = node->mtime(); stbuf->st_ctime = node->ctime(); @@ -260,13 +269,17 @@ int fusezip_mknod(const char *path, mode int fusezip_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { (void) path; - return ((FileNode*)fi->fh)->read(buf, size, offset); + if (offset < 0) + return -EINVAL; + return ((FileNode*)fi->fh)->read(buf, size, static_cast<size_t>(offset)); } int fusezip_write(const char *path, const char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { (void) path; - return ((FileNode*)fi->fh)->write(buf, size, offset); + if (offset < 0) + return -EINVAL; + return ((FileNode*)fi->fh)->write(buf, size, static_cast<size_t>(offset)); } int fusezip_release (const char *path, struct fuse_file_info *fi) { @@ -278,13 +291,17 @@ int fusezip_release (const char *path, s int fusezip_ftruncate(const char *path, off_t offset, struct fuse_file_info *fi) { (void) path; - return -((FileNode*)fi->fh)->truncate(offset); + if (offset < 0) + return -EINVAL; + return -((FileNode*)fi->fh)->truncate(static_cast<size_t>(offset)); } int fusezip_truncate(const char *path, off_t offset) { if (*path == '\0') { return -EACCES; } + if (offset < 0) + return -EINVAL; FileNode *node = get_file_node(path + 1); if (node == NULL) { return -ENOENT; @@ -296,7 +313,7 @@ int fusezip_truncate(const char *path, o if ((res = node->open()) != 0) { return res; } - if ((res = node->truncate(offset)) != 0) { + if ((res = node->truncate(static_cast<size_t>(offset))) != 0) { node->close(); return -res; } @@ -338,7 +355,7 @@ int fusezip_mkdir(const char *path, mode if (*path == '\0') { return -ENOENT; } - zip_int64_t idx = zip_dir_add(get_zip(), path + 1, ZIP_FL_ENC_UTF_8); + zip_int64_t idx = zip_dir_add(get_zip(), path + 1, ZIP_FL_ENC_GUESS); if (idx < 0) { return -ENOMEM; } @@ -370,8 +387,8 @@ int fusezip_rename(const char *path, con } } - int len = strlen(new_path); - int oldLen = strlen(path + 1) + 1; + size_t len = strlen(new_path); + size_t oldLen = strlen(path + 1) + 1; std::string new_name; if (!node->is_dir) { --len; @@ -405,8 +422,8 @@ int fusezip_rename(const char *path, con if (nn->is_dir) { strcat(name, "/"); } - if (nn->id >= 0) { - zip_file_rename(z, nn->id, name, ZIP_FL_ENC_UTF_8); + if (nn->present_in_zip()) { + zip_file_rename(z, nn->id(), name, ZIP_FL_ENC_GUESS); } // changing child list may cause loop iterator corruption get_data()->renameNode (nn, name, false); @@ -415,8 +432,8 @@ int fusezip_rename(const char *path, con } } } - if (node->id >= 0) { - zip_file_rename(z, node->id, new_name.c_str(), ZIP_FL_ENC_UTF_8); + if (node->present_in_zip()) { + zip_file_rename(z, node->id(), new_name.c_str(), ZIP_FL_ENC_GUESS); } get_data()->renameNode (node, new_name.c_str(), true);
  14. Download patch tests/whitebox/zip_open_failure.cpp

    --- 0.5.0-1/tests/whitebox/zip_open_failure.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/tests/whitebox/zip_open_failure.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -27,8 +27,14 @@ struct zip *zip_open(const char *, int, return NULL; } -int zip_error_to_str(char *buf, zip_uint64_t len, int, int) { - return strncpy(buf, "Expected error", len) - buf; +void zip_error_init_with_code(zip_error_t *, int) { +} + +const char *zip_error_strerror(zip_error_t *) { + return "Expected error"; +} + +void zip_error_fini(zip_error_t *) { } // only stubs
  15. Download patch lib/extraField.cpp

    --- 0.5.0-1/lib/extraField.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/extraField.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2014-2017 by Alexander Galanin // +// Copyright (C) 2014-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -24,16 +24,16 @@ unsigned long ExtraField::getLong (const zip_uint8_t *&data) { unsigned long t = *data++; - t += *data++ << 8; - t += *data++ << 16; - t += *data++ << 24; + t += static_cast<unsigned long>(*data++ << 8); + t += static_cast<unsigned long>(*data++ << 16); + t += static_cast<unsigned long>(*data++ << 24); return t; } unsigned short ExtraField::getShort (const zip_uint8_t *&data) { unsigned short t = *data++; - t += *data++ << 8; + t = static_cast<unsigned short>(t + (*data++ << 8)); return t; } @@ -55,20 +55,20 @@ ExtraField::parseExtTimeStamp (zip_uint1 if (data + 4 > end) { return false; } - mtime = (time_t)getLong(data); + mtime = static_cast<time_t>(getLong(data)); } if (hasATime) { if (data + 4 > end) { return false; } - atime = (time_t)getLong(data); + atime = static_cast<time_t>(getLong(data)); } // only check that data format is correct if (hasCreTime) { if (data + 4 > end) { return false; } - cretime = (time_t)getLong(data); + cretime = static_cast<time_t>(getLong(data)); } return true; @@ -92,19 +92,19 @@ ExtraField::createExtTimeStamp (zip_flag data[len++] = flags; for (int i = 0; i < 4; ++i) { - data[len++] = mtime & 0xFF; + data[len++] = static_cast<unsigned char>(mtime); mtime >>= 8; } // The central-header extra field contains the modification time only, // or no timestamp at all. if (location == ZIP_FL_LOCAL) { for (int i = 0; i < 4; ++i) { - data[len++] = atime & 0xFF; + data[len++] = static_cast<unsigned char>(atime); atime >>= 8; } if (set_cretime) { for (int i = 0; i < 4; ++i) { - data[len++] = cretime & 0xFF; + data[len++] = static_cast<unsigned char>(cretime); cretime >>= 8; } } @@ -125,8 +125,8 @@ ExtraField::parseSimpleUnixField (zip_ui if (data + 12 > end) { return false; } - atime = getLong (data); - mtime = getLong (data); + atime = static_cast<time_t>(getLong(data)); + mtime = static_cast<time_t>(getLong(data)); uid = getShort (data); gid = getShort (data); break; @@ -159,7 +159,7 @@ ExtraField::parseSimpleUnixField (zip_ui } p = data + lenUid; uid = 0; - int overflowBytes = sizeof(uid_t) - lenUid; + int overflowBytes = static_cast<int>(sizeof(uid_t)) - lenUid; while (--p >= data) { if (overflowBytes > 0 && *p != 0) { // UID overflow @@ -179,7 +179,7 @@ ExtraField::parseSimpleUnixField (zip_ui } p = data + lenGid; gid = 0; - overflowBytes = sizeof(gid_t) - lenGid; + overflowBytes = static_cast<int>(sizeof(gid_t)) - lenGid; while (--p >= data) { if (overflowBytes > 0 && *p != 0) { // GID overflow
  16. Download patch lib/fuseZipData.cpp

    --- 0.5.0-1/lib/fuseZipData.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/fuseZipData.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2018 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -64,7 +64,7 @@ void FuseZipData::build_tree(bool readon bool needPrefix = false; if (readonly) { for (zip_int64_t i = 0; i < n; ++i) { - const char *name = zip_get_name(m_zip, i, ZIP_FL_ENC_RAW); + const char *name = zip_get_name(m_zip, static_cast<zip_uint64_t>(i), ZIP_FL_ENC_RAW); if ((name[0] == '/') || (strncmp(name, "../", 3) == 0)) { needPrefix = true; } @@ -72,7 +72,7 @@ void FuseZipData::build_tree(bool readon } // add zip entries into tree for (zip_int64_t i = 0; i < n; ++i) { - const char *name = zip_get_name(m_zip, i, ZIP_FL_ENC_RAW); + const char *name = zip_get_name(m_zip, static_cast<zip_uint64_t>(i), ZIP_FL_ENC_RAW); std::string converted; convertFileName(name, readonly, needPrefix, converted); const char *cname = converted.c_str(); @@ -121,9 +121,10 @@ int FuseZipData::removeNode(FileNode *no node->parent->setCTime (time(NULL)); files.erase(node->full_name.c_str()); - zip_int64_t id = node->id; + bool present = node->present_in_zip(); + zip_uint64_t id = node->id(); delete node; - if (id >= 0) { + if (present) { return (zip_delete (m_zip, id) == 0)? 0 : ENOENT; } else { return 0; @@ -189,7 +190,7 @@ void FuseZipData::convertFileName(const (cur - start == 2 && start[0] == '.' && start[1] == '.')) { throw std::runtime_error(std::string("bad file name: ") + orig); } - converted.append(start, cur - start + 1); + converted.append(start, static_cast<size_t>(cur - start + 1)); start = cur + 1; } // end of string is reached @@ -272,13 +273,13 @@ void FuseZipData::save () { if (node->isTemporaryDir()) { // persist temporary directory zip_int64_t idx = zip_dir_add(m_zip, - node->full_name.c_str(), ZIP_FL_ENC_UTF_8); + node->full_name.c_str(), ZIP_FL_ENC_GUESS); if (idx < 0) { syslog(LOG_ERR, "Unable to save directory %s in ZIP archive", node->full_name.c_str()); continue; } - node->id = idx; + node->set_id(idx); } int res = node->saveMetadata(); if (res != 0) {
  17. Download patch INSTALL

    --- 0.5.0-1/INSTALL 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/INSTALL 2019-03-12 17:56:15.000000000 +0000 @@ -1,7 +1,7 @@ You need the following libraries: libfuse >= 2.7 http://fuse.sourceforge.net -libzip >= 0.11.2 http://www.nih.at/libzip/ +libzip >= 1.0 http://libzip.org The following tools are required:
  18. Download patch changelog

    --- 0.5.0-1/changelog 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/changelog 2019-03-12 17:56:15.000000000 +0000 @@ -1,3 +1,14 @@ +2019-03-12 Alexander Galanin <al@galanin.nnov.ru> + + * Released 0.6.0: + - Fixed incompatibility with iconv module. + - inode numbers is now unique. + - Include libzip version on --version output. + - Set minimum libzip version to 1.0, remove deprecated functions usage. + - Fixed extended set of compiler warnings (type conversion, old style + casts..). + - Added debug utils. + 2018-02-04 Alexander Galanin <al@galanin.nnov.ru> * Released 0.5.0: - #54: Force open in read-only mode if archive file or its parent
  19. Download patch tests/whitebox/filename_validator.cpp

    --- 0.5.0-1/tests/whitebox/filename_validator.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/tests/whitebox/filename_validator.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -32,9 +32,17 @@ struct zip *zip_open(const char *, int, return NULL; } -int zip_error_to_str(char *, zip_uint64_t, int, int) { +void zip_error_init_with_code(zip_error_t *, int) { + assert(false); +} + +const char *zip_error_strerror(zip_error_t *) { + assert(false); + return NULL; +} + +void zip_error_fini(zip_error_t *) { assert(false); - return 0; } const char *zip_get_name(struct zip *, zip_uint64_t, zip_flags_t) {
  20. Download patch lib/fileNode.h

    --- 0.5.0-1/lib/fileNode.h 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/fileNode.h 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2017 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -42,6 +42,7 @@ private: NEW_DIR }; + zip_int64_t _id; BigBuffer *buffer; struct zip *zip; int open_count; @@ -108,12 +109,12 @@ public: void rename (const char *new_name); int open(); - int read(char *buf, size_t size, zip_uint64_t offset); - int write(const char *buf, size_t size, zip_uint64_t offset); + int read(char *buf, size_t size, size_t offset); + int write(const char *buf, size_t size, size_t offset); int close(); /** - * Invoke zip_add() or zip_replace() for file to save it. + * Invoke zip_file_add() or zip_file_replace() for file to save it. * Should be called only if item is needed to ba saved into zip file. * * @return 0 if success, != 0 on error @@ -135,7 +136,7 @@ public: * EIO If insufficient memory available (because ENOMEM not * listed in truncate() error codes) */ - int truncate(zip_uint64_t offset); + int truncate(size_t offset); inline bool isChanged() const { return state == CHANGED || state == NEW; @@ -146,7 +147,7 @@ public: } inline bool isTemporaryDir() const { - return (state == NEW_DIR) && (id == NEW_NODE_INDEX); + return (state == NEW_DIR) && (_id == NEW_NODE_INDEX); } /** @@ -180,7 +181,7 @@ public: //TODO: rewrite without memory allocation inline std::string getParentName () const { if (name > full_name.c_str()) { - return std::string (full_name, 0, name - full_name.c_str() - 1); + return std::string (full_name, 0, static_cast<size_t>(name - full_name.c_str() - 1)); } else { return ""; } @@ -200,10 +201,17 @@ public: zip_uint64_t size() const; + bool present_in_zip() const { return _id >= 0; } + zip_uint64_t id() const { return static_cast<zip_uint64_t>(_id); } + + void set_id(zip_int64_t id_) { + _id = id_; + // called only from FuseZipData::save, so we're don't worry about 'status' variable value + } + const char *name; std::string full_name; bool is_dir; - zip_int64_t id; nodelist_t childs; FileNode *parent; };
  21. Download patch lib/Makefile

    --- 0.5.0-1/lib/Makefile 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/Makefile 2019-03-12 17:56:15.000000000 +0000 @@ -1,7 +1,7 @@ DEST=libfusezip.a LIBS=$(shell pkg-config fuse --libs) $(shell pkg-config libzip --libs) -CXXFLAGS=-g -O0 -Wall -Wextra -pedantic -Werror -RELEASE_CXXFLAGS=-O2 -Wall -Wextra -pedantic -Werror +CXXFLAGS=-g -O0 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror +RELEASE_CXXFLAGS=-O2 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror FUSEFLAGS=$(shell pkg-config fuse --cflags) ZIPFLAGS=$(shell pkg-config libzip --cflags) SOURCES=$(sort $(wildcard *.cpp)) @@ -16,12 +16,8 @@ release: $(DEST): $(OBJECTS) $(AR) -cr $@ $(OBJECTS) -# fuse-zip.cpp must be compiled separately with FUSEFLAGS -fuse-zip.o: fuse-zip.cpp - $(CXX) -c $(CXXFLAGS) $(FUSEFLAGS) $(ZIPFLAGS) $< -o $@ - .cpp.o: - $(CXX) -c $(CXXFLAGS) $(ZIPFLAGS) $< -o $@ + $(CXX) -c $(CXXFLAGS) $(FUSEFLAGS) $(ZIPFLAGS) $< -o $@ clean: rm -f $(DEST) $(OBJECTS)
  22. Download patch lib/bigBuffer.cpp

    --- 0.5.0-1/lib/bigBuffer.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/lib/bigBuffer.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2017 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -17,11 +17,15 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>.// //////////////////////////////////////////////////////////////////////////// +#include <cassert> #include <cerrno> #include <cstdlib> #include <cstring> -#include <string> +#include <limits> #include <stdexcept> +#include <string> + +#include <limits.h> #include <syslog.h> #include "bigBuffer.h" @@ -98,7 +102,7 @@ public: * @return Number of bytes actually read. It can differ with 'count' * if offset+count>chunkSize. */ - size_t read(char *dest, zip_uint64_t offset, size_t count) const { + size_t read(char *dest, unsigned int offset, size_t count) const { if (offset + count > chunkSize) { count = chunkSize - offset; } @@ -124,7 +128,7 @@ public: * @throws * std::bad_alloc If there are no memory for buffer */ - size_t write(const char *src, zip_uint64_t offset, size_t count) { + size_t write(const char *src, unsigned int offset, size_t count) { if (offset + count > chunkSize) { count = chunkSize - offset; } @@ -144,7 +148,7 @@ public: /** * Clear tail of internal buffer with zeroes starting from 'offset'. */ - void clearTail(zip_uint64_t offset) { + void clearTail(unsigned int offset) { if (m_ptr != NULL && offset < chunkSize) { memset(m_ptr + offset, 0, chunkSize - offset); } @@ -155,18 +159,18 @@ public: BigBuffer::BigBuffer(): len(0) { } -BigBuffer::BigBuffer(struct zip *z, zip_uint64_t nodeId, zip_uint64_t length): +BigBuffer::BigBuffer(struct zip *z, zip_uint64_t nodeId, size_t length): len(length) { struct zip_file *zf = zip_fopen_index(z, nodeId, 0); if (zf == NULL) { syslog(LOG_WARNING, "%s", zip_strerror(z)); throw std::runtime_error(zip_strerror(z)); } - unsigned int ccount = chunksCount(length); + size_t ccount = chunksCount(length); chunks.resize(ccount, ChunkWrapper()); - unsigned int chunk = 0; + size_t chunk = 0; while (length > 0) { - zip_uint64_t readSize = chunkSize; + size_t readSize = chunkSize; if (readSize > length) { readSize = length; } @@ -178,7 +182,7 @@ BigBuffer::BigBuffer(struct zip *z, zip_ throw std::runtime_error(err); } ++chunk; - length -= nr; + length -= static_cast<size_t>(nr); if ((nr == 0 || chunk == ccount) && length != 0) { // Allocated memory are exhausted, but there are unread bytes (or // file is longer that given length). Possibly CRC error. @@ -197,16 +201,18 @@ BigBuffer::BigBuffer(struct zip *z, zip_ BigBuffer::~BigBuffer() { } -int BigBuffer::read(char *buf, size_t size, zip_uint64_t offset) const { +int BigBuffer::read(char *buf, size_t size, size_t offset) const { if (offset > len) { return 0; } - int chunk = chunkNumber(offset); - int pos = chunkOffset(offset); - if (size > unsigned(len - offset)) { + size_t chunk = chunkNumber(offset); + unsigned int pos = chunkOffset(offset); + if (size > len - offset) { size = len - offset; } - int nread = size; + if (size > INT_MAX) + size = INT_MAX; + int nread = static_cast<int>(size); while (size > 0) { size_t r = chunks[chunk].read(buf, pos, size); @@ -218,10 +224,12 @@ int BigBuffer::read(char *buf, size_t si return nread; } -int BigBuffer::write(const char *buf, size_t size, zip_uint64_t offset) { - int chunk = chunkNumber(offset); - int pos = chunkOffset(offset); - int nwritten = size; +int BigBuffer::write(const char *buf, size_t size, size_t offset) { + size_t chunk = chunkNumber(offset); + unsigned int pos = chunkOffset(offset); + if (size > INT_MAX) + size = INT_MAX; + int nwritten = static_cast<int>(size); if (offset > len) { if (chunkNumber(len) < chunksCount(len)) { @@ -243,7 +251,7 @@ int BigBuffer::write(const char *buf, si return nwritten; } -void BigBuffer::truncate(zip_uint64_t offset) { +void BigBuffer::truncate(size_t offset) { chunks.resize(chunksCount(offset)); if (offset > len && chunkNumber(len) < chunksCount(len)) { @@ -263,8 +271,11 @@ zip_int64_t BigBuffer::zipUserFunctionCa return 0; } case ZIP_SOURCE_READ: { - int r = b->buf->read((char*)data, len, b->pos); - b->pos += r; + size_t rlen = std::numeric_limits<size_t>::max(); + if (len < rlen) + rlen = static_cast<size_t>(len); + int r = b->buf->read((char*)data, rlen, b->pos); + b->pos += static_cast<unsigned int>(r); return r; } case ZIP_SOURCE_STAT: { @@ -285,18 +296,12 @@ zip_int64_t BigBuffer::zipUserFunctionCa // This code should not be called in normal case because none of // implemented functions raises error flag. int *errs = static_cast<int *>(data); -#if LIBZIP_VERSION_MAJOR >= 1 errs[0] = ZIP_ER_OPNOTSUPP; -#else - errs[0] = ZIP_ER_INVAL; -#endif errs[1] = EINVAL; return 2 * sizeof(int); } -#if LIBZIP_VERSION_MAJOR >= 1 case ZIP_SOURCE_SUPPORTS: return ZIP_SOURCE_SUPPORTS_READABLE; -#endif default: // indicate unsupported operation return -1; @@ -313,15 +318,23 @@ int BigBuffer::saveToZip(time_t mtime, s delete cbs; return -ENOMEM; } - zip_int64_t nid; - if ((newFile && (nid = zip_file_add(z, fname, s, ZIP_FL_ENC_UTF_8)) < 0) - || (!newFile && zip_file_replace(z, index, s, ZIP_FL_ENC_UTF_8) < 0)) { + if (newFile) { + zip_int64_t nid = zip_file_add(z, fname, s, ZIP_FL_ENC_GUESS); + if (nid < 0) { + delete cbs; + zip_source_free(s); + return -ENOMEM; + } else { + // indices are actually in range [0..2^63-1] + index = nid; + } + } else { + assert(index >= 0); + if (zip_file_replace(z, static_cast<zip_uint64_t>(index), s, ZIP_FL_ENC_GUESS) < 0) { delete cbs; zip_source_free(s); return -ENOMEM; } - if (newFile) { - index = nid; } return 0; }
  23. Download patch Makefile

    --- 0.5.0-1/Makefile 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/Makefile 2019-03-12 17:56:15.000000000 +0000 @@ -9,8 +9,8 @@ man1dir=$(mandir)/man1 manext=.1 LIBS=-Llib -lfusezip $(shell pkg-config fuse --libs) $(shell pkg-config libzip --libs) LIB=lib/libfusezip.a -CXXFLAGS=-g -O0 -Wall -Wextra -pedantic -Werror -RELEASE_CXXFLAGS=-O2 -Wall -Wextra -pedantic -Werror +CXXFLAGS=-g -O0 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror +RELEASE_CXXFLAGS=-O2 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror FUSEFLAGS=$(shell pkg-config fuse --cflags) ZIPFLAGS=$(shell pkg-config libzip --cflags) SOURCES=main.cpp @@ -33,7 +33,6 @@ $(DEST): $(OBJECTS) $(LIB) $(CXX) $(OBJECTS) $(LDFLAGS) $(LIBS) \ -o $@ -# main.cpp must be compiled separately with FUSEFLAGS main.o: main.cpp $(CXX) -c $(CXXFLAGS) $(FUSEFLAGS) $(ZIPFLAGS) $< \ -Ilib \
  24. Download patch .hgignore

    --- 0.5.0-1/.hgignore 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/.hgignore 2019-03-12 17:56:15.000000000 +0000 @@ -16,3 +16,6 @@ tests/whitebox/*.x # other related projects (needed for performance tests) others +# utils +utils/dump-extrafld +utils/create-content-size
  25. Download patch fuse-zip.1

    --- 0.5.0-1/fuse-zip.1 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/fuse-zip.1 2019-03-12 17:56:15.000000000 +0000 @@ -44,7 +44,7 @@ is a FUSE filesystem, that enables any p Unlike KIO or Gnome VFS, it can be used in any application without modifications. Unlike other FUSE filesystems, only fuse\-zip provides write support to ZIP archives. -Also, fuse\-zip is faster that all known implementations on large archives with many files. +Also, fuse\-zip is faster than all known implementations on large archives with many files. Since version 0.3.0 fuse-zip has support for absolute and parent-relative paths in file names, but only in read-only mode (-r command line switch). Absolute
  26. Download patch utils/dump-extrafld.cpp

    --- 0.5.0-1/utils/dump-extrafld.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 0.6.0-0ubuntu1/utils/dump-extrafld.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -0,0 +1,172 @@ +#include <time.h> +#include <stdlib.h> +#include <string.h> +#include <zip.h> + +#include "lib/extraField.h" + +void print_time (const char *label, time_t time) { + char str[1024]; + time_t t = (time_t)time; + struct tm *tmp; + tmp = localtime(&t); + if (tmp == NULL) { + perror("localtime"); + exit(EXIT_FAILURE); + } + if (strftime(str, sizeof(str), "%a, %d %b %Y %T %z", tmp) == 0) { + fprintf(stderr, "strftime returned 0"); + exit(EXIT_FAILURE); + } + + printf(" %s: %s\n", label, str); +} + +void dump_extrafld(zip_uint16_t id, zip_uint16_t len, const zip_uint8_t *field, bool central) { + const zip_uint8_t *end = field + len; + for (const zip_uint8_t *f = field; f < end; ++f) { + printf("0x%02X, ", *f); + } + printf("\n"); + switch (id) { + case FZ_EF_TIMESTAMP: { + bool has_mtime, has_atime, has_cretime; + time_t mtime, atime, cretime; + ExtraField::parseExtTimeStamp (len, field, has_mtime, mtime, has_atime, atime, has_cretime, cretime); + printf(" extended timestamp\n"); + unsigned char flags = *field; + printf(" flags %d: mod %d acc %d cre %d\n", flags, has_mtime, has_atime, has_cretime); + if (has_mtime) { + print_time("mtime", mtime); + } + if (!central) { + if (has_atime) { + print_time("atime", atime); + } + if (has_cretime) { + print_time("cretime", cretime); + } + } + break; + } + + case FZ_EF_PKWARE_UNIX: + case FZ_EF_INFOZIP_UNIX1: + case FZ_EF_INFOZIP_UNIX2: + { + switch (id) + { + case FZ_EF_PKWARE_UNIX: + printf(" PKWare Unix\n"); + break; + case FZ_EF_INFOZIP_UNIX1: + printf(" Info-ZIP Unix v1\n"); + break; + case FZ_EF_INFOZIP_UNIX2: + printf(" Info-ZIP Unix v2\n"); + break; + } + if (central) + break; + bool has_mtime, has_atime; + time_t mtime, atime; + uid_t uid; + gid_t gid; + bool res = ExtraField::parseSimpleUnixField(id, len, field, uid, gid, has_mtime, mtime, has_atime, atime); + if (!res) { + printf(" parse failed\n"); + break; + } + printf(" UID %u\n", uid); + printf(" GID %u\n", gid); + if (has_atime) { + print_time("atime", atime); + } + if (has_mtime) { + print_time("mtime", mtime); + } + break; + } + + case FZ_EF_INFOZIP_UNIXN: { + printf(" Info-ZIP Unix (new)\n"); + if (len < 2) break; + unsigned char version = *field++; + printf(" version %d\n", version); + int l = *field++, shift = 0; + printf(" len(UID) %d\n", l); + if (field + l > end) break; + unsigned long long uid = 0, gid = 0; + while (l-- > 0) { + uid = uid + (*field++ << shift); + shift += 8; + } + printf(" UID %llu\n", uid); + l = *field++; + shift = 0; + printf(" len(GID) %d\n", l); + if (field + l > end) break; + while (l-- > 0) { + gid = gid + (*field++ << shift); + shift += 8; + } + printf(" GID %llu\n", gid); + break; + } + } +} + +int main(int argc, char **argv) { + if (argc != 2) { + fprintf(stderr, "usage: %s <zip-file>\n", argv[0]); + return EXIT_FAILURE; + } + + int err; + struct zip *z = zip_open(argv[1], 0, &err); + if (z == NULL) { + fprintf(stderr, "file open error\n"); + return EXIT_FAILURE; + } + + for (zip_int64_t i = 0; i < zip_get_num_entries(z, 0); ++i) { + zip_uint8_t opsys; + zip_uint32_t attr; + zip_file_get_external_attributes(z, i, 0, &opsys, &attr); + const char *opsys_s; + switch (opsys) + { + case ZIP_OPSYS_UNIX: + opsys_s = "UNIX"; + break; + case ZIP_OPSYS_DOS: + opsys_s = "DOS"; + break; + case ZIP_OPSYS_WINDOWS_NTFS: + opsys_s = "WINDOWS NTFS"; + break; + case ZIP_OPSYS_MVS: + opsys_s = "MVS"; + break; + default: + opsys_s = "unknown"; + } + printf("%s\t(opsys %s (%d), mode1 0%06lo, mode2 0x%04X):\n", + zip_get_name(z, i, ZIP_FL_ENC_STRICT), opsys_s, opsys, (unsigned long)attr >> 16, attr & 0xffff); + for (zip_int16_t j = 0; j < zip_file_extra_fields_count(z, i, ZIP_FL_CENTRAL); ++j) { + zip_uint16_t id, len; + const zip_uint8_t *field = zip_file_extra_field_get(z, i, j, &id, &len, ZIP_FL_CENTRAL); + printf(" 0x%04X len=%d central: ", id, len); + dump_extrafld(id, len, field, true); + } + for (zip_int16_t j = 0; j < zip_file_extra_fields_count(z, i, ZIP_FL_LOCAL); ++j) { + zip_uint16_t id, len; + const zip_uint8_t *field = zip_file_extra_field_get(z, i, j, &id, &len, ZIP_FL_LOCAL); + printf(" 0x%04X len=%d local: ", id, len); + dump_extrafld(id, len, field, false); + } + } + + zip_close(z); + return EXIT_SUCCESS; +}
  27. Download patch debian/patches/cross.patch

    --- 0.5.0-1/debian/patches/cross.patch 2019-01-12 04:42:22.000000000 +0000 +++ 0.6.0-0ubuntu1/debian/patches/cross.patch 2019-03-15 00:03:13.000000000 +0000 @@ -1,6 +1,6 @@ ---- fuse-zip-0.4.4.orig/Makefile -+++ fuse-zip-0.4.4/Makefile -@@ -7,12 +7,13 @@ +--- fuse-zip-0.6.0.orig/Makefile ++++ fuse-zip-0.6.0/Makefile +@@ -7,12 +7,13 @@ docdir=$(datarootdir)/doc/$(DEST) mandir=$(datarootdir)/man man1dir=$(mandir)/man1 manext=.1 @@ -8,8 +8,8 @@ +PKG_CONFIG?=pkg-config +LIBS=-Llib -lfusezip $(shell $(PKG_CONFIG) fuse --libs) $(shell $(PKG_CONFIG) libzip --libs) LIB=lib/libfusezip.a - CXXFLAGS=-g -O0 -Wall -Wextra -pedantic -Werror - RELEASE_CXXFLAGS=-O2 -Wall -Wextra -pedantic -Werror + CXXFLAGS=-g -O0 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror + RELEASE_CXXFLAGS=-O2 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror -FUSEFLAGS=$(shell pkg-config fuse --cflags) -ZIPFLAGS=$(shell pkg-config libzip --cflags) +FUSEFLAGS=$(shell $(PKG_CONFIG) fuse --cflags) @@ -17,15 +17,15 @@ SOURCES=main.cpp OBJECTS=$(SOURCES:.cpp=.o) MANSRC=fuse-zip.1 ---- fuse-zip-0.4.4.orig/lib/Makefile -+++ fuse-zip-0.4.4/lib/Makefile +--- fuse-zip-0.6.0.orig/lib/Makefile ++++ fuse-zip-0.6.0/lib/Makefile @@ -1,9 +1,10 @@ DEST=libfusezip.a -LIBS=$(shell pkg-config fuse --libs) $(shell pkg-config libzip --libs) +PKG_CONFIG?=pkg-config +LIBS=$(shell $(PKG_CONFIG) fuse --libs) $(shell $(PKG_CONFIG) libzip --libs) - CXXFLAGS=-g -O0 -Wall -Wextra -pedantic -Werror - RELEASE_CXXFLAGS=-O2 -Wall -Wextra -pedantic -Werror + CXXFLAGS=-g -O0 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror + RELEASE_CXXFLAGS=-O2 -Wall -Wextra -Wconversion -Wsign-conversion -Wlogical-op -Wshadow -pedantic -Werror -FUSEFLAGS=$(shell pkg-config fuse --cflags) -ZIPFLAGS=$(shell pkg-config libzip --cflags) +FUSEFLAGS=$(shell $(PKG_CONFIG) fuse --cflags)
  28. Download patch utils/Makefile

    --- 0.5.0-1/utils/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ 0.6.0-0ubuntu1/utils/Makefile 2019-03-12 17:56:15.000000000 +0000 @@ -0,0 +1,22 @@ +LIBS=-L../lib -lfusezip $(shell pkg-config libzip --libs) +CXXFLAGS=-g -O0 -Wall -Wextra -Wlogical-op -Wshadow -pedantic -Werror +ZIPFLAGS=$(shell pkg-config libzip --cflags) + +all: dump-extrafld create-content-size + +dump-extrafld: dump-extrafld.cpp $(LIB) + $(CXX) $(CXXFLAGS) $(ZIPFLAGS) $< \ + -I.. \ + $(LDFLAGS) $(LIBS) \ + -o $@ + +create-content-size: create-content-size.cpp + $(CXX) $(CXXFLAGS) $(ZIPFLAGS) $< \ + -I.. \ + $(LDFLAGS) $(LIBS) \ + -o $@ + +clean: + rm -f dump-extrafld create-content-size + +.PHONY: all clean
  29. Download patch main.cpp

    --- 0.5.0-1/main.cpp 2018-12-01 11:21:29.000000000 +0000 +++ 0.6.0-0ubuntu1/main.cpp 2019-03-12 17:56:15.000000000 +0000 @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2008-2018 by Alexander Galanin // +// Copyright (C) 2008-2019 by Alexander Galanin // // al@galanin.nnov.ru // // http://galanin.nnov.ru/~al // // // @@ -23,8 +23,14 @@ #include "config.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" + #include <fuse.h> #include <fuse_opt.h> + +#pragma GCC diagnostic pop + #include <libgen.h> #include <limits.h> #include <syslog.h> @@ -35,6 +41,10 @@ #include "fuse-zip.h" #include "fuseZipData.h" +#if (LIBZIP_VERSION_MAJOR < 1) + #error "libzip >= 1.0 is required!" +#endif + /** * Print usage information */ @@ -56,6 +66,7 @@ void print_usage() { */ void print_version() { fprintf(stderr, "%s version: %s\n", PROGRAM, VERSION); + fprintf(stderr, "libzip version: %s\n", LIBZIP_VERSION); } /** @@ -84,7 +95,7 @@ struct fusezip_param { * @return -1 on error, 0 if arg is to be discarded, 1 if arg should be kept */ static int process_arg(void *data, const char *arg, int key, struct fuse_args *outargs) { - struct fusezip_param *param = (fusezip_param*)data; + struct fusezip_param *param = static_cast<fusezip_param*>(data); (void)outargs;

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: sshfs-fuse

sshfs-fuse (3.6.0+repack+really2.10-0ubuntu1) focal; urgency=medium * Revert to 2.10 until debian fix their fuse -> fuse3 upgrade and/or co-installability issues. The fuse3 dependency of 3.6.0 breaks Kubuntu and UbuntuStudio ISO builds. -- Rik Mills <rikmills@kde.org> Tue, 26 Nov 2019 09:36:00 +0000

Modifications :
  1. Download patch test/travis-install.sh

    --- 3.6.0+repack-1/test/travis-install.sh 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/travis-install.sh 2017-08-03 16:00:34.000000000 +0000 @@ -2,29 +2,20 @@ set -e -# Meson 0.45 requires Python 3.5 or newer -sudo python3 -m pip install pytest meson==0.44 +sudo ln -svf $(which python3) /usr/bin/python3 +sudo python3 -m pip install pytest meson +wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip +unzip ninja-linux.zip +chmod 755 ninja +sudo chown root:root ninja +sudo mv -fv ninja /usr/local/bin valgrind --version ninja --version meson --version -# Install fuse -wget https://github.com/libfuse/libfuse/archive/master.zip -unzip master.zip -cd libfuse-master -mkdir build -cd build -export CC=gcc-6 -meson .. -ninja -sudo ninja install -test -e /usr/local/lib/pkgconfig || sudo mkdir /usr/local/lib/pkgconfig -sudo mv /usr/local/lib/*/pkgconfig/* /usr/local/lib/pkgconfig/ -ls -d1 /usr/local/lib/*-linux-gnu | sudo tee /etc/ld.so.conf.d/usrlocal.conf -sudo ldconfig - # Setup ssh -ssh-keygen -b 1024 -t rsa -f ~/.ssh/id_rsa -P '' +ssh-keygen -b 768 -t rsa -f ~/.ssh/id_rsa -P '' cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys ssh -o "StrictHostKeyChecking=no" localhost echo "SSH connection succeeded" +
  2. Download patch test/travis-build.sh

    --- 3.6.0+repack-1/test/travis-build.sh 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/travis-build.sh 2017-08-03 16:00:34.000000000 +0000 @@ -36,6 +36,13 @@ for san in undefined address; do meson -D b_sanitize=${san} -D b_lundef=false -D werror=true .. ninja ${TEST_CMD} - sudo ninja install cd .. done + +# Autotools build +CC=gcc +autoreconf -i +./configure +make +${TEST_CMD} +sudo make install
  3. Download patch cache.h

    --- 3.6.0+repack-1/cache.h 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/cache.h 2017-08-03 16:00:34.000000000 +0000 @@ -9,7 +9,20 @@ #include <fuse.h> #include <fuse_opt.h> -struct fuse_operations *cache_wrap(struct fuse_operations *oper); +#ifndef FUSE_VERSION +#define FUSE_VERSION (FUSE_MAJOR_VERSION * 10 + FUSE_MINOR_VERSION) +#endif + +typedef struct fuse_cache_dirhandle *fuse_cache_dirh_t; +typedef int (*fuse_cache_dirfil_t) (fuse_cache_dirh_t h, const char *name, + const struct stat *stbuf); + +struct fuse_cache_operations { + struct fuse_operations oper; + int (*cache_getdir) (const char *, fuse_cache_dirh_t, fuse_cache_dirfil_t); +}; + +struct fuse_operations *cache_init(struct fuse_cache_operations *oper); int cache_parse_options(struct fuse_args *args); void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr); void cache_invalidate(const char *path);
  4. Download patch sshfs.1.in
  5. Download patch meson.build

    --- 3.6.0+repack-1/meson.build 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/meson.build 2017-08-03 16:00:34.000000000 +0000 @@ -1,8 +1,8 @@ -project('sshfs', 'c', version: '3.6.0', - meson_version: '>= 0.40', - default_options: [ 'buildtype=debugoptimized' ]) +project('sshfs', 'c', version: '2.10.0', + meson_version: '>= 0.38', + default_options: [ 'buildtype=plain' ]) -add_global_arguments('-D_REENTRANT', '-DHAVE_CONFIG_H', +add_global_arguments('-D_REENTRANT', '-DHAVE_CONFIG_H', '-O2', '-g', '-Wall', '-Wextra', '-Wno-sign-compare', '-Wmissing-declarations', '-Wwrite-strings', language: 'c') @@ -25,8 +25,6 @@ if not cc.compiles(code, args: [ '-O0', endif -rst2man = find_program('rst2man', 'rst2man.py', required: false) - cfg = configuration_data() cfg.set_quoted('PACKAGE_VERSION', meson.project_version()) @@ -41,32 +39,26 @@ else cfg.set_quoted('IDMAP_DEFAULT', 'none') endif +configure_file(input: 'sshfs.1.in', + output: 'sshfs.1', + configuration : cfg) configure_file(output: 'config.h', configuration : cfg) -sshfs_deps = [ dependency('fuse3', version: '>= 3.1.0'), +sshfs_deps = [ dependency('fuse', version: '>= 2.3'), dependency('glib-2.0'), dependency('gthread-2.0') ] executable('sshfs', sshfs_sources, include_directories: include_dirs, dependencies: sshfs_deps, - c_args: ['-DFUSE_USE_VERSION=31'], + c_args: ['-DFUSE_USE_VERSION=26'], install: true, install_dir: get_option('bindir')) -if rst2man.found() - custom_target('manpages', input: [ 'sshfs.rst' ], output: [ 'sshfs.1' ], - command: [rst2man, '@INPUT@', '@OUTPUT@'], install: true, - install_dir: join_paths(get_option('mandir'), 'man1')) -else - message('rst2man not found, not building manual page.') -endif - -meson.add_install_script('utils/install_helper.sh', - get_option('sbindir'), - get_option('bindir')) - +# This is a little ugly. Is there a better way to tell Meson that the +# manpage is in the build directory? +install_man(join_paths(meson.current_build_dir(), 'sshfs.1')) subdir('test')
  6. Download patch test/Makefile.am

    --- 3.6.0+repack-1/test/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/Makefile.am 2017-08-03 16:00:34.000000000 +0000 @@ -0,0 +1,4 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = meson.build conftest.py pytest.ini test_sshfs.py \ + util.py wrong_command.c
  7. Download patch README.rst

    --- 3.6.0+repack-1/README.rst 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/README.rst 2017-08-03 16:00:34.000000000 +0000 @@ -10,20 +10,6 @@ servers support and enable this SFTP acc very simple to use - there's nothing to do on the server-side. -Development Status ------------------- - -SSHFS is shipped by all major Linux distributions and has been in -production use across a wide range of systems for many years. However, -at present SSHFS does not have any active, regular contributors, and -there are a number of known issues (see the bugtracker). The current -maintainer continues to apply pull requests and makes regular -releases, but unfortunately has no capacity to do any development -beyond addressing high-impact issues. When reporting bugs, please -understand that unless you are including a pull request or are -reporting a critical issue, you will probably not get a response. - - How to use ---------- @@ -46,7 +32,7 @@ To unmount the filesystem:: fusermount -u mountpoint -On BSD and macOS, to unmount the filesystem:: +On BSD and OS-X, to unmount the filesystem:: umount mountpoint @@ -56,16 +42,15 @@ Installation First, download the latest SSHFS release from https://github.com/libfuse/sshfs/releases. On Linux and BSD, you will -also need to install libfuse_ 3.1.0 or newer. On macOS, you need -OSXFUSE_ instead. Finally, you need the Glib_ library with development -headers (which should be available from your operating system's -package manager). +also need to have libfuse_ installed. On OS-X, you need OSXFUSE_ +instead. Finally, you need the Glib_ development package (which should +be available from your operating system's package manager). To build and install, we recommend to use Meson_ (version 0.38 or newer) and Ninja_. After extracting the sshfs tarball, create a (temporary) build directory and run Meson:: - $ mkdir build; cd build + $ md build; cd build $ meson .. Normally, the default build options will work fine. If you @@ -89,6 +74,47 @@ tests requires the `py.test`_ Python mod .. _Ninja: https://ninja-build.org/ .. _`py.test`: http://www.pytest.org/ +Alternate Installation +---------------------- + +If you are not able to use Meson and Ninja, please report this to the +sshfs mailing list. Until the problem is resolved, you may fall back +to an in-source build using autotools:: + + $ ./configure + $ make + $ sudo make install + +Note that support for building with autotools may disappear at some +point, so if you depend on using autotools for some reason please let +the sshfs developers know! + + +Caveats +------- + +Rename +~~~~~~ + +Some SSH servers do not support atomically overwriting the destination +when renaming a file. In this case you will get an error when you +attempt to rename a file and the destination already exists. A +workaround is to first remove the destination file, and then do the +rename. SSHFS can do this automatically if you call it with `-o +workaround=rename`. However, in this case it is still possible that +someone (or something) recreates the destination file after SSHFS has +removed it, but before SSHFS had the time to rename the old file. In +this case, the rename will still fail. + +Hardlinks +~~~~~~~~~ + +If the SSH server supports the *hardlinks* extension, SSHFS will allow +you to create hardlinks. However, hardlinks will always appear as +individual files when seen through an SSHFS mount, i.e. they will +appear to have different inodes and an *st_nlink* value of 1. + + Getting Help ------------ @@ -99,10 +125,8 @@ https://lists.sourceforge.net/lists/list Please report any bugs on the GitHub issue tracker at https://github.com/libfuse/libfuse/issues. - Professional Support -------------------- -Professional support is offered via `Rath Consulting`_. - -.. _`Rath Consulting`: http://www.rath-consulting.biz +Professional support is available. Please contact Nikolaus Rath +<Nikolaus@rath.org> for details.
  8. Download patch sshfs.rst
  9. Download patch test/meson.build

    --- 3.6.0+repack-1/test/meson.build 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/meson.build 2017-08-03 16:00:34.000000000 +0000 @@ -2,7 +2,7 @@ test_scripts = [ 'conftest.py', 'pytest. 'util.py' ] custom_target('test_scripts', input: test_scripts, output: test_scripts, build_by_default: true, - command: ['cp', '-fPp', + command: ['cp', '-fPu', '--preserve=mode', '@INPUT@', meson.current_build_dir() ]) # Provide something helpful when running 'ninja test'
  10. Download patch sshfs.c
  11. Download patch debian/control

    --- 3.6.0+repack-1/debian/control 2019-11-16 02:30:39.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/debian/control 2019-11-26 09:36:00.000000000 +0000 @@ -1,19 +1,14 @@ Source: sshfs-fuse Section: utils Priority: optional -Standards-Version: 4.4.1 -Maintainer: Bartosz Fenski <fenio@debian.org> +Standards-Version: 4.1.5 +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Bartosz Fenski <fenio@debian.org> Uploaders: Dmitry Smirnov <onlyjob@debian.org> -Build-Depends: debhelper (>= 11~) - ,libfuse3-dev - ,libglib2.0-dev +Build-Depends: debhelper (>= 11~), libglib2.0-dev, libfuse-dev, pkg-config ,meson - ,pkg-config ,python3 - ,python3-docutils ,python3-pytest -# tests: - ,fuse3 Homepage: https://github.com/libfuse/sshfs Vcs-Browser: https://salsa.debian.org/debian/sshfs-fuse Vcs-Git: https://salsa.debian.org/debian/sshfs-fuse.git @@ -21,7 +16,7 @@ Vcs-Git: https://salsa.debian.org/debian Package: sshfs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} - ,fuse3 [linux-any] | fuse4bsd [kfreebsd-any] + ,fuse [linux-any] | fuse4bsd [kfreebsd-any] ,openssh-client Description: filesystem client based on SSH File Transfer Protocol sshfs is a filesystem client based on the SSH File Transfer Protocol.
  12. Download patch .appveyor.yml

    --- 3.6.0+repack-1/.appveyor.yml 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/.appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -version: '{build}' - -install: - -# install WinFsp -- appveyor DownloadFile https://github.com/billziss-gh/winfsp/releases/download/v1.4B2/winfsp-1.4.18211.msi -- for %%f in ("winfsp-*.msi") do start /wait msiexec /i %%f /qn INSTALLLEVEL=1000 - -# install FUSE for Cygwin (64-bit and 32-bit) -- C:\cygwin64\bin\env.exe -i PATH=/bin bash "%ProgramFiles(x86)%\WinFsp\opt\cygfuse\install.sh" -- C:\cygwin\bin\env.exe -i PATH=/bin bash "%ProgramFiles(x86)%\WinFsp\opt\cygfuse\install.sh" - -# install additional Cygwin packages (64-bit and 32-bit) -- C:\cygwin64\setup-x86_64.exe -qnNdO -R C:\cygwin64 -s http://cygwin.mirror.constant.com -l C:\cygwin64\var\cache\setup -P libglib2.0-devel -P meson -- C:\cygwin\setup-x86.exe -qnNdO -R C:\cygwin -s http://cygwin.mirror.constant.com -l C:\cygwin\var\cache\setup -P libglib2.0-devel -P meson - -build_script: -- C:\cygwin64\bin\env.exe -i PATH=/bin bash test\appveyor-build.sh -- C:\cygwin\bin\env.exe -i PATH=/bin bash test\appveyor-build.sh
  13. Download patch test/util.py

    --- 3.6.0+repack-1/test/util.py 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/util.py 2017-08-03 16:00:34.000000000 +0000 @@ -20,19 +20,13 @@ def wait_for_mount(mount_process, mnt_di elapsed += 0.1 pytest.fail("mountpoint failed to come up") -def cleanup(mount_process, mnt_dir): +def cleanup(mnt_dir): subprocess.call(['fusermount', '-z', '-u', mnt_dir], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - mount_process.terminate() - try: - mount_process.wait(1) - except subprocess.TimeoutExpired: - mount_process.kill() - def umount(mount_process, mnt_dir): - subprocess.check_call(['fusermount3', '-z', '-u', mnt_dir ]) + subprocess.check_call(['fusermount', '-z', '-u', mnt_dir ]) assert not os.path.ismount(mnt_dir) # Give mount process a little while to terminate. Popen.wait(timeout)
  14. Download patch configure.ac

    --- 3.6.0+repack-1/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/configure.ac 2017-08-03 16:00:34.000000000 +0000 @@ -0,0 +1,44 @@ +AC_INIT(sshfs, 2.10) +AC_CANONICAL_TARGET +AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AM_PROG_CC_C_O +CFLAGS="$CFLAGS -Wall -W" +LIBS= +AC_SEARCH_LIBS(dlsym, [dl]) +LIBS= + +case "$target_os" in + *linux*) osname=linux;; + *darwin*) osname=darwin;; + *) osname=unknown;; +esac + +export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH +PKG_CHECK_MODULES([SSHFS], [fuse >= 2.3 glib-2.0 gthread-2.0]) +have_fuse_opt_parse=no +oldlibs="$LIBS" +LIBS="$LIBS $SSHFS_LIBS" +AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes]) +LIBS="$oldlibs" +if test "$have_fuse_opt_parse" = no -o "$osname" = darwin; then + CFLAGS="$CFLAGS -I${srcdir}/compat" +fi +AM_CONDITIONAL(FUSE_OPT_COMPAT, test "$have_fuse_opt_parse" = no) +AM_CONDITIONAL(DARWIN_COMPAT, test "$osname" = darwin) + +AC_CHECK_PROG(UNMOUNT_COMMAND, fusermount, fusermount -u, umount) + +# TODO: Figure out why we special-case this in Darwin. Would be nice if +# the default setting was consistent across platforms so we wouldn't need +# to care about it here. +case "$osname" in + darwin) IDMAP_DEFAULT=user ;; + *) IDMAP_DEFAULT=none ;; +esac +AC_SUBST(IDMAP_DEFAULT) + +AC_CONFIG_FILES([Makefile test/Makefile]) +AC_OUTPUT
  15. Download patch make_release_tarball.sh

    --- 3.6.0+repack-1/make_release_tarball.sh 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/make_release_tarball.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Create tarball from Git tag, removing and adding -# some files. -# - -set -e - -if [ -z "$1" ]; then - TAG="$(git tag --list 'sshfs-3*' --sort=-taggerdate | head -1)" -else - TAG="$1" -fi - -echo "Creating release tarball for ${TAG}..." - -mkdir "${TAG}" -git archive --format=tar "${TAG}" | tar -x "--directory=${TAG}" -find "${TAG}" -name .gitignore -delete -rm "${TAG}/make_release_tarball.sh" \ - "${TAG}/.travis.yml" \ - "${TAG}/test/travis-build.sh" \ - "${TAG}/test/travis-install.sh" -tar -cJf "${TAG}.tar.xz" "${TAG}/" -gpg --armor --detach-sign "${TAG}.tar.xz" - -PREV_TAG="$(git tag --list 'sshfs-3*' --sort=-taggerdate --merged "${TAG}^"| head -1)" -echo "Contributors from ${PREV_TAG} to ${TAG}:" -git log --pretty="format:%an <%aE>" "${PREV_TAG}..${TAG}" | sort -u -
  16. Download patch .github/ISSUE_TEMPLATE/issue-report.md

    --- 3.6.0+repack-1/.github/ISSUE_TEMPLATE/issue-report.md 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/.github/ISSUE_TEMPLATE/issue-report.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ ---- -name: Issue report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -PLEASE READ BEFORE REPORTING AN ISSUE - -SSHFS does not have any active, regular contributors or developers. The current maintainer continues to apply pull requests and tries to make regular releases, but unfortunately has no capacity to do any development beyond addressing high-impact issues. When reporting bugs, please understand that unless you are including a pull request or are reporting a critical issue, you will probably not get a response. - -To prevent the issue tracker from being flooded with issues that no-one is intending to work on, and to give more visibilty to critical issues that users should be aware of and that most urgently need attention, I will also close most bug reports once they've been inactive for a while. - -Please note that this isn't meant to imply that you haven't found a bug - you most likely have and I'm grateful that you took the time to report it. Unfortunately, SSHFS is a purely volunteer driven project, -and at the moment there simply aren't any volunteers.
  17. Download patch debian/clean

    --- 3.6.0+repack-1/debian/clean 2019-11-16 02:28:24.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/debian/clean 2014-01-24 00:39:39.000000000 +0000 @@ -1,4 +1 @@ -## Debian CI: -debian/.gitlab-ci.yml - configure
  18. Download patch FAQ
  19. Download patch ChangeLog.rst

    --- 3.6.0+repack-1/ChangeLog.rst 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/ChangeLog.rst 2017-08-03 16:00:34.000000000 +0000 @@ -1,95 +1,9 @@ -Release 3.6.0 (2019-11-03) --------------------------- - -* Added "-o direct_io" option. - This option disables the use of page cache in kernel. - This is useful for example if the file size is not known before reading it. - For example if you mount /proc dir from a remote host without the direct_io - option, the read always will return zero bytes instead of actual data. -* Added --verbose option. -* Fixed a number of compiler warnings. -* Improved performance under OS X. - - -Release 3.5.2 (2019-04-13) --------------------------- - -* Fixed "-o idmap=user" to map both UID and GID on all OSs. -* Fixed improper handling of sequential spaces spaces in "ssh_command" option - -Release 3.5.1 (2018-12-22) --------------------------- - -* Documentation updates -* Build system updates -* Added "BindInterface" as valid "-o" option. - -Release 3.5.0 (2018-08-28) --------------------------- - -* Fixed error code returned by rename(), allowing proper fallback. -* Port to Cygwin. - -Release 3.4.0 (2018-06-29) --------------------------- - -* Make utimens(NULL) result in timestamp "now" -- no more touched files - dated 1970-01-01 -* New `createmode` workaround. -* Fix `fstat` workaround regression. - -Release 3.3.2 (2018-04-29) --------------------------- - -* New `renamexdev` workaround. - -Release 3.3.1 (2017-10-25) --------------------------- - -* Manpage is now installed in correct directory. -* SSHFS now supports (or rather: ignores) some options that it may - receive as result of being mounted from ``/etc/mtab``. This includes - things like ``user``, ``netdev``, or ``auto``. - -SSHFS 3.3.0 (2017-09-20) ------------------------- - -* Dropped support for writeback caching (and, as a consequence, - "unreliable append" operation). As of kernel 4.14, the FUSE module's - writeback implementation is not compatible with network filesystems - and there are no imminent plans to change that. -* Add support for mounting from /etc/fstab -* Dropped support for building with autotools. -* Added missing options to man page. - -Release 3.2.0 (2017-08-06) --------------------------- - -* Re-enabled writeback cache. -* SSHFS now supports O_APPEND. - -Release 3.1.0 (2017-08-04) --------------------------- - -* Temporarily disabled the writeback cache feature, since there - have been reports of dataloss when appending to files when - writeback caching is enabled. +Release 2.10 (2017-08-03) +------------------------- * Fixed a crash due to a race condition when listing directory contents. - -* For improved backwards compatibility, SSHFS now also silently - accepts the old ``-o cache_*`` options. - -Release 3.0.0 (2017-07-08) --------------------------- - -* sshfs now requires libfuse 3.1.0 or newer. -* When supported by the kernel, sshfs now uses writeback caching. -* The `cache` option has been renamed to `dir_cache` for clarity. * Added unit tests -* --debug now behaves like -o debug_sshfs, i.e. it enables sshfs - debugging messages rather than libfuse debugging messages. * Documented limited hardlink support. * Added support for building with Meson. * Added support for more SSH options.
  20. Download patch debian/patches/series

    --- 3.6.0+repack-1/debian/patches/series 2019-11-16 02:27:57.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/debian/patches/series 2016-06-13 20:34:59.000000000 +0000 @@ -1 +1 @@ -#sshfs.1.patch +sshfs.1.patch
  21. Download patch utils/install_helper.sh

    --- 3.6.0+repack-1/utils/install_helper.sh 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/utils/install_helper.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#!/bin/sh -# -# Don't call this script. It is used internally by the Meson -# build system. Thank you for your cooperation. -# - -set -e - -bindir="$2" -sbindir="$1" -prefix="${MESON_INSTALL_DESTDIR_PREFIX}" - -mkdir -p "${prefix}/${sbindir}" - -ln -svf --relative "${prefix}/${bindir}/sshfs" \ - "${prefix}/${sbindir}/mount.sshfs" - -ln -svf --relative "${prefix}/${bindir}/sshfs" \ - "${prefix}/${sbindir}/mount.fuse.sshfs"
  22. Download patch test/appveyor-build.sh

    --- 3.6.0+repack-1/test/appveyor-build.sh 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/appveyor-build.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -#!/bin/bash - -machine=$(uname -m) -mkdir build-$machine -cd build-$machine -meson .. -ninja
  23. Download patch debian/source/options

    --- 3.6.0+repack-1/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/debian/source/options 2012-05-05 00:57:49.000000000 +0000 @@ -0,0 +1 @@ +compression = "xz"
  24. Download patch debian/docs

    --- 3.6.0+repack-1/debian/docs 2019-11-16 02:27:57.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/debian/docs 2016-06-09 06:06:06.000000000 +0000 @@ -1,2 +1,3 @@ AUTHORS README* +FAQ
  25. Download patch test/test_sshfs.py

    --- 3.6.0+repack-1/test/test_sshfs.py 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/test/test_sshfs.py 2017-08-03 16:00:34.000000000 +0000 @@ -13,7 +13,6 @@ import stat import shutil import filecmp import errno -from contextlib import contextmanager from tempfile import NamedTemporaryFile from util import (wait_for_mount, umount, cleanup, base_cmdline, basename, fuse_test_marker, safe_sleep) @@ -31,9 +30,8 @@ def name_generator(__ctr=[0]): return 'testfile_%d' % __ctr[0] @pytest.mark.parametrize("debug", (False, True)) -@pytest.mark.parametrize("cache_timeout", (0,1)) -@pytest.mark.parametrize("sync_rd", (True, False)) -def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, capfd): +@pytest.mark.parametrize("cache_timeout", (0, 1)) +def test_sshfs(tmpdir, debug, cache_timeout, capfd): # Avoid false positives from debug messages #if debug: @@ -60,15 +58,11 @@ def test_sshfs(tmpdir, debug, cache_time if debug: cmdline += [ '-o', 'sshfs_debug' ] - if sync_rd: - cmdline += [ '-o', 'sync_readdir' ] - # SSHFS Cache if cache_timeout == 0: - cmdline += [ '-o', 'dir_cache=no' ] + cmdline += [ '-o', 'cache=no' ] else: - cmdline += [ '-o', 'dcache_timeout=%d' % cache_timeout, - '-o', 'dir_cache=yes' ] + cmdline += [ '-o', 'cache_timeout=%d' % cache_timeout ] # FUSE Cache cmdline += [ '-o', 'entry_timeout=0', @@ -88,8 +82,6 @@ def test_sshfs(tmpdir, debug, cache_time tst_readdir(src_dir, mnt_dir) tst_open_read(src_dir, mnt_dir) tst_open_write(src_dir, mnt_dir) - tst_append(src_dir, mnt_dir) - tst_seek(src_dir, mnt_dir) tst_create(mnt_dir) tst_passthrough(src_dir, mnt_dir, cache_timeout) tst_mkdir(mnt_dir) @@ -102,29 +94,17 @@ def test_sshfs(tmpdir, debug, cache_time # SSHFS only supports one second resolution when setting # file timestamps. tst_utimens(mnt_dir, tol=1) - tst_utimens_now(mnt_dir) - tst_link(mnt_dir, cache_timeout) + tst_link(mnt_dir) tst_truncate_path(mnt_dir) tst_truncate_fd(mnt_dir) tst_open_unlink(mnt_dir) except: - cleanup(mount_process, mnt_dir) + cleanup(mnt_dir) raise else: umount(mount_process, mnt_dir) -@contextmanager -def os_open(name, flags): - fd = os.open(name, flags) - try: - yield fd - finally: - os.close(fd) - -def os_create(name): - os.close(os.open(name, os.O_CREAT | os.O_RDWR)) - def tst_unlink(src_dir, mnt_dir, cache_timeout): name = name_generator() fullname = mnt_dir + "/" + name @@ -230,32 +210,6 @@ def tst_open_write(src_dir, mnt_dir): assert filecmp.cmp(fullname, TEST_FILE, False) -def tst_append(src_dir, mnt_dir): - name = name_generator() - os_create(pjoin(src_dir, name)) - fullname = pjoin(mnt_dir, name) - with os_open(fullname, os.O_WRONLY) as fd: - os.write(fd, b'foo\n') - with os_open(fullname, os.O_WRONLY|os.O_APPEND) as fd: - os.write(fd, b'bar\n') - - with open(fullname, 'rb') as fh: - assert fh.read() == b'foo\nbar\n' - -def tst_seek(src_dir, mnt_dir): - name = name_generator() - os_create(pjoin(src_dir, name)) - fullname = pjoin(mnt_dir, name) - with os_open(fullname, os.O_WRONLY) as fd: - os.lseek(fd, 1, os.SEEK_SET) - os.write(fd, b'foobar\n') - with os_open(fullname, os.O_WRONLY) as fd: - os.lseek(fd, 4, os.SEEK_SET) - os.write(fd, b'com') - - with open(fullname, 'rb') as fh: - assert fh.read() == b'\0foocom\n' - def tst_open_unlink(mnt_dir): name = pjoin(mnt_dir, name_generator()) data1 = b'foo' @@ -275,7 +229,7 @@ def tst_open_unlink(mnt_dir): def tst_statvfs(mnt_dir): os.statvfs(mnt_dir) -def tst_link(mnt_dir, cache_timeout): +def tst_link(mnt_dir): name1 = pjoin(mnt_dir, name_generator()) name2 = pjoin(mnt_dir, name_generator()) shutil.copyfile(TEST_FILE, name1) @@ -286,14 +240,6 @@ def tst_link(mnt_dir, cache_timeout): os.link(name1, name2) - # The link operation changes st_ctime, and if we're unlucky - # the kernel will keep the old value cached for name1, and - # retrieve the new value for name2 (at least, this is the only - # way I can explain the test failure). To avoid this problem, - # we need to wait until the cached value has expired. - if cache_timeout: - safe_sleep(cache_timeout) - fstat1 = os.lstat(name1) fstat2 = os.lstat(name2) for attr in ('st_mode', 'st_dev', 'st_uid', 'st_gid', @@ -404,18 +350,6 @@ def tst_utimens(mnt_dir, tol=0): assert abs(fstat.st_atime_ns - atime_ns) < tol*1e9 assert abs(fstat.st_mtime_ns - mtime_ns) < tol*1e9 -def tst_utimens_now(mnt_dir): - fullname = pjoin(mnt_dir, name_generator()) - - fd = os.open(fullname, os.O_CREAT | os.O_RDWR) - os.close(fd) - os.utime(fullname, None) - - fstat = os.lstat(fullname) - # We should get now-timestamps - assert fstat.st_atime != 0 - assert fstat.st_mtime != 0 - def tst_passthrough(src_dir, mnt_dir, cache_timeout): name = name_generator() src_name = pjoin(src_dir, name)
  26. Download patch AUTHORS

    --- 3.6.0+repack-1/AUTHORS 2019-11-03 09:34:29.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/AUTHORS 2017-08-03 16:00:34.000000000 +0000 @@ -15,44 +15,21 @@ Contributors (autogenerated list) Alan Jenkins <alan.christopher.jenkins@gmail.com> Alexander Neumann <alexander@bumpern.de> -Anatol Pomozov <anatol.pomozov@gmail.com> Benjamin Fleischer <fleiben@gmail.com> Berserker <berserker.troll@yandex.com> Bill Zissimopoulos <billziss@navimatics.com> -Brandon Carter <b-carter@users.noreply.github.com> Chris Wolfe <cwolfe@chromium.org> -Clayton G. Hobbs <clay@lakeserv.net> -Daniel Lublin <daniel@lublin.se> -DrDaveD <2129743+DrDaveD@users.noreply.github.com> gala <gala132@users.noreply.github.com> -Galen Getsov <4815620+ggetsov@users.noreply.github.com> George Vlahavas <vlahavas@gmail.com> -G.raud Meyer <graud@gmx.com> -harrim4n <git@harrim4n.com> Jakub Jelen <jjelen@redhat.com> -Josh Triplett <josh@joshtriplett.org> Julio Merino <jmmv@google.com> Julio Merino <jmmv@meroh.net> -kalvdans <github@kalvdans.no-ip.org> -Michael Forney <mforney@mforney.org> Mike Kelly <mike@pair.com> -Mike Salvatore <mike.s.salvatore@gmail.com> Miklos Szeredi <miklos@szeredi.hu> Miklos Szeredi <mszeredi@suse.cz> -mssalvatore <mike.s.salvatore@gmail.com> Nikolaus Rath <Nikolaus@rath.org> Percy Jahn <email@percyjahn.de> Qais Patankar <qaisjp@gmail.com> -Quentin Rameau <quinq@fifth.space> -Reid Wagner <wagnerreid@gmail.com> Rian Hunter <rian@alum.mit.edu> -Rian Hunter <rianhunter@users.noreply.github.com> -Samuel Murray <samuel.murray@outlook.com> -S. D. Cloudt <s.d.cloudt@student.tue.nl> -smheidrich <smheidrich@weltenfunktion.de> -sunwire <50745572+sunwire@users.noreply.github.com> -Tim Harder <radhermit@gmail.com> -Timo Savola <timo.savola@iki.fi> tpoindessous <thomas@poindessous.com> -Viktor Szakats <vszakats@users.noreply.github.com> Zoltan Kuscsik <zoltan.kuscsik@linaro.org>
  27. Download patch Makefile.am

    --- 3.6.0+repack-1/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ 3.6.0+repack+really2.10-0ubuntu1/Makefile.am 2017-08-03 16:00:34.000000000 +0000 @@ -0,0 +1,30 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = sshfs + +SUBDIRS = test + +sshfs_SOURCES = sshfs.c cache.c cache.h +if FUSE_OPT_COMPAT +sshfs_SOURCES += compat/fuse_opt.c compat/fuse_opt.h +endif +if DARWIN_COMPAT +sshfs_SOURCES += compat/darwin_compat.c compat/darwin_compat.h +endif + +sshfs_LDADD = $(SSHFS_LIBS) +sshfs_CFLAGS = $(SSHFS_CFLAGS) +sshfs_CPPFLAGS = -D_REENTRANT -DFUSE_USE_VERSION=26 -DLIBDIR=\"$(libdir)\" \ + -DIDMAP_DEFAULT="\"$(IDMAP_DEFAULT)\"" + +EXTRA_DIST = sshfs.1.in meson.build +CLEANFILES = sshfs.1 sshfs.1.tmp + +dist_man_MANS = sshfs.1 + +sshfs.1: sshfs.1.in + $(AM_V_GEN)sed \ + -e 's/[@]IDMAP_DEFAULT@/$(IDMAP_DEFAULT)/g' \ + -e 's/[@]UNMOUNT_COMMAND@/$(UNMOUNT_COMMAND)/g' \ + <$(srcdir)/sshfs.1.in >sshfs.1.tmp || exit 1; \ + mv sshfs.1.tmp sshfs.1
  28. Download patch debian/copyright
  29. Download patch cache.c

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: unionfs-fuse

unionfs-fuse (1.0-1ubuntu2) bionic; urgency=high * No change rebuild to pick up -fPIE compiler default -- Balint Reczey <rbalint@ubuntu.com> Tue, 03 Apr 2018 12:48:42 +0000 unionfs-fuse (1.0-1ubuntu1) wily; urgency=medium * Merge from Debian unstable (LP: #1476699). Remaining changes: - debian/control: Add Multi-Arch: foreign. -- Logan Rosen <logan@ubuntu.com> Sun, 02 Aug 2015 21:46:16 -0400

Modifications :
  1. Download patch debian/control

    --- 1.0-1/debian/control 2015-07-14 07:24:09.000000000 +0000 +++ 1.0-1ubuntu2/debian/control 2015-08-03 01:46:37.000000000 +0000 @@ -2,12 +2,14 @@ Source: unionfs-fuse Section: misc Priority: optional Homepage: https://github.com/rpodgorny/unionfs-fuse -Maintainer: Bernd Schubert <bernd.schubert@fastmail.fm> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Bernd Schubert <bernd.schubert@fastmail.fm> Build-Depends: debhelper (>= 9.0.0), libfuse-dev, cmake Standards-Version: 3.9.6 Package: unionfs-fuse Architecture: linux-any +Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends}, fuse Description: Fuse implementation of unionfs This is another unionfs implementation using filesystem in
  1. fuse-umfuse-ext2
  2. fuse-zip
  3. sshfs-fuse
  4. unionfs-fuse