networker: use the right char buffer for the password.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 10 Jun 2012 13:54:47 +0000 (15:54 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 10 Jun 2012 13:54:47 +0000 (15:54 +0200)
citadel/modules/network/serv_netconfig.c

index f0f487d1769f0767de30b8bb163d560eb3786029..8f1018a4a9961a71cf54c358cd37baf0784407d4 100644 (file)
@@ -471,7 +471,6 @@ void cmd_netp(char *cmdbuf)
        char *node;
        StrBuf *NodeStr;
        long nodelen;
-       char pass[256];
        int v;
 
        const StrBuf *secret = NULL;
@@ -481,7 +480,7 @@ void cmd_netp(char *cmdbuf)
        /* Authenticate */
        node = CCC->curr_user;
        nodelen = extract_token(CCC->curr_user, cmdbuf, 0, '|', sizeof CCC->curr_user);
-       extract_token(CCC->user.password, cmdbuf, 1, '|', sizeof pass);
+       extract_token(CCC->user.password, cmdbuf, 1, '|', sizeof CCC->user.password);
        NodeStr = NewStrBufPlain(node, nodelen);
        /* load the IGnet Configuration to check node validity */
        working_ignetcfg = load_ignetcfg();
@@ -499,7 +498,7 @@ void cmd_netp(char *cmdbuf)
                return;
        }
 
-       if (strcasecmp(pass, ChrPtr(secret))) {
+       if (strcasecmp(CCC->user.password, ChrPtr(secret))) {
                snprintf(err_buf, sizeof err_buf,
                        "A Citadel server at %s [%s] failed to authenticate as network node \"%s\".\n",
                        CC->cs_host, CC->cs_addr, node