Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2005-10-12 01:13:58 UTC
Modified files:
Tag: u2_10_12_branch
ChangeLog include/s_stats.h ircd/m_stats.c ircd/s_stats.c
Log message:
Add a flag to /stats that makes a /stats available to local opers.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.9 ircu2.10/ChangeLog:1.710.2.10
--- ircu2.10/ChangeLog:1.710.2.9 Mon Oct 10 05:17:48 2005
+++ ircu2.10/ChangeLog Tue Oct 11 18:13:48 2005
@@ -1,3 +1,11 @@
+2005-10-12 Perry Lorier <[EMAIL PROTECTED]>
+
+ * include/s_stats.h: Add new "Local" only flag to /stats.
+
+ * ircd/m_stats.c: Consult it.
+
+ * ircd/s_stats.c: Use the flag.
+
2004-01-04 Kevin L Mitchell <[EMAIL PROTECTED]>
* ircd/s_numeric.c (do_numeric): fix a crash when a numeric is
Index: ircu2.10/include/s_stats.h
diff -u ircu2.10/include/s_stats.h:1.12 ircu2.10/include/s_stats.h:1.12.2.1
--- ircu2.10/include/s_stats.h:1.12 Mon Oct 4 21:21:37 2004
+++ ircu2.10/include/s_stats.h Tue Oct 11 18:13:48 2005
@@ -21,7 +21,7 @@
*/
/** @file
* @brief Report configuration lines and other statistics from this server.
- * @version $Id: s_stats.h,v 1.12 2004/10/05 04:21:37 entrope Exp $
+ * @version $Id: s_stats.h,v 1.12.2.1 2005/10/12 01:13:48 entrope Exp $
*/
#ifndef INCLUDED_s_stats_h
@@ -55,8 +55,9 @@
#define STAT_FLAG_OPERONLY 0x01 /**< Oper-only stat */
#define STAT_FLAG_OPERFEAT 0x02 /**< Oper-only if the feature is true */
-#define STAT_FLAG_CASESENS 0x04 /**< Flag is case-sensitive */
-#define STAT_FLAG_VARPARAM 0x08 /**< May have an extra parameter */
+#define STAT_FLAG_LOCONLY 0x04 /**< Local user only */
+#define STAT_FLAG_CASESENS 0x08 /**< Flag is case-sensitive */
+#define STAT_FLAG_VARPARAM 0x10 /**< May have an extra parameter */
extern void stats_init(void);
const struct StatDesc *stats_find(const char *name_or_char);
Index: ircu2.10/ircd/m_stats.c
diff -u ircu2.10/ircd/m_stats.c:1.31 ircu2.10/ircd/m_stats.c:1.31.2.1
--- ircu2.10/ircd/m_stats.c:1.31 Fri Dec 10 21:14:03 2004
+++ ircu2.10/ircd/m_stats.c Tue Oct 11 18:13:48 2005
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_stats.c,v 1.31 2004/12/11 05:14:03 klmitch Exp $
+ * $Id: m_stats.c,v 1.31.2.1 2005/10/12 01:13:48 entrope Exp $
*/
/*
@@ -137,6 +137,10 @@
((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control))))
return send_reply(cptr, ERR_NOPRIVILEGES);
+ /* Check if they are a local user */
+ if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(cptr))
+ return send_reply(cptr, ERR_NOPRIVILEGES);
+
/* Check for extra parameter */
if ((sd->sd_flags & STAT_FLAG_VARPARAM) && parc > 3 && !EmptyString(parv[3]))
param = parv[3];
Index: ircu2.10/ircd/s_stats.c
diff -u ircu2.10/ircd/s_stats.c:1.44 ircu2.10/ircd/s_stats.c:1.44.2.1
--- ircu2.10/ircd/s_stats.c:1.44 Sat Jun 18 18:37:59 2005
+++ ircu2.10/ircd/s_stats.c Tue Oct 11 18:13:48 2005
@@ -62,7 +62,7 @@
/** @file
* @brief Report configuration lines and other statistics from this
* server.
- * @version $Id: s_stats.c,v 1.44 2005/06/19 01:37:59 a1kmm Exp $
+ * @version $Id: s_stats.c,v 1.44.2.1 2005/10/12 01:13:48 entrope Exp $
*
* Note: The info is reported in the order the server uses
* it--not reversed as in ircd.conf!
@@ -525,7 +525,7 @@
/** Contains information about all statistics. */
struct StatDesc statsinfo[] = {
- { 'a', "nameservers", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_a,
+ { 'a', "nameservers", STAT_FLAG_OPERFEAT|STAT_FLAG_LOCONLY, FEAT_HIS_STATS_a,
report_dns_servers, 0,
"DNS servers." },
{ 'c', "connect", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_c,
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches