OS: opensolaris developer preview
Problem privileges required to do Software installation:

Symptoms:

[EMAIL PROTECTED] ~ >cat /etc/ouser_attr
Excerpt:
adm::::profiles=Log Management
dladm::::auths=solaris.smf.manage.wpa,solaris.smf.modify
lp::::profiles=Printer Management
postgres::::type=role;profiles=Postgres Administration,All
root::::type=role;auths=solaris.*,solaris.grant;profiles=All;lock_after_retries=
                                   no;min_label=admin_low;clearance=admin_high
jhawk::::type=normal;profiles=Basic Solaris User,Primary 
Administrator;roles=root                                   t
[EMAIL PROTECTED] ~ >test.py
[EMAIL PROTECTED] ~ >pkg refresh
Excerpt:
IOError: [Errno 13] Permission denied: '//var/pkg/catalog/opensolaris.org/attrs'
[EMAIL PROTECTED] ~ >pkg install SUNWtidy
Excerpt:
OSError: [Errno 13] Permission denied: '//var/pkg/pkg/SUNWtidy'
[EMAIL PROTECTED] ~ >profiles
Basic Solaris User
All
Primary Administrator
Software Installation
[EMAIL PROTECTED] ~ >

Test for Software Installation as suggested by Shawn:

#!/usr/bin/env python

import sys
import os
try:
   import pygtk
   pygtk.require("2.0")
except:
   pass
try:
   import gtk
   import gtk.glade
   import gobject
except:
   sys.exit(1)
from threading import Thread
import time

   
class Test:
    def __init__(self):

            """ this is a test """
            win = gtk.Window(gtk.WINDOW_TOPLEVEL)
            self.win =win
            vb = gtk.VBox(False)
            vb.add(gtk.Label("Test for Software Installation"))
            self.entry =gtk.Entry()
            vb.add(self.entry)
            win.connect('destroy', gtk.main_quit)
            win.set_title('Test')
            win.add(vb)
            win.resize(300,100)
            win.show_all()
            win.show()
            self.ckeck_status()

    def ckeck_status(self):
        user = os.getlogin()
        chk = False
        try:
                #option one
                p = os.popen("profiles",'r')
                line = p.readline()
                i = 0
                while line:
                        if line.find("Software Installation"): 
                                chk = True
                                break
                        i = i +1
                        p.readline()
                #option two
                if not chk:
                        f = open('/etc/ouser_attr','r')
                        line = f.readline()
                        while line:
                                if line.find(user) > -1:
                                        if line.find("Software Installation") > 
-1:
                                                chk = True
                                                break
                                line =f.readline()
                        f.close()
        except:
                pass
        if not chk: 
                self.entry.set_text("Software Installation not approved")
        else:
                self.entry.set_text("Software Installation approved")
        return


#-----------------------------------------------------------------------------#
# Main
#-----------------------------------------------------------------------------#
        
def main():
    gtk.main()
    return 0
        
if __name__ == '__main__':
  test = Test()
  main()

Final Thoughts:

The only way I can install on my system is to su to gain root access.
Thus I designed IpsPkgTool to require root access.
New clean install and image-update last night. Is this anomalous 
or am I missing something here.


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to