View | Details | Raw Unified | Return to bug 177698 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/src/crypto/openssh/session.c (+13 lines)
Lines 1491-1501 Link Here
1491
1491
1492
	if (platform_privileged_uidswap()) {
1492
	if (platform_privileged_uidswap()) {
1493
#ifdef HAVE_LOGIN_CAP
1493
#ifdef HAVE_LOGIN_CAP
1494
#ifdef LOGIN_SETMAC
1495
		/* Set the MAC label second so it doesn't interfere with setting the login class. */
1496
		if (setusercontext(lc, pw, pw->pw_uid,
1497
		    (LOGIN_SETALL & ~(LOGIN_SETENV|LOGIN_SETPATH|LOGIN_SETUSER|LOGIN_SETMAC))) < 0) {
1498
			perror("unable to set user context");
1499
			exit(1);
1500
		}
1501
		if (setusercontext(lc, pw, pw->pw_uid,LOGIN_SETMAC) < 0) {
1502
			perror("unable to set user context");
1503
			exit(1);
1504
		}
1505
#else
1494
		if (setusercontext(lc, pw, pw->pw_uid,
1506
		if (setusercontext(lc, pw, pw->pw_uid,
1495
		    (LOGIN_SETALL & ~(LOGIN_SETENV|LOGIN_SETPATH|LOGIN_SETUSER))) < 0) {
1507
		    (LOGIN_SETALL & ~(LOGIN_SETENV|LOGIN_SETPATH|LOGIN_SETUSER))) < 0) {
1496
			perror("unable to set user context");
1508
			perror("unable to set user context");
1497
			exit(1);
1509
			exit(1);
1498
		}
1510
		}
1511
#endif
1499
#else
1512
#else
1500
		if (setlogin(pw->pw_name) < 0)
1513
		if (setlogin(pw->pw_name) < 0)
1501
			error("setlogin failed: %s", strerror(errno));
1514
			error("setlogin failed: %s", strerror(errno));

Return to bug 177698