• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3816

01 Apr 2025 07:12AM UTC coverage: 34.045% (-0.05%) from 34.09%
#3816

push

travis-ci

happyguoxy
test:alter gcda dir

148369 of 599532 branches covered (24.75%)

Branch coverage included in aggregate %.

222390 of 489498 relevant lines covered (45.43%)

759503.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.61
/source/dnode/mgmt/node_util/src/dmFile.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http:www.gnu.org/licenses/>.
14
 */
15

16
#define _DEFAULT_SOURCE
17
#include "crypt.h"
18
#include "dmUtil.h"
19
#include "tchecksum.h"
20
#include "tgrant.h"
21
#include "tjson.h"
22

23
#define MAXLEN               1024
24
#define DM_KEY_INDICATOR     "this indicator!"
25
#define DM_ENCRYPT_CODE_FILE "encryptCode.cfg"
26
#define DM_CHECK_CODE_FILE   "checkCode.bin"
27

28
static int32_t dmDecodeFile(SJson *pJson, bool *deployed) {
1✔
29
  int32_t code = 0;
1✔
30
  int32_t value = 0;
1✔
31

32
  tjsonGetInt32ValueFromDouble(pJson, "deployed", value, code);
1✔
33
  if (code < 0) return code;
1!
34

35
  *deployed = (value != 0);
1✔
36
  return code;
1✔
37
}
38

39
int32_t dmReadFile(const char *path, const char *name, bool *pDeployed) {
274✔
40
  int32_t   code = -1;
274✔
41
  TdFilePtr pFile = NULL;
274✔
42
  char     *content = NULL;
274✔
43
  SJson    *pJson = NULL;
274✔
44
  char      file[PATH_MAX] = {0};
274✔
45
  int32_t   nBytes = snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name);
274✔
46
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
274!
47
    code = TSDB_CODE_OUT_OF_BUFFER;
×
48
    goto _OVER;
×
49
  }
50

51
  if (taosStatFile(file, NULL, NULL, NULL) < 0) {
274✔
52
    dInfo("file:%s not exist", file);
273!
53
    code = 0;
273✔
54
    goto _OVER;
273✔
55
  }
56

57
  pFile = taosOpenFile(file, TD_FILE_READ);
1✔
58
  if (pFile == NULL) {
1!
59
    code = terrno;
×
60
    dError("failed to open file:%s since %s", file, tstrerror(code));
×
61
    goto _OVER;
×
62
  }
63

64
  int64_t size = 0;
1✔
65
  code = taosFStatFile(pFile, &size, NULL);
1✔
66
  if (code != 0) {
1!
67
    dError("failed to fstat file:%s since %s", file, tstrerror(code));
×
68
    goto _OVER;
×
69
  }
70

71
  content = taosMemoryMalloc(size + 1);
1!
72
  if (content == NULL) {
1!
73
    code = terrno;
×
74
    goto _OVER;
×
75
  }
76

77
  if (taosReadFile(pFile, content, size) != size) {
1!
78
    code = terrno;
×
79
    dError("failed to read file:%s since %s", file, tstrerror(code));
×
80
    goto _OVER;
×
81
  }
82

83
  content[size] = '\0';
1✔
84

85
  pJson = tjsonParse(content);
1✔
86
  if (pJson == NULL) {
1!
87
    code = TSDB_CODE_INVALID_JSON_FORMAT;
×
88
    goto _OVER;
×
89
  }
90

91
  if (dmDecodeFile(pJson, pDeployed) < 0) {
1!
92
    code = TSDB_CODE_INVALID_JSON_FORMAT;
×
93
    goto _OVER;
×
94
  }
95

96
  code = 0;
1✔
97
  dInfo("succceed to read mnode file %s", file);
1!
98

99
_OVER:
×
100
  if (content != NULL) taosMemoryFree(content);
274!
101
  if (pJson != NULL) cJSON_Delete(pJson);
274✔
102
  if (pFile != NULL) taosCloseFile(&pFile);
274✔
103

104
  if (code != 0) {
274!
105
    dError("failed to read dnode file:%s since %s", file, tstrerror(code));
×
106
  }
107
  return code;
274✔
108
}
109

110
static int32_t dmEncodeFile(SJson *pJson, bool deployed) {
13✔
111
  if (tjsonAddDoubleToObject(pJson, "deployed", deployed) < 0) return TSDB_CODE_INVALID_JSON_FORMAT;
13!
112
  return 0;
13✔
113
}
114

115
int32_t dmWriteFile(const char *path, const char *name, bool deployed) {
13✔
116
  int32_t   code = -1;
13✔
117
  char     *buffer = NULL;
13✔
118
  SJson    *pJson = NULL;
13✔
119
  TdFilePtr pFile = NULL;
13✔
120
  char      file[PATH_MAX] = {0};
13✔
121
  char      realfile[PATH_MAX] = {0};
13✔
122

123
  int32_t nBytes = snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name);
13✔
124
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
13!
125
    code = TSDB_CODE_OUT_OF_BUFFER;
×
126
    goto _OVER;
×
127
  }
128

129
  nBytes = snprintf(realfile, sizeof(realfile), "%s%s%s.json", path, TD_DIRSEP, name);
13✔
130
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
13!
131
    code = TSDB_CODE_OUT_OF_BUFFER;
×
132
    goto _OVER;
×
133
  }
134

135
  pJson = tjsonCreateObject();
13✔
136
  if (pJson == NULL) {
13!
137
    code = terrno;
×
138
    goto _OVER;
×
139
  }
140

141
  if ((code = dmEncodeFile(pJson, deployed)) != 0) goto _OVER;
13!
142

143
  buffer = tjsonToString(pJson);
13✔
144
  if (buffer == NULL) {
13!
145
    code = TSDB_CODE_INVALID_JSON_FORMAT;
×
146
    goto _OVER;
×
147
  }
148

149
  pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH);
13✔
150
  if (pFile == NULL) {
13!
151
    code = terrno;
×
152
    goto _OVER;
×
153
  }
154

155
  int32_t len = strlen(buffer);
13✔
156
  if (taosWriteFile(pFile, buffer, len) <= 0) {
13!
157
    code = terrno;
×
158
    goto _OVER;
×
159
  }
160
  if (taosFsyncFile(pFile) < 0) {
13!
161
    code = terrno;
×
162
    goto _OVER;
×
163
  }
164

165
  if (taosCloseFile(&pFile) != 0) {
13!
166
    code = TAOS_SYSTEM_ERROR(ERRNO);
×
167
    goto _OVER;
×
168
  }
169
  TAOS_CHECK_GOTO(taosRenameFile(file, realfile), NULL, _OVER);
13!
170

171
  dInfo("succeed to write file:%s, deloyed:%d", realfile, deployed);
13!
172

173
_OVER:
×
174
  if (pJson != NULL) tjsonDelete(pJson);
13!
175
  if (buffer != NULL) taosMemoryFree(buffer);
13!
176
  if (pFile != NULL) taosCloseFile(&pFile);
13!
177

178
  if (code != 0) {
13!
179
    dError("failed to write file:%s since %s, deloyed:%d", realfile, tstrerror(code), deployed);
×
180
  }
181
  return code;
13✔
182
}
183

184
int32_t dmCheckRunning(const char *dataDir, TdFilePtr *pFile) {
137✔
185
  int32_t code = 0;
137✔
186
  char    filepath[PATH_MAX] = {0};
137✔
187
  snprintf(filepath, sizeof(filepath), "%s%s.running", dataDir, TD_DIRSEP);
137✔
188

189
  *pFile = taosOpenFile(filepath, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_CLOEXEC);
137✔
190
  if (*pFile == NULL) {
137!
191
    code = terrno;
×
192
    dError("failed to open file:%s since %s", filepath, tstrerror(code));
×
193
    return code;
×
194
  }
195

196
  int32_t retryTimes = 0;
137✔
197
  int32_t ret = 0;
137✔
198
  do {
199
    ret = taosLockFile(*pFile);
137✔
200
    if (ret == 0) break;
137!
201

202
    code = terrno;
×
203
    taosMsleep(1000);
×
204
    retryTimes++;
×
205
    dError("failed to lock file:%s since %s, retryTimes:%d", filepath, tstrerror(code), retryTimes);
×
206
  } while (retryTimes < 12);
×
207

208
  if (ret < 0) {
137!
209
    code = TAOS_SYSTEM_ERROR(ERRNO);
×
210
    (void)taosCloseFile(pFile);
×
211
    *pFile = NULL;
×
212
    return code;
×
213
  }
214

215
  dDebug("lock file:%s to prevent repeated starts", filepath);
137✔
216
  return code;
137✔
217
}
218

219
extern int32_t generateEncryptCode(const char *key, const char *machineId, char **encryptCode);
220

221
static int32_t dmWriteCheckCodeFile(char *file, char *realfile, char *key, bool toLogFile) {
×
222
  TdFilePtr pFile = NULL;
×
223
  char     *result = NULL;
×
224
  int32_t   code = -1;
×
225

226
  int32_t len = ENCRYPTED_LEN(sizeof(DM_KEY_INDICATOR));
×
227
  result = taosMemoryMalloc(len);
×
228
  if (result == NULL) {
×
229
    return terrno;
×
230
  }
231

232
  SCryptOpts opts;
233
  tstrncpy(opts.key, key, ENCRYPT_KEY_LEN + 1);
×
234
  opts.len = len;
×
235
  opts.source = DM_KEY_INDICATOR;
×
236
  opts.result = result;
×
237
  opts.unitLen = 16;
×
238
  (void)CBC_Encrypt(&opts);
×
239

240
  pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH);
×
241
  if (pFile == NULL) {
×
242
    code = terrno;
×
243
    goto _OVER;
×
244
  }
245

246
  if (taosWriteFile(pFile, opts.result, len) <= 0) {
×
247
    code = terrno;
×
248
    goto _OVER;
×
249
  }
250

251
  if (taosFsyncFile(pFile) < 0) {
×
252
    code = TAOS_SYSTEM_ERROR(ERRNO);
×
253
    goto _OVER;
×
254
  }
255

256
  if (taosCloseFile(&pFile) != 0) {
×
257
    code = TAOS_SYSTEM_ERROR(ERRNO);
×
258
    goto _OVER;
×
259
  }
260

261
  TAOS_CHECK_GOTO(taosRenameFile(file, realfile), NULL, _OVER);
×
262

263
  encryptDebug("succeed to write checkCode file:%s", realfile);
×
264

265
  code = 0;
×
266
_OVER:
×
267
  if (pFile != NULL) taosCloseFile(&pFile);
×
268
  if (result != NULL) taosMemoryFree(result);
×
269

270
  return code;
×
271
}
272

273
static int32_t dmWriteEncryptCodeFile(char *file, char *realfile, char *encryptCode, bool toLogFile) {
×
274
  TdFilePtr pFile = NULL;
×
275
  int32_t   code = -1;
×
276

277
  pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH);
×
278
  if (pFile == NULL) {
×
279
    code = terrno;
×
280
    goto _OVER;
×
281
  }
282

283
  int32_t len = strlen(encryptCode);
×
284
  if (taosWriteFile(pFile, encryptCode, len) <= 0) {
×
285
    code = terrno;
×
286
    goto _OVER;
×
287
  }
288
  if (taosFsyncFile(pFile) < 0) {
×
289
    code = terrno;
×
290
    goto _OVER;
×
291
  }
292

293
  if (taosCloseFile(&pFile) != 0) {
×
294
    code = TAOS_SYSTEM_ERROR(ERRNO);
×
295
    goto _OVER;
×
296
  }
297

298
  TAOS_CHECK_GOTO(taosRenameFile(file, realfile), NULL, _OVER);
×
299

300
  encryptDebug("succeed to write encryptCode file:%s", realfile);
×
301

302
  code = 0;
×
303
_OVER:
×
304
  if (pFile != NULL) taosCloseFile(&pFile);
×
305

306
  return code;
×
307
}
308

309
static int32_t dmCompareEncryptKey(char *file, char *key, bool toLogFile) {
×
310
  char     *content = NULL;
×
311
  int64_t   size = 0;
×
312
  TdFilePtr pFile = NULL;
×
313
  char     *result = NULL;
×
314
  int32_t   code = -1;
×
315

316
  pFile = taosOpenFile(file, TD_FILE_READ);
×
317
  if (pFile == NULL) {
×
318
    code = terrno;
×
319
    encryptError("failed to open dnode file:%s since %s", file, tstrerror(code));
×
320
    goto _OVER;
×
321
  }
322

323
  code = taosFStatFile(pFile, &size, NULL);
×
324
  if (code != 0) {
×
325
    encryptError("failed to fstat dnode file:%s since %s", file, tstrerror(code));
×
326
    goto _OVER;
×
327
  }
328

329
  content = taosMemoryMalloc(size);
×
330
  if (content == NULL) {
×
331
    code = terrno;
×
332
    goto _OVER;
×
333
  }
334

335
  if (taosReadFile(pFile, content, size) != size) {
×
336
    code = terrno;
×
337
    encryptError("failed to read dnode file:%s since %s", file, tstrerror(code));
×
338
    goto _OVER;
×
339
  }
340

341
  encryptDebug("succeed to read checkCode file:%s", file);
×
342

343
  int len = ENCRYPTED_LEN(size);
×
344
  result = taosMemoryMalloc(len);
×
345
  if (result == NULL) {
×
346
    code = terrno;
×
347
    encryptError("failed to alloc memory file:%s since %s", file, tstrerror(code));
×
348
    goto _OVER;
×
349
  }
350

351
  SCryptOpts opts = {0};
×
352
  tstrncpy(opts.key, key, ENCRYPT_KEY_LEN + 1);
×
353
  opts.len = len;
×
354
  opts.source = content;
×
355
  opts.result = result;
×
356
  opts.unitLen = 16;
×
357
  (void)CBC_Decrypt(&opts);
×
358

359
  if (strcmp(opts.result, DM_KEY_INDICATOR) != 0) {
×
360
    code = TSDB_CODE_DNODE_ENCRYPTKEY_CHANGED;
×
361
    encryptError("failed to compare decrypted result");
×
362
    goto _OVER;
×
363
  }
364

365
  encryptDebug("succeed to compare checkCode file:%s", file);
×
366
  code = 0;
×
367
_OVER:
×
368
  if (result != NULL) taosMemoryFree(result);
×
369
  if (content != NULL) taosMemoryFree(content);
×
370
  if (pFile != NULL) taosCloseFile(&pFile);
×
371

372
  return code;
×
373
}
374

375
int32_t dmUpdateEncryptKey(char *key, bool toLogFile) {
×
376
#if defined(TD_ENTERPRISE) || defined(TD_ASTRA_TODO)
377
  int32_t code = -1;
×
378
  int32_t lino = 0;
×
379
  char   *machineId = NULL;
×
380
  char   *encryptCode = NULL;
×
381

382
  char folder[PATH_MAX] = {0};
×
383

384
  char encryptFile[PATH_MAX] = {0};
×
385
  char realEncryptFile[PATH_MAX] = {0};
×
386

387
  char checkFile[PATH_MAX] = {0};
×
388
  char realCheckFile[PATH_MAX] = {0};
×
389

390
  int32_t nBytes = snprintf(folder, sizeof(folder), "%s%sdnode", tsDataDir, TD_DIRSEP);
×
391
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
×
392
    return TSDB_CODE_OUT_OF_BUFFER;
×
393
  }
394

395
  nBytes = snprintf(encryptFile, sizeof(realEncryptFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE);
×
396
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
×
397
    return TSDB_CODE_OUT_OF_BUFFER;
×
398
  }
399

400
  nBytes = snprintf(realEncryptFile, sizeof(realEncryptFile), "%s%s%s", folder, TD_DIRSEP, DM_ENCRYPT_CODE_FILE);
×
401
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
×
402
    return TSDB_CODE_OUT_OF_BUFFER;
×
403
  }
404

405
  nBytes = snprintf(checkFile, sizeof(checkFile), "%s%s%s.bak", folder, TD_DIRSEP, DM_CHECK_CODE_FILE);
×
406
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
×
407
    return TSDB_CODE_OUT_OF_BUFFER;
×
408
  }
409

410
  snprintf(realCheckFile, sizeof(realCheckFile), "%s%s%s", folder, TD_DIRSEP, DM_CHECK_CODE_FILE);
×
411
  if (nBytes <= 0 || nBytes >= PATH_MAX) {
×
412
    return TSDB_CODE_OUT_OF_BUFFER;
×
413
  }
414

415
  if (taosMkDir(folder) != 0) {
×
416
    code = terrno;
×
417
    encryptError("failed to create dir:%s since %s", folder, tstrerror(code));
×
418
    goto _OVER;
×
419
  }
420

421
  if (taosCheckExistFile(realCheckFile)) {
×
422
    if ((code = dmCompareEncryptKey(realCheckFile, key, toLogFile)) != 0) {
×
423
      goto _OVER;
×
424
    }
425
  }
426

427
  TAOS_CHECK_GOTO(tGetMachineId(&machineId), &lino, _OVER);
×
428

429
  TAOS_CHECK_GOTO(generateEncryptCode(key, machineId, &encryptCode), &lino, _OVER);
×
430

431
  if ((code = dmWriteEncryptCodeFile(encryptFile, realEncryptFile, encryptCode, toLogFile)) != 0) {
×
432
    goto _OVER;
×
433
  }
434

435
  if ((code = dmWriteCheckCodeFile(checkFile, realCheckFile, key, toLogFile)) != 0) {
×
436
    goto _OVER;
×
437
  }
438

439
  encryptInfo("Succeed to update encrypt key\n");
×
440

441
  code = 0;
×
442
_OVER:
×
443
  taosMemoryFree(encryptCode);
×
444
  taosMemoryFree(machineId);
×
445
  if (code != 0) {
×
446
    encryptError("failed to update encrypt key at line %d since %s", lino, tstrerror(code));
×
447
  }
448
  TAOS_RETURN(code);
×
449
#else
450
  return 0;
451
#endif
452
}
453

454
extern int32_t checkAndGetCryptKey(const char *encryptCode, const char *machineId, char **key);
455

456
static int32_t dmReadEncryptCodeFile(char *file, char **output) {
×
457
  TdFilePtr pFile = NULL;
×
458
  int32_t   code = -1;
×
459
  char     *content = NULL;
×
460

461
  pFile = taosOpenFile(file, TD_FILE_READ);
×
462
  if (pFile == NULL) {
×
463
    code = terrno;
×
464
    dError("failed to open dnode file:%s since %s", file, tstrerror(code));
×
465
    goto _OVER;
×
466
  }
467

468
  int64_t size = 0;
×
469
  code = taosFStatFile(pFile, &size, NULL);
×
470
  if (code != 0) {
×
471
    dError("failed to fstat dnode file:%s since %s", file, tstrerror(code));
×
472
    goto _OVER;
×
473
  }
474

475
  content = taosMemoryMalloc(size + 1);
×
476
  if (content == NULL) {
×
477
    code = terrno;
×
478
    goto _OVER;
×
479
  }
480

481
  if (taosReadFile(pFile, content, size) != size) {
×
482
    code = terrno;
×
483
    dError("failed to read dnode file:%s since %s", file, tstrerror(code));
×
484
    goto _OVER;
×
485
  }
486

487
  content[size] = '\0';
×
488

489
  *output = content;
×
490
  content = NULL;
×
491

492
  dInfo("succeed to read encryptCode file:%s", file);
×
493
  code = 0;
×
494
_OVER:
×
495
  if (pFile != NULL) taosCloseFile(&pFile);
×
496
  taosMemoryFree(content);
×
497

498
  return code;
×
499
}
500

