00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "auditMS.h"
00010 #include "auditUtil.h"
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 int
00047 msiGetAuditTrailInfoByUserID(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
00048 {
00049 rsComm_t *rsComm;
00050 char *userID;
00051 bytesBuf_t *mybuf;
00052
00053
00054 RE_TEST_MACRO (" Calling msiGetAuditTrailInfoByUserID")
00055
00056 if (rei == NULL || rei->rsComm == NULL) {
00057 rodsLog (LOG_ERROR, "msiGetAuditTrailInfoByUserID: input rei or rsComm is NULL");
00058 return (SYS_INTERNAL_NULL_INPUT_ERR);
00059 }
00060
00061 rsComm = rei->rsComm;
00062
00063
00064 mybuf = (bytesBuf_t *)malloc(sizeof(bytesBuf_t));
00065 memset (mybuf, 0, sizeof (bytesBuf_t));
00066
00067
00068
00069 if ((userID = parseMspForStr (inpParam1)) == NULL) {
00070 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00071 "msiGetAuditTrailInfoByUserID: parseMspForStr error for param 1.");
00072 free( mybuf );
00073 return (rei->status);
00074 }
00075
00076
00077
00078 rei->status = getAuditTrailInfoByUserID(userID, mybuf, rsComm);
00079
00080
00081 if (rei->status < 0) {
00082 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00083 "msiGetAuditTrailInfoByUserID: getAuditTrailInfoByUserID failed for user ID %s, status = %d", userID, rei->status);
00084 }
00085
00086
00087
00088 fillIntInMsParam (outParam, rei->status);
00089
00090
00091
00092 if (!mybuf->buf) {
00093 mybuf->buf = strdup("");
00094 }
00095 fillBufLenInMsParam (inpParam2, strlen((char*)mybuf->buf), mybuf);
00096
00097 free( mybuf );
00098
00099 return (rei->status);
00100
00101 }
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 int
00139 msiGetAuditTrailInfoByObjectID(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
00140 {
00141 rsComm_t *rsComm;
00142 char *objectID;
00143 bytesBuf_t *mybuf;
00144
00145
00146 RE_TEST_MACRO (" Calling msiGetAuditTrailInfoByObjectID")
00147
00148 if (rei == NULL || rei->rsComm == NULL) {
00149 rodsLog (LOG_ERROR, "msiGetAuditTrailInfoByObjectID: input rei or rsComm is NULL");
00150 return (SYS_INTERNAL_NULL_INPUT_ERR);
00151 }
00152
00153 rsComm = rei->rsComm;
00154
00155
00156 mybuf = (bytesBuf_t *)malloc(sizeof(bytesBuf_t));
00157 memset (mybuf, 0, sizeof (bytesBuf_t));
00158
00159
00160
00161 if ((objectID = parseMspForStr (inpParam1)) == NULL) {
00162 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00163 "msiGetAuditTrailInfoByObjectID: parseMspForStr error for param 1.");
00164 free( mybuf );
00165 return (rei->status);
00166 }
00167
00168
00169
00170 rei->status = getAuditTrailInfoByObjectID(objectID, mybuf, rsComm);
00171
00172
00173 if (rei->status < 0) {
00174 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00175 "msiGetAuditTrailInfoByObjectID: getAuditTrailInfoByObjectID failed for object ID %s, status = %d", objectID, rei->status);
00176 }
00177
00178
00179
00180 fillIntInMsParam (outParam, rei->status);
00181
00182
00183
00184 if (!mybuf->buf) {
00185 mybuf->buf = strdup("");
00186 }
00187 fillBufLenInMsParam (inpParam2, strlen((char*)mybuf->buf), mybuf);
00188
00189 free( mybuf );
00190
00191 return (rei->status);
00192
00193 }
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230 int
00231 msiGetAuditTrailInfoByActionID(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
00232 {
00233 rsComm_t *rsComm;
00234 char *actionID;
00235 bytesBuf_t *mybuf;
00236
00237
00238 RE_TEST_MACRO (" Calling msiGetAuditTrailInfoByActionID")
00239
00240 if (rei == NULL || rei->rsComm == NULL) {
00241 rodsLog (LOG_ERROR, "msiGetAuditTrailInfoByActionID: input rei or rsComm is NULL");
00242 return (SYS_INTERNAL_NULL_INPUT_ERR);
00243 }
00244
00245 rsComm = rei->rsComm;
00246
00247
00248 mybuf = (bytesBuf_t *)malloc(sizeof(bytesBuf_t));
00249 memset (mybuf, 0, sizeof (bytesBuf_t));
00250
00251
00252
00253 if ((actionID = parseMspForStr (inpParam1)) == NULL) {
00254 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00255 "msiGetAuditTrailInfoByActionID: parseMspForStr error for param 1.");
00256 free( mybuf );
00257 return (rei->status);
00258 }
00259
00260
00261
00262 rei->status = getAuditTrailInfoByActionID(actionID, mybuf, rsComm);
00263
00264
00265 if (rei->status < 0) {
00266 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00267 "msiGetAuditTrailInfoByActionID: getAuditTrailInfoByActionID failed for action ID %s, status = %d", actionID, rei->status);
00268 }
00269
00270
00271
00272 fillIntInMsParam (outParam, rei->status);
00273
00274
00275
00276 if (!mybuf->buf) {
00277 mybuf->buf = strdup("");
00278 }
00279 fillBufLenInMsParam (inpParam2, strlen((char*)mybuf->buf), mybuf);
00280
00281 free( mybuf );
00282
00283 return (rei->status);
00284
00285 }
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322 int
00323 msiGetAuditTrailInfoByKeywords(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *outParam, ruleExecInfo_t *rei)
00324 {
00325 rsComm_t *rsComm;
00326 char *commentStr;
00327 bytesBuf_t *mybuf;
00328
00329
00330 RE_TEST_MACRO (" Calling msiGetAuditTrailInfoByKeywords")
00331
00332 if (rei == NULL || rei->rsComm == NULL) {
00333 rodsLog (LOG_ERROR, "msiGetAuditTrailInfoByKeywords: input rei or rsComm is NULL");
00334 return (SYS_INTERNAL_NULL_INPUT_ERR);
00335 }
00336
00337 rsComm = rei->rsComm;
00338
00339
00340 mybuf = (bytesBuf_t *)malloc(sizeof(bytesBuf_t));
00341 memset (mybuf, 0, sizeof (bytesBuf_t));
00342
00343
00344
00345 if ((commentStr = parseMspForStr (inpParam1)) == NULL) {
00346 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00347 "msiGetAuditTrailInfoByKeywords: parseMspForStr error for param 1.");
00348 free( mybuf );
00349 return (rei->status);
00350 }
00351
00352
00353
00354 rei->status = getAuditTrailInfoByKeywords(commentStr, mybuf, rsComm);
00355
00356
00357 if (rei->status < 0) {
00358 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00359 "msiGetAuditTrailInfoByKeywords: getAuditTrailInfoByKeywords failed for comment string %s, status = %d", commentStr, rei->status);
00360 }
00361
00362
00363
00364 fillIntInMsParam (outParam, rei->status);
00365
00366
00367
00368 if (!mybuf->buf) {
00369 mybuf->buf = strdup("");
00370 }
00371 fillBufLenInMsParam (inpParam2, strlen((char*)mybuf->buf), mybuf);
00372
00373 free( mybuf );
00374
00375 return (rei->status);
00376
00377 }
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415 int
00416 msiGetAuditTrailInfoByTimeStamp(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei)
00417 {
00418 rsComm_t *rsComm;
00419 char *begTS;
00420 char *endTS;
00421 bytesBuf_t *mybuf;
00422
00423
00424 RE_TEST_MACRO (" Calling msiGetAuditTrailInfoByTimeStamp")
00425
00426 if (rei == NULL || rei->rsComm == NULL) {
00427 rodsLog (LOG_ERROR, "msiGetAuditTrailInfoByTimeStamp: input rei or rsComm is NULL");
00428 return (SYS_INTERNAL_NULL_INPUT_ERR);
00429 }
00430
00431 rsComm = rei->rsComm;
00432
00433
00434 mybuf = (bytesBuf_t *)malloc(sizeof(bytesBuf_t));
00435 memset (mybuf, 0, sizeof (bytesBuf_t));
00436
00437
00438
00439
00440 if ((begTS = parseMspForStr (inpParam1)) == NULL) {
00441 begTS = strdup("");
00442 }
00443
00444
00445 if ((endTS = parseMspForStr (inpParam2)) == NULL) {
00446 endTS = strdup("");
00447 }
00448
00449
00450
00451 rei->status = getAuditTrailInfoByTimeStamp(begTS, endTS, mybuf, rsComm);
00452
00453
00454 if (rei->status < 0) {
00455 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status,
00456 "msiGetAuditTrailInfoByTimeStamp: getAuditTrailInfoByTimeStamp failed for values between %s and %s, status = %d", begTS, endTS, rei->status);
00457 }
00458
00459
00460
00461 fillIntInMsParam (outParam, rei->status);
00462
00463
00464 if (!mybuf->buf) {
00465 mybuf->buf = strdup("");
00466 }
00467 fillBufLenInMsParam (inpParam3, strlen((char*)mybuf->buf), mybuf);
00468
00469 return (rei->status);
00470
00471 }