Fixed captive-sandbox-server chroot(2) mode on SUSE9.0.
authorshort <>
Thu, 30 Oct 2003 16:24:36 +0000 (16:24 +0000)
committershort <>
Thu, 30 Oct 2003 16:24:36 +0000 (16:24 +0000)
 - Great debugging support by the courtesy of Christian Kristukat.

src/client/sandbox-server/main.c

index 3f470bc..796fbbc 100644 (file)
@@ -368,6 +368,14 @@ struct passwd *want_uid_passwd;
                want_uid_name=captive_strdup_alloca(want_uid_passwd->pw_name);
                }
 
+       /* Prevent: GLib-WARNING **: getpwuid_r(): failed due to unknown user id (42)
+        * Try to invoke GLib g_get_any_init() before possible chroot(2) below.
+        */
+       g_get_user_name();
+       g_get_real_name();
+       g_get_home_dir();
+       g_get_tmp_dir();
+
        if (fragile && !optarg_chroot)
                fatal("Fragile setuid/root environment but no --chroot set");
        if (optarg_chroot) {