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

Collapse All | Expand All

(-)session.c (-2 / +9 lines)
Lines 1466-1474 do_setusercontext(struct passwd *pw) Link Here
1466
	if (getuid() == 0 || geteuid() == 0)
1466
	if (getuid() == 0 || geteuid() == 0)
1467
#endif /* HAVE_CYGWIN */
1467
#endif /* HAVE_CYGWIN */
1468
	{
1468
	{
1469
1470
#ifdef HAVE_SETPCRED
1469
#ifdef HAVE_SETPCRED
1471
		if (setpcred(pw->pw_name, (char **)NULL) == -1)
1470
		/*
1471
		 * If we have a chroot directory, we set everything exept real
1472
		 * uid which we will need for chroot.  If we don't have a
1473
		 * chroot directory, we don't override anything.
1474
		 */
1475
		char *creds[] = { "REAL_USER=root", NULL };
1476
1477
		if (setpcred(pw->pw_name,
1478
		    options.chroot_directory == NULL ? NULL : creds) == -1)
1472
			fatal("Failed to set process credentials");
1479
			fatal("Failed to set process credentials");
1473
#endif /* HAVE_SETPCRED */
1480
#endif /* HAVE_SETPCRED */
1474
#ifdef HAVE_LOGIN_CAP
1481
#ifdef HAVE_LOGIN_CAP

Return to bug 1567