"""Base class for FD hierarchy.
"""
- __slots__ = ( '_id' , 'acl' )
+ __slots__ = ( '_id' , 'acl' , 'eff_acl' )
type = headers.T_FD
def __new__( cls , id ) :
if id is None :
raise TypeError , 'Invalid id %r' % ( id , )
self._id = id
self.acl = acl.AclByName( self )
+ self.eff_acl = acl.EffectiveAclByName( self )
def __eq__( self , other ) :
return self is other or ( isinstance( other , FDBase )
and self.type == other.type
type = headers.T_DEV # Needed for RcTypeDict
class BlockDeviceBase( DeviceBase ) :
- __slots__ = ( '_dev' , '_id' , 'acl' )
+ __slots__ = ( '_dev' , '_id' , 'acl' , 'eff_acl' )
def __init__( self , major , minor = None ) :
super( BlockDeviceBase , self ).__init__()
self._dev = ( major , minor )
id.dev.major = major
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __eq__( self , other ) :
return self is other or ( isinstance( other , BlockDeviceBase )
and self._dev == other._dev )
headers.T_DEV , False )
class CharacterDeviceBase( DeviceBase ) :
- __slots__ = ( '_dev' , '_id' , 'acl' )
+ __slots__ = ( '_dev' , '_id' , 'acl' , 'eff_acl' )
def __init__( self , major , minor = None ) :
super( CharacterDeviceBase , self ).__init__()
self._dev = ( major , minor )
id.dev.major = major
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __eq__( self , other ) :
return self is other or ( isinstance( other , CharacterDeviceBase )
and self._dev == other._dev )
}
class UserBase( ObjectWithAttributes ) :
- __slots__ = ( 'uid' , '_id' , 'acl' )
+ __slots__ = ( 'uid' , '_id' , 'acl' , 'eff_acl' )
def __new__( cls , user ) :
user = _nuser( user )
if user < 0 :
self.uid = uid
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __int__( self ) :
return int( self.uid )
def __long__( self ) :
}
class GroupBase( ObjectWithAttributes ) :
- __slots__ = ( 'gid' , '_id' , 'acl' )
+ __slots__ = ( 'gid' , '_id' , 'acl' , 'eff_acl' )
def __new__( cls , group ) :
group = _ngroup( group )
if group < 0 :
self.gid = gid
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __int__( self ) :
return int( self.gid )
def __long__( self ) :
#--[ Process ]----------------------------------------------------------------
class ProcessBase( ObjectWithAttributes ) :
- __slots__ = ( 'pid' , '_id' , 'acl' )
+ __slots__ = ( 'pid' , '_id' , 'acl' , 'eff_acl' )
def __init__( self , process ) :
super( ProcessBase , self ).__init__()
id = headers.rsbac_target_id_t()
self.pid = process
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __int__( self ) :
return int( self.pid )
def __long__( self ) :
#--[ IPC ]--------------------------------------------------------------------
class IpcBase( ObjectWithAttributes ) :
- __slots__ = ( '_id' , 'id' , 'acl' )
+ __slots__ = ( '_id' , 'id' , 'acl' , 'eff_acl' )
ipc = headers.I_none
def __init__( self , ipcId ) :
super( IpcBase , self ).__init__()
self._id = byref( id )
self.id = ipcId
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __int__( self ) :
return int( self.id )
def __long__( self ) :
g_scd = {}
class Scd( Object ) :
- __slots__ = ( '_id' , 'id' , 'name' , 'acl' )
+ __slots__ = ( '_id' , 'id' , 'name' , 'acl' , 'eff_acl' )
type = headers.T_SCD
def __new__( cls , target , *args , **kwargs ) :
instance = g_scd.get( target )
self.id = target
self.name = name
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def getRcType( self ) :
return Type( self.type , self.id )
rc_type = property( getRcType )
_g_networkObject = None
class NetworkObject( Object ) :
- __slots__ = ( '_id' , 'acl' )
+ __slots__ = ( '_id' , 'acl' , 'eff_acl' )
type = headers.T_NETOBJ
def __new__( cls ) :
global _g_networkObject
id.netobj.remote_len = 0
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __repr__( self ) :
return '<NetworkObject>'
return sorted( map( byteArrayToString , arr ) )
class NetworkDeviceBase( ObjectWithAttributes ) :
- __slots__ = ( '_name' , '_id' , 'acl' )
+ __slots__ = ( '_name' , '_id' , 'acl' , 'eff_acl' )
def __init__( self , name ) :
super( NetworkDeviceBase , self ).__init__()
id = headers.rsbac_target_id_t()
self._name = name
self._id = byref( id )
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __eq__( self , other ) :
return self is other or ( isinstance( other , NetworkDeviceBase )
and self._name == other._name )
return NetworkTemplate( dest )
class _NetworkTemplateSelf( object ) :
- __slots__ = ( '_id' , 'nt' , 'acl' )
+ __slots__ = ( '_id' , 'nt' , 'acl' , 'eff_acl' )
type = headers.T_NETTEMP_NT
def __init__( self , nt ) :
id = headers.rsbac_target_id_t()
self._id = byref( id )
self.nt = nt
self.acl = acl.AclById( self )
+ self.eff_acl = acl.EffectiveAclById( self )
def __repr__( self ) :
return '<NetworkTemplate[Self] %d>' % self.nt
class NetworkTemplateBase( ObjectWithAttributes ) :
- __slots__ = ( '_id' , 'nt' , 'acl' , 'selfAcl' )
+ __slots__ = ( '_id' , 'nt' , 'acl' , 'eff_acl' , 'selfAcl' , 'eff_selfAcl' )
def __init__( self , nt ) :
super( NetworkTemplateBase , self ).__init__()
id = headers.rsbac_target_id_t()
self._id = byref( id )
self.nt = nt
self.acl = acl.AclById( self )
- self.selfAcl = acl.AclById( _NetworkTemplateSelf( nt ) )
+ self.eff_acl = acl.EffectiveAclByName( self )
+ ntSelf = _NetworkTemplateSelf( nt )
+ self.selfAcl = acl.AclById( ntSelf )
+ self.eff_SelfAcl = acl.EffectiveAclById( ntSelf )
def __repr__( self ) :
try :
name = `self.getName()`