forked from huawei/openGauss-server
Update encrypt.cpp
This commit is contained in:
parent
4ec1513e05
commit
5f334a5656
|
|
@ -34,6 +34,14 @@
|
|||
static int check_key_num(const char* password);
|
||||
static void create_child_dir(const char* pathdir);
|
||||
|
||||
|
||||
/*
|
||||
function name: check_path
|
||||
description: Check if the string delivered has the character that should not be included
|
||||
arguments: A pointer to string that its type is const char
|
||||
return value: void
|
||||
Note:none
|
||||
*/
|
||||
void check_path(const char *path_name)
|
||||
{
|
||||
const char* danger_character_list[] = {"|",
|
||||
|
|
@ -69,6 +77,14 @@ void check_path(const char *path_name)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
function name: check_key_num
|
||||
description: Check if the password is a null string, if so, then the password is invalid.
|
||||
At the same time, the function check if the length of password exceeds MAX_CRYPT_LEN, if so, print the error.
|
||||
arguments: A pointer to string that its type is const char
|
||||
return value: An integer that its type is static int
|
||||
Note:The length of password should not be zero, and never exceeds MAX_CRYPT_LEN
|
||||
*/
|
||||
static int check_key_num(const char* password)
|
||||
{
|
||||
int key_len = 0;
|
||||
|
|
@ -84,6 +100,13 @@ static int check_key_num(const char* password)
|
|||
return key_len;
|
||||
}
|
||||
|
||||
/*
|
||||
function name: create_child_dir
|
||||
description: 函数作用
|
||||
arguments: A pointer to string that its type is const char
|
||||
return value: static void
|
||||
Note:函数中提醒阅读者需要注意的东西
|
||||
*/
|
||||
static void create_child_dir(const char* pathdir)
|
||||
{
|
||||
if (pathdir == NULL) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue