From tytso@MIT.EDU  Tue Jan 16 12:27:33 1996
Return-Path: tytso@MIT.EDU
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by redhat.com (8.6.12/8.6.12) with SMTP id MAA03018 for <marc@redhat.com>; Tue, 16 Jan 1996 12:27:32 -0500
Received: from DCL.MIT.EDU by MIT.EDU with SMTP
	id AA10150; Tue, 16 Jan 96 12:26:54 EST
Received: by dcl.MIT.EDU (5.0/4.7) id AA19900; Tue, 16 Jan 1996 12:27:02 -0500
Date: Tue, 16 Jan 1996 12:27:02 -0500
From: "Theodore Ts'o" <tytso@MIT.EDU>
Message-Id: <9601161727.AA19900@dcl.MIT.EDU>
To: Volker Elling <elling@stud.fh-heilbronn.de>
Cc: linux-pam@MIT.EDU
In-Reply-To: Volker Elling's message of Tue, 16 Jan 1996 18:06:34 +0100 (MET),
	<Pine.LNX.3.91.960116175855.21527B-100000@lem.stud.fh-heilbronn.de>
Subject: Re: Semantics of "optional"
Address: 1 Amherst St., Cambridge, MA 02139
Phone: (617) 253-8091
Content-Length: 1630

To quote from the PAM DCE:

        (a) `required': With this flag, the module failure results in the
            PAM framework returning the error to the caller _after_
            executing all other modules on the stack.  For the function to
            be able to return success to the application all `required'
            modules have to report success.  This flag is normally set when
            authentication by this module is a _must_.

        (b) `optional': With this flag, the PAM framework ignores the
            module failure and continues with the processing of the next
            module in sequence.  This flag is used when the user is allowed
            to login even if that particular module has failed.

        (c) `sufficient': With this flag, if the module succeeds the PAM
            framework returns success to the application immediately
            without trying any other modules.  For failure cases, the
            _sufficient_ modules are treated as `optional'.

In other words, "required", "optional", and "sufficient" determine how
the PAM library should handle module success and failures.  Remember,
the order of modules in /etc/pam.conf is important.  The PAM library
follows these rules:

If the module has a    ... then on module	... then on the module
control flag of ...    returning SUCCESS	returning FAILURE
		
... Required		CONTINUE		return FAILURE

... Optional		CONTINUE		CONTINUE

... Sufficient		return SUCCESS		CONTINUE

CONTINUE means:  continue by call the next module in /etc/pam.conf; if
there are no more modules, return SUCCESS.

Hope this helps!

							- Ted




