فهرست منبع

* Fix oidentd spoofing regression

Only write to .oidentd.conf if there is something to write out.
This was introduced by the gcc warnings fixes.
Bryan Drewery 16 سال پیش
والد
کامیت
329c2a276a
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      src/dccutil.c

+ 3 - 2
src/dccutil.c

@@ -1027,8 +1027,9 @@ identd_open(const char *sourceIp, const char *destIp)
       if (ftruncate(fileno(f), 0))
         goto failure;
 
-      if (!fwrite(outbuf, 1, strlen(outbuf), f))
-        goto failure;
+      if (strlen(outbuf))
+        if (!fwrite(outbuf, 1, strlen(outbuf), f))
+          goto failure;
 
       //And make a record in the oidentd.conf to spoof the ident request from this port->dest-prot
       fprintf(f, "to %s from %s { reply \"%s\" }\n", destIp, sourceIp, origbotname);