View | Details | Raw Unified | Return to bug 26286
Collapse All | Expand All

(-)share/man/man3/stdarg.3 (-1 / +1 lines)
Lines 120-126 Link Here
120
.Fa type
120
.Fa type
121
is not compatible with the type of the actual next argument
121
is not compatible with the type of the actual next argument
122
(as promoted according to the default argument promotions),
122
(as promoted according to the default argument promotions),
123
random errors will occur.
123
random errors will occur, which might lead to a security risk.
124
.Pp
124
.Pp
125
The first use of the
125
The first use of the
126
.Fn va_arg
126
.Fn va_arg
(-)lib/libc/gen/err.3 (-3 / +10 lines)
Lines 97-105 Link Here
97
and a space are output.
97
and a space are output.
98
If the
98
If the
99
.Fa fmt
99
.Fa fmt
100
argument is not NULL, the
100
argument is not NULL, then further output is controlled by treating
101
.Xr printf 3
101
it as a format string that specifies how subsequent arguments (or
102
-like formatted error message is output.
102
arguments accessed via the variable-length argument facilities of
103
.Xr stdarg 3 )
104
are converted for output, in the same way as 
105
.Xr printf 3 .
106
If the format string specifies an argument that does not exist, or
107
a type different from that actually given, random errors, that
108
could cause a security risk, may occur.
109
.Pp
103
The output is terminated by a newline character.
110
The output is terminated by a newline character.
104
.Pp
111
.Pp
105
The
112
The
(-)lib/libc/gen/setproctitle.3 (-6 / +10 lines)
Lines 39-51 Link Here
39
.Xr ps 1
39
.Xr ps 1
40
command.
40
command.
41
.Pp
41
.Pp
42
The title is set from the executable's name, followed by the
42
If 
43
result of a
43
.Va fmt 
44
.Xr printf 3
44
is not NULL, then the title is set from the executable's name,
45
style expansion of the arguments as specified by the
45
followed by the result of treating
46
.Va fmt
46
.Va fmt
47
argument.
47
as a format string that specifies how subsequent arguments are
48
If the
48
converted, in the same was as
49
.Xr printf 3 .
50
If the format string specifies arguments that do not exist, or it
51
specifies a type different from that actually given, random errors,
52
that could cause a security risk, may occur.  If the
49
.Va fmt
53
.Va fmt
50
argument begins with a
54
argument begins with a
51
.Dq -
55
.Dq -
(-)lib/libc/gen/syslog.3 (-17 / +18 lines)
Lines 48-56 Link Here
48
.Fd #include <syslog.h>
48
.Fd #include <syslog.h>
49
.Fd #include <varargs.h>
49
.Fd #include <varargs.h>
50
.Ft void
50
.Ft void
51
.Fn syslog "int priority" "const char *message" "..."
51
.Fn syslog "int priority" "const char *fmt" "..."
52
.Ft void
52
.Ft void
53
.Fn vsyslog "int priority" "const char *message" "va_list args"
53
.Fn vsyslog "int priority" "const char *fmt" "va_list args"
54
.Ft void
54
.Ft void
55
.Fn openlog "const char *ident" "int logopt" "int facility"
55
.Fn openlog "const char *ident" "int logopt" "int facility"
56
.Ft void
56
.Ft void
Lines 60-92 Link Here
60
.Sh DESCRIPTION
60
.Sh DESCRIPTION
61
The
61
The
62
.Fn syslog
62
.Fn syslog
63
function
63
function writes a message to the system message logger.
64
writes
65
.Fa message
66
to the system message logger.
67
The message is then written to the system console, log files,
64
The message is then written to the system console, log files,
68
logged-in users, or forwarded to other machines as appropriate.
65
logged-in users, or forwarded to other machines as appropriate.
69
(See
66
(See
70
.Xr syslogd 8 . )
67
.Xr syslogd 8 . )
71
.Pp
68
.Pp
72
The message is identical to a
69
The message is created by treating
73
.Xr printf 3
70
.Va fmt
74
format string, except that
71
as a format string that specifies how subsequent arguments are
72
converted, in the same was as
73
.Xr printf 3 ,
74
with an additional convertion specifier of
75
.Ql %m
75
.Ql %m
76
is replaced by the current error
76
which is replaced by the current error message.  (As denoted by
77
message.
77
the global variable
78
(As denoted by the global variable
79
.Va errno ;
78
.Va errno ;
80
see
79
see
81
.Xr strerror 3 . )
80
.Xr strerror 3 . )
82
A trailing newline is added if none is present.
81
If the format string specifies arguments that do not exist, or it
82
specifies a type different from that actually given, random errors,
83
that could cause a security risk, may occur.  A trailing newline
84
is added if none is present.
83
.Pp
85
.Pp
84
The
86
The
85
.Fn vsyslog
87
.Fn vsyslog
86
function
88
function is an alternate form in which the arguments have already
87
is an alternate form in which the arguments have already been captured
89
been captured using the variable-length argument facilities of
88
using the variable-length argument facilities of
90
.Xr stdarg 3 .
89
.Xr varargs 3 .
90
.Pp
91
.Pp
91
The message is tagged with
92
The message is tagged with
92
.Fa priority .
93
.Fa priority .
(-)lib/libc/stdio/printf.3 (-1 / +5 lines)
Lines 170-176 Link Here
170
the character
170
the character
171
.Cm % .
171
.Cm % .
172
The arguments must correspond properly (after type promotion)
172
The arguments must correspond properly (after type promotion)
173
with the conversion specifier.
173
with the conversion specifier.  If they do not random errors,
174
which could cause a security risk, may occur.  In particular,
175
user-supplied data should never be included in the format string
176
without checking that it is safe (eg, does not contain %s
177
and other character sequences with special meaning).
174
After the
178
After the
175
.Cm % ,
179
.Cm % ,
176
the following appear in sequence:
180
the following appear in sequence:

Return to bug 26286