aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2021-09-14 12:34:28 +1000
committeronefang2021-09-14 12:34:28 +1000
commit21eb7fec28703c4e0522374d37469b5b75bb1bbe (patch)
tree23c77e14dc1e56e5162b2bdbc43796147d55640b
parentPut back the stat() of the session Lua file. (diff)
downloadopensim-SC-21eb7fec28703c4e0522374d37469b5b75bb1bbe.zip
opensim-SC-21eb7fec28703c4e0522374d37469b5b75bb1bbe.tar.gz
opensim-SC-21eb7fec28703c4e0522374d37469b5b75bb1bbe.tar.bz2
opensim-SC-21eb7fec28703c4e0522374d37469b5b75bb1bbe.tar.xz
More output logging tweaks.
-rw-r--r--src/sledjchisl/sledjchisl.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c
index 3f420c6..c2ca044 100644
--- a/src/sledjchisl/sledjchisl.c
+++ b/src/sledjchisl/sledjchisl.c
@@ -1044,7 +1044,7 @@ int LuaToHash(reqData *Rd, char *file, char *var, qhashtbl_t *tnm, int ret, stru
1044 1044
1045 if (-1 == clock_gettime(CLOCK_REALTIME, &then)) 1045 if (-1 == clock_gettime(CLOCK_REALTIME, &then))
1046 perror_msg("Unable to get the time."); 1046 perror_msg("Unable to get the time.");
1047 I("Reading %s file %s", type, file); 1047 V("Reading %s file %s", type, file);
1048 if (0 != stat(file, st)) // Don't delete this in future, the caller wants st filled. 1048 if (0 != stat(file, st)) // Don't delete this in future, the caller wants st filled.
1049 { 1049 {
1050 D("No %s file.", file); 1050 D("No %s file.", file);
@@ -5187,7 +5187,7 @@ static void freeSesh(reqData *Rd, boolean linky, boolean wipe)
5187 char *file = NULL; 5187 char *file = NULL;
5188 sesh *shs = &Rd->shs; 5188 sesh *shs = &Rd->shs;
5189 5189
5190T("free sesh %s %s", linky ? "linky" : "session", wipe ? "wipe" : "delete"); 5190t("free sesh %s %s", linky ? "linky" : "session", wipe ? "wipe" : "delete");
5191 if (linky) 5191 if (linky)
5192 { 5192 {
5193 shs = Rd->lnk; 5193 shs = Rd->lnk;
@@ -5197,9 +5197,9 @@ T("free sesh %s %s", linky ? "linky" : "session", wipe ? "wipe" : "delete");
5197 file = xmprintf("%s/sessions/%s.lua", scCache, shs->leaf); 5197 file = xmprintf("%s/sessions/%s.lua", scCache, shs->leaf);
5198 5198
5199 if (wipe) 5199 if (wipe)
5200 I("Wiping session %s.", file); 5200 V("Wiping session %s.", file);
5201 else 5201 else
5202 I("Deleting session %s.", file); 5202 V("Deleting session %s.", file);
5203 5203
5204 if ('\0' != shs->leaf[0]) 5204 if ('\0' != shs->leaf[0])
5205 { 5205 {
@@ -5296,7 +5296,7 @@ static void setToken_n_munchie(reqData *Rd, boolean linky)
5296 size_t l = strlen(tnm0); 5296 size_t l = strlen(tnm0);
5297 5297
5298 if (s) 5298 if (s)
5299 I("Creating session %s.", file); 5299 V("Creating session %s.", file);
5300 else 5300 else
5301 C("Updating session %s.", file); // I don't think updates can occur now. 5301 C("Updating session %s.", file); // I don't think updates can occur now.
5302t("Write shs %s", tnm0); 5302t("Write shs %s", tnm0);
@@ -5816,7 +5816,7 @@ static sesh *newSesh(reqData *Rd, boolean linky)
5816 uuid_t binuuid; 5816 uuid_t binuuid;
5817 sesh *ret = &Rd->shs; 5817 sesh *ret = &Rd->shs;
5818 5818
5819T("new sesh %s %s %s", linky ? "linky" : "session", ret->UUID, ret->name); 5819t("new sesh %s %s %s", linky ? "linky" : "session", ret->UUID, ret->name);
5820 if (linky) 5820 if (linky)
5821 { 5821 {
5822 Rd->lnk = xzalloc(sizeof(sesh)); 5822 Rd->lnk = xzalloc(sizeof(sesh));
@@ -5971,7 +5971,7 @@ static int sessionValidate(reqData *Rd, inputForm *iF, inputValue *iV)
5971 5971
5972 // In this case the session stuff has to come from specific places. 5972 // In this case the session stuff has to come from specific places.
5973 hashish = Rd->queries->getstr(Rd->queries, "hashish", true); 5973 hashish = Rd->queries->getstr(Rd->queries, "hashish", true);
5974d("O hashish %s", hashish); 5974//d("O hashish %s", hashish);
5975 if (NULL != hashish) 5975 if (NULL != hashish)
5976 { 5976 {
5977 char *t = xstrdup(hashish); 5977 char *t = xstrdup(hashish);
@@ -6007,15 +6007,15 @@ d("O hashish %s", hashish);
6007 I("Validating SESSION hashish %s", hashish); 6007 I("Validating SESSION hashish %s", hashish);
6008 } 6008 }
6009 6009
6010d("O toke_n_munchie %s", toke_n_munchie); 6010//d("O toke_n_munchie %s", toke_n_munchie);
6011d("O munchie %s", munchie); 6011//d("O munchie %s", munchie);
6012 if (0 == ret) 6012 if (0 == ret)
6013 { 6013 {
6014 struct stat st; 6014 struct stat st;
6015 struct timespec now; 6015 struct timespec now;
6016 6016
6017 leaf = myHMACkey(getStrH(Rd->configs, "pepper"), hashish, TRUE); 6017 leaf = myHMACkey(getStrH(Rd->configs, "pepper"), hashish, TRUE);
6018d("leaf %s", leaf); 6018//d("leaf %s", leaf);
6019 if (linky) 6019 if (linky)
6020 t0 = xmprintf("%s/sessions/%s.linky", scCache, leaf); 6020 t0 = xmprintf("%s/sessions/%s.linky", scCache, leaf);
6021 else 6021 else
@@ -6048,12 +6048,12 @@ d("leaf %s", leaf);
6048 else 6048 else
6049 { 6049 {
6050 timeStamp = xmprintf("%ld.%ld", (long) st.st_mtim.tv_sec, st.st_mtim.tv_nsec); 6050 timeStamp = xmprintf("%ld.%ld", (long) st.st_mtim.tv_sec, st.st_mtim.tv_nsec);
6051d("timeStamp %s", timeStamp); 6051//d("timeStamp %s", timeStamp);
6052 seshion = xmprintf("%s%s", tnm->getstr(tnm, "seshID", false), timeStamp); 6052 seshion = xmprintf("%s%s", tnm->getstr(tnm, "seshID", false), timeStamp);
6053d("sesh %s", seshion); 6053//d("sesh %s", seshion);
6054 t0 = myHMAC(seshion, FALSE); 6054 t0 = myHMAC(seshion, FALSE);
6055 munchie = xmprintf("%s%s", t0, timeStamp); 6055 munchie = xmprintf("%s%s", t0, timeStamp);
6056d("munchie %s", munchie); 6056//d("munchie %s", munchie);
6057 free(t0); 6057 free(t0);
6058 free(timeStamp); 6058 free(timeStamp);
6059 t1 = getStrH(Rd->body, "munchie"); 6059 t1 = getStrH(Rd->body, "munchie");
@@ -6071,7 +6071,7 @@ d("munchie %s", munchie);
6071 t1 = myHMAC(t0, FALSE); 6071 t1 = myHMAC(t0, FALSE);
6072 free(t0); 6072 free(t0);
6073 6073
6074d("toke_n_munchie %s", t1); 6074//d("toke_n_munchie %s", t1);
6075 if (strcmp(t1, toke_n_munchie) != 0) 6075 if (strcmp(t1, toke_n_munchie) != 0)
6076 { 6076 {
6077 bitchSession(Rd, "Wrong toke_n_munchie for session.", "HMAC(UUID + munchie) != toke_n_munchie"); 6077 bitchSession(Rd, "Wrong toke_n_munchie for session.", "HMAC(UUID + munchie) != toke_n_munchie");
@@ -6086,10 +6086,10 @@ d("toke_n_munchie %s", t1);
6086 t1 = myHMAC(t0, FALSE); 6086 t1 = myHMAC(t0, FALSE);
6087 free(t0); 6087 free(t0);
6088 toke_n_munchie = t1; 6088 toke_n_munchie = t1;
6089d("toke_n_munchie %s", t1); 6089//d("toke_n_munchie %s", t1);
6090 } 6090 }
6091 t1 = myHMACkey(getStrH(tnm, "salt"), toke_n_munchie, FALSE); 6091 t1 = myHMACkey(getStrH(tnm, "salt"), toke_n_munchie, FALSE);
6092d("hashish %s", t1); 6092//d("hashish %s", t1);
6093 if (strcmp(t1, hashish) != 0) 6093 if (strcmp(t1, hashish) != 0)
6094 { 6094 {
6095 bitchSession(Rd, "Wrong hashish for session.", "HMAC(toke_n_munchie + salt) != hashish"); 6095 bitchSession(Rd, "Wrong hashish for session.", "HMAC(toke_n_munchie + salt) != hashish");
@@ -6101,7 +6101,6 @@ d("hashish %s", t1);
6101// TODO - should carefully review all of this, especially the moving of session data to and fro. 6101// TODO - should carefully review all of this, especially the moving of session data to and fro.
6102 if (0 == ret) 6102 if (0 == ret)
6103 { 6103 {
6104W("Validated session.");
6105 sesh *shs = &Rd->shs; 6104 sesh *shs = &Rd->shs;
6106 6105
6107 qstrcpy(shs->leaf, sizeof(shs->leaf), leaf); 6106 qstrcpy(shs->leaf, sizeof(shs->leaf), leaf);
@@ -6109,9 +6108,10 @@ W("Validated session.");
6109 shs->name = tnm->getstr(tnm, "name", true); 6108 shs->name = tnm->getstr(tnm, "name", true);
6110 if (NULL != shs->UUID) free(shs->UUID); 6109 if (NULL != shs->UUID) free(shs->UUID);
6111 shs->UUID = tnm->getstr(tnm, "UUID", true); 6110 shs->UUID = tnm->getstr(tnm, "UUID", true);
6111I("Validated session for %s.", shs->name);
6112 if (linky) 6112 if (linky)
6113 { 6113 {
6114W("Validated session linky."); 6114V("Validated session linky.");
6115 addStrL(Rd->messages, "Congratulations, you have validated your new account. Now you can log onto the web site."); 6115 addStrL(Rd->messages, "Congratulations, you have validated your new account. Now you can log onto the web site.");
6116 addStrL(Rd->messages, "NOTE - you wont be able to log onto the grid until your new account has been approved."); 6116 addStrL(Rd->messages, "NOTE - you wont be able to log onto the grid until your new account has been approved.");
6117 Rd->lnk = xzalloc(sizeof(sesh)); 6117 Rd->lnk = xzalloc(sizeof(sesh));
@@ -9178,7 +9178,7 @@ t("QUERY");
9178 } 9178 }
9179 else 9179 else
9180 { 9180 {
9181T("ignoring QUERY"); 9181t("ignoring QUERY");
9182 Rd->queries = qhashtbl(0, 0); 9182 Rd->queries = qhashtbl(0, 0);
9183 free(Rd->RUri); 9183 free(Rd->RUri);
9184 Rd->RUri = xmprintf("%s%s", Rd->Script, Rd->Path); 9184 Rd->RUri = xmprintf("%s%s", Rd->Script, Rd->Path);