Lines Matching defs:cmd

254 MODRET solaris_audit_post_pass(cmd_rec *cmd) {
261 return PR_DECLINED(cmd);
265 MODRET solaris_audit_post_fail(cmd_rec *cmd) {
270 audit_failure(cmd->tmp_pool, login_user);
271 return PR_DECLINED(cmd);
350 * and the handler wants to return PR_ERROR(cmd), then it is necessary
356 * returns PR_ERROR(cmd), then the corresponding "post_err-"
377 * argument (using the memory pool "pool" from "cmd") and stores it to *arg2.
381 * into cmd under "notes" variable, so that it is accessible
385 cmd_rec *cmd, const char* description, int event_type, char **arg2) {
394 cmd->error_code = ADT_FAILURE;
396 if (cmd->arg == NULL) {
405 if ((tmp = pstrdup(cmd->pool, cmd->arg)) == NULL) {
408 description, cmd->arg, how);
414 if (cmd->notes == NULL) {
416 description, cmd->arg, "API error, notes is NULL");
423 description, cmd->arg, how, strerror(errno));
427 if (pr_table_add(cmd->notes, EVENT_KEY, event, sizeof(*event)) == -1) {
430 description, cmd->arg, how);
446 * from "cmd->notes" and logs it. This structure has been created by the
458 MODRET __solaris_audit_post(cmd_rec *cmd,
460 const char* (*fill_event)(cmd_rec *cmd, adt_event_data_t *event))
466 int exit_error = cmd->error_code;
468 event = (adt_event_data_t*)pr_table_remove(cmd->notes, EVENT_KEY, &size);
482 msg = fill_event(cmd, event);
507 return PR_DECLINED(cmd);
513 * by the caller. The pointer to cmd is supplied, because the stat64
529 cmd_rec *cmd, const char* path, adt_stat_t **ret)
539 ptr = palloc(cmd->pool, sizeof(*ptr));
554 static const char* dele_fill_attr(cmd_rec *cmd, adt_event_data_t *event) {
556 cmd, event->adt_ft_remove.f_path, &(event->adt_ft_remove.f_attr)
560 MODRET solaris_audit_pre_dele(cmd_rec *cmd) {
565 event = __solaris_audit_pre_arg2(cmd, "remove", ADT_ft_remove, &ptr);
568 return PR_ERROR(cmd);
576 cmd->error_code = errno;
578 return PR_ERROR(cmd);
590 (void) dele_fill_attr(cmd, event);
592 return PR_DECLINED(cmd);
595 MODRET solaris_audit_post_dele(cmd_rec *cmd) {
597 cmd, "remove", ADT_SUCCESS, ADT_SUCCESS, NULL);
600 MODRET solaris_audit_post_dele_err(cmd_rec *cmd) {
601 return __solaris_audit_post(cmd, "remove", ADT_FAILURE, ADT_FAILURE, NULL);
607 MODRET solaris_audit_pre_mkd(cmd_rec *cmd) {
611 event = __solaris_audit_pre_arg2(cmd, "mkdir", ADT_ft_mkdir, &ptr);
614 return PR_ERROR(cmd);
625 return PR_DECLINED(cmd);
628 static const char* mkd_fill_event(cmd_rec *cmd, adt_event_data_t *event) {
633 cmd->error_code = errno;
639 cmd, event->adt_ft_mkdir.d_path, &(event->adt_ft_mkdir.d_attr)
643 static const char* mkd_fill_event_err(cmd_rec *cmd, adt_event_data_t *event) {
650 cmd, event->adt_ft_mkdir.d_path, &(event->adt_ft_mkdir.d_attr));
656 MODRET solaris_audit_post_mkd(cmd_rec *cmd) {
658 cmd, "mkdir", ADT_SUCCESS, ADT_SUCCESS, mkd_fill_event);
661 MODRET solaris_audit_post_mkd_err(cmd_rec *cmd) {
663 cmd, "mkdir", ADT_FAILURE, ADT_FAILURE, mkd_fill_event_err);
668 static const char* rmd_fill_attr(cmd_rec *cmd, adt_event_data_t *event) {
670 cmd, event->adt_ft_rmdir.f_path, &(event->adt_ft_rmdir.f_attr)
674 MODRET solaris_audit_pre_rmd(cmd_rec *cmd) {
679 event = __solaris_audit_pre_arg2(cmd, "rmdir", ADT_ft_rmdir, &ptr);
682 return PR_ERROR(cmd);
688 cmd->error_code = errno;
692 return PR_ERROR(cmd);
700 (void) rmd_fill_attr(cmd, event);
702 return PR_DECLINED(cmd);
705 MODRET solaris_audit_post_rmd(cmd_rec *cmd) {
706 return __solaris_audit_post(cmd, "rmdir", ADT_SUCCESS, ADT_SUCCESS, NULL);
709 MODRET solaris_audit_post_rmd_err(cmd_rec *cmd) {
710 return __solaris_audit_post(cmd, "rmdir", ADT_FAILURE, ADT_FAILURE, NULL);
715 MODRET solaris_audit_pre_mdtm(cmd_rec *cmd) {
720 event = __solaris_audit_pre_arg2(cmd, "utimes", ADT_ft_utimes, &ptr);
723 return PR_ERROR(cmd);
729 cmd->error_code = errno;
733 return PR_ERROR(cmd);
743 return PR_DECLINED(cmd);
746 static const char* mdtm_fill_attr(cmd_rec *cmd, adt_event_data_t *event) {
748 cmd, event->adt_ft_utimes.f_path, &(event->adt_ft_utimes.f_attr)
752 MODRET solaris_audit_post_mdtm(cmd_rec *cmd) {
754 cmd, "utimes", ADT_SUCCESS, ADT_SUCCESS, mdtm_fill_attr);
757 MODRET solaris_audit_post_mdtm_err(cmd_rec *cmd) {
758 return __solaris_audit_post(cmd, "utimes", ADT_FAILURE, ADT_FAILURE, NULL);
763 MODRET solaris_audit_pre_put(cmd_rec *cmd) {
767 event = __solaris_audit_pre_arg2(cmd, "put", ADT_ft_put, &ptr);
770 return PR_ERROR(cmd);
776 return PR_DECLINED(cmd);
779 static const char* put_fill_event(cmd_rec *cmd, adt_event_data_t *event) {
784 cmd->error_code = errno;
790 cmd, event->adt_ft_put.f_path, &(event->adt_ft_put.f_attr)
794 MODRET solaris_audit_post_put(cmd_rec *cmd) {
796 cmd, "put", ADT_SUCCESS, ADT_SUCCESS, put_fill_event);
799 MODRET solaris_audit_post_put_err(cmd_rec *cmd) {
800 return __solaris_audit_post(cmd, "put", ADT_FAILURE, ADT_FAILURE, NULL);
805 MODRET solaris_audit_pre_get(cmd_rec *cmd) {
810 event = __solaris_audit_pre_arg2(cmd, "get", ADT_ft_get, &ptr);
813 return PR_ERROR(cmd);
819 cmd->error_code = errno;
823 return PR_ERROR(cmd);
833 return PR_DECLINED(cmd);
836 static const char* get_fill_attr(cmd_rec *cmd, adt_event_data_t *event) {
838 cmd, event->adt_ft_get.f_path, &(event->adt_ft_get.f_attr)
842 MODRET solaris_audit_post_get(cmd_rec *cmd) {
844 cmd, "get", ADT_SUCCESS, ADT_SUCCESS, get_fill_attr);
847 MODRET solaris_audit_post_get_err(cmd_rec *cmd) {
848 return __solaris_audit_post(cmd, "get", ADT_FAILURE, ADT_FAILURE, NULL);
874 static void __solaris_audit_rnfr_err(cmd_rec *cmd)
881 event = __solaris_audit_pre_arg2(cmd, "RNFR", ADT_ft_rename, NULL);
891 (void) __solaris_audit_post(cmd, "RNFR", ADT_FAILURE, ADT_FAILURE, NULL);
898 MODRET solaris_audit_pre_rnfr(cmd_rec *cmd) {
913 __solaris_audit_rnfr_err(cmd);
920 event = __solaris_audit_pre_arg2(cmd, "get", ADT_ft_rename, &ptr);
928 src_path = strdup(cmd->arg);
935 return PR_DECLINED(cmd);
937 return PR_ERROR(cmd);
945 MODRET solaris_audit_post_rnfr(cmd_rec *cmd) {
954 return PR_ERROR(cmd);
961 return PR_DECLINED(cmd);
972 static const char* rnfr_err_fill_event(cmd_rec *cmd, adt_event_data_t *event) {
990 MODRET solaris_audit_post_rnfr_err(cmd_rec *cmd) {
993 ret = __solaris_audit_post(cmd, "RNFR", ADT_FAILURE, ADT_FAILURE,
1004 static const char* rnto_fill_attr(cmd_rec *cmd, adt_event_data_t *event) {
1006 cmd, event->adt_ft_rename.src_path, &(event->adt_ft_rename.src_attr)
1010 MODRET solaris_audit_pre_rnto(cmd_rec *cmd) {
1015 event = __solaris_audit_pre_arg2(cmd, "get", ADT_ft_rename, &ptr);
1032 msg = rnto_fill_attr(cmd, event);
1039 return PR_DECLINED(cmd);
1043 return PR_ERROR(cmd);
1046 static const char* rnto_fill_event(cmd_rec *cmd, adt_event_data_t *event) {
1060 MODRET solaris_audit_post_rnto(cmd_rec *cmd) {
1065 return PR_ERROR(cmd);
1067 retval = __solaris_audit_post(cmd, "RNTO", ADT_SUCCESS, ADT_SUCCESS,
1080 static const char* rnto_err_fill_event(cmd_rec *cmd, adt_event_data_t *event) {
1089 MODRET solaris_audit_post_rnto_err(cmd_rec *cmd) {
1091 retval = __solaris_audit_post(cmd, "RNTO", ADT_FAILURE, ADT_FAILURE,