19575647 Proftpd misses log entries and fails in open(2) of /dev/log s11-update
authorTomas Klacko <tomas.klacko@oracle.com>
Fri, 31 Oct 2014 08:32:47 -0700
branchs11-update
changeset 3445 22a312294722
parent 3444 10e7519ee062
child 3448 8b1b3566fb9e
19575647 Proftpd misses log entries and fails in open(2) of /dev/log
components/proftpd/patches/19575647.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/proftpd/patches/19575647.patch	Fri Oct 31 08:32:47 2014 -0700
@@ -0,0 +1,53 @@
+diff --git a/include/pr-syslog.h b/include/pr-syslog.h
+index 3eea2be..774a3b0 100644
+--- a/include/pr-syslog.h
++++ b/include/pr-syslog.h
[email protected]@ -68,7 +68,7 @@
+ #elif defined(__hpux)
+ # define PR_PATH_LOG	"/dev/log.un"
+ #else
+-# define PR_PATH_LOG	"/dev/log"
++# define PR_PATH_LOG	"/dev/conslog"
+ #endif
+ 
+ /* Close desriptor used to write to system logger. */
+diff --git a/lib/pr-syslog.c b/lib/pr-syslog.c
+index 3a62956..2b3d747 100644
+--- a/lib/pr-syslog.c
++++ b/lib/pr-syslog.c
[email protected]@ -265,7 +265,7 @@ static void pr_vsyslog(int sockfd, int pri, register const char *fmt,
+   send(sockfd, logbuf, buflen, 0);
+ #else
+ 
+-  /* Prepare the structs for use by putmsg(). As /dev/log is a STREAMS
++  /* Prepare the structs for use by putmsg(). As /dev/conslog is a STREAMS
+    * device on Solaris (and possibly other platforms?), putmsg() is
+    * used so that syslog facility and level are properly honored; write()
+    * does not seem to work as desired.
[email protected]@ -347,22 +347,11 @@ int pr_openlog(const char *ident, int opts, int facility) {
+   }
+ #else
+   sockfd = open(PR_PATH_LOG, O_WRONLY);
+-
+-# ifdef SOLARIS2
+-  /* Workaround for a /dev/log bug (SunSolve bug #4817079) on Solaris. */
+-  if (sockfd >= 0) {
+-    struct strioctl ic;
+-
+-    ic.ic_cmd = I_ERRLOG;
+-    ic.ic_timout = 0;
+-    ic.ic_len = 0;
+-    ic.ic_dp = NULL;
+-
+-    if (ioctl(sockfd, I_STR, &ic) < 0)
+-      fprintf(stderr, "error setting I_ERRLOG on " PR_PATH_LOG ": %s\n",
+-        strerror(errno));
++  if (sockfd < 0) {
++    fprintf(stderr, "failed to open %s: %d, %s\n",
++      PR_PATH_LOG, errno, strerror(errno));
++    exit(EXIT_FAILURE);
+   }
+-# endif /* SOLARIS2 */
+ #endif
+ 
+   return sockfd;