tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

printf and -m



Beckground:

gcc assumes that %m is a valid printf(3) format. In BSD %m is only valid
in syslog(3) like functions and means strerror(errno). GLIBC and MUSLC
implement %m also for printf(3).

Description: 

This patch does the following:

gcc:
- Introduces a format attribute called "syslog" that accepts %m.
- Makes the printf attribute not accept %m.

src:
- Introduces a __sysloglike() macro that uses the new format attribute
  if available, and fails back to the standard printf attribute.
- Changes log-like functions to use the new attribute.

We should decide what we want to do:

- Make %m work in printf() like linux does.
- Apply the following patch to prevent programs use %m in printf formats,
  keep fixing 3rd party code, and maintain the custom format attribute to
  find new offenders. It is unlikely that the gnu folks will take a patch
  that makes %m warn for printf. We could coordinate with other BSD's to
  do the same. Note that this patch can break pkgsrc code...

What do you think?

christos

Index: external/bsd/am-utils/dist/include/am_utils.h
===================================================================
RCS file: /cvsroot/src/external/bsd/am-utils/dist/include/am_utils.h,v
retrieving revision 1.1.1.3
diff -u -u -r1.1.1.3 am_utils.h
--- external/bsd/am-utils/dist/include/am_utils.h	17 Jan 2015 16:34:18 -0000	1.1.1.3
+++ external/bsd/am-utils/dist/include/am_utils.h	21 Aug 2015 16:16:07 -0000
@@ -324,7 +324,7 @@
 extern void going_down(int);
 extern void mnt_free(mntent_t *);
 extern void plog(int, const char *,...)
-     __attribute__ ((__format__ (__printf__, 2, 3)));
+     __attribute__ ((__format__ (__syslog__, 2, 3)));
 extern void rmdirs(char *);
 extern void rpc_msg_init(struct rpc_msg *, u_long, u_long, u_long);
 extern void set_amd_program_number(u_long program);
@@ -489,7 +489,7 @@
 extern void print_nfs_args(const void *, u_long nfs_version);
 extern int debug_option (char *opt);
 extern void dplog(const char *fmt, ...)
-     __attribute__ ((__format__ (__printf__, 1, 2)));
+     __attribute__ ((__format__ (__syslog__, 1, 2)));
 
 #else /* not DEBUG */
 
Index: external/bsd/blacklist/bin/internal.h
===================================================================
RCS file: /cvsroot/src/external/bsd/blacklist/bin/internal.h,v
retrieving revision 1.12
diff -u -u -r1.12 internal.h
--- external/bsd/blacklist/bin/internal.h	27 Jan 2015 19:40:37 -0000	1.12
+++ external/bsd/blacklist/bin/internal.h	21 Aug 2015 16:16:09 -0000
@@ -48,6 +48,6 @@
 extern struct ifaddrs *ifas;
 
 void (*lfun)(int, const char *, ...)
-    __attribute__((__format__(__printf__, 2, 3)));
+    __attribute__((__format__(__syslog__, 2, 3)));
 
 #endif /* _INTERNAL_H */
Index: external/bsd/dhcp/dist/includes/dhcpd.h
===================================================================
RCS file: /cvsroot/src/external/bsd/dhcp/dist/includes/dhcpd.h,v
retrieving revision 1.6
diff -u -u -r1.6 dhcpd.h
--- external/bsd/dhcp/dist/includes/dhcpd.h	12 Jul 2014 12:09:37 -0000	1.6
+++ external/bsd/dhcp/dist/includes/dhcpd.h	21 Aug 2015 16:16:09 -0000
@@ -2092,8 +2092,7 @@
 			const char **, struct expression *, int, int);
 int parse_allow_deny (struct option_cache **, struct parse *, int);
 int parse_auth_key (struct data_string *, struct parse *);
-int parse_warn (struct parse *, const char *, ...)
-	__attribute__((__format__(__printf__,2,3)));
+int parse_warn (struct parse *, const char *, ...) __sysloglike(2, 3);
 struct expression *parse_domain_list(struct parse *cfile, int);
 
 
Index: external/bsd/dhcp/dist/includes/omapip/omapip_p.h
===================================================================
RCS file: /cvsroot/src/external/bsd/dhcp/dist/includes/omapip/omapip_p.h,v
retrieving revision 1.1.1.4
diff -u -u -r1.1.1.4 omapip_p.h
--- external/bsd/dhcp/dist/includes/omapip/omapip_p.h	12 Jul 2014 11:57:57 -0000	1.1.1.4
+++ external/bsd/dhcp/dist/includes/omapip/omapip_p.h	21 Aug 2015 16:16:09 -0000
@@ -283,14 +283,10 @@
 extern int log_perror;
 extern void (*log_cleanup) (void);
 
-void log_fatal (const char *, ...)
-	__attribute__((__format__(__printf__,1,2))) ISC_DHCP_NORETURN;
-int log_error (const char *, ...)
-	__attribute__((__format__(__printf__,1,2)));
-int log_info (const char *, ...)
-	__attribute__((__format__(__printf__,1,2)));
-int log_debug (const char *, ...)
-	__attribute__((__format__(__printf__,1,2)));
+void log_fatal (const char *, ...) __sysloglike(1, 2) ISC_DHCP_NORETURN;
+int log_error (const char *, ...) __sysloglike(1, 2);
+int log_info (const char *, ...) __sysloglike(1, 2);
+int log_debug (const char *, ...) __sysloglike(1, 2);
 void do_percentm (char *obuf, const char *ibuf);
 
 isc_result_t uerr2isc (int);
Index: external/bsd/dhcpcd/dist/common.h
===================================================================
RCS file: /cvsroot/src/external/bsd/dhcpcd/dist/common.h,v
retrieving revision 1.10
diff -u -u -r1.10 common.h
--- external/bsd/dhcpcd/dist/common.h	9 Jul 2015 10:15:34 -0000	1.10
+++ external/bsd/dhcpcd/dist/common.h	21 Aug 2015 16:16:09 -0000
@@ -121,8 +121,8 @@
 # ifndef __packed
 #  define __packed   __attribute__((__packed__))
 # endif
-# ifndef __printflike
-#  define __printflike(a, b) __attribute__((format(printf, a, b)))
+# ifndef __sysloglike
+#  define __sysloglike(a, b) __attribute__((__format__(__printf__, a, b)))
 # endif
 # ifndef __unused
 #  define __unused   __attribute__((__unused__))
@@ -134,8 +134,8 @@
 # ifndef __packed
 #  define __packed
 # endif
-# ifndef __printflike
-#  define __printflike
+# ifndef __sysloglike
+#  define __sysloglike
 # endif
 # ifndef __unused
 #  define __unused
@@ -174,7 +174,7 @@
 #if USE_LOGFILE
 void logger_open(struct dhcpcd_ctx *);
 #define logger_mask(ctx, lvl) setlogmask((lvl))
-__printflike(3, 4) void logger(struct dhcpcd_ctx *, int, const char *, ...);
+__sysloglike(3, 4) void logger(struct dhcpcd_ctx *, int, const char *, ...);
 void logger_close(struct dhcpcd_ctx *);
 #else
 #define logger_open(ctx) openlog(PACKAGE, LOG_PERROR | LOG_PID, LOG_DAEMON)
Index: external/bsd/ntp/dist/include/ntp_stdlib.h
===================================================================
RCS file: /cvsroot/src/external/bsd/ntp/dist/include/ntp_stdlib.h,v
retrieving revision 1.9
diff -u -u -r1.9 ntp_stdlib.h
--- external/bsd/ntp/dist/include/ntp_stdlib.h	10 Jul 2015 14:20:29 -0000	1.9
+++ external/bsd/ntp/dist/include/ntp_stdlib.h	21 Aug 2015 16:16:29 -0000
@@ -21,18 +21,20 @@
 
 #ifdef __GNUC__
 #define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
+#define NTP_SYSLOG(fmt, args) __attribute__((__format__(__syslog__, fmt, args)))
 #else
 #define NTP_PRINTF(fmt, args)
+#define NTP_SYSLOG(fmt, args)
 #endif
 
-extern	int	mprintf(const char *, ...) NTP_PRINTF(1, 2);
-extern	int	mfprintf(FILE *, const char *, ...) NTP_PRINTF(2, 3);
-extern	int	mvfprintf(FILE *, const char *, va_list) NTP_PRINTF(2, 0);
+extern	int	mprintf(const char *, ...) NTP_SYSLOG(1, 2);
+extern	int	mfprintf(FILE *, const char *, ...) NTP_SYSLOG(2, 3);
+extern	int	mvfprintf(FILE *, const char *, va_list) NTP_SYSLOG(2, 0);
 extern	int	mvsnprintf(char *, size_t, const char *, va_list)
