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

(-)a/sshpty.c (-2 / +7 lines)
Lines 202-208 pty_setowner(struct passwd *pw, const char *tty) Link Here
202
	/*
202
	/*
203
	 * Change owner and mode of the tty as required.
203
	 * Change owner and mode of the tty as required.
204
	 * Warn but continue if filesystem is read-only and the uids match/
204
	 * Warn but continue if filesystem is read-only and the uids match/
205
	 * tty is owned by root.
205
	 * tty is owned by root, also warn but continue
206
	 * if the uids match and the gid is the overflow gid 0xFFFE,
207
	 * which is the case in user namespaces.
206
	 */
208
	 */
207
	if (stat(tty, &st))
209
	if (stat(tty, &st))
208
		fatal("stat(%.100s) failed: %.100s", tty,
210
		fatal("stat(%.100s) failed: %.100s", tty,
Lines 219-224 pty_setowner(struct passwd *pw, const char *tty) Link Here
219
				debug("chown(%.100s, %u, %u) failed: %.100s",
221
				debug("chown(%.100s, %u, %u) failed: %.100s",
220
				    tty, (u_int)pw->pw_uid, (u_int)gid,
222
				    tty, (u_int)pw->pw_uid, (u_int)gid,
221
				    strerror(errno));
223
				    strerror(errno));
224
			else if (st.st_uid == pw->pw_uid && st.st_gid == 0xFFFE)
225
				debug("chown(%.100s, %u, %u) failed: %.100s",
226
				    tty, (u_int)pw->pw_uid, (u_int)gid,
227
				    strerror(errno));
222
			else
228
			else
223
				fatal("chown(%.100s, %u, %u) failed: %.100s",
229
				fatal("chown(%.100s, %u, %u) failed: %.100s",
224
				    tty, (u_int)pw->pw_uid, (u_int)gid,
230
				    tty, (u_int)pw->pw_uid, (u_int)gid,
225
- 

Return to bug 2813