Bug 1824 - Added project(4) support for Solaris 10
Summary: Added project(4) support for Solaris 10
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All Solaris
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_7
  Show dependency treegraph
 
Reported: 2010-09-23 02:37 AEST by Cory Erickson
Modified: 2011-01-24 12:33 AEDT (History)
2 users (show)

See Also:


Attachments
patch for solaris projects support (16.23 KB, application/octet-stream)
2010-09-23 02:37 AEST, Cory Erickson
no flags Details
solaris project support added to SNAP-20100922 (3.04 KB, patch)
2010-10-19 09:08 AEDT, Cory Erickson
no flags Details | Diff
openssh-solaris-projects.patch (5.03 KB, patch)
2010-11-05 11:30 AEDT, Darren Tucker
djm: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cory Erickson 2010-09-23 02:37:16 AEST
Created attachment 1929 [details]
patch for solaris projects support

Projects are the basis for resource controls in Solaris 10. The current openssh doesn't appear to support projects, so the default project (system) is inherited from the parent sshd:

[ericksco]unixprd:~$ ssh themis
Last login: Sun Sep 19 11:24:46 2010 from unixprd.mnscu.e
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
[ericksco]themis:~$ projects -d # displays default project
default
[ericksco]themis:~$ id -p # however, "system" project is inherited from sshd
uid=1108(ericksco) gid=101(admins) projid=0(system)

With the project support enabled, sshd can properly set the default project (as uid=0) before spawning client command/shell:

[ericksco]unixprd:~$ ssh timmy
Last login: Tue Sep 21 20:40:40 2010 from unixprd.mnscu.e
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
[ericksco]timmy:~$ projects -d # displays default project
group.admins
[ericksco]timmy:~$ id -p # now effective project is correct
uid=1108(ericksco) gid=101(admins) projid=11(group.admins)

The library calls utilized are:

- getdefaultproj()

Obtains the default project for the user logging in.

- setproject()

Sets the project for the session. Requires special privs (uid=0) or will fail.
Comment 1 Damien Miller 2010-10-12 13:48:04 AEDT
Hi, could you regenerate this patch as a unified diff ("diff -u") and reattach? Unified diffs are much easier to read and review.
Comment 2 Cory Erickson 2010-10-19 09:08:31 AEDT
Created attachment 1937 [details]
solaris project support added to SNAP-20100922
Comment 3 Darren Tucker 2010-11-05 11:29:11 AEDT
looks mostly ok but I'd like to put the code in port-solaris.c and the hook into platform.c for maintainability reasons.
Comment 4 Darren Tucker 2010-11-05 11:30:50 AEDT
Created attachment 1948 [details]
openssh-solaris-projects.patch

Move code into port-solaris.c
Comment 5 Darren Tucker 2010-11-05 12:20:04 AEDT
Modified patch applied and it will be in 5.7p1.  Thanks.
Comment 6 Damien Miller 2011-01-24 12:33:51 AEDT
Move resolved bugs to CLOSED after 5.7 release