Sponsored Content
Top Forums Programming Timed action after fork() in parent process Post 302510847 by disaster on Tuesday 5th of April 2011 06:45:47 AM
Old 04-05-2011
Well, looks like I learned more than I intended to... didn't know that this was possible for binaries either... Anyways: If you take away the read flag, this way won't work anymore:
Code:
[chris@myhost Test]$ ./hw
Hallo welt
[chris@myhost Test]$ ls -l hw
-rwxr-xr-x 1 chris users 5432 Apr  1 14:44 hw
[chris@myhost Test]$ chmod -x hw
[chris@myhost Test]$ ./hw
bash: ./hw: Permission denied
[chris@myhost Test]$ /lib/ld-linux.so.2 ./hw
Hallo welt
[chris@myhost Test]$ chmod -r hw
[chris@myhost Test]$ /lib/ld-linux.so.2 ./hw
./hw: error while loading shared libraries: ./hw: cannot open shared object file: Permission denied
[chris@myhost Test]$ chmod +x hw
[chris@myhost Test]$ ./hw
Hallo welt
[chris@myhost Test]$ /lib/ld-linux.so.2 ./hw
./hw: error while loading shared libraries: ./hw: cannot open shared object file: Permission denied


My intention is to make one program available only over one call within another program. So I would take away its read and exec permissions, so it cannot be executed from anywhere else (assume chmod isn't available to the user). Just with my call as above. The program is obvious: If I wait in the parent process until the child exits there is a time gap in which the permissions are not so strict as I actually want them to be...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find the chid process id from given parent process id

how to find the chid process id from given parent process id.... (the chid process doesnot have sub processes inturn) (3 Replies)
Discussion started by: guhas
3 Replies

2. Programming

Problems with child comunicating with parent on fork()

Hello, I'm trying to implement a version of a bucketSort (kinda) server/client, but I'm having a VERY hard time on making the server behave correctly, when talking to the children, after it forks. The server is kinda big (300+ lines), so I won't post it here, but here's what I'm doing. 1)create a... (8 Replies)
Discussion started by: Zarnick
8 Replies

3. UNIX for Advanced & Expert Users

Fork() 1 Parent 3 Children

Hi, as I understand fork(), it makes a copy of the parent which becomes a child. But is there anyway to make three children for that one parent. So in other words, if I look up the getppid() of the children, I want them to have the same value?? Thanks in advance to any help! (1 Reply)
Discussion started by: MS_CC
1 Replies

4. Shell Programming and Scripting

How to make the parent process to wait for the child process

Hi All, I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program. I want 1st script to wait until the 'C' program completes. I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
Discussion started by: sennidurai
7 Replies

5. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

6. Programming

parent called more times - fork - C language

Hi gurus can you explain following lines of code ? #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> int main(void) { pid_t pid; int rv; switch(pid = fork()) { case -1: ... (7 Replies)
Discussion started by: wakatana
7 Replies

7. Programming

fork(), parent and child processes???

Hi friends, I have a small question regarding unix system call fork, I hope you will solve my problem. Here is the small program $ cat fork1.c #include <stdio.h> #include <unistd.h> #include <sys/types.h> int main() { int pid; int x = 0; x = x + 1; pid = fork(); if(pid < 0) {... (2 Replies)
Discussion started by: gabam
2 Replies

8. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

9. UNIX for Dummies Questions & Answers

Timed loop to scan for a process

Hi all, Looking for some help, I have written a very simple script to pass to PowerHA to act as an indicator to activate failover required. Where i get completely lost is I have to create a wait and carry out the grep for the process once every 10 seconds this works but need to embed this... (1 Reply)
Discussion started by: Gary Hay
1 Replies

10. UNIX for Beginners Questions & Answers

One parent, multiple children pipe with fork()

The task I have to do is something along the lines "I receive some input and based on the first character I send it through pipe to one of the children to print". The scheme it is based on is 1->2; 1->3; 1->4; 2 will print all the input that starts with a letter, 3 will print all the input that... (2 Replies)
Discussion started by: Ildiko
2 Replies
Net::LDAPS(3)						User Contributed Perl Documentation					     Net::LDAPS(3)

NAME
Net::LDAPS - use LDAP over an SSL connection SYNOPSIS
use Net::LDAPS; $ldaps = Net::LDAPS->new('myhost.example.com', port => '10000', verify => 'require', capath => '/usr/local/cacerts/'); # alternate way use Net::LDAP; $ldaps = Net::LDAP->new('ldaps://myhost.example.com:10000', verify => 'require', capath => '/usr/local/cacerts/'); DESCRIPTION
Communicate using the LDAP protocol to a directory server using an encrypted (SSL) network connection. This mechanism is non-standard but widely supported; consider using LDAPv3 with the standard TLS extension if possible (many servers do not support it yet.) See "start_tls" in Net::LDAP. All the normal "Net::LDAP" methods can be used with a "Net::LDAPS" object; see Net::LDAP for details. CONSTRUCTOR
new ( HOST [, OPTIONS ] ) Create a new connection. HOST is the hostname to contact. OPTIONS is a number of key/value pairs. See "new" in Net::LDAP for details. SEE ALSO
Net::LDAP, IO::Socket::SSL BUGS
You cannot have more than one LDAPS connection at any one time, due to restrictions in the underlying Net::SSLeay code. AUTHOR
Chris Ridd <chris.ridd@isode.com> COPYRIGHT
Copyright (c) 2000-2004, Chris Ridd and Graham Barr. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-09-20 Net::LDAPS(3)
All times are GMT -4. The time now is 08:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy