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

Collapse All | Expand All

(-)configure.ac (+13 lines)
Lines 333-338 AC_CHECK_HEADERS(sys/mount.h, [], [], [ Link Here
333
# Messages for features tested for in target-specific section
333
# Messages for features tested for in target-specific section
334
SIA_MSG="no"
334
SIA_MSG="no"
335
SPC_MSG="no"
335
SPC_MSG="no"
336
SP_MSG="no"
336
337
337
# Check for some target-specific stuff
338
# Check for some target-specific stuff
338
case "$host" in
339
case "$host" in
Lines 704-709 mips-sony-bsd|mips-sony-newsos4) Link Here
704
			  SPC_MSG="yes" ], )
705
			  SPC_MSG="yes" ], )
705
		],
706
		],
706
	)
707
	)
708
	AC_ARG_WITH(solaris-projects,
709
		[  --with-solaris-projects Enable Solaris projects (experimental)],
710
		[
711
		AC_CHECK_LIB(project, setproject,
712
			[ AC_DEFINE(USE_SOLARIS_PROJECTS, 1,
713
				[Define if you have Solaris projects])
714
			SSHDLIBS="$SSHDLIBS -lproject"
715
			AC_SUBST(SSHDLIBS)
716
			SP_MSG="yes" ], )
717
		],
718
	)
707
	;;
719
	;;
708
*-*-sunos4*)
720
*-*-sunos4*)
709
	CPPFLAGS="$CPPFLAGS -DSUNOS4"
721
	CPPFLAGS="$CPPFLAGS -DSUNOS4"
Lines 4236-4241 echo " TCP Wrappers support Link Here
4236
echo "              MD5 password support: $MD5_MSG"
4248
echo "              MD5 password support: $MD5_MSG"
4237
echo "                   libedit support: $LIBEDIT_MSG"
4249
echo "                   libedit support: $LIBEDIT_MSG"
4238
echo "  Solaris process contract support: $SPC_MSG"
4250
echo "  Solaris process contract support: $SPC_MSG"
4251
echo "           Solaris project support: $SP_MSG"
4239
echo "       IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
4252
echo "       IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
4240
echo "           Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
4253
echo "           Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
4241
echo "                  BSD Auth support: $BSD_AUTH_MSG"
4254
echo "                  BSD Auth support: $BSD_AUTH_MSG"
(-)platform.c (+10 lines)
Lines 57-62 platform_post_fork_child(void) Link Here
57
#endif
57
#endif
58
}
58
}
59
59
60
void
61
platform_setusercontext(struct passwd *pw)
62
{
63
#ifdef USE_SOLARIS_PROJECTS
64
	/* if solaris projects were detected, set the default now */
65
	if (getuid() == 0 || geteuid() == 0)
66
		solaris_set_default_project(pw);
67
#endif
68
}
69
60
char *
70
char *
61
platform_krb5_get_principal_name(const char *pw_name)
71
platform_krb5_get_principal_name(const char *pw_name)
62
{
72
{
(-)platform.h (+3 lines)
Lines 18-27 Link Here
18
18
19
#include <sys/types.h>
19
#include <sys/types.h>
20
20
21
#include <pwd.h>
22
21
void platform_pre_listen(void);
23
void platform_pre_listen(void);
22
void platform_pre_fork(void);
24
void platform_pre_fork(void);
23
void platform_post_fork_parent(pid_t child_pid);
25
void platform_post_fork_parent(pid_t child_pid);
24
void platform_post_fork_child(void);
26
void platform_post_fork_child(void);
27
void platform_setusercontext(struct passwd *);
25
char *platform_get_krb5_client(const char *);
28
char *platform_get_krb5_client(const char *);
26
char *platform_krb5_get_principal_name(const char *);
29
char *platform_krb5_get_principal_name(const char *);
27
30
(-)session.c (+2 lines)
Lines 1469-1474 do_setusercontext(struct passwd *pw) Link Here
1469
{
1469
{
1470
	char *chroot_path, *tmp;
1470
	char *chroot_path, *tmp;
1471
1471
1472
	platform_setusercontext(pw);
1473
1472
#ifdef WITH_SELINUX
1474
#ifdef WITH_SELINUX
1473
	/* Cache selinux status for later use */
1475
	/* Cache selinux status for later use */
1474
	(void)ssh_selinux_enabled();
1476
	(void)ssh_selinux_enabled();
(-)openbsd-compat/port-solaris.c (+30 lines)
Lines 197-199 solaris_contract_post_fork_parent(pid_t Link Here
197
		close(ctl_fd);
197
		close(ctl_fd);
198
}
198
}
199
#endif
199
#endif
200
201
#ifdef USE_SOLARIS_PROJECTS
202
#include <sys/task.h>
203
#include <project.h>
204
205
/*
206
 * Get/set solaris default project.
207
 * If we fail, just run along gracefully.
208
 */
209
void
210
solaris_set_default_project(struct passwd *pw)
211
{
212
	struct project  *defaultproject;
213
	struct project   tempproject;
214
	char buf[1024];
215
216
	/* get default project, if we fail just return gracefully  */
217
	if ((defaultproject = getdefaultproj(pw->pw_name, &tempproject, &buf,
218
	    sizeof(buf))) > 0) {
219
		/* set default project */
220
		if (setproject(defaultproject->pj_name, pw->pw_name,
221
		    TASK_NORMAL) != 0)
222
			debug("setproject(%s): %s", defaultproject->pj_name,
223
			    strerror(errno));
224
	} else {
225
		/* debug on getdefaultproj() error */
226
		debug("getdefaultproj(%s): %s", pw->pw_name, strerror(errno));
227
	}
228
}
229
#endif /* USE_SOLARIS_PROJECTS */
(-)openbsd-compat/port-solaris.h (+3 lines)
Lines 20-27 Link Here
20
20
21
#include <sys/types.h>
21
#include <sys/types.h>
22
22
23
#include <pwd.h>
24
23
void solaris_contract_pre_fork(void);
25
void solaris_contract_pre_fork(void);
24
void solaris_contract_post_fork_child(void);
26
void solaris_contract_post_fork_child(void);
25
void solaris_contract_post_fork_parent(pid_t pid);
27
void solaris_contract_post_fork_parent(pid_t pid);
28
void solaris_set_default_project(struct passwd *);
26
29
27
#endif
30
#endif

Return to bug 1824