-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpass.h
More file actions
104 lines (88 loc) · 2.27 KB
/
pass.h
File metadata and controls
104 lines (88 loc) · 2.27 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* pass.h
*
* Copyright (C) 1999, 2002, 2006, 2013 Staf Wagemakers Belgie/Belgium
*
* 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 2 of the License, 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include "common.h"
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include "md5crypt.h"
#include "salt.h"
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
#ifdef HAVE_SHADOW_H
#include <shadow.h>
#endif
#include "xmalloc.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <errno.h>
#ifndef __PASS_H
#define __PASS_H
#define SHADOWFILE "/etc/shadow"
#define OSHADOWFILE "/etc/oshadow"
#define TMPFILE "/etc/tmp_passwd"
#define BUFFERLEN 256
#ifdef _WITHPAM
#include <security/pam_appl.h>
char *set_pam_service(char *s);
char *last_pam_msg();
int set_pam_chauth_flag (int flag);
#define PASS_SUCCESS PAM_SUCCESS
#endif
#ifndef _WITHPAM
#include "fgetpwnam.h"
#define PASS_SUCCESS 0
#endif
struct pw_info {
struct passwd *p;
struct spwd *sp;
#ifdef _WITHPAM
pam_handle_t *pamh;
#endif
};
struct pw_info * get_pw(char *name);
int ckpw(struct pw_info *pw,char *pass);
int chpw_nopam(struct pw_info *pw,char *pass,int mode);
int chpw(struct pw_info *pw,char *pass);
char * set_shadow_location ( char * shadow_file );
char * set_passwd_location ( char * passwd_file );
#ifdef _WITHPAM
int ckpw_nopam(struct pw_info *pw,char *pass);
struct pw_info * get_pw_nopam(char *name);
#endif
#endif