security/filesystem.xml
c5d92fd7127e059d448d43ba339f19956f83b05a
...
...
@@ -1,10 +1,10 @@
1
-
<?xml version="1.0" encoding="iso-8859-1"?>
2
-
<!-- $Revision: 1.7 $ -->
1
+
<?xml version="1.0" encoding="utf-8"?>
2
+
<!-- $Revision$ -->
3
3
<!-- splitted from ./index.xml, last change in rev 1.66 -->
4
4
<chapter xml:id="security.filesystem" xmlns="http://docbook.org/ns/docbook">
5
5
<title>Filesystem Security</title>
6
6
<simpara>
7
-
PHP is subject to the security built into most server systems with
7
+
<acronym>PHP</acronym> is subject to the security built into most server systems with
8
8
respect to permissions on a file and directory basis. This allows
9
9
you to control which files in the filesystem may be read. Care
10
10
should be taken with any files which are world readable to ensure
...
...
@@ -12,8 +12,8 @@
12
12
filesystem.
13
13
</simpara>
14
14
<simpara>
15
-
Since PHP was designed to allow user level access to the filesystem,
16
-
it's entirely possible to write a PHP script that will allow you
15
+
Since <acronym>PHP</acronym> was designed to allow user level access to the filesystem,
16
+
it's entirely possible to write a <acronym>PHP</acronym> script that will allow you
17
17
to read system files such as /etc/passwd, modify your ethernet
18
18
connections, send massive printer jobs out, etc. This has some
19
19
obvious implications, in that you need to ensure that the files
...
...
@@ -22,7 +22,7 @@
22
22
<simpara>
23
23
Consider the following script, where a user indicates that they'd
24
24
like to delete a file in their home directory. This assumes a
25
-
situation where a PHP web interface is regularly used for file
25
+
situation where a <acronym>PHP</acronym> web interface is regularly used for file
26
26
management, so the Apache user is allowed to delete files in
27
27
the user home directories.
28
28
</simpara>
...
...
@@ -73,7 +73,7 @@ echo "The file has been deleted!";
73
73
<itemizedlist>
74
74
<listitem>
75
75
<simpara>
76
-
Only allow limited permissions to the PHP web user binary.
76
+
Only allow limited permissions to the <acronym>PHP</acronym> web user binary.
77
77
</simpara>
78
78
</listitem>
79
79
<listitem>
...
...
@@ -90,7 +90,7 @@ echo "The file has been deleted!";
90
90
<?php
91
91
// removes a file from the hard drive that
92
92
// the PHP user has access to.
93
-
$username = $_SERVER['REMOTE_USER']; // using an authentication mechanisim
93
+
$username = $_SERVER['REMOTE_USER']; // using an authentication mechanism
94
94
$userfile = basename($_POST['user_submitted_filename']);
95
95
$homedir = "/home/$username";
96
96

...
...
@@ -147,7 +147,7 @@ if (!ctype_alnum($username) || !preg_match('/^(?:[a-z0-9_-]|\.(?!\.))+$/iD', $us
147
147
<sect1 xml:id="security.filesystem.nullbytes">
148
148
<title>Null bytes related issues</title>
149
149
<simpara>
150
-
As PHP uses the underlying C functions for filesystem related
150
+
As <acronym>PHP</acronym> uses the underlying C functions for filesystem related
151
151
operations, it may handle null bytes in a quite unexpected way.
152
152
As null bytes denote the end of a string in C, strings containing them
153
153
won't be considered entirely but rather only until a null byte occurs.
...
...
@@ -209,7 +209,7 @@ sgml-indent-step:1
209
209
sgml-indent-data:t
210
210
indent-tabs-mode:nil
211
211
sgml-parent-document:nil
212
-
sgml-default-dtd-file:"../../manual.ced"
212
+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
213
213
sgml-exposed-tags:nil
214
214
sgml-local-catalogs:nil
215
215
sgml-local-ecat-files:nil
216
216