mod_authz_owner.xml revision d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacd
654734c34540d66c4550b856dd1a278779b34138nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
654734c34540d66c4550b856dd1a278779b34138nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Copyright 2003-2004 Apache Software Foundation
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 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.
654734c34540d66c4550b856dd1a278779b34138nd<description>Authorization based on file ownership</description>
654734c34540d66c4550b856dd1a278779b34138nd<compatibility>Available in Apache 2.1 and later</compatibility>
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 <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 <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 <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 <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 href="/content-negotiation.html#multiviews">content negotiated
654734c34540d66c4550b856dd1a278779b34138nd<seealso><directive module="core">Require</directive></seealso>
654734c34540d66c4550b856dd1a278779b34138nd<seealso><directive module="core">Satisfy</directive></seealso>
654734c34540d66c4550b856dd1a278779b34138nd<section id="examples"><title>Configuration Examples</title>
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 AuthType Basic<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthName MyPrivateFiles<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthBasicProvider dbm<br />
654734c34540d66c4550b856dd1a278779b34138nd Satisfy All<br />
654734c34540d66c4550b856dd1a278779b34138nd Require file-owner<br />
654734c34540d66c4550b856dd1a278779b34138nd </Directory>
654734c34540d66c4550b856dd1a278779b34138nd </example>
654734c34540d66c4550b856dd1a278779b34138nd </section>
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 AuthType Basic<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthName "Project Foo Files"<br />
654734c34540d66c4550b856dd1a278779b34138nd AuthBasicProvider dbm<br />
654734c34540d66c4550b856dd1a278779b34138nd Satisfy All<br />
654734c34540d66c4550b856dd1a278779b34138nd Require file-group<br />
654734c34540d66c4550b856dd1a278779b34138nd </Directory>
654734c34540d66c4550b856dd1a278779b34138nd </example>
654734c34540d66c4550b856dd1a278779b34138nd </section>
654734c34540d66c4550b856dd1a278779b34138nd<directivesynopsis>
654734c34540d66c4550b856dd1a278779b34138nd<description>Sets whether authorization will be passed on to lower level
654734c34540d66c4550b856dd1a278779b34138ndmodules</description>
654734c34540d66c4550b856dd1a278779b34138nd<contextlist><context>directory</context><context>.htaccess</context>
654734c34540d66c4550b856dd1a278779b34138nd</contextlist>
654734c34540d66c4550b856dd1a278779b34138nd <p>Setting the <directive>AuthzOwnerAuthoritative</directive>
654734c34540d66c4550b856dd1a278779b34138nd user authorization to be passed on to lower level modules (as defined
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 <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 <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 <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</directivesynopsis>
654734c34540d66c4550b856dd1a278779b34138nd</modulesynopsis>