#if CONFIG_FSE
fse_info finfo;
#endif
- int need_event, has_listeners;
+ int need_event, has_listeners, need_kpath2;
char *target_path = NULL;
int truncated=0;
#endif
has_listeners = kauth_authorize_fileop_has_listeners();
- if (need_event || has_listeners) {
+ need_kpath2 = 0;
+#if CONFIG_AUDIT
+ if (AUDIT_RECORD_EXISTS()) {
+ need_kpath2 = 1;
+ }
+#endif
+
+ if (need_event || has_listeners || need_kpath2) {
char *link_to_path = NULL;
int len, link_name_len;
len = safe_getpath(dvp, nd.ni_cnd.cn_nameptr, target_path, MAXPATHLEN, &truncated);
+ AUDIT_ARG(kpath, target_path, ARG_KPATH2);
+
if (has_listeners) {
/* build the path to file we are linking to */
GET_PATH(link_to_path);
int retry_count;
int mntrename;
int need_event;
+ int need_kpath2;
+ int has_listeners;
const char *oname = NULL;
char *from_name = NULL, *to_name = NULL;
int from_len=0, to_len=0;
need_event = 0;
#endif /* CONFIG_FSE */
- if (need_event || kauth_authorize_fileop_has_listeners()) {
+ has_listeners = kauth_authorize_fileop_has_listeners();
+
+ need_kpath2 = 0;
+#if CONFIG_AUDIT
+ if (AUDIT_RECORD_EXISTS()) {
+ need_kpath2 = 1;
+ }
+#endif
+
+ if (need_event || has_listeners) {
if (from_name == NULL) {
GET_PATH(from_name);
if (from_name == NULL) {
}
from_len = safe_getpath(fdvp, fromnd->ni_cnd.cn_nameptr, from_name, MAXPATHLEN, &from_truncated);
+ }
+ if (need_event || need_kpath2 || has_listeners) {
if (to_name == NULL) {
GET_PATH(to_name);
if (to_name == NULL) {
}
to_len = safe_getpath(tdvp, tond->ni_cnd.cn_nameptr, to_name, MAXPATHLEN, &to_truncated);
+ if (to_name && need_kpath2) {
+ AUDIT_ARG(kpath, to_name, ARG_KPATH2);
+ }
}
if (!fvp) {
/*