- Home /
How to serve security policy on linux system?
Unity ships sockpol.exe for Windows, and that can be run on Mac with "mono sockpol.exe", but Linux servers are omitted. Presumably they figured if you ran a Linux server you'd know how to do it. Well I didn't, and couldn't find it, so I'm going to answer my own question, because I think it will be useful, and would love it if someone had a better idea.
Answer by Molix · Apr 29, 2011 at 02:11 PM
You can use netcat (a.k.a. nc) to listen on a socket and respond to requests. Basically you just create a script that pipes an echo of the domain policy to nc. e.g., create a text file that will be your script, say, domainPolicyServer.sh:
#!/bin/sh
while true; do echo '<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="1-65536"/>
</cross-domain-policy>' | netcat -l 843; done
You'll need to make it executable, and you'll probably want to make sure no one messes with it, e.g.
chmod 700 domainPolicyServer.sh
You can then start that with:
/path/to/file/domainPolicyServer.sh > /dev/null &
That will start it in the background and keep it quiet.
You can also add that command to your /etc/rc.local to ensure it is started at boot up.
This works, but I'm no Linux guru, so feedback is welcome.
Not really useful to me atm, but upvote for sharing your knowledge/experience with the community!
Hi, thanks! $$anonymous$$aybe it's due to a different "netcat" I have under Debian Squeeze, but I had to change your script slightly to make it work: I used "netcat -l -p 843" ins$$anonymous$$d of "netcat -l 843".
After adding the -p option the script works. Awesome.
@molix please add a remark in your answer.
Answer by AdrianJF · Sep 29, 2015 at 03:28 PM
There is an issue with this script becoming unresponsive and stopping responding to tcp requests. The script is still running but with no clue to why it's not responding.,There is an issue with this script becoming unresponsive and stopping reponding to tcp requests. The script is still running but with no clue to why it's not responding.
Your answer
Follow this Question
Related Questions
Security Policy works with WWW but not with PrefetchSocketPolicy on web port? 1 Answer
Cross-domain policy for specific folder/URL 1 Answer
Security.PrefetchSocketPolicy problem. 0 Answers
Web Player connection issue. 0 Answers
Why not Linux? 1 Answer