From 5f334a56564024135d0d90f58c68eb04bc3a0376 Mon Sep 17 00:00:00 2001 From: Eao3piq4e Date: Thu, 28 Jul 2022 12:05:27 +0800 Subject: [PATCH] Update encrypt.cpp --- src/bin/gs_guc/encrypt.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/bin/gs_guc/encrypt.cpp b/src/bin/gs_guc/encrypt.cpp index bc03bb4b6..48783362f 100644 --- a/src/bin/gs_guc/encrypt.cpp +++ b/src/bin/gs_guc/encrypt.cpp @@ -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) {