Chmod, Umask, Stat, Fileperms, and File Permissions
Chmod, Umask, Stat, Fileperms, and File Permissions
Chmod, Umask, Stat, Fileperms, and File Permissions
1 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
03/03/2015 23:27
2 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
.htaccess ^
$ chmod 604 .htaccess
604 -rw----r--
/web/askapache/cgi-bin/.htaccess
php.cgi ^
$ chmod 711 php.cgi
$ 711 -rwx--x--x
/web/askapache/cgi-bin/php.cgi
.php.ini ^
03/03/2015 23:27
3 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
/web/askapache/cgi-bin/php.ini
I'm in the process of developing an updated version of the .htaccess security plugin, and one thing I have been working on is file
permissions. Some people had problems trying to create files on their server and I realized it was bad programming on my part.. so
I began researching permissions in detail. I went deep into the source code of Apache (which is why this site is called
AskApache, BTW), PHP, Python, Ocaml, Perl, Ruby, and POSIX operating systems and got a pretty good handle on it now..
Stat Function ^
I've created a stat function in php that goes farther than the normal stat function... Just give the function a file to stat, and it returns
an array of information.
03/03/2015 23:27
4 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
function askapache_stat($filename) {
clearstatcache();
$ss=@stat($filename);
if(!$ss) die("Couldnt stat {$filename}");
$file_convert=array(0140000=>'ssocket',0120000=>'llink',0100000=>'-file',0060000=>'bblock',0040000=>'dd
$p=$ss['mode'];
$t=decoct($ss['mode'] & 0170000);
$str = (array_key_exists(octdec($t),$file_convert)) ? $file_convert[octdec($t)]{0} : 'u';
$str.=(($p&0x0100)?'r':'-').(($p&0x0080)?'w':'-').(($p&0x0040)?(($p&0x0800)?'s':'x'):(($p&0x0800)?'S':'
$str.=(($p&0x0020)?'r':'-').(($p&0x0010)?'w':'-').(($p&0x0008)?(($p&0x0400)?'s':'x'):(($p&0x0400)?'S':'
$str.=(($p&0x0004)?'r':'-').(($p&0x0002)?'w':'-').(($p&0x0001)?(($p&0x0200)?'t':'x'):(($p&0x0200)?'T':'
$s=array(
'perms'=>array(
'umask'=>sprintf("%04o",umask()),
'human'=>$str,
'octal1'=>sprintf("%o", ($ss['mode'] & 000777)),
'octal2'=>sprintf("0%o", 0777 & $p),
'decimal'=>sprintf("%04o", $p),
'fileperms'=>@fileperms($filename),
'mode1'=>$p,
'mode2'=>$ss['mode']),
'filetype'=>array(
'type'=>substr($file_convert[octdec($t)],1),
'type_octal'=>sprintf("%07o", octdec($t)),
'is_file'=>@is_file($filename),
'is_dir'=>@is_dir($filename),
'is_link'=>@is_link($filename),
'is_readable'=> @is_readable($filename),
'is_writable'=> @is_writable($filename)),
'owner'=>array(
'fileowner'=>$ss['uid'],
'filegroup'=>$ss['gid'],
'owner_name'=>(function_exists('posix_getpwuid')) ? @reset(@posix_getpwuid($ss['uid'])) : '',
'group_name'=>(function_exists('posix_getgrgid')) ? @reset(@posix_getgrgid($ss['gid'])) : ''),
'file'=>array(
'filename'=>$filename,
'realpath'=>(@realpath($filename) != $filename) ? @realpath($filename) : '',
'dirname'=>@dirname($filename),
'basename'=>@basename($filename)),
'device'=>array(
'device'=>$ss['dev'], //Device
'device_number'=>$ss['rdev'], //Device number, if device.
'inode'=>$ss['ino'], //File serial number
'link_count'=>$ss['nlink'], //link count
'link_to'=>($s['type']=='link') ? @readlink($filename) : ''),
'size'=>array(
'size'=>$ss['size'], //Size of file, in bytes.
'blocks'=>$ss['blocks'], //Number 512-byte blocks allocated
'block_size'=> $ss['blksize']), //Optimal block size for I/O.
'time'=>array(
'mtime'=>$ss['mtime'], //Time of last modification
'atime'=>$ss['atime'], //Time of last access.
'ctime'=>$ss['ctime'], //Time of last status change
'accessed'=>@date('Y M D H:i:s',$ss['atime']),
'modified'=>@date('Y M D H:i:s',$ss['mtime']),
'created'=>@date('Y M D H:i:s',$ss['ctime'])),
);
clearstatcache();
return $s;
}
03/03/2015 23:27
5 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
Array(
[perms] => Array
(
[umask] => 0022
[human] => -rw-r--r-[octal1] => 644
[octal2] => 0644
[decimal] => 100644
[fileperms] => 33188
[mode1] => 33188
[mode2] => 33188
)
[filetype] => Array
(
[type] => file
[type_octal] => 0100000
[is_file] => 1
[is_dir] =>
[is_link] =>
[is_readable] => 1
[is_writable] => 1
)
[owner] => Array
(
[fileowner] => 035483
[filegroup] => 23472
[owner_name] => askapache
[group_name] => grp22558
)
[file] => Array
(
[filename] => /web/askapache/askapache-stat/public_html/ok/g.php
[realpath] =>
[dirname] => /web/askapache/askapache-stat/public_html/ok
[basename] => g.php
)
[device] => Array
(
[device] => 25
[device_number] => 0
[inode] => 92455020
[link_count] => 1
[link_to] =>
)
[size] => Array
(
[size] => 2652
[blocks] => 8
[block_size] => 8192
)
[time] => Array
(
[mtime] => 1227685253
[atime] => 1227685138
[ctime] => 1227685253
[accessed] => 2008 Nov Tue 23:38:58
[modified] => 2008 Nov Tue 23:40:53
[created] => 2008 Nov Tue 23:40:53
)
)
03/03/2015 23:27
6 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
(http://uploads.askapache.com/2008/11/danger-chmodscreenshot.png) This shows what each numeric permission does to a REGULAR file. I'll provide the code to do this below so you
can do the same thing on your server.
03/03/2015 23:27
7 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 0
---------chmod 1
---------x
chmod 2
--------wchmod 3
--------wx
chmod 4
-------r-chmod 5
-------r-x
chmod 6
-------rwchmod 7
-------rwx
chmod 10
------x--chmod 11
------x--x
chmod 12
------x-wchmod 13
------x-wx
chmod 14
------xr-chmod 15
------xr-x
chmod 16
------xrwchmod 17
------xrwx
chmod 20
-----w---chmod 21
-----w---x
chmod 22
-----w--wchmod 23
-----w--wx
chmod 24
-----w-r-chmod 25
-----w-r-x
chmod 26
-----w-rwchmod 27
-----w-rwx
chmod 30
-----wx--chmod 31
-----wx--x
chmod 32
-----wx-wchmod 33
-----wx-wx
chmod 34
-----wxr-chmod 35
-----wxr-x
chmod 36
-----wxrwchmod 37
-----wxrwx
chmod 40
----r----chmod 41
----r----x
chmod 42
----r---wchmod 43
----r---wx
03/03/2015 23:27
8 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 44
----r--r-chmod 45
----r--r-x
chmod 46
----r--rwchmod 47
----r--rwx
chmod 50
----r-x--chmod 51
----r-x--x
chmod 52
----r-x-wchmod 53
----r-x-wx
chmod 54
----r-xr-chmod 55
----r-xr-x
chmod 56
----r-xrwchmod 57
----r-xrwx
chmod 60
----rw---chmod 61
----rw---x
chmod 62
----rw--wchmod 63
----rw--wx
chmod 64
----rw-r-chmod 65
----rw-r-x
chmod 66
----rw-rwchmod 67
----rw-rwx
chmod 70
----rwx--chmod 71
----rwx--x
chmod 72
----rwx-wchmod 73
----rwx-wx
chmod 74
----rwxr-chmod 75
----rwxr-x
chmod 76
----rwxrwchmod 77
----rwxrwx
chmod 100
---x-----chmod 101
---x-----x
chmod 102
---x----wchmod 103
---x----wx
chmod 104
---x---r-chmod 105
---x---r-x
chmod 106
---x---rwchmod 107
---x---rwx
03/03/2015 23:27
9 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 110
---x--x--chmod 111
---x--x--x
chmod 112
---x--x-wchmod 113
---x--x-wx
chmod 114
---x--xr-chmod 115
---x--xr-x
chmod 116
---x--xrwchmod 117
---x--xrwx
chmod 120
---x-w---chmod 121
---x-w---x
chmod 122
---x-w--wchmod 123
---x-w--wx
chmod 124
---x-w-r-chmod 125
---x-w-r-x
chmod 126
---x-w-rwchmod 127
---x-w-rwx
chmod 130
---x-wx--chmod 131
---x-wx--x
chmod 132
---x-wx-wchmod 133
---x-wx-wx
chmod 134
---x-wxr-chmod 135
---x-wxr-x
chmod 136
---x-wxrwchmod 137
---x-wxrwx
chmod 140
---xr----chmod 141
---xr----x
chmod 142
---xr---wchmod 143
---xr---wx
chmod 144
---xr--r-chmod 145
---xr--r-x
chmod 146
---xr--rwchmod 147
---xr--rwx
chmod 150
---xr-x--chmod 151
---xr-x--x
chmod 152
---xr-x-wchmod 153
---xr-x-wx
03/03/2015 23:27
10 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 154
---xr-xr-chmod 155
---xr-xr-x
chmod 156
---xr-xrwchmod 157
---xr-xrwx
chmod 160
---xrw---chmod 161
---xrw---x
chmod 162
---xrw--wchmod 163
---xrw--wx
chmod 164
---xrw-r-chmod 165
---xrw-r-x
chmod 166
---xrw-rwchmod 167
---xrw-rwx
chmod 170
---xrwx--chmod 171
---xrwx--x
chmod 172
---xrwx-wchmod 173
---xrwx-wx
chmod 174
---xrwxr-chmod 175
---xrwxr-x
chmod 176
---xrwxrwchmod 177
---xrwxrwx
chmod 200
--w------chmod 201
--w------x
chmod 202
--w-----wchmod 203
--w-----wx
chmod 204
--w----r-chmod 205
--w----r-x
chmod 206
--w----rwchmod 207
--w----rwx
chmod 210
--w---x--chmod 211
--w---x--x
chmod 212
--w---x-wchmod 213
--w---x-wx
chmod 214
--w---xr-chmod 215
--w---xr-x
chmod 216
--w---xrwchmod 217
--w---xrwx
03/03/2015 23:27
11 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 220
--w--w---chmod 221
--w--w---x
chmod 222
--w--w--wchmod 223
--w--w--wx
chmod 224
--w--w-r-chmod 225
--w--w-r-x
chmod 226
--w--w-rwchmod 227
--w--w-rwx
chmod 230
--w--wx--chmod 231
--w--wx--x
chmod 232
--w--wx-wchmod 233
--w--wx-wx
chmod 234
--w--wxr-chmod 235
--w--wxr-x
chmod 236
--w--wxrwchmod 237
--w--wxrwx
chmod 240
--w-r----chmod 241
--w-r----x
chmod 242
--w-r---wchmod 243
--w-r---wx
chmod 244
--w-r--r-chmod 245
--w-r--r-x
chmod 246
--w-r--rwchmod 247
--w-r--rwx
chmod 250
--w-r-x--chmod 251
--w-r-x--x
chmod 252
--w-r-x-wchmod 253
--w-r-x-wx
chmod 254
--w-r-xr-chmod 255
--w-r-xr-x
chmod 256
--w-r-xrwchmod 257
--w-r-xrwx
chmod 260
--w-rw---chmod 261
--w-rw---x
chmod 262
--w-rw--wchmod 263
--w-rw--wx
03/03/2015 23:27
12 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 264
--w-rw-r-chmod 265
--w-rw-r-x
chmod 266
--w-rw-rwchmod 267
--w-rw-rwx
chmod 270
--w-rwx--chmod 271
--w-rwx--x
chmod 272
--w-rwx-wchmod 273
--w-rwx-wx
chmod 274
--w-rwxr-chmod 275
--w-rwxr-x
chmod 276
--w-rwxrwchmod 277
--w-rwxrwx
chmod 300
--wx-----chmod 301
--wx-----x
chmod 302
--wx----wchmod 303
--wx----wx
chmod 304
--wx---r-chmod 305
--wx---r-x
chmod 306
--wx---rwchmod 307
--wx---rwx
chmod 310
--wx--x--chmod 311
--wx--x--x
chmod 312
--wx--x-wchmod 313
--wx--x-wx
chmod 314
--wx--xr-chmod 315
--wx--xr-x
chmod 316
--wx--xrwchmod 317
--wx--xrwx
chmod 320
--wx-w---chmod 321
--wx-w---x
chmod 322
--wx-w--wchmod 323
--wx-w--wx
chmod 324
--wx-w-r-chmod 325
--wx-w-r-x
chmod 326
--wx-w-rwchmod 327
--wx-w-rwx
03/03/2015 23:27
13 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 330
--wx-wx--chmod 331
--wx-wx--x
chmod 332
--wx-wx-wchmod 333
--wx-wx-wx
chmod 334
--wx-wxr-chmod 335
--wx-wxr-x
chmod 336
--wx-wxrwchmod 337
--wx-wxrwx
chmod 340
--wxr----chmod 341
--wxr----x
chmod 342
--wxr---wchmod 343
--wxr---wx
chmod 344
--wxr--r-chmod 345
--wxr--r-x
chmod 346
--wxr--rwchmod 347
--wxr--rwx
chmod 350
--wxr-x--chmod 351
--wxr-x--x
chmod 352
--wxr-x-wchmod 353
--wxr-x-wx
chmod 354
--wxr-xr-chmod 355
--wxr-xr-x
chmod 356
--wxr-xrwchmod 357
--wxr-xrwx
chmod 360
--wxrw---chmod 361
--wxrw---x
chmod 362
--wxrw--wchmod 363
--wxrw--wx
chmod 364
--wxrw-r-chmod 365
--wxrw-r-x
chmod 366
--wxrw-rwchmod 367
--wxrw-rwx
chmod 370
--wxrwx--chmod 371
--wxrwx--x
chmod 372
--wxrwx-wchmod 373
--wxrwx-wx
03/03/2015 23:27
14 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 374
--wxrwxr-chmod 375
--wxrwxr-x
chmod 376
--wxrwxrwchmod 377
--wxrwxrwx
chmod 400
-r-------chmod 401
-r-------x
chmod 402
-r------wchmod 403
-r------wx
chmod 404
-r-----r-chmod 405
-r-----r-x
chmod 406
-r-----rwchmod 407
-r-----rwx
chmod 410
-r----x--chmod 411
-r----x--x
chmod 412
-r----x-wchmod 413
-r----x-wx
chmod 414
-r----xr-chmod 415
-r----xr-x
chmod 416
-r----xrwchmod 417
-r----xrwx
chmod 420
-r---w---chmod 421
-r---w---x
chmod 422
-r---w--wchmod 423
-r---w--wx
chmod 424
-r---w-r-chmod 425
-r---w-r-x
chmod 426
-r---w-rwchmod 427
-r---w-rwx
chmod 430
-r---wx--chmod 431
-r---wx--x
chmod 432
-r---wx-wchmod 433
-r---wx-wx
chmod 434
-r---wxr-chmod 435
-r---wxr-x
chmod 436
-r---wxrwchmod 437
-r---wxrwx
03/03/2015 23:27
15 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 440
-r--r----chmod 441
-r--r----x
chmod 442
-r--r---wchmod 443
-r--r---wx
chmod 444
-r--r--r-chmod 445
-r--r--r-x
chmod 446
-r--r--rwchmod 447
-r--r--rwx
chmod 450
-r--r-x--chmod 451
-r--r-x--x
chmod 452
-r--r-x-wchmod 453
-r--r-x-wx
chmod 454
-r--r-xr-chmod 455
-r--r-xr-x
chmod 456
-r--r-xrwchmod 457
-r--r-xrwx
chmod 460
-r--rw---chmod 461
-r--rw---x
chmod 462
-r--rw--wchmod 463
-r--rw--wx
chmod 464
-r--rw-r-chmod 465
-r--rw-r-x
chmod 466
-r--rw-rwchmod 467
-r--rw-rwx
chmod 470
-r--rwx--chmod 471
-r--rwx--x
chmod 472
-r--rwx-wchmod 473
-r--rwx-wx
chmod 474
-r--rwxr-chmod 475
-r--rwxr-x
chmod 476
-r--rwxrwchmod 477
-r--rwxrwx
chmod 500
-r-x-----chmod 501
-r-x-----x
chmod 502
-r-x----wchmod 503
-r-x----wx
03/03/2015 23:27
16 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 504
-r-x---r-chmod 505
-r-x---r-x
chmod 506
-r-x---rwchmod 507
-r-x---rwx
chmod 510
-r-x--x--chmod 511
-r-x--x--x
chmod 512
-r-x--x-wchmod 513
-r-x--x-wx
chmod 514
-r-x--xr-chmod 515
-r-x--xr-x
chmod 516
-r-x--xrwchmod 517
-r-x--xrwx
chmod 520
-r-x-w---chmod 521
-r-x-w---x
chmod 522
-r-x-w--wchmod 523
-r-x-w--wx
chmod 524
-r-x-w-r-chmod 525
-r-x-w-r-x
chmod 526
-r-x-w-rwchmod 527
-r-x-w-rwx
chmod 530
-r-x-wx--chmod 531
-r-x-wx--x
chmod 532
-r-x-wx-wchmod 533
-r-x-wx-wx
chmod 534
-r-x-wxr-chmod 535
-r-x-wxr-x
chmod 536
-r-x-wxrwchmod 537
-r-x-wxrwx
chmod 540
-r-xr----chmod 541
-r-xr----x
chmod 542
-r-xr---wchmod 543
-r-xr---wx
chmod 544
-r-xr--r-chmod 545
-r-xr--r-x
chmod 546
-r-xr--rwchmod 547
-r-xr--rwx
03/03/2015 23:27
17 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 550
-r-xr-x--chmod 551
-r-xr-x--x
chmod 552
-r-xr-x-wchmod 553
-r-xr-x-wx
chmod 554
-r-xr-xr-chmod 555
-r-xr-xr-x
chmod 556
-r-xr-xrwchmod 557
-r-xr-xrwx
chmod 560
-r-xrw---chmod 561
-r-xrw---x
chmod 562
-r-xrw--wchmod 563
-r-xrw--wx
chmod 564
-r-xrw-r-chmod 565
-r-xrw-r-x
chmod 566
-r-xrw-rwchmod 567
-r-xrw-rwx
chmod 570
-r-xrwx--chmod 571
-r-xrwx--x
chmod 572
-r-xrwx-wchmod 573
-r-xrwx-wx
chmod 574
-r-xrwxr-chmod 575
-r-xrwxr-x
chmod 576
-r-xrwxrwchmod 577
-r-xrwxrwx
chmod 600
-rw------chmod 601
-rw------x
chmod 602
-rw-----wchmod 603
-rw-----wx
chmod 604
-rw----r-chmod 605
-rw----r-x
chmod 606
-rw----rwchmod 607
-rw----rwx
chmod 610
-rw---x--chmod 611
-rw---x--x
chmod 612
-rw---x-wchmod 613
-rw---x-wx
03/03/2015 23:27
18 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 614
-rw---xr-chmod 615
-rw---xr-x
chmod 616
-rw---xrwchmod 617
-rw---xrwx
chmod 620
-rw--w---chmod 621
-rw--w---x
chmod 622
-rw--w--wchmod 623
-rw--w--wx
chmod 624
-rw--w-r-chmod 625
-rw--w-r-x
chmod 626
-rw--w-rwchmod 627
-rw--w-rwx
chmod 630
-rw--wx--chmod 631
-rw--wx--x
chmod 632
-rw--wx-wchmod 633
-rw--wx-wx
chmod 634
-rw--wxr-chmod 635
-rw--wxr-x
chmod 636
-rw--wxrwchmod 637
-rw--wxrwx
chmod 640
-rw-r----chmod 641
-rw-r----x
chmod 642
-rw-r---wchmod 643
-rw-r---wx
chmod 644
-rw-r--r-chmod 645
-rw-r--r-x
chmod 646
-rw-r--rwchmod 647
-rw-r--rwx
chmod 650
-rw-r-x--chmod 651
-rw-r-x--x
chmod 652
-rw-r-x-wchmod 653
-rw-r-x-wx
chmod 654
-rw-r-xr-chmod 655
-rw-r-xr-x
chmod 656
-rw-r-xrwchmod 657
-rw-r-xrwx
03/03/2015 23:27
19 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 660
-rw-rw---chmod 661
-rw-rw---x
chmod 662
-rw-rw--wchmod 663
-rw-rw--wx
chmod 664
-rw-rw-r-chmod 665
-rw-rw-r-x
chmod 666
-rw-rw-rwchmod 667
-rw-rw-rwx
chmod 670
-rw-rwx--chmod 671
-rw-rwx--x
chmod 672
-rw-rwx-wchmod 673
-rw-rwx-wx
chmod 674
-rw-rwxr-chmod 675
-rw-rwxr-x
chmod 676
-rw-rwxrwchmod 677
-rw-rwxrwx
chmod 700
-rwx-----chmod 701
-rwx-----x
chmod 702
-rwx----wchmod 703
-rwx----wx
chmod 704
-rwx---r-chmod 705
-rwx---r-x
chmod 706
-rwx---rwchmod 707
-rwx---rwx
chmod 710
-rwx--x--chmod 711
-rwx--x--x
chmod 712
-rwx--x-wchmod 713
-rwx--x-wx
chmod 714
-rwx--xr-chmod 715
-rwx--xr-x
chmod 716
-rwx--xrwchmod 717
-rwx--xrwx
chmod 720
-rwx-w---chmod 721
-rwx-w---x
chmod 722
-rwx-w--wchmod 723
-rwx-w--wx
03/03/2015 23:27
20 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 724
-rwx-w-r-chmod 725
-rwx-w-r-x
chmod 726
-rwx-w-rwchmod 727
-rwx-w-rwx
chmod 730
-rwx-wx--chmod 731
-rwx-wx--x
chmod 732
-rwx-wx-wchmod 733
-rwx-wx-wx
chmod 734
-rwx-wxr-chmod 735
-rwx-wxr-x
chmod 736
-rwx-wxrwchmod 737
-rwx-wxrwx
chmod 740
-rwxr----chmod 741
-rwxr----x
chmod 742
-rwxr---wchmod 743
-rwxr---wx
chmod 744
-rwxr--r-chmod 745
-rwxr--r-x
chmod 746
-rwxr--rwchmod 747
-rwxr--rwx
chmod 750
-rwxr-x--chmod 751
-rwxr-x--x
chmod 752
-rwxr-x-wchmod 753
-rwxr-x-wx
chmod 754
-rwxr-xr-chmod 755
-rwxr-xr-x
chmod 756
-rwxr-xrwchmod 757
-rwxr-xrwx
chmod 760
-rwxrw---chmod 761
-rwxrw---x
chmod 762
-rwxrw--wchmod 763
-rwxrw--wx
chmod 764
-rwxrw-r-chmod 765
-rwxrw-r-x
chmod 766
-rwxrw-rwchmod 767
-rwxrw-rwx
03/03/2015 23:27
21 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
chmod 770
-rwxrwx--chmod 771
-rwxrwx--x
chmod 772
-rwxrwx-wchmod 773
-rwxrwx-wx
chmod 774
-rwxrwxr-chmod 775
-rwxrwxr-x
chmod 776
-rwxrwxrwchmod 777
-rwxrwxrwx
Congratulations! ^
Here's my custom stat function, which I am definately not finished with, so check back in a couple days and if you find any
improvements please hook me up with a comment!
function askapache_stat( $filename ) {
$p=@fileperms($filename);
$s=@stat($filename);
$str='';
$t=decoct($s['mode'] & 0170000);
switch (octdec($t)) {
case 0140000: $str = 's'; $stat['type']='socket'; break;
case 0120000: $str = 'l'; $stat['type']='link'; break;
case 0100000: $str = '-'; $stat['type']='file'; break;
case 0060000: $str = 'b'; $stat['type']='block'; break;
case 0040000: $str = 'd'; $stat['type']='dir'; break;
case 0020000: $str = 'c'; $stat['type']='char'; break;
case 0010000: $str = 'p'; $stat['type']='fifo'; break;
default: $str = 'u'; $stat['type']='unknown'; break;
}
$stat['type_octal'] = sprintf("%07o", octdec($t));
$str .= (($p&0x0100)?'r':'-').(($p&0x0080)?'w':'-').(($p&0x0040)?(($p&0x0800)?'s':'x'):(($p&0x0800)?'S':
$str .= (($p&0x0020)?'r':'-').(($p&0x0010)?'w':'-').(($p&0x0008)?(($p&0x0400)?'s':'x'):(($p&0x0400)?'S':
$str .= (($p&0x0004)?'r':'-').(($p&0x0002)?'w':'-').(($p&0x0001)?(($p&0x0200)?'t':'x'):(($p&0x0200)?'T':
$stat['default_umask']=sprintf("%04o",umask());
$stat['perm_human']=$str;
$stat['perm_octal1'] = sprintf( "%o", ( $s['mode'] & 00777 ) );
$stat['perm_octal2'] = sprintf("0%o", 0777 & $p);
$stat['perm_dec'] = sprintf("%04o", $p);
$stat['perm_mode']=$s['mode'];
// File mode.
$stat['file'] = @realpath($filename);
$stat['basename'] = basename( $filename );
$stat['user_id'] = $s['uid'];
$stat['group_id'] = $s['gid'];
$stat['device']=$s['dev'];
// Device
$stat['device_number']=$s['rdev'];
// Device number, if device.
$stat['inode']=$s['ino'];
// File serial number
$stat['link_count']=$s['nlink'];
// link count
if($stat['type']=='link')$stat['link_to']=@readlink( $filename );
$stat['size']=$s['size'];
// Size of file, in bytes.
$stat['block_size']=$s['blksize'];
// Optimal block size for I/O.
$stat['blocks']=$s['blocks'];
// Number 512-byte blocks allocated
$stat['time_access']=@date( 'Y M D H:i:s',$s['atime']);
$stat['time_modified']=@date( 'Y M D H:i:s',$s['mtime']);
$stat['time_created']=@date( 'Y M D H:i:s',$s['ctime']);
clearstatcache();
return $stat;
}
header('Content-Type: text/plain');
$stat=askapache_stat(__FILE__);
print_r($stat);
03/03/2015 23:27
22 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
&&
&&
&&
&&
&&
&&
&&
&&
&&
&&
&&
&&
&&
&&
&&
define('S_ISUID',
define('S_ISGID',
define('S_ISVTX',
define('S_IRWXU',
define('S_IRUSR',
define('S_IWUSR',
define('S_IXUSR',
define('S_IRWXG',
define('S_IRGRP',
define('S_IWGRP',
define('S_IXGRP',
define('S_IRWXO',
define('S_IROTH',
define('S_IWOTH',
define('S_IXOTH',
S_IRWXU
S_IRUSR
S_IWUSR
S_IXUSR
00700
00400
00200
00100
S_IRWXG
S_IRGRP
S_IWGRP
S_IXGRP
00070
00040
00020
00010
03/03/2015 23:27
23 di 37
#define
#define
#define
#define
S_IRWXO
S_IROTH
S_IWOTH
S_IXOTH
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
00007
00004
00002
00001
What's a File ^
A file is not merely its contents, a name, and a file type. A file also has an owner (a user ID), a group (a group ID), permissions
(what the owner can do with the file, what people in the group can do, and what everyone else can do), various timestamps, and
other information. Collectively, we call these a file's attributes.
Setting Permissions ^
The basic symbolic operations on a file's permissions are adding, removing, and setting the permission that certain users have to
03/03/2015 23:27
24 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
read, write, and execute or search the file. These operations have the following format:
users operation permissions
The spaces between the three parts above are shown for readability only; symbolic modes cannot contain spaces. The users part
tells which users' access to the file is changed. It consists of one or more of the following letters (or it can be empty). When more
than one of these letters is given, the order that they are in does not matter.
u - the user who owns the file.
g - other users who are in the file's group.
o - all other users.
a - all users; the same as ugo.
The operation part tells how to change the affected users' access to the file, and is one of the following symbols:
+ - to add the permissions to whatever permissions the users already have for the file.
- - to remove the permissions from whatever permissions the users already have for the file.
= - to make the permissions the only permissions that the users have for the file.
The permissions part tells what kind of access to the file should be changed; it is normally zero or more of the following letters. As
with the users part, the order does not matter when more than one letter is given. Omitting the permissions part is useful only with
the = operation, where it gives the specified users no access at all to the file.
r - the permission the users have to read the file.
w - the permission the users have to write to the file.
x - the permission the users have to execute the file, or search it if it is a directory.
For example, to give everyone permission to read and write a regular file, but not to execute it, use:
a=rw
To remove write permission for all users other than the file's owner, use:
go-w
The above command does not affect the access that the owner of the file has to it, nor does it affect whether other users can read
or execute the file.
To give everyone except a file's owner no permission to do anything with that file, use the mode below. Other users could still
remove the file, if they have write permission on the directory it is in.
go=
adds the permissions for users who are in a file's group to the permissions that other users have for the file. Thus, if the file started
out as mode 664 (rw-rw-r--), the above mode would change it to mode 666 (rw-rw-rw-). If the file had started out as mode 741
(rwxr----x), the above mode would change it to mode 745 (rwxr--r-x). The - and = operations work analogously.
03/03/2015 23:27
25 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
Omitting the users part of a symbolic mode is generally not useful with operations other than +. It is useful with + because it allows
you to use umask as an easily customizable protection against giving away more permission to files than you intended to. As an
example, if umask has the value 2, which removes write permission for users who are not in the file's group, then the mode:
+w
adds permission to write to the file to its owner and to other users who are in the file's group, but not to other users. In contrast, the
mode:
a+w
ignores umask, and does give write permission for the file to all users.
If you want to try to set these bits, you must mention them explicitly in the symbolic or numeric modes, e.g.:
# These commands try to set the set-user-ID
# and set-group-ID bits of the subdirectories.
mkdir G H
chmod 6755 G
chmod u=rwx,go=rx,a+s H
mkdir -m 6755 I
mkdir -m u=rwx,go=rx,a+s J
If you want to try to clear these bits, you must mention them explicitly in a symbolic mode, e.g.:
# This command tries to clear the set-user-ID
# and set-group-ID bits of the directory D.
chmod a-s D
Numeric Modes ^
The permissions granted to the user, to other users in the file's group, and to other users not in the file's group each require three
bits, which are represented as one octal digit. The three special mode bits also require one bit each, and they are as a group
represented as another octal digit. Here is how the bits are arranged, starting with the lowest valued bit:
03/03/2015 23:27
26 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
1 Execute/search
2 Write
4 Read
For example, numeric mode 4755 corresponds to symbolic mode u=rwxs,go=rx , and numeric m ode 664 corresponds to
symbolic mode ug=rw,o=r . Numeric mode 0 corresponds to symbolic mode a= .
APR_FPROT_USETID
0x8000 /* Set user id */
APR_FPROT_UREAD
0x0400 /* Read by user */
APR_FPROT_UWRITE
0x0200 /* Write by user */
APR_FPROT_UEXECUTE 0x0100 /* Execute by user */
#define
#define
#define
#define
APR_FPROT_GSETID
0x4000 /* Set group id */
APR_FPROT_GREAD
0x0040 /* Read by group */
APR_FPROT_GWRITE
0x0020 /* Write by group */
APR_FPROT_GEXECUTE 0x0010 /* Execute by group */
#define
#define
#define
#define
#define APR_FPROT_OS_DEFAULT
03/03/2015 23:27
27 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
apr_unix_perms2mode(perms){
mode=0;
if (perms & APR_USETID) mode |= S_ISUID;
if (perms & APR_UREAD) mode |= S_IRUSR;
if (perms & APR_UWRITE) mode |= S_IWUSR;
if (perms & APR_UEXECUTE) mode |= S_IXUSR;
if
if
if
if
(perms
(perms
(perms
(perms
&
&
&
&
(mode
(mode
(mode
(mode
&
&
&
&
APR_USETID;
APR_UREAD;
APR_UWRITE;
APR_UEXECUTE;
S_ISGID)perms
S_IRGRP)perms
S_IWGRP)perms
S_IXGRP)perms
|=
|=
|=
|=
APR_GSETID;
APR_GREAD;
APR_GWRITE;
APR_GEXECUTE;
|=
|=
|=
|=
APR_WSTICKY;
APR_WREAD;
APR_WWRITE;
APR_WEXECUTE;
umask ^
umask(int mask){
arg1;
int oldumask;
int arg_count = ZEND_NUM_ARGS();
oldumask = umask(077);
if (BG(umask) == -1) BG(umask) = oldumask;
if (arg_count == 0) umask(oldumask);
convert_to_long_ex(arg1);
umask(Z_LVAL_PP(arg1));
RETURN_LONG(oldumask);
}
File Attributes ^
Each file will have attributes based on the type of OS.. Using the stat command you can view them.
03/03/2015 23:27
28 di 37
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
%a
%A
%b
%B
%d
%D
%f
%F
%g
%G
%h
%i
%n
%N
%o
%s
%t
%T
%u
%U
%x
%X
%y
%Y
%z
%Z
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
S_IFMT
00170000 /* These bits determine file type. */
S_IFSOCK 0140000 /* Socket file */
S_IFLNK
0120000 /* Symbolic Link */
S_IFREG
0100000 /* Regular file */
S_IFDIR
0040000 /* Directory */
S_IFIFO 0010000
/* FIFO first-in-first-out file */
/* Such devices can be read either a character at a time or a "block" (many characters) at a time,
hence we say there are block special files and character special files. */
#define S_IFBLK
0060000 /* Block device */
#define S_IFCHR 0020000 /* Character device */
*/
S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH)
S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH)
03/03/2015 23:27
29 di 37
filetype_from_mode(mode){
type;
switch (mode & S_IFMT) {
case S_IFREG: type = APR_REG;
case S_IFDIR: type = APR_DIR;
case S_IFLNK: type = APR_LNK;
case S_IFCHR: type = APR_CHR;
case S_IFBLK: type = APR_BLK;
case S_IFFIFO: type = APR_PIPE;
case S_IFSOCK: type = APR_SOCK;
default: type = APR_UNKFILE;
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
break;
break;
break;
break;
break;
break;
break;
}
return type;
}
APR_FINFO_LINK 0x00000001 /* Stat the link not the file itself if it is a link */
APR_FINFO_MTIME 0x00000010 /* Modification Time */
APR_FINFO_CTIME 0x00000020 /* Creation or inode-changed time */
APR_FINFO_ATIME 0x00000040 /* Access Time */
APR_FINFO_SIZE 0x00000100 /* Size of the file */
APR_FINFO_CSIZE 0x00000200 /* Storage size consumed by the file */
APR_FINFO_DEV 0x00001000 /* Device */
APR_FINFO_INODE 0x00002000 /* Inode */
APR_FINFO_NLINK 0x00004000 /* Number of links */
APR_FINFO_TYPE 0x00008000 /* Type */
APR_FINFO_USER 0x00010000 /* User */
APR_FINFO_GROUP 0x00020000 /* Group */
APR_FINFO_UPROT 0x00100000 /* User protection bits */
APR_FINFO_GPROT 0x00200000 /* Group protection bits */
APR_FINFO_WPROT 0x00400000 /* World protection bits */
APR_FINFO_ICASE 0x01000000 /* if dev is case insensitive */
APR_FINFO_NAME 0x02000000 /* name in proper case */
APR_FINFO_MIN 0x00008170 /* type, mtime, ctime, atime, size */
APR_FINFO_IDENT 0x00003000 /* dev and inode */
APR_FINFO_OWNER 0x00030000 /* user and group */
APR_FINFO_PROT 0x00700000 /* all protections */
APR_FINFO_NORM 0x0073b170 /* an atomic unix apr_stat() */
APR_FINFO_DIRENT 0x02000000 /* an atomic unix apr_dir_read() */
03/03/2015 23:27
30 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
Apache Security ^
All your web files that need to be read by Apache should be readable by everyone as Apache itself is run under dhapache user.
However, executable scripts like .php are executed under your own user and do not have to be world readable as they are not
actually read by Apache, but executed via suEXEC(http://en.wikipedia.org/wiki/suEXEC) . Quite the opposite - to prevent your code
or database settings from being messed by any third-parties you SHOULD set permissions to these files explicitly to something like
640 or even 600 depending on who do you trust.
03/03/2015 23:27
31 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
$ chgrp -R aapp_www .
$ chmod 2751 .
$ chmod 2771 rainforce.org
By setting 2771 the directory will be writable by the owner, the group and will be only executable by others. The contents of an
executable only directory cannot be listed, but the files inside it can be read (if the permissions of the file allow it). It is important that
the directory can be executable in order to allow static content (e.g. .html files) inside it to be read. Remember that directories you
don't want anyone to have web access to, should be 0770 (writable by the owner and group, or 0750 writable by the owner and
readable by group). Such strict permissions should by applied to password files, php include files or databases files (such as
SQLite, BDB, etc).
Do the same for rainforce user, but specify aapp group instead.
$ chgrp -R aapp .
$ chmod 2751 .
Optionally modify umask in .bash_profile in user's home to 007 to make all files created by this user have 660 permissions set
by default. If you want that newly created files by accessible by the web, you need to manually setup it's permissions to 664.
Now I can login as the user "rainforce" and update the web-site in the ../rainforce_www/rainforce.org directory. There is one more
setup needed. Because files copied from other accounts can have 644 permissions set instead of 664, you need a script which will
update permissions to 664 or 660 to allow other group members modify such files.
External Links ^
Introduction to Unix file permissions(http://oldfield.wattle.id.au/luv/permissions.html)
Understanding UNIX permission and chmod(http://www.perlfect.com/articles/chmod.shtml)
Original Article from DreamHost Wiki(http://wiki.dreamhost.com/index.php?title=Security)
Content is available under GNU Free Documentation License 1.2(http://www.gnu.org/copyleft/fdl.html) .
/usr/lib/w3m/cgi-bin/dirlist.cgi ^
03/03/2015 23:27
32 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
sub utype {
local($_) = @_;
local(%T) = (
0010000, 'PIPE',
0020000, 'CHR',
0040000, 'DIR',
0060000, 'BLK',
0100000, 'FILE',
0120000, 'LINK',
0140000, 'SOCK',
);
return $T{($_ & 0170000)} || 'FILE';
}
sub umode {
local($_) = @_;
local(%T) = (
0010000, 'p',
0020000, 'c',
0040000, 'd',
0060000, 'b',
0100000, '-',
0120000, 'l',
0140000, 's',
);
return ($T{($_ & 0170000)}
. (($_ & 00400) ? 'r' :
. (($_ & 00200) ? 'w' :
. (($_ & 04000) ? 's' :
(($_ & 00100) ? 'x' :
. (($_ & 00040) ? 'r' :
. (($_ & 00020) ? 'w' :
. (($_ & 02000) ? 's' :
(($_ & 00010) ? 'x' :
. (($_ & 00004) ? 'r' :
. (($_ & 00002) ? 'w' :
. (($_ & 01000) ? 't' :
(($_ & 00001) ? 'x' :
|| '-')
'-')
'-')
'-'))
'-')
'-')
'-'))
'-')
'-')
'-'));
/usr/lib/perl/5.8.4/linux/stat.ph ^
03/03/2015 23:27
33 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
eval
eval
eval
eval
eval
eval
eval
eval
eval
eval
eval
eval
Mozilla-Source 1.8a2(http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.8a2/src/mozilla-source-1.8a2.tar.bz2 )
/* notice that these valuse are octal. */
const PERM_IRWXU = 00700; /* read, write, execute/search by owner */
const PERM_IRUSR = 00400; /* read permission, owner */
const PERM_IWUSR = 00200; /* write permission, owner */
const PERM_IXUSR = 00100; /* execute/search permission, owner */
const PERM_IRWXG = 00070; /* read, write, execute/search by group */
const PERM_IRGRP = 00040; /* read permission, group */
const PERM_IWGRP = 00020; /* write permission, group */
const PERM_IXGRP = 00010; /* execute/search permission, group */
const PERM_IRWXO = 00007; /* read, write, execute/search by others */
const PERM_IROTH = 00004; /* read permission, others */
const PERM_IWOTH = 00002; /* write permission, others */
const PERM_IXOTH = 00001; /* execute/search permission, others */
const
const
const
const
const
const
const
const
MODE_RDONLY
MODE_WRONLY
MODE_RDWR
MODE_CREATE
MODE_APPEND
MODE_TRUNCATE
MODE_SYNC
MODE_EXCL
=
=
=
=
=
=
=
=
0x01;
0x02;
0x04;
0x08;
0x10;
0x20;
0x40;
0x80;
03/03/2015 23:27
34 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
/usr/include/libpng12/png.h ^
/* Transform masks for the high-level interface */
#define PNG_TRANSFORM_IDENTITY
0x0000
/* read and write
#define PNG_TRANSFORM_STRIP_16
0x0001
/* read only */
#define PNG_TRANSFORM_STRIP_ALPHA
0x0002
/* read only */
#define PNG_TRANSFORM_PACKING
0x0004
/* read and write
#define PNG_TRANSFORM_PACKSWAP
0x0008
/* read and write
#define PNG_TRANSFORM_EXPAND
0x0010
/* read only */
#define PNG_TRANSFORM_INVERT_MONO
0x0020
/* read and write
#define PNG_TRANSFORM_SHIFT
0x0040
/* read and write
#define PNG_TRANSFORM_BGR
0x0080
/* read and write
#define PNG_TRANSFORM_SWAP_ALPHA
0x0100
/* read and write
#define PNG_TRANSFORM_SWAP_ENDIAN
0x0200
/* read and write
#define PNG_TRANSFORM_INVERT_ALPHA
0x0400
/* read and write
#define PNG_TRANSFORM_STRIP_FILLER
0x0800
/* WRITE only */
*/
*/
*/
*/
*/
*/
*/
*/
*/
/usr/lib/python2.4/stat.py ^
# Extract bits from the mode
def S_IMODE(mode):
return mode & 07777
def S_IFMT(mode):
return mode & 0170000
# Constants used as S_IFMT() for various file types
# (not all are implemented on all systems)
S_IFDIR
S_IFCHR
S_IFBLK
S_IFREG
S_IFIFO
S_IFLNK
S_IFSOCK
=
=
=
=
=
=
=
0040000
0020000
0060000
0100000
0010000
0120000
0140000
03/03/2015 23:27
35 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
/usr/include/bits/stat.h ^
/* Encoding of the file mode.
*/
#define __S_IFMT
/* File
#define
#define
#define
#define
#define
#define
#define
0040000
0020000
0060000
0100000
0010000
0120000
0140000
types. */
__S_IFDIR
__S_IFCHR
__S_IFBLK
__S_IFREG
__S_IFIFO
__S_IFLNK
__S_IFSOCK
__S_ISUID
__S_ISGID
__S_ISVTX
__S_IREAD
__S_IWRITE
__S_IEXEC
/*
/*
/*
/*
/*
/*
/*
*/
Directory. */
Character device. */
Block device. */
Regular file. */
FIFO. */
Symbolic link. */
Socket. */
But
*/
04000
02000
01000
0400
0200
0100
/*
/*
/*
/*
/*
/*
*/
/usr/include/linux/nfs.h ^
#define
#define
#define
#define
#define
#define
#define
#define
#define
NFS_FIFO_DEV
NFSMODE_FMT
NFSMODE_DIR
NFSMODE_CHR
NFSMODE_BLK
NFSMODE_REG
NFSMODE_LNK
NFSMODE_SOCK
NFSMODE_FIFO
(-1)
0170000
0040000
0020000
0060000
0100000
0120000
0140000
0010000
/usr/include/linux/nfs3.h ^
#define
#define
#define
#define
#define
#define
#define
#define
#define
NFS3_FIFO_DEV
NFS3MODE_FMT
NFS3MODE_DIR
NFS3MODE_CHR
NFS3MODE_BLK
NFS3MODE_REG
NFS3MODE_LNK
NFS3MODE_SOCK
NFS3MODE_FIFO
(-1)
0170000
0040000
0020000
0060000
0100000
0120000
0140000
0010000
0x0001
0x0002
0x0004
0x0008
0x0010
0x0020
0x003f
/usr/include/linux/stat.h ^
03/03/2015 23:27
36 di 37
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
S_IFMT 00170000
S_IFSOCK 0140000
S_IFLNK 0120000
S_IFREG 0100000
S_IFBLK 0060000
S_IFDIR 0040000
S_IFCHR 0020000
S_IFIFO 0010000
S_ISUID 0004000
S_ISGID 0002000
S_ISVTX 0001000
#define
#define
#define
#define
#define
#define
#define
S_ISLNK(m)
S_ISREG(m)
S_ISDIR(m)
S_ISCHR(m)
S_ISBLK(m)
S_ISFIFO(m)
S_ISSOCK(m)
#define
#define
#define
#define
S_IRWXU
S_IRUSR
S_IWUSR
S_IXUSR
00700
00400
00200
00100
#define
#define
#define
#define
S_IRWXG
S_IRGRP
S_IWGRP
S_IXGRP
00070
00040
00020
00010
#define
#define
#define
#define
S_IRWXO
S_IROTH
S_IWOTH
S_IXOTH
00007
00004
00002
00001
(((m)
(((m)
(((m)
(((m)
(((m)
(((m)
(((m)
&
&
&
&
&
&
&
S_IFMT)
S_IFMT)
S_IFMT)
S_IFMT)
S_IFMT)
S_IFMT)
S_IFMT)
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
==
==
==
==
==
==
==
S_IFLNK)
S_IFREG)
S_IFDIR)
S_IFCHR)
S_IFBLK)
S_IFIFO)
S_IFSOCK)
03/03/2015 23:27
37 di 37
http://www.askapache.com/security/chmod-stat.html#chmod-0-to-7777
Tags ^
chmod File Permissions umask
February 17th, 2012
Easy boot.ini Hacks for Windows SysOpsMod_Rewrite Security
Comments Welcome ^
[hide]
It's very simple - you read the protocol and write the code. -Bill Joy
RSS(http://feedvalidator.org/check.cgi?url=http://www.askapache.com/feed/) | XHTML 1.1(http://validator.w3.org/check
/referer?ss=1;outline=1;sp=1;debug) | CSS 2.1(http://jigsaw.w3.org/css-validator/check/referer?warning=0)
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0
License(http://creativecommons.org/licenses/by/3.0/) , just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by
The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd(http://hoohoo.ncsa.illinois.edu/) .
UNIX is a registered Trademark of The Open Group(http://www.opengroup.org/) . POSIX is a registered Trademark of The
IEEE(http://standards.ieee.org/) .
+Askapache(https://plus.google.com/+Askapache) | askapache(http://profiles.wordpress.org/askapache)
Site Map | Contact Webmaster | License and Disclaimer | Terms of Service
Main(http://www.quantcast.com/p-5e44cjdXWaqOA) (http://www.alexa.com/data/details/main/www.askapache.com)
03/03/2015 23:27