From 3e562522089b727f8d2dc1f7ce4b21e5116f9478 Mon Sep 17 00:00:00 2001 From: nishi Date: Fri, 7 Jun 2024 03:32:20 +0000 Subject: [PATCH] works git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@168 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Server/server.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Server/server.c b/Server/server.c index 3acae32..5249f38 100644 --- a/Server/server.c +++ b/Server/server.c @@ -194,6 +194,15 @@ int main(int _argc, char** _argv) { } } if(has_pass) { + int shift = i; + struct auth_entry** old_entries = entries; + for(i = 0; old_entries[i] != NULL; i++); + entries = malloc(sizeof(*entries) * (i + 2)); + for(i = 0; old_entries[i] != NULL; i++) entries[i] = old_entries[i]; + free(old_entries); + entries[i] = malloc(sizeof(**entries)); + entries[i]->user = __dw_strdup(str); + entries[i]->pass = __dw_strdup(str + shift + 1); printf("User %s is allowed to access the database now\n", str); } free(str); -- 2.43.0