commit cf3509386ab100849fb879c5ab02dda032dfa509
Author: Bastien Nocera <[email protected]>
Date: Thu Mar 4 14:50:06 2010 +0000
Make the temporary mount point configurable
Distributions that use SELinux cannot have libgpod's callouts
mount devices as they wish in random location on the disk.
Instead, we'd use a specific directory, so that the SELinux
rules could be amended for that case.
This patch does not change the default location of the temporary
directory.
configure.ac | 15 +++++++++++++++
tools/Makefile.am | 9 +++++++++
tools/generic-callout.c | 2 +-
3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 14d7135..1d03dcb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,6 +203,20 @@ AC_ARG_ENABLE(udev,
AM_CONDITIONAL(USE_UDEV, test x"$enable_udev" = xyes)
AC_SUBST([udevdir], [/lib/udev])
+dnl ***********************************************************************
+dnl * for the udev and hal callouts, we need a temporary directory to
+dnl * mount the iPod to write out its extended info file.
+dnl ***********************************************************************
+
+temp_mount_dir="/tmp/"
+AC_ARG_WITH(temp_mount_dir, AC_HELP_STRING([--with-mount-dir=DIR],
+ [Directory where HAL/udev will create a sub-directory to mount iPods]),,
+ with_temp_mount_dir="$temp_mount_dir")
+TMPMOUNTDIR="$with_temp_mount_dir"
+AC_SUBST(TMPMOUNTDIR)
+AH_TEMPLATE([TMPMOUNTDIR], [Directory where HAL/udev will create a
sub-directory to mount iPods])
+AC_DEFINE_UNQUOTED(TMPMOUNTDIR, "$with_temp_mount_dir", [Directory where
HAL/udev will create a sub-directory to mount iPods])
+
dnl **************************************************
dnl * TagLib is only used by test-rebuild-db
dnl **************************************************
@@ -393,6 +407,7 @@ Configuration for $PACKAGE $VERSION :
Python bindings ..........: $with_python
PyGObject support ........: $have_pygobject
iPhone/iPod Touch support.: $enable_libimobiledevice
+ Temporary mount directory.: $with_temp_mount_dir
Now type 'make' to build $PACKAGE $VERSION,
and then 'make install' for installation.
diff --git a/tools/Makefile.am b/tools/Makefile.am
index e6334cd..2f8553e 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -90,3 +90,12 @@ ipod_time_sync_CFLAGS=$(SGUTILS_CFLAGS) $(LIBGPOD_CFLAGS)
ipod_time_sync_LDADD=$(SGUTILS_LIBS) $(LIBGPOD_LIBS)
endif
+if USE_UDEV
+install-data-hook:
+ $(MKDIR_P) "$(DESTDIR)$(MOUNTDIR)"
+endif
+if HAVE_HAL
+install-data-hook:
+ $(MKDIR_P) "$(DESTDIR)$(MOUNTDIR)"
+endif
+
diff --git a/tools/generic-callout.c b/tools/generic-callout.c
index b45f6da..b8b617e 100644
--- a/tools/generic-callout.c
+++ b/tools/generic-callout.c
@@ -560,7 +560,7 @@ static char *mount_ipod (const char *dev_path, const char
*fstype)
char *tmpname;
int result;
- filename = g_build_filename (g_get_tmp_dir (), "ipodXXXXXX", NULL);
+ filename = g_build_filename (TMPMOUNTDIR, "ipodXXXXXX", NULL);
if (filename == NULL) {
return NULL;
}
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2