-			NTP_PRINTF(3, 0);
+			NTP_SYSLOG(3, 0);
 extern	int	msnprintf(char *, size_t, const char *, ...)
-			NTP_PRINTF(3, 4);
-extern	void	msyslog(int, const char *, ...) NTP_PRINTF(2, 3);
+			NTP_SYSLOG(3, 4);
+extern	void	msyslog(int, const char *, ...) NTP_SYSLOG(2, 3);
 extern	void	init_logging	(const char *, u_int32, int);
 extern	int	change_logfile	(const char *, int);
 extern	void	setup_logfile	(const char *);
Index: external/bsd/ntp/dist/ntpd/refclock_jupiter.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c,v
retrieving revision 1.8
diff -u -u -r1.8 refclock_jupiter.c
--- external/bsd/ntp/dist/ntpd/refclock_jupiter.c	10 Jul 2015 14:20:33 -0000	1.8
+++ external/bsd/ntp/dist/ntpd/refclock_jupiter.c	21 Aug 2015 16:16:30 -0000
@@ -136,8 +136,7 @@
 static	u_short	jupiter_cksum	(u_short *, u_int);
 static	int	jupiter_config	(struct instance *);
 static	void	jupiter_debug	(struct peer *, const char *,
-				 const char *, ...)
-			__attribute__ ((format (printf, 3, 4)));
+				 const char *, ...) NTP_SYSLOG(3, 4);
 static	const char *	jupiter_parse_t	(struct instance *, u_short *);
 static	const char *	jupiter_parse_gpos	(struct instance *, u_short *);
 static	void	jupiter_platform	(struct instance *, u_int);
Index: external/bsd/ntp/dist/ntpd/refclock_oncore.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ntp/dist/ntpd/refclock_oncore.c,v
retrieving revision 1.11
diff -u -u -r1.11 refclock_oncore.c
--- external/bsd/ntp/dist/ntpd/refclock_oncore.c	10 Jul 2015 14:20:33 -0000	1.11
+++ external/bsd/ntp/dist/ntpd/refclock_oncore.c	21 Aug 2015 16:16:30 -0000
@@ -380,7 +380,7 @@
 static	void	oncore_load_almanac   (struct instance *);
 static	void	oncore_log	      (struct instance *, int, const char *);
 static	int	oncore_log_f	      (struct instance *, int, const char *, ...)
-		NTP_PRINTF(3, 4);
+		NTP_SYSLOG(3, 4);
 static	void	oncore_print_Cb       (struct instance *, u_char *);
 /* static  void    oncore_print_array	 (u_char *, int);	*/
 static	void	oncore_print_posn     (struct instance *);
Index: external/bsd/openpam/dist/include/security/openpam.h
===================================================================
RCS file: /cvsroot/src/external/bsd/openpam/dist/include/security/openpam.h,v
retrieving revision 1.7
diff -u -u -r1.7 openpam.h
--- external/bsd/openpam/dist/include/security/openpam.h	24 Oct 2014 18:17:56 -0000	1.7
+++ external/bsd/openpam/dist/include/security/openpam.h	21 Aug 2015 16:16:30 -0000
@@ -92,7 +92,7 @@
 pam_error(const pam_handle_t *_pamh,
 	const char *_fmt,
 	...)
-	OPENPAM_FORMAT ((__printf__, 2, 3))
+	OPENPAM_FORMAT ((__syslog__, 2, 3))
 	OPENPAM_NONNULL((1,2));
 
 int
@@ -106,7 +106,7 @@
 pam_info(const pam_handle_t *_pamh,
 	const char *_fmt,
 	...)
-	OPENPAM_FORMAT ((__printf__, 2, 3))
+	OPENPAM_FORMAT ((__syslog__, 2, 3))
 	OPENPAM_NONNULL((1,2));
 
 int
@@ -129,14 +129,14 @@
 pam_vinfo(const pam_handle_t *_pamh,
 	const char *_fmt,
 	va_list _ap)
-	OPENPAM_FORMAT ((__printf__, 2, 0))
+	OPENPAM_FORMAT ((__syslog__, 2, 0))
 	OPENPAM_NONNULL((1,2));
 
 int
 pam_verror(const pam_handle_t *_pamh,
 	const char *_fmt,
 	va_list _ap)
-	OPENPAM_FORMAT ((__printf__, 2, 0))
+	OPENPAM_FORMAT ((__syslog__, 2, 0))
 	OPENPAM_NONNULL((1,2));
 
 int
