I have submitted the following case as PSARC 2010/116 with a timeout
next Wednesday, April 14th.

This is a pretty trivial interface change, so I am not expecting it
will require much review.  I worked out the details with Garrett
D'Amore, and he already reviewed the one-pager and thought it was ready
to submit.

I have also attached the patch to the GDM PreSession & PostSession
script which implements the interface change described in this
one-pager in case anybody wants to review it as well.

Thanks,

Brian

---

Template Version: @(#)onepager.txt 1.35 07/11/07 SMI
Copyright 2007 Sun Microsystems

1. Introduction
   1.1. Project/Component Working Name:

        GDM Integration With audioctl

   1.2. Name of Document Author/Supplier:

        Brian Cameron

   1.3. Date of This Document:

        March 06, 2010

           1.3.1. Date this project was conceived:

                  March 06, 2010

   1.4. Name of Major Document Customer(s)/Consumer(s):

      1.4.1. The PAC or CPT you expect to review your project:

             System PAC

      1.4.2. The ARC(s) you expect to review your project:

             PSARC

      1.4.3. The Director/VP who is "Sponsoring" this project:

             [email protected]

      1.4.4. The name of your business unit:

             Solaris Platform Engineering

   1.5. Email Aliases:

      1.5.1. Responsible Manager:

             [email protected]

      1.5.2. Responsible Engineer:

             [email protected]

      1.5.3. Marketing Manager:

             [email protected]

      1.5.4. Interest List:

             [email protected]

2. Project Summary

    2.1 Project Description:

    This ARC case addresses bugster CR #6606096 by providing a
    mechanism for the user's audio settings to be saved on logout and
    re-loaded on login.  This ensures that the audio settings are
    returned to the user's preferred values on reboot or when one user
    logs out and another user logs in.

    There has been some discussion with the Device Allocation team about
    solving this problem at a lower level so that audio preferences are
    saved and loaded when the audio device is allocated or
    deallocated.  Until a better low-level solution exists, this case
    provides users with temporary relief.  This is needed since many
    users complain that their audio settings are lost and returned to
    the default system values each time they reboot their machine.
    However, this integration will likely be removed if and when a more
    general solution is available.

4. Technical Description:

    4.1. Details:

         To save the user's audio settings, the GDM PostSession script
         is modified to save the user's audio settings on logout.

         The user's audio settings values are stored in the
         $HOME/.audioctl directory.  The PostSession script creates
         this directory if it is not present and ensures it has 700
         permissions and is owned by the user and associated with the
         user's primary group.

         The PostSession script then saves the user's audio settings by
         calling the /usr/bin/audioctl program as follows:

/usr/bin/audioctrl save-controls -f $HOME/.audioctl/audioctl-$HOSTNAME-$DEVICENAME

         The HOSTNAME value is obtained by calling /usr/bin/hostname and
         the DEVICENAME value is obtained by calling the following
         command:

         /usr/bin/audioctl show-device | grep Name | sed 's/.*= *//g'

         The resulting $HOME/.audioctl/audioctl-$HOMENAME-$DEVICENAME
         file is created with 600 permissions and also is owned by the
         user and associated with the user's primary group.

         This ensures that the audio default settings are saved uniquely
         per-machine and per-device for each user.  Thus, each user who
         shares their $HOME directory across multiple systems will have
         discrete settings for each machine and device that they use.

         The GDM PreSession script loads the settings when the user
         next logs in by calling this command, constructing the
         filename in the same manner as described above:

/usr/bin/audioctl load-controls $HOME/.audioctl/audioctl-$HOSTNAME-$DEVICENAME

    4.2. Bug/RFE Number(s):

         CR #6606096

    4.5. Interfaces:

                                   Exported  Interface

    Interface                     Classification  Comments
    -------------------------     --------------  ----------------------
    $HOME/.audioctl/audioctl-$HOSTNAME-$DEVICENAME
                                  Volatile        User's audio
                                                  settings

                                Imported  Interface

    Interface            Classification  ARC case       Comment
    --------             --------------- ----------     ----------------
    /usr/bin/audioctl    Committed       PSARC 2009/626

    4.6. Doc Impact:

         None.

    4.7. Admin/Config Impact:

         None.

    4.8. HA Impact:

         None.

    4.9. I18N/L10N Impact:

         None.  This change adds no messages needing translation.

    4.10. Packaging & Delivery:

          Included with GDM.

    4.11. Security Impact:

          File system permissions and ownership are used to ensure that
          each user's configuration files can not be accessed or
          modified by other users.

    4.12. Dependencies:

          This solution only works on systems that support OSS.  For
          example, it will not work in Sun Ray environments until they
          support OSS or on systems that do not have OSS audio driver
          support.

5. Reference Documents:

   None.

--- gdm-2.30.0/data/PreSession.in-orig  2010-04-01 20:07:33.764844800 -0500
+++ gdm-2.30.0/data/PreSession.in       2010-04-01 20:08:26.004795852 -0500
@@ -7,3 +7,18 @@
 # Note that output goes into the .xsession-errors file for easy debugging
 #
 PATH="@SCRIPT_PATH@"
+
+OSS_SAVE_HOSTNAME=`/usr/bin/hostname`
+OSS_SAVE_DEVICE=""
+OSS_SAVE_DIR="$HOME/.audioctl"
+
+if test -x "/usr/bin/audioctl" ; then
+  OSS_SAVE_DEVICE=`/usr/bin/audioctl show-device | /usr/bin/grep Name | 
/usr/bin/sed 's/.*= *//g'`
+fi
+
+if test -n "$OSS_SAVE_HOSTNAME" -a -n "$OSS_SAVE_DEVICE"; then
+   OSS_SAVE_FILE="$OSS_SAVE_DIR/audioctl-$OSS_SAVE_HOSTNAME-$OSS_SAVE_DEVICE"
+   if test -f "$OSS_SAVE_FILE" ; then
+      /usr/bin/audioctl load-controls $OSS_SAVE_FILE
+   fi
+fi
--- gdm-2.30.0/data/PostSession.in-orig 2010-04-01 20:07:40.149431751 -0500
+++ gdm-2.30.0/data/PostSession.in      2010-04-01 20:08:42.805832581 -0500
@@ -1,4 +1,29 @@
 #!/bin/sh
 PATH="@SCRIPT_PATH@"
 
+OSS_SAVE_HOSTNAME=`/usr/bin/hostname`
+OSS_SAVE_DEVICE=""
+OSS_SAVE_DIR="$HOME/.audioctl"
+
+if test -x "/usr/bin/audioctl" ; then
+  OSS_SAVE_DEVICE=`/usr/bin/audioctl show-device | /usr/bin/grep Name | 
/usr/bin/sed 's/.*= *//g'`
+fi
+
+if test -n "$OSS_SAVE_HOSTNAME" -a -n "$OSS_SAVE_DEVICE"; then
+   if test ! -d "$OSS_SAVE_DIR" ; then
+      /usr/bin/mkdir $OSS_SAVE_DIR
+      /usr/bin/chmod 700 $OSS_SAVE_DIR
+      /usr/bin/chown $USER $OSS_SAVE_DIR
+      /usr/bin/chgrp `id -nG $USER` $OSS_SAVE_DIR
+   fi
+
+   if test -d "$OSS_SAVE_DIR" ; then
+      
OSS_SAVE_FILE="$OSS_SAVE_DIR/audioctl-$OSS_SAVE_HOSTNAME-$OSS_SAVE_DEVICE"
+      /usr/bin/audioctl save-controls -f $OSS_SAVE_FILE
+      /usr/bin/chmod 600 $OSS_SAVE_FILE
+      /usr/bin/chown $USER $OSS_SAVE_FILE
+      /usr/bin/chgrp `id -nG $USER` $OSS_SAVE_FILE
+   fi
+fi
+
 exit 0
_______________________________________________
opensolaris-arc mailing list
[email protected]

Reply via email to