PAM_SUCCEED_IF(8)

  .SH "NAME" pam_succeed_if - test account characteristics
  .SH "SYNOPSIS"
    .HP u
      pam_succeed_if.so
       [flag...]
       [condition...]

  .SH "DESCRIPTION"

    .PP pam_succeed_if.so is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated or values of other PAM items. One use is to select whether to load other modules based on this test.
    .PP The module should be given one or more conditions as module arguments, and authentication will succeed only if all of the conditions are met.

  .SH "OPTIONS"

    .PP The following flags are supported:

      .PP debug

              Turns on debugging messages sent to syslog.

          .RE
          .PP use_uid

                  Evaluate conditions using the account of the user whose UID the application is running under instead of the user being authenticated.

              .RE
              .PP quiet

                      Don't log failure or success to the system log.

                  .RE
                  .PP quiet_fail

                          Don't log failure to the system log.

                      .RE
                      .PP quiet_success

                              Don't log success to the system log.

                          .RE
                          .PP audit

                                  Log unknown users to the system log.

                              .RE

                            .PP Conditions are three words: a field, a test, and a value to test for.
                            .PP Available fields are user, uid, gid, shell, home, ruser, rhost, tty and service:

                              .PP field < number

                                      Field has a value numerically less than number.

                                  .RE
                                  .PP field <= number

                                          Field has a value numerically less than or equal to number.

                                      .RE
                                      .PP field eq number

                                              Field has a value numerically equal to number.

                                          .RE
                                          .PP field >= number

                                                  Field has a value numerically greater than or equal to number.

                                              .RE
                                              .PP field > number

                                                      Field has a value numerically greater than number.

                                                  .RE
                                                  .PP field ne number

                                                          Field has a value numerically different from number.

                                                      .RE
                                                      .PP field = string

                                                              Field exactly matches the given string.

                                                          .RE
                                                          .PP field != string

                                                                  Field does not match the given string.

                                                              .RE
                                                              .PP field =~ glob

                                                                      Field matches the given glob.

                                                                  .RE
                                                                  .PP field !~ glob

                                                                          Field does not match the given glob.

                                                                      .RE
                                                                      .PP field in item:item:...

                                                                              Field is contained in the list of items separated by colons.

                                                                          .RE
                                                                          .PP field notin item:item:...

                                                                                  Field is not contained in the list of items separated by colons.

                                                                              .RE
                                                                              .PP user ingroup group[:group:....]

                                                                                      User is in given group(s).

                                                                                  .RE
                                                                                  .PP user notingroup group[:group:....]

                                                                                          User is not in given group(s).

                                                                                      .RE
                                                                                      .PP user innetgr netgroup

                                                                                              (user,host) is in given netgroup.

                                                                                          .RE
                                                                                          .PP user notinnetgr group

                                                                                                  (user,host) is not in given netgroup.

                                                                                              .RE

                                                                                          .SH "MODULE TYPES PROVIDED"

                                                                                            .PP All module types (account, auth, password and session) are provided.

                                                                                          .SH "RETURN VALUES"

                                                                                                .PP PAM_SUCCESS

                                                                                                        The condition was true.

                                                                                                    .RE
                                                                                                    .PP PAM_AUTH_ERR

                                                                                                            The condition was false.

                                                                                                        .RE
                                                                                                        .PP PAM_SERVICE_ERR

                                                                                                                A service error occurred or the arguments can't be parsed correctly.

                                                                                                            .RE

                                                                                                      .SH "EXAMPLES"

                                                                                                        .PP To emulate the behaviour of pam_wheel, except there is no fallback to group 0 being only approximated by checking also the root group membership:

                                                                                                        auth required pam_succeed_if.so quiet user ingroup wheel:root

                                                                                                        .PP Given that the type matches, only loads the othermodule rule if the UID is over 500. Adjust the number after default to skip several rules.

                                                                                                        type [default=1 success=ignore] pam_succeed_if.so quiet uid > 500
                                                                                                        type required othermodule.so arguments...

                                                                                                      .SH "SEE ALSO"

                                                                                                        .PP glob(7), pam(8)

                                                                                                      .SH "AUTHOR"

                                                                                                        .PP Nalin Dahyabhai <nalin@redhat.com>