Sponsored Content
Top Forums Shell Programming and Scripting Cat files listed in text file and redirect to new directory with same filename Post 302948168 by RudiC on Friday 26th of June 2015 10:54:40 AM
Old 06-26-2015
I'd be very surprised that you'd be denied to cp files but allowed to cat them, as both are just reading operations that need read permission. Are you sure you didn't try sth. different?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy files listed in a text file - whitespace problem.

Hi, Say I have this text file <copy.out> that contains a list of files/directories to be copied out to a different location. $ more copy.out dir1/file1 dir1/file2 dir1/file3 "dir1/white space" dir1/file4 If I do the following: $copy=`more copy.out` $echo $copy dir1/file1... (4 Replies)
Discussion started by: 60doses
4 Replies

2. Shell Programming and Scripting

Shellscript to sort duplicate files listed in a text file

I have many pdf's scattered across 4 machines. There is 1 location where I have other Pdf's maintained. But the issues it the 4 machines may have duplicate pdf's among themselves, but I want just 1 copy of each so that they can be transfered to that 1 location. What I have thought is: 1) I have... (11 Replies)
Discussion started by: deaddevil
11 Replies

3. Shell Programming and Scripting

Moving files listed in a data file to a new directory using Perl

Hi, I have a data file that lists a number of files. I want to move the files named in that one to another directory. Here's what I have: #!/usr/bin/perl -w open(FILE, "<collision.txt"); my @lines=<FILE>; foreach my $lines (@lines) { system("mv $lines collisions/."); } close(FILE); ... (2 Replies)
Discussion started by: renthead720
2 Replies

4. Shell Programming and Scripting

cat redirect EOF missing text

Hello attempting to redirect out to create a startup script in solaris. The steps are working but the $1 entry is being left out. syntax below and content of output file below. cat > S99build << EOF > #!/bin/bash > case $1 in > 'start') > /usr/os-buildsol.sh > > ;; > esac > exit 0 >... (3 Replies)
Discussion started by: juanb25
3 Replies

5. UNIX for Dummies Questions & Answers

cat files from subdirectories output using same filename

Hi, I need to concatenate data files with a .mp extension that are stored in directories by year. I want to keep the same filename as an output for example: for the file name p030.mp, which resides in the following subdirectories: /2000/p030.mp /2001/p030.mp /2002/p030.mp I want to:... (4 Replies)
Discussion started by: cmshreve
4 Replies

6. Shell Programming and Scripting

Recursively cat files in a directory with filename printed first.

I want to recursively cat the content of files in a directory e.g. find /etc -type f -exec cat {} \; But I want it to print the file name first and then the content. For example let's say /etc/statetab and /etc/colord.conf will be printed first then I want the output to look something like; ... (6 Replies)
Discussion started by: lewk
6 Replies

7. Shell Programming and Scripting

Copy files listed in text file to new directory

I am trying to write a script that will copy all file listed in a text file (100s of file names) to a new directory Assume script will run with main as current working directory and I know how many files/lines will be in List.txt Im trying to work up a test script using this model Contents of... (2 Replies)
Discussion started by: IAmTheGrass
2 Replies

8. Shell Programming and Scripting

perl Compare zone files in directory with what is listed in named.conf

I would really appreciate any assistance that I can get here. I am fairly new to perl. I am trying to rewrite my shell scripts to perl. Currently I have a shell script (using sed, awk, grep, etc) that gets a list of all of the zone files in a directory and then looks in named.conf for what... (0 Replies)
Discussion started by: brianjb
0 Replies

9. Shell Programming and Scripting

Delete files listed in text file

Hi Team, Here's the scenario, I have a text file called "file_list.txt". Its content is as follows. 111.tmp 112.tmp 113.tmp 114.tmp These files will present in "workdir" directory. It has many files. But only the files present in file_list.txt has to be deleted from the workdir... (7 Replies)
Discussion started by: kmanivan82
7 Replies

10. Shell Programming and Scripting

Want to delete the junk files from a directory which are not listed in a TEXT file

Hello Everyone, I want to delete the image files from a directory, which are not listed in a TEXT file. The directory contains large number of image files (in millions) required / not required. I want to delete the image files which are "not required". I have generated a Text file having... (3 Replies)
Discussion started by: Praveen Pandit
3 Replies
AUDIT2ALLOW(1)								NSA							    AUDIT2ALLOW(1)

