--- gvpe/src/conf.C 2011/03/06 21:01:36 1.56 +++ gvpe/src/conf.C 2012/12/04 10:29:43 1.59 @@ -40,6 +40,7 @@ #include #include #include +#include #include "netcompat.h" @@ -182,6 +183,7 @@ #if ENABLE_DNS free (dns_forw_host); dns_forw_host = 0; #endif + free (change_root); change_root = 0; free (script_if_up); script_if_up = 0; free (script_node_up); script_node_up = 0; free (script_node_change); script_node_change = 0; @@ -275,8 +277,23 @@ conf.icmp_type = atoi (val); #endif } + else if (!strcmp (var, "chuser")) + { + struct passwd *pw = getpwnam (val); + if (!pw) + return _("user specified for chuser not found"); + + conf.change_uid = pw->pw_uid; + conf.change_gid = pw->pw_gid; + } + else if (!strcmp (var, "chuid")) + conf.change_uid = atoi (val); + else if (!strcmp (var, "chgid")) + conf.change_gid = atoi (val); + else if (!strcmp (var, "chroot")) + free (conf.change_root), conf.change_root = strdup (val); - // per config + // per node else if (!strcmp (var, "node")) { parse_argv ();