PERFORCE change 100524 for review
Wayne Salamon
wsalamon at FreeBSD.org
Mon Jul 3 20:35:42 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100524
Change 100524 by wsalamon at vh3 on 2006/07/03 20:34:16
Break the handling of EXTATTR events into separate cases for clarity.
Affected files ...
.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm.c#17 edit
Differences ...
==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm.c#17 (text+ko) ====
@@ -238,6 +238,29 @@
} \
} while (0) \
+#define EXTATTR_TOKENS do { \
+ if (ARG_IS_VALID(kar, ARG_VALUE)) { \
+ switch (ar->ar_arg_value) { \
+ case EXTATTR_NAMESPACE_USER: \
+ tok = au_to_text(EXTATTR_NAMESPACE_USER_STRING);\
+ break; \
+ case EXTATTR_NAMESPACE_SYSTEM: \
+ tok = au_to_text(EXTATTR_NAMESPACE_SYSTEM_STRING);\
+ break; \
+ default: \
+ tok = au_to_arg32(3, "attrnamespace", \
+ ar->ar_arg_value); \
+ break; \
+ } \
+ kau_write(rec, tok); \
+ } \
+ /* attrname is in the text field */ \
+ if (ARG_IS_VALID(kar, ARG_TEXT)) { \
+ tok = au_to_text(ar->ar_arg_text); \
+ kau_write(rec, tok); \
+ } \
+} while (0)
+
/*
* Implement auditing for the auditon() system call. The audit tokens that
* are generated depend on the command that was sent into the auditon()
@@ -626,6 +649,18 @@
UPATH1_VNODE1_TOKENS;
break;
+ case AUE_EXTATTRCTL:
+ UPATH1_VNODE1_TOKENS;
+ if (ARG_IS_VALID(kar, ARG_CMD)) {
+ tok = au_to_arg32(2, "cmd", ar->ar_arg_cmd);
+ kau_write(rec, tok);
+ }
+ /* extattrctl(2) filename parameter is in upath2/vnode2 */
+ UPATH2_TOKENS;
+ VNODE2_TOKENS;
+ EXTATTR_TOKENS;
+ break;
+
case AUE_EXTATTR_GET_FILE:
case AUE_EXTATTR_SET_FILE:
case AUE_EXTATTR_LIST_FILE:
@@ -634,16 +669,10 @@
case AUE_EXTATTR_SET_LINK:
case AUE_EXTATTR_LIST_LINK:
case AUE_EXTATTR_DELETE_LINK:
- case AUE_EXTATTRCTL:
UPATH1_VNODE1_TOKENS;
- if (ARG_IS_VALID(kar, ARG_CMD)) {
- tok = au_to_arg32(2, "cmd", ar->ar_arg_cmd);
- kau_write(rec, tok);
- }
- /* extattrctl(2) filename parameter is in upath2/vnode2 */
- UPATH2_TOKENS;
- VNODE2_TOKENS;
- /* fall through */
+ EXTATTR_TOKENS;
+ break;
+
case AUE_EXTATTR_GET_FD:
case AUE_EXTATTR_SET_FD:
case AUE_EXTATTR_LIST_FD:
@@ -652,26 +681,7 @@
tok = au_to_arg32(2, "fd", ar->ar_arg_fd);
kau_write(rec, tok);
}
- if (ARG_IS_VALID(kar, ARG_VALUE)) {
- switch (ar->ar_arg_value) {
- case EXTATTR_NAMESPACE_USER:
- tok = au_to_text(EXTATTR_NAMESPACE_USER_STRING);
- break;
- case EXTATTR_NAMESPACE_SYSTEM:
- tok = au_to_text(EXTATTR_NAMESPACE_SYSTEM_STRING);
- break;
- default:
- tok = au_to_arg32(3, "attrnamespace",
- ar->ar_arg_value);
- break;
- }
- kau_write(rec, tok);
- }
- /* attrname is in the text field */
- if (ARG_IS_VALID(kar, ARG_TEXT)) {
- tok = au_to_text(ar->ar_arg_text);
- kau_write(rec, tok);
- }
+ EXTATTR_TOKENS;
break;
case AUE_FCHMOD:
More information about the trustedbsd-cvs
mailing list