@@ -216,7 +216,7 @@
 	const char *_func,
 	const char *_fmt,
 	...)
-	OPENPAM_FORMAT ((__printf__, 3, 4))
+	OPENPAM_FORMAT ((__syslog__, 3, 4))
 	OPENPAM_NONNULL((3));
 
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
@@ -236,7 +236,7 @@
 openpam_log(int _level,
 	const char *_format,
 	...)
-	OPENPAM_FORMAT ((__printf__, 2, 3))
+	OPENPAM_FORMAT ((__syslog__, 2, 3))
 	OPENPAM_NONNULL((2));
 #endif
 
Index: external/gpl3/gcc/dist/gcc/c-family/c-format.c
===================================================================
RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/c-family/c-format.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 c-format.c
--- external/gpl3/gcc/dist/gcc/c-family/c-format.c	1 Mar 2014 08:43:01 -0000	1.1.1.1
+++ external/gpl3/gcc/dist/gcc/c-family/c-format.c	21 Aug 2015 16:16:33 -0000
@@ -860,14 +860,20 @@
   },
   { "gnu_strftime", NULL,                 time_char_table,  "_-0^#", "EO",
     strftime_flag_specs, strftime_flag_pairs,
-    FMT_FLAG_FANCY_PERCENT_OK, 'w', 0, 0, 0, 0, 0,
+    FMT_FLAG_FANCY_PERCENT_OK|FMT_FLAG_M_OK, 'w', 0, 0, 0, 0, 0,
     NULL, NULL
   },
   { "gnu_strfmon",  strfmon_length_specs, monetary_char_table, "=^+(!-", NULL,
     strfmon_flag_specs, strfmon_flag_pairs,
     FMT_FLAG_ARG_CONVERT, 'w', '#', 'p', 0, 'L', 0,
     NULL, NULL
-  }
+  },
+  { "gnu_syslog",   printf_length_specs,  print_char_table, " +#0-'I", NULL,
+    printf_flag_specs, printf_flag_pairs,
+    FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK|FMT_FLAG_M_OK,
+    'w', 0, 'p', 0, 'L', 0,
+    &integer_type_node, &integer_type_node
+  },
 };
 
 /* This layer of indirection allows GCC to reassign format_types with
@@ -1983,6 +1989,13 @@
 	  warning (OPT_Wformat_, "conversion lacks type at end of format");
 	  continue;
 	}
+
+      if (format_char == 'm' && !(fki->flags & FMT_FLAG_M_OK))
+        {
+	  warning (OPT_Wformat_, "%%m is only allowed in syslog(3)");
+	  continue;
+	}
+	
       format_chars++;
       fci = fki->conversion_specs;
       while (fci->format_chars != 0
@@ -2854,6 +2867,7 @@
 static const target_ovr_attr gnu_target_overrides_format_attributes[] =
 {
   { "gnu_printf",   "printf" },
+  { "gnu_syslog",   "syslog" },
   { "gnu_scanf",    "scanf" },
   { "gnu_strftime", "strftime" },
   { "gnu_strfmon",  "strfmon" },
Index: external/gpl3/gcc/dist/gcc/c-family/c-format.h
===================================================================
RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/c-family/c-format.h,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 c-format.h
--- external/gpl3/gcc/dist/gcc/c-family/c-format.h	1 Mar 2014 08:43:01 -0000	1.1.1.1
+++ external/gpl3/gcc/dist/gcc/c-family/c-format.h	21 Aug 2015 16:16:33 -0000
@@ -75,11 +75,13 @@
   FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128,
   /* The format arg is an opaque object that will be parsed by an external
      facility.  */
-  FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL = 256
+  FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL = 256,
   /* Not included here: details of whether width or precision may occur
      (controlled by width_char and precision_char); details of whether
      '*' can be used for these (width_type and precision_type); details
      of whether length modifiers can occur (length_char_specs).  */
+  FMT_FLAG_M_OK = 512
+  /* %m is only allowed in syslog */
 };
 
 /* Structure describing a length modifier supported in format checking, and
Index: lib/libwrap/diag.c
===================================================================
RCS file: /cvsroot/src/lib/libwrap/diag.c,v
retrieving revision 1.10
diff -u -u -r1.10 diag.c
--- lib/libwrap/diag.c	22 Mar 2012 22:58:15 -0000	1.10
+++ lib/libwrap/diag.c	21 Aug 2015 16:16:43 -0000
@@ -38,7 +38,7 @@
 jmp_buf tcpd_buf;
 
 static void tcpd_diag(int, const char *, const char *, va_list)
-    __printflike(3,0);
+    __sysloglike(3,0);
 
 /* tcpd_diag - centralize error reporter */
 
