Skip to content

Commit

Permalink
Hopefully fixed #1451
Browse files Browse the repository at this point in the history
  • Loading branch information
kzangeli committed Nov 12, 2023
1 parent 8aa8d0b commit b5422a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Fixed issues:
* #280 - New CLI (hidden) for extra field in notifications (trigger: "VERB URL PATH"): -triggerOperation
* #1456 - Bug fix - entity id+type duplicated in forwarded request of "Create Entity"
* #1458 - Supporting system timestamps (createdAt/modifiedAt) in q
* #1451 - Bug fix - removed a trailing ampersand from the URI for the connection to mongodb
18 changes: 9 additions & 9 deletions src/lib/orionld/mongoc/mongocInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ static char* uriCompose
char* compV[50];
int compNo = 0;

LM_T(LmtMongoc, ("dbURI: '%s'", dbURI));
LM_T(LmtMongoc, ("dbHost: '%s'", dbHost));
LM_T(LmtMongoc, ("dbUser: '%s'", dbUser));
if (dbPwd != NULL)
Expand All @@ -162,21 +161,22 @@ static char* uriCompose
// Is "${PWD}" present?
// If so, split dbURI into two parts - before and after "${PWD}" and add dbPwd in between
//
compV[0] = dbURI;
compNo = 1;

char* pwdP = strstr(dbURI, "${PWD}");
if (pwdP != NULL)
{
if (dbPwd[0] == 0)
LM_X(1, ("Invalid Command Line Options: -dbURI is used with a password substitution, but no password (-dbPwd) is supplied"));

compV[compNo++] = dbURI;
*pwdP = 0;
compV[compNo++] = dbPwd;
compV[compNo++] = &pwdP[6];
}
else
compV[compNo++] = dbURI;
*pwdP = 0;
compV[1] = dbPwd;
compV[2] = &pwdP[6];
compNo = 3;

compV[compNo++] = (char*) "&";
LM_T(LmtMongoc, ("dbURI: '%s****%s'", compV[0], compV[2]));
}
}
else
{
Expand Down

0 comments on commit b5422a1

Please sign in to comment.