Package Details: pmount 0.9.23-16

Git Clone URL: https://aur.archlinux.org/pmount.git (read-only, click to copy)
Package Base: pmount
Description: mount removable devices as normal user
Upstream URL: https://salsa.debian.org/debian/pmount
Licenses: GPL2
Conflicts: pmount
Provides: pmount
Submitter: Barthalion
Maintainer: ralphptorres
Last Packager: ralphptorres
Votes: 96
Popularity: 0.000000
First Submitted: 2012-12-12 19:55 (UTC)
Last Updated: 2024-06-04 11:49 (UTC)

Latest Comments

1 2 3 4 5 6 7 Next › Last »

ralphptorres commented on 2024-06-04 11:50 (UTC)

Applied, thanks.

cockroach commented on 2024-05-22 00:10 (UTC)

I can no longer build this:

gcc -DHAVE_CONFIG_H -I. -I..     -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/home/stefan/software/pmount/src=/usr/src/debug/pmount -flto=auto -MT luks.o -MD -MP -MF .deps/luks.Tpo -c -o luks.o luks.c
luks.c: In function ‘luks_create_lockfile’:
luks.c:147:7: error: implicit declaration of function ‘creat’ [-Wimplicit-function-declaration]
  147 |   f = creat( path, 0600);
      |       ^~~~~
luks.c:153:3: error: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
  153 |   close(f);
      |   ^~~~~
      |   pclose
luks.c: In function ‘luks_remove_lockfile’:
luks.c:183:5: error: implicit declaration of function ‘unlink’ [-Wimplicit-function-declaration]
  183 |     unlink(path);
      |     ^~~~~~
make[2]: *** [Makefile:374: luks.o] Error 1
make[2]: Leaving directory '/home/stefan/software/pmount/src/pmount-debian-0.9.23-7/src'
make[1]: *** [Makefile:329: all-recursive] Error 1
make[1]: Leaving directory '/home/stefan/software/pmount/src/pmount-debian-0.9.23-7'
make: *** [Makefile:258: all] Error 2

The following little patch helps:

--- a/pmount-debian-0.9.23-7/src/luks.c
+++ b/pmount-debian-0.9.23-7/src/luks.c
@@ -16,6 +16,8 @@
 #include <limits.h>
 #include <sys/stat.h>
 #include <libintl.h>
+#include <fcntl.h>
+#include <unistd.h>


 /* If CRYPTSETUP_RUID is set, we run cryptsetup with ruid = euid = 0.

ralphptorres commented on 2024-03-27 12:21 (UTC)

Changed the upstream url and refactored a couple of things. Cheers

m040601 commented on 2024-02-26 18:58 (UTC) (edited on 2024-02-26 19:11 (UTC) by m040601)

This PKGBUILD hasnt been touched since 2018. The PKGBUILD "pmount-safe-removal" also hasnt been touched since 2015, https://aur.archlinux.org/packages/pmount-safe-removal

Several people have offered to adopt and maintain it. Please respond and eventually disown it if not willing to maintain it.

It currently pulls from,

15 source=(
16   "https://alioth-archive.debian.org/releases/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2"
17   "pmount-bash-completion" # From pmount-debian
18   "0001-Fix-a-careless-segfault-in-debug-mode.patch"
19   "pmount.exfat.patch"
Upstream URL:   http://pmount.alioth.debian.org/

That upstream/homepage is wrong. It doesnt exist anymore.

https://packages.debian.org/search?keywords=pmount points to a "Homepage", https://alioth-archive.debian.org/release/pmount/pmount . That page also doesnt exist anymore.

Most probably this tool has not seen any developments in recent times. It is now in maintenance mode, taken care by the debian packagers themselves.

The only activity is at,

Vcs-Browser: https://salsa.debian.org/debian/pmount
Vcs-Git: https://salsa.debian.org/debian/pmount.git

with some serious security hole fixes.

Please change the Upstream URL of this AUR PKGBUILD to maybe,

Upstream URL: https://salsa.debian.org/debian/pmount

And check if the current sources and patches are still the best choice.

Thanks in advance.

dreieck commented on 2023-10-31 20:22 (UTC)

license also was still wrong.
Updated PKGBUILD ↗ here, the other files are from this comment's tarball from @xwhatsit from 2023-08-03.

I am willing to maintain this when it is disowned.

xwhatsit commented on 2023-08-03 02:20 (UTC) (edited on 2023-08-03 02:20 (UTC) by xwhatsit)

...note, the comment box seems to have messed with tabs/spaces in the patch file, and the sha256sum is incorrect if you just copy/paste it from there. Either use the tarball linked from earlier or set the sha256sum for the patch to SKIP.

xwhatsit commented on 2023-08-03 02:16 (UTC)

Taking dreieck's advice, find updated PKGBUILD and patch which fixes the atime issues (without needing to pass -A/--noatime every time you run pmount).

Tarball is available here, otherwise see below: https://static.wongcornall.com/pmount-removed-atime.tar.gz

PKGBUILD:

# Maintainer: Baptiste Jonglez <archlinux at bitsofnetworks dot org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Simon Legner <Simon.Legner@gmail.com>

pkgname=pmount
pkgver=0.9.23
pkgrel=15
pkgdesc="mount removable devices as normal user"
arch=('i686' 'x86_64' 'armv7h')
license=('GPL2')
url="http://pmount.alioth.debian.org/"
backup=('etc/pmount.allow')
depends=('sysfsutils>=2.0.0-1' 'util-linux')
makedepends=('intltool')
source=(
  "https://alioth-archive.debian.org/releases/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2"
  "pmount-bash-completion" # From pmount-debian
  "0001-Fix-a-careless-segfault-in-debug-mode.patch"
  "0002-Remove-atime-options.patch"
  "pmount.exfat.patch"
)
sha256sums=('db38fc290b710e8e9e9d442da2fb627d41e13b3ee80326c15cc2595ba00ea036'
            '2f3983432533d453cb1217b8e6804264e22fa689a0e73a2a4d8d11f0b704bacc'
            'e19eda4987b41f1b76281b980b56239b386539938d70e5b4a40b286bff789b93'
            'ae335b81aaf0ed60e5f40189cf71025a1764c1e7cd05fe546ef13bc7aa003449'
            '6c90da5d992deea70334acaf6781df9d538887bd3d1b62e36a9449e0708006c0')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 < "${srcdir}/0001-Fix-a-careless-segfault-in-debug-mode.patch"
  patch -p1 < "${srcdir}/0002-Remove-atime-options.patch"
  patch -p1 < "${srcdir}/pmount.exfat.patch"
}

build() {
  # commented out in order to avoid *** Error in `/usr/bin/ld': corrupted double-linked list: 0x09e43ce8 ***
  #export CFLAGS="${CFLAGS} -fPIE -pie"
  #export CXXFLAGS="${CXXFLAGS} -fPIE -pie"

  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr --disable-hal \
    --with-cryptsetup-prog=/usr/bin/cryptsetup
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm644 ${srcdir}/pmount-bash-completion ${pkgdir}/usr/share/bash-completion/completions/pmount
  mkdir -p ${pkgdir}/media
}

0002-Remove-atime-options.patch:

diff -u -r pmount-0.9.23/src/pmount.c pmount-0.9.23-patched/src/pmount.c
--- pmount-0.9.23/src/pmount.c  2010-05-05 08:22:07.000000000 +1200
+++ pmount-0.9.23-patched/src/pmount.c  2023-08-03 14:02:08.327191168 +1200
@@ -80,8 +80,6 @@
     "  -r          : force <device> to be mounted read-only\n"
     "  -w          : force <device> to be mounted read-write\n"
     "  -s, --sync  : mount <device> with the 'sync' option (default: 'async')\n"
-    "  -A, --noatime\n"
-    "                mount <device> with the 'noatime' option (default: 'atime')\n"
     "  -e, --exec  : mount <device> with the 'exec' option (default: 'noexec')\n"
     "  -t <fs>     : mount as file system type <fs> (default: autodetected)\n"
     "  -c <charset>: use given I/O character set (default: 'utf8' if called\n"
@@ -213,7 +211,6 @@
  * @param fsname file system name (mount option -t)
  * @param async if not 0, the device will be mounted with 'async' (i. e. write
  *        caching)
- * @param noatime if not 0, the device will be mounted with 'noatime'
  * @param exec if not 0, the device will be mounted with 'exec'
  * @param force_write 1 for forced r/w, 0 for forced r/o, -1 for kernel default
  * @param iocharset charset to use for file name conversion; NULL for mount
@@ -227,7 +224,7 @@
  */
 int
 do_mount( const char* device, const char* mntpt, const char* fsname, int async,
-     int noatime, int exec, int force_write, const char* iocharset, 
+     int exec, int force_write, const char* iocharset, 
      int utf8, 
      const char* umask, const char *fmask, const char *dmask, 
      int suppress_errors )
@@ -238,7 +235,6 @@
     char fdmask_opt[100];
     char iocharset_opt[100];
     const char* sync_opt = ",sync";
-    const char* atime_opt = ",atime";
     const char* exec_opt = ",noexec";
     const char* access_opt = NULL;
     char options[1000];
@@ -325,9 +321,6 @@
     if( async )
         sync_opt = ",async";

-    if( noatime )
-        atime_opt = ",noatime";
-
     if( exec )
         exec_opt = ",exec";

@@ -371,8 +364,8 @@
        fs->iocharset_format, "iso8859-1");
     }

-    snprintf( options, sizeof( options ), "%s%s%s%s%s%s%s%s%s", 
-            fs->options, sync_opt, atime_opt, exec_opt, access_opt, ugid_opt,
+    snprintf( options, sizeof( options ), "%s%s%s%s%s%s%s%s", 
+            fs->options, sync_opt, exec_opt, access_opt, ugid_opt,
             umask_opt, fdmask_opt, iocharset_opt );

     /* go for it */
@@ -388,7 +381,6 @@
  * @param mntpt desired mount point
  * @param async if not 0, the device will be mounted with 'async' (i. e. write
  *        caching)
- * @param noatime if not 0, the device will be mounted with 'noatime'
  * @param exec if not 0, the device will be mounted with 'exec'
  * @param force_write 1 for forced r/w, 0 for forced r/o, -1 for kernel default
  * @param iocharset charset to use for file name conversion; NULL for mount
@@ -401,7 +393,7 @@
  */
 int
 do_mount_auto( const char* device, const char* mntpt, int async, 
-          int noatime, int exec, int force_write, const char* iocharset, 
+          int exec, int force_write, const char* iocharset, 
           int utf8, 
           const char* umask, const char *fmask, const char *dmask )
 {
@@ -422,7 +414,7 @@
    debug("blkdid detected ntfs and ntfs-3g was found. Using ntfs-3g\n");
    tp = "ntfs-3g";
       }
-      result = do_mount( device, mntpt, tp, async, noatime, exec, 
+      result = do_mount( device, mntpt, tp, async, exec, 
             force_write, iocharset, utf8, umask, fmask, 
             dmask, nostderr );
       if(result == 0)
@@ -444,14 +436,14 @@
       /* don't suppress stderr if we try the last possible fs */
       if( (fs+1)->fsname == NULL )
    nostderr = 0;
-      result = do_mount( device, mntpt, fs->fsname, async, noatime, exec,
+      result = do_mount( device, mntpt, fs->fsname, async, exec,
             force_write, iocharset, utf8, umask, fmask, dmask, nostderr );
       if( result == 0 )
    break;

       /* sometimes VFAT fails when using iocharset; try again without */
       if( iocharset )
-   result = do_mount( device, mntpt, fs->fsname, async, noatime, exec,
+   result = do_mount( device, mntpt, fs->fsname, async, exec,
               force_write, NULL, utf8, umask, fmask, dmask, nostderr );
       if( result <= 0 )
    break;
@@ -615,7 +607,6 @@
     const char* fstab_device;
     int is_real_path = 0;
     int async = 1;
-    int noatime = 0;
     int exec = 0;
     int force_write = -1; /* 0: ro, 1: rw, -1: default */
     const char* use_fstype = NULL;
@@ -636,7 +627,6 @@
         { "lock", 0, NULL, 'l'},
         { "unlock", 0, NULL, 'L'},
         { "sync", 0, NULL, 's' },
-        { "noatime", 0, NULL, 'A' },
         { "exec", 0, NULL, 'e' },
         { "type", 1, NULL, 't' },
         { "charset", 1, NULL, 'c' },
@@ -678,7 +668,7 @@

     /* parse command line options */
     do {
-        switch( option = getopt_long( argc, argv, "+hdelLsArwp:t:c:u:V", long_opts, NULL ) ) {
+        switch( option = getopt_long( argc, argv, "+hdelLsrwp:t:c:u:V", long_opts, NULL ) ) {
             case -1:  break;          /* end of arguments */
             case ':':
             case '?': return E_ARGS;  /* unknown argument */
@@ -693,8 +683,6 @@

             case 's': async = 0; break;

-            case 'A': noatime = 1; break;
-
             case 'e': exec = 1; break;

             case 't': use_fstype = optarg; break;
@@ -866,10 +854,10 @@

             /* off we go */
             if( use_fstype )
-                result = do_mount( decrypted_device, mntpt, use_fstype, async, noatime,
+                result = do_mount( decrypted_device, mntpt, use_fstype, async,
                   exec, force_write, iocharset, utf8, umask, fmask, dmask, 0 );
             else
-                result = do_mount_auto( decrypted_device, mntpt, async, noatime, exec,
+                result = do_mount_auto( decrypted_device, mntpt, async, exec,
                         force_write, iocharset, utf8, umask, fmask, dmask ); 

             /* unlock the mount point again */
diff -u -r pmount-0.9.23/src/pmount-hal.c pmount-0.9.23-patched/src/pmount-hal.c
--- pmount-0.9.23/src/pmount-hal.c  2009-02-13 11:45:40.000000000 +1300
+++ pmount-0.9.23-patched/src/pmount-hal.c  2023-08-03 14:03:53.563588224 +1200
@@ -112,7 +112,7 @@
 }

 void exec_pmount( const char* device, const char* fstype, const char* label,
-        dbus_bool_t sync, dbus_bool_t noatime, dbus_bool_t exec, const char*
+        dbus_bool_t sync, dbus_bool_t exec, const char*
         umask, const char *fmask, const char *dmask, const char* iocharset, int addargc, const char* const* addargv ) 
 {
     const char** argv = (const char**) calloc( sizeof( const char* ), addargc+15 );
@@ -129,8 +129,6 @@

     if( sync )
         argv[argc++] = "--sync";
-    if( noatime )
-        argv[argc++] = "--noatime";
     if( exec )
         argv[argc++] = "--exec";

@@ -190,7 +188,7 @@
     DBusConnection *dbus_conn;
     LibHalVolume* volume;
     LibHalDrive* drive;
-    dbus_bool_t sync = FALSE, noatime = FALSE, exec = FALSE;
+    dbus_bool_t sync = FALSE, exec = FALSE;
     char *umask = NULL;
     char *fmask = NULL;
     char *dmask = NULL;
@@ -338,10 +336,6 @@
             exec = TRUE;
         else if( !strncmp( s, "noexec", 6 ) )
             exec = FALSE;
-        else if( !strncmp( s, "atime", 5 ) )
-            noatime = FALSE;
-        else if( !strncmp( s, "noatime", 7 ) )
-            noatime = TRUE;
         else if( !strncmp( s, "sync", 4 ) )
             sync = TRUE;
         else if( !strncmp( s, "async", 5 ) )
@@ -405,7 +399,7 @@
     dbus_connection_unref( dbus_conn );

     /* go */
-    exec_pmount( device, fstype, label, sync, noatime, exec, umask, fmask, dmask, iocharset, argc-2, argv+2 );
+    exec_pmount( device, fstype, label, sync, exec, umask, fmask, dmask, iocharset, argc-2, argv+2 );

     return 0;
 }

dreieck commented on 2023-07-24 16:12 (UTC)

Regarding mount failure -- the solution was given ↗ here:

pmount uses per default the mount option atime. Which does not work anymore.

pmount --noatime succeeds.

I suggest that you add a patch to the sources that removes atime as mount option, see ↗ here.

Regards!

dreieck commented on 2023-07-24 08:46 (UTC)

Suggesion: Add optdepends=('cryptsetup: For mounting of encrypted devices.').

Regards!