PERFORCE change 147856 for review
Diego Giagio
diego at FreeBSD.org
Wed Aug 20 01:12:16 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=147856
Change 147856 by diego at diego_black on 2008/08/20 01:11:38
Clean up audit_arg.c. We don't need audit_record_arg_xxx functions
anymore.
Affected files ...
.. //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit_arg.c#6 edit
Differences ...
==== //depot/projects/soc2008/diego-audit/src/sys/security/audit/audit_arg.c#6 (text) ====
@@ -35,7 +35,6 @@
#include <sys/ipc.h>
#include <sys/mount.h>
#include <sys/proc.h>
-#include <sys/sbuf.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/protosw.h>
@@ -45,11 +44,11 @@
#include <sys/un.h>
#include <sys/vnode.h>
-#include <machine/stdarg.h>
-
#include <netinet/in.h>
#include <netinet/in_pcb.h>
+#include <machine/stdarg.h>
+
#include <security/audit/audit.h>
#include <security/audit/audit_private.h>
@@ -64,16 +63,20 @@
* hasn't already been filled in?
*/
void
-audit_record_arg_addr(struct kaudit_record *ar, void *addr)
+audit_arg_addr(void *addr)
{
- KASSERT(ar != NULL, ("audit_record_arg_addr: ar == NULL"));
+ struct kaudit_record *ar;
+
+ ar = currecord();
+ if (ar == NULL)
+ return;
ar->k_ar.ar_arg_addr = addr;
ARG_SET_VALID(ar, ARG_ADDR);
}
void
-audit_arg_addr(void *addr)
+audit_arg_exit(int status, int retval)
{
struct kaudit_record *ar;
@@ -81,21 +84,13 @@
if (ar == NULL)
return;
- audit_record_arg_addr(ar, addr);
-}
-
-void
-audit_record_arg_exit(struct kaudit_record *ar, int status, int retval)
-{
- KASSERT(ar != NULL, ("audit_record_arg_exit: ar == NULL"));
-
ar->k_ar.ar_arg_exitstatus = status;
ar->k_ar.ar_arg_exitretval = retval;
ARG_SET_VALID(ar, ARG_EXIT);
}
void
-audit_arg_exit(int status, int retval)
+audit_arg_len(int len)
{
struct kaudit_record *ar;
@@ -103,20 +98,12 @@
if (ar == NULL)
return;
- audit_record_arg_exit(ar, status, retval);
-}
-
-void
-audit_record_arg_len(struct kaudit_record *ar, int len)
-{
- KASSERT(ar != NULL, ("audit_record_arg_len: ar == NULL"));
-
ar->k_ar.ar_arg_len = len;
ARG_SET_VALID(ar, ARG_LEN);
}
void
-audit_arg_len(int len)
+audit_arg_fd(int fd)
{
struct kaudit_record *ar;
@@ -124,20 +111,12 @@
if (ar == NULL)
return;
- audit_record_arg_len(ar, len);
-}
-
-void
-audit_record_arg_fd(struct kaudit_record *ar, int fd)
-{
- KASSERT(ar != NULL, ("audit_record_arg_fd: ar == NULL"));
-
ar->k_ar.ar_arg_fd = fd;
ARG_SET_VALID(ar, ARG_FD);
}
void
-audit_arg_fd(int fd)
+audit_arg_fflags(int fflags)
{
struct kaudit_record *ar;
@@ -145,20 +124,12 @@
if (ar == NULL)
return;
- audit_record_arg_fd(ar, fd);
-}
-
-void
-audit_record_arg_fflags(struct kaudit_record *ar, int fflags)
-{
- KASSERT(ar != NULL, ("audit_record_arg_fflags: ar == NULL"));
-
ar->k_ar.ar_arg_fflags = fflags;
ARG_SET_VALID(ar, ARG_FFLAGS);
}
void
-audit_arg_fflags(int fflags)
+audit_arg_gid(gid_t gid)
{
struct kaudit_record *ar;
@@ -166,20 +137,12 @@
if (ar == NULL)
return;
- audit_record_arg_fflags(ar, fflags);
-}
-
-void
-audit_record_arg_gid(struct kaudit_record *ar, gid_t gid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_gid: ar == NULL"));
-
ar->k_ar.ar_arg_gid = gid;
ARG_SET_VALID(ar, ARG_GID);
}
void
-audit_arg_gid(gid_t gid)
+audit_arg_uid(uid_t uid)
{
struct kaudit_record *ar;
@@ -187,20 +150,12 @@
if (ar == NULL)
return;
- audit_record_arg_gid(ar, gid);
-}
-
-void
-audit_record_arg_uid(struct kaudit_record *ar, uid_t uid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_uid: ar == NULL"));
-
ar->k_ar.ar_arg_uid = uid;
ARG_SET_VALID(ar, ARG_UID);
}
void
-audit_arg_uid(uid_t uid)
+audit_arg_egid(gid_t egid)
{
struct kaudit_record *ar;
@@ -208,20 +163,12 @@
if (ar == NULL)
return;
- audit_record_arg_uid(ar, uid);
-}
-
-void
-audit_record_arg_egid(struct kaudit_record *ar, gid_t egid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_egid: ar == NULL"));
-
ar->k_ar.ar_arg_egid = egid;
ARG_SET_VALID(ar, ARG_EGID);
}
void
-audit_arg_egid(gid_t egid)
+audit_arg_euid(uid_t euid)
{
struct kaudit_record *ar;
@@ -229,20 +176,12 @@
if (ar == NULL)
return;
- audit_record_arg_egid(ar, egid);
-}
-
-void
-audit_record_arg_euid(struct kaudit_record *ar, uid_t euid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_euid: ar == NULL"));
-
ar->k_ar.ar_arg_euid = euid;
ARG_SET_VALID(ar, ARG_EUID);
}
void
-audit_arg_euid(uid_t euid)
+audit_arg_rgid(gid_t rgid)
{
struct kaudit_record *ar;
@@ -250,20 +189,12 @@
if (ar == NULL)
return;
- audit_record_arg_euid(ar, euid);
-}
-
-void
-audit_record_arg_rgid(struct kaudit_record *ar, gid_t rgid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_rgid: ar == NULL"));
-
ar->k_ar.ar_arg_rgid = rgid;
ARG_SET_VALID(ar, ARG_RGID);
}
void
-audit_arg_rgid(gid_t rgid)
+audit_arg_ruid(uid_t ruid)
{
struct kaudit_record *ar;
@@ -271,20 +202,12 @@
if (ar == NULL)
return;
- audit_record_arg_rgid(ar, rgid);
-}
-
-void
-audit_record_arg_ruid(struct kaudit_record *ar, uid_t ruid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_ruid: ar == NULL"));
-
ar->k_ar.ar_arg_ruid = ruid;
ARG_SET_VALID(ar, ARG_RUID);
}
void
-audit_arg_ruid(uid_t ruid)
+audit_arg_sgid(gid_t sgid)
{
struct kaudit_record *ar;
@@ -292,20 +215,12 @@
if (ar == NULL)
return;
- audit_record_arg_ruid(ar, ruid);
-}
-
-void
-audit_record_arg_sgid(struct kaudit_record *ar, gid_t sgid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_sgid: ar == NULL"));
-
ar->k_ar.ar_arg_sgid = sgid;
ARG_SET_VALID(ar, ARG_SGID);
}
void
-audit_arg_sgid(gid_t sgid)
+audit_arg_suid(uid_t suid)
{
struct kaudit_record *ar;
@@ -313,38 +228,20 @@
if (ar == NULL)
return;
- audit_record_arg_sgid(ar, sgid);
-}
-
-void
-audit_record_arg_suid(struct kaudit_record *ar, uid_t suid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_suid: ar == NULL"));
-
ar->k_ar.ar_arg_suid = suid;
ARG_SET_VALID(ar, ARG_SUID);
}
void
-audit_arg_suid(uid_t suid)
+audit_arg_groupset(gid_t *gidset, u_int gidset_size)
{
+ int i;
struct kaudit_record *ar;
ar = currecord();
if (ar == NULL)
return;
- audit_record_arg_suid(ar, suid);
-}
-
-void
-audit_record_arg_groupset(struct kaudit_record *ar, gid_t *gidset,
- u_int gidset_size)
-{
- int i;
-
- KASSERT(ar != NULL, ("audit_record_arg_groupset: ar == NULL"));
-
for (i = 0; i < gidset_size; i++)
ar->k_ar.ar_arg_groups.gidset[i] = gidset[i];
ar->k_ar.ar_arg_groups.gidset_size = gidset_size;
@@ -352,7 +249,7 @@
}
void
-audit_arg_groupset(gid_t *gidset, u_int gidset_size)
+audit_arg_login(char *login)
{
struct kaudit_record *ar;
@@ -360,20 +257,12 @@
if (ar == NULL)
return;
- audit_record_arg_groupset(ar, gidset, gidset_size);
-}
-
-void
-audit_record_arg_login(struct kaudit_record *ar, char *login)
-{
- KASSERT(ar != NULL, ("audit_record_arg_login: ar == NULL"));
-
strlcpy(ar->k_ar.ar_arg_login, login, MAXLOGNAME);
ARG_SET_VALID(ar, ARG_LOGIN);
}
void
-audit_arg_login(char *login)
+audit_arg_ctlname(int *name, int namelen)
{
struct kaudit_record *ar;
@@ -381,21 +270,13 @@
if (ar == NULL)
return;
- audit_record_arg_login(ar, login);
-}
-
-void
-audit_record_arg_ctlname(struct kaudit_record *ar, int *name, int namelen)
-{
- KASSERT(ar != NULL, ("audit_record_arg_ctlname: ar == NULL"));
-
bcopy(name, &ar->k_ar.ar_arg_ctlname, namelen * sizeof(int));
ar->k_ar.ar_arg_len = namelen;
ARG_SET_VALID(ar, ARG_CTLNAME | ARG_LEN);
}
void
-audit_arg_ctlname(int *name, int namelen)
+audit_arg_mask(int mask)
{
struct kaudit_record *ar;
@@ -403,20 +284,12 @@
if (ar == NULL)
return;
- audit_record_arg_ctlname(ar, name, namelen);
-}
-
-void
-audit_record_arg_mask(struct kaudit_record *ar, int mask)
-{
- KASSERT(ar != NULL, ("audit_record_arg_mask: ar == NULL"));
-
ar->k_ar.ar_arg_mask = mask;
ARG_SET_VALID(ar, ARG_MASK);
}
void
-audit_arg_mask(int mask)
+audit_arg_mode(mode_t mode)
{
struct kaudit_record *ar;
@@ -424,20 +297,12 @@
if (ar == NULL)
return;
- audit_record_arg_mask(ar, mask);
-}
-
-void
-audit_record_arg_mode(struct kaudit_record *ar, mode_t mode)
-{
- KASSERT(ar != NULL, ("audit_record_arg_mode: ar == NULL"));
-
ar->k_ar.ar_arg_mode = mode;
ARG_SET_VALID(ar, ARG_MODE);
}
void
-audit_arg_mode(mode_t mode)
+audit_arg_dev(int dev)
{
struct kaudit_record *ar;
@@ -445,20 +310,12 @@
if (ar == NULL)
return;
- audit_record_arg_mode(ar, mode);
-}
-
-void
-audit_record_arg_dev(struct kaudit_record *ar, int dev)
-{
- KASSERT(ar != NULL, ("audit_record_arg_dev: ar == NULL"));
-
ar->k_ar.ar_arg_dev = dev;
ARG_SET_VALID(ar, ARG_DEV);
}
void
-audit_arg_dev(int dev)
+audit_arg_value(long value)
{
struct kaudit_record *ar;
@@ -466,20 +323,12 @@
if (ar == NULL)
return;
- audit_record_arg_dev(ar, dev);
-}
-
-void
-audit_record_arg_value(struct kaudit_record *ar, long value)
-{
- KASSERT(ar != NULL, ("audit_record_arg_value: ar == NULL"));
-
ar->k_ar.ar_arg_value = value;
ARG_SET_VALID(ar, ARG_VALUE);
}
void
-audit_arg_value(long value)
+audit_arg_owner(uid_t uid, gid_t gid)
{
struct kaudit_record *ar;
@@ -487,21 +336,13 @@
if (ar == NULL)
return;
- audit_record_arg_value(ar, value);
-}
-
-void
-audit_record_arg_owner(struct kaudit_record *ar, uid_t uid, gid_t gid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_owner: ar == NULL"));
-
ar->k_ar.ar_arg_uid = uid;
ar->k_ar.ar_arg_gid = gid;
ARG_SET_VALID(ar, ARG_UID | ARG_GID);
}
void
-audit_arg_owner(uid_t uid, gid_t gid)
+audit_arg_pid(pid_t pid)
{
struct kaudit_record *ar;
@@ -509,38 +350,23 @@
if (ar == NULL)
return;
- audit_record_arg_owner(ar, uid, gid);
-}
-
-void
-audit_record_arg_pid(struct kaudit_record *ar, pid_t pid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_pid: ar == NULL"));
-
ar->k_ar.ar_arg_pid = pid;
ARG_SET_VALID(ar, ARG_PID);
}
void
-audit_arg_pid(pid_t pid)
+audit_arg_process(struct proc *p)
{
struct kaudit_record *ar;
+ KASSERT(p != NULL, ("audit_arg_process: p == NULL"));
+
+ PROC_LOCK_ASSERT(p, MA_OWNED);
+
ar = currecord();
if (ar == NULL)
return;
- audit_record_arg_pid(ar, pid);
-}
-
-void
-audit_record_arg_process(struct kaudit_record *ar, struct proc *p)
-{
- KASSERT(ar != NULL, ("audit_record_arg_process: ar == NULL"));
- KASSERT(p != NULL, ("audit_record_arg_process: p == NULL"));
-
- PROC_LOCK_ASSERT(p, MA_OWNED);
-
ar->k_ar.ar_arg_auid = p->p_ucred->cr_audit.ai_auid;
ar->k_ar.ar_arg_euid = p->p_ucred->cr_uid;
ar->k_ar.ar_arg_egid = p->p_ucred->cr_groups[0];
@@ -554,7 +380,7 @@
}
void
-audit_arg_process(struct proc *p)
+audit_arg_signum(u_int signum)
{
struct kaudit_record *ar;
@@ -562,20 +388,12 @@
if (ar == NULL)
return;
- audit_record_arg_process(ar, p);
-}
-
-void
-audit_record_arg_signum(struct kaudit_record *ar, u_int signum)
-{
- KASSERT(ar != NULL, ("audit_record_arg_signum: ar == NULL"));
-
ar->k_ar.ar_arg_signum = signum;
ARG_SET_VALID(ar, ARG_SIGNUM);
}
void
-audit_arg_signum(u_int signum)
+audit_arg_socket(int sodomain, int sotype, int soprotocol)
{
struct kaudit_record *ar;
@@ -583,15 +401,6 @@
if (ar == NULL)
return;
- audit_record_arg_signum(ar, signum);
-}
-
-void
-audit_record_arg_socket(struct kaudit_record *ar, int sodomain, int sotype,
- int soprotocol)
-{
- KASSERT(ar != NULL, ("audit_record_arg_socket: ar == NULL"));
-
ar->k_ar.ar_arg_sockinfo.so_domain = sodomain;
ar->k_ar.ar_arg_sockinfo.so_type = sotype;
ar->k_ar.ar_arg_sockinfo.so_protocol = soprotocol;
@@ -599,53 +408,17 @@
}
void
-audit_arg_socket(int sodomain, int sotype, int soprotocol)
+audit_arg_sockaddr(struct thread *td, struct sockaddr *sa)
{
struct kaudit_record *ar;
- ar = currecord();
- if (ar == NULL)
- return;
+ KASSERT(td != NULL, ("audit_arg_sockaddr: td == NULL"));
+ KASSERT(sa != NULL, ("audit_arg_sockaddr: sa == NULL"));
- audit_record_arg_socket(ar, sodomain, sotype, soprotocol);
-}
-
-void
-audit_record_arg_socket_ex(struct kaudit_record *ar, int sodomain, int sotype,
- struct sockaddr *la, struct sockaddr *ra)
-{
- KASSERT(ar != NULL, ("audit_record_arg_socket_ex: ar == NULL"));
- KASSERT(la != NULL, ("audit_record_arg_socket_ex: la == NULL"));
- KASSERT(ra != NULL, ("audit_record_arg_socket_ex: ra == NULL"));
-
- ar->k_ar.ar_arg_sockconn.sc_domain = sodomain;
- ar->k_ar.ar_arg_sockconn.sc_type = sotype;
- bcopy(la, &ar->k_ar.ar_arg_sockconn.sc_laddr, la->sa_len);
- bcopy(ra, &ar->k_ar.ar_arg_sockconn.sc_raddr, ra->sa_len);
- ARG_SET_VALID(ar, ARG_SOCKCONN);
-}
-
-void
-audit_arg_socket_ex(int sodomain, int sotype, struct sockaddr *la,
- struct sockaddr *ra)
-{
- struct kaudit_record *ar;
-
ar = currecord();
if (ar == NULL)
return;
- audit_record_arg_socket_ex(ar, sodomain, sotype, la, ra);
-}
-
-void
-audit_record_arg_sockaddr(struct kaudit_record *ar, struct thread *td,
- struct sockaddr *sa)
-{
- KASSERT(ar != NULL, ("audit_record_arg_sockaddr: ar == NULL"));
- KASSERT(td != NULL, ("audit_record_arg_sockaddr: td == NULL"));
- KASSERT(sa != NULL, ("audit_record_arg_sockaddr: sa == NULL"));
-
bcopy(sa, &ar->k_ar.ar_arg_sockaddr, sa->sa_len);
switch (sa->sa_family) {
case AF_INET:
@@ -657,8 +430,8 @@
break;
case AF_UNIX:
- audit_record_arg_upath(ar, td,
- ((struct sockaddr_un *)sa)->sun_path, ARG_UPATH1);
+ audit_arg_upath(td, ((struct sockaddr_un *)sa)->sun_path,
+ ARG_UPATH1);
ARG_SET_VALID(ar, ARG_SADDRUNIX);
break;
/* XXXAUDIT: default:? */
@@ -666,7 +439,7 @@
}
void
-audit_arg_sockaddr(struct thread *td, struct sockaddr *sa)
+audit_arg_auid(uid_t auid)
{
struct kaudit_record *ar;
@@ -674,20 +447,12 @@
if (ar == NULL)
return;
- audit_record_arg_sockaddr(ar, td, sa);
-}
-
-void
-audit_record_arg_auid(struct kaudit_record *ar, uid_t auid)
-{
- KASSERT(ar != NULL, ("audit_record_arg_auid: ar == NULL"));
-
ar->k_ar.ar_arg_auid = auid;
ARG_SET_VALID(ar, ARG_AUID);
}
void
-audit_arg_auid(uid_t auid)
+audit_arg_auditinfo(struct auditinfo *au_info)
{
struct kaudit_record *ar;
@@ -695,14 +460,6 @@
if (ar == NULL)
return;
- audit_record_arg_auid(ar, auid);
-}
-
-void
-audit_record_arg_auditinfo(struct kaudit_record *ar, struct auditinfo *au_info)
-{
- KASSERT(ar != NULL, ("audit_record_arg_auditinfo: ar == NULL"));
-
ar->k_ar.ar_arg_auid = au_info->ai_auid;
ar->k_ar.ar_arg_asid = au_info->ai_asid;
ar->k_ar.ar_arg_amask.am_success = au_info->ai_mask.am_success;
@@ -713,7 +470,7 @@
}
void
-audit_arg_auditinfo(struct auditinfo *au_info)
+audit_arg_auditinfo_addr(struct auditinfo_addr *au_info)
{
struct kaudit_record *ar;
@@ -721,15 +478,6 @@
if (ar == NULL)
return;
- audit_record_arg_auditinfo(ar, au_info);
-}
-
-void
-audit_record_arg_auditinfo_addr(struct kaudit_record *ar,
- struct auditinfo_addr *au_info)
-{
- KASSERT(ar != NULL, ("audit_record_arg_auditinfo_addr: ar == NULL"));
-
ar->k_ar.ar_arg_auid = au_info->ai_auid;
ar->k_ar.ar_arg_asid = au_info->ai_asid;
ar->k_ar.ar_arg_amask.am_success = au_info->ai_mask.am_success;
@@ -744,18 +492,6 @@
}
void
-audit_arg_auditinfo_addr(struct auditinfo_addr *au_info)
-{
- struct kaudit_record *ar;
-
- ar = currecord();
- if (ar == NULL)
- return;
-
- audit_record_arg_auditinfo_addr(ar, au_info);
-}
-
-void
audit_arg_text(char *text, ...)
{
struct kaudit_record *ar;
@@ -786,16 +522,20 @@
}
void
-audit_record_arg_cmd(struct kaudit_record *ar, int cmd)
+audit_arg_cmd(int cmd)
{
- KASSERT(ar != NULL, ("audit_record_arg_cmd: ar == NULL"));
+ struct kaudit_record *ar;
+
+ ar = currecord();
+ if (ar == NULL)
+ return;
ar->k_ar.ar_arg_cmd = cmd;
ARG_SET_VALID(ar, ARG_CMD);
}
void
-audit_arg_cmd(int cmd)
+audit_arg_svipc_cmd(int cmd)
{
struct kaudit_record *ar;
@@ -803,20 +543,12 @@
if (ar == NULL)
return;
- audit_record_arg_cmd(ar, cmd);
-}
-
-void
-audit_record_arg_svipc_cmd(struct kaudit_record *ar, int cmd)
-{
- KASSERT(ar != NULL, ("audit_record_arg_svipc_cmd: ar == NULL"));
-
ar->k_ar.ar_arg_svipc_cmd = cmd;
ARG_SET_VALID(ar, ARG_SVIPC_CMD);
}
void
-audit_arg_svipc_cmd(int cmd)
+audit_arg_svipc_perm(struct ipc_perm *perm)
{
struct kaudit_record *ar;
@@ -824,21 +556,13 @@
if (ar == NULL)
return;
- audit_record_arg_svipc_cmd(ar, cmd);
-}
-
-void
-audit_record_arg_svipc_perm(struct kaudit_record *ar, struct ipc_perm *perm)
-{
- KASSERT(ar != NULL, ("audit_record_arg_svipc_perm: ar == NULL"));
-
bcopy(perm, &ar->k_ar.ar_arg_svipc_perm,
sizeof(ar->k_ar.ar_arg_svipc_perm));
ARG_SET_VALID(ar, ARG_SVIPC_PERM);
}
void
-audit_arg_svipc_perm(struct ipc_perm *perm)
+audit_arg_svipc_id(int id)
{
struct kaudit_record *ar;
@@ -846,20 +570,12 @@
if (ar == NULL)
return;
- audit_record_arg_svipc_perm(ar, perm);
-}
-
-void
-audit_record_arg_svipc_id(struct kaudit_record *ar, int id)
-{
- KASSERT(ar != NULL, ("audit_record_arg_svipc_id: ar == NULL"));
-
ar->k_ar.ar_arg_svipc_id = id;
ARG_SET_VALID(ar, ARG_SVIPC_ID);
}
void
-audit_arg_svipc_id(int id)
+audit_arg_svipc_addr(void * addr)
{
struct kaudit_record *ar;
@@ -867,20 +583,12 @@
if (ar == NULL)
return;
- audit_record_arg_svipc_id(ar, id);
-}
-
-void
-audit_record_arg_svipc_addr(struct kaudit_record *ar, void * addr)
-{
- KASSERT(ar != NULL, ("audit_record_arg_svipc_addr: ar == NULL"));
-
ar->k_ar.ar_arg_svipc_addr = addr;
ARG_SET_VALID(ar, ARG_SVIPC_ADDR);
}
void
-audit_arg_svipc_addr(void *addr)
+audit_arg_posix_ipc_perm(uid_t uid, gid_t gid, mode_t mode)
{
struct kaudit_record *ar;
@@ -888,15 +596,6 @@
if (ar == NULL)
return;
- audit_record_arg_svipc_addr(ar, addr);
-}
-
-void
-audit_record_arg_posix_ipc_perm(struct kaudit_record *ar, uid_t uid, gid_t gid,
- mode_t mode)
-{
- KASSERT(ar != NULL, ("audit_record_arg_posix_ipc_perm: ar == NULL"));
-
ar->k_ar.ar_arg_pipc_perm.pipc_uid = uid;
ar->k_ar.ar_arg_pipc_perm.pipc_gid = gid;
ar->k_ar.ar_arg_pipc_perm.pipc_mode = mode;
@@ -904,7 +603,7 @@
}
void
-audit_arg_posix_ipc_perm(uid_t uid, gid_t gid, mode_t mode)
+audit_arg_auditon(union auditon_udata *udata)
{
struct kaudit_record *ar;
@@ -912,44 +611,27 @@
if (ar == NULL)
return;
- audit_record_arg_posix_ipc_perm(ar, uid, gid, mode);
-}
-
-void
-audit_record_arg_auditon(struct kaudit_record *ar, union auditon_udata *udata)
-{
- KASSERT(ar != NULL, ("audit_record_arg_auditon: ar == NULL"));
-
bcopy((void *)udata, &ar->k_ar.ar_arg_auditon,
sizeof(ar->k_ar.ar_arg_auditon));
ARG_SET_VALID(ar, ARG_AUDITON);
}
-void
-audit_arg_auditon(union auditon_udata *udata)
-{
- struct kaudit_record *ar;
-
- ar = currecord();
- if (ar == NULL)
- return;
-
- audit_record_arg_auditon(ar, udata);
-}
-
/*
* Audit information about a file, either the file's vnode info, or its
* socket address info.
*/
void
-audit_record_arg_file(struct kaudit_record *ar, struct proc *p, struct file *fp)
+audit_arg_file(struct proc *p, struct file *fp)
{
+ struct kaudit_record *ar;
struct socket *so;
struct inpcb *pcb;
struct vnode *vp;
int vfslocked;
- KASSERT(ar != NULL, ("audit_record_arg_file: ar == NULL"));
+ ar = currecord();
+ if (ar == NULL)
+ return;
switch (fp->f_type) {
case DTYPE_VNODE:
@@ -960,7 +642,7 @@
vp = fp->f_vnode;
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- audit_record_arg_vnode(ar, vp, ARG_VNODE1);
+ audit_arg_vnode(vp, ARG_VNODE1);
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
break;
@@ -997,18 +679,6 @@
}
}
-void
-audit_arg_file(struct proc *p, struct file *fp)
-{
- struct kaudit_record *ar;
-
- ar = currecord();
- if (ar == NULL)
- return;
-
- audit_record_arg_file(ar, p, fp);
-}
-
/*
* Store a path as given by the user process for auditing into the audit
* record stored on the user thread. This function will allocate the memory
@@ -1018,19 +688,22 @@
* XXXAUDIT: Possibly assert that the memory isn't already allocated?
*/
void
-audit_record_arg_upath(struct kaudit_record *ar, struct thread *td,
- char *upath, u_int64_t flag)
+audit_arg_upath(struct thread *td, char *upath, u_int64_t flag)
{
+ struct kaudit_record *ar;
char **pathp;
- KASSERT(ar != NULL, ("audit_record_arg_upath: ar == NULL"));
- KASSERT(td != NULL, ("audit_record_arg_upath: td == NULL"));
- KASSERT(upath != NULL, ("audit_record_arg_upath: upath == NULL"));
+ KASSERT(td != NULL, ("audit_arg_upath: td == NULL"));
+ KASSERT(upath != NULL, ("audit_arg_upath: upath == NULL"));
+
+ ar = currecord();
+ if (ar == NULL)
+ return;
KASSERT((flag == ARG_UPATH1) || (flag == ARG_UPATH2),
- ("audit_record_arg_upath: flag %llu", (unsigned long long)flag));
+ ("audit_arg_upath: flag %llu", (unsigned long long)flag));
KASSERT((flag != ARG_UPATH1) || (flag != ARG_UPATH2),
- ("audit_record_arg_upath: flag %llu", (unsigned long long)flag));
+ ("audit_arg_upath: flag %llu", (unsigned long long)flag));
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list