From: наб Date: Thu, 28 Nov 2024 17:48:58 +0000 (-0500) Subject: debian: provide fuseext2 to replace src:fuse-umfuse-ext2 X-Git-Tag: v1.47.2-rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=757a712c1238c7ed7852d662f337f5620db8a75e;p=thirdparty%2Fe2fsprogs.git debian: provide fuseext2 to replace src:fuse-umfuse-ext2 The fuse-umfuse-ext2 packaghas been abandoned by upstream, and a follow-up fork at https://github.com/alperakcan/fuse-ext2 hasn't been updated in five years. Both of these versions also warn against mounting file systems read/write with fuse-ext2. As proposed on debian-devel, let's replace fuse-umfuse-ext2 with a compatibility shell script shipped with fuse2fs. Link: https://lists.debian.org/debian-devel/2024/10/msg00231.html Addresses-Debian-Bug: #1085590 Signed-off-by: Theodore Ts'o --- diff --git a/debian/control b/debian/control index e641b371..bc582cd8 100644 --- a/debian/control +++ b/debian/control @@ -13,12 +13,23 @@ Package: fuse2fs Build-Profiles: Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends} +Breaks: fuseext2 (<< 1.47.1-2~) +Replaces: fuseext2 (<< 1.47.1-2~) Architecture: linux-any kfreebsd-any Description: ext2 / ext3 / ext4 file system driver for FUSE fuse2fs is a FUSE file system client that supports reading and writing from devices or image files containing ext2, ext3, and ext4 file systems. +Package: fuseext2 +Build-Profiles: +Depends: fuse2fs (>= 1.47.1-2), ${misc:Depends} +Architecture: all +Priority: optional +Section: oldlibs +Description: transitional package + This is a transitional package. It can safely be removed. + Package: logsave Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends} diff --git a/debian/copyright b/debian/copyright index 77bd5ea1..604ed9e7 100644 --- a/debian/copyright +++ b/debian/copyright @@ -21,6 +21,15 @@ Copyright: 2003-2007 Theodore Ts'o 1995-1996 Michael Nonweiler License: GPL-2 +Files: debian/fuse-ext2 +Copyright: 2008-2010 Alper Akcan + 2009-2010 Renzo Davoli +License: GPL-2+ + +Files: debian/fuse-ext2.1 +Copyright: 2024 наб +License: 0BSD + Files: lib/et/* lib/ss/* Copyright: 1987-1988 MIT Student Information Processing Board @@ -471,6 +480,37 @@ Comment: On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program (in the main directory of the fuse-ext2 + distribution in the file COPYING); if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +Comment: + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +License: 0BSD + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + . + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + License: LGPL-2 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as diff --git a/debian/fuse-ext2 b/debian/fuse-ext2 new file mode 100755 index 00000000..ebd3b8a5 --- /dev/null +++ b/debian/fuse-ext2 @@ -0,0 +1,65 @@ +#!/bin/sh +usage() { + printf 'usage: %s [-hv] [-o ro|force|allow_others[,...]]... device|image mountpoint\n\nUse fuse2fs instead.\n' "${0##*/}" + exit 9 +} + +args="$(getopt -o 'hvo:' --long 'help,verbose,options:' -n "${0##*/}" -s 'sh' -- "$@")" || exit +eval set -- "$args" + +original_options= +readonly= +force= +while :; do + case "$1" in + -o|--options) + original_options="$original_options,$2" + shift 2 + ;; + -h|--help) + usage + shift + ;; + -v|--verbose) + shift + ;; + --) + shift + break + ;; + esac +done + +[ $# -eq 2 ] || usage +device="$1" +mountpoint="$2" + +# let fuse2fs check $device + +options= +while [ -n "${original_options#,}" ]; do + original_options="${original_options#,}" + full="${original_options%%,*}" + original_options="${original_options#*,}," + case "${full%%=*}" in + "ro" ) readonly=y ;; # Read-only mount. + "rw" ) readonly= ;; # Read-write mount + "rw+" ) readonly=; force=y ;; # Read-write mount + "silent") ;; # keep silent + "force" ) force=y ;; # enable read/write + * ) options="$options,$full"; continue ;; + esac + [ "$full" = "${full%=*}" ] || { + printf '%s: %s: value given but not allowed\n' "${0##*/}" "$full" >&2 + exit 254 + } +done + +[ -z "$readonly" ] && [ -z "$force" ] && { + printf '%s: Mounting %s Read-Only. Use '\''force'\'' or '\''rw+'\'' options to enable Read-Write mode\n' "${0##*/}" "$device" >&2 + readonly=y +} + +[ -n "$readonly" ] && options="$options,ro" || options="$options,rw" + +exec /usr/bin/fuse2fs "$device" "$mountpoint" -o "${options#,}" diff --git a/debian/fuse-ext2.1 b/debian/fuse-ext2.1 new file mode 100644 index 00000000..b24ab56e --- /dev/null +++ b/debian/fuse-ext2.1 @@ -0,0 +1,67 @@ +.\" SPDX-License-Identifier: 0BSD +.\" +.Dd October 24, 2024 +.Dt FUSE-EXT2 1 +.Os fuse2fs +. +.Sh NAME +.Nm fuse-ext2 +.Nd fuse2fs compatibility wrapper +.Sh SYNOPSIS +.Nm +.Op Fl hv +.Oo Fl o Cm ro Ns \&| Ns Cm force Ns \&| Ns Cm allow_others Ns Oo ,… Oc Oc Ns … +.Ar device Ns \&| Ns Ar image +.Ar mountpoint +. +.Sh DESCRIPTION +This wrapper provides the +.Nm +interface via +.Xr fuse2fs 1 , +which you should migrate to instead. +. +.Sh OPTIONS +.Bl -tag -compact -width ".Fl o , -options Ar option Ns Op ,…" +.It Fl h , -help +Show usage string. +. +.It Fl v , -verbose +Ignored. +. +.It Fl o , -options Ar option Ns Op ,… +.Xr mount.fuse3 8 +options, of which these are handled specially: +.Bl -tag -compact -offset 4n -width ".Cm silent" +.It Cm ro +Mount read-only. +. +.It Cm rw +Mount read-write +.Em if +.Cm force +also given. +This is the default. +. +.It Cm rw+ +Same as +.Fl o Cm rw , Ns Cm force +.It Cm silent +Ignored. +.It Cm force +If +.Cm rw , +mount read-write. +.El +all other +.Ar option Ns s +are forwarded to +.Nm fuse2fs +directly. +.Pp +If +.Cm rw +but not +.Cm force , +the mount is read-only and a warning is issued. +.El diff --git a/debian/fuse2fs.install b/debian/fuse2fs.install index 2ed4c3c0..5ff8792d 100644 --- a/debian/fuse2fs.install +++ b/debian/fuse2fs.install @@ -1,2 +1,5 @@ /usr/bin/fuse2fs /usr/share/man/man1/fuse2fs.1 + +debian/fuse-ext2 /usr/bin/ +debian/fuse-ext2.1 /usr/share/man/man1/ diff --git a/debian/fuse2fs.links b/debian/fuse2fs.links new file mode 100644 index 00000000..71cb0b6b --- /dev/null +++ b/debian/fuse2fs.links @@ -0,0 +1,7 @@ +/usr/bin/fuse-ext2 /usr/bin/fuseext2 +/usr/bin/fuse-ext2 /usr/sbin/mount.fuse-ext2 +/usr/sbin/mount.fuse-ext2 /usr/sbin/mount.fuseext2 + +/usr/share/man/man1/fuse-ext2.1 /usr/share/man/man1/fuseext2.1 +/usr/share/man/man1/fuse-ext2.1 /usr/share/man/man8/mount.fuse-ext2.8 +/usr/share/man/man8/mount.fuse-ext2.8 /usr/share/man/man8/mount.fuseext2.8