]> arthur.barton.de Git - ngircd-alex.git/commitdiff
No_Privileges(): handle forwarded messages.
authorAlexander Barton <alex@barton.de>
Tue, 22 Jul 2008 16:33:44 +0000 (18:33 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 30 Sep 2009 14:00:05 +0000 (16:00 +0200)
src/ngircd/irc-oper.c

index 544fe67d4928c8ba3dc793f38107b6f62b8a5835..e7dfee6c944e48237b25a4d2aa7942aa81c3676b 100644 (file)
@@ -73,10 +73,22 @@ Check_Oper(CLIENT * Client)
 static bool
 No_Privileges(CLIENT * Client, REQUEST * Req)
 {
-       Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"",
-           Client_Mask(Client), Req->command);
-       return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG,
-                                 Client_ID(Client));
+       CLIENT *from = NULL;
+
+       if (Req->prefix) 
+               from = Client_Search(Req->prefix);
+
+       if (from) {
+               Log(LOG_NOTICE, "No privileges: client \"%s\" (%s), command \"%s\"",
+                   Req->prefix, Client_Mask(Client), Req->command);
+               return IRC_WriteStrClient(from, ERR_NOPRIVILEGES_MSG,
+                                         Client_ID(from));
+       } else {
+               Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"",
+                   Client_Mask(Client), Req->command);
+               return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG,
+                                         Client_ID(Client));
+       }
 } /* PermissionDenied */