hal/hald-runner main.c,1.1,1.2 runner.c,1.2,1.3
David Zeuthen
david at freedesktop.org
Sat Jan 21 08:54:06 PST 2006
Update of /cvs/hal/hal/hald-runner
In directory gabe:/tmp/cvs-serv14173/hald-runner
Modified Files:
main.c runner.c
Log Message:
2006-01-21 David Zeuthen <davidz at redhat.com>
* hald-runner/runner.c (find_program): Simply use glib convience
g_find_program_in_path() on the basename of the desired helper since
our allowed paths are now in $PATH
* hald-runner/main.c (main): Print out allowed paths
* hald/linux2/blockdev.c (add_blockdev_probing_helper_done): Fix up
indenting
* hald/hald_runner.h: Modify prototype of hald_runner_start_runner to
not take the path to the runner
* hald/hald_runner.c (hald_runner_start_runner): Use the flag
G_SPAWN_SEARCH_PATH to search for hald-runner. Export HALD_RUNNER_PATH
as PATH for the runner. Always include standard locations, e.g.
$(libexecdir) and $(datadir)/hal/scripts.
* hald/hald_dbus.c (hald_exec_method_cb): Check if there really
was an error
* hald/hald.c (usage): Remove usage for --with-runner
(main): Remove --with-runner option; just search $PATH for it
* hald/run-hald.sh, hald/debug-hald.sh, hald/valgrind-hald.sh:
Set $HALD_RUNNER_PATH and modify $PATH to include local hald-runner
* tools/hal-system-storage-mount: Read and enforce security policy
as specified in fdi/policy/10osvendor/10-security-policy.fdi
* fdi/policy/10osvendor/Makefile.am (dist_fdi_DATA):
Add 10-security-policy.fdi
* fdi/policy/10osvendor/10-security-policy.fdi: New file
Index: main.c
===================================================================
RCS file: /cvs/hal/hal/hald-runner/main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- main.c 21 Jan 2006 02:45:27 -0000 1.1
+++ main.c 21 Jan 2006 16:54:04 -0000 1.2
@@ -188,7 +188,8 @@
}
int
-main(int argc, char **argv) {
+main(int argc, char **argv)
+{
DBusConnection *c;
DBusError error;
GMainLoop *loop;
@@ -199,6 +200,8 @@
dbus_address = getenv("HALD_RUNNER_DBUS_ADDRESS");
g_assert(dbus_address != NULL);
+ fprintf(stderr, "Runner started - allowed paths are '%s'\n", getenv("PATH"));
+
c = dbus_connection_open(dbus_address, &error);
if (c == NULL)
goto error;
Index: runner.c
===================================================================
RCS file: /cvs/hal/hal/hald-runner/runner.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- runner.c 21 Jan 2006 06:36:51 -0000 1.2
+++ runner.c 21 Jan 2006 16:54:04 -0000 1.3
@@ -187,13 +187,11 @@
}
static
-gboolean find_program(char **argv) {
+gboolean find_program(char **argv)
+{
/* Search for the program in the dirs where it's allowed to be */
- char *dirs[] = { PACKAGE_LIBEXEC_DIR, PACKAGE_SCRIPT_DIR, NULL };
char *program;
char *path = NULL;
- struct stat buf;
- int i;
if (argv[0] == NULL)
return FALSE;
@@ -202,17 +200,6 @@
/* first search $PATH to make e.g. run-hald.sh work */
path = g_find_program_in_path (program);
- /* otherwise check allowed paths */
- if (path == NULL) {
- for (i = 0; dirs[i] != NULL; i++) {
- path = g_build_filename(dirs[i], program, NULL);
- if (stat(path, &buf) == 0) {
- break;
- }
- g_free(path);
- path = NULL;
- }
- }
g_free(program);
if (path == NULL)
return FALSE;
@@ -221,7 +208,6 @@
g_free(argv[0]);
argv[0] = path;
}
- fprintf (stderr, "foobar '%s'!\n", argv[0]);
return TRUE;
}
More information about the hal-commit
mailing list