#perl
02 October 2007
Total 34 pages. You are browsing page 4/34.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
02:49 <****> not system()
02:49 <****> Why do you need it do do this?
02:49 <****> That die will never be reached
02:49 * jagerman is suprised it took so long for "why do you want to do that?" to come up
02:49 <****> it does
02:49 <****>
02:49 <****> platypus: Yes it will: if exec fails
02:50 <****> Which, mind you, means it is *not* restarting anything :)
02:50 <****> jagerman: Yes, but not the way Mr-Shutter expects it to be.
02:50 <****> heh, true
02:50 <****> eval: exec(perl, $0); die "aids";
02:50 <****> Mr-Shutter: ''ERROR: 26674: aids at (eval 213) line 1.
02:51 <****> buubot will not let you do that.
02:51 <****> eval: exec(perl, $0) or die "Exec failed: $!"
02:51 <****> jagerman: ''ERROR: 26698: Exec failed: No such file or directory at (eval 213) line 1.
02:51 <****> something like this might work: exec $^X, $0;
02:51 <****> eval: exec($^X, $0) or die "Exec failed: $!"
02:51 <****> jagerman: ''ERROR: 26706: Exec failed: No such file or directory at (eval 213) line 1.
02:51 <****> but then, it might not depending on changes to cwd, etc.
02:52 <****> eval: exec $0
02:52 <****> apeiron: 0
02:52 * apeiron notes that evals fork()
02:52 <****> Well, buubot's, anyway
02:52 <****> apeiron, eval dont fork
02:52 <****> systems do
02:52 <****> eval don;t return....
02:52 <****> Mr-Shutter: ''ERROR: syntax error at (eval 213) line 1, near "t return"
02:52 <****> eval: fork or die "spoon: $!"
02:52 <****> jagerman: ''ERROR: 26762: spoon: Resource temporarily unavailable at (eval 213) line 1.
02:52 <****> Mr-Shutter, I'm aware.
02:53 <****> Mr-Shutter, I mean that buubot's eval: command does a fork.
02:53 <****> yea
02:53 <****> Thus you can try to make it run code that crashes current perls and it doesn't crash the bot.
02:53 <****> and changes user id and system root
02:53 * apeiron knows this last fact firsthand. :)
02:53 <****> and sets max files open to 1
02:54 <****> buubot also runs chroot'd with 0 fds available (among other things)
02:55 <****> eval: use constant spoon, knife; fork while knife eq spoon;
02:55 <****> jagerman: Error, killing eval due to timeout
02:56 <****> sp i should do a exec('/usr/bin/perl/', "-e \'kill($PID); exec(\"/user/bin/perl/\",$0);\'");
02:56 <****> What if /usr/bin/perl or /user/bin/perl don't exist?
02:56 <****> lol whops
02:56 <****> sp i should do a exec('/usr/bin/perl/', "-e \'kill($PID); exec(\"/usr/bin/perl/\",$0);\'");
02:56 <****> eval: kill -9, $$
02:56 <****> jagerman: 0
02:57 <****> Mr-Shutter: if you have to have a new pid, fork() first
02:57 <****> eval: kill 9, $$
02:57 <****> Mr-Shutter: otherwise, i think you are missing the point of exec()
02:57 <****> Hmm.
02:57 <****> and $^X might be better instead of hardcoding your perl interp
02:57 <****> Did it actually do it?
02:57 <****> eval: getppid
02:57 <****> apeiron: 26930
02:57 <****> it forks
02:57 <****> e.g. we have perl installed in /u01/opt at work
02:57 <****> eval: $$
02:57 <****> Jmax: 26938
02:57 <****> eval: $$
02:57 <****> Jmax: 26940
02:58 <****> eval: kill 9, $$; $!
02:58 <****> eval: getppid
02:58 <****> jagerman: 27014
02:58 <****> ?
02:58 <****> perldoc -f getppid
02:59 <****> eval: $foo = 0
02:59 <****> pravus: 0
02:59 * apeiron wonders.
02:59 <****> wtf didn't that kill come back?
02:59 <****> eval: kill 9, getppid
02:59 <****> apeiron: 0
02:59 <****> awww.
02:59 <****> eval: $SIG{INT} = sub { print "Caught INT" }; kill 2, $$;
02:59 <****> jagerman: Caught INT1
03:00 <****> buu++ # AFAIK, that legitimately should have killed buubot
03:00 <****> apeiron: the parent is run as root
03:00 <****> then it drops privs to another user
03:00 <****> ah. Would have to be privseps, yeah.
03:00 <****> eval: kill 9, $$
03:01 <****> pravus, buu still gets a ++ for thinking of it.
03:01 <****> apparently buu isn't catching child deaths from a sigkill
03:01 <****> eval: $$
03:01 <****> tag: 27112
03:01 <****> eval: $$
03:01 <****> tag: 27115
03:01 <****> that's what I thought
03:01 <****> eval: [$$, getppid]
03:01 <****> apeiron: :) i was just explaining how it works
03:01 <****> jagerman: [27139,27138]
03:01 <****> although it has been a long time since i've looked at the source
03:02 <****> eval: kill 9, 27138
03:02 <****> tag: 0
03:02 <****> hurm
03:02 <****> clever
03:02 <****> deparse: BEGIN{ kill 9, 27138}
03:02 <****>)]
03:02 <****> jagerman: []
03:03 <****>
03:03 <****> jagerman: ''ERROR: syntax error at (eval 213) line 2, at EOF
03:03 <****>
03:03 <****> jagerman: 65534
Total 34 pages. You are browsing page 4/34.
First :: Prev :: [...] [2] [3] [4] [5] [6] [...] :: Next :: Last
