[PATCH] make path to eject flexible

Gabriel C nix.or.die at googlemail.com
Tue Mar 27 02:45:22 PDT 2007


David Zeuthen wrote:
> On Mon, 2007-03-26 at 21:54 +0200, Danny Kukawka wrote:
>   
>> Hi,
>>
>> could we change the handling of the eject call in tools/hal-storage-shared.c 
>> to let g_spawn_sync() find the correct path? The reason is SUSE has eject 
>> since ages in /bin/eject and not /usr/bin/eject (Maybe for the academic 
>> reason that /usr can be unavailable). 
>>
>> I hope the attached patch work also on other distributions than SUSE.
>>     
>
> No can do. In Fedora, I actually patch the file to use /usr/sbin/eject
> to avoid SELinux issues because /usr/bin/eject is a symlink to
> consolehelper. A patch that provides a configure option (that defaults
> to /usr/bin/eject) would be OK though. Thanks.
>   

Maybe something like the attached patch ?

>      David
>
>
>   

Gabriel
-------------- next part --------------
diff --git a/configure.in b/configure.in
index 6570b99..7622d3b 100644
--- a/configure.in
+++ b/configure.in
@@ -141,6 +141,13 @@ AC_ARG_ENABLE(docbook-docs,     [  --enable-docbook-docs   build documentation (
 AC_ARG_ENABLE(man-pages,        [  --enable-man-pages      build manual pages],enable_man_pages=$enableval,enable_man_pages=yes)
 AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)
 
+## eject 
+AC_ARG_WITH(eject,              [  --with-eject=path       System eject location. (default /usr/bin/eject)],
+[if test ! -z "$withval"; then
+  EJECT="\\\"$withval\\\""
+  CFLAGS="$CFLAGS -DEJECT=$EJECT"
+fi])
+AC_SUBST(EJECT)
 
 GTK_DOC_CHECK([1.3])
 
diff --git a/tools/hal-storage-shared.c b/tools/hal-storage-shared.c
index 1dfecb3..f632ae3 100644
--- a/tools/hal-storage-shared.c
+++ b/tools/hal-storage-shared.c
@@ -510,7 +510,9 @@ line_found:
 	g_free (mount_point_to_unmount);
 }
 
+#ifndef EJECT
 #define EJECT "/usr/bin/eject"
+#endif
 
 void
 handle_eject (LibHalContext *hal_ctx, 


More information about the hal mailing list