00001
00002
00003
00004
00005
00006
00007 #ifndef CHIRP_ACL_H
00008 #define CHIRP_ACL_H
00009
00010 #include <stdio.h>
00011
00012 #define CHIRP_ACL_BASE_NAME ".__acl"
00013 #define CHIRP_ACL_BASE_LENGTH (strlen(CHIRP_ACL_BASE_NAME))
00014
00015 #define CHIRP_ACL_READ (1<<0)
00016 #define CHIRP_ACL_WRITE (1<<1)
00017 #define CHIRP_ACL_LIST (1<<2)
00018 #define CHIRP_ACL_DELETE (1<<3)
00019 #define CHIRP_ACL_ADMIN (1<<4)
00020 #define CHIRP_ACL_EXECUTE (1<<5)
00021 #define CHIRP_ACL_PUT (1<<6)
00022 #define CHIRP_ACL_RESERVE_READ (1<<7)
00023 #define CHIRP_ACL_RESERVE_WRITE (1<<8)
00024 #define CHIRP_ACL_RESERVE_LIST (1<<9)
00025 #define CHIRP_ACL_RESERVE_DELETE (1<<10)
00026 #define CHIRP_ACL_RESERVE_PUT (1<<11)
00027 #define CHIRP_ACL_RESERVE_ADMIN (1<<12)
00028 #define CHIRP_ACL_RESERVE_RESERVE (1<<13)
00029 #define CHIRP_ACL_RESERVE_EXECUTE (1<<14)
00030 #define CHIRP_ACL_RESERVE (1<<15)
00031 #define CHIRP_ACL_ALL (~0)
00032
00033 int chirp_acl_check( const char *filename, const char *subject, int flags );
00034 int chirp_acl_check_dir( const char *dirname, const char *subject, int flags );
00035 int chirp_acl_check_link( const char *linkname, const char *subject, int flags );
00036
00037 int chirp_acl_set( const char *filename, const char *subject, int flags );
00038
00039 FILE * chirp_acl_open( const char *filename );
00040 int chirp_acl_read( FILE *aclfile, char *subject, int *flags );
00041 void chirp_acl_close( FILE *aclfile);
00042
00043 const char * chirp_acl_flags_to_text( int flags );
00044 int chirp_acl_text_to_flags( const char *text );
00045 int chirp_acl_from_access_flags( int flags );
00046 int chirp_acl_from_open_flags( int flags );
00047
00048 void chirp_acl_force_readonly();
00049 void chirp_acl_timeout_set( int t );
00050 int chirp_acl_timeout_get();
00051 void chirp_acl_default( const char *aclpath );
00052
00053 int chirp_acl_init_root( const char *path );
00054 int chirp_acl_init_copy( const char *path );
00055 int chirp_acl_init_reserve( const char *path, const char *subject );
00056
00057 #endif