Bugzilla – Attachment 1948 Details for
Bug 1824
Added project(4) support for Solaris 10
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
openssh-solaris-projects.patch
openssh-solaris-projects.patch (text/plain), 5.03 KB, created by
Darren Tucker
on 2010-11-05 11:30:50 AEDT
(
hide
)
Description:
openssh-solaris-projects.patch
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2010-11-05 11:30:50 AEDT
Size:
5.03 KB
patch
obsolete
>Index: configure.ac >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/configure.ac,v >retrieving revision 1.455 >diff -u -p -r1.455 configure.ac >--- configure.ac 11 Oct 2010 11:35:23 -0000 1.455 >+++ configure.ac 5 Nov 2010 00:00:38 -0000 >@@ -333,6 +333,7 @@ AC_CHECK_HEADERS(sys/mount.h, [], [], [ > # Messages for features tested for in target-specific section > SIA_MSG="no" > SPC_MSG="no" >+SP_MSG="no" > > # Check for some target-specific stuff > case "$host" in >@@ -704,6 +705,17 @@ mips-sony-bsd|mips-sony-newsos4) > SPC_MSG="yes" ], ) > ], > ) >+ AC_ARG_WITH(solaris-projects, >+ [ --with-solaris-projects Enable Solaris projects (experimental)], >+ [ >+ AC_CHECK_LIB(project, setproject, >+ [ AC_DEFINE(USE_SOLARIS_PROJECTS, 1, >+ [Define if you have Solaris projects]) >+ SSHDLIBS="$SSHDLIBS -lproject" >+ AC_SUBST(SSHDLIBS) >+ SP_MSG="yes" ], ) >+ ], >+ ) > ;; > *-*-sunos4*) > CPPFLAGS="$CPPFLAGS -DSUNOS4" >@@ -4236,6 +4248,7 @@ echo " TCP Wrappers support > echo " MD5 password support: $MD5_MSG" > echo " libedit support: $LIBEDIT_MSG" > echo " Solaris process contract support: $SPC_MSG" >+echo " Solaris project support: $SP_MSG" > echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" > echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" > echo " BSD Auth support: $BSD_AUTH_MSG" >Index: platform.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/platform.c,v >retrieving revision 1.3 >diff -u -p -r1.3 platform.c >--- platform.c 20 Dec 2009 23:49:22 -0000 1.3 >+++ platform.c 5 Nov 2010 00:21:00 -0000 >@@ -57,6 +57,16 @@ platform_post_fork_child(void) > #endif > } > >+void >+platform_setusercontext(struct passwd *pw) >+{ >+#ifdef USE_SOLARIS_PROJECTS >+ /* if solaris projects were detected, set the default now */ >+ if (getuid() == 0 || geteuid() == 0) >+ solaris_set_default_project(pw); >+#endif >+} >+ > char * > platform_krb5_get_principal_name(const char *pw_name) > { >Index: platform.h >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/platform.h,v >retrieving revision 1.4 >diff -u -p -r1.4 platform.h >--- platform.h 14 Jan 2010 01:44:16 -0000 1.4 >+++ platform.h 5 Nov 2010 00:26:01 -0000 >@@ -18,10 +18,13 @@ > > #include <sys/types.h> > >+#include <pwd.h> >+ > void platform_pre_listen(void); > void platform_pre_fork(void); > void platform_post_fork_parent(pid_t child_pid); > void platform_post_fork_child(void); >+void platform_setusercontext(struct passwd *); > char *platform_get_krb5_client(const char *); > char *platform_krb5_get_principal_name(const char *); > >Index: session.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/session.c,v >retrieving revision 1.398 >diff -u -p -r1.398 session.c >--- session.c 26 Jun 2010 00:00:15 -0000 1.398 >+++ session.c 5 Nov 2010 00:16:34 -0000 >@@ -1469,6 +1469,8 @@ do_setusercontext(struct passwd *pw) > { > char *chroot_path, *tmp; > >+ platform_setusercontext(pw); >+ > #ifdef WITH_SELINUX > /* Cache selinux status for later use */ > (void)ssh_selinux_enabled(); >Index: openbsd-compat/port-solaris.c >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/openbsd-compat/port-solaris.c,v >retrieving revision 1.3 >diff -u -p -r1.3 port-solaris.c >--- openbsd-compat/port-solaris.c 31 Oct 2006 23:28:49 -0000 1.3 >+++ openbsd-compat/port-solaris.c 5 Nov 2010 00:24:58 -0000 >@@ -197,3 +197,33 @@ solaris_contract_post_fork_parent(pid_t > close(ctl_fd); > } > #endif >+ >+#ifdef USE_SOLARIS_PROJECTS >+#include <sys/task.h> >+#include <project.h> >+ >+/* >+ * Get/set solaris default project. >+ * If we fail, just run along gracefully. >+ */ >+void >+solaris_set_default_project(struct passwd *pw) >+{ >+ struct project *defaultproject; >+ struct project tempproject; >+ char buf[1024]; >+ >+ /* get default project, if we fail just return gracefully */ >+ if ((defaultproject = getdefaultproj(pw->pw_name, &tempproject, &buf, >+ sizeof(buf))) > 0) { >+ /* set default project */ >+ if (setproject(defaultproject->pj_name, pw->pw_name, >+ TASK_NORMAL) != 0) >+ debug("setproject(%s): %s", defaultproject->pj_name, >+ strerror(errno)); >+ } else { >+ /* debug on getdefaultproj() error */ >+ debug("getdefaultproj(%s): %s", pw->pw_name, strerror(errno)); >+ } >+} >+#endif /* USE_SOLARIS_PROJECTS */ >Index: openbsd-compat/port-solaris.h >=================================================================== >RCS file: /home/dtucker/openssh/cvs/openssh/openbsd-compat/port-solaris.h,v >retrieving revision 1.1 >diff -u -p -r1.1 port-solaris.h >--- openbsd-compat/port-solaris.h 30 Aug 2006 17:24:42 -0000 1.1 >+++ openbsd-compat/port-solaris.h 5 Nov 2010 00:20:04 -0000 >@@ -20,8 +20,11 @@ > > #include <sys/types.h> > >+#include <pwd.h> >+ > void solaris_contract_pre_fork(void); > void solaris_contract_post_fork_child(void); > void solaris_contract_post_fork_parent(pid_t pid); >+void solaris_set_default_project(struct passwd *); > > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1824
:
1929
|
1937
| 1948