Index: lib/libwrap/tcpd.h
===================================================================
RCS file: /cvsroot/src/lib/libwrap/tcpd.h,v
retrieving revision 1.14
diff -u -u -r1.14 tcpd.h
--- lib/libwrap/tcpd.h	22 Mar 2012 22:59:43 -0000	1.14
+++ lib/libwrap/tcpd.h	21 Aug 2015 16:16:43 -0000
@@ -168,10 +168,10 @@
   */
 
 /* Report problem and proceed */
-void tcpd_warn(const char *, ...) __printflike(1, 2);
+void tcpd_warn(const char *, ...) __sysloglike(1, 2);
 
 /* Report problem and jump */
-void tcpd_jump(const char *, ...) __dead __printflike(1, 2);
+void tcpd_jump(const char *, ...) __dead __sysloglike(1, 2);
 __END_DECLS
 
 struct tcpd_context {
Index: libexec/identd/identd.h
===================================================================
RCS file: /cvsroot/src/libexec/identd/identd.h,v
retrieving revision 1.9
diff -u -u -r1.9 identd.h
--- libexec/identd/identd.h	15 Mar 2012 02:02:21 -0000	1.9
+++ libexec/identd/identd.h	21 Aug 2015 16:16:44 -0000
@@ -14,7 +14,7 @@
 #define satosin6(sa)	((struct sockaddr_in6 *)(sa))
 #define in_hosteq(s,t)	((s).s_addr == (t).s_addr)
 
-void maybe_syslog(int, const char *, ...) __printflike(2, 3);
+void maybe_syslog(int, const char *, ...) __sysloglike(2, 3);
 
 #ifdef WITH_PF
 int pf_natlookup(struct sockaddr_storage *, struct sockaddr *, int *);
Index: sbin/init/init.c
===================================================================
RCS file: /cvsroot/src/sbin/init/init.c,v
retrieving revision 1.106
diff -u -u -r1.106 init.c
--- sbin/init/init.c	16 Jun 2015 23:18:55 -0000	1.106
+++ sbin/init/init.c	21 Aug 2015 16:16:44 -0000
@@ -110,9 +110,9 @@
 static void handle(sig_t, ...);
 static void delset(sigset_t *, ...);
 
-static void stall(const char *, ...) __printflike(1, 2);
-static void warning(const char *, ...) __printflike(1, 2);
-static void emergency(const char *, ...) __printflike(1, 2);
+static void stall(const char *, ...) __sysloglike(1, 2);
+static void warning(const char *, ...) __sysloglike(1, 2);
+static void emergency(const char *, ...) __sysloglike(1, 2);
 __dead static void disaster(int);
 static void badsys(int);
 
Index: sys/sys/cdefs.h
===================================================================
RCS file: /cvsroot/src/sys/sys/cdefs.h,v
retrieving revision 1.124
diff -u -u -r1.124 cdefs.h
--- sys/sys/cdefs.h	25 Jan 2015 20:45:18 -0000	1.124
+++ sys/sys/cdefs.h	21 Aug 2015 16:16:51 -0000
@@ -474,12 +474,18 @@
 #if __GNUC_PREREQ__(2, 7)
 #define __printflike(fmtarg, firstvararg)	\
 	    __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
+#ifndef __NetBSD__
+#define __syslog__ __printf__
+#endif
+#define __sysloglike(fmtarg, firstvararg)	\
+	    __attribute__((__format__ (__syslog__, fmtarg, firstvararg)))
 #define __scanflike(fmtarg, firstvararg)	\
 	    __attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
 #define __format_arg(fmtarg)    __attribute__((__format_arg__ (fmtarg)))
 #else
 #define __printflike(fmtarg, firstvararg)	/* nothing */
 #define __scanflike(fmtarg, firstvararg)	/* nothing */
+#define __sysloglike(fmtarg, firstvararg)	/* nothing */
 #define __format_arg(fmtarg)			/* nothing */
 #endif
 
Index: sys/sys/syslog.h
===================================================================
RCS file: /cvsroot/src/sys/sys/syslog.h,v
retrieving revision 1.36
diff -u -u -r1.36 syslog.h
--- sys/sys/syslog.h	20 Jul 2014 20:55:17 -0000	1.36
+++ sys/sys/syslog.h	21 Aug 2015 16:16:51 -0000
@@ -201,36 +201,36 @@
 void	closelog(void);
 void	openlog(const char *, int, int);
 int	setlogmask(int);
-void	syslog(int, const char *, ...) __printflike(2, 3);
+void	syslog(int, const char *, ...) __sysloglike(2, 3);
 #if defined(_NETBSD_SOURCE)
-void	vsyslog(int, const char *, __va_list) __printflike(2, 0);
+void	vsyslog(int, const char *, __va_list) __sysloglike(2, 0);
 #ifndef __LIBC12_SOURCE__
 void	closelog_r(struct syslog_data *) __RENAME(__closelog_r60);
 void	openlog_r(const char *, int, int, struct syslog_data *)
     __RENAME(__openlog_r60);
 int	setlogmask_r(int, struct syslog_data *) __RENAME(__setlogmask_r60);
 void	syslog_r(int, struct syslog_data *, const char *, ...)
-    __RENAME(__syslog_r60) __printflike(3, 4);
+    __RENAME(__syslog_r60) __sysloglike(3, 4);
 void	vsyslog_r(int, struct syslog_data *, const char *, __va_list)
-    __RENAME(__vsyslog_r60) __printflike(3, 0);
+    __RENAME(__vsyslog_r60) __sysloglike(3, 0);
 void	syslogp_r(int, struct syslog_data *, const char *, const char *,
-    const char *, ...) __RENAME(__syslogp_r60) __printflike(5, 6);
+    const char *, ...) __RENAME(__syslogp_r60) __sysloglike(5, 6);
 void	vsyslogp_r(int, struct syslog_data *, const char *, const char *,
-    const char *, __va_list) __RENAME(__vsyslogp_r60) __printflike(5, 0);
+    const char *, __va_list) __RENAME(__vsyslogp_r60) __sysloglike(5, 0);
 #endif
 void	syslogp(int, const char *, const char *, const char *, ...)
