From 0dee0e26eb8566c7ae16765ee0d3f15b3e42c442 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Thu, 26 Jun 2025 06:26:22 -0400 Subject: [PATCH] Adding password within USRTYP --- lib/devsql.c | 10 +++++++--- lib/unisql.c | 1 + lib/unisql.h | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/devsql.c b/lib/devsql.c index 25ca7d9..862cbf1 100644 --- a/lib/devsql.c +++ b/lib/devsql.c @@ -437,6 +437,7 @@ PUBLIC USRTYP *sql_getusr(SQLPTR *sqlptr,char *email) //field avalable in table "EMAILS" const char *usrfield[]={ "email", + "passwd", "space", "mxspace", (char *)0 @@ -525,13 +526,16 @@ while (proceed==true) { if ((locval=getvalue(sql,rs,0,usrfield[i]))==(char *)0) continue; switch (i) { - case 0 : + case 0 : //user email usr->email=strdup(locval); break; - case 1 : + case 1 : //user passwd + usr->passwd=strdup(locval); + break; + case 2 : //user used space usr->space=atoi(locval); break; - case 2 : + case 3 : //user max space available usr->mxspace=atoi(locval); break; default : diff --git a/lib/unisql.c b/lib/unisql.c index c172200..3c63376 100644 --- a/lib/unisql.c +++ b/lib/unisql.c @@ -103,6 +103,7 @@ PUBLIC USRTYP *sql_freeusr(USRTYP *usr) { if (usr!=(USRTYP *)0) { + usr->passwd=rou_freestr(usr->passwd); usr->email=rou_freestr(usr->email); (void) free(usr); usr=(USRTYP *)0; diff --git a/lib/unisql.h b/lib/unisql.h index 59c3f8d..d0da839 100644 --- a/lib/unisql.h +++ b/lib/unisql.h @@ -12,7 +12,8 @@ //structure about user within the database typedef struct { char *email; //user emails - u_long space; //user space used; + char *passwd; //user password + u_long space; //user space used u_long mxspace; //user maximun space }USRTYP; -- 2.47.3