gradm --help displays: [...] -O <filename|directory>, --output Specify where to place policies generated from learning mode. Should be a directory only if "split-roles" is specified in learn_config. [...] So: # grep split /etc/grsec/learn_config # to write out your generated policy such that roles are split into separate split-roles but: # gradm -L grlearn -O b Unable to open b for writing. Error: Is a directory Reproducible: Always
What version of gradm?
(In reply to comment #1) > What version of gradm? Sorry. Its in the title. I've confirmed this.
I added gradm-2.9.1.201301041755 to the tree. Can you test?
No, still doesn't work. If I don't create output dir then output should be created as file. But I'm lookong into gradm_fulllearn.c file and there is: if (grlearn_options & GR_SPLIT_ROLES) { if (stream) { fprintf(stderr, "Error: Output path must be a directory when \"split-roles\" is used in learn-config.\n"); exit(EXIT_FAILURE); } current_output_file = alloca(strlen(output_log) + 16384); sprintf(current_output_file, "%s/policy", output_log); stream = fopen(current_output_file, "w"); if (stream == NULL) { fprintf(stderr, "Unable to open %s for writing.\n" "Error: %s\n", current_output_file, strerror(errno)); exit(EXIT_FAILURE); } } else { if (stream == NULL) { fprintf(stderr, "Error: Output path must be a file when \"split-roles\" is not used in learn-config.\n"); exit(EXIT_FAILURE); } } And I didn't got message "Output path must be a directory when...". So maybe: a) gradm doesn't noticed I configured "split-roles" b) something is wrong with "if" statement above c) something else, (I don't have C skills) ;)
man 8 gradm says: -O <filename|stream> Specifies output mode. Requires a single argument that can be "stdout", "stderr", or a regular file. Only used with -L or -F. So it looks option with "directory" was removed, but gradmfullearn.c says something diffrent.
(In reply to comment #5) > man 8 gradm says: > -O <filename|stream> > Specifies output mode. Requires a single argument that can be > "stdout", "stderr", or a regular file. Only used with -L or > -F. > > So it looks option with "directory" was removed, but gradmfullearn.c says > something diffrent. Yep. Upstream is not supporting this.
Uhm, thanks.