LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-01-2004, 10:26 PM   #1
luzi82
LQ Newbie
 
Registered: Apr 2003
Posts: 26

Rep: Reputation: 15
over-fork


once upon a time, a funny user run these C++ code in my computer.

Code:
#include <stdlib.h>

int main() {
   while (1) {fork();}
}
oh, yes. I can remove his account for punishment.
But I think it would be better if I can do something to prevent such thing happen.

what can I do?
 
Old 01-02-2004, 04:51 AM   #2
poison
Member
 
Registered: Dec 2003
Location: Layer 7 =D
Distribution: Slackware, LFS, Rock Linux
Posts: 165

Rep: Reputation: 30
1. prevent those funny users from using your mightiest weapon-your compiler ^^
2. prevent them from installing, copying, moving any binarys. and maybe even prevent them from making any file executable ^^ just do a little scripting...
3. punish them if they are still feeling funny =)

hehe....I'm a bastard ^^
 
Old 01-02-2004, 06:55 AM   #3
Y0jiMb0
Member
 
Registered: Jul 2003
Location: Valencia (Spain)
Distribution: slackware 11, FEDORA CORE 4, RHEL3, Gentoo...
Posts: 361

Rep: Reputation: 30
Hi!
It is an interesting problem I've never asked myself before. I was looking for some information, and I found something, that may be useful
What I think you should do is to establish a limit for the number of processes a "normal" user can own (perhaps a good idea is also limiting the number of files that a process can open, to avoid more problems in the future).
How can you achieve this? Several ways:

1) check "man limits". With a file called "/etc/limits" you can easily do it.

2) Maybe another possibility:
http://rexgrep.tripod.com/rexfbdmain.htm
(however, it could be a bit old, I have no idea about it )

3) You could do it by hand: a couple of scripts... it should be possible

I hope it helps (EDIT>) you to give a "funny" surprise to this "funny user".
Regards

Last edited by Y0jiMb0; 01-02-2004 at 06:59 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
more on fork() feetyouwell Programming 6 09-17-2004 11:18 AM
fork() vibhory2j Linux - Software 1 05-24-2004 04:11 AM
Fork again Avatar33 Programming 13 08-22-2003 01:41 PM
fork() lowlifeish Programming 3 11-04-2002 10:50 AM
Fork Ztyx Linux - General 1 08-31-2002 11:25 AM


All times are GMT -5. The time now is 05:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration