Merge pull request #21523 from taosdata/feat/TS-3134-3.0
feat: allow user to reset root passwd
This commit is contained in:
commit
fe7ba9d92e
|
@ -82,6 +82,7 @@ extern int64_t tsVndCommitMaxIntervalMs;
|
||||||
// mnode
|
// mnode
|
||||||
extern int64_t tsMndSdbWriteDelta;
|
extern int64_t tsMndSdbWriteDelta;
|
||||||
extern int64_t tsMndLogRetention;
|
extern int64_t tsMndLogRetention;
|
||||||
|
extern bool tsMndSkipGrant;
|
||||||
|
|
||||||
// monitor
|
// monitor
|
||||||
extern bool tsEnableMonitor;
|
extern bool tsEnableMonitor;
|
||||||
|
|
|
@ -73,6 +73,7 @@ int64_t tsVndCommitMaxIntervalMs = 600 * 1000;
|
||||||
// mnode
|
// mnode
|
||||||
int64_t tsMndSdbWriteDelta = 200;
|
int64_t tsMndSdbWriteDelta = 200;
|
||||||
int64_t tsMndLogRetention = 2000;
|
int64_t tsMndLogRetention = 2000;
|
||||||
|
bool tsMndSkipGrant = false;
|
||||||
|
|
||||||
// monitor
|
// monitor
|
||||||
bool tsEnableMonitor = true;
|
bool tsEnableMonitor = true;
|
||||||
|
@ -491,6 +492,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
|
||||||
|
|
||||||
if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, 0) != 0) return -1;
|
if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, 0) != 0) return -1;
|
||||||
if (cfgAddInt64(pCfg, "mndLogRetention", tsMndLogRetention, 500, 10000, 0) != 0) return -1;
|
if (cfgAddInt64(pCfg, "mndLogRetention", tsMndLogRetention, 500, 10000, 0) != 0) return -1;
|
||||||
|
if (cfgAddBool(pCfg, "skipGrant", tsMndSkipGrant, 0) != 0) return -1;
|
||||||
|
|
||||||
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, 0) != 0) return -1;
|
if (cfgAddBool(pCfg, "monitor", tsEnableMonitor, 0) != 0) return -1;
|
||||||
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, 0) != 0) return -1;
|
if (cfgAddInt32(pCfg, "monitorInterval", tsMonitorInterval, 1, 200000, 0) != 0) return -1;
|
||||||
|
@ -890,6 +892,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
||||||
|
|
||||||
tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64;
|
tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64;
|
||||||
tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64;
|
tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64;
|
||||||
|
tsMndSkipGrant = cfgGetItem(pCfg, "skipGrant")->bval;
|
||||||
|
|
||||||
tsStartUdfd = cfgGetItem(pCfg, "udf")->bval;
|
tsStartUdfd = cfgGetItem(pCfg, "udf")->bval;
|
||||||
tstrncpy(tsUdfdResFuncs, cfgGetItem(pCfg, "udfdResFuncs")->str, sizeof(tsUdfdResFuncs));
|
tstrncpy(tsUdfdResFuncs, cfgGetItem(pCfg, "udfdResFuncs")->str, sizeof(tsUdfdResFuncs));
|
||||||
|
|
|
@ -245,7 +245,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(connReq.passwd, pUser->pass, TSDB_PASSWORD_LEN - 1) != 0) {
|
if (strncmp(connReq.passwd, pUser->pass, TSDB_PASSWORD_LEN - 1) != 0 && !tsMndSkipGrant) {
|
||||||
mGError("user:%s, failed to login from %s since invalid pass, input:%s", pReq->info.conn.user, ip, connReq.passwd);
|
mGError("user:%s, failed to login from %s since invalid pass, input:%s", pReq->info.conn.user, ip, connReq.passwd);
|
||||||
code = TSDB_CODE_MND_AUTH_FAILURE;
|
code = TSDB_CODE_MND_AUTH_FAILURE;
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
|
|
Loading…
Reference in New Issue