Sponsored Content
Top Forums Programming Storing a Temporary File Using C Post 302931500 by metallica1973 on Tuesday 13th of January 2015 11:25:06 AM
Old 01-13-2015
Essentially in a nutshell this is what I am trying to achieve:

1 - Temporary download /etc/vpnc/test.conf to tmp_file
2 - Search for a line in tmp_file
3 - print out the results of my findings
4 - Delete tmp_file

As always, many thanks for your help
 

10 More Discussions You Might Find Interesting

1. Ubuntu

Avoid creating temporary files on editing a file in Ubuntu

Hi, My ubuntu flavor always create temporary files having filename followed by ~ on editing. For eg: if I am editing a file called "sip.c", automatically a temporary (bkup) file is getting created with the name "sip.c~". How to avoid this file creation? (7 Replies)
Discussion started by: royalibrahim
7 Replies

2. Shell Programming and Scripting

remove temporary file ?

Hi all, In the script I am creating a temporary file with process id as temp.txt.$$ I want to remove this tomporary file first from the current directory when i'll run the same script next time. Note: Every time when the script executes then it has unique process id and it'll create a... (5 Replies)
Discussion started by: varungupta
5 Replies

3. AIX

error : pg: 0652-122 Cannot write to the temporary file

Hi All, I'm getting this error when I use "pg". /tmp is not full and the permission is correct. root@axappk01::/home> hostname|pg pg: 0652-122 Cannot write to the temporary file. Please advise. (6 Replies)
Discussion started by: fara_aris
6 Replies

4. Shell Programming and Scripting

Perl : how to modify a file without generate a temporary file

Hi All, I have a file like below, how can i insert one line after line 1 without using a temporary file in perl? line 1 line 2 line 3 expected result line 1 new line <---insert here line 2 line 3 (2 Replies)
Discussion started by: summer_cherry
2 Replies

5. Shell Programming and Scripting

temporary file to file then move to directory

Ok in my bash script i have 5 options to create a simple html script. I need to create a temporary file and whatever the user types will be stored in that file using html codes. And then I have another option in which that temporary file will be moved to the public_html directory in which the user... (19 Replies)
Discussion started by: gangsta
19 Replies

6. UNIX for Dummies Questions & Answers

mailx command - Temporary mail file: permission denied

Hi , I am facing a problem with respect to mailx command in unix . Earlier it was working fine and I am facing this issue only from last week . I used mailx command and I am getting a error message as follows : temporary mail file: Permission denied If I run mailx command from... (2 Replies)
Discussion started by: deepav1985
2 Replies

7. Shell Programming and Scripting

How to remove the first line of a file without using any temporary file

I want remove first line of the file without using any temporary file. Everything should be done in the original file itself since I don't any file creation access whereas I have modify access. It would be great if somebody help in this regard ASAP . Thanks in Advance. Kishore:mad: (1 Reply)
Discussion started by: tvbhkishore
1 Replies

8. Shell Programming and Scripting

How to remove a temporary file inside gawk

Hi- How can I make the temporary file 0 byte , created inside gawk. I am using system("rm -f temp_orders"); It seems system command is deleting file permanently and I am not able to execute below statement. print ORD_HEAD_FULL >> cFILE; (cFile is temp_orders) (2 Replies)
Discussion started by: ashish_kaithi
2 Replies

9. UNIX for Dummies Questions & Answers

Mailx - temporary mail message file: No such file or directory

How would I go about resolving this error temporary mail message file: No such file or directory Can anybody tell me where the default location is for the temporary mail message file is for mailx? It appears that it doesn't exist. Thanks (1 Reply)
Discussion started by: joen
1 Replies

10. UNIX for Beginners Questions & Answers

Finding specific string in file and storing in another file

Text in input file is like this <title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" width="313" height="20" key="staticText-1"/> <box></box> <textElement> <font fontName="Arial" pdfFontName="Helvetica-Bold"... (4 Replies)
Discussion started by: aankita30
4 Replies
vpnc_selinux(8) 						SELinux Policy vpnc						   vpnc_selinux(8)

NAME
vpnc_selinux - Security Enhanced Linux Policy for the vpnc processes DESCRIPTION
Security-Enhanced Linux secures the vpnc processes via flexible mandatory access control. The vpnc processes execute with the vpnc_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. For example: ps -eZ | grep vpnc_t ENTRYPOINTS
The vpnc_t SELinux type can be entered via the vpnc_exec_t file type. The default entrypoint paths for the vpnc_t domain are the following: /sbin/vpnc, /usr/sbin/vpnc, /usr/bin/openconnect PROCESS TYPES
SELinux defines process types (domains) for each process running on the system You can see the context of a process using the -Z option to ps Policy governs the access confined processes have to files. SELinux vpnc policy is very flexible allowing users to setup their vpnc pro- cesses in as secure a method as possible. The following process types are defined for vpnc: vpnc_t Note: semanage permissive -a vpnc_t can be used to make the process type vpnc_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANS
SELinux policy is customizable based on least access required. vpnc policy is extremely flexible and has several booleans that allow you to manipulate the policy and run vpnc with the tightest access possible. If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server, you must turn on the authlo- gin_nsswitch_use_ldap boolean. Disabled by default. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow all daemons the ability to read/write terminals, you must turn on the daemons_use_tty boolean. Disabled by default. setsebool -P daemons_use_tty 1 If you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Enabled by default. setsebool -P deny_ptrace 1 If you want to allow all domains to use other domains file descriptors, you must turn on the domain_fd_use boolean. Enabled by default. setsebool -P domain_fd_use 1 If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default. setsebool -P domain_kernel_load_modules 1 If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. setsebool -P fips_mode 1 If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default. setsebool -P global_ssp 1 If you want to allow confined applications to run with kerberos, you must turn on the kerberos_enabled boolean. Enabled by default. setsebool -P kerberos_enabled 1 If you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default. setsebool -P nis_enabled 1 If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Disabled by default. setsebool -P nscd_use_shm 1 If you want to support ecryptfs home directories, you must turn on the use_ecryptfs_home_dirs boolean. Disabled by default. setsebool -P use_ecryptfs_home_dirs 1 NSSWITCH DOMAIN
If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server for the vpnc_t, you must turn on the authlogin_nsswitch_use_ldap boolean. setsebool -P authlogin_nsswitch_use_ldap 1 If you want to allow confined applications to run with kerberos for the vpnc_t, you must turn on the kerberos_enabled boolean. setsebool -P kerberos_enabled 1 MANAGED FILES
The SELinux process type vpnc_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. NetworkManager_var_run_t /var/run/teamd(/.*)? /var/run/nm-xl2tpd.conf.* /var/run/nm-dhclient.* /var/run/NetworkManager(/.*)? /var/run/wpa_supplicant(/.*)? /var/run/wicd.pid /var/run/NetworkManager.pid /var/run/nm-dns-dnsmasq.conf /var/run/wpa_supplicant-global net_conf_t /etc/hosts[^/]* /etc/yp.conf.* /etc/denyhosts.* /etc/hosts.deny.* /etc/resolv.conf.* /etc/sysconfig/networking(/.*)? /etc/sysconfig/network-scripts(/.*)? /etc/sysconfig/network-scripts/.*resolv.conf /etc/ethers /etc/ntp.conf vpnc_tmp_t vpnc_var_run_t /var/run/vpnc(/.*)? FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type. You can see the context of a file using the -Z option to ls Policy governs the access confined processes have to these files. SELinux vpnc policy is very flexible allowing users to setup their vpnc processes in as secure a method as possible. STANDARD FILE CONTEXT SELinux defines the file context types for the vpnc, if you wanted to store files with these types in a diffent paths, you need to execute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk. semanage fcontext -a -t vpnc_exec_t '/srv/vpnc/content(/.*)?' restorecon -R -v /srv/myvpnc_content Note: SELinux often uses regular expressions to specify labels that match multiple files. The following file types are defined for vpnc: vpnc_exec_t - Set files with the vpnc_exec_t type, if you want to transition an executable to the vpnc_t domain. Paths: /sbin/vpnc, /usr/sbin/vpnc, /usr/bin/openconnect vpnc_tmp_t - Set files with the vpnc_tmp_t type, if you want to store vpnc temporary files in the /tmp directories. vpnc_var_run_t - Set files with the vpnc_var_run_t type, if you want to store the vpnc files under the /run or /var/run directory. Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. COMMANDS
semanage fcontext can also be used to manipulate default file context mappings. semanage permissive can also be used to manipulate whether or not a process type is permissive. semanage module can also be used to enable/disable/install/remove policy modules. semanage boolean can also be used to manipulate the booleans system-config-selinux is a GUI tool available to customize SELinux policy settings. AUTHOR
This manual page was auto-generated using sepolicy manpage . SEE ALSO
selinux(8), vpnc(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) , setsebool(8) vpnc 14-06-10 vpnc_selinux(8)
All times are GMT -4. The time now is 09:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy