summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/fs')
-rw-r--r--usr/src/uts/common/fs/lookup.c27
-rw-r--r--usr/src/uts/common/fs/sockfs/sockstr.c7
-rw-r--r--usr/src/uts/common/fs/sockfs/socksubr.c5
-rw-r--r--usr/src/uts/common/fs/sockfs/socktpi.c13
-rw-r--r--usr/src/uts/common/fs/vnode.c10
5 files changed, 33 insertions, 29 deletions
diff --git a/usr/src/uts/common/fs/lookup.c b/usr/src/uts/common/fs/lookup.c
index 076887fdbc..940b2f17d1 100644
--- a/usr/src/uts/common/fs/lookup.c
+++ b/usr/src/uts/common/fs/lookup.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -92,7 +92,7 @@ lookupnameatcred(
error = pn_get_buf(fnamep, seg, &lookpn, namebuf, sizeof (namebuf));
if (error == 0) {
- if (audit_active)
+ if (AU_AUDITING())
audit_lookupname();
error = lookuppnatcred(&lookpn, NULL, followlink,
dirvpp, compvpp, startvp, cr);
@@ -230,6 +230,7 @@ lookuppnvp(
vnode_t *zonevp = curproc->p_zone->zone_rootvp; /* zone root */
int must_be_directory = 0;
boolean_t retry_with_kcred;
+ uint32_t auditing = AU_AUDITING();
CPU_STATS_ADDQ(CPU, sys, namei, 1);
nlink = 0;
@@ -244,7 +245,7 @@ lookuppnvp(
pp = &presrvd;
}
- if (audit_active)
+ if (auditing)
audit_anchorpath(pnp, vp == rootvp);
/*
@@ -276,7 +277,7 @@ next:
* Process the next component of the pathname.
*/
if (error = pn_getcomponent(pnp, component)) {
- if (audit_active)
+ if (auditing)
audit_addcomponent(pnp);
goto bad;
}
@@ -408,7 +409,7 @@ checkforroot:
*/
if (pn_pathleft(pnp) || dirvpp == NULL || error != ENOENT)
goto bad;
- if (audit_active) { /* directory access */
+ if (auditing) { /* directory access */
if (error = audit_savepath(pnp, vp, error, cr))
goto bad_noaudit;
}
@@ -466,7 +467,7 @@ checkforroot:
*/
if (cvp->v_type == VLNK && ((flags & FOLLOW) || pn_pathleft(pnp))) {
struct pathname linkpath;
- if (audit_active) {
+ if (auditing) {
if (error = audit_pathcomp(pnp, cvp, cr))
goto bad;
}
@@ -481,7 +482,7 @@ checkforroot:
goto bad;
}
- if (audit_active)
+ if (auditing)
audit_symlink(pnp, &linkpath);
if (pn_pathleft(&linkpath) == 0)
@@ -505,7 +506,7 @@ checkforroot:
vp = rootvp;
VN_HOLD(vp);
}
- if (audit_active)
+ if (auditing)
audit_anchorpath(pnp, vp == rootvp);
if (pn_fixslash(pnp)) {
flags |= FOLLOW;
@@ -578,7 +579,7 @@ checkforroot:
* an alias of the last component.
*/
if (vn_compare(vp, cvp)) {
- if (audit_active)
+ if (auditing)
(void) audit_savepath(pnp, cvp,
EINVAL, cr);
pn_setlast(pnp);
@@ -590,14 +591,14 @@ checkforroot:
pn_free(pp);
return (EINVAL);
}
- if (audit_active) {
+ if (auditing) {
if (error = audit_pathcomp(pnp, vp, cr))
goto bad;
}
*dirvpp = vp;
} else
VN_RELE(vp);
- if (audit_active)
+ if (auditing)
(void) audit_savepath(pnp, cvp, 0, cr);
if (pnp->pn_path == pnp->pn_buf)
(void) pn_set(pnp, ".");
@@ -621,7 +622,7 @@ checkforroot:
return (0);
}
- if (audit_active) {
+ if (auditing) {
if (error = audit_pathcomp(pnp, cvp, cr))
goto bad;
}
@@ -645,7 +646,7 @@ checkforroot:
goto next;
bad:
- if (audit_active) /* reached end of path */
+ if (auditing) /* reached end of path */
(void) audit_savepath(pnp, cvp, error, cr);
bad_noaudit:
/*
diff --git a/usr/src/uts/common/fs/sockfs/sockstr.c b/usr/src/uts/common/fs/sockfs/sockstr.c
index dc2af07a93..4b08e4aac3 100644
--- a/usr/src/uts/common/fs/sockfs/sockstr.c
+++ b/usr/src/uts/common/fs/sockfs/sockstr.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1679,6 +1679,7 @@ strsock_proto(vnode_t *vp, mblk_t *mp,
union T_primitives *tpr;
struct sonode *so;
sotpi_info_t *sti;
+ uint32_t auditing = AU_AUDITING();
so = VTOSO(vp);
sti = SOTOTPI(so);
@@ -1788,7 +1789,7 @@ strsock_proto(vnode_t *vp, mblk_t *mp,
*allmsgsigs = S_INPUT | S_RDNORM;
*pollwakeups = POLLIN | POLLRDNORM;
*wakeups = RSLEEP;
- if (audit_active)
+ if (auditing)
audit_sock(T_UNITDATA_IND, strvp2wq(vp),
mp, 0);
return (mp);
@@ -2279,7 +2280,7 @@ strsock_proto(vnode_t *vp, mblk_t *mp,
return (NULL);
}
- if (audit_active)
+ if (auditing)
audit_sock(T_CONN_IND, strvp2wq(vp), mp, 0);
if (!(so->so_state & SS_ACCEPTCONN)) {
zcmn_err(getzoneid(), CE_WARN,
diff --git a/usr/src/uts/common/fs/sockfs/socksubr.c b/usr/src/uts/common/fs/sockfs/socksubr.c
index 526fdd4937..2a329da653 100644
--- a/usr/src/uts/common/fs/sockfs/socksubr.c
+++ b/usr/src/uts/common/fs/sockfs/socksubr.c
@@ -62,7 +62,6 @@
#include <sys/socketvar.h>
#include <netinet/in.h>
#include <sys/un.h>
-
#include <sys/ucred.h>
#include <sys/tiuser.h>
@@ -756,7 +755,7 @@ fdbuf_extract(struct fdbuf *fdbuf, void *rights, int rightslen)
mutex_exit(&fp->f_tlock);
setf(fd, fp);
*rp++ = fd;
- if (audit_active)
+ if (AU_AUDITING())
audit_fdrecv(fd, fp);
dprint(1, ("fdbuf_extract: [%d] = %d, %p refcnt %d\n",
i, fd, (void *)fp, fp->f_count));
@@ -830,7 +829,7 @@ fdbuf_create(void *rights, int rightslen, struct fdbuf **fdbufp)
fdbuf->fd_fds[i] = fp;
fdbuf->fd_numfd++;
releasef(fds[i]);
- if (audit_active)
+ if (AU_AUDITING())
audit_fdsend(fds[i], fp, 0);
}
*fdbufp = fdbuf;
diff --git a/usr/src/uts/common/fs/sockfs/socktpi.c b/usr/src/uts/common/fs/sockfs/socktpi.c
index bfbd67ad81..de0293e710 100644
--- a/usr/src/uts/common/fs/sockfs/socktpi.c
+++ b/usr/src/uts/common/fs/sockfs/socktpi.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2591,7 +2591,7 @@ sotpi_connect(struct sonode *so,
soisconnecting(so);
mutex_exit(&so->so_lock);
- if (audit_active)
+ if (AU_AUDITING())
audit_sock(T_CONN_REQ, strvp2wq(SOTOV(so)), mp, 0);
error = kstrputmsg(SOTOV(so), mp, NULL, 0, 0,
@@ -3857,7 +3857,7 @@ sosend_dgramcmsg(struct sonode *so, struct sockaddr *name, socklen_t namelen,
ASSERT(MBLKL(mp) <= (ssize_t)size);
ASSERT(mp->b_wptr <= mp->b_datap->db_lim);
- if (audit_active)
+ if (AU_AUDITING())
audit_sock(T_UNITDATA_REQ, strvp2wq(SOTOV(so)), mp, 0);
error = kstrputmsg(SOTOV(so), mp, uiop, len, 0, MSG_BAND, 0);
@@ -4135,7 +4135,7 @@ sosend_dgram(struct sonode *so, struct sockaddr *name, socklen_t namelen,
ASSERT(mp->b_wptr <= mp->b_datap->db_lim);
}
- if (audit_active)
+ if (AU_AUDITING())
audit_sock(T_UNITDATA_REQ, strvp2wq(SOTOV(so)), mp, 0);
error = kstrputmsg(SOTOV(so), mp, uiop, len, 0, MSG_BAND, 0);
@@ -4657,6 +4657,7 @@ sodgram_direct(struct sonode *so, struct sockaddr *name,
boolean_t connected;
mblk_t *mpdata = NULL;
sotpi_info_t *sti = SOTOTPI(so);
+ uint32_t auditing = AU_AUDITING();
ASSERT(name != NULL && namelen != 0);
ASSERT(!(so->so_mode & SM_CONNREQUIRED));
@@ -4721,7 +4722,7 @@ sodgram_direct(struct sonode *so, struct sockaddr *name,
linkb(mp, mpdata);
else
mp = mpdata;
- if (audit_active)
+ if (auditing)
audit_sock(T_UNITDATA_REQ, strvp2wq(SOTOV(so)), mp, 0);
udp_wput(udp_wq, mp);
@@ -4741,7 +4742,7 @@ sodgram_direct(struct sonode *so, struct sockaddr *name,
if (connected)
return (strwrite(SOTOV(so), uiop, CRED()));
- if (audit_active)
+ if (auditing)
audit_sock(T_UNITDATA_REQ, strvp2wq(SOTOV(so)), mp, 0);
error = kstrputmsg(SOTOV(so), mp, uiop, len, 0, MSG_BAND, 0);
diff --git a/usr/src/uts/common/fs/vnode.c b/usr/src/uts/common/fs/vnode.c
index acdfdb36a1..f1a69479b8 100644
--- a/usr/src/uts/common/fs/vnode.c
+++ b/usr/src/uts/common/fs/vnode.c
@@ -1295,6 +1295,7 @@ vn_createat(
struct vattr vattr;
enum symfollow follow;
int estale_retry = 0;
+ uint32_t auditing = AU_AUDITING();
ASSERT((vap->va_mask & (AT_TYPE|AT_MODE)) == (AT_TYPE|AT_MODE));
@@ -1318,7 +1319,7 @@ top:
*/
if (error = pn_get(pnamep, seg, &pn))
return (error);
- if (audit_active)
+ if (auditing)
audit_vncreate_start();
dvp = NULL;
*vpp = NULL;
@@ -1526,7 +1527,7 @@ top:
out:
- if (audit_active)
+ if (auditing)
audit_vncreate_finish(*vpp, error);
if (in_crit) {
nbl_end_crit(vp);
@@ -1628,6 +1629,7 @@ vn_renameat(vnode_t *fdvp, char *fname, vnode_t *tdvp,
vnode_t *fromvp, *fvp;
vnode_t *tovp, *targvp;
int estale_retry = 0;
+ uint32_t auditing = AU_AUDITING();
top:
fvp = fromvp = tovp = targvp = NULL;
@@ -1651,7 +1653,7 @@ top:
* use the lib directory for the rename.
*/
- if (audit_active)
+ if (auditing)
audit_setfsat_path(1);
/*
* Lookup to and from directories.
@@ -1668,7 +1670,7 @@ top:
goto out;
}
- if (audit_active)
+ if (auditing)
audit_setfsat_path(3);
if (error = lookuppnat(&tpn, NULL, NO_FOLLOW, &tovp, &targvp, tdvp)) {
goto out;