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

(-)auth.c (-10 / +13 lines)
Lines 99-106 allowed_user(struct passwd * pw) Link Here
99
		for (i = 0; i < options.num_deny_users; i++)
99
		for (i = 0; i < options.num_deny_users; i++)
100
			if (match_user(pw->pw_name, hostname, ipaddr,
100
			if (match_user(pw->pw_name, hostname, ipaddr,
101
			    options.deny_users[i])) {
101
			    options.deny_users[i])) {
102
				logit("User %.100s not allowed because listed in DenyUsers",
102
				logit("User %.100s from %.100s not allowed "
103
				    pw->pw_name);
103
				    "because listed in DenyUsers",
104
				    pw->pw_name, hostname);
104
				return 0;
105
				return 0;
105
			}
106
			}
106
	}
107
	}
Lines 112-127 allowed_user(struct passwd * pw) Link Here
112
				break;
113
				break;
113
		/* i < options.num_allow_users iff we break for loop */
114
		/* i < options.num_allow_users iff we break for loop */
114
		if (i >= options.num_allow_users) {
115
		if (i >= options.num_allow_users) {
115
			logit("User %.100s not allowed because not listed in AllowUsers",
116
			logit("User %.100s from %.100s not allowed because "
116
			    pw->pw_name);
117
			    "not listed in AllowUsers", pw->pw_name, hostname);
117
			return 0;
118
			return 0;
118
		}
119
		}
119
	}
120
	}
120
	if (options.num_deny_groups > 0 || options.num_allow_groups > 0) {
121
	if (options.num_deny_groups > 0 || options.num_allow_groups > 0) {
121
		/* Get the user's group access list (primary and supplementary) */
122
		/* Get the user's group access list (primary and supplementary) */
122
		if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
123
		if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
123
			logit("User %.100s not allowed because not in any group",
124
			logit("User %.100s from %.100s not allowed because "
124
			    pw->pw_name);
125
			    "not in any group", pw->pw_name, hostname);
125
			return 0;
126
			return 0;
126
		}
127
		}
127
128
Lines 130-137 allowed_user(struct passwd * pw) Link Here
130
			if (ga_match(options.deny_groups,
131
			if (ga_match(options.deny_groups,
131
			    options.num_deny_groups)) {
132
			    options.num_deny_groups)) {
132
				ga_free();
133
				ga_free();
133
				logit("User %.100s not allowed because a group is listed in DenyGroups",
134
				logit("User %.100s from %.100s not allowed "
134
				    pw->pw_name);
135
				    "because a group is listed in DenyGroups",
136
				    pw->pw_name, hostname);
135
				return 0;
137
				return 0;
136
			}
138
			}
137
		/*
139
		/*
Lines 142-149 allowed_user(struct passwd * pw) Link Here
142
			if (!ga_match(options.allow_groups,
144
			if (!ga_match(options.allow_groups,
143
			    options.num_allow_groups)) {
145
			    options.num_allow_groups)) {
144
				ga_free();
146
				ga_free();
145
				logit("User %.100s not allowed because none of user's groups are listed in AllowGroups",
147
				logit("User %.100s from %.100s not allowed "
146
				    pw->pw_name);
148
				    "because none of user's groups are listed "
149
				    "in AllowGroups", pw->pw_name, hostname);
147
				return 0;
150
				return 0;
148
			}
151
			}
149
		ga_free();
152
		ga_free();

Return to bug 909