world.OpenPort() works almost all the times you'd expect it to on Linux EXCEPT when the security level is set to trusted
Code Snippet (if applicable) to Reproduce Problem:
Using this with a combination of strace and -params I have determined the port change isn't even attempted while running in trusted mode whereas it works fine in safe and ultrasafe modes
.
var/sec_level
/world
sleep_offline = FALSE
/world/New()
..()
sec_level = params["sec_level"]
if(!sec_level)
log << "Please run with -params \"sec_level=<DD security level>\""
del(src)
if(params["at_startup"])
//should have launched with strace
var/result = OpenPort(12346)
log << "Result: [result] ([result == null])"
del(src)
/client/verb/check_em()
set name = "Do test (with client)"
if(sec_level == "trusted")
var/pid = input("Enter DD PID") as num
shell("strace -y -yy -C -o /code/verb_with_client_[sec_level].log -p [pid] &")
var/result = world.OpenPort(12346)
world.log << "Result: [result] ([result == null])"
del(world)
/client/verb/check_em2()
set name = "Do test (without client)"
var/pid
if(sec_level == "trusted")
pid = input("Enter DD PID") as num
del_client_and_continue(src, pid)
/proc/del_client_and_continue(client/C, pid)
del(C)
sleep(50)
if(sec_level == "trusted")
shell("strace -y -yy -C -o /code/verb_no_client_[sec_level].log -p [pid] &")
var/result = world.OpenPort(12346)
world.log << "Result: [result] ([result == null])"
del(world)
Expected Results:
The port changes and the new port value is returned
Actual Results:
The port doesn't change and null is returned
Does the problem occur:
Every time
When does the problem NOT occur?
Running on ultrasafe or safe
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? It occurs at least up to 512.1427 but probably earlier too
Workarounds:
None in BYOND