Bladeren bron

* Port [3226] to 1.2.14
* Make bot chmod() itself when accessing its binary.



svn: 3227

Bryan Drewery 19 jaren geleden
bovenliggende
commit
0aca986fe4
5 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 1 0
      doc/UPDATES
  2. 2 0
      src/binary.c
  3. 2 2
      src/main.c
  4. 0 2
      src/shell.c
  5. 0 1
      src/shell.h

+ 1 - 0
doc/UPDATES

@@ -18,6 +18,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * All bots are now rehashed after editing binary - nick casing, ip changes are taken into effect.
 * Bots now use the shell username instead of botnick when ident does not work.
 * Localhubs now auto add *!~username@... hosts instead of *!~nick@... hosts for their leafs.
+* Make bot chmod() itself when accessing its binary.
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 2 - 0
src/binary.c

@@ -54,6 +54,8 @@ bin_checksum(const char *fname, int todo)
  
   hash[0] = 0;
 
+  fixmod(fname);
+
   if (todo == GET_CHECKSUM) {
     if (!(f = fopen(fname, "rb")))
       werr(ERR_BINSTAT);

+ 2 - 2
src/main.c

@@ -586,10 +586,10 @@ static void startup_checks(int hack) {
   if (!updating)
     parseconf(1);
 
+  fixmod(binname);
+
   if (!can_stat(binname))
    werr(ERR_BINSTAT);
-  else if (fixmod(binname))
-   werr(ERR_BINMOD);
 
 #ifndef CYGWIN_HACKS
   move_bin(conf.binpath, conf.binname, 1);

+ 0 - 2
src/shell.c

@@ -660,8 +660,6 @@ char *werr_tostr(int errnum)
     return "Cannot access binary";
   case ERR_BADPASS:
     return "Incorrect password";
-  case ERR_BINMOD:
-    return "Cannot chmod() binary";
   case ERR_PASSWD:
     return "Cannot access the global passwd file";
   case ERR_WRONGBINDIR:

+ 0 - 1
src/shell.h

@@ -6,7 +6,6 @@
 #endif /* HAVE_CONFIG_H */
 
 #define ERR_BINSTAT     1
-#define ERR_BINMOD      2
 #define ERR_PASSWD      3
 #define ERR_WRONGBINDIR 4
 #define ERR_DATADIR	5