Skip to content

Commit

Permalink
Fixes for 1.12
Browse files Browse the repository at this point in the history
Fix restrict

Fix typo

Fix comparison

Fix stats.help [Patch by: wilk wilkowy]
  • Loading branch information
Michael Ortmann authored and michaelortmann committed Jun 1, 2024
1 parent c0e2646 commit 2b7722d
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 37 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Unfortunately, you need to compile stats.mod within your eggdrop source,
so if you removed your original compile directory, you'll have to
compile the whole bot again... sorry.

Put stats.mod.1.11.tar.gz in ~/eggdrop-1.9.5/src/mod/,
and unpack it (tar xfz stats.mod-1.11.tar.gz). Change directory
Put stats.mod.1.12.tar.gz in ~/eggdrop-1.9.5/src/mod/,
and unpack it (tar xfz stats.mod-1.12.tar.gz). Change directory
back to ~/eggdrop-1.9.5/. Type 'make config'. Type 'make', wait until compiling
is done and use 'make install' to install the bot and stats.mod.

Expand Down
6 changes: 6 additions & 0 deletions UPDATES
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changes in Stats.mod: (since v1.0.1)
--------------------
1.12
- Fix restrict
- Fix typo
- Fix comparison
- Fix stats.help [Patch by: wilk wilkowy]

1.11
- Fix heap-use-after-free
- Enhance FIXME comment for heap-use-after-free
Expand Down
10 changes: 6 additions & 4 deletions core/mini_httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,9 @@ static char *encode_url(char *url)
*/
static char *decode_url(char *paramurl)
{
char *p, *buf, *url, c, hex[5];
char *p, *buf, *url, hex[5];
long int i;
size_t l;

// free url-buffer (global var)
if (httpd_text_buf)
Expand Down Expand Up @@ -967,10 +968,11 @@ static char *decode_url(char *paramurl)
i = '?';
debug0("MiniHTTPd: decode_url(): i is 0");
}
c = (char) i;
// now append the decoded char to the url
httpd_text_buf = nrealloc(httpd_text_buf, strlen(httpd_text_buf) + 1 + 1);
sprintf(httpd_text_buf, "%s%c", httpd_text_buf, c);
l = strlen(httpd_text_buf);
httpd_text_buf = nrealloc(httpd_text_buf, l + 1 + 1);
httpd_text_buf[l++] = (char) i;
httpd_text_buf[l] = 0;
// increase the pointer to abandon the encoded char
url += 2;
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/templates_stats_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ static void template_send_hosts(int idx, struct template_content *h_tpc)
continue;
host = strrchr(h->host, '.') + 1;
// skip other unusable hosts
if (!((host - 1) && host)) {
if (!host) {
debug1("[stats.mod] Skipping host-stats for '%s'.", h->host);
continue;
}
Expand Down
75 changes: 50 additions & 25 deletions help/stats.help
Original file line number Diff line number Diff line change
@@ -1,59 +1,84 @@
%{help=savestats}%{+m}
### %bsavestats%b
Saves all data.
Saves all data.

See also: purgestats
%{help=resetuser}%{+m|-}
### %bresetuser%b <user> <chan>
resets all statistics of <user> in <chan> to 0.
Resets all channel statistics of user to 0.

See also: purgestats, savestats
%{help=schannel}%{+o|+o}
### %bschannel%b [channel]
displays a list of users on the channel, listing their nicks and
corresponding stats-usernames.
Displays a list of users on the channel, listing their nicks and
corresponding stats-usernames.

See also: swhois
%{help=swhois}%{+o|+o}
### %bswhois%b <user>
displays information about <user> (stat-flags, hosts, etc...)
flags:
+/-list: list a user in the top10/20/etc?
+/-addhosts: automatically add new hosts to user?
Displays information about user (stat-flags, hosts, etc...).
Flags:
+/-list: list a user in the top10/20/etc?
+/-addhosts: automatically add new hosts to user?

See also: schattr, smatch
%{help=+shost}%{+m|-}
### %b+shost%b <user> <host>
adds a host to <user>
Adds a host to user.

See also: -shost
%{help=-shost}%{+m|-}
### %b-shost%b <user> <host>
removes a host from <user>
Removes a host from user.

See also: +shost
%{help=+suser}%{+m|-}
### %b+suser%b <user> [host]
creates a new stat-user record
Creates a new stat-user record.

See also: -suser, +shost, -shost
%{help=-suser}%{+m|-}
### %b-suser%b <user>
deletes a stat-user
Deletes a stat-user.

See also: +suser
%{help=schattr}%{+m|-}
### %bschattr%b <user> <flags>
changes the flags of a stat-user
Changes the flags of a stat-user.

See also: swhois
%{help=smatch}%{+m}
### %bsmatch%b [user] [host] [flags]
displays all matching users
wildcards allowed.
Displays all matching users. Wildcards allowed.

See also: swhois
%{help=chsusername}%{+m}
### %bchsusername%b <user> <newname>
changes the name of an user
Changes the name of an user.

See also: +suser, -suser, sumuser
%{help=writewebstats}%{+m|-}
### %bwritewebstats%b <channels>
writes the static (*cough*!) webfiles for the given channels.
Writes the static (*cough*!) webfiles for the given channels.
%{help=purgestats}%{+m|-}
### %bpurgestats%b
purges all outdates statistics and deletes old users
Purges all outdated statistics and deletes old users.

See also: savestats
%{help=sumuser}%{+n|-}
### %bsumuser%b <user1> <user2>
transfers all stats from user2 to user1 and deletes user2
Transfers all stats from user2 to user1 and deletes user2.

See also: chsusername
%{help=stats module}%{+m}
### help on the %bstats module%b
### %bstats module%b commands
Commands available: (use %b'.help <command>'%b for more info)
%{+o|o}
for ops:
For ops:
%bschannel%b
%bswhois%b
%{+m|m}
for masters:
For masters:
%bsavestats%b
%bresetuser%b
%b+shost%b
Expand All @@ -70,14 +95,14 @@
There is also a list of tcl settings available,
use %b'.help stats settings'%b
%{help=all}%{+m}
### commands for the %bstats module%b
### %bstats module%b commands
Commands available: (use %b'.help <command>'%b for more info)
%{+o|o}
for ops:
For ops:
%bschannel%b
%bswhois%b
%{+m|m}
for masters:
For masters:
%bsavestats%b
%bresetuser%b
%b+shost%b
Expand Down
2 changes: 1 addition & 1 deletion language/stats.en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ T minutes time wasted
500 Hello, you've just been added to my userbase! Your username is "<?user/?>".
500 From now on, I'll log various statistics about you, unless you stop me.
500 If you set a password with "/msg <?botnick/?> STATSPASS <password>", you can edit the settings of your account.
500 The password will be transferred and stored in plain-text, so please don't re-use a password for any important account.
500 The password will be transferred and stored in plain-text, so please don't reuse a password for any important account.
500 The URL of the stats-pages is http://<?server_host/?>:<?server_port/?>

1020 Sorry, I don't recognize you.
Expand Down
4 changes: 2 additions & 2 deletions stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define MAKING_STATS
#define MODULE_NAME "stats"
#define MODULE_VERSION "1.11"
#define MODULE_VERSION "1.12"
#ifndef NO_EGG
#include "../module.h"
#include "../irc.mod/irc.h"
Expand Down Expand Up @@ -446,7 +446,7 @@ char *stats_start(Function * global_funcs)

chanlangs = NULL;
slang_glob_init();
module_register(MODULE_NAME, stats_table, 1, 11);
module_register(MODULE_NAME, stats_table, 1, 12);
if (!(irc_funcs = module_depend(MODULE_NAME, "irc", 1, 0)))
return "You need the irc module to use the stats module.";
if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 0)))
Expand Down
4 changes: 2 additions & 2 deletions templates/stats/classic/classic.de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ D 12 etwas Zeit
# userpage head
710 Statistiken f�r <?user/?> in <?chan/?>
720 ICQ#
721 eMail
721 E-Mail
722 Homepage
723 Alter
730 Platz
Expand Down Expand Up @@ -162,7 +162,7 @@ F vocables 2 Auch <a href="../users/<?user/?>/"><?user/?>'s</a> Wortschatz ist n
1040 Neues Passwort
1045 Neues Passwort (Best�tigung)
1050 ICQ#
1060 eMail
1060 E-Mail
1070 Homepage
1080 List me in the top<?topnr/?>?
1081 Soll ich automatisch neue Hosts zu deinem Account hinzuf�gen?
Expand Down

0 comments on commit 2b7722d

Please sign in to comment.