Any way I can do this?
#!/bin/bash
cd /mystic
trap '' 2
./_mystic "$*"
And voila! Ran across the street to 7-11, was still able to log in remotely, and it appears Ctrl-C is now being trapped.
I'll continue testing before I go live with this, but am I missing anything obvious? Like a way to natively trap Ctrl-C in Mystic, or security concerns?
Unfortunately, there is a race condition here....
Also, there are a lot of other signals you might
SIGTERM(15) and SIGTSTP(20). I think that covers everything a user could do from the keyboard.
But in this case I'm only thinking as far as "accidentally break out of a door in unanticipated ways". So long as they stay inside the door, I'm
not worried.
Any way I can do this?
Hey, nathanael!
(I'm talking to myself :-) )
On 21 Jan 2019, nathanael pondered and said...
Any way I can do this?
Hey, nathanael!
(I'm talking to myself :-) )
Oh no, he's talking to himself...
Any way I can do this?
Hey, nathanael!
(I'm talking to myself :-) )
Oh no, he's talking to himself...
up not realizing they are actually typing tons of garbage into a database or google search :P
Nonsense. No, I'm not.
Yes, you are.
True, of course. Without a way to trap from within Mystic or its door process, however, this is the best I could come up with.
Thanks for the remind about ^\. I'm now trapping SIGINT(2) SIGQUIT(3) SIGTERM(15) and SIGTSTP(20). I think that covers everything a user could do from the keyboard.
Thanks for the remind about ^\. I'm now trapping SIGINT(2) SIGQUIT(3) SIGTERM(15) and SIGTSTP(20). I think that covers everything a user could do from the keyboard.
You want to run a text-based non-BBS program as a door but users are
able to CTRL-C out of it and end up on a bash shell. Is that correct?
trying to work with Mystic's processes though. SIGTERM, SIGHUP and SIGPIPE are all trapped by Mystic itself, everything else is ignored.
Correct.
I've presently got BSD Games, for example, set up as doors, but they can all be ^C-ed. Trapping SIGINT in a bash wrapper script before running
the mystic client fixes it. In theory, as tenser mentioned, it's vulnerable to a racing condition (though I suspect most folk type too slowly to make it a practical concern).
trying to work with Mystic's processes though. SIGTERM, SIGHUP and SIGPIPE are all trapped by Mystic itself, everything else is ignored.
ATM I'm trapping SIGINT, SIGQUIT SIGTERM and SIGTSTP -- basically, ^C,
^Z, ^T and ^\. Most of the BSD games still respond to ^C, I just end up back in Mystic instead of a command line.
In any case, my menu entries are pretty simple:
(DD) Exec external program
clear;adventure
Maybe I can build something into that system to prevent SIGINT on the child process.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 418 |
Nodes: | 16 (0 / 16) |
Uptime: | 16:04:37 |
Calls: | 8,795 |
Calls today: | 7 |
Files: | 13,300 |
Messages: | 5,966,724 |