NAME
audit2allow - generate SELinux policy allow/dontaudit rules from logs of denied operations audit2why - translates SELinux audit messages into a description of why the access was denied (audit2allow -w) SYNOPSIS
audit2allow [options] OPTIONS
-a | --all Read input from audit and message log, conflicts with -i -b | --boot Read input from audit messages since last boot conflicts with -i -d | --dmesg Read input from output of /bin/dmesg. Note that all audit messages are not available via dmesg when auditd is running; use "ause- arch -m avc | audit2allow" or "-a" instead. -D | --dontaudit Generate dontaudit rules (Default: allow) -h | --help Print a short usage message -i <inputfile> | --input <inputfile> read input from <inputfile> -l | --lastreload read input only after last policy reload -m <modulename> | --module <modulename> Generate module/require output <modulename> -M <modulename> Generate loadable module package, conflicts with -o -p <policyfile> | --policy <policyfile> Policy file to use for analysis -o <outputfile> | --output <outputfile> append output to <outputfile> -r | --requires Generate require output syntax for loadable modules. -N | --noreference Do not generate reference policy, traditional style allow rules. This is the default behavior. -R | --reference Generate reference policy using installed macros. This attempts to match denials against interfaces and may be inaccurate. -w | --why Translates SELinux audit messages into a description of why the access was denied -v | --verbose Turn on verbose output DESCRIPTION
This utility scans the logs for messages logged when the system denied permission for operations, and generates a snippet of policy rules which, if loaded into policy, might have allowed those operations to succeed. However, this utility only generates Type Enforcement (TE) allow rules. Certain permission denials may require other kinds of policy changes, e.g. adding an attribute to a type declaration to sat- isfy an existing constraint, adding a role allow rule, or modifying a constraint. The audit2why(8) utility may be used to diagnose the reason when it is unclear. Care must be exercised while acting on the output of this utility to ensure that the operations being permitted do not pose a security threat. Often it is better to define new domains and/or types, or make other structural changes to narrowly allow an optimal set of opera- tions to succeed, as opposed to blindly implementing the sometimes broad changes recommended by this utility. Certain permission denials are not fatal to the application, in which case it may be preferable to simply suppress logging of the denial via a 'dontaudit' rule rather than an 'allow' rule. EXAMPLE
NOTE: These examples are for systems using the audit package. If you do not use the audit package, the AVC messages will be in /var/log/messages. Please substitute /var/log/messages for /var/log/audit/audit.log in the examples. Using audit2allow to generate module policy $ cat /var/log/audit/audit.log | audit2allow -m local > local.te $ cat local.te module local 1.0; require { class file { getattr open read }; type myapp_t; type etc_t; }; allow myapp_t etc_t:file { getattr open read }; <review local.te and customize as desired> Using audit2allow to generate module policy using reference policy $ cat /var/log/audit/audit.log | audit2allow -R -m local > local.te $ cat local.te policy_module(local, 1.0) gen_require(` type myapp_t; type etc_t; }; files_read_etc_files(myapp_t) <review local.te and customize as desired> Building module policy using Makefile # SELinux provides a policy devel environment under /usr/share/selinux/devel # You can create a te file and compile it by executing $ make -f /usr/share/selinux/devel/Makefile $ semodule -i local.pp Building module policy manually # Compile the module $ checkmodule -M -m -o local.mod local.te # Create the package $ semodule_package -o local.pp -m local.mod # Load the module into the kernel $ semodule -i local.pp Using audit2allow to generate and build module policy $ cat /var/log/audit/audit.log | audit2allow -M local Generating type enforcment file: local.te Compiling policy: checkmodule -M -m -o local.mod local.te Building package: semodule_package -o local.pp -m local.mod ******************** IMPORTANT *********************** In order to load this newly created policy package into the kernel, you are required to execute semodule -i local.pp Using audit2allow to generate monolithic (non-module) policy $ cd /etc/selinux/$SELINUXTYPE/src/policy $ cat /var/log/audit/audit.log | audit2allow >> domains/misc/local.te $ cat domains/misc/local.te allow cupsd_config_t unconfined_t:fifo_file { getattr ioctl }; <review domains/misc/local.te and customize as desired> $ make load AUTHOR
This manual page was written by Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux system. It was updated by Dan Walsh <dwalsh@redhat.com> The audit2allow utility has contributions from several people, including Justin R. Smith and Yuichi Nakamura. and Dan Walsh Security Enhanced Linux October 2010 AUDIT2ALLOW(1)
All times are GMT -4. The time now is 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy