/[vps]/baselayout-vserver/trunk/src/core/src/runscript.c
Gentoo

Diff of /baselayout-vserver/trunk/src/core/src/runscript.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 235 Revision 236
21#define IS_SBIN_RC() ((caller) && (0 == strcmp (caller, SBIN_RC))) 21#define IS_SBIN_RC() ((caller) && (0 == strcmp (caller, SBIN_RC)))
22 22
23static void (*selinux_run_init_old) (void); 23static void (*selinux_run_init_old) (void);
24static void (*selinux_run_init_new) (int argc, char **argv); 24static void (*selinux_run_init_new) (int argc, char **argv);
25 25
26#if defined(WANT_SELINUX)
26void setup_selinux (int argc, char **argv); 27void setup_selinux (int argc, char **argv);
28#endif
27char ** filter_environ (char *caller); 29char ** filter_environ (char *caller);
28 30
29extern char **environ; 31extern char **environ;
30 32
33#if defined(WANT_SELINUX)
31void 34void
32setup_selinux (int argc, char **argv) 35setup_selinux (int argc, char **argv)
33{ 36{
34 void *lib_handle = NULL; 37 void *lib_handle = NULL;
35 38
50 fprintf (stderr, "Run_init is missing from runscript_selinux.so!\n"); 53 fprintf (stderr, "Run_init is missing from runscript_selinux.so!\n");
51 exit (127); 54 exit (127);
52 } 55 }
53 } 56 }
54} 57}
58#endif
55 59
56char ** 60char **
57filter_environ (char *caller) 61filter_environ (char *caller)
58{ 62{
59 char **myenv = NULL; 63 char **myenv = NULL;
182 /* XXX: Might think to bail here, but it could mean the system 186 /* XXX: Might think to bail here, but it could mean the system
183 * is rendered unbootable, so rather not */ 187 * is rendered unbootable, so rather not */
184 myenv = environ; 188 myenv = environ;
185 } 189 }
186 190
191#if defined(WANT_SELINUX)
187 /* Ok, we are ready to go, so setup selinux if applicable */ 192 /* Ok, we are ready to go, so setup selinux if applicable */
188 setup_selinux (argc, argv); 193 setup_selinux (argc, argv);
194#endif
189 195
190 if (!IS_SBIN_RC ()) 196 if (!IS_SBIN_RC ())
191 { 197 {
192 if (execve ("/sbin/runscript.sh", myargs, myenv) < 0) 198 if (execve ("/sbin/runscript.sh", myargs, myenv) < 0)
193 exit (1); 199 exit (1);

Legend:
Removed from v.235  
changed lines
  Added in v.236

  ViewVC Help
Powered by ViewVC 1.1.20