~ubuntu-branches/ubuntu/intrepid/checkpolicy/intrepid

« back to all changes in this revision

Viewing changes to checkpolicy.c

  • Committer: Bazaar Package Importer
  • Author(s): Caleb Case, Caleb Case, Joseph Jackson IV
  • Date: 2008-02-09 21:34:46 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080209213446-hqazy6s0r3lpdekc
Tags: 2.0.9-0ubuntu1
[ Caleb Case ]
* New upstream SVN HEAD.
 + Added support for policy capabilities from Todd Miller.
 + Initialize the source file name from the command line argument so
   that checkpolicy/checkmodule report something more useful than
   "unknown source".
 + Merged remove use of REJECT and trailing context in lex rules; make
   ipv4 address parsing like ipv6 from James Carter.
 + Merged handle unknown policydb flag support from Eric Paris.
   Adds new command line options -U {allow, reject, deny} for selecting
   the flag when a base module or kernel policy is built.
 + Merged fix for segfault on duplicate require of sensitivity from
   Caleb Case.
 + Merged fix for dead URLs in checkpolicy man pages from Dan Walsh.

[ Joseph Jackson IV ]
* debian/control
  - Update Debian Maintainer field

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
 
91
91
extern policydb_t *policydbp;
92
92
extern int mlspol;
 
93
extern int handle_unknown;
93
94
 
94
95
static char *txtfile = "policy.conf";
95
96
static char *binfile = "policy";
99
100
void usage(char *progname)
100
101
{
101
102
        printf
102
 
            ("usage:  %s [-b] [-d] [-M] [-c policyvers (%d-%d)] [-o output_file] [input_file]\n",
 
103
            ("usage:  %s [-b] [-d] [-U handle_unknown (allow,deny,reject) [-M] [-c policyvers (%d-%d)] [-o output_file] [input_file]\n",
103
104
             progname, POLICYDB_VERSION_MIN, POLICYDB_VERSION_MAX);
104
105
        exit(1);
105
106
}
390
391
        int show_version = 0;
391
392
        struct policy_file pf;
392
393
 
393
 
        while ((ch = getopt(argc, argv, "o:dbMVc:")) != EOF) {
 
394
        while ((ch = getopt(argc, argv, "o:dbU:MVc:")) != EOF) {
394
395
                switch (ch) {
395
396
                case 'o':
396
397
                        outfile = optarg;
405
406
                case 'V':
406
407
                        show_version = 1;
407
408
                        break;
 
409
                case 'U':
 
410
                        if (!strcasecmp(optarg, "deny")) {
 
411
                                handle_unknown = DENY_UNKNOWN;
 
412
                                break;
 
413
                        }
 
414
                        if (!strcasecmp(optarg, "allow")) {
 
415
                                handle_unknown = ALLOW_UNKNOWN;
 
416
                                break;
 
417
                        }
 
418
                        if (!strcasecmp(optarg, "reject")) {
 
419
                                handle_unknown = REJECT_UNKNOWN;
 
420
                                break;
 
421
                        }
 
422
                        usage(argv[0]);
408
423
                case 'M':
409
424
                        mlspol = 1;
410
425
                        break;
515
530
 
516
531
                /* Let sepol know if we are dealing with MLS support */
517
532
                parse_policy.mls = mlspol;
 
533
                parse_policy.handle_unknown = handle_unknown;
518
534
 
519
535
                policydbp = &parse_policy;
520
536