5 # MIT said they would take this patch however there has been talk of modifying |
5 # MIT said they would take this patch however there has been talk of modifying |
6 # fopen() for 32bit apps to extend the number of fds so this patch will not be |
6 # fopen() for 32bit apps to extend the number of fds so this patch will not be |
7 # submitted to MIT until this is resolved in ON. |
7 # submitted to MIT until this is resolved in ON. |
8 # Patch source: in-house |
8 # Patch source: in-house |
9 # |
9 # |
10 diff --git a/src/appl/gss-sample/gss-server.c b/src/appl/gss-sample/gss-server.c |
|
11 --- a/src/appl/gss-sample/gss-server.c |
10 --- a/src/appl/gss-sample/gss-server.c |
12 +++ b/src/appl/gss-sample/gss-server.c |
11 +++ b/src/appl/gss-sample/gss-server.c |
13 @@ -709,7 +709,7 @@ main(int argc, char **argv) |
12 @@ -709,7 +709,7 @@ main(int argc, char **argv) |
14 if (!strcmp(*argv, "/dev/null")) { |
13 if (!strcmp(*argv, "/dev/null")) { |
15 logfile = display_file = NULL; |
14 logfile = display_file = NULL; |
17 - logfile = fopen(*argv, "a"); |
16 - logfile = fopen(*argv, "a"); |
18 + logfile = fopen(*argv, "aF"); |
17 + logfile = fopen(*argv, "aF"); |
19 display_file = logfile; |
18 display_file = logfile; |
20 if (!logfile) { |
19 if (!logfile) { |
21 perror(*argv); |
20 perror(*argv); |
22 diff --git a/src/clients/ksu/authorization.c b/src/clients/ksu/authorization.c |
|
23 --- a/src/clients/ksu/authorization.c |
21 --- a/src/clients/ksu/authorization.c |
24 +++ b/src/clients/ksu/authorization.c |
22 +++ b/src/clients/ksu/authorization.c |
25 @@ -100,7 +100,7 @@ krb5_error_code krb5_authorization(context, principal, luser, |
23 @@ -100,7 +100,7 @@ krb5_error_code krb5_authorization(context, principal, luser, |
26 |
24 |
27 /* k5login and k5users must be owned by target user or root */ |
25 /* k5login and k5users must be owned by target user or root */ |
38 - if ((users_fp = fopen(k5users_path, "r")) == NULL) { |
36 - if ((users_fp = fopen(k5users_path, "r")) == NULL) { |
39 + if ((users_fp = fopen(k5users_path, "rF")) == NULL) { |
37 + if ((users_fp = fopen(k5users_path, "rF")) == NULL) { |
40 return 0; |
38 return 0; |
41 } |
39 } |
42 if ( fowner(users_fp, pwd->pw_uid) == FALSE){ |
40 if ( fowner(users_fp, pwd->pw_uid) == FALSE){ |
43 diff --git a/src/clients/ksu/ccache.c b/src/clients/ksu/ccache.c |
|
44 --- a/src/clients/ksu/ccache.c |
41 --- a/src/clients/ksu/ccache.c |
45 +++ b/src/clients/ksu/ccache.c |
42 +++ b/src/clients/ksu/ccache.c |
46 @@ -375,7 +375,7 @@ krb5_get_login_princ(luser, princ_list) |
43 @@ -375,7 +375,7 @@ krb5_get_login_princ(luser, princ_list) |
47 |
44 |
48 |
45 |
50 - if ((fp = fopen(pbuf, "r")) == NULL) { |
47 - if ((fp = fopen(pbuf, "r")) == NULL) { |
51 + if ((fp = fopen(pbuf, "rF")) == NULL) { |
48 + if ((fp = fopen(pbuf, "rF")) == NULL) { |
52 return 0; |
49 return 0; |
53 } |
50 } |
54 /* |
51 /* |
55 diff --git a/src/clients/ksu/heuristic.c b/src/clients/ksu/heuristic.c |
|
56 --- a/src/clients/ksu/heuristic.c |
52 --- a/src/clients/ksu/heuristic.c |
57 +++ b/src/clients/ksu/heuristic.c |
53 +++ b/src/clients/ksu/heuristic.c |
58 @@ -222,7 +222,7 @@ get_authorized_princ_names(luser, cmd, princ_list) |
54 @@ -222,7 +222,7 @@ get_authorized_princ_names(luser, cmd, princ_list) |
59 k5users_flag = stat(k5users_path, &tb); |
55 k5users_flag = stat(k5users_path, &tb); |
60 |
56 |
71 - if ((users_fp = fopen(k5users_path, "r")) == NULL) |
67 - if ((users_fp = fopen(k5users_path, "r")) == NULL) |
72 + if ((users_fp = fopen(k5users_path, "rF")) == NULL) |
68 + if ((users_fp = fopen(k5users_path, "rF")) == NULL) |
73 return 0; |
69 return 0; |
74 |
70 |
75 if ( fowner(users_fp, pwd->pw_uid) == FALSE){ |
71 if ( fowner(users_fp, pwd->pw_uid) == FALSE){ |
76 diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c |
|
77 --- a/src/kadmin/dbutil/dump.c |
72 --- a/src/kadmin/dbutil/dump.c |
78 +++ b/src/kadmin/dbutil/dump.c |
73 +++ b/src/kadmin/dbutil/dump.c |
79 @@ -1215,7 +1215,7 @@ current_dump_sno_in_ulog(krb5_context context, const char *ifile) |
74 @@ -1215,7 +1215,7 @@ current_dump_sno_in_ulog(krb5_context context, const char *ifile) |
80 char buf[BUFSIZ]; |
75 char buf[BUFSIZ]; |
81 FILE *f; |
76 FILE *f; |
83 - f = fopen(ifile, "r"); |
78 - f = fopen(ifile, "r"); |
84 + f = fopen(ifile, "rF"); |
79 + f = fopen(ifile, "rF"); |
85 if (f == NULL) |
80 if (f == NULL) |
86 return 0; /* aliasing other errors to ENOENT here is OK */ |
81 return 0; /* aliasing other errors to ENOENT here is OK */ |
87 |
82 |
88 @@ -1537,7 +1537,7 @@ load_db(int argc, char **argv) |
83 @@ -1540,7 +1540,7 @@ load_db(int argc, char **argv) |
89 |
84 |
90 /* Open the dumpfile. */ |
85 /* Open the dumpfile. */ |
91 if (dumpfile != NULL) { |
86 if (dumpfile != NULL) { |
92 - f = fopen(dumpfile, "r"); |
87 - f = fopen(dumpfile, "r"); |
93 + f = fopen(dumpfile, "rF"); |
88 + f = fopen(dumpfile, "rF"); |
94 if (f == NULL) { |
89 if (f == NULL) { |
95 com_err(progname, errno, _("while opening %s"), dumpfile); |
90 com_err(progname, errno, _("while opening %s"), dumpfile); |
96 goto error; |
91 goto error; |
97 diff --git a/src/kadmin/server/ovsec_kadmd.c b/src/kadmin/server/ovsec_kadmd.c |
|
98 --- a/src/kadmin/server/ovsec_kadmd.c |
92 --- a/src/kadmin/server/ovsec_kadmd.c |
99 +++ b/src/kadmin/server/ovsec_kadmd.c |
93 +++ b/src/kadmin/server/ovsec_kadmd.c |
100 @@ -126,7 +126,7 @@ write_pid_file(const char *pid_file) |
94 @@ -126,7 +126,7 @@ write_pid_file(const char *pid_file) |
101 unsigned long pid; |
95 unsigned long pid; |
102 int st1, st2; |
96 int st1, st2; |
104 - file = fopen(pid_file, "w"); |
98 - file = fopen(pid_file, "w"); |
105 + file = fopen(pid_file, "wF"); |
99 + file = fopen(pid_file, "wF"); |
106 if (file == NULL) |
100 if (file == NULL) |
107 return errno; |
101 return errno; |
108 pid = (unsigned long)getpid(); |
102 pid = (unsigned long)getpid(); |
109 diff --git a/src/kdc/main.c b/src/kdc/main.c |
|
110 --- a/src/kdc/main.c |
103 --- a/src/kdc/main.c |
111 +++ b/src/kdc/main.c |
104 +++ b/src/kdc/main.c |
112 @@ -859,7 +859,7 @@ write_pid_file(const char *path) |
105 @@ -859,7 +859,7 @@ write_pid_file(const char *path) |
113 FILE *file; |
106 FILE *file; |
114 unsigned long pid; |
107 unsigned long pid; |
116 - file = fopen(path, "w"); |
109 - file = fopen(path, "w"); |
117 + file = fopen(path, "wF"); |
110 + file = fopen(path, "wF"); |
118 if (file == NULL) |
111 if (file == NULL) |
119 return errno; |
112 return errno; |
120 pid = (unsigned long) getpid(); |
113 pid = (unsigned long) getpid(); |
121 diff --git a/src/lib/gssapi/generic/util_errmap.c b/src/lib/gssapi/generic/util_errmap.c |
|
122 --- a/src/lib/gssapi/generic/util_errmap.c |
114 --- a/src/lib/gssapi/generic/util_errmap.c |
123 +++ b/src/lib/gssapi/generic/util_errmap.c |
115 +++ b/src/lib/gssapi/generic/util_errmap.c |
124 @@ -176,7 +176,7 @@ OM_uint32 gssint_mecherrmap_map(OM_uint32 minor, const gss_OID_desc * oid) |
116 @@ -176,7 +176,7 @@ OM_uint32 gssint_mecherrmap_map(OM_uint32 minor, const gss_OID_desc * oid) |
125 |
117 |
126 #ifdef DEBUG |
118 #ifdef DEBUG |
128 - f = fopen("/dev/pts/9", "w+"); |
120 - f = fopen("/dev/pts/9", "w+"); |
129 + f = fopen("/dev/pts/9", "w+F"); |
121 + f = fopen("/dev/pts/9", "w+F"); |
130 if (f == NULL) |
122 if (f == NULL) |
131 f = stderr; |
123 f = stderr; |
132 #endif |
124 #endif |
133 diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c |
|
134 --- a/src/lib/gssapi/mechglue/g_initialize.c |
125 --- a/src/lib/gssapi/mechglue/g_initialize.c |
135 +++ b/src/lib/gssapi/mechglue/g_initialize.c |
126 +++ b/src/lib/gssapi/mechglue/g_initialize.c |
136 @@ -1218,7 +1218,7 @@ loadConfigFile(const char *fileName) |
127 @@ -1218,7 +1218,7 @@ loadConfigFile(const char *fileName) |
137 char buffer[BUFSIZ], *oidStr; |
128 char buffer[BUFSIZ], *oidStr; |
138 FILE *confFile; |
129 FILE *confFile; |
140 - if ((confFile = fopen(fileName, "r")) == NULL) { |
131 - if ((confFile = fopen(fileName, "r")) == NULL) { |
141 + if ((confFile = fopen(fileName, "rF")) == NULL) { |
132 + if ((confFile = fopen(fileName, "rF")) == NULL) { |
142 return; |
133 return; |
143 } |
134 } |
144 |
135 |
145 diff --git a/src/lib/kadm5/logger.c b/src/lib/kadm5/logger.c |
|
146 --- a/src/lib/kadm5/logger.c |
136 --- a/src/lib/kadm5/logger.c |
147 +++ b/src/lib/kadm5/logger.c |
137 +++ b/src/lib/kadm5/logger.c |
148 @@ -566,7 +566,7 @@ krb5_klog_init(krb5_context kcontext, char *ename, char *whoami, krb5_boolean do |
138 @@ -566,7 +566,7 @@ krb5_klog_init(krb5_context kcontext, char *ename, char *whoami, krb5_boolean do |
149 if (cp[4] == ':' || cp[4] == '=') { |
139 if (cp[4] == ':' || cp[4] == '=') { |
150 /* Solaris Kerberos */ |
140 /* Solaris Kerberos */ |
179 - f = fopen(log_control.log_entries[lindex].lfu_fname, "a+"); |
169 - f = fopen(log_control.log_entries[lindex].lfu_fname, "a+"); |
180 + f = fopen(log_control.log_entries[lindex].lfu_fname, "a+F"); |
170 + f = fopen(log_control.log_entries[lindex].lfu_fname, "a+F"); |
181 if (f) { |
171 if (f) { |
182 set_cloexec_file(f); |
172 set_cloexec_file(f); |
183 log_control.log_entries[lindex].lfu_filep = f; |
173 log_control.log_entries[lindex].lfu_filep = f; |
184 diff --git a/src/lib/kadm5/srv/server_acl.c b/src/lib/kadm5/srv/server_acl.c |
|
185 --- a/src/lib/kadm5/srv/server_acl.c |
174 --- a/src/lib/kadm5/srv/server_acl.c |
186 +++ b/src/lib/kadm5/srv/server_acl.c |
175 +++ b/src/lib/kadm5/srv/server_acl.c |
187 @@ -488,7 +488,7 @@ kadm5int_acl_load_acl_file() |
176 @@ -488,7 +488,7 @@ kadm5int_acl_load_acl_file() |
188 |
177 |
189 DPRINT(DEBUG_CALLS, acl_debug_level, ("* kadm5int_acl_load_acl_file()\n")); |
178 DPRINT(DEBUG_CALLS, acl_debug_level, ("* kadm5int_acl_load_acl_file()\n")); |
191 - afp = fopen(acl_acl_file, "r"); |
180 - afp = fopen(acl_acl_file, "r"); |
192 + afp = fopen(acl_acl_file, "rF"); |
181 + afp = fopen(acl_acl_file, "rF"); |
193 if (afp) { |
182 if (afp) { |
194 set_cloexec_file(afp); |
183 set_cloexec_file(afp); |
195 alineno = 1; |
184 alineno = 1; |
196 diff --git a/src/lib/kdb/kdb_default.c b/src/lib/kdb/kdb_default.c |
|
197 --- a/src/lib/kdb/kdb_default.c |
185 --- a/src/lib/kdb/kdb_default.c |
198 +++ b/src/lib/kdb/kdb_default.c |
186 +++ b/src/lib/kdb/kdb_default.c |
199 @@ -251,9 +251,9 @@ krb5_db_def_fetch_mkey_stash(krb5_context context, |
187 @@ -251,9 +251,9 @@ krb5_db_def_fetch_mkey_stash(krb5_context context, |
200 FILE *kf = NULL; |
188 FILE *kf = NULL; |
201 |
189 |
206 - if (!(kf = fopen(keyfile, "r"))) |
194 - if (!(kf = fopen(keyfile, "r"))) |
207 + if (!(kf = fopen(keyfile, "rF"))) |
195 + if (!(kf = fopen(keyfile, "rF"))) |
208 #endif |
196 #endif |
209 return KRB5_KDB_CANTREAD_STORED; |
197 return KRB5_KDB_CANTREAD_STORED; |
210 set_cloexec_file(kf); |
198 set_cloexec_file(kf); |
211 diff --git a/src/lib/krb5/ccache/cc_dir.c b/src/lib/krb5/ccache/cc_dir.c |
|
212 --- a/src/lib/krb5/ccache/cc_dir.c |
199 --- a/src/lib/krb5/ccache/cc_dir.c |
213 +++ b/src/lib/krb5/ccache/cc_dir.c |
200 +++ b/src/lib/krb5/ccache/cc_dir.c |
214 @@ -153,7 +153,7 @@ read_primary_file(krb5_context context, const char *primary_path, |
201 @@ -153,7 +153,7 @@ read_primary_file(krb5_context context, const char *primary_path, |
215 *residual_out = NULL; |
202 *residual_out = NULL; |
216 |
203 |
218 - fp = fopen(primary_path, "r"); |
205 - fp = fopen(primary_path, "r"); |
219 + fp = fopen(primary_path, "rF"); |
206 + fp = fopen(primary_path, "rF"); |
220 if (fp == NULL) |
207 if (fp == NULL) |
221 return ENOENT; |
208 return ENOENT; |
222 ret = fgets(buf, sizeof(buf), fp); |
209 ret = fgets(buf, sizeof(buf), fp); |
223 diff --git a/src/lib/krb5/ccache/ccselect_k5identity.c b/src/lib/krb5/ccache/ccselect_k5identity.c |
|
224 --- a/src/lib/krb5/ccache/ccselect_k5identity.c |
210 --- a/src/lib/krb5/ccache/ccselect_k5identity.c |
225 +++ b/src/lib/krb5/ccache/ccselect_k5identity.c |
211 +++ b/src/lib/krb5/ccache/ccselect_k5identity.c |
226 @@ -168,7 +168,7 @@ k5identity_choose(krb5_context context, krb5_ccselect_moddata data, |
212 @@ -168,7 +168,7 @@ k5identity_choose(krb5_context context, krb5_ccselect_moddata data, |
227 free(homedir); |
213 free(homedir); |
228 if (ret) |
214 if (ret) |
230 - fp = fopen(filename, "r"); |
216 - fp = fopen(filename, "r"); |
231 + fp = fopen(filename, "rF"); |
217 + fp = fopen(filename, "rF"); |
232 free(filename); |
218 free(filename); |
233 if (fp == NULL) |
219 if (fp == NULL) |
234 return KRB5_PLUGIN_NO_HANDLE; |
220 return KRB5_PLUGIN_NO_HANDLE; |
235 diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c |
|
236 --- a/src/lib/krb5/keytab/kt_file.c |
221 --- a/src/lib/krb5/keytab/kt_file.c |
237 +++ b/src/lib/krb5/keytab/kt_file.c |
222 +++ b/src/lib/krb5/keytab/kt_file.c |
238 @@ -1028,11 +1028,11 @@ typedef krb5_int16 krb5_kt_vno; |
223 @@ -1028,11 +1028,11 @@ typedef krb5_int16 krb5_kt_vno; |
239 #define krb5_kt_default_vno ((krb5_kt_vno)KRB5_KT_DEFAULT_VNO) |
224 #define krb5_kt_default_vno ((krb5_kt_vno)KRB5_KT_DEFAULT_VNO) |
240 |
225 |
249 +static char *const fopen_mode_rbplus= "r+F"; |
234 +static char *const fopen_mode_rbplus= "r+F"; |
250 +static char *const fopen_mode_rb = "rF"; |
235 +static char *const fopen_mode_rb = "rF"; |
251 #endif |
236 #endif |
252 |
237 |
253 static krb5_error_code |
238 static krb5_error_code |
254 diff --git a/src/lib/krb5/keytab/kt_srvtab.c b/src/lib/krb5/keytab/kt_srvtab.c |
|
255 --- a/src/lib/krb5/keytab/kt_srvtab.c |
239 --- a/src/lib/krb5/keytab/kt_srvtab.c |
256 +++ b/src/lib/krb5/keytab/kt_srvtab.c |
240 +++ b/src/lib/krb5/keytab/kt_srvtab.c |
257 @@ -342,9 +342,9 @@ const struct _krb5_kt_ops krb5_kts_ops = { |
241 @@ -342,9 +342,9 @@ const struct _krb5_kt_ops krb5_kts_ops = { |
258 #include <stdio.h> |
242 #include <stdio.h> |
259 |
243 |
264 -#define READ_MODE "r" |
248 -#define READ_MODE "r" |
265 +#define READ_MODE "rF" |
249 +#define READ_MODE "rF" |
266 #endif |
250 #endif |
267 |
251 |
268 /* The maximum sizes for V4 aname, realm, sname, and instance +1 */ |
252 /* The maximum sizes for V4 aname, realm, sname, and instance +1 */ |
269 diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c |
|
270 --- a/src/lib/krb5/os/localaddr.c |
253 --- a/src/lib/krb5/os/localaddr.c |
271 +++ b/src/lib/krb5/os/localaddr.c |
254 +++ b/src/lib/krb5/os/localaddr.c |
272 @@ -368,7 +368,7 @@ get_linux_ipv6_addrs () |
255 @@ -368,7 +368,7 @@ get_linux_ipv6_addrs () |
273 FILE *f; |
256 FILE *f; |
274 |
257 |
276 - f = fopen("/proc/net/if_inet6", "r"); |
259 - f = fopen("/proc/net/if_inet6", "r"); |
277 + f = fopen("/proc/net/if_inet6", "rF"); |
260 + f = fopen("/proc/net/if_inet6", "rF"); |
278 if (f) { |
261 if (f) { |
279 char ifname[21]; |
262 char ifname[21]; |
280 unsigned int idx, pfxlen, scope, dadstat; |
263 unsigned int idx, pfxlen, scope, dadstat; |
281 diff --git a/src/lib/krb5/os/localauth_k5login.c b/src/lib/krb5/os/localauth_k5login.c |
|
282 --- a/src/lib/krb5/os/localauth_k5login.c |
264 --- a/src/lib/krb5/os/localauth_k5login.c |
283 +++ b/src/lib/krb5/os/localauth_k5login.c |
265 +++ b/src/lib/krb5/os/localauth_k5login.c |
284 @@ -116,7 +116,7 @@ userok_k5login(krb5_context context, krb5_localauth_moddata data, |
266 @@ -116,7 +116,7 @@ userok_k5login(krb5_context context, krb5_localauth_moddata data, |
285 if (ret) |
267 if (ret) |
286 goto cleanup; |
268 goto cleanup; |
288 - fp = fopen(filename, "r"); |
270 - fp = fopen(filename, "r"); |
289 + fp = fopen(filename, "rF"); |
271 + fp = fopen(filename, "rF"); |
290 if (fp == NULL) { |
272 if (fp == NULL) { |
291 ret = errno; |
273 ret = errno; |
292 goto cleanup; |
274 goto cleanup; |
293 diff --git a/src/lib/krb5/rcache/t_replay.c b/src/lib/krb5/rcache/t_replay.c |
|
294 --- a/src/lib/krb5/rcache/t_replay.c |
275 --- a/src/lib/krb5/rcache/t_replay.c |
295 +++ b/src/lib/krb5/rcache/t_replay.c |
276 +++ b/src/lib/krb5/rcache/t_replay.c |
296 @@ -66,7 +66,7 @@ dump_rcache(const char *filename) |
277 @@ -66,7 +66,7 @@ dump_rcache(const char *filename) |
297 krb5_int32 usec; |
278 krb5_int32 usec; |
298 krb5_timestamp timestamp; |
279 krb5_timestamp timestamp; |
300 - fp = fopen(filename, "r"); |
281 - fp = fopen(filename, "r"); |
301 + fp = fopen(filename, "rF"); |
282 + fp = fopen(filename, "rF"); |
302 if (!fp) { |
283 if (!fp) { |
303 fprintf(stderr, "Can't open filename: %s\n", strerror(errno)); |
284 fprintf(stderr, "Can't open filename: %s\n", strerror(errno)); |
304 return; |
285 return; |
305 diff --git a/src/lib/krb5/unicode/ucdata/ucdata.c b/src/lib/krb5/unicode/ucdata/ucdata.c |
|
306 --- a/src/lib/krb5/unicode/ucdata/ucdata.c |
286 --- a/src/lib/krb5/unicode/ucdata/ucdata.c |
307 +++ b/src/lib/krb5/unicode/ucdata/ucdata.c |
287 +++ b/src/lib/krb5/unicode/ucdata/ucdata.c |
308 @@ -156,7 +156,7 @@ _ucprop_load(char *paths, int reload) |
288 @@ -156,7 +156,7 @@ _ucprop_load(char *paths, int reload) |
309 _ucprop_size = 0; |
289 _ucprop_size = 0; |
310 } |
290 } |
366 - if ((in = _ucopenfile(paths, "num.dat", "rb")) == 0) |
346 - if ((in = _ucopenfile(paths, "num.dat", "rb")) == 0) |
367 + if ((in = _ucopenfile(paths, "num.dat", "rbF")) == 0) |
347 + if ((in = _ucopenfile(paths, "num.dat", "rbF")) == 0) |
368 return -1; |
348 return -1; |
369 |
349 |
370 /* |
350 /* |
371 diff --git a/src/lib/krb5/unicode/ucdata/ucgendat.c b/src/lib/krb5/unicode/ucdata/ucgendat.c |
|
372 --- a/src/lib/krb5/unicode/ucdata/ucgendat.c |
351 --- a/src/lib/krb5/unicode/ucdata/ucgendat.c |
373 +++ b/src/lib/krb5/unicode/ucdata/ucgendat.c |
352 +++ b/src/lib/krb5/unicode/ucdata/ucgendat.c |
374 @@ -1296,14 +1296,14 @@ write_cdata(char *opath) |
353 @@ -1296,14 +1296,14 @@ write_cdata(char *opath) |
375 * Open the output file. |
354 * Open the output file. |
376 */ |
355 */ |
458 - if ((in = fopen(argv[0], "r")) == 0) |
437 - if ((in = fopen(argv[0], "r")) == 0) |
459 + if ((in = fopen(argv[0], "rF")) == 0) |
438 + if ((in = fopen(argv[0], "rF")) == 0) |
460 fprintf(stderr, "%s: unable to open ctype file %s\n", |
439 fprintf(stderr, "%s: unable to open ctype file %s\n", |
461 prog, argv[0]); |
440 prog, argv[0]); |
462 else { |
441 else { |
463 diff --git a/src/lib/rpc/getrpcent.c b/src/lib/rpc/getrpcent.c |
|
464 --- a/src/lib/rpc/getrpcent.c |
442 --- a/src/lib/rpc/getrpcent.c |
465 +++ b/src/lib/rpc/getrpcent.c |
443 +++ b/src/lib/rpc/getrpcent.c |
466 @@ -121,7 +121,7 @@ SETRPCENT_TYPE setrpcent(int f) |
444 @@ -121,7 +121,7 @@ SETRPCENT_TYPE setrpcent(int f) |
467 if (d == 0) |
445 if (d == 0) |
468 return; |
446 return; |
479 - if ((d->rpcf = fopen(RPCDB, "r")) == NULL) |
457 - if ((d->rpcf = fopen(RPCDB, "r")) == NULL) |
480 + if ((d->rpcf = fopen(RPCDB, "rF")) == NULL) |
458 + if ((d->rpcf = fopen(RPCDB, "rF")) == NULL) |
481 return (NULL); |
459 return (NULL); |
482 set_cloexec_file(d->rpcf); |
460 set_cloexec_file(d->rpcf); |
483 } |
461 } |
484 diff --git a/src/lib/rpc/svc_auth_gssapi.c b/src/lib/rpc/svc_auth_gssapi.c |
|
485 --- a/src/lib/rpc/svc_auth_gssapi.c |
462 --- a/src/lib/rpc/svc_auth_gssapi.c |
486 +++ b/src/lib/rpc/svc_auth_gssapi.c |
463 +++ b/src/lib/rpc/svc_auth_gssapi.c |
487 @@ -57,7 +57,7 @@ void gssrpcint_printf(const char *format, ...) |
464 @@ -57,7 +57,7 @@ void gssrpcint_printf(const char *format, ...) |
488 { |
465 { |
489 static FILE *f; |
466 static FILE *f; |
491 - f = fopen("/dev/pts/4", "a"); |
468 - f = fopen("/dev/pts/4", "a"); |
492 + f = fopen("/dev/pts/4", "aF"); |
469 + f = fopen("/dev/pts/4", "aF"); |
493 if (f) { |
470 if (f) { |
494 vfprintf(f, format, ap); |
471 vfprintf(f, format, ap); |
495 fflush(f); |
472 fflush(f); |
496 diff --git a/src/plugins/audit/test/au_test.c b/src/plugins/audit/test/au_test.c |
|
497 --- a/src/plugins/audit/test/au_test.c |
473 --- a/src/plugins/audit/test/au_test.c |
498 +++ b/src/plugins/audit/test/au_test.c |
474 +++ b/src/plugins/audit/test/au_test.c |
499 @@ -54,7 +54,7 @@ static k5_mutex_t lock = K5_MUTEX_PARTIAL_INITIALIZER; |
475 @@ -54,7 +54,7 @@ static k5_mutex_t lock = K5_MUTEX_PARTIAL_INITIALIZER; |
500 static krb5_error_code |
476 static krb5_error_code |
501 open_au(krb5_audit_moddata *auctx) |
477 open_au(krb5_audit_moddata *auctx) |
503 - au_fd = fopen("au.log", "a+"); |
479 - au_fd = fopen("au.log", "a+"); |
504 + au_fd = fopen("au.log", "a+F"); |
480 + au_fd = fopen("au.log", "a+F"); |
505 if (au_fd == NULL) |
481 if (au_fd == NULL) |
506 return KRB5_PLUGIN_NO_HANDLE; /* audit module is unavailable */ |
482 return KRB5_PLUGIN_NO_HANDLE; /* audit module is unavailable */ |
507 k5_mutex_init(&lock); |
483 k5_mutex_init(&lock); |
508 diff --git a/src/plugins/kdb/db2/adb_openclose.c b/src/plugins/kdb/db2/adb_openclose.c |
|
509 --- a/src/plugins/kdb/db2/adb_openclose.c |
484 --- a/src/plugins/kdb/db2/adb_openclose.c |
510 +++ b/src/plugins/kdb/db2/adb_openclose.c |
485 +++ b/src/plugins/kdb/db2/adb_openclose.c |
511 @@ -147,12 +147,12 @@ osa_adb_init_db(osa_adb_db_t *dbp, char *filename, char *lockfilename, |
486 @@ -152,12 +152,12 @@ osa_adb_init_db(osa_adb_db_t *dbp, char *filename, char *lockfilename, |
|
487 * needs be open read/write so that write locking can work with |
512 * POSIX systems |
488 * POSIX systems |
513 */ |
489 */ |
514 lockp->lockinfo.filename = strdup(lockfilename); |
|
515 - if ((lockp->lockinfo.lockfile = fopen(lockfilename, "r+")) == NULL) { |
490 - if ((lockp->lockinfo.lockfile = fopen(lockfilename, "r+")) == NULL) { |
516 + if ((lockp->lockinfo.lockfile = fopen(lockfilename, "r+F")) == NULL) { |
491 + if ((lockp->lockinfo.lockfile = fopen(lockfilename, "r+F")) == NULL) { |
517 /* |
492 /* |
518 * maybe someone took away write permission so we could only |
493 * maybe someone took away write permission so we could only |
519 * get shared locks? |
494 * get shared locks? |
521 - if ((lockp->lockinfo.lockfile = fopen(lockfilename, "r")) |
496 - if ((lockp->lockinfo.lockfile = fopen(lockfilename, "r")) |
522 + if ((lockp->lockinfo.lockfile = fopen(lockfilename, "rF")) |
497 + if ((lockp->lockinfo.lockfile = fopen(lockfilename, "rF")) |
523 == NULL) { |
498 == NULL) { |
524 free(db); |
499 free(db); |
525 return OSA_ADB_NOLOCKFILE; |
500 return OSA_ADB_NOLOCKFILE; |
526 diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c |
|
527 --- a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c |
501 --- a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c |
528 +++ b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c |
502 +++ b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c |
529 @@ -66,7 +66,7 @@ __bt_dinit() |
503 @@ -66,7 +66,7 @@ __bt_dinit() |
530 first = 0; |
504 first = 0; |
531 |
505 |
533 - if ((tracefp = fopen("/tmp/__bt_debug", "w")) != NULL) |
507 - if ((tracefp = fopen("/tmp/__bt_debug", "w")) != NULL) |
534 + if ((tracefp = fopen("/tmp/__bt_debug", "wF")) != NULL) |
508 + if ((tracefp = fopen("/tmp/__bt_debug", "wF")) != NULL) |
535 return; |
509 return; |
536 #endif |
510 #endif |
537 tracefp = stderr; |
511 tracefp = stderr; |
538 diff --git a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c |
|
539 --- a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c |
512 --- a/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c |
540 +++ b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c |
513 +++ b/src/plugins/kdb/db2/libdb2/test/SEQ_TEST/t.c |
541 @@ -18,7 +18,7 @@ void main(int argc, char *argv[]) { |
514 @@ -18,7 +18,7 @@ void main(int argc, char *argv[]) { |
542 FILE *fopen(), *fin; |
515 FILE *fopen(), *fin; |
543 |
516 |
545 - if ((fin = fopen("data","r")) == NULL) { |
518 - if ((fin = fopen("data","r")) == NULL) { |
546 + if ((fin = fopen("data","rF")) == NULL) { |
519 + if ((fin = fopen("data","rF")) == NULL) { |
547 printf("Unable to open %s\n","data"); |
520 printf("Unable to open %s\n","data"); |
548 exit(25); |
521 exit(25); |
549 } |
522 } |
550 diff --git a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c |
|
551 --- a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c |
523 --- a/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c |
552 +++ b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c |
524 +++ b/src/plugins/kdb/db2/libdb2/test/btree.tests/main.c |
553 @@ -224,7 +224,7 @@ user(db) |
525 @@ -224,7 +224,7 @@ user(db) |
554 int argc, i, last; |
526 int argc, i, last; |
555 char *lbuf, *argv[4], buf[512]; |
527 char *lbuf, *argv[4], buf[512]; |
584 - if ((fp = fopen(argv[1], "r")) == NULL) { |
556 - if ((fp = fopen(argv[1], "r")) == NULL) { |
585 + if ((fp = fopen(argv[1], "rF")) == NULL) { |
557 + if ((fp = fopen(argv[1], "rF")) == NULL) { |
586 (void)fprintf(stderr, "%s: %s\n", argv[1], strerror(errno)); |
558 (void)fprintf(stderr, "%s: %s\n", argv[1], strerror(errno)); |
587 return; |
559 return; |
588 } |
560 } |
589 diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c |
|
590 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c |
561 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c |
591 +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c |
562 +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/tdel.c |
592 @@ -103,7 +103,7 @@ char **argv; |
563 @@ -103,7 +103,7 @@ char **argv; |
593 } |
564 } |
594 |
565 |
596 - fp = fopen ( argv[0], "r"); |
567 - fp = fopen ( argv[0], "r"); |
597 + fp = fopen ( argv[0], "rF"); |
568 + fp = fopen ( argv[0], "rF"); |
598 i = 0; |
569 i = 0; |
599 while ( fgets(wp1, 8192, fp) && |
570 while ( fgets(wp1, 8192, fp) && |
600 fgets(wp2, 8192, fp) && |
571 fgets(wp2, 8192, fp) && |
601 diff --git a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c |
|
602 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c |
572 --- a/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c |
603 +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c |
573 +++ b/src/plugins/kdb/db2/libdb2/test/hash1.tests/thash4.c |
604 @@ -106,7 +106,7 @@ char **argv; |
574 @@ -106,7 +106,7 @@ char **argv; |
605 } |
575 } |
606 |
576 |
608 - fp = fopen ( argv[0], "r"); |
578 - fp = fopen ( argv[0], "r"); |
609 + fp = fopen ( argv[0], "rF"); |
579 + fp = fopen ( argv[0], "rF"); |
610 i = 0; |
580 i = 0; |
611 while ( fgets(wp1, 256, fp) && |
581 while ( fgets(wp1, 256, fp) && |
612 fgets(wp2, 8192, fp) && |
582 fgets(wp2, 8192, fp) && |
613 diff --git a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c |
|
614 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c |
583 --- a/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c |
615 +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c |
584 +++ b/src/plugins/kdb/db2/libdb2/test/hash2.tests/passtest.c |
616 @@ -19,8 +19,8 @@ main(void) |
585 @@ -19,8 +19,8 @@ main(void) |
617 val_line = (char *)malloc(300); |
586 val_line = (char *)malloc(300); |
618 old = (char *)malloc(300); |
587 old = (char *)malloc(300); |
655 + keys = fopen("yp.keys", "rtF"); |
624 + keys = fopen("yp.keys", "rtF"); |
656 + vals = fopen("yp.total", "rtF"); |
625 + vals = fopen("yp.total", "rtF"); |
657 |
626 |
658 db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_BINARY, 0664, DB_HASH, &passwd); |
627 db = dbopen("/usr/tmp/passwd.db", O_RDWR|O_BINARY, 0664, DB_HASH, &passwd); |
659 n = 0; |
628 n = 0; |
660 diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c |
|
661 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c |
629 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c |
662 +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c |
630 +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c |
663 @@ -178,7 +178,7 @@ done: |
631 @@ -178,7 +178,7 @@ done: |
664 |
632 |
665 /* set password in the file */ |
633 /* set password in the file */ |
676 - newfile = fopen(tmp_file, "w"); |
644 - newfile = fopen(tmp_file, "w"); |
677 + newfile = fopen(tmp_file, "wF"); |
645 + newfile = fopen(tmp_file, "wF"); |
678 umask (omask); |
646 umask (omask); |
679 if (newfile == NULL) { |
647 if (newfile == NULL) { |
680 com_err(me, errno, _("Error creating file %s"), tmp_file); |
648 com_err(me, errno, _("Error creating file %s"), tmp_file); |
681 diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c |
|
682 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c |
649 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c |
683 +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c |
650 +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_service_stash.c |
684 @@ -87,7 +87,7 @@ krb5_ldap_readpassword(krb5_context context, const char *filename, |
651 @@ -87,7 +87,7 @@ krb5_ldap_readpassword(krb5_context context, const char *filename, |
685 |
652 |
686 *password_out = NULL; |
653 *password_out = NULL; |
688 - fp = fopen(filename, "r"); |
655 - fp = fopen(filename, "r"); |
689 + fp = fopen(filename, "rF"); |
656 + fp = fopen(filename, "rF"); |
690 if (fp == NULL) { |
657 if (fp == NULL) { |
691 ret = errno; |
658 ret = errno; |
692 k5_setmsg(context, ret, _("Cannot open LDAP password file '%s': %s"), |
659 k5_setmsg(context, ret, _("Cannot open LDAP password file '%s': %s"), |
693 diff --git a/src/plugins/locate/python/py-locate.c b/src/plugins/locate/python/py-locate.c |
|
694 --- a/src/plugins/locate/python/py-locate.c |
660 --- a/src/plugins/locate/python/py-locate.c |
695 +++ b/src/plugins/locate/python/py-locate.c |
661 +++ b/src/plugins/locate/python/py-locate.c |
696 @@ -98,7 +98,7 @@ my_init(void) |
662 @@ -98,7 +98,7 @@ my_init(void) |
697 |
663 |
698 Py_Initialize (); |
664 Py_Initialize (); |
700 - f = fopen(SCRIPT_PATH, "r"); |
666 - f = fopen(SCRIPT_PATH, "r"); |
701 + f = fopen(SCRIPT_PATH, "rF"); |
667 + f = fopen(SCRIPT_PATH, "rF"); |
702 if (f == NULL) { |
668 if (f == NULL) { |
703 if (sctx) |
669 if (sctx) |
704 krb5_set_error_message(sctx, -1, |
670 krb5_set_error_message(sctx, -1, |
705 diff --git a/src/plugins/preauth/otp/otp_state.c b/src/plugins/preauth/otp/otp_state.c |
|
706 --- a/src/plugins/preauth/otp/otp_state.c |
671 --- a/src/plugins/preauth/otp/otp_state.c |
707 +++ b/src/plugins/preauth/otp/otp_state.c |
672 +++ b/src/plugins/preauth/otp/otp_state.c |
708 @@ -96,7 +96,7 @@ read_secret_file(const char *secret_file, char **secret) |
673 @@ -96,7 +96,7 @@ read_secret_file(const char *secret_file, char **secret) |
709 return retval; |
674 return retval; |
710 } |
675 } |
712 - file = fopen(filename, "r"); |
677 - file = fopen(filename, "r"); |
713 + file = fopen(filename, "rF"); |
678 + file = fopen(filename, "rF"); |
714 if (file == NULL) { |
679 if (file == NULL) { |
715 retval = errno; |
680 retval = errno; |
716 com_err("otp", retval, "Unable to open secret file '%s'", filename); |
681 com_err("otp", retval, "Unable to open secret file '%s'", filename); |
717 diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |
|
718 --- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |
682 --- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |
719 +++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |
683 +++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c |
720 @@ -4281,7 +4281,7 @@ pkinit_get_certs_pkcs12(krb5_context context, |
684 @@ -4281,7 +4281,7 @@ pkinit_get_certs_pkcs12(krb5_context context, |
721 goto cleanup; |
685 goto cleanup; |
722 } |
686 } |
724 - fp = fopen(idopts->cert_filename, "rb"); |
688 - fp = fopen(idopts->cert_filename, "rb"); |
725 + fp = fopen(idopts->cert_filename, "rbF"); |
689 + fp = fopen(idopts->cert_filename, "rbF"); |
726 if (fp == NULL) { |
690 if (fp == NULL) { |
727 pkiDebug("Failed to open PKCS12 file '%s', error %d\n", |
691 pkiDebug("Failed to open PKCS12 file '%s', error %d\n", |
728 idopts->cert_filename, errno); |
692 idopts->cert_filename, errno); |
729 diff --git a/src/plugins/preauth/pkinit/pkinit_lib.c b/src/plugins/preauth/pkinit/pkinit_lib.c |
|
730 --- a/src/plugins/preauth/pkinit/pkinit_lib.c |
693 --- a/src/plugins/preauth/pkinit/pkinit_lib.c |
731 +++ b/src/plugins/preauth/pkinit/pkinit_lib.c |
694 +++ b/src/plugins/preauth/pkinit/pkinit_lib.c |
732 @@ -365,7 +365,7 @@ print_buffer_bin(unsigned char *buf, unsigned int len, char *filename) |
695 @@ -365,7 +365,7 @@ print_buffer_bin(unsigned char *buf, unsigned int len, char *filename) |
733 if (len <= 0 || filename == NULL) |
696 if (len <= 0 || filename == NULL) |
734 return; |
697 return; |
736 - if ((f = fopen(filename, "w")) == NULL) |
699 - if ((f = fopen(filename, "w")) == NULL) |
737 + if ((f = fopen(filename, "wF")) == NULL) |
700 + if ((f = fopen(filename, "wF")) == NULL) |
738 return; |
701 return; |
739 |
702 |
740 set_cloexec_file(f); |
703 set_cloexec_file(f); |
741 diff --git a/src/plugins/tls/k5tls/openssl.c b/src/plugins/tls/k5tls/openssl.c |
|
742 --- a/src/plugins/tls/k5tls/openssl.c |
704 --- a/src/plugins/tls/k5tls/openssl.c |
743 +++ b/src/plugins/tls/k5tls/openssl.c |
705 +++ b/src/plugins/tls/k5tls/openssl.c |
744 @@ -348,7 +348,7 @@ load_anchor_file(X509_STORE *store, const char *path) |
706 @@ -348,7 +348,7 @@ load_anchor_file(X509_STORE *store, const char *path) |
745 X509_INFO *xi; |
707 X509_INFO *xi; |
746 int i; |
708 int i; |
748 - fp = fopen(path, "r"); |
710 - fp = fopen(path, "r"); |
749 + fp = fopen(path, "rF"); |
711 + fp = fopen(path, "rF"); |
750 if (fp == NULL) |
712 if (fp == NULL) |
751 return errno; |
713 return errno; |
752 sk = PEM_X509_INFO_read(fp, NULL, NULL, NULL); |
714 sk = PEM_X509_INFO_read(fp, NULL, NULL, NULL); |
753 diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c |
|
754 --- a/src/slave/kpropd.c |
715 --- a/src/slave/kpropd.c |
755 +++ b/src/slave/kpropd.c |
716 +++ b/src/slave/kpropd.c |
756 @@ -1310,7 +1310,7 @@ authorized_principal(krb5_context context, krb5_principal p, |
717 @@ -1310,7 +1310,7 @@ authorized_principal(krb5_context context, krb5_principal p, |
757 if (retval) |
718 if (retval) |
758 return FALSE; |
719 return FALSE; |
760 - acl_file = fopen(acl_file_name, "r"); |
721 - acl_file = fopen(acl_file_name, "r"); |
761 + acl_file = fopen(acl_file_name, "rF"); |
722 + acl_file = fopen(acl_file_name, "rF"); |
762 if (acl_file == NULL) |
723 if (acl_file == NULL) |
763 return FALSE; |
724 return FALSE; |
764 |
725 |
765 diff --git a/src/tests/asn.1/t_trval.c b/src/tests/asn.1/t_trval.c |
|
766 --- a/src/tests/asn.1/t_trval.c |
726 --- a/src/tests/asn.1/t_trval.c |
767 +++ b/src/tests/asn.1/t_trval.c |
727 +++ b/src/tests/asn.1/t_trval.c |
768 @@ -93,7 +93,7 @@ int main(argc, argv) |
728 @@ -93,7 +93,7 @@ int main(argc, argv) |
769 } |
729 } |
770 } else { |
730 } else { |
772 - if ((fp = fopen(*argv,"r")) == NULL) { |
732 - if ((fp = fopen(*argv,"r")) == NULL) { |
773 + if ((fp = fopen(*argv,"rF")) == NULL) { |
733 + if ((fp = fopen(*argv,"rF")) == NULL) { |
774 fprintf(stderr,"trval: unable to open %s\n", *argv); |
734 fprintf(stderr,"trval: unable to open %s\n", *argv); |
775 continue; |
735 continue; |
776 } |
736 } |
777 diff --git a/src/tests/gss-threads/gss-server.c b/src/tests/gss-threads/gss-server.c |
|
778 --- a/src/tests/gss-threads/gss-server.c |
737 --- a/src/tests/gss-threads/gss-server.c |
779 +++ b/src/tests/gss-threads/gss-server.c |
738 +++ b/src/tests/gss-threads/gss-server.c |
780 @@ -733,7 +733,7 @@ main(int argc, char **argv) |
739 @@ -733,7 +733,7 @@ main(int argc, char **argv) |
781 if (!strcmp(*argv, "/dev/null")) { |
740 if (!strcmp(*argv, "/dev/null")) { |
782 logfile = display_file = NULL; |
741 logfile = display_file = NULL; |
784 - logfile = fopen(*argv, "a"); |
743 - logfile = fopen(*argv, "a"); |
785 + logfile = fopen(*argv, "aF"); |
744 + logfile = fopen(*argv, "aF"); |
786 display_file = logfile; |
745 display_file = logfile; |
787 if (!logfile) { |
746 if (!logfile) { |
788 perror(*argv); |
747 perror(*argv); |
789 diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c |
|
790 --- a/src/util/profile/prof_file.c |
748 --- a/src/util/profile/prof_file.c |
791 +++ b/src/util/profile/prof_file.c |
749 +++ b/src/util/profile/prof_file.c |
792 @@ -126,7 +126,7 @@ static int rw_access(const_profile_filespec_t filespec) |
750 @@ -126,7 +126,7 @@ static int rw_access(const_profile_filespec_t filespec) |
793 */ |
751 */ |
794 FILE *f; |
752 FILE *f; |
823 - f = fopen(new_file, "w"); |
781 - f = fopen(new_file, "w"); |
824 + f = fopen(new_file, "wF"); |
782 + f = fopen(new_file, "wF"); |
825 if (!f) { |
783 if (!f) { |
826 retval = errno; |
784 retval = errno; |
827 if (retval == 0) |
785 if (retval == 0) |
828 diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c |
|
829 --- a/src/util/profile/prof_parse.c |
786 --- a/src/util/profile/prof_parse.c |
830 +++ b/src/util/profile/prof_parse.c |
787 +++ b/src/util/profile/prof_parse.c |
831 @@ -213,7 +213,7 @@ static errcode_t parse_include_file(const char *filename, |
788 @@ -213,7 +213,7 @@ static errcode_t parse_include_file(const char *filename, |
832 state.root_section = root_section; |
789 state.root_section = root_section; |
833 state.current_section = NULL; |
790 state.current_section = NULL; |
835 - fp = fopen(filename, "r"); |
792 - fp = fopen(filename, "r"); |
836 + fp = fopen(filename, "rF"); |
793 + fp = fopen(filename, "rF"); |
837 if (fp == NULL) |
794 if (fp == NULL) |
838 return PROF_FAIL_INCLUDE_FILE; |
795 return PROF_FAIL_INCLUDE_FILE; |
839 retval = parse_file(fp, &state, NULL); |
796 retval = parse_file(fp, &state, NULL); |
840 diff --git a/src/util/profile/test_parse.c b/src/util/profile/test_parse.c |
|
841 --- a/src/util/profile/test_parse.c |
797 --- a/src/util/profile/test_parse.c |
842 +++ b/src/util/profile/test_parse.c |
798 +++ b/src/util/profile/test_parse.c |
843 @@ -25,7 +25,7 @@ int main(argc, argv) |
799 @@ -25,7 +25,7 @@ int main(argc, argv) |
844 exit(1); |
800 exit(1); |
845 } |
801 } |