diff --git a/Common/compile.h b/Common/compile.h index 2d77ccbd8..7ad1425a3 100755 --- a/Common/compile.h +++ b/Common/compile.h @@ -1,11 +1,11 @@ /* This file is auto generated,for sGATE version info */ /* Used readelf to get this information form driver of application */ /* "readelf --debug-dump=macro " */ -#define sGATE_COMPILE_DATE "2019-07-01" -#define sGATE_COMPILE_TIME "17:53:10" -#define sGATE_COMPILE_MAJOR "20190701" -#define sGATE_COMPILE_SUB "175310" -#define sGATE_COMPILE_BY "cl" +#define sGATE_COMPILE_DATE "2019-07-04" +#define sGATE_COMPILE_TIME "15:46:50" +#define sGATE_COMPILE_MAJOR "20190704" +#define sGATE_COMPILE_SUB "154650" +#define sGATE_COMPILE_BY "zza" #define sGATE_COMPILE_HOST "esgwdev01" -#define sGATE_GIT_TAGS "aaa812c65-dev" -#define sGATE_GIT_VERS "aaa812c654225f595f12a32bc7d56bcc225f3ee4" +#define sGATE_GIT_TAGS "76e0ad830-dev" +#define sGATE_GIT_VERS "76e0ad8308f233b00aa7c570d17cefe38cc84e3d" diff --git a/Makefile b/Makefile index 9c9fd6394..7d35eac2e 100755 --- a/Makefile +++ b/Makefile @@ -28,9 +28,9 @@ MAKE_FLAGS += -j$(shell cat /proc/cpuinfo | grep processor | wc -l) endif endif -.PHONY : demo conntrack netlink trace openrpc configm redismq +.PHONY : demo conntrack netlink trace openrpc configm redismq usermanager -all: demo conntrack netlink trace openrpc configm redismq +all: demo conntrack netlink trace openrpc configm redismq usermanager ifeq ($(OPT), install) #$(shell `find ../release -name "*.zip" -delete`) @@ -147,3 +147,12 @@ else ifeq ($(OPT), install) else $(MLOG)make all $(MAKE_FLAGS) -C Platform/build -f user.redismq.Makefile MLOG=$(MLOG) DISABLE_WARRING=$(DIS_BUILD_WARRING) MAKE_TARGET=redismq endif + +usermanager: +ifeq ($(OPT), clean) + $(MLOG)make $(MAKE_FLAGS) -C Product/build -f user.usermanager.Makefile cleanall MLOG=$(MLOG) MAKE_TARGET=usermanager +else ifeq ($(OPT), install) + $(MLOG)make $(MAKE_FLAGS) -C Product/build -f user.usermanager.Makefile install DIR=$(DIR) MLOG=$(MLOG) MAKE_TARGET=usermanager +else + $(MLOG)make all $(MAKE_FLAGS) -C Product/build -f user.usermanager.Makefile MLOG=$(MLOG) DISABLE_WARRING=$(DIS_BUILD_WARRING) MAKE_TARGET=usermanager +endif \ No newline at end of file diff --git a/Platform/build/user.configm.Makefile b/Platform/build/user.configm.Makefile index e7d8333bc..25804cce2 100755 --- a/Platform/build/user.configm.Makefile +++ b/Platform/build/user.configm.Makefile @@ -27,7 +27,7 @@ VPATH = ../user/configm/config-server # set the source file, don't used .o because of ... -COMMON_SRCS = configserver.c ipconfig/ipconfig.c ipconfig/parsefile.c authfree_config/authfree.c localportal_config/localportal.c userlock_config/userlock.c jumppage_config/jumppage.c +COMMON_SRCS = configserver.c ipconfig/ipconfig.c ipconfig/parsefile.c authfree_config/authfree.c localportal_config/localportal.c userlock_config/userlock.c jumppage_config/jumppage.c user_manager_config/user_group_config.c # MRS Board Source Files PLAT_LINUX_SRCS = $(COMMON_SRCS) @@ -42,8 +42,8 @@ PLAT_ARM64_LDFLAGS := PLAT_LINUX_LDFLAGS := #gcc libs -ARM64_LIBS := ../thirdparty/arm64/libev-arm64.so ./libopenrpc-arm64.so ./libnetlinku-arm64.so -lpthread -lm -LINUX_LIBS := ../thirdparty/x86_64/libev-linux.so ./libopenrpc-linux.so ./libnetlinku-linux.so -lpthread -lm +ARM64_LIBS := -lcjson ../thirdparty/arm64/libev-arm64.so ./libopenrpc-arm64.so ./libnetlinku-arm64.so ../../Product/build/debug/usermanager-arm64.so -lpthread -lm +LINUX_LIBS := -lcjson ../thirdparty/x86_64/libev-linux.so ./libopenrpc-linux.so ./libnetlinku-linux.so ../../Product/build/debug/usermanager-linux.so -lpthread -lm ifeq ($(PLAT_ARM64), TRUE) DEPEND_LIB += ../thirdparty/arm64/libev-arm64.so ./debug/libopenrpc-arm64.so ./debug/libnetlinku-arm64.so diff --git a/Platform/user/configm/config-server/include/user_group_config.h b/Platform/user/configm/config-server/include/user_group_config.h index e95e93975..a8345669a 100644 --- a/Platform/user/configm/config-server/include/user_group_config.h +++ b/Platform/user/configm/config-server/include/user_group_config.h @@ -23,6 +23,11 @@ typedef ret_code (*usergroup_config)(uint source, uint config_type, pointer output, int *output_len); +/* 新增用户组 */ +ret_code usergroup_config_add_proc(uint source, uint config_type, + pointer input, int input_len, + pointer output, int *output_len); + /* user group config */ ret_code usergroup_config_chk(uint source, uint config_type, pointer input, int input_len, diff --git a/Platform/user/configm/config-server/user_manager_config/user_group_config.c b/Platform/user/configm/config-server/user_manager_config/user_group_config.c index ab6d1e2ba..21aa79081 100644 --- a/Platform/user/configm/config-server/user_manager_config/user_group_config.c +++ b/Platform/user/configm/config-server/user_manager_config/user_group_config.c @@ -1,3 +1,4 @@ +#include #include "configm.h" #include "user_group_config.h" #include "rpc.h" @@ -162,7 +163,7 @@ ret_code usergroup_config_proc(uint source, uint config_type, ret = gs_usergroup_fun_table[fun_type](source, config_type, input, input_len, - output, *output_len); + output, output_len); return ret; diff --git a/Product/build/user.usermanager.Makefile b/Product/build/user.usermanager.Makefile new file mode 100644 index 000000000..0eecc974c --- /dev/null +++ b/Product/build/user.usermanager.Makefile @@ -0,0 +1,62 @@ +# target name, the target name must have the same name of c source file +TARGET_NAME=usermanager + +# target +# for linux module driver: KO +# for application: EXE +# for dynamic library: DLL +TARGET_TYPE = DLL + +# target object +# for application: APP +# for device driver: DRV +TARGET_OBJ = APP + +# custom install dir +TARGET_BOX = + +#debug mode or release mode +DEBUG = TRUE + +PLAT_LINUX ?= TRUE +PLAT_ARM64 ?= TRUE + +VPATH = ../user/user_manager/ + +# source code + +# set the source file, don't used .o because of ... + +COMMON_SRCS = array_index.c user_group.c user.c user_mod.c + +# MRS Board Source Files +PLAT_LINUX_SRCS = $(COMMON_SRCS) +PLAT_ARM64_SRCS = $(COMMON_SRCS) + +# gcc CFLAGS +PLAT_ARM64_CFLAGS := -fPIC -I../../Common -I../common +PLAT_LINUX_CFLAGS := -fPIC -I../../Common -I../common + +PLAT_ARM64_LDFLAGS := -fPIC -shared -lpthread +PLAT_LINUX_LDFLAGS := $(PLAT_ARM64_LDFLAGS) + + +# this line must be at below of thus, because of... +include ../../Common/common.Makefile + +ifneq ($(MAKECMDGOALS), clean) +ifneq ($(MAKECMDGOALS), cleanall) +ifneq ($(notdir $(DEPEND_LIB)), $(wildcard $(DEPEND_LIB))) +$(shell $(CP) $(DEPEND_LIB) ./) +endif +endif +endif + +ifeq ($(MAKECMDGOALS), ) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +else +ifeq ($(MAKECMDGOALS), all) +$(shell find ./ -name "$(TARGET)-*.ko" -delete) +endif +endif + diff --git a/Product/user/user_manager/array_index.c b/Product/user/user_manager/array_index.c index 751d17b97..0f1a9d4e1 100644 --- a/Product/user/user_manager/array_index.c +++ b/Product/user/user_manager/array_index.c @@ -2,7 +2,7 @@ #include #include #include "array_index.h" -#include "../../common/common_user.h" +#include "common_user.h" ARRAY g_user_index_head = { 0 }; ARRAY g_group_index_head = { 0 }; diff --git a/Product/user/user_manager/user.c b/Product/user/user_manager/user.c index 442fcbe95..156960b54 100644 --- a/Product/user/user_manager/user.c +++ b/Product/user/user_manager/user.c @@ -2,11 +2,11 @@ #include #include #include -#include "../../common/common_user.h" +#include "common_user.h" #include "array_index.h" -#include "user_group.h" -#include "user.h" #include "user_mod.h" +#include "sg/user/user_manager/user_group.h" +#include "sg/user/user_manager/user.h" extern ARRAY g_user_index_head; extern USERGROUP g_group_table[]; @@ -105,7 +105,7 @@ void get_user_by_id(unsigned short ID, USERLIST* ulist) if (NULL == ulist || INVALID_INDEX >= ID || (USER_INDEX_MAX - 1) <= ID) { - return NULL; + return; } memset(ulist, 0, sizeof(ulist)); @@ -268,4 +268,4 @@ bool mod_user_line(char* uname, const int intype, char* in) result = g_user_modfunc_table[intype](uid, in); return result; -} \ No newline at end of file +} diff --git a/Product/user/user_manager/user_group.c b/Product/user/user_manager/user_group.c index 56033228b..df42ae4d5 100644 --- a/Product/user/user_manager/user_group.c +++ b/Product/user/user_manager/user_group.c @@ -3,8 +3,8 @@ #include #include #include "array_index.h" -#include "user_group.h" -#include "../../common/common_user.h" +#include "sg/user/user_manager/user_group.h" +#include "common_user.h" extern ARRAY g_group_index_head; USERGROUP g_group_table[GROUP_INDEX_MAX]; diff --git a/Product/user/user_manager/user_mod.c b/Product/user/user_manager/user_mod.c index c81821cd1..815b051db 100644 --- a/Product/user/user_manager/user_mod.c +++ b/Product/user/user_manager/user_mod.c @@ -1,7 +1,9 @@ #include +#include +#include #include "user_mod.h" -#include "user_group.h" -#include "user.h" +#include "sg/user/user_manager/user_group.h" +#include "sg/user/user_manager/user.h" #include "array_index.h" #include "common_user.h"