Bladeren bron

* Fixed a baduname()/email() bug.

svn: 788
Bryan Drewery 22 jaren geleden
bovenliggende
commit
6be487df5f
2 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 1 0
      doc/UPDATES
  2. 2 2
      src/shell.c

+ 1 - 0
doc/UPDATES

@@ -4,6 +4,7 @@ This is a summary of ChangeLog basically.
 1.User flag +x is now correctly recognized in more places.
 2.Auth system was broken similar to the channel ctcp bug.
 3.Added config option 'cmdprefix' back.
+4.Fixed a bug in the auto-email code for bad uname.
 
 1.1.3
 1.Fixed a very fatal bug with channel ctcps.

+ 2 - 2
src/shell.c

@@ -698,7 +698,7 @@ int email(char *subject, char *msg, int who)
   if ((f = popen(open, "w"))) {
     if (sendmail) {
       fprintf(f, "To: %s\n", addrs);
-      fprintf(f, "From: %s@%s\n", conf.bot->nick ? conf.bot->nick : conf.username, un.nodename);
+      fprintf(f, "From: %s@%s\n", conffile.bots->nick ? conffile.bots->nick : (conffile.username ? conffile.username : "WRAITH"), un.nodename);
       fprintf(f, "Subject: %s\n", subject);
       fprintf(f, "Content-Type: text/plain\n");
     }
@@ -742,7 +742,7 @@ void baduname(char *confhas, char *my_uname) {
 
     uname(&un);
     egg_snprintf(subject, sizeof subject, "CONF/UNAME() mismatch notice");
-    egg_snprintf(msg, sizeof msg, "This is an auto email from a wraith bot which has you in it's OWNER_EMAIL list..\n \nThe uname() output on this box has changed, probably due to a kernel upgrade...\nMy login is: %s\nConf : %s\nUname(): %s\n \nThis email will only be sent once a day while this error is present.\nYou need to login to my shell (%s) and fix my local config.\n", conf.username, confhas, my_uname, un.nodename);
+    egg_snprintf(msg, sizeof msg, STR("This is an auto email from a wraith bot which has you in it's OWNER_EMAIL list..\n \nThe uname() output on this box has changed, probably due to a kernel upgrade...\nMy login is: %s\nConf : %s\nUname(): %s\n \nThis email will only be sent once a day while this error is present.\nYou need to login to my shell (%s) and fix my local config.\n"), conf.username, confhas, my_uname, un.nodename);
     email(subject, msg, EMAIL_OWNERS);
   }
   free(tmpfile);