From dbf54ace2bbdc61ef74c8df603342c36a1705358 Mon Sep 17 00:00:00 2001 From: NurPech Date: Mon, 7 Jan 2013 21:56:06 +0100 Subject: [PATCH] bugfixes in command "oset" update example configuration file --- src/mod-hostserv.c | 10 +++++++--- srvx.conf.example | 13 +++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/mod-hostserv.c b/src/mod-hostserv.c index 234d610..a652043 100644 --- a/src/mod-hostserv.c +++ b/src/mod-hostserv.c @@ -29,6 +29,8 @@ * "manager_can_del_toplevel" "0"; //managers of a toplevel group may delete the whole group * "manager_can_rename_secondlevel" "0"; //managers of a secondlevel group may rename the whole group * "manager_can_del_secondlevel" "0"; //managers of a secondlevel group may delete the whole group + * "manager_toplevel_can_oset" "0"; //managers of a toplevel group can set other user's fakehosts + * "manager_secondlevel_can_oset" "0"; //managers of a secondlevel group can set other user's fakehosts * }; * }; * @@ -1165,7 +1167,7 @@ static MODCMD_FUNC(cmd_unassign) { static MODCMD_FUNC(cmd_oset) { struct handle_info *hi; char *fakehost; - struct hs_assignment *assgn; + struct hs_assignment *assignment; if(!strchr(argv[1], '.')) { if (!(hi = modcmd_get_handle_info(user, argv[1]))) return 0; @@ -1179,8 +1181,9 @@ static MODCMD_FUNC(cmd_oset) { reply("NSMSG_MUST_AUTH"); return 0; } + struct hs_user *hs_user = hs_get_user(hi, 1); if(!strcmp(argv[1], "*")) { - if(!check_management_access(user->handle_info)) { + if(!check_management_access(user->handle_info, NULL, NULL)) { reply("HSMSG_ACCESS_DENIED"); return 0; } @@ -1195,11 +1198,12 @@ static MODCMD_FUNC(cmd_oset) { reply("HSMSG_UNKNOWN_FAKEHOST", fhinfo.slfh_name, fhinfo.tlfh_name); return 0; } - struct hs_user *hs_user = hs_get_user(hi, 1); if(!check_management_access(user->handle_info, (hostserv_conf.manager_toplevel_can_oset ? fhinfo.tlfh : NULL), (hostserv_conf.manager_secondlevel_can_oset ? fhinfo.slfh : NULL))) { reply("HSMSG_ACCESS_DENIED"); return 0; } + struct hs_toplevel *tlfh; + struct hs_secondlevel *slfh; for(assignment = hs_user->assignments; assignment; assignment = assignment->unext) { slfh = assignment->secondlevel; tlfh = slfh->toplevel; diff --git a/srvx.conf.example b/srvx.conf.example index f8acd0d..84409ed 100644 --- a/srvx.conf.example +++ b/srvx.conf.example @@ -411,6 +411,19 @@ "gline_duration" "1h"; "punishment_reason" "Your message contained a forbidden word."; }; + + "hostserv" { + "nick" "HostServ"; + "modes" "+iokSD"; + "toplevel_access" "600"; + "fallback_other_assignment" "1"; + "manager_can_del_toplevel" "0"; + "manager_can_del_secondlevel" "0"; + "manager_can_rename_toplevel" "0"; + "manager_can_rename_secondlevel" "0"; + "manager_toplevel_can_oset" "0"; + "manager_secondlevel_can_oset" "0"; + }; }; "policers" { -- 2.20.1