File: pam.h

package info (click to toggle)
ukui-screensaver 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,064 kB
  • sloc: cpp: 7,017; ansic: 290; xml: 121; makefile: 7
file content (42 lines) | stat: -rw-r--r-- 1,303 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Copyright (C) 2018 Tianjin KYLIN Information Technology Co., Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 *
**/
#ifndef PAM_H
#define PAM_H

#include <errno.h>
#include <string.h>
#include <QDebug>

void authenticate(int toParent[2], int toAuthChild[2]);

int pam_conversation(int num_msg, const struct pam_message **msg,
				struct pam_response **resp, void *appdata_ptr);

#define MAX_MSG_LENGTH 1024
struct pam_message_object {
	int msg_style;
	char msg[MAX_MSG_LENGTH + 1];
} __attribute__((packed));

#define PIPE_OPS_SAFE(statement) do { \
	int return_value = statement; \
    if (return_value == -1)\
        qWarning("PIPE write/read error: %s", strerror(errno)); \
} while (0)

#endif // PAM_H