CUBRID Engine  latest
authenticate.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "porting.h"
#include "misc_string.h"
#include "memory_alloc.h"
#include "dbtype.h"
#include "error_manager.h"
#include "boot_cl.h"
#include "work_space.h"
#include "object_primitive.h"
#include "class_object.h"
#include "schema_manager.h"
#include "authenticate.h"
#include "set_object.h"
#include "object_accessor.h"
#include "encryption.h"
#include "crypt_opfunc.h"
#include "message_catalog.h"
#include "string_opfunc.h"
#include "locator_cl.h"
#include "virtual_object.h"
#include "db.h"
#include "trigger_manager.h"
#include "transform.h"
#include "environment_variable.h"
#include "execute_schema.h"
#include "jsp_cl.h"
#include "object_print.h"
#include "execute_statement.h"
#include "optimizer.h"
#include "network_interface_cl.h"
#include "printer.hpp"

Go to the source code of this file.

Classes

struct  au_grant
 
struct  au_class_cache
 
struct  au_user_cache
 
struct  class_grant
 
struct  class_user
 
struct  class_auth
 

Macros

#define MSGCAT_AUTH_INVALID_CACHE   1
 
#define MSGCAT_AUTH_CLASS_NAME   2
 
#define MSGCAT_AUTH_FROM_USER   3
 
#define MSGCAT_AUTH_USER_TITLE   4
 
#define MSGCAT_AUTH_UNDEFINED_USER   5
 
#define MSGCAT_AUTH_USER_NAME   6
 
#define MSGCAT_AUTH_USER_ID   7
 
#define MSGCAT_AUTH_USER_MEMBERS   8
 
#define MSGCAT_AUTH_USER_GROUPS   9
 
#define MSGCAT_AUTH_USER_NAME2   10
 
#define MSGCAT_AUTH_CURRENT_USER   11
 
#define MSGCAT_AUTH_ROOT_TITLE   12
 
#define MSGCAT_AUTH_ROOT_USERS   13
 
#define MSGCAT_AUTH_GRANT_DUMP_ERROR   14
 
#define MSGCAT_AUTH_AUTH_TITLE   15
 
#define MSGCAT_AUTH_USER_DIRECT_GROUPS   16
 
#define GRANT_ENTRY_LENGTH   3
 
#define GRANT_ENTRY_CLASS(index)   (index )
 
#define GRANT_ENTRY_SOURCE(index)   ((index) + 1)
 
#define GRANT_ENTRY_CACHE(index)   ((index) + 2)
 
#define PASSWORD_ENCRYPTION_SEED   "U9a$y1@zw~a0%"
 
#define ENCODE_PREFIX_DEFAULT   (char)0
 
#define ENCODE_PREFIX_DES   (char)1
 
#define ENCODE_PREFIX_SHA1   (char)2
 
#define ENCODE_PREFIX_SHA2_512   (char)3
 
#define IS_ENCODED_DES(string)   (string[0] == ENCODE_PREFIX_DES)
 
#define IS_ENCODED_SHA1(string)   (string[0] == ENCODE_PREFIX_SHA1)
 
#define IS_ENCODED_SHA2_512(string)   (string[0] == ENCODE_PREFIX_SHA2_512)
 
#define IS_ENCODED_ANY(string)   (IS_ENCODED_SHA2_512 (string) || IS_ENCODED_SHA1 (string) || IS_ENCODED_DES (string))
 
#define IS_STRING(n)   DB_IS_STRING (n)
 
#define IS_CATALOG_CLASS(name)
 
#define AU_MIN_BIT   1 /* AU_SELECT */
 
#define AU_MAX_BIT   0x40 /* AU_EXECUTE */
 

Typedefs

typedef enum fetch_by FETCH_BY
 
typedef struct au_grant AU_GRANT
 
typedef struct au_class_cache AU_CLASS_CACHE
 
typedef struct au_user_cache AU_USER_CACHE
 
typedef struct class_grant CLASS_GRANT
 
typedef struct class_user CLASS_USER
 
typedef struct class_auth CLASS_AUTH
 

Enumerations

enum  fetch_by { DONT_KNOW, BY_INSTANCE_MOP, BY_CLASS_MOP }
 

Functions

void get_attribute_number (DB_OBJECT *target, DB_VALUE *result, DB_VALUE *attr_name)
 
static int au_get_set (MOP obj, const char *attname, DB_SET **set)
 
static int au_get_object (MOP obj, const char *attname, MOP *mop_ptr)
 
static int au_set_get_obj (DB_SET *set, int index, MOP *obj)
 
static AU_CLASS_CACHEau_make_class_cache (int depth)
 
static void au_free_class_cache (AU_CLASS_CACHE *cache)
 
static AU_CLASS_CACHEau_install_class_cache (SM_CLASS *sm_class)
 
static int au_extend_class_caches (int *index)
 
static int au_find_user_cache_index (DB_OBJECT *user, int *index, int check_it)
 
static void free_user_cache (AU_USER_CACHE *u)
 
static void reset_cache_for_user_and_class (SM_CLASS *sm_class)
 
static void remove_user_cache_references (MOP user)
 
static void init_caches (void)
 
static void flush_caches (void)
 
static MOP au_make_user (const char *name)
 
static int au_set_new_auth (MOP au_obj, MOP grantor, MOP user, MOP class_mop, DB_AUTH auth_type, bool grant_option)
 
static MOP au_get_new_auth (MOP grantor, MOP user, MOP class_mop, DB_AUTH auth_type)
 
static int au_insert_new_auth (MOP grantor, MOP user, MOP class_mop, DB_AUTH auth_type, int grant_option)
 
static int au_update_new_auth (MOP grantor, MOP user, MOP class_mop, DB_AUTH auth_type, int grant_option)
 
static int au_delete_new_auth (MOP grantor, MOP user, MOP class_mop, DB_AUTH auth_type)
 
static int au_propagate_del_new_auth (AU_GRANT *glist, DB_AUTH mask)
 
static int check_user_name (const char *name)
 
static void encrypt_password (const char *pass, int add_prefix, char *dest)
 
static void encrypt_password_sha1 (const char *pass, int add_prefix, char *dest)
 
static void encrypt_password_sha2_512 (const char *pass, char *dest)
 
static bool match_password (const char *user, const char *database)
 
static int au_set_password_internal (MOP user, const char *password, int encode, char encrypt_prefix)
 
static int au_add_direct_groups (DB_SET *new_groups, DB_VALUE *value)
 
static int au_compute_groups (MOP member, const char *name)
 
static int au_add_member_internal (MOP group, MOP member, int new_user)
 
static int find_grant_entry (DB_SET *grants, MOP class_mop, MOP grantor)
 
static int add_grant_entry (DB_SET *grants, MOP class_mop, MOP grantor)
 
static void drop_grant_entry (DB_SET *grants, int index)
 
static int get_grants (MOP auth, DB_SET **grant_ptr, int filter)
 
static int apply_grants (MOP auth, MOP class_mop, unsigned int *bits)
 
static int update_cache (MOP classop, SM_CLASS *sm_class, AU_CLASS_CACHE *cache)
 
static int appropriate_error (unsigned int bits, unsigned int requested)
 
static int check_grant_option (MOP classop, SM_CLASS *sm_class, DB_AUTH type)
 
static void free_grant_list (AU_GRANT *grants)
 
static int collect_class_grants (MOP class_mop, DB_AUTH type, MOP revoked_auth, int revoked_grant_index, AU_GRANT **return_grants)
 
static void map_grant_list (AU_GRANT *grants, MOP grantor)
 
static int propagate_revoke (AU_GRANT *grant_list, MOP owner, DB_AUTH mask)
 
static int is_protected_class (MOP classmop, SM_CLASS *sm_class, DB_AUTH auth)
 
static int check_authorization (MOP classobj, SM_CLASS *sm_class, DB_AUTH type)
 
static int fetch_class (MOP op, MOP *return_mop, SM_CLASS **return_class, AU_FETCHMODE fetchmode, FETCH_BY fetch_by)
 
static int au_fetch_class_internal (MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type, FETCH_BY fetch_by)
 
static int fetch_instance (MOP op, MOBJ *obj_ptr, AU_FETCHMODE fetchmode, LC_FETCH_VERSION_TYPE read_fetch_version_type)
 
static int au_perform_login (const char *name, const char *password, bool ignore_dba_privilege)
 
static CLASS_GRANTmake_class_grant (CLASS_USER *user, int cache)
 
static CLASS_USERmake_class_user (MOP user_obj)
 
static void free_class_grants (CLASS_GRANT *grants)
 
static void free_class_users (CLASS_USER *users)
 
static CLASS_USERfind_or_add_user (CLASS_AUTH *auth, MOP user_obj)
 
static int add_class_grant (CLASS_AUTH *auth, MOP source, MOP user, int cache)
 
static int build_class_grant_list (CLASS_AUTH *cl_auth, MOP class_mop)
 
static void issue_grant_statement (print_output &output_ctx, CLASS_AUTH *auth, CLASS_GRANT *grant, int authbits)
 
static int class_grant_loop (print_output &output_ctx, CLASS_AUTH *auth)
 
static void au_print_cache (int cache, FILE *fp)
 
static void au_print_grant_entry (DB_SET *grants, int grant_index, FILE *fp)
 
static void au_print_auth (MOP auth, FILE *fp)
 
static int au_change_serial_owner (MOP *object, MOP new_owner)
 
void au_free_authorization_cache (void *cache)
 
void au_reset_authorization_caches (void)
 
MOP au_find_user (const char *user_name)
 
int au_find_user_to_drop (const char *user_name, MOP *user)
 
void au_find_user_method (MOP class_mop, DB_VALUE *returnval, DB_VALUE *name)
 
int au_force_write_new_auth (void)
 
int au_delete_auth_of_dropping_table (const char *class_name)
 
bool au_is_dba_group_member (MOP user)
 
MOP au_add_user (const char *name, int *exists)
 
void au_add_user_method (MOP class_mop, DB_VALUE *returnval, DB_VALUE *name, DB_VALUE *password)
 
char * au_user_name_dup (void)
 
int au_set_password (MOP user, const char *password)
 
void au_set_password_method (MOP user, DB_VALUE *returnval, DB_VALUE *password)
 
void au_set_password_encoded_method (MOP user, DB_VALUE *returnval, DB_VALUE *password)
 
void au_set_password_encoded_sha1_method (MOP user, DB_VALUE *returnval, DB_VALUE *password)
 
int au_set_user_comment (MOP user, const char *comment)
 
int au_add_member (MOP group, MOP member)
 
void au_add_member_method (MOP user, DB_VALUE *returnval, DB_VALUE *memval)
 
int au_drop_member (MOP group, MOP member)
 
void au_drop_member_method (MOP user, DB_VALUE *returnval, DB_VALUE *memval)
 
int au_drop_user (MOP user)
 
void au_drop_user_method (MOP root, DB_VALUE *returnval, DB_VALUE *name)
 
int au_grant (MOP user, MOP class_mop, DB_AUTH type, bool grant_option)
 
int au_revoke (MOP user, MOP class_mop, DB_AUTH type)
 
int au_change_owner (MOP classmop, MOP owner)
 
void au_change_owner_method (MOP obj, DB_VALUE *returnval, DB_VALUE *class_, DB_VALUE *owner)
 
void au_change_serial_owner_method (MOP obj, DB_VALUE *returnval, DB_VALUE *serial, DB_VALUE *owner)
 
int au_change_trigger_owner (MOP trigger, MOP owner)
 
void au_change_trigger_owner_method (MOP obj, DB_VALUE *returnval, DB_VALUE *trigger, DB_VALUE *owner)
 
MOP au_get_class_owner (MOP classmop)
 
void au_get_owner_method (MOP obj, DB_VALUE *returnval, DB_VALUE *class_)
 
void au_check_authorization_method (MOP obj, DB_VALUE *returnval, DB_VALUE *class_, DB_VALUE *auth)
 
int au_add_method_check_authorization (void)
 
int au_change_sp_owner (MOP sp, MOP owner)
 
void au_change_sp_owner_method (MOP obj, DB_VALUE *returnval, DB_VALUE *sp, DB_VALUE *owner)
 
int au_check_user (void)
 
const char * au_user_name (void)
 
bool au_has_user_name (void)
 
int au_fetch_class (MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
 
int au_fetch_class_by_instancemop (MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
 
int au_fetch_class_by_classmop (MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
 
int au_fetch_class_force (MOP op, SM_CLASS **class_, AU_FETCHMODE fetchmode)
 
int au_check_authorization (MOP op, DB_AUTH auth)
 
int au_fetch_instance (MOP op, MOBJ *obj_ptr, AU_FETCHMODE mode, LC_FETCH_VERSION_TYPE fetch_version_type, DB_AUTH type)
 
int au_fetch_instance_force (MOP op, MOBJ *obj_ptr, AU_FETCHMODE fetchmode, LC_FETCH_VERSION_TYPE fetch_version_type)
 
void au_disable_passwords (void)
 
int au_set_user (MOP newuser)
 
int au_login (const char *name, const char *password, bool ignore_dba_privilege)
 
void au_login_method (MOP class_mop, DB_VALUE *returnval, DB_VALUE *user, DB_VALUE *password)
 
int au_start (void)
 
char * au_get_user_name (MOP obj)
 
int au_export_users (print_output &output_ctx)
 
int au_export_grants (print_output &output_ctx, MOP class_mop)
 
void au_dump_auth (FILE *fp)
 
void au_dump_user (MOP user, FILE *fp)
 
void au_dump_to_file (FILE *fp)
 
void au_dump (void)
 
void au_describe_user_method (MOP user, DB_VALUE *returnval)
 
void au_info_method (MOP class_mop, DB_VALUE *returnval, DB_VALUE *info)
 
void au_describe_root_method (MOP class_mop, DB_VALUE *returnval, DB_VALUE *info)
 
void au_link_static_methods (void)
 
int au_install (void)
 
void au_init (void)
 
void au_final (void)
 
int au_get_class_privilege (DB_OBJECT *mop, unsigned int *auth)
 
int au_disable (void)
 
void au_enable (int save)
 
MOP au_get_public_user (void)
 
MOP au_get_dba_user (void)
 
int au_check_serial_authorization (MOP serial_object)
 
const char * au_get_public_user_name (void)
 
const char * au_get_user_class_name (void)
 

Variables

const char * AU_ROOT_CLASS_NAME = "db_root"
 
const char * AU_OLD_ROOT_CLASS_NAME = "db_authorizations"
 
const char * AU_USER_CLASS_NAME = "db_user"
 
const char * AU_PASSWORD_CLASS_NAME = "db_password"
 
const char * AU_AUTH_CLASS_NAME = "db_authorization"
 
const char * AU_GRANT_CLASS_NAME = "db_grant"
 
const char * AU_PUBLIC_USER_NAME = "PUBLIC"
 
const char * AU_DBA_USER_NAME = "DBA"
 
MOP Au_root = NULL
 
int Au_disable = 1
 
static int Au_ignore_passwords = 0
 
MOP Au_public_user = NULL
 
MOP Au_dba_user = NULL
 
MOP Au_user = NULL
 
static char Au_user_name [DB_MAX_USER_LENGTH+4] = { '\0' }
 
char Au_user_password_des_oldstyle [AU_MAX_PASSWORD_BUF+4] = { '\0' }
 
char Au_user_password_sha1 [AU_MAX_PASSWORD_BUF+4] = { '\0' }
 
char Au_user_password_sha2_512 [AU_MAX_PASSWORD_BUF+4] = { '\0' }
 
static DB_OBJECTAu_authorizations_class
 
static DB_OBJECTAu_authorization_class
 
static DB_OBJECTAu_user_class
 
static DB_OBJECTAu_password_class
 
static AU_USER_CACHEAu_user_cache = NULL
 
static AU_CLASS_CACHEAu_class_caches = NULL
 
static int Au_cache_depth = 0
 
static int Au_cache_max = 0
 
static int Au_cache_increment = 4
 
static int Au_cache_index = -1
 
static const char * auth_type_name []
 
static DB_METHOD_LINK au_static_links []
 

Macro Definition Documentation

#define AU_MAX_BIT   0x40 /* AU_EXECUTE */

Referenced by class_grant_loop().

#define AU_MIN_BIT   1 /* AU_SELECT */

Referenced by class_grant_loop().

#define ENCODE_PREFIX_DEFAULT   (char)0

Definition at line 136 of file authenticate.c.

#define ENCODE_PREFIX_DES   (char)1
#define ENCODE_PREFIX_SHA1   (char)2
#define ENCODE_PREFIX_SHA2_512   (char)3
#define GRANT_ENTRY_SOURCE (   index)    ((index) + 1)
#define IS_CATALOG_CLASS (   name)
Value:
(strcmp(name, CT_CLASS_NAME) == 0 || \
strcmp(name, CT_ATTRIBUTE_NAME) == 0 || \
strcmp(name, CT_DOMAIN_NAME) == 0 || \
strcmp(name, CT_METHOD_NAME) == 0 || \
strcmp(name, CT_METHSIG_NAME) == 0 || \
strcmp(name, CT_METHARG_NAME) == 0 || \
strcmp(name, CT_METHFILE_NAME) == 0 || \
strcmp(name, CT_QUERYSPEC_NAME) == 0 || \
strcmp(name, CT_RESOLUTION_NAME) ==0 || \
strcmp(name, CT_INDEX_NAME) == 0 || \
strcmp(name, CT_INDEXKEY_NAME) == 0 || \
strcmp(name, CT_CLASSAUTH_NAME) == 0 || \
strcmp(name, CT_DATATYPE_NAME) == 0 || \
strcmp(name, CT_STORED_PROC_NAME) == 0 || \
strcmp(name, CT_STORED_PROC_ARGS_NAME) == 0 || \
strcmp(name, CT_PARTITION_NAME) == 0 || \
strcmp(name, CT_SERIAL_NAME) == 0 || \
strcmp(name, CT_USER_NAME) == 0 || \
strcmp(name, CT_COLLATION_NAME) == 0 || \
strcmp(name, CT_HA_APPLY_INFO_NAME) == 0 || \
strcmp(name, CT_TRIGGER_NAME) == 0 || \
strcmp(name, CT_ROOT_NAME) == 0 || \
strcmp(name, CT_PASSWORD_NAME) == 0 || \
strcmp(name, CT_AUTHORIZATION_NAME) == 0 || \
strcmp(name, CT_AUTHORIZATIONS_NAME) == 0 || \
strcmp(name, CT_CHARSET_NAME) == 0 || \
strcmp(name, CT_DUAL_NAME) == 0)
#define CT_ATTRIBUTE_NAME
Definition: transform.h:120
#define CT_DATATYPE_NAME
Definition: transform.h:131
#define CT_CLASSAUTH_NAME
Definition: transform.h:130
#define CT_METHOD_NAME
Definition: transform.h:122
#define CT_AUTHORIZATIONS_NAME
Definition: transform.h:143
#define CT_DOMAIN_NAME
Definition: transform.h:121
#define CT_METHSIG_NAME
Definition: transform.h:123
#define CT_AUTHORIZATION_NAME
Definition: transform.h:142
#define CT_STORED_PROC_NAME
Definition: transform.h:132
#define CT_METHFILE_NAME
Definition: transform.h:125
#define CT_DUAL_NAME
Definition: transform.h:145
#define CT_CLASS_NAME
Definition: transform.h:119
#define CT_PARTITION_NAME
Definition: transform.h:134
#define CT_SERIAL_NAME
Definition: transform.h:135
#define CT_STORED_PROC_ARGS_NAME
Definition: transform.h:133
#define CT_HA_APPLY_INFO_NAME
Definition: transform.h:136
#define CT_USER_NAME
Definition: transform.h:138
#define CT_INDEX_NAME
Definition: transform.h:128
#define CT_METHARG_NAME
Definition: transform.h:124
#define CT_QUERYSPEC_NAME
Definition: transform.h:126
#define CT_COLLATION_NAME
Definition: transform.h:137
#define CT_TRIGGER_NAME
Definition: transform.h:139
#define CT_INDEXKEY_NAME
Definition: transform.h:129
#define CT_ROOT_NAME
Definition: transform.h:140
#define CT_PASSWORD_NAME
Definition: transform.h:141
#define CT_RESOLUTION_NAME
Definition: transform.h:127
#define CT_CHARSET_NAME
Definition: transform.h:144

Definition at line 150 of file authenticate.c.

Referenced by is_protected_class().

#define IS_ENCODED_ANY (   string)    (IS_ENCODED_SHA2_512 (string) || IS_ENCODED_SHA1 (string) || IS_ENCODED_DES (string))

Definition at line 143 of file authenticate.c.

Referenced by match_password().

#define IS_ENCODED_DES (   string)    (string[0] == ENCODE_PREFIX_DES)

Definition at line 140 of file authenticate.c.

Referenced by au_export_users(), and match_password().

#define IS_ENCODED_SHA1 (   string)    (string[0] == ENCODE_PREFIX_SHA1)

Definition at line 141 of file authenticate.c.

Referenced by au_export_users(), and match_password().

#define IS_ENCODED_SHA2_512 (   string)    (string[0] == ENCODE_PREFIX_SHA2_512)
#define MSGCAT_AUTH_AUTH_TITLE   15

Definition at line 98 of file authenticate.c.

Referenced by au_dump_to_file().

#define MSGCAT_AUTH_CLASS_NAME   2

Definition at line 85 of file authenticate.c.

Referenced by au_print_grant_entry().

#define MSGCAT_AUTH_CURRENT_USER   11

Definition at line 94 of file authenticate.c.

Referenced by au_dump_to_file().

#define MSGCAT_AUTH_FROM_USER   3

Definition at line 86 of file authenticate.c.

Referenced by au_print_grant_entry().

#define MSGCAT_AUTH_GRANT_DUMP_ERROR   14

Definition at line 97 of file authenticate.c.

Referenced by au_export_grants().

#define MSGCAT_AUTH_INVALID_CACHE   1

Definition at line 84 of file authenticate.c.

Referenced by au_print_cache().

#define MSGCAT_AUTH_ROOT_TITLE   12

Definition at line 95 of file authenticate.c.

#define MSGCAT_AUTH_ROOT_USERS   13

Definition at line 96 of file authenticate.c.

Referenced by au_dump_to_file().

#define MSGCAT_AUTH_UNDEFINED_USER   5

Definition at line 88 of file authenticate.c.

Referenced by au_print_auth().

#define MSGCAT_AUTH_USER_DIRECT_GROUPS   16

Definition at line 99 of file authenticate.c.

Referenced by au_dump_user().

#define MSGCAT_AUTH_USER_GROUPS   9

Definition at line 92 of file authenticate.c.

Referenced by au_dump_user().

#define MSGCAT_AUTH_USER_ID   7

Definition at line 90 of file authenticate.c.

#define MSGCAT_AUTH_USER_MEMBERS   8

Definition at line 91 of file authenticate.c.

#define MSGCAT_AUTH_USER_NAME   6

Definition at line 89 of file authenticate.c.

Referenced by au_dump_user().

#define MSGCAT_AUTH_USER_NAME2   10

Definition at line 93 of file authenticate.c.

Referenced by au_dump_user().

#define MSGCAT_AUTH_USER_TITLE   4

Definition at line 87 of file authenticate.c.

Referenced by au_print_auth().

#define PASSWORD_ENCRYPTION_SEED   "U9a$y1@zw~a0%"

Definition at line 135 of file authenticate.c.

Referenced by encrypt_password().

Typedef Documentation

Definition at line 223 of file authenticate.c.

typedef struct au_grant AU_GRANT

Definition at line 193 of file authenticate.c.

typedef struct au_user_cache AU_USER_CACHE

Definition at line 240 of file authenticate.c.

typedef struct class_auth CLASS_AUTH

Definition at line 284 of file authenticate.c.

typedef struct class_grant CLASS_GRANT

Definition at line 254 of file authenticate.c.

typedef struct class_user CLASS_USER

Definition at line 268 of file authenticate.c.

typedef enum fetch_by FETCH_BY

Definition at line 185 of file authenticate.c.

Enumeration Type Documentation

enum fetch_by
Enumerator
DONT_KNOW 
BY_INSTANCE_MOP 
BY_CLASS_MOP 

Definition at line 179 of file authenticate.c.

Function Documentation

static int add_class_grant ( CLASS_AUTH auth,
MOP  source,
MOP  user,
int  cache 
)
static
static int add_grant_entry ( DB_SET grants,
MOP  class_mop,
MOP  grantor 
)
static

Definition at line 3744 of file authenticate.c.

References db_make_int(), db_make_object(), GRANT_ENTRY_CACHE, GRANT_ENTRY_CLASS, GRANT_ENTRY_SOURCE, set_put_element(), and set_size().

Referenced by au_grant().

Here is the caller graph for this function:

static int apply_grants ( MOP  auth,
MOP  class_mop,
unsigned int *  bits 
)
static

Definition at line 3986 of file authenticate.c.

References db_get_int(), db_get_object(), error(), get_grants(), GRANT_ENTRY_CACHE, GRANT_ENTRY_CLASS, GRANT_ENTRY_LENGTH, au_grant::grants, i, NO_ERROR, set_free(), set_get_element(), and set_size().

Referenced by update_cache().

Here is the caller graph for this function:

static int appropriate_error ( unsigned int  bits,
unsigned int  requested 
)
static
static int au_add_direct_groups ( DB_SET new_groups,
DB_VALUE value 
)
static

Definition at line 2861 of file authenticate.c.

References au_get_set(), db_get_object(), DB_IS_NULL, db_set_add(), error(), NO_ERROR, NULL, set_cardinality(), set_free(), and set_get_element().

Referenced by au_compute_groups(), and au_drop_user().

Here is the caller graph for this function:

int au_add_member ( MOP  group,
MOP  member 
)

Definition at line 3134 of file authenticate.c.

References au_add_member_internal().

Referenced by au_add_member_method(), db_add_member(), and parse_user_define_line().

Here is the caller graph for this function:

static int au_add_member_internal ( MOP  group,
MOP  member,
int  new_user 
)
static
int au_add_method_check_authorization ( void  )
int au_change_owner ( MOP  classmop,
MOP  owner 
)

Definition at line 5114 of file authenticate.c.

References ARG_FILE_LINE, sm_class::attributes, au_change_serial_owner(), AU_DISABLE, AU_ENABLE, au_fetch_class_force(), AU_FETCH_UPDATE, au_is_dba_group_member(), sm_attribute::auto_increment, ER_AU_DBA_ONLY, er_set(), ER_WARNING_SEVERITY, error(), sm_attribute::header, locator_flush_class(), sm_component::next, NO_ERROR, NULL, and sm_class::owner.

Referenced by au_change_owner_method(), au_install(), boot_define_attribute(), boot_define_charsets(), boot_define_class(), boot_define_class_authorization(), boot_define_collations(), boot_define_data_type(), boot_define_domain(), boot_define_dual(), boot_define_ha_apply_info(), boot_define_index(), boot_define_index_key(), boot_define_meth_argument(), boot_define_meth_file(), boot_define_meth_sig(), boot_define_method(), boot_define_partition(), boot_define_query_spec(), boot_define_serial(), boot_define_stored_procedure(), boot_define_stored_procedure_arguments(), boot_define_view_attribute(), boot_define_view_attribute_set_domain(), boot_define_view_authorization(), boot_define_view_class(), boot_define_view_db_charset(), boot_define_view_db_collation(), boot_define_view_index(), boot_define_view_index_key(), boot_define_view_method(), boot_define_view_method_argument(), boot_define_view_method_argument_set_domain(), boot_define_view_method_file(), boot_define_view_partition(), boot_define_view_stored_procedure(), boot_define_view_stored_procedure_arguments(), boot_define_view_super_class(), boot_define_view_trigger(), and boot_define_view_vclass().

int au_change_serial_owner ( MOP object,
MOP  new_owner 
)
static
int au_change_sp_owner ( MOP  sp,
MOP  owner 
)

Definition at line 5638 of file authenticate.c.

References ARG_FILE_LINE, AU_DISABLE, AU_ENABLE, au_is_dba_group_member(), db_make_object(), ER_AU_DBA_ONLY, er_set(), ER_WARNING_SEVERITY, error(), NO_ERROR, obj_set(), and SP_ATTR_OWNER.

Referenced by au_change_sp_owner_method().

Here is the caller graph for this function:

int au_change_trigger_owner ( MOP  trigger,
MOP  owner 
)
void au_change_trigger_owner_method ( MOP  obj,
DB_VALUE returnval,
DB_VALUE trigger,
DB_VALUE owner 
)
int au_check_authorization ( MOP  op,
DB_AUTH  auth 
)

Definition at line 6246 of file authenticate.c.

References Au_disable, au_fetch_class(), AU_FETCH_READ, error(), and NO_ERROR.

Referenced by au_check_authorization_method(), check_authorization(), check_target(), do_update_stats(), and load_has_authorization().

Here is the caller graph for this function:

void au_check_authorization_method ( MOP  obj,
DB_VALUE returnval,
DB_VALUE class_,
DB_VALUE auth 
)
int au_check_user ( void  )

Definition at line 5722 of file authenticate.c.

References ARG_FILE_LINE, ER_AU_INVALID_USER, er_set(), ER_WARNING_SEVERITY, error(), NO_ERROR, and NULL.

Referenced by db_get_all_chosen_classes(), sm_fetch_all_base_classes(), sm_fetch_all_classes(), and sm_mark_system_classes().

Here is the caller graph for this function:

static int au_delete_new_auth ( MOP  grantor,
MOP  user,
MOP  class_mop,
DB_AUTH  auth_type 
)
static

Definition at line 1824 of file authenticate.c.

References assert, au_get_new_auth(), DB_AUTH_EXECUTE, er_errid(), error(), NO_ERROR, NULL, obj_delete(), and obj_inst_lock().

Referenced by au_propagate_del_new_auth(), and au_revoke().

Here is the caller graph for this function:

void au_describe_root_method ( MOP  class_mop,
DB_VALUE returnval,
DB_VALUE info 
)

Definition at line 8168 of file authenticate.c.

References au_dump(), au_info_method(), db_make_null(), and NULL.

void au_describe_user_method ( MOP  user,
DB_VALUE returnval 
)

Definition at line 8114 of file authenticate.c.

References au_dump_user(), db_make_null(), and NULL.

int au_disable ( void  )

Definition at line 8619 of file authenticate.c.

References Au_disable.

Referenced by csql(), csql_do_session_cmd(), and main().

Here is the caller graph for this function:

void au_disable_passwords ( void  )

Definition at line 6472 of file authenticate.c.

References Au_ignore_passwords.

void au_dump ( void  )

Definition at line 8100 of file authenticate.c.

References au_dump_to_file().

Referenced by au_describe_root_method().

Here is the caller graph for this function:

void au_enable ( int  save)

Definition at line 8632 of file authenticate.c.

References Au_disable.

static int au_extend_class_caches ( int *  index)
static
int au_fetch_class ( MOP  op,
SM_CLASS **  class_ptr,
AU_FETCHMODE  fetchmode,
DB_AUTH  type 
)

Definition at line 6174 of file authenticate.c.

References au_fetch_class_internal(), and DONT_KNOW.

Referenced by adjust_partition_range(), adjust_partition_size(), api_rmeta_get_info(), au_check_authorization(), check_resolution_name(), db_check_authorization(), db_check_authorization_and_grant_option(), db_find_class_of_index(), db_get_attribute(), db_get_attribute_domain(), db_get_attribute_names(), db_get_attributes(), db_get_class_attribute(), db_get_class_attribute_names(), db_get_class_attributes(), db_get_class_method(), db_get_class_method_names(), db_get_class_methods(), db_get_class_resolutions(), db_get_constraints(), db_get_loader_commands(), db_get_method(), db_get_method_file_names(), db_get_method_files(), db_get_method_function(), db_get_method_names(), db_get_methods(), db_get_ordered_attribute_names(), db_get_ordered_attributes(), db_get_query_specs(), db_get_resolutions(), db_get_shared_attribute(), db_get_shared_attribute_names(), db_get_subclass_names(), db_get_subclasses(), db_get_superclass_names(), db_get_superclasses(), db_is_updatable_attribute(), db_is_updatable_object(), db_seq_create(), db_set_create(), db_set_create_basic(), db_set_create_multi(), do_alter_index_rebuild(), do_alter_partitioning_pre(), do_coalesce_partition_post(), do_coalesce_partition_pre(), do_create_partition(), do_create_partition_constraint(), do_create_trigger(), do_drop_partition_list(), do_drop_partitioned_class(), do_get_partition_keycol(), do_get_partition_parent(), do_get_partition_size(), do_is_partitioned_subclass(), do_promote_partition_by_name(), do_promote_partition_list(), do_recreate_renamed_class_indexes(), do_remove_partition_pre(), do_rename_partition(), do_reorganize_partition_post(), do_save_all_indexes(), emit_index_def(), emit_partition_info(), extract_objects(), fetch_descriptor_class(), find_attribute(), find_attribute_op(), find_shared_attribute(), help_describe_mop(), object_description::init(), class_description::init(), is_replace_or_odku_allowed(), la_repl_add_object(), ldr_act_add_class_all_attrs(), ldr_act_check_missing_non_null_attrs(), locator_mflush_force(), lock_supers(), lock_supers_drop(), make_template(), obj_class_lock(), obj_copy(), obj_delete(), obj_find_multi_attr(), obj_find_multi_desc(), obj_find_object_by_pkey(), obj_find_unique(), obj_inst_lock(), obj_locate_attribute(), obj_send_array(), obj_send_list(), obj_send_va(), obt_find_attribute(), pt_check_alter_partition(), pt_check_filter_index_expr(), pt_check_partitions(), pt_make_flat_name_list(), pt_resolve_using_index(), pt_spec_to_xasl_class_oid_list(), pt_to_insert_xasl(), pt_to_merge_insert_xasl(), pt_to_pred_expr(), sm_add_trigger(), sm_att_info(), sm_check_index_exist(), sm_class_check_uniques(), sm_class_constraints(), sm_class_has_triggers(), sm_delete_class_mop(), sm_drop_constraint(), sm_drop_index(), sm_drop_trigger(), sm_exist_index(), sm_fetch_all_objects_internal(), sm_find_index(), sm_force_method_link(), sm_get_att_name(), sm_get_attribute_descriptor(), sm_get_ch_heap(), sm_get_ch_name(), sm_get_class(), sm_get_class_repid(), sm_get_class_with_statistics(), sm_get_index(), sm_get_method_descriptor(), sm_get_method_source_file(), sm_get_statistics_force(), sm_get_trigger_cache(), sm_invalidate_trigger_cache(), sm_is_partition(), sm_is_subclass(), sm_load_online_index(), sm_object_size_quick(), sm_partitioned_class_type(), sm_prelink_methods(), sm_rename_class(), sm_truncate_class(), sm_truncate_using_delete(), smt_check_foreign_key(), smt_check_index_exist(), smt_copy_class_mop(), smt_delete_super_connect(), smt_edit_class_mop(), smt_find_constraint(), truncate_need_repl_log(), unloaddb(), update_class(), and update_object_tuple().

int au_fetch_class_by_classmop ( MOP  op,
SM_CLASS **  class_ptr,
AU_FETCHMODE  fetchmode,
DB_AUTH  type 
)

Definition at line 6206 of file authenticate.c.

References au_fetch_class_internal(), and BY_CLASS_MOP.

Referenced by sm_class_has_unique_constraint(), sm_exist_index(), and sm_find_subclass_in_hierarchy().

Here is the caller graph for this function:

int au_fetch_class_by_instancemop ( MOP  op,
SM_CLASS **  class_ptr,
AU_FETCHMODE  fetchmode,
DB_AUTH  type 
)

Definition at line 6190 of file authenticate.c.

References au_fetch_class_internal(), and BY_INSTANCE_MOP.

int au_fetch_class_force ( MOP  op,
SM_CLASS **  class_,
AU_FETCHMODE  fetchmode 
)

Definition at line 6223 of file authenticate.c.

References DONT_KNOW, and fetch_class().

Referenced by abort_subclasses(), allocate_unique_constraint(), alter_trigger_hierarchy(), annotate_method_files(), au_change_owner(), au_change_owner_method(), au_get_class_owner(), au_grant(), au_revoke(), check_domain_class_type(), check_for_cons(), check_resolution_target(), classobj_copy_constraint_like(), classobj_copy_props(), classobj_is_exist_foreign_key_ref(), collect_hier_class_info(), db_get_attribute_force(), db_get_attributes_force(), db_is_any_class(), db_is_class(), db_is_vclass(), object_printer::describe_constraint(), do_evaluate_default_expr(), domain_search(), drop_foreign_key_ref_internal(), emit_schema(), fill_in_insert_default_function_arguments(), find_superclass(), flatten_method_files(), flatten_properties(), flatten_subclasses(), flatten_trigger_cache(), get_candidates(), inherit_constraint(), lock_subclasses_internal(), obj_get_att(), object_to_trigger(), pt_append_omitted_on_update_expr_assignments(), pt_bind_names_post(), pt_check_show_index(), pt_check_table_in_show_heap(), pt_find_omitted_default_expr(), pt_flush_classes(), pt_has_modified_class_helper(), pt_make_subclass_list(), pt_resolve_partition_spec(), retain_former_ids(), sm_check_class_domain(), sm_check_reuse_oid_class(), sm_coerce_object_domain(), sm_destroy_representations(), sm_fetch_all_base_classes(), sm_get_ch_name(), sm_get_class_collation(), sm_get_class_flag(), sm_get_class_tde_algorithm(), sm_is_nested_view_recached(), sm_is_partitioned_class(), sm_is_reuse_oid_class(), sm_mark_system_class(), sm_mark_system_classes(), sm_save_constraint_info(), sm_set_class_collation(), sm_set_class_comment(), sm_set_class_flag(), sm_set_class_tde_algorithm(), sm_update_statistics(), sm_virtual_queries(), smt_find_owner_of_constraint(), update_foreign_key_ref(), update_subclasses(), update_supers(), update_supers_drop(), vid_build_non_upd_object(), vid_compare_non_updatable_objects(), and ws_update_oid_and_class().

void au_final ( void  )

Definition at line 8518 of file authenticate.c.

References Au_disable, flush_caches(), and NULL.

Referenced by boot_client_all_finalize(), boot_initialize_client(), and boot_restart_client().

Here is the caller graph for this function:

static int au_find_user_cache_index ( DB_OBJECT user,
int *  index,
int  check_it 
)
static
void au_free_authorization_cache ( void *  cache)

Definition at line 784 of file authenticate.c.

References au_free_class_cache(), au_class_cache::next, and NULL.

static void au_free_class_cache ( AU_CLASS_CACHE cache)
static

Definition at line 742 of file authenticate.c.

References free_and_init, and NULL.

Referenced by au_extend_class_caches(), au_free_authorization_cache(), and flush_caches().

Here is the caller graph for this function:

MOP au_get_class_owner ( MOP  classmop)

Definition at line 5480 of file authenticate.c.

References Au_dba_user, au_fetch_class_force(), AU_FETCH_READ, NO_ERROR, NULL, and sm_class::owner.

Referenced by au_export_grants(), au_get_owner_method(), db_get_owner(), emit_class_owner(), and get_grants().

Here is the caller graph for this function:

int au_get_class_privilege ( DB_OBJECT mop,
unsigned int *  auth 
)
MOP au_get_dba_user ( void  )

Definition at line 8652 of file authenticate.c.

References Au_dba_user.

static int au_get_object ( MOP  obj,
const char *  attname,
MOP mop_ptr 
)
static
MOP au_get_public_user ( void  )

Definition at line 8642 of file authenticate.c.

References Au_public_user.

const char* au_get_public_user_name ( void  )

Definition at line 8706 of file authenticate.c.

References AU_PUBLIC_USER_NAME.

Referenced by uci_connect().

Here is the caller graph for this function:

const char* au_get_user_class_name ( void  )

Definition at line 8712 of file authenticate.c.

References AU_USER_CLASS_NAME.

int au_grant ( MOP  user,
MOP  class_mop,
DB_AUTH  type,
bool  grant_option 
)

Definition at line 4383 of file authenticate.c.

References add_grant_entry(), ARG_FILE_LINE, AU_DISABLE, AU_ENABLE, au_fetch_class_force(), au_fetch_instance(), AU_FETCH_READ, AU_FETCH_UPDATE, au_get_object(), au_grant(), AU_GRANT_SHIFT, au_insert_new_auth(), AU_NO_AUTHORIZATION, AU_TYPE_MASK, AU_UPDATE, au_update_new_auth(), AU_USER_CLASS_NAME, catcls_Enable, check_grant_option(), DB_AUTH_NONE, db_get_int(), db_make_int(), DB_NOT_PARTITIONED_CLASS, DB_PARTITIONED_CLASS, ER_AU_ACCESS_ERROR, ER_AU_CANT_GRANT_OWNER, ER_AU_CANT_UPDATE, ER_ERROR_SEVERITY, ER_LK_UNILATERALLY_ABORTED, er_set(), ER_WARNING_SEVERITY, error(), find_grant_entry(), free_and_init, get_grants(), GRANT_ENTRY_CACHE, au_grant::grants, i, LC_FETCH_MVCC_VERSION, NO_ERROR, NULL, obj_inst_lock(), sm_class::owner, reset_cache_for_user_and_class(), set_free(), set_get_element(), set_put_element(), sm_bump_local_schema_version(), sm_partitioned_class_type(), tran_abort_upto_system_savepoint(), tran_system_savepoint(), UNIQUE_PARTITION_SAVEPOINT_GRANT, and ws_is_same_object().

Referenced by au_add_method_check_authorization(), au_grant(), au_install(), boot_define_dual(), boot_define_ha_apply_info(), boot_define_serial(), boot_define_view_attribute(), boot_define_view_attribute_set_domain(), boot_define_view_authorization(), boot_define_view_class(), boot_define_view_db_charset(), boot_define_view_db_collation(), boot_define_view_index(), boot_define_view_index_key(), boot_define_view_method(), boot_define_view_method_argument(), boot_define_view_method_argument_set_domain(), boot_define_view_method_file(), boot_define_view_partition(), boot_define_view_stored_procedure(), boot_define_view_stored_procedure_arguments(), boot_define_view_super_class(), boot_define_view_trigger(), boot_define_view_vclass(), and db_grant().

bool au_has_user_name ( void  )

Definition at line 5804 of file authenticate.c.

References Au_user_name, NULL, and strlen.

Referenced by boot_restart_client().

Here is the caller graph for this function:

void au_info_method ( MOP  class_mop,
DB_VALUE returnval,
DB_VALUE info 
)

Definition at line 8140 of file authenticate.c.

References db_get_string(), DB_IS_NULL, db_make_null(), help_print_info(), IS_STRING, and NULL.

Referenced by au_describe_root_method().

Here is the caller graph for this function:

void au_init ( void  )

Definition at line 8497 of file authenticate.c.

References Au_disable, init_caches(), and NULL.

Referenced by boot_initialize_client(), and boot_restart_client().

Here is the caller graph for this function:

static int au_insert_new_auth ( MOP  grantor,
MOP  user,
MOP  class_mop,
DB_AUTH  auth_type,
int  grant_option 
)
static

Definition at line 1748 of file authenticate.c.

References au_set_new_auth(), DB_AUTH_EXECUTE, error(), NO_ERROR, and NULL.

Referenced by au_force_write_new_auth(), and au_grant().

Here is the caller graph for this function:

static AU_CLASS_CACHE * au_install_class_cache ( SM_CLASS sm_class)
static
void au_link_static_methods ( void  )

Definition at line 8197 of file authenticate.c.

References db_link_static_methods().

Referenced by conn_restart_client(), and install_static_methods().

Here is the caller graph for this function:

static AU_CLASS_CACHE * au_make_class_cache ( int  depth)
static
static void au_print_cache ( int  cache,
FILE *  fp 
)
static

Definition at line 7710 of file authenticate.c.

References AU_GRANT_SHIFT, auth_type_name, i, MSGCAT_AUTH_INVALID_CACHE, MSGCAT_CATALOG_CUBRID, msgcat_message(), and MSGCAT_SET_AUTHORIZATION.

Referenced by au_print_grant_entry().

Here is the caller graph for this function:

static void au_print_grant_entry ( DB_SET grants,
int  grant_index,
FILE *  fp 
)
static
static int au_propagate_del_new_auth ( AU_GRANT glist,
DB_AUTH  mask 
)
static
void au_reset_authorization_caches ( void  )

Definition at line 1019 of file authenticate.c.

References Au_cache_depth, AU_CACHE_INVALID, au_class_cache::data, i, au_class_cache::next, and NULL.

Referenced by ws_abort_mops(), and ws_clear_all_hints().

Here is the caller graph for this function:

static int au_set_get_obj ( DB_SET set,
int  index,
MOP obj 
)
static

Definition at line 664 of file authenticate.c.

References db_get_object(), DB_IS_NULL, DB_TYPE_OBJECT, DB_VALUE_TYPE, ER_OBJ_DOMAIN_CONFLICT, error(), NO_ERROR, NULL, and set_get_element().

Referenced by update_cache().

Here is the caller graph for this function:

int au_set_password ( MOP  user,
const char *  password 
)

Definition at line 2657 of file authenticate.c.

References au_set_password_internal(), and ENCODE_PREFIX_SHA2_512.

Referenced by au_add_user_method(), au_set_password_method(), db_set_password(), do_alter_user(), and do_create_user().

Here is the caller graph for this function:

void au_set_password_encoded_method ( MOP  user,
DB_VALUE returnval,
DB_VALUE password 
)
void au_set_password_method ( MOP  user,
DB_VALUE returnval,
DB_VALUE password 
)
int au_set_user ( MOP  newuser)
static int au_update_new_auth ( MOP  grantor,
MOP  user,
MOP  class_mop,
DB_AUTH  auth_type,
int  grant_option 
)
static

Definition at line 1779 of file authenticate.c.

References assert, au_get_new_auth(), au_set_new_auth(), DB_AUTH_EXECUTE, er_errid(), error(), NO_ERROR, NULL, and obj_inst_lock().

Referenced by au_grant().

Here is the caller graph for this function:

char* au_user_name_dup ( void  )

Definition at line 2441 of file authenticate.c.

References Au_user_name, and strdup().

Referenced by boot_initialize_client().

Here is the caller graph for this function:

static int check_grant_option ( MOP  classop,
SM_CLASS sm_class,
DB_AUTH  type 
)
static
static int check_user_name ( const char *  name)
static

Definition at line 2094 of file authenticate.c.

References NO_ERROR.

Referenced by au_add_user().

Here is the caller graph for this function:

static int class_grant_loop ( print_output output_ctx,
CLASS_AUTH auth 
)
static
static void drop_grant_entry ( DB_SET grants,
int  index 
)
static

Definition at line 3772 of file authenticate.c.

References GRANT_ENTRY_LENGTH, i, set_drop_seq_element(), and set_size().

Referenced by au_revoke(), get_grants(), and propagate_revoke().

Here is the caller graph for this function:

static void encrypt_password ( const char *  pass,
int  add_prefix,
char *  dest 
)
static

Definition at line 2349 of file authenticate.c.

References AU_MAX_PASSWORD_BUF, crypt_encrypt_printable(), crypt_seed(), ENCODE_PREFIX_DES, NULL, and PASSWORD_ENCRYPTION_SEED.

Referenced by au_login(), and match_password().

Here is the caller graph for this function:

static void encrypt_password_sha1 ( const char *  pass,
int  add_prefix,
char *  dest 
)
static

Definition at line 2378 of file authenticate.c.

References AU_MAX_PASSWORD_BUF, crypt_encrypt_sha1_printable(), ENCODE_PREFIX_SHA1, and NULL.

Referenced by au_login(), and match_password().

Here is the caller graph for this function:

static void encrypt_password_sha2_512 ( const char *  pass,
char *  dest 
)
static

Definition at line 2405 of file authenticate.c.

References assert, crypt_sha_two(), db_private_free_and_init, ENCODE_PREFIX_SHA2_512, NO_ERROR, NULL, and strlen.

Referenced by au_export_users(), au_login(), au_set_password_internal(), and match_password().

Here is the caller graph for this function:

static int find_grant_entry ( DB_SET grants,
MOP  class_mop,
MOP  grantor 
)
static

Definition at line 3711 of file authenticate.c.

References db_get_object(), GRANT_ENTRY_CLASS, GRANT_ENTRY_LENGTH, GRANT_ENTRY_SOURCE, i, set_get_element(), set_size(), and ws_is_same_object().

Referenced by au_grant(), and au_revoke().

Here is the caller graph for this function:

static CLASS_USER * find_or_add_user ( CLASS_AUTH auth,
MOP  user_obj 
)
static

Definition at line 7303 of file authenticate.c.

References make_class_user(), class_user::next, NULL, class_user::obj, class_auth::users, and ws_is_same_object().

Referenced by add_class_grant(), and au_export_grants().

Here is the caller graph for this function:

static void flush_caches ( void  )
static

Definition at line 1081 of file authenticate.c.

References au_free_class_cache(), sm_class::auth_cache, au_class_cache::class_, free_user_cache(), init_caches(), au_class_cache::next, au_user_cache::next, NULL, and strlen.

Referenced by au_final().

Here is the caller graph for this function:

static void free_class_grants ( CLASS_GRANT grants)
static

Definition at line 7264 of file authenticate.c.

References free_and_init, au_grant::next, class_grant::next, and NULL.

Referenced by class_grant_loop(), and free_class_users().

Here is the caller graph for this function:

static void free_class_users ( CLASS_USER users)
static

Definition at line 7281 of file authenticate.c.

References free_and_init, free_class_grants(), class_user::grants, au_grant::next, class_user::next, and NULL.

Referenced by au_export_grants().

Here is the caller graph for this function:

static void free_grant_list ( AU_GRANT grants)
static

Definition at line 4562 of file authenticate.c.

References au_grant::auth_object, db_ws_free(), au_grant::grantor, au_grant::next, NULL, and au_grant::user.

Referenced by au_revoke(), and collect_class_grants().

Here is the caller graph for this function:

static void free_user_cache ( AU_USER_CACHE u)
static

Definition at line 956 of file authenticate.c.

References free_and_init, NULL, and au_user_cache::user.

Referenced by flush_caches().

Here is the caller graph for this function:

void get_attribute_number ( DB_OBJECT target,
DB_VALUE result,
DB_VALUE attr_name 
)
static void init_caches ( void  )
static

Definition at line 1064 of file authenticate.c.

References Au_cache_depth, Au_cache_increment, Au_cache_index, Au_cache_max, and NULL.

Referenced by au_init(), and flush_caches().

Here is the caller graph for this function:

static int is_protected_class ( MOP  classmop,
SM_CLASS sm_class,
DB_AUTH  auth 
)
static

Definition at line 5826 of file authenticate.c.

References AU_ALTER, AU_DELETE, AU_INDEX, AU_INSERT, AU_UPDATE, IS_CATALOG_CLASS, sm_ch_name(), and sm_issystem().

Referenced by check_authorization().

Here is the caller graph for this function:

static void issue_grant_statement ( print_output output_ctx,
CLASS_AUTH auth,
CLASS_GRANT grant,
int  authbits 
)
static
static CLASS_GRANT * make_class_grant ( CLASS_USER user,
int  cache 
)
static

Definition at line 7210 of file authenticate.c.

References class_grant::cache, class_grant::next, NULL, au_grant::user, and class_grant::user.

Referenced by add_class_grant().

Here is the caller graph for this function:

static CLASS_USER * make_class_user ( MOP  user_obj)
static

Definition at line 7229 of file authenticate.c.

References AU_FULL_AUTHORIZATION, class_user::available_auth, class_user::grants, class_user::next, NULL, class_user::obj, and ws_is_same_object().

Referenced by find_or_add_user().

Here is the caller graph for this function:

static void map_grant_list ( AU_GRANT grants,
MOP  grantor 
)
static

Definition at line 4764 of file authenticate.c.

References au_grant::grant_option, au_grant::grantor, au_grant::legal, au_grant::next, NULL, and au_grant::user.

Referenced by propagate_revoke().

Here is the caller graph for this function:

static bool match_password ( const char *  user,
const char *  database 
)
static
static void remove_user_cache_references ( MOP  user)
static

Definition at line 1045 of file authenticate.c.

References au_user_cache::next, NULL, au_user_cache::user, and ws_is_same_object().

Referenced by au_drop_user().

Here is the caller graph for this function:

static void reset_cache_for_user_and_class ( SM_CLASS sm_class)
static

Definition at line 984 of file authenticate.c.

References AU_CACHE_INVALID, au_class_cache::class_, au_class_cache::data, au_user_cache::index, au_class_cache::next, au_user_cache::next, and NULL.

Referenced by au_grant(), and au_revoke().

Here is the caller graph for this function:

Variable Documentation

const char* AU_AUTH_CLASS_NAME = "db_authorization"
DB_OBJECT* Au_authorization_class
static

Definition at line 375 of file authenticate.c.

DB_OBJECT* Au_authorizations_class
static

Definition at line 374 of file authenticate.c.

int Au_cache_depth = 0
static
int Au_cache_increment = 4
static

Definition at line 409 of file authenticate.c.

Referenced by au_extend_class_caches(), and init_caches().

int Au_cache_index = -1
static
int Au_cache_max = 0
static

Definition at line 408 of file authenticate.c.

Referenced by au_extend_class_caches(), au_install_class_cache(), and init_caches().

AU_CLASS_CACHE* Au_class_caches = NULL
static

Definition at line 393 of file authenticate.c.

Referenced by au_install_class_cache().

const char* AU_DBA_USER_NAME = "DBA"

Definition at line 113 of file authenticate.c.

Referenced by au_perform_login(), and au_start().

const char* AU_GRANT_CLASS_NAME = "db_grant"

Definition at line 110 of file authenticate.c.

int Au_ignore_passwords = 0
static

Definition at line 323 of file authenticate.c.

Referenced by au_disable_passwords(), and au_perform_login().

const char* AU_OLD_ROOT_CLASS_NAME = "db_authorizations"

Definition at line 105 of file authenticate.c.

Referenced by au_install().

DB_OBJECT* Au_password_class
static

Definition at line 377 of file authenticate.c.

const char* AU_PASSWORD_CLASS_NAME = "db_password"

Definition at line 108 of file authenticate.c.

Referenced by au_install(), au_set_password_internal(), au_start(), and clist_init().

const char* AU_PUBLIC_USER_NAME = "PUBLIC"
const char* AU_ROOT_CLASS_NAME = "db_root"

Definition at line 104 of file authenticate.c.

Referenced by au_install(), au_start(), and clist_init().

DB_METHOD_LINK au_static_links[]
static
Initial value:
= {
{"au_add_user_method", (METHOD_LINK_FUNCTION) au_add_user_method},
{"au_drop_user_method", (METHOD_LINK_FUNCTION) au_drop_user_method},
{"au_find_user_method", (METHOD_LINK_FUNCTION) au_find_user_method},
{"au_add_member_method", (METHOD_LINK_FUNCTION) au_add_member_method},
{"au_drop_member_method", (METHOD_LINK_FUNCTION) au_drop_member_method},
{"au_set_password_method", (METHOD_LINK_FUNCTION) au_set_password_method},
{"au_set_password_encoded_method", (METHOD_LINK_FUNCTION) au_set_password_encoded_method},
{"au_set_password_encoded_sha1_method", (METHOD_LINK_FUNCTION) au_set_password_encoded_sha1_method},
{"au_describe_user_method", (METHOD_LINK_FUNCTION) au_describe_user_method},
{"au_describe_root_method", (METHOD_LINK_FUNCTION) au_describe_root_method},
{"au_info_method", (METHOD_LINK_FUNCTION) au_info_method},
{"au_login_method", (METHOD_LINK_FUNCTION) au_login_method},
{"au_change_owner_method", (METHOD_LINK_FUNCTION) au_change_owner_method},
{"au_change_trigger_owner_method", (METHOD_LINK_FUNCTION) au_change_trigger_owner_method},
{"au_get_owner_method", (METHOD_LINK_FUNCTION) au_get_owner_method},
{"au_check_authorization_method", (METHOD_LINK_FUNCTION) au_check_authorization_method},
{"qo_set_cost", (METHOD_LINK_FUNCTION) qo_set_cost},
{"get_attribute_number", (METHOD_LINK_FUNCTION) get_attribute_number},
{"dbmeth_class_name", (METHOD_LINK_FUNCTION) dbmeth_class_name},
{"dbmeth_print", (METHOD_LINK_FUNCTION) dbmeth_print},
{"au_change_sp_owner_method", (METHOD_LINK_FUNCTION) au_change_sp_owner_method},
{"au_change_serial_owner_method", (METHOD_LINK_FUNCTION) au_change_serial_owner_method},
}
void au_add_user_method(MOP class_mop, DB_VALUE *returnval, DB_VALUE *name, DB_VALUE *password)
void dbmeth_print(DB_OBJECT *self, DB_VALUE *result, DB_VALUE *msg)
void qo_set_cost(DB_OBJECT *target, DB_VALUE *result, DB_VALUE *plan, DB_VALUE *cost)
void au_set_password_encoded_sha1_method(MOP user, DB_VALUE *returnval, DB_VALUE *password)
void au_drop_user_method(MOP root, DB_VALUE *returnval, DB_VALUE *name)
void au_add_member_method(MOP user, DB_VALUE *returnval, DB_VALUE *memval)
void dbmeth_class_name(DB_OBJECT *self, DB_VALUE *result)
void au_set_password_method(MOP user, DB_VALUE *returnval, DB_VALUE *password)
void au_check_authorization_method(MOP obj, DB_VALUE *returnval, DB_VALUE *class_, DB_VALUE *auth)
void(* METHOD_LINK_FUNCTION)()
Definition: dbtype_def.h:332
void au_set_password_encoded_method(MOP user, DB_VALUE *returnval, DB_VALUE *password)
void au_change_owner_method(MOP obj, DB_VALUE *returnval, DB_VALUE *class_, DB_VALUE *owner)
void au_info_method(MOP class_mop, DB_VALUE *returnval, DB_VALUE *info)
#define NULL
Definition: freelistheap.h:34
void au_change_serial_owner_method(MOP obj, DB_VALUE *returnval, DB_VALUE *serial, DB_VALUE *owner)
void au_describe_user_method(MOP user, DB_VALUE *returnval)
void get_attribute_number(DB_OBJECT *target, DB_VALUE *result, DB_VALUE *attr_name)
void au_change_sp_owner_method(MOP obj, DB_VALUE *returnval, DB_VALUE *sp, DB_VALUE *owner)
void au_describe_root_method(MOP class_mop, DB_VALUE *returnval, DB_VALUE *info)
void au_get_owner_method(MOP obj, DB_VALUE *returnval, DB_VALUE *class_)
void au_find_user_method(MOP class_mop, DB_VALUE *returnval, DB_VALUE *name)
void au_change_trigger_owner_method(MOP obj, DB_VALUE *returnval, DB_VALUE *trigger, DB_VALUE *owner)
void au_login_method(MOP class_mop, DB_VALUE *returnval, DB_VALUE *user, DB_VALUE *password)
void au_drop_member_method(MOP user, DB_VALUE *returnval, DB_VALUE *memval)

Definition at line 439 of file authenticate.c.

AU_USER_CACHE* Au_user_cache = NULL
static

Definition at line 384 of file authenticate.c.

Referenced by au_find_user_cache_index().

DB_OBJECT* Au_user_class
static

Definition at line 376 of file authenticate.c.

char Au_user_name[DB_MAX_USER_LENGTH+4] = { '\0' }
static
char Au_user_password_des_oldstyle[AU_MAX_PASSWORD_BUF+4] = { '\0' }

Definition at line 358 of file authenticate.c.

Referenced by au_login(), and match_password().

char Au_user_password_sha1[AU_MAX_PASSWORD_BUF+4] = { '\0' }

Definition at line 359 of file authenticate.c.

Referenced by au_login(), and match_password().

char Au_user_password_sha2_512[AU_MAX_PASSWORD_BUF+4] = { '\0' }

Definition at line 360 of file authenticate.c.

Referenced by au_login(), au_start(), and match_password().

const char* auth_type_name[]
static
Initial value:
= {
"select", "insert", "update", "delete", "alter", "index", "execute"
}

Definition at line 421 of file authenticate.c.

Referenced by au_print_cache().