3 # py-rsbac - RSBAC Python bindings
4 # Copyright (C) 2006 Frederic Jolliton <pyrsbac@tuxee.net>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 'adf' , 'module' , 'transaction' , 'objects' , 'rc' , 'um' , 'data' ,
23 'jail' , 'acl' , 'daz' , 'roles' , 'auth' ,
24 'moduleVersion' , 'headerVersion' , 'kernelVersion' ]
27 if sys.version_info < ( 2 , 4 , 0 ) :
28 raise ImportError , 'RSBAC Python bindings requires at least Python 2.4'
30 moduleVersion = ( 0 , 0 , 1 , '' )
32 from rsbac.errors import Error
33 from rsbac._data import *
34 from rsbac._misc import *
35 from rsbac import adf, module, transaction, objects
36 from rsbac import rc, um, data, jail, acl, daz, roles, auth
38 __all__ += _data.__all__
39 __all__ += _misc.__all__
41 # Note: overwrite the functions with their values
42 headerVersion = headerVersion()
43 libraryVersion = libraryVersion()
44 kernelVersion = kernelVersion()
46 if ( not 0 <= kernelVersion[ 0 ] < 10
47 or not 0 <= kernelVersion[ 1 ] < 100
48 or not 0 <= kernelVersion[ 2 ] < 100 ) : # ok up to 10.100.100 version
49 print >> sys.stderr , 'Warning: RSBAC kernel version (%s) doesn\'t look right. Wrong librsbac.so?' \
50 % ( '.'.join( map( str , kernelVersion ) ) )
51 if not ( headerVersion == libraryVersion == kernelVersion ) :
52 print >> sys.stderr , 'Warning: RSBAC version mismatch (header: %s, library: %s, kernel: %s)' \
53 % ( '.'.join( map( str , headerVersion ) ) ,
54 '.'.join( map( str , libraryVersion ) ) ,
55 '.'.join( map( str , kernelVersion ) ) )
59 # indent-tabs-mode: nil