1--TEST--
2Test tempnam() function: usage variations - permissions(0000 to 0350) of dir
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6    die('skip Not valid for Windows');
7}
8require __DIR__ . '/../skipif_root.inc';
9?>
10--FILE--
11<?php
12/* Trying to create the file in a dir with permissions from 0000 to 0350,
13     Allowable permissions: files are expected to be created in the input dir
14     Non-allowable permissions: files are expected to be created in '/tmp' dir
15*/
16
17echo "*** Testing tempnam() with dir of permissions from 0000 to 0350 ***\n";
18$file_path = __DIR__;
19$dir_name = $file_path."/tempnam_variation4-0";
20$prefix = "tempnamVar4.";
21
22mkdir($dir_name);
23
24for($mode = 0000; $mode <= 0350; $mode++) {
25  chmod($dir_name, $mode);
26  $file_name = tempnam($dir_name, $prefix);
27
28  if(file_exists($file_name) ) {
29    if (dirname($file_name) != $dir_name) {
30      /* Either there's a notice or error */
31       printf("%o\n", $mode);
32
33      if (realpath(dirname($file_name)) != realpath(sys_get_temp_dir())) {
34         echo " created in unexpected dir\n";
35      }
36    }
37    unlink($file_name);
38  }
39  else {
40    print("FAILED: File is not created\n");
41  }
42}
43
44rmdir($dir_name);
45
46echo "*** Done ***\n";
47?>
48--EXPECTF--
49*** Testing tempnam() with dir of permissions from 0000 to 0350 ***
50
51Notice: tempnam(): file created in the system's temporary directory in %s on line %d
520
53
54Notice: tempnam(): file created in the system's temporary directory in %s on line %d
551
56
57Notice: tempnam(): file created in the system's temporary directory in %s on line %d
582
59
60Notice: tempnam(): file created in the system's temporary directory in %s on line %d
613
62
63Notice: tempnam(): file created in the system's temporary directory in %s on line %d
644
65
66Notice: tempnam(): file created in the system's temporary directory in %s on line %d
675
68
69Notice: tempnam(): file created in the system's temporary directory in %s on line %d
706
71
72Notice: tempnam(): file created in the system's temporary directory in %s on line %d
737
74
75Notice: tempnam(): file created in the system's temporary directory in %s on line %d
7610
77
78Notice: tempnam(): file created in the system's temporary directory in %s on line %d
7911
80
81Notice: tempnam(): file created in the system's temporary directory in %s on line %d
8212
83
84Notice: tempnam(): file created in the system's temporary directory in %s on line %d
8513
86
87Notice: tempnam(): file created in the system's temporary directory in %s on line %d
8814
89
90Notice: tempnam(): file created in the system's temporary directory in %s on line %d
9115
92
93Notice: tempnam(): file created in the system's temporary directory in %s on line %d
9416
95
96Notice: tempnam(): file created in the system's temporary directory in %s on line %d
9717
98
99Notice: tempnam(): file created in the system's temporary directory in %s on line %d
10020
101
102Notice: tempnam(): file created in the system's temporary directory in %s on line %d
10321
104
105Notice: tempnam(): file created in the system's temporary directory in %s on line %d
10622
107
108Notice: tempnam(): file created in the system's temporary directory in %s on line %d
10923
110
111Notice: tempnam(): file created in the system's temporary directory in %s on line %d
11224
113
114Notice: tempnam(): file created in the system's temporary directory in %s on line %d
11525
116
117Notice: tempnam(): file created in the system's temporary directory in %s on line %d
11826
119
120Notice: tempnam(): file created in the system's temporary directory in %s on line %d
12127
122
123Notice: tempnam(): file created in the system's temporary directory in %s on line %d
12430
125
126Notice: tempnam(): file created in the system's temporary directory in %s on line %d
12731
128
129Notice: tempnam(): file created in the system's temporary directory in %s on line %d
13032
131
132Notice: tempnam(): file created in the system's temporary directory in %s on line %d
13333
134
135Notice: tempnam(): file created in the system's temporary directory in %s on line %d
13634
137
138Notice: tempnam(): file created in the system's temporary directory in %s on line %d
13935
140
141Notice: tempnam(): file created in the system's temporary directory in %s on line %d
14236
143
144Notice: tempnam(): file created in the system's temporary directory in %s on line %d
14537
146
147Notice: tempnam(): file created in the system's temporary directory in %s on line %d
14840
149
150Notice: tempnam(): file created in the system's temporary directory in %s on line %d
15141
152
153Notice: tempnam(): file created in the system's temporary directory in %s on line %d
15442
155
156Notice: tempnam(): file created in the system's temporary directory in %s on line %d
15743
158
159Notice: tempnam(): file created in the system's temporary directory in %s on line %d
16044
161
162Notice: tempnam(): file created in the system's temporary directory in %s on line %d
16345
164
165Notice: tempnam(): file created in the system's temporary directory in %s on line %d
16646
167
168Notice: tempnam(): file created in the system's temporary directory in %s on line %d
16947
170
171Notice: tempnam(): file created in the system's temporary directory in %s on line %d
17250
173
174Notice: tempnam(): file created in the system's temporary directory in %s on line %d
17551
176
177Notice: tempnam(): file created in the system's temporary directory in %s on line %d
17852
179
180Notice: tempnam(): file created in the system's temporary directory in %s on line %d
18153
182
183Notice: tempnam(): file created in the system's temporary directory in %s on line %d
18454
185
186Notice: tempnam(): file created in the system's temporary directory in %s on line %d
18755
188
189Notice: tempnam(): file created in the system's temporary directory in %s on line %d
19056
191
192Notice: tempnam(): file created in the system's temporary directory in %s on line %d
19357
194
195Notice: tempnam(): file created in the system's temporary directory in %s on line %d
19660
197
198Notice: tempnam(): file created in the system's temporary directory in %s on line %d
19961
200
201Notice: tempnam(): file created in the system's temporary directory in %s on line %d
20262
203
204Notice: tempnam(): file created in the system's temporary directory in %s on line %d
20563
206
207Notice: tempnam(): file created in the system's temporary directory in %s on line %d
20864
209
210Notice: tempnam(): file created in the system's temporary directory in %s on line %d
21165
212
213Notice: tempnam(): file created in the system's temporary directory in %s on line %d
21466
215
216Notice: tempnam(): file created in the system's temporary directory in %s on line %d
21767
218
219Notice: tempnam(): file created in the system's temporary directory in %s on line %d
22070
221
222Notice: tempnam(): file created in the system's temporary directory in %s on line %d
22371
224
225Notice: tempnam(): file created in the system's temporary directory in %s on line %d
22672
227
228Notice: tempnam(): file created in the system's temporary directory in %s on line %d
22973
230
231Notice: tempnam(): file created in the system's temporary directory in %s on line %d
23274
233
234Notice: tempnam(): file created in the system's temporary directory in %s on line %d
23575
236
237Notice: tempnam(): file created in the system's temporary directory in %s on line %d
23876
239
240Notice: tempnam(): file created in the system's temporary directory in %s on line %d
24177
242
243Notice: tempnam(): file created in the system's temporary directory in %s on line %d
244100
245
246Notice: tempnam(): file created in the system's temporary directory in %s on line %d
247101
248
249Notice: tempnam(): file created in the system's temporary directory in %s on line %d
250102
251
252Notice: tempnam(): file created in the system's temporary directory in %s on line %d
253103
254
255Notice: tempnam(): file created in the system's temporary directory in %s on line %d
256104
257
258Notice: tempnam(): file created in the system's temporary directory in %s on line %d
259105
260
261Notice: tempnam(): file created in the system's temporary directory in %s on line %d
262106
263
264Notice: tempnam(): file created in the system's temporary directory in %s on line %d
265107
266
267Notice: tempnam(): file created in the system's temporary directory in %s on line %d
268110
269
270Notice: tempnam(): file created in the system's temporary directory in %s on line %d
271111
272
273Notice: tempnam(): file created in the system's temporary directory in %s on line %d
274112
275
276Notice: tempnam(): file created in the system's temporary directory in %s on line %d
277113
278
279Notice: tempnam(): file created in the system's temporary directory in %s on line %d
280114
281
282Notice: tempnam(): file created in the system's temporary directory in %s on line %d
283115
284
285Notice: tempnam(): file created in the system's temporary directory in %s on line %d
286116
287
288Notice: tempnam(): file created in the system's temporary directory in %s on line %d
289117
290
291Notice: tempnam(): file created in the system's temporary directory in %s on line %d
292120
293
294Notice: tempnam(): file created in the system's temporary directory in %s on line %d
295121
296
297Notice: tempnam(): file created in the system's temporary directory in %s on line %d
298122
299
300Notice: tempnam(): file created in the system's temporary directory in %s on line %d
301123
302
303Notice: tempnam(): file created in the system's temporary directory in %s on line %d
304124
305
306Notice: tempnam(): file created in the system's temporary directory in %s on line %d
307125
308
309Notice: tempnam(): file created in the system's temporary directory in %s on line %d
310126
311
312Notice: tempnam(): file created in the system's temporary directory in %s on line %d
313127
314
315Notice: tempnam(): file created in the system's temporary directory in %s on line %d
316130
317
318Notice: tempnam(): file created in the system's temporary directory in %s on line %d
319131
320
321Notice: tempnam(): file created in the system's temporary directory in %s on line %d
322132
323
324Notice: tempnam(): file created in the system's temporary directory in %s on line %d
325133
326
327Notice: tempnam(): file created in the system's temporary directory in %s on line %d
328134
329
330Notice: tempnam(): file created in the system's temporary directory in %s on line %d
331135
332
333Notice: tempnam(): file created in the system's temporary directory in %s on line %d
334136
335
336Notice: tempnam(): file created in the system's temporary directory in %s on line %d
337137
338
339Notice: tempnam(): file created in the system's temporary directory in %s on line %d
340140
341
342Notice: tempnam(): file created in the system's temporary directory in %s on line %d
343141
344
345Notice: tempnam(): file created in the system's temporary directory in %s on line %d
346142
347
348Notice: tempnam(): file created in the system's temporary directory in %s on line %d
349143
350
351Notice: tempnam(): file created in the system's temporary directory in %s on line %d
352144
353
354Notice: tempnam(): file created in the system's temporary directory in %s on line %d
355145
356
357Notice: tempnam(): file created in the system's temporary directory in %s on line %d
358146
359
360Notice: tempnam(): file created in the system's temporary directory in %s on line %d
361147
362
363Notice: tempnam(): file created in the system's temporary directory in %s on line %d
364150
365
366Notice: tempnam(): file created in the system's temporary directory in %s on line %d
367151
368
369Notice: tempnam(): file created in the system's temporary directory in %s on line %d
370152
371
372Notice: tempnam(): file created in the system's temporary directory in %s on line %d
373153
374
375Notice: tempnam(): file created in the system's temporary directory in %s on line %d
376154
377
378Notice: tempnam(): file created in the system's temporary directory in %s on line %d
379155
380
381Notice: tempnam(): file created in the system's temporary directory in %s on line %d
382156
383
384Notice: tempnam(): file created in the system's temporary directory in %s on line %d
385157
386
387Notice: tempnam(): file created in the system's temporary directory in %s on line %d
388160
389
390Notice: tempnam(): file created in the system's temporary directory in %s on line %d
391161
392
393Notice: tempnam(): file created in the system's temporary directory in %s on line %d
394162
395
396Notice: tempnam(): file created in the system's temporary directory in %s on line %d
397163
398
399Notice: tempnam(): file created in the system's temporary directory in %s on line %d
400164
401
402Notice: tempnam(): file created in the system's temporary directory in %s on line %d
403165
404
405Notice: tempnam(): file created in the system's temporary directory in %s on line %d
406166
407
408Notice: tempnam(): file created in the system's temporary directory in %s on line %d
409167
410
411Notice: tempnam(): file created in the system's temporary directory in %s on line %d
412170
413
414Notice: tempnam(): file created in the system's temporary directory in %s on line %d
415171
416
417Notice: tempnam(): file created in the system's temporary directory in %s on line %d
418172
419
420Notice: tempnam(): file created in the system's temporary directory in %s on line %d
421173
422
423Notice: tempnam(): file created in the system's temporary directory in %s on line %d
424174
425
426Notice: tempnam(): file created in the system's temporary directory in %s on line %d
427175
428
429Notice: tempnam(): file created in the system's temporary directory in %s on line %d
430176
431
432Notice: tempnam(): file created in the system's temporary directory in %s on line %d
433177
434
435Notice: tempnam(): file created in the system's temporary directory in %s on line %d
436200
437
438Notice: tempnam(): file created in the system's temporary directory in %s on line %d
439201
440
441Notice: tempnam(): file created in the system's temporary directory in %s on line %d
442202
443
444Notice: tempnam(): file created in the system's temporary directory in %s on line %d
445203
446
447Notice: tempnam(): file created in the system's temporary directory in %s on line %d
448204
449
450Notice: tempnam(): file created in the system's temporary directory in %s on line %d
451205
452
453Notice: tempnam(): file created in the system's temporary directory in %s on line %d
454206
455
456Notice: tempnam(): file created in the system's temporary directory in %s on line %d
457207
458
459Notice: tempnam(): file created in the system's temporary directory in %s on line %d
460210
461
462Notice: tempnam(): file created in the system's temporary directory in %s on line %d
463211
464
465Notice: tempnam(): file created in the system's temporary directory in %s on line %d
466212
467
468Notice: tempnam(): file created in the system's temporary directory in %s on line %d
469213
470
471Notice: tempnam(): file created in the system's temporary directory in %s on line %d
472214
473
474Notice: tempnam(): file created in the system's temporary directory in %s on line %d
475215
476
477Notice: tempnam(): file created in the system's temporary directory in %s on line %d
478216
479
480Notice: tempnam(): file created in the system's temporary directory in %s on line %d
481217
482
483Notice: tempnam(): file created in the system's temporary directory in %s on line %d
484220
485
486Notice: tempnam(): file created in the system's temporary directory in %s on line %d
487221
488
489Notice: tempnam(): file created in the system's temporary directory in %s on line %d
490222
491
492Notice: tempnam(): file created in the system's temporary directory in %s on line %d
493223
494
495Notice: tempnam(): file created in the system's temporary directory in %s on line %d
496224
497
498Notice: tempnam(): file created in the system's temporary directory in %s on line %d
499225
500
501Notice: tempnam(): file created in the system's temporary directory in %s on line %d
502226
503
504Notice: tempnam(): file created in the system's temporary directory in %s on line %d
505227
506
507Notice: tempnam(): file created in the system's temporary directory in %s on line %d
508230
509
510Notice: tempnam(): file created in the system's temporary directory in %s on line %d
511231
512
513Notice: tempnam(): file created in the system's temporary directory in %s on line %d
514232
515
516Notice: tempnam(): file created in the system's temporary directory in %s on line %d
517233
518
519Notice: tempnam(): file created in the system's temporary directory in %s on line %d
520234
521
522Notice: tempnam(): file created in the system's temporary directory in %s on line %d
523235
524
525Notice: tempnam(): file created in the system's temporary directory in %s on line %d
526236
527
528Notice: tempnam(): file created in the system's temporary directory in %s on line %d
529237
530
531Notice: tempnam(): file created in the system's temporary directory in %s on line %d
532240
533
534Notice: tempnam(): file created in the system's temporary directory in %s on line %d
535241
536
537Notice: tempnam(): file created in the system's temporary directory in %s on line %d
538242
539
540Notice: tempnam(): file created in the system's temporary directory in %s on line %d
541243
542
543Notice: tempnam(): file created in the system's temporary directory in %s on line %d
544244
545
546Notice: tempnam(): file created in the system's temporary directory in %s on line %d
547245
548
549Notice: tempnam(): file created in the system's temporary directory in %s on line %d
550246
551
552Notice: tempnam(): file created in the system's temporary directory in %s on line %d
553247
554
555Notice: tempnam(): file created in the system's temporary directory in %s on line %d
556250
557
558Notice: tempnam(): file created in the system's temporary directory in %s on line %d
559251
560
561Notice: tempnam(): file created in the system's temporary directory in %s on line %d
562252
563
564Notice: tempnam(): file created in the system's temporary directory in %s on line %d
565253
566
567Notice: tempnam(): file created in the system's temporary directory in %s on line %d
568254
569
570Notice: tempnam(): file created in the system's temporary directory in %s on line %d
571255
572
573Notice: tempnam(): file created in the system's temporary directory in %s on line %d
574256
575
576Notice: tempnam(): file created in the system's temporary directory in %s on line %d
577257
578
579Notice: tempnam(): file created in the system's temporary directory in %s on line %d
580260
581
582Notice: tempnam(): file created in the system's temporary directory in %s on line %d
583261
584
585Notice: tempnam(): file created in the system's temporary directory in %s on line %d
586262
587
588Notice: tempnam(): file created in the system's temporary directory in %s on line %d
589263
590
591Notice: tempnam(): file created in the system's temporary directory in %s on line %d
592264
593
594Notice: tempnam(): file created in the system's temporary directory in %s on line %d
595265
596
597Notice: tempnam(): file created in the system's temporary directory in %s on line %d
598266
599
600Notice: tempnam(): file created in the system's temporary directory in %s on line %d
601267
602
603Notice: tempnam(): file created in the system's temporary directory in %s on line %d
604270
605
606Notice: tempnam(): file created in the system's temporary directory in %s on line %d
607271
608
609Notice: tempnam(): file created in the system's temporary directory in %s on line %d
610272
611
612Notice: tempnam(): file created in the system's temporary directory in %s on line %d
613273
614
615Notice: tempnam(): file created in the system's temporary directory in %s on line %d
616274
617
618Notice: tempnam(): file created in the system's temporary directory in %s on line %d
619275
620
621Notice: tempnam(): file created in the system's temporary directory in %s on line %d
622276
623
624Notice: tempnam(): file created in the system's temporary directory in %s on line %d
625277
626*** Done ***
627