-    __printflike(4, 5);
+    __sysloglike(4, 5);
 void	vsyslogp(int, const char *, const char *, const char *, __va_list)
-    __printflike(4, 0);
+    __sysloglike(4, 0);
 #endif
 __END_DECLS
 
 #else /* !_KERNEL */
 
 void	logpri(int);
-void	log(int, const char *, ...) __printflike(2, 3);
-void	vlog(int, const char *, __va_list) __printflike(2, 0);
-void	addlog(const char *, ...) __printflike(1, 2);
+void	log(int, const char *, ...) __sysloglike(2, 3);
+void	vlog(int, const char *, __va_list) __sysloglike(2, 0);
+void	addlog(const char *, ...) __sysloglike(1, 2);
 void	logwakeup(void);
 
 #endif /* !_KERNEL */
Index: usr.sbin/lpr/lpd/recvjob.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/lpr/lpd/recvjob.c,v
retrieving revision 1.23
diff -u -u -r1.23 recvjob.c
--- usr.sbin/lpr/lpd/recvjob.c	30 Aug 2011 19:27:37 -0000	1.23
+++ usr.sbin/lpr/lpd/recvjob.c	21 Aug 2015 16:16:52 -0000
@@ -74,7 +74,7 @@
 static char	 tfname[NAME_MAX];	/* tmp copy of cf before linking */
 
 static int        chksize(int);
-static void       frecverr(const char *, ...) __dead __printflike(1, 2);
+static void       frecverr(const char *, ...) __dead __sysloglike(1, 2);
 static int        noresponse(void);
 static void       rcleanup(int);
 static int        read_number(const char *);
Index: usr.sbin/tcpdchk/inetcf.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/tcpdchk/inetcf.c,v
retrieving revision 1.9
diff -u -u -r1.9 inetcf.c
--- usr.sbin/tcpdchk/inetcf.c	31 Aug 2011 16:25:00 -0000	1.9
+++ usr.sbin/tcpdchk/inetcf.c	21 Aug 2015 16:16:52 -0000
@@ -102,7 +102,7 @@
      */
     if (conf != 0) {
 	if ((fp = fopen(conf, "r")) == 0) {
-	    fprintf(stderr, percent_m(buf, "open %s: %m\n"), conf);
+	    fprintf(stderr, percent_m(buf, "open %s\n"), conf);
 	    exit(1);
 	}
     } else {


Home | Main Index | Thread Index | Old Index