Hi,

It was stated last week that OpenSMTPD daemon doesn't throw any warning if a specific table isn't readable by OpenSMTPD user.

I made a patch for the portable version on github :

*** a/table_static.c    2016-01-11 10:16:15.486422024 +0100
--- b/table_static.c    2016-01-08 12:58:58.564321019 +0100
***************
*** 95,101 ****

      fp = fopen(config, "r");
      if (fp == NULL)
!         return 0;

      while ((flen = getline(&buf, &sz, fp)) != -1) {
          if (buf[flen - 1] == '\n')
--- 95,101 ----

      fp = fopen(config, "r");
      if (fp == NULL)
!         goto err;

      while ((flen = getline(&buf, &sz, fp)) != -1) {
          if (buf[flen - 1] == '\n')
***************
*** 143,148 ****
--- 143,151 ----
      free(buf);
      fclose(fp);
      return ret;
+ err:
+         log_warn("warn: Table \"%s\"", config);
+         return 0;
  }

  static int

If someone could review it and test it before I fork the repository and make a merge request on github.

Thank you.

Regards,
Alexis VACHETTE.

--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to