]> Nishi Git Mirror - dataworks.git/commitdiff
works
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Fri, 7 Jun 2024 03:32:20 +0000 (03:32 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Fri, 7 Jun 2024 03:32:20 +0000 (03:32 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@168 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Server/server.c

index 3acae32a0fef2291368f0aca3236ebf819c87f14..5249f38a5c5f219e5fbba1cae11d35941da1224a 100644 (file)
@@ -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);