1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Little help with sudo

This commit is contained in:
Nicolas Viennot 2013-11-01 13:47:30 -04:00
parent 4bd26896f8
commit b68ebad5a9

View File

@ -331,8 +331,12 @@ void tmate_ssh_server_main(const char *keys_dir, int port)
client->ip_address, sizeof(client->ip_address)) < 0)
tmate_fatal("Error getting IP address from connection");
if ((pid = namespace_fork()) < 0)
tmate_fatal("Can't fork in new namespace");
if ((pid = namespace_fork()) < 0) {
if (getuid() == 0)
tmate_fatal("Can't fork in new namespace, are you running a recent kernel?");
else
tmate_fatal("Can't fork in new namespace, run me with root priviledges");
}
if (pid) {
tmate_info("Child spawned pid=%d, ip=%s",