View | Details | Raw Unified | Return to bug 29897
Collapse All | Expand All

(-)pam_unix.new/CVS/Root (-1 / +1 lines)
Line 1 Link Here
1
/mnt/cvs/FreeBSD
1
/mnt/cvs
(-)pam_unix.new/pam_unix.c (-4 / +23 lines)
Lines 23-29 Link Here
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
24
 * SUCH DAMAGE.
25
 *
25
 *
26
 *	$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.7 2001/07/09 18:20:50 markm Exp $
26
 *	$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.7 2001/07/09 18:20:50 markm Exp $ - this version
27
 */
27
 */
28
28
29
#include <sys/types.h>
29
#include <sys/types.h>
Lines 41-47 Link Here
41
41
42
#include "pam_mod_misc.h"
42
#include "pam_mod_misc.h"
43
43
44
#define PASSWORD_PROMPT	"Password:"
44
#define DEFAULT_PASSWORD_PROMPT	"Password:"
45
#define DEFAULT_WARN  (2L * 7L * 86400L)  /* Two weeks */
45
#define DEFAULT_WARN  (2L * 7L * 86400L)  /* Two weeks */
46
46
47
enum { PAM_OPT_AUTH_AS_SELF=PAM_OPT_STD_MAX, PAM_OPT_NULLOK };
47
enum { PAM_OPT_AUTH_AS_SELF=PAM_OPT_STD_MAX, PAM_OPT_NULLOK };
Lines 52-57 Link Here
52
	{ NULL, 0 }
52
	{ NULL, 0 }
53
};
53
};
54
54
55
56
55
/*
57
/*
56
 * authentication management
58
 * authentication management
57
 */
59
 */
Lines 64-69 Link Here
64
	int retval;
66
	int retval;
65
	const char *password, *user;
67
	const char *password, *user;
66
	char *encrypted;
68
	char *encrypted;
69
	login_cap_t *lc;
70
	char	*passwd_prompt=DEFAULT_PASSWORD_PROMPT;
67
71
68
	pam_std_option(&options, other_options, argc, argv);
72
	pam_std_option(&options, other_options, argc, argv);
69
73
Lines 84-89 Link Here
84
88
85
		PAM_LOG("Doing real authentication");
89
		PAM_LOG("Doing real authentication");
86
90
91
		lc = login_getclass(NULL);
92
/*****************************************
93
 *
94
 * I don't understand why prompts should be default for all login classes
95
 * I think that lc = login_getpwclass(pwd) is more flexiable solution
96
 *
97
 *		lc = login_getclass(NULL);
98
 *		lc = login_getpwclass(pwd);
99
 */
100
		passwd_prompt = login_getcapstr(lc, "passwd_prompt",
101
	    					DEFAULT_PASSWORD_PROMPT, 
102
						DEFAULT_PASSWORD_PROMPT);
103
		login_close(lc);
104
		lc = NULL;
105
87
		if (pwd->pw_passwd[0] == '\0'
106
		if (pwd->pw_passwd[0] == '\0'
88
		    && pam_test_option(&options, PAM_OPT_NULLOK, NULL)) {
107
		    && pam_test_option(&options, PAM_OPT_NULLOK, NULL)) {
89
			/*
108
			/*
Lines 94-100 Link Here
94
			PAM_RETURN(PAM_SUCCESS);
113
			PAM_RETURN(PAM_SUCCESS);
95
		}
114
		}
96
		else {
115
		else {
97
			retval = pam_get_pass(pamh, &password, PASSWORD_PROMPT,
116
			retval = pam_get_pass(pamh, &password, passwd_prompt,
98
			    &options);
117
			    &options);
99
			if (retval != PAM_SUCCESS)
118
			if (retval != PAM_SUCCESS)
100
				PAM_RETURN(retval);
119
				PAM_RETURN(retval);
Lines 118-124 Link Here
118
		 * User unknown.
137
		 * User unknown.
119
		 * Encrypt a dummy password so as to not give away too much.
138
		 * Encrypt a dummy password so as to not give away too much.
120
		 */
139
		 */
121
		retval = pam_get_pass(pamh, &password, PASSWORD_PROMPT,
140
		retval = pam_get_pass(pamh, &password, passwd_prompt,
122
		    &options);
141
		    &options);
123
		if (retval != PAM_SUCCESS)
142
		if (retval != PAM_SUCCESS)
124
			PAM_RETURN(retval);
143
			PAM_RETURN(retval);

Return to bug 29897