501
int32_t dmGetEncryptKey() {
129✔
502
#if defined(TD_ENTERPRISE) || defined(TD_ASTRA_TODO)
503
  int32_t code = -1;
129✔
504
  char    encryptFile[PATH_MAX] = {0};
129✔
505
  char    checkFile[PATH_MAX] = {0};
129✔
506
  char   *machineId = NULL;
129✔
507
  char   *encryptKey = NULL;
129✔
508
  char   *content = NULL;
129✔
509

510
  int32_t nBytes = snprintf(encryptFile, sizeof(encryptFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP,
129✔
511
                            DM_ENCRYPT_CODE_FILE);
512
  if (nBytes <= 0 || nBytes >= sizeof(encryptFile)) {
129!
513
    code = TSDB_CODE_OUT_OF_BUFFER;
×
514
    return code;
×
515
  }
516

517
  nBytes = snprintf(checkFile, sizeof(checkFile), "%s%sdnode%s%s", tsDataDir, TD_DIRSEP, TD_DIRSEP, DM_CHECK_CODE_FILE);
129✔
518
  if (nBytes <= 0 || nBytes >= sizeof(checkFile)) {
129!
519
    code = TSDB_CODE_OUT_OF_BUFFER;
×
520
    return code;
×
521
  }
522

523
  if (!taosCheckExistFile(encryptFile)) {
129!
524
    code = TSDB_CODE_DNODE_INVALID_ENCRYPT_CONFIG;
129✔
525
    dInfo("no exist, checkCode file:%s", encryptFile);
129!
526
    return 0;
129✔
527
  }
528

529
  if ((code = dmReadEncryptCodeFile(encryptFile, &content)) != 0) {
×
530
    goto _OVER;
×
531
  }
532

533
  if ((code = tGetMachineId(&machineId)) != 0) {
×
534
    goto _OVER;
×
535
  }
536

537
  if ((code = checkAndGetCryptKey(content, machineId, &encryptKey)) != 0) {
×
538
    goto _OVER;
×
539
  }
540

541
  taosMemoryFreeClear(machineId);
×
542
  taosMemoryFreeClear(content);
×
543

544
  if (encryptKey[0] == '\0') {
×
545
    code = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY;
×
546
    dError("failed to read key since %s", tstrerror(code));
×
547
    goto _OVER;
×
548
  }
549

550
  if ((code = dmCompareEncryptKey(checkFile, encryptKey, true)) != 0) {
×
551
    goto _OVER;
×
552
  }
553

554
  tstrncpy(tsEncryptKey, encryptKey, ENCRYPT_KEY_LEN + 1);
×
555
  taosMemoryFreeClear(encryptKey);
×
556
  tsEncryptionKeyChksum = taosCalcChecksum(0, tsEncryptKey, strlen(tsEncryptKey));
×
557
  tsEncryptionKeyStat = ENCRYPT_KEY_STAT_LOADED;
×
558

559
  code = 0;
×
560
_OVER:
×
561
  if (content != NULL) taosMemoryFree(content);
×
562
  if (encryptKey != NULL) taosMemoryFree(encryptKey);
×
563
  if (machineId != NULL) taosMemoryFree(machineId);
×
564
  if (code != 0) {
×
565
    dError("failed to get encrypt key since %s", tstrerror(code));
×
566
  }
567
  TAOS_RETURN(code);
×
568
#else
569
  return 0;
570
#endif
571
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc