pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/hal When mounting a filesystem on behalf of a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6b6dac6f646f
branches:  trunk
changeset: 568925:6b6dac6f646f
user:      abs <abs%pkgsrc.org@localhost>
date:      Sun Dec 27 16:17:33 2009 +0000

description:
When mounting a filesystem on behalf of a user treat __NetBSD__ similarly
to __FreeBSD__ and chown the mountpoint to the user. With this change,
and the recent one to policykit automounting works on NetBSD

diffstat:

 sysutils/hal/Makefile         |   4 ++--
 sysutils/hal/distinfo         |   4 ++--
 sysutils/hal/patches/patch-aa |  36 ++++++++++++++++++++++++++----------
 3 files changed, 30 insertions(+), 14 deletions(-)

diffs (128 lines):

diff -r fc37e72dd710 -r 6b6dac6f646f sysutils/hal/Makefile
--- a/sysutils/hal/Makefile     Sun Dec 27 15:06:28 2009 +0000
+++ b/sysutils/hal/Makefile     Sun Dec 27 16:17:33 2009 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.42 2009/10/15 00:30:38 jmcneill Exp $
+# $NetBSD: Makefile,v 1.43 2009/12/27 16:17:33 abs Exp $
 
 DISTNAME=              hal-0.5.11
-PKGREVISION=           25
+PKGREVISION=           26
 CATEGORIES=            sysutils
 MASTER_SITES=          http://hal.freedesktop.org/releases/
 EXTRACT_SUFX=          .tar.bz2
diff -r fc37e72dd710 -r 6b6dac6f646f sysutils/hal/distinfo
--- a/sysutils/hal/distinfo     Sun Dec 27 15:06:28 2009 +0000
+++ b/sysutils/hal/distinfo     Sun Dec 27 16:17:33 2009 +0000
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.14 2009/09/14 15:18:36 joerg Exp $
+$NetBSD: distinfo,v 1.15 2009/12/27 16:17:33 abs Exp $
 
 SHA1 (hal-0.5.11.tar.bz2) = 1ddb7895d2ddc2464b553ad11f7ba38860478ae9
 RMD160 (hal-0.5.11.tar.bz2) = 741cfe82f0bc2d67106b24cfe526a754ab36e45f
 Size (hal-0.5.11.tar.bz2) = 1281251 bytes
-SHA1 (patch-aa) = cad685075f8246397e3783fb3e9d094a2bee4d04
+SHA1 (patch-aa) = 7caee5b1af8f76d30ebac437507a99031982d1c2
 SHA1 (patch-ab) = 03723893f9219967a0e3b48c1a03592688389234
 SHA1 (patch-ac) = 5836bb68f4742bdccc9c61fbf8cc86020007a0a5
 SHA1 (patch-ad) = 2a2732f82a4fd8d7ffa311b4a0e747208dc9ad1c
diff -r fc37e72dd710 -r 6b6dac6f646f sysutils/hal/patches/patch-aa
--- a/sysutils/hal/patches/patch-aa     Sun Dec 27 15:06:28 2009 +0000
+++ b/sysutils/hal/patches/patch-aa     Sun Dec 27 16:17:33 2009 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.4 2008/12/20 21:11:05 jmcneill Exp $
+$NetBSD: patch-aa,v 1.5 2009/12/27 16:17:34 abs Exp $
 
---- tools/hal-storage-mount.c.orig     2008-05-07 19:24:23.000000000 -0400
-+++ tools/hal-storage-mount.c  2008-12-20 15:34:05.000000000 -0500
+--- tools/hal-storage-mount.c.orig     2008-05-07 23:24:23.000000000 +0000
++++ tools/hal-storage-mount.c
 @@ -31,7 +31,7 @@
  #include <string.h>
  #include <glib.h>
@@ -11,7 +11,7 @@
  #include <fstab.h>
  #include <sys/param.h>
  #include <sys/ucred.h>
-@@ -41,6 +41,13 @@
+@@ -41,6 +41,14 @@
  #elif sun
  #include <sys/mnttab.h>
  #include <sys/vfstab.h>
@@ -22,10 +22,11 @@
 +#include <fcntl.h>
 +#include <sys/stat.h>
 +#include <unistd.h>
++#include <pwd.h>
  #else
  #include <mntent.h>
  #endif
-@@ -54,10 +61,14 @@
+@@ -54,10 +62,14 @@
  
  #include "hal-storage-shared.h"
  
@@ -41,7 +42,7 @@
  #elif sun
  #define MOUNT         "/sbin/mount"
  #define MOUNT_OPTIONS "noexec,nosuid"
-@@ -421,7 +432,7 @@ device_is_mounted (const char *device, c
+@@ -421,7 +433,7 @@ device_is_mounted (const char *device, c
  static const char *
  map_fstype (const char *fstype)
  {
@@ -50,7 +51,7 @@
        if (! strcmp (fstype, "iso9660"))
                return "cd9660";
        else if (! strcmp (fstype, "ext2"))
-@@ -430,6 +441,13 @@ map_fstype (const char *fstype)
+@@ -430,6 +442,13 @@ map_fstype (const char *fstype)
                return "ext2fs";
        else if (! strcmp (fstype, "vfat"))
                return "msdosfs";
@@ -64,7 +65,13 @@
  #elif sun
        if (! strcmp (fstype, "iso9660"))
                return "hsfs";
-@@ -475,6 +493,11 @@ handle_mount (LibHalContext *hal_ctx, 
+@@ -470,11 +489,16 @@ handle_mount (LibHalContext *hal_ctx, 
+       gboolean is_remount;
+       gboolean explicit_mount_point_given;
+       const char *end;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+       struct passwd *pw;
        uid_t calling_uid;
        gid_t calling_gid;
  #endif
@@ -76,7 +83,7 @@
        const char *label;
        const char *uuid;
  
-@@ -731,7 +754,6 @@ handle_mount (LibHalContext *hal_ctx, 
+@@ -731,7 +755,6 @@ handle_mount (LibHalContext *hal_ctx, 
        /* construct arguments to mount */
        na = 0;
        
@@ -84,7 +91,7 @@
        if (strlen (mount_fstype) > 0) {
                mount_do_fstype = (char *) map_fstype (mount_fstype);
        } else if (volume == NULL) {
-@@ -742,8 +764,29 @@ handle_mount (LibHalContext *hal_ctx, 
+@@ -742,8 +765,29 @@ handle_mount (LibHalContext *hal_ctx, 
        } else {
                mount_do_fstype = "auto";
        }
@@ -116,3 +123,12 @@
  
        args[na++] = "-o";
  #ifdef HAVE_UMOUNT_HAL
+@@ -814,7 +858,7 @@ handle_mount (LibHalContext *hal_ctx, 
+                       unknown_error ("Cannot create mount directory");
+               }
+               
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+               calling_uid = (uid_t) strtol (invoked_by_uid, (char **) NULL, 10);
+               pw = getpwuid (calling_uid);
+               if (pw != NULL) {



Home | Main Index | Thread Index | Old Index