mod_authz_owner.xml revision 5f5d1b4cc970b7f06ff8ef6526128e9a27303d88
654734c34540d66c4550b856dd1a278779b34138nd<?xml version="1.0"?>
654734c34540d66c4550b856dd1a278779b34138nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
654734c34540d66c4550b856dd1a278779b34138nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<!--
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd Copyright 2003-2004 The Apache Software Foundation
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Licensed under the Apache License, Version 2.0 (the "License");
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd you may not use this file except in compliance with the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd http://www.apache.org/licenses/LICENSE-2.0
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd-->
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
7db9f691a00ead175b03335457ca296a33ddf31bnd<modulesynopsis metafile="mod_authz_owner.xml.meta">
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd<name>mod_authz_owner</name>
654734c34540d66c4550b856dd1a278779b34138nd<description>Authorization based on file ownership</description>
654734c34540d66c4550b856dd1a278779b34138nd<status>Extension</status>
654734c34540d66c4550b856dd1a278779b34138nd<sourcefile>mod_authz_owner.c</sourcefile>
654734c34540d66c4550b856dd1a278779b34138nd<identifier>authz_owner_module</identifier>
654734c34540d66c4550b856dd1a278779b34138nd<compatibility>Available in Apache 2.1 and later</compatibility>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd<summary>
654734c34540d66c4550b856dd1a278779b34138nd <p>This module authorizes access to files by comparing the userid used
654734c34540d66c4550b856dd1a278779b34138nd for HTTP authentication (the web userid) with the file-system owner or
654734c34540d66c4550b856dd1a278779b34138nd group of the requested file. The supplied username and password
654734c34540d66c4550b856dd1a278779b34138nd must be already properly verified by an authentication module,
654734c34540d66c4550b856dd1a278779b34138nd such as <module>mod_auth_basic</module> or
654734c34540d66c4550b856dd1a278779b34138nd <module>mod_auth_digest</module>. <module>mod_authz_owner</module>
654734c34540d66c4550b856dd1a278779b34138nd recognizes two arguments for the <directive module="core"
654734c34540d66c4550b856dd1a278779b34138nd >Require</directive> directive, <code>file-owner</code> and
654734c34540d66c4550b856dd1a278779b34138nd <code>file-group</code>, as follows:</p>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <dl>
654734c34540d66c4550b856dd1a278779b34138nd <dt><code>file-owner</code></dt>
654734c34540d66c4550b856dd1a278779b34138nd <dd>The supplied web-username must match the system's name for the
654734c34540d66c4550b856dd1a278779b34138nd owner of the file being requested. That is, if the operating system
654734c34540d66c4550b856dd1a278779b34138nd says the requested file is owned by <code>jones</code>, then the
654734c34540d66c4550b856dd1a278779b34138nd username used to access it through the web must be <code>jones</code>
654734c34540d66c4550b856dd1a278779b34138nd as well.</dd>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <dt><code>file-group</code></dt>
654734c34540d66c4550b856dd1a278779b34138nd <dd>The name of the system group that owns the file must be present
654734c34540d66c4550b856dd1a278779b34138nd in a group database, which is provided, for example, by <module
654734c34540d66c4550b856dd1a278779b34138nd >mod_authz_groupfile</module> or <module>mod_authz_dbm</module>,
654734c34540d66c4550b856dd1a278779b34138nd and the web-username must be a member of that group. For example, if
654734c34540d66c4550b856dd1a278779b34138nd the operating system says the requested file is owned by (system)
654734c34540d66c4550b856dd1a278779b34138nd group <code>accounts</code>, the group <code>accounts</code> must
654734c34540d66c4550b856dd1a278779b34138nd appear in the group database and the web-username used in the request
654734c34540d66c4550b856dd1a278779b34138nd must be a member of that group.</dd>
654734c34540d66c4550b856dd1a278779b34138nd </dl>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <note><title>Note</title>
654734c34540d66c4550b856dd1a278779b34138nd <p>If <module>mod_authz_owner</module> is used in order to authorize
654734c34540d66c4550b856dd1a278779b34138nd a resource that is not actually present in the filesystem
654734c34540d66c4550b856dd1a278779b34138nd (<em>i.e.</em> a virtual resource), it will deny the access.</p>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <p>Particularly it will never authorize <a
654734c34540d66c4550b856dd1a278779b34138nd href="/content-negotiation.html#multiviews">content negotiated
654734c34540d66c4550b856dd1a278779b34138nd "MultiViews"</a> resources.</p>
654734c34540d66c4550b856dd1a278779b34138nd </note>
654734c34540d66c4550b856dd1a278779b34138nd</summary>
654734c34540d66c4550b856dd1a278779b34138nd<seealso><directive module="core">Require</directive></seealso>
654734c34540d66c4550b856dd1a278779b34138nd<seealso><directive module="core">Satisfy</directive></seealso>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd<section id="examples"><title>Configuration Examples</title>
654734c34540d66c4550b856dd1a278779b34138nd
67c026fea89b4faf173772b5944b6aa006ca6eb0nd <section id="examples.file-owner"><title>Require file-owner</title>
654734c34540d66c4550b856dd1a278779b34138nd <p>Consider a multi-user system running the Apache Web server, with
654734c34540d66c4550b856dd1a278779b34138nd each user having his or her own files in <code
654734c34540d66c4550b856dd1a278779b34138nd >~/public_html/private</code>. Assuming that there is a single
654734c34540d66c4550b856dd1a278779b34138nd <directive module="mod_authn_dbm">AuthDBMUserFile</directive> database
654734c34540d66c4550b856dd1a278779b34138nd that lists all of their web-usernames, and that these usernames match
654734c34540d66c4550b856dd1a278779b34138nd the system's usernames that actually own the files on the server, then
654734c34540d66c4550b856dd1a278779b34138nd the following stanza would allow only the user himself access to his
654734c34540d66c4550b856dd1a278779b34138nd own files. User <code>jones</code> would not be allowed to access
654734c34540d66c4550b856dd1a278779b34138nd files in <code>/home/smith/public_html/private</code> unless they
654734c34540d66c4550b856dd1a278779b34138nd were owned by <code>jones</code> instead of <code>smith</code>.</p>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <example>
654734c34540d66c4550b856dd1a278779b34138nd &lt;Directory /home/*/public_html/private&gt;<br />
654734c34540d66c4550b856dd1a278779b34138nd <indent>
654734c34540d66c4550b856dd1a278779b34138nd AuthType Basic<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthName MyPrivateFiles<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthBasicProvider dbm<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthDBMUserFile /usr/local/apache2/etc/.htdbm-all<br />
654734c34540d66c4550b856dd1a278779b34138nd Satisfy All<br />
654734c34540d66c4550b856dd1a278779b34138nd Require file-owner<br />
654734c34540d66c4550b856dd1a278779b34138nd </indent>
654734c34540d66c4550b856dd1a278779b34138nd &lt;/Directory&gt;
654734c34540d66c4550b856dd1a278779b34138nd </example>
654734c34540d66c4550b856dd1a278779b34138nd </section>
654734c34540d66c4550b856dd1a278779b34138nd
67c026fea89b4faf173772b5944b6aa006ca6eb0nd <section id="examples.file-group"><title>Require file-group</title>
654734c34540d66c4550b856dd1a278779b34138nd <p>Consider a system similar to the one described above, but with
654734c34540d66c4550b856dd1a278779b34138nd some users that share their project files in
654734c34540d66c4550b856dd1a278779b34138nd <code>~/public_html/project-foo</code>. The files are owned by the
654734c34540d66c4550b856dd1a278779b34138nd system group <code>foo</code> and there is a single <directive
654734c34540d66c4550b856dd1a278779b34138nd module="mod_authz_dbm">AuthDBMGroupFile</directive> database that
654734c34540d66c4550b856dd1a278779b34138nd contains all of the web-usernames and their group membership,
654734c34540d66c4550b856dd1a278779b34138nd <em>i.e.</em> they must be at least member of a group named
654734c34540d66c4550b856dd1a278779b34138nd <code>foo</code>. So if <code>jones</code> and <code>smith</code>
654734c34540d66c4550b856dd1a278779b34138nd are both member of the group <code>foo</code>, then both will be
654734c34540d66c4550b856dd1a278779b34138nd authorized to access the <code>project-foo</code> directories of
654734c34540d66c4550b856dd1a278779b34138nd each other.</p>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <example>
654734c34540d66c4550b856dd1a278779b34138nd &lt;Directory /home/*/public_html/project-foo&gt;<br />
654734c34540d66c4550b856dd1a278779b34138nd <indent>
654734c34540d66c4550b856dd1a278779b34138nd AuthType Basic<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthName "Project Foo Files"<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthBasicProvider dbm<br />
654734c34540d66c4550b856dd1a278779b34138nd <br />
654734c34540d66c4550b856dd1a278779b34138nd # combined user/group database<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthDBMUserFile /usr/local/apache2/etc/.htdbm-all<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthDBMGroupFile /usr/local/apache2/etc/.htdbm-all<br />
654734c34540d66c4550b856dd1a278779b34138nd <br />
654734c34540d66c4550b856dd1a278779b34138nd Satisfy All<br />
654734c34540d66c4550b856dd1a278779b34138nd Require file-group<br />
654734c34540d66c4550b856dd1a278779b34138nd </indent>
654734c34540d66c4550b856dd1a278779b34138nd &lt;/Directory&gt;
654734c34540d66c4550b856dd1a278779b34138nd </example>
654734c34540d66c4550b856dd1a278779b34138nd </section>
654734c34540d66c4550b856dd1a278779b34138nd</section>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd<directivesynopsis>
654734c34540d66c4550b856dd1a278779b34138nd<name>AuthzOwnerAuthoritative</name>
654734c34540d66c4550b856dd1a278779b34138nd<description>Sets whether authorization will be passed on to lower level
654734c34540d66c4550b856dd1a278779b34138ndmodules</description>
654734c34540d66c4550b856dd1a278779b34138nd<syntax>AuthzOwnerAuthoritative On|Off</syntax>
654734c34540d66c4550b856dd1a278779b34138nd<default>AuthzOwnerAuthoritative On</default>
654734c34540d66c4550b856dd1a278779b34138nd<contextlist><context>directory</context><context>.htaccess</context>
654734c34540d66c4550b856dd1a278779b34138nd</contextlist>
654734c34540d66c4550b856dd1a278779b34138nd<override>AuthConfig</override>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd<usage>
654734c34540d66c4550b856dd1a278779b34138nd <p>Setting the <directive>AuthzOwnerAuthoritative</directive>
654734c34540d66c4550b856dd1a278779b34138nd directive explicitly to <code>Off</code> allows for
654734c34540d66c4550b856dd1a278779b34138nd user authorization to be passed on to lower level modules (as defined
654734c34540d66c4550b856dd1a278779b34138nd in the <code>modules.c</code> files) if:</p>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <ul>
654734c34540d66c4550b856dd1a278779b34138nd <li>in the case of <code>file-owner</code> the file-system owner does not
654734c34540d66c4550b856dd1a278779b34138nd match the supplied web-username or could not be determined, or</li>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <li>in the case of <code>file-group</code> the file-system group does not
654734c34540d66c4550b856dd1a278779b34138nd contain the supplied web-username or could not be determined.</li>
654734c34540d66c4550b856dd1a278779b34138nd </ul>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <p>Note that setting the value to <code>Off</code> also allows the
654734c34540d66c4550b856dd1a278779b34138nd combination of <code>file-owner</code> and <code>file-group</code>, so
654734c34540d66c4550b856dd1a278779b34138nd access will be allowed if either one or the other (or both) match.</p>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd <p>By default, control is not passed on and an authorization failure
654734c34540d66c4550b856dd1a278779b34138nd will result in an "Authentication Required" reply. Not
654734c34540d66c4550b856dd1a278779b34138nd setting it to <code>Off</code> thus keeps the system secure and forces
654734c34540d66c4550b856dd1a278779b34138nd an NCSA compliant behaviour.</p>
654734c34540d66c4550b856dd1a278779b34138nd</usage>
654734c34540d66c4550b856dd1a278779b34138nd</directivesynopsis>
654734c34540d66c4550b856dd1a278779b34138nd
654734c34540d66c4550b856dd1a278779b34138nd</modulesynopsis>