/[baselayout]/trunk/src/runscript.c
Gentoo

Contents of /trunk/src/runscript.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 484 - (show annotations) (download) (as text)
Wed Apr 21 17:09:18 2004 UTC (15 years, 1 month ago) by vapier
File MIME type: text/x-csrc
File size: 887 byte(s)
update copyright years

1 /*
2 * Copyright 1999-2004 Gentoo Technologies, Inc.
3 * Distributed under the terms of the GNU General Public License v2
4 * $Header$
5 */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <sys/types.h>
11 #include <wait.h>
12 #include <dlfcn.h>
13
14 static void (*selinux_run_init) (void);
15
16 int main(int argc, char **argv) {
17 char *myargs[32];
18 void *lib_handle;
19 int new = 1;
20 myargs[0] = "runscript";
21
22 /* if (argc < 3)
23 exit(1);
24 */
25 while (argv[new] != 0) {
26 myargs[new] = argv[new];
27 new++;
28 }
29 myargs[new] = (char *) 0;
30 if (argc < 3) {
31 execv("/lib/rcscripts/sh/rc-help.sh",myargs);
32 exit(1);
33 }
34
35 lib_handle = dlopen("/lib/rcscripts/runscript_selinux.so", RTLD_LAZY | RTLD_GLOBAL);
36 if( lib_handle != NULL ) {
37 selinux_run_init = dlsym(lib_handle, "selinux_runscript");
38 selinux_run_init();
39 }
40
41 if (execv("/sbin/runscript.sh",myargs) < 0)
42 exit(1);
43
44 return 0;
45 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20