(root)/
Linux-PAM-1.5.3/
modules/
pam_setquota/
pam_setquota.8.xml
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="pam_setquota">

  <refmeta>
    <refentrytitle>pam_setquota</refentrytitle>
    <manvolnum>8</manvolnum>
    <refmiscinfo class="source">Linux-PAM</refmiscinfo>
    <refmiscinfo class="manual">Linux-PAM Manual</refmiscinfo>
  </refmeta>

  <refnamediv xml:id="pam_setquota-name">
    <refname>pam_setquota</refname>
    <refpurpose>PAM module to set or modify disk quotas on session start</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis xml:id="pam_setquota-cmdsynopsis" sepchar=" ">
      <command>pam_setquota.so</command>
       <arg choice="opt" rep="norepeat">
        fs=<replaceable>/home</replaceable>
      </arg>
      <arg choice="opt" rep="norepeat">
        overwrite=<replaceable>0</replaceable>
      </arg>
      <arg choice="opt" rep="norepeat">
        debug=<replaceable>0</replaceable>
      </arg>
      <arg choice="opt" rep="norepeat">
        startuid=<replaceable>1000</replaceable>
      </arg>
       <arg choice="opt" rep="norepeat">
        enduid=<replaceable>0</replaceable>
      </arg>
       <arg choice="opt" rep="norepeat">
        bsoftlimit=<replaceable>19000</replaceable>
      </arg>
       <arg choice="opt" rep="norepeat">
        bhardlimit=<replaceable>20000</replaceable>
      </arg>
       <arg choice="opt" rep="norepeat">
        isoftlimit=<replaceable>3000</replaceable>
      </arg>
       <arg choice="opt" rep="norepeat">
        ihardlimit=<replaceable>4000</replaceable>
      </arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 xml:id="pam_setquota-description">

    <title>DESCRIPTION</title>

    <para>
      pam_setquota is a PAM module to set or modify a disk quota at session start
    </para>
    <para>
      This makes quotas usable with central user databases, such as MySQL or LDAP.
    </para>

  </refsect1>

  <refsect1 xml:id="pam_setquota-options">

    <title>OPTIONS</title>
    <para>
      <variablelist>
        <varlistentry>
          <term>
            fs=/home
          </term>
          <listitem>
            <para>
             The device file or mountpoint the policy applies to. Defaults to the
             filesystem containing the users home directory.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            overwrite=0
          </term>
          <listitem>
            <para>
             Overwrite an existing quota. Note: Enabling this will remove the ability
             for the admin to manually configure different quotas for users for a
             filesystem with <citerefentry><refentrytitle>edquota</refentrytitle>
             <manvolnum>8</manvolnum></citerefentry>. (Defaults to 0)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            debug=0
          </term>
          <listitem>
            <para>
             Enable debugging. A value of 1 outputs the old and new quota on a device.
             A value of 2 also prints out the matched and found filesystems should
             <option>fs</option> be unset. (Defaults to 0)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            startuid=1000
          </term>
          <listitem>
            <para>
             Describe the start of the UID range the policy is applied to.
             (Defaults to UID_MIN from login.defs or the uidmin value defined
             at compile-time if UID_MIN is undefined.)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            enduid=0
          </term>
          <listitem>
            <para>
             Describe the end of the UID range the policy is applied to. Setting
             <emphasis>enduid=0</emphasis> results in an open-ended UID
             range (i.e. all uids greater than <option>startuid</option> are
             included). (Defaults to 0)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            bsoftlimit=19000
          </term>
          <listitem>
            <para>
              Soft limit for disk quota blocks, as defined by <citerefentry>
              <refentrytitle>quotactl</refentrytitle><manvolnum>2</manvolnum>
              </citerefentry>.
              Note: <option>bsoftlimit</option> and <option>bhardlimit</option>
              <emphasis>must</emphasis> be set at the same time!
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            bhardlimit=20000
          </term>
          <listitem>
            <para>
              Hard limit for disk quota blocks, as defined by <citerefentry>
              <refentrytitle>quotactl</refentrytitle><manvolnum>2</manvolnum>
              </citerefentry>.
              Note: <option>bsoftlimit</option> and <option>bhardlimit</option>
              <emphasis>must</emphasis> be set at the same time!
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            isoftlimit=3000
          </term>
          <listitem>
            <para>
              Soft limit for inodes, as defined by <citerefentry><refentrytitle>
              quotactl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
              Note: <option>isoftlimit</option> and <option>ihardlimit</option>
              <emphasis>must</emphasis> be set at the same time!
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            ihardlimit=4000
          </term>
          <listitem>
            <para>
              Hard limit for inodes, as defined by <citerefentry><refentrytitle>
              quotactl</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
              Note: <option>isoftlimit</option> and <option>ihardlimit</option>
              <emphasis>must</emphasis> be set at the same time!
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </para>
  </refsect1>

  <refsect1 xml:id="pam_setquota-types">
    <title>MODULE TYPES PROVIDED</title>
    <para>
       Only the <option>session</option> module type is provided.
    </para>
  </refsect1>

  <refsect1 xml:id="pam_setquota-return_values">
    <title>RETURN VALUES</title>
    <para>
      <variablelist>

        <varlistentry>
          <term>PAM_SUCCESS</term>
          <listitem>
            <para>
              The quota was set successfully.
            </para>
          </listitem>
        </varlistentry>

	<varlistentry>
          <term>PAM_IGNORE</term>
          <listitem>
            <para>
              No action was taken because either the UID of the user was outside
              of the specified range, a quota already existed and
              <option>overwrite=1</option> was not configured or no limits were
              configured at all.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>PAM_USER_UNKNOWN</term>
          <listitem>
            <para>
              The user was not found.
            </para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term>PAM_PERM_DENIED</term>
          <listitem>
            <para>
               <filename>/proc/mounts</filename> could not be opened.
            </para>
            <para>
               The filesystem or device specified was not found.
            </para>
            <para>
               The limits for the user could not be retrieved. See syslog for
               more information.
            </para>
            <para>
               The limits for the user could not be set. See syslog for
               more information.
            </para>
            <para>
               Either <option>isoftlimit</option>/<option>ihardlimit</option>
               or <option>bsoftlimit</option>/<option>bhardlimit</option> were
               not set at the same time.
            </para>
          </listitem>
        </varlistentry>

      </variablelist>
    </para>
  </refsect1>

  <refsect1 xml:id="pam_setquota-examples">
    <title>EXAMPLES</title>
    <para>
    A single invocation of `pam_setquota` applies a specific policy to a UID
    range. Applying different policies to specific UID ranges is done by
    invoking pam_setquota more than once. The last matching entry
    defines the resulting quota.
    <programlisting>
      session  required   pam_setquota.so bsoftlimit=1000 bhardlimit=2000 isoftlimit=1000 ihardlimit=2000 startuid=1000 enduid=0 fs=/home
      session  required   pam_setquota.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=2001 enduid=3000 fs=/dev/sda1
      session  required   pam_setquota.so bsoftlimit=19000 bhardlimit=20000 isoftlimit=3000 ihardlimit=4000 startuid=3001 enduid=4000 fs=/dev/sda1 overwrite=1
    </programlisting>
    </para>
  </refsect1>

  <refsect1 xml:id="pam_setquota-see_also">
    <title>SEE ALSO</title>
    <para>
      <citerefentry>
        <refentrytitle>pam.conf</refentrytitle><manvolnum>5</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>pam.d</refentrytitle><manvolnum>5</manvolnum>
      </citerefentry>,
      <citerefentry>
        <refentrytitle>pam</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>
    </para>
  </refsect1>

  <refsect1 xml:id="pam_setquota-author">
    <title>AUTHOR</title>
      <para>
       pam_setquota was originally written by
       Ruslan Savchenko &lt;savrus@mexmat.net&gt;.
      </para>
      <para>
       Further modifications were made by Shane Tzen &lt;shane@ict.usc.edu&gt;,
       Sven Hartge &lt;sven@svenhartge.de&gt;
       and Keller Fuchs &lt;kellerfuchs@hashbang.sh&gt;.
      </para>
  </refsect1>

</refentry>