pam_open_session(3)

pam_open_session3

Start pam session management

Usage

#include <security/pam_appl.h>

int pam_open_session(pam_handle_t *pamh, int flags);

Overview

The pam_open_session function sets up a user session for a previously successfully authenticated user. The session should later be terminated with a call to pam_close_session(3).

It should be noted that the effective uid, geteuid(2), of the application should be of sufficient privilege to perform such tasks as creating or mounting the user's home directory for example.

The flags argument is the binary or of zero or more of the following values:

PAM_SILENT

Do not emit any messages.

Return values

PAM_ABORT

General failure.

PAM_BUF_ERR

Memory buffer error.

PAM_SESSION_ERR

Session failure.

PAM_SUCCESS

Session was successfully created.

Releases

17 releases since Debian 1.3 (Bo); the text changed 13 times.

  1. 1.3–2.1
  2. 2.2
  3. 3.0
  4. 3.1
  5. 4.0
  6. 5.0
  7. 6.0
  8. 7
  9. 8–9
  10. 10
  11. 11
  12. 12
  13. 13
  14. Arch

From pam 1.7.3-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.