Browse Source

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

svn: 788
Bryan Drewery 22 years ago
parent
commit
6be487df5f
2 changed files with 3 additions and 2 deletions
  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.
 1.User flag +x is now correctly recognized in more places.
 2.Auth system was broken similar to the channel ctcp bug.
 2.Auth system was broken similar to the channel ctcp bug.
 3.Added config option 'cmdprefix' back.
 3.Added config option 'cmdprefix' back.
+4.Fixed a bug in the auto-email code for bad uname.
 
 
 1.1.3
 1.1.3
 1.Fixed a very fatal bug with channel ctcps.
 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 ((f = popen(open, "w"))) {
     if (sendmail) {
     if (sendmail) {
       fprintf(f, "To: %s\n", addrs);
       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, "Subject: %s\n", subject);
       fprintf(f, "Content-Type: text/plain\n");
       fprintf(f, "Content-Type: text/plain\n");
     }
     }
@@ -742,7 +742,7 @@ void baduname(char *confhas, char *my_uname) {
 
 
     uname(&un);
     uname(&un);
     egg_snprintf(subject, sizeof subject, "CONF/UNAME() mismatch notice");
     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);
     email(subject, msg, EMAIL_OWNERS);
   }
   }
   free(tmpfile);
   free(tmpfile);