Author: jreidinger Date: Wed Jul 2 09:16:00 2008 New Revision: 48745 URL: http://svn.opensuse.org/viewcvs/yast?rev=48745&view=rev Log: fix python and polkit errors Modified: branches/tmp/lslezak/workshop/auth_dbus_layer/AuthException.py branches/tmp/lslezak/workshop/auth_dbus_layer/Makefile branches/tmp/lslezak/workshop/auth_dbus_layer/polkit.c branches/tmp/lslezak/workshop/auth_dbus_layer/polkitwrapper.py Modified: branches/tmp/lslezak/workshop/auth_dbus_layer/AuthException.py URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/auth_dbus_layer/AuthException.py?rev=48745&r1=48744&r2=48745&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/auth_dbus_layer/AuthException.py (original) +++ branches/tmp/lslezak/workshop/auth_dbus_layer/AuthException.py Wed Jul 2 09:16:00 2008 @@ -2,7 +2,7 @@ class AuthRequiredException(dbus.exceptions.DBusException): def __init__(self, service=''): - DBusException.__init__(self, "Authentification needed for : %s"%msg) + dbus.exceptions.DBusException.__init__(self, "Authentification needed for : %s"%service) def __doc__(): print "exception which is throwed when user must authentificate before call dbus method." @@ -11,7 +11,7 @@ class AccessDenied(dbus.exceptions.DBusException): def __init__(self, service=''): - DBusException.__init__(self, "Policykit denied access to service: %s"%msg) + dbus.exceptions.DBusException.__init__(self, "Policykit denied access to service: %s"%service) def __doc__(): print "exception which is throwed when user cannot use this service." Modified: branches/tmp/lslezak/workshop/auth_dbus_layer/Makefile URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/auth_dbus_layer/Makefile?rev=48745&r1=48744&r2=48745&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/auth_dbus_layer/Makefile (original) +++ branches/tmp/lslezak/workshop/auth_dbus_layer/Makefile Wed Jul 2 09:16:00 2008 @@ -1,2 +1,2 @@ polkitbind.so: polkit.c - gcc -fPIC -L/lib64 -lpython2.5 -ldbus-1 -lpolkit -lpolkit-dbus -I/usr/include/python -I/usr/include/PolicyKit -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -shared -o polkitbind.so polkit.c + gcc -fPIC -rdynamic -L/lib64 -lpython2.5 -ldbus-1 -lpolkit -lpolkit-dbus -I/usr/include/python -I/usr/include/PolicyKit -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -shared -o polkitbind.so polkit.c Modified: branches/tmp/lslezak/workshop/auth_dbus_layer/polkit.c URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/auth_dbus_layer/polkit.c?rev=48745&r1=48744&r2=48745&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/auth_dbus_layer/polkit.c (original) +++ branches/tmp/lslezak/workshop/auth_dbus_layer/polkit.c Wed Jul 2 09:16:00 2008 @@ -47,16 +47,15 @@ goto finish; } - if (!(polkit_caller_get_ck_session(caller, &session))) { - goto finish; + if (polkit_caller_get_ck_session(caller, &session)) { + /* We need to overwrite the UID in both the caller and the session + * object */ + if (!(polkit_session_set_uid(session, getuid()))) { + goto finish; + } } - /* We need to overwrite the UID in both the caller and the session - * object */ - if (!(polkit_session_set_uid(session, getuid()))) { - goto finish; - } if (!(action = polkit_action_new())) { goto finish; Modified: branches/tmp/lslezak/workshop/auth_dbus_layer/polkitwrapper.py URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/auth_dbus_layer/polkitwrapper.py?rev=48745&r1=48744&r2=48745&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/auth_dbus_layer/polkitwrapper.py (original) +++ branches/tmp/lslezak/workshop/auth_dbus_layer/polkitwrapper.py Wed Jul 2 09:16:00 2008 @@ -2,11 +2,11 @@ import AuthException def PolkitCheck(name): - result = checkPolicyLow(name) + result = polkitbind.checkPolicyLow(name) if result==-3: raise AuthException.AccessDenied(name) elif result==-2: - raise AuthException. AuthRequiredException(name) + raise AuthException.AuthRequiredException(name) return result def __doc__(): -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org