From: nishi Date: Fri, 7 Jun 2024 03:32:20 +0000 (+0000) Subject: works X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=3e562522089b727f8d2dc1f7ce4b21e5116f9478;p=dataworks.git works git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@168 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- 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);