updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / compartment / compartment.c.diff
blobf1483f693d0872551e63850fc3303b0552faaeef
1 --- a/compartment.c 2002-08-24 19:49:26.000000000 +0200
2 +++ b/compartment.c 2007-02-03 18:36:00.000000000 +0100
3 @@ -83,18 +83,7 @@
4 void help() {
5 fprintf(stderr, "%s %s %s %s %s\n\n", PROGRAM_NAME, VERSION, AUTHOR, AUTHOR2, POINTER);
6 fprintf(stderr, "Syntax: %s [options] /full/path/to/program\n", prg);
7 - fprintf(stderr, "Options:
8 -\t --chroot path\t chroot to path
9 -\t --user user\t change uid to this user
10 -\t --group group\t change gid to this group
11 -\t --init program\t execute this program/script before doing anything
12 -\t --cap capset\t set capset name. This option can be used several times.
13 -\t --verbose\t be verbose
14 -\t --quiet\t do no logging (to syslog)
15 -\t --fork\t\t fork (if everything is fine)
16 -\nHints: always try to chroot; use --user&group if possible; chroot and chown all
17 -files to another user than root if you use capabilties. Read the README file!
18 -\nKnown capset names: none");
19 + fprintf(stderr, "Options:\n\t --chroot path\t chroot to path\n\t --user user\t change uid to this user\n\t --group group\t change gid to this group\n\t --init program\t execute this program/script before doing anything\n\t --cap capset\t set capset name. This option can be used several times.\n\t --verbose\t be verbose\n\t --quiet\t do no logging (to syslog)\n\t --fork\t\t fork (if everything is fine)\n\nHints: always try to chroot; use --user&group if possible; chroot and chown all\nfiles to another user than root if you use capabilties. Read the README file!\n\nKnown capset names: none");
20 tmp = 0;
21 while(strlen(cap_set_names[tmp])>0)
22 fprintf(stderr," %s",cap_set_names[tmp++]);
23 @@ -189,11 +178,11 @@
24 my_secure();
25 openlog("Compartment", LOG_PID, LOG_DAEMON);
26 if (sizeof(uid_t) == 4) {
27 - (unsigned long int) uidrange = 65535;
28 + uidrange = 65535;
29 } else { if (sizeof(uid_t) == 8) {
30 - (unsigned long int) uidrange = (unsigned long int) 2147483646; //4294967295;
31 + uidrange = (unsigned long int) 2147483646; //4294967295;
32 } else
33 - fprintf(stderr, "Warning: weird uid size: %d\n", sizeof(uid_t));
34 + fprintf(stderr, "Warning: weird uid size: %ld\n", sizeof(uid_t));
37 program_params = 1;
38 @@ -442,11 +431,7 @@
39 if (access(_argv[0], X_OK) < 0)
40 print_msg("Execute bit missing, or no permissions to execute %s\n", _argv[0]);
41 else
42 - print_msg("Could not properly execute %s - the chroot environment might not be
43 -set up correctly:
44 -Create the directories /etc and /lib in chroot_dir and run \"ldd %s\"
45 -to see which libraries are needed. Copy these to chroot_dir/lib, then chdir to
46 -chroot_dir and execute \"ldconfig -X -r .\"\n", _argv[0], _argv[0]);
47 + print_msg("Could not properly execute %s - the chroot environment might not be\nset up correctly:\nCreate the directories /etc and /lib in chroot_dir and run \"ldd %s\"\nto see which libraries are needed. Copy these to chroot_dir/lib, then chdir to\nchroot_dir and execute \"ldconfig -X -r .\"\n", _argv[0], _argv[0]);
50 return 1;