From owner-p4-projects@FreeBSD.ORG Sun Jan 15 02:42:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AAA2D16A420; Sun, 15 Jan 2006 02:42:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B4A216A424 for ; Sun, 15 Jan 2006 02:42:04 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9761043D4C for ; Sun, 15 Jan 2006 02:42:03 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0F2g3Rp033406 for ; Sun, 15 Jan 2006 02:42:03 GMT (envelope-from gnn@neville-neil.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0F2g3Nn033403 for perforce@freebsd.org; Sun, 15 Jan 2006 02:42:03 GMT (envelope-from gnn@neville-neil.com) Date: Sun, 15 Jan 2006 02:42:03 GMT Message-Id: <200601150242.k0F2g3Nn033403@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gnn@neville-neil.com using -f From: "George V. Neville-Neil" To: Perforce Change Reviews Cc: Subject: PERFORCE change 89716 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 02:42:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=89716 Change 89716 by gnn@gnn_devbox_fast_ipsec on 2006/01/15 02:41:52 First cut at removing PF_KEY data structures from the keydb. This code does not work completely yet but needs to be saved. Affected files ... .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/ipsec.c#2 edit .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/key.c#2 edit .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/key_var.h#2 edit .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/keydb.h#2 edit .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/xform_ah.c#2 edit .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/xform_esp.c#2 edit .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/xform_tcp.c#2 edit Differences ... ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/ipsec.c#2 (text+ko) ==== @@ -92,6 +92,7 @@ #include +#define IPSEC_DEBUG #ifdef IPSEC_DEBUG int ipsec_debug = 1; #else ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/key.c#2 (text+ko) ==== @@ -420,7 +420,10 @@ static struct mbuf *key_setsadbxsa2 __P((u_int8_t, u_int32_t, u_int32_t)); static struct mbuf *key_setsadbxpolicy __P((u_int16_t, u_int8_t, u_int32_t)); -static void *key_dup(const void *, u_int, struct malloc_type *); +static struct seckey *key_dup_keymsg(const struct sadb_key *, u_int, + struct malloc_type *); +static struct seclifetime *key_dup_lifemsg(const struct sadb_lifetime *src, + struct malloc_type *type); #ifdef INET6 static int key_ismyaddr6 __P((struct sockaddr_in6 *)); #endif @@ -488,6 +491,10 @@ static int key_senderror __P((struct socket *, struct mbuf *, int)); static int key_validate_ext __P((const struct sadb_ext *, int)); static int key_align __P((struct mbuf *, struct sadb_msghdr *)); +static struct mbuf *key_setlifetime(struct seclifetime *src, + u_int16_t exttype); +static struct mbuf *key_setkey(struct seckey *src, u_int16_t exttype); + #if 0 static const char *key_getfqdn __P((void)); static const char *key_getuserfqdn __P((void)); @@ -909,8 +916,8 @@ /* What the best method is to compare ? */ if (key_preferred_oldsa) { - if (candidate->lft_c->sadb_lifetime_addtime > - sav->lft_c->sadb_lifetime_addtime) { + if (candidate->lft_c->addtime > + sav->lft_c->addtime) { candidate = sav; } continue; @@ -918,8 +925,8 @@ } /* preferred new sa rather than old sa */ - if (candidate->lft_c->sadb_lifetime_addtime < - sav->lft_c->sadb_lifetime_addtime) { + if (candidate->lft_c->addtime < + sav->lft_c->addtime) { d = candidate; candidate = sav; } else @@ -930,7 +937,7 @@ * suitable candidate and the lifetime of the SA is not * permanent. */ - if (d->lft_c->sadb_lifetime_addtime != 0) { + if (d->lft_c->addtime != 0) { struct mbuf *m, *result; u_int8_t satype; @@ -2787,9 +2794,9 @@ } else { KASSERT(sav->iv == NULL, ("iv but no xform")); if (sav->key_auth != NULL) - bzero(_KEYBUF(sav->key_auth), _KEYLEN(sav->key_auth)); + bzero(sav->key_auth->key_data, _KEYLEN(sav->key_auth)); if (sav->key_enc != NULL) - bzero(_KEYBUF(sav->key_enc), _KEYLEN(sav->key_enc)); + bzero(sav->key_enc->key_data, _KEYLEN(sav->key_enc)); } if (sav->key_auth != NULL) { free(sav->key_auth, M_IPSEC_MISC); @@ -3038,9 +3045,11 @@ goto fail; } - sav->key_auth = key_dup(key0, len, M_IPSEC_MISC); - if (sav->key_auth == NULL) { - ipseclog((LOG_DEBUG, "%s: No more memory.\n",__func__)); + sav->key_auth = (struct seckey *)key_dup_keymsg(key0, len, + M_IPSEC_MISC); + if (sav->key_auth == NULL ) { + ipseclog((LOG_DEBUG, "%s: No more memory.\n", + __func__)); error = ENOBUFS; goto fail; } @@ -3061,12 +3070,15 @@ } switch (mhp->msg->sadb_msg_satype) { case SADB_SATYPE_ESP: + /* XXX FIX ME */ if (len == PFKEY_ALIGN8(sizeof(struct sadb_key)) && sav->alg_enc != SADB_EALG_NULL) { error = EINVAL; break; } - sav->key_enc = key_dup(key0, len, M_IPSEC_MISC); + sav->key_enc = (struct seckey *)key_dup_keymsg(key0, + len, + M_IPSEC_MISC); if (sav->key_enc == NULL) { ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); @@ -3126,13 +3138,10 @@ goto fail; } - sav->lft_c->sadb_lifetime_len = - PFKEY_UNIT64(sizeof(struct sadb_lifetime)); - sav->lft_c->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT; - sav->lft_c->sadb_lifetime_allocations = 0; - sav->lft_c->sadb_lifetime_bytes = 0; - sav->lft_c->sadb_lifetime_addtime = time_second; - sav->lft_c->sadb_lifetime_usetime = 0; + sav->lft_c->allocations = 0; + sav->lft_c->bytes = 0; + sav->lft_c->addtime = time_second; + sav->lft_c->usetime = 0; /* lifetimes for HARD and SOFT */ { @@ -3144,7 +3153,7 @@ error = EINVAL; goto fail; } - sav->lft_h = key_dup(lft0, sizeof(*lft0), M_IPSEC_MISC); + sav->lft_h = key_dup_lifemsg(lft0, M_IPSEC_MISC); if (sav->lft_h == NULL) { ipseclog((LOG_DEBUG, "%s: No more memory.\n",__func__)); error = ENOBUFS; @@ -3159,7 +3168,7 @@ error = EINVAL; goto fail; } - sav->lft_s = key_dup(lft0, sizeof(*lft0), M_IPSEC_MISC); + sav->lft_s = key_dup_lifemsg(lft0, M_IPSEC_MISC); if (sav->lft_s == NULL) { ipseclog((LOG_DEBUG, "%s: No more memory.\n",__func__)); error = ENOBUFS; @@ -3271,9 +3280,7 @@ u_int32_t seq, pid; { struct mbuf *result = NULL, *tres = NULL, *m; - int l = 0; int i; - void *p; int dumporder[] = { SADB_EXT_SA, SADB_X_EXT_SA2, SADB_EXT_LIFETIME_HARD, SADB_EXT_LIFETIME_SOFT, @@ -3290,7 +3297,6 @@ for (i = sizeof(dumporder)/sizeof(dumporder[0]) - 1; i >= 0; i--) { m = NULL; - p = NULL; switch (dumporder[i]) { case SADB_EXT_SA: m = key_setsadbsa(sav); @@ -3325,36 +3331,45 @@ case SADB_EXT_KEY_AUTH: if (!sav->key_auth) continue; - l = PFKEY_UNUNIT64(sav->key_auth->sadb_key_len); - p = sav->key_auth; + m = key_setkey(sav->key_auth, SADB_EXT_KEY_AUTH); + if (!m) + goto fail; break; case SADB_EXT_KEY_ENCRYPT: if (!sav->key_enc) continue; - l = PFKEY_UNUNIT64(sav->key_enc->sadb_key_len); - p = sav->key_enc; + m = key_setkey(sav->key_enc, SADB_EXT_KEY_ENCRYPT); + if (!m) + goto fail; break; case SADB_EXT_LIFETIME_CURRENT: if (!sav->lft_c) continue; - l = PFKEY_UNUNIT64(((struct sadb_ext *)sav->lft_c)->sadb_ext_len); - p = sav->lft_c; + m = key_setlifetime(sav->lft_c, + SADB_EXT_LIFETIME_CURRENT); + if (!m) + goto fail; break; case SADB_EXT_LIFETIME_HARD: if (!sav->lft_h) continue; - l = PFKEY_UNUNIT64(((struct sadb_ext *)sav->lft_h)->sadb_ext_len); - p = sav->lft_h; + m = key_setlifetime(sav->lft_h, + SADB_EXT_LIFETIME_HARD); + if (!m) + goto fail; break; case SADB_EXT_LIFETIME_SOFT: if (!sav->lft_s) continue; - l = PFKEY_UNUNIT64(((struct sadb_ext *)sav->lft_s)->sadb_ext_len); - p = sav->lft_s; + m = key_setlifetime(sav->lft_h, + SADB_EXT_LIFETIME_SOFT); + + if (!m) + goto fail; break; case SADB_EXT_ADDRESS_PROXY: @@ -3366,29 +3381,15 @@ continue; } - if ((!m && !p) || (m && p)) + if (!m) goto fail; - if (p && tres) { - M_PREPEND(tres, l, M_DONTWAIT); - if (!tres) - goto fail; - bcopy(p, mtod(tres, caddr_t), l); - continue; - } - if (p) { - m = key_alloc_mbuf(l); - if (!m) - goto fail; - m_copyback(m, 0, l, p); - } - if (tres) m_cat(m, tres); tres = m; + } m_cat(result, tres); - if (result->m_len < sizeof(struct sadb_msg)) { result = m_pullup(result, sizeof(struct sadb_msg)); if (result == NULL) @@ -3609,21 +3610,67 @@ } /* %%% utilities */ -/* - * copy a buffer into the new buffer allocated. +/* Take a key message (sadb_key) from the socket and turn it into one + * of the kernel's key structures (seckey). + * + * IN: pointer to the src + * OUT: NULL no more memory + */ +struct seckey * +key_dup_keymsg(const struct sadb_key *src, u_int len, + struct malloc_type *type) +{ + struct seckey *dst = NULL; + dst = (struct seckey *)malloc(sizeof(struct seckey), type, M_NOWAIT); + if (dst != NULL) { + dst->bits = src->sadb_key_bits; + dst->key_data = (char *)malloc(len, type, M_NOWAIT); + if (dst->key_data != NULL) { + bcopy(src + sizeof(struct sadb_key), + dst->key_data, len); + ipseclog((LOG_DEBUG, "%s: source bits %p\n", __func__, + src + sizeof(struct sadb_key))); + ipseclog((LOG_DEBUG, "%s: dst bits %p\n", __func__, + dst->key_data)); + } else { + ipseclog((LOG_DEBUG, "%s: No more memory.\n", + __func__)); + free(dst, type); + dst = NULL; + } + } else { + ipseclog((LOG_DEBUG, "%s: No more memory.\n", + __func__)); + + } + return dst; +} + +/* Take a lifetime message (sadb_lifetime) passed in on a socket and + * turn it into one of the kernel's lifetime structures (seclifetime). + * + * IN: pointer to the destination, source and malloc type + * OUT: NULL, no more memory */ -static void * -key_dup(const void *src, u_int len, struct malloc_type *type) + +static struct seclifetime * +key_dup_lifemsg(const struct sadb_lifetime *src, + struct malloc_type *type) { - void *copy; + struct seclifetime *dst = NULL; - copy = malloc(len, type, M_NOWAIT); - if (copy == NULL) { + dst = (struct seclifetime *)malloc(sizeof(struct seclifetime), + type, M_NOWAIT); + if (dst == NULL) { /* XXX counter */ ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); - } else - bcopy(src, copy, len); - return copy; + } else { + dst->allocations = src->sadb_lifetime_allocations; + dst->bytes = src->sadb_lifetime_bytes; + dst->addtime = src->sadb_lifetime_addtime; + dst->usetime = src->sadb_lifetime_usetime; + } + return dst; } /* compare my own address @@ -4071,13 +4118,13 @@ } /* check SOFT lifetime */ - if (sav->lft_s->sadb_lifetime_addtime != 0 && - now - sav->created > sav->lft_s->sadb_lifetime_addtime) { + if (sav->lft_s->addtime != 0 && + now - sav->created > sav->lft_s->addtime) { /* * check SA to be used whether or not. * when SA hasn't been used, delete it. */ - if (sav->lft_c->sadb_lifetime_usetime == 0) { + if (sav->lft_c->usetime == 0) { key_sa_chgstate(sav, SADB_SASTATE_DEAD); KEY_FREESAV(&sav); } else { @@ -4096,8 +4143,8 @@ * when new SA is installed. Caution when it's * installed too big lifetime by time. */ - else if (sav->lft_s->sadb_lifetime_bytes != 0 && - sav->lft_s->sadb_lifetime_bytes < sav->lft_c->sadb_lifetime_bytes) { + else if (sav->lft_s->bytes != 0 && + sav->lft_s->bytes < sav->lft_c->bytes) { key_sa_chgstate(sav, SADB_SASTATE_DYING); /* @@ -4122,15 +4169,15 @@ continue; } - if (sav->lft_h->sadb_lifetime_addtime != 0 && - now - sav->created > sav->lft_h->sadb_lifetime_addtime) { + if (sav->lft_h->addtime != 0 && + now - sav->created > sav->lft_h->addtime) { key_sa_chgstate(sav, SADB_SASTATE_DEAD); KEY_FREESAV(&sav); } #if 0 /* XXX Should we keep to send expire message until HARD lifetime ? */ else if (sav->lft_s != NULL - && sav->lft_s->sadb_lifetime_addtime != 0 - && now - sav->created > sav->lft_s->sadb_lifetime_addtime) { + && sav->lft_s->addtime != 0 + && now - sav->created > sav->lft_s->addtime) { /* * XXX: should be checked to be * installed the valid SA. @@ -4144,8 +4191,8 @@ } #endif /* check HARD lifetime by bytes */ - else if (sav->lft_h->sadb_lifetime_bytes != 0 && - sav->lft_h->sadb_lifetime_bytes < sav->lft_c->sadb_lifetime_bytes) { + else if (sav->lft_h->bytes != 0 && + sav->lft_h->bytes < sav->lft_c->bytes) { key_sa_chgstate(sav, SADB_SASTATE_DEAD); KEY_FREESAV(&sav); } @@ -4977,20 +5024,23 @@ } /* make structure */ - sah->idents = malloc(idsrclen, M_IPSEC_MISC, M_NOWAIT); + sah->idents = malloc(sizeof(struct secident), M_IPSEC_MISC, M_NOWAIT); if (sah->idents == NULL) { ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); return ENOBUFS; } - sah->identd = malloc(iddstlen, M_IPSEC_MISC, M_NOWAIT); + sah->identd = malloc(sizeof(struct secident), M_IPSEC_MISC, M_NOWAIT); if (sah->identd == NULL) { free(sah->idents, M_IPSEC_MISC); sah->idents = NULL; ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); return ENOBUFS; } - bcopy(idsrc, sah->idents, idsrclen); - bcopy(iddst, sah->identd, iddstlen); + sah->idents->type = idsrc->sadb_ident_type; + sah->idents->id = idsrc->sadb_ident_id; + + sah->identd->type = iddst->sadb_ident_type; + sah->identd->id = iddst->sadb_ident_id; return 0; } @@ -6262,10 +6312,10 @@ lt = mtod(m, struct sadb_lifetime *); lt->sadb_lifetime_len = PFKEY_UNIT64(sizeof(struct sadb_lifetime)); lt->sadb_lifetime_exttype = SADB_EXT_LIFETIME_CURRENT; - lt->sadb_lifetime_allocations = sav->lft_c->sadb_lifetime_allocations; - lt->sadb_lifetime_bytes = sav->lft_c->sadb_lifetime_bytes; - lt->sadb_lifetime_addtime = sav->lft_c->sadb_lifetime_addtime; - lt->sadb_lifetime_usetime = sav->lft_c->sadb_lifetime_usetime; + lt->sadb_lifetime_allocations = sav->lft_c->allocations; + lt->sadb_lifetime_bytes = sav->lft_c->bytes; + lt->sadb_lifetime_addtime = sav->lft_c->addtime; + lt->sadb_lifetime_usetime = sav->lft_c->usetime; lt = (struct sadb_lifetime *)(mtod(m, caddr_t) + len / 2); bcopy(sav->lft_s, lt, sizeof(*lt)); m_cat(result, m); @@ -7103,21 +7153,21 @@ * XXX Currently, there is a difference of bytes size * between inbound and outbound processing. */ - sav->lft_c->sadb_lifetime_bytes += m->m_pkthdr.len; + sav->lft_c->bytes += m->m_pkthdr.len; /* to check bytes lifetime is done in key_timehandler(). */ /* * We use the number of packets as the unit of - * sadb_lifetime_allocations. We increment the variable + * allocations. We increment the variable * whenever {esp,ah}_{in,out}put is called. */ - sav->lft_c->sadb_lifetime_allocations++; + sav->lft_c->allocations++; /* XXX check for expires? */ /* - * NOTE: We record CURRENT sadb_lifetime_usetime by using wall clock, + * NOTE: We record CURRENT usetime by using wall clock, * in seconds. HARD and SOFT lifetime are measured by the time - * difference (again in seconds) from sadb_lifetime_usetime. + * difference (again in seconds) from usetime. * * usetime * v expire expire @@ -7125,7 +7175,7 @@ * <--------------> HARD * <-----> SOFT */ - sav->lft_c->sadb_lifetime_usetime = time_second; + sav->lft_c->usetime = time_second; /* XXX check for expires? */ return; @@ -7214,3 +7264,55 @@ return m; } + +static struct mbuf * +key_setkey(struct seckey *src, u_int16_t exttype) +{ + struct mbuf *m; + struct sadb_key *p; + int len = PFKEY_ALIGN8(sizeof(struct sadb_key)); + + if (src == NULL) + return NULL; + + m = key_alloc_mbuf(len); + if (m == NULL) + return NULL; + p = mtod(m, struct sadb_key *); + bzero(p, len); + p->sadb_key_len = PFKEY_UNIT64(len); + p->sadb_key_exttype = exttype; + p->sadb_key_bits = src->bits; + ipseclog((LOG_DEBUG, "%s: setting key data %s\n", + __func__, src->key_data)); + bcopy(src->key_data, _KEYBUF(p), len); + + return m; +} + +static struct mbuf * +key_setlifetime(struct seclifetime *src, u_int16_t exttype) +{ + struct mbuf *m = NULL; + struct sadb_lifetime *p; + int len = PFKEY_ALIGN8(sizeof(struct sadb_lifetime)); + + if (src == NULL) + return NULL; + + m = key_alloc_mbuf(len); + if (m == NULL) + return m; + p = mtod(m, struct sadb_lifetime *); + + bzero(p, len); + p->sadb_lifetime_len = PFKEY_UNIT64(len); + p->sadb_lifetime_exttype = exttype; + p->sadb_lifetime_allocations = src->allocations; + p->sadb_lifetime_bytes = src->bytes; + p->sadb_lifetime_addtime = src->addtime; + p->sadb_lifetime_usetime = src->usetime; + + return m; + +} ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/key_var.h#2 (text+ko) ==== @@ -66,8 +66,8 @@ #ifdef _KERNEL #define _ARRAYLEN(p) (sizeof(p)/sizeof(p[0])) -#define _KEYLEN(key) ((u_int)((key)->sadb_key_bits >> 3)) -#define _KEYBITS(key) ((u_int)((key)->sadb_key_bits)) +#define _KEYLEN(key) ((u_int)((key)->bits >> 3)) +#define _KEYBITS(key) ((u_int)((key)->bits)) #define _KEYBUF(key) ((caddr_t)((caddr_t)(key) + sizeof(struct sadb_key))) #endif /*_KERNEL*/ ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/keydb.h#2 (text+ko) ==== @@ -60,14 +60,39 @@ /* see IPSEC_MANUAL_REQID_MAX. */ }; +/* + * In order to split out the keydb implementation from that of the + * PF_KEY sockets we need to define a few structures that while they + * may seem common are likely to diverge over time. + */ + +/* sadb_identity */ +struct secident { + u_int16_t type; + u_int64_t id; +}; + +/* sadb_key */ +struct seckey { + u_int16_t bits; + char *key_data; +}; + +struct seclifetime { + u_int32_t allocations; + u_int64_t bytes; + u_int64_t addtime; + u_int64_t usetime; +}; + /* Security Association Data Base */ struct secashead { LIST_ENTRY(secashead) chain; struct secasindex saidx; - struct sadb_ident *idents; /* source identity */ - struct sadb_ident *identd; /* destination identity */ + struct secident *idents; /* source identity */ + struct secident *identd; /* destination identity */ /* XXX I don't know how to use them. */ u_int8_t state; /* MATURE or DEAD. */ @@ -97,8 +122,8 @@ u_int32_t spi; /* SPI Value, network byte order */ u_int32_t flags; /* holder for SADB_KEY_FLAGS */ - struct sadb_key *key_auth; /* Key for Authentication */ - struct sadb_key *key_enc; /* Key for Encryption */ + struct seckey *key_auth; /* Key for Authentication */ + struct seckey *key_enc; /* Key for Encryption */ caddr_t iv; /* Initilization Vector */ u_int ivlen; /* length of IV */ void *sched; /* intermediate encryption key */ @@ -107,9 +132,9 @@ struct secreplay *replay; /* replay prevention */ time_t created; /* for lifetime */ - struct sadb_lifetime *lft_c; /* CURRENT lifetime, it's constant. */ - struct sadb_lifetime *lft_h; /* HARD lifetime */ - struct sadb_lifetime *lft_s; /* SOFT lifetime */ + struct seclifetime *lft_c; /* CURRENT lifetime, it's constant. */ + struct seclifetime *lft_h; /* HARD lifetime */ + struct seclifetime *lft_s; /* SOFT lifetime */ u_int32_t seq; /* sequence number */ pid_t pid; /* message's pid */ ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/xform_ah.c#2 (text+ko) ==== @@ -201,7 +201,7 @@ bzero(cria, sizeof (*cria)); cria->cri_alg = sav->tdb_authalgxform->type; cria->cri_klen = _KEYBITS(sav->key_auth); - cria->cri_key = _KEYBUF(sav->key_auth); + cria->cri_key = sav->key_auth->key_data; return 0; } @@ -231,7 +231,7 @@ int err; if (sav->key_auth) - bzero(_KEYBUF(sav->key_auth), _KEYLEN(sav->key_auth)); + bzero(sav->key_auth->key_data, _KEYLEN(sav->key_auth)); err = crypto_freesession(sav->tdb_cryptoid); sav->tdb_cryptoid = 0; @@ -622,8 +622,8 @@ /* Authentication operation. */ crda->crd_alg = ahx->type; - crda->crd_key = _KEYBUF(sav->key_auth); crda->crd_klen = _KEYBITS(sav->key_auth); + crda->crd_key = sav->key_auth->key_data; /* Find out if we've already done crypto. */ for (mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_CRYPTO_DONE, NULL); @@ -1014,7 +1014,7 @@ /* Authentication operation. */ crda->crd_alg = ahx->type; - crda->crd_key = _KEYBUF(sav->key_auth); + crda->crd_key = sav->key_auth->key_data; crda->crd_klen = _KEYBITS(sav->key_auth); /* Allocate IPsec-specific opaque crypto info. */ ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/xform_esp.c#2 (text+ko) ==== @@ -215,7 +215,7 @@ bzero(&crie, sizeof (crie)); crie.cri_alg = sav->tdb_encalgxform->type; crie.cri_klen = _KEYBITS(sav->key_enc); - crie.cri_key = _KEYBUF(sav->key_enc); + crie.cri_key = sav->key_enc->key_data; /* XXX Rounds ? */ if (sav->tdb_authalgxform && sav->tdb_encalgxform) { @@ -248,7 +248,7 @@ int error = ah_zeroize(sav); if (sav->key_enc) - bzero(_KEYBUF(sav->key_enc), _KEYLEN(sav->key_enc)); + bzero(sav->key_enc->key_data, _KEYLEN(sav->key_enc)); if (sav->iv) { free(sav->iv, M_XDATA); sav->iv = NULL; @@ -381,7 +381,7 @@ crda->crd_inject = m->m_pkthdr.len - alen; crda->crd_alg = esph->type; - crda->crd_key = _KEYBUF(sav->key_auth); + crda->crd_key = sav->key_auth->key_data; crda->crd_klen = _KEYBITS(sav->key_auth); /* Copy the authenticator */ @@ -418,7 +418,7 @@ crde->crd_inject = skip + hlen - sav->ivlen; crde->crd_alg = espx->type; - crde->crd_key = _KEYBUF(sav->key_enc); + crde->crd_key = sav->key_enc->key_data; crde->crd_klen = _KEYBITS(sav->key_enc); /* XXX Rounds ? */ } @@ -802,7 +802,7 @@ /* Encryption operation. */ crde->crd_alg = espx->type; - crde->crd_key = _KEYBUF(sav->key_enc); + crde->crd_key = sav->key_enc->key_data; crde->crd_klen = _KEYBITS(sav->key_enc); /* XXX Rounds ? */ } else @@ -841,7 +841,7 @@ /* Authentication operation. */ crda->crd_alg = esph->type; - crda->crd_key = _KEYBUF(sav->key_auth); + crda->crd_key = sav->key_auth->key_data; crda->crd_klen = _KEYBITS(sav->key_auth); } ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/xform_tcp.c#2 (text+ko) ==== @@ -117,7 +117,7 @@ { if (sav->key_auth) - bzero(_KEYBUF(sav->key_auth), _KEYLEN(sav->key_auth)); + bzero(sav->key_auth->key_data, _KEYLEN(sav->key_auth)); sav->tdb_cryptoid = 0; sav->tdb_authalgxform = NULL; From owner-p4-projects@FreeBSD.ORG Sun Jan 15 17:19:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id ED2DE16A422; Sun, 15 Jan 2006 17:19:58 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABEC716A41F for ; Sun, 15 Jan 2006 17:19:58 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1578F43D48 for ; Sun, 15 Jan 2006 17:19:58 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FHJvP4099448 for ; Sun, 15 Jan 2006 17:19:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FHJvP3099445 for perforce@freebsd.org; Sun, 15 Jan 2006 17:19:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 17:19:57 GMT Message-Id: <200601151719.k0FHJvP3099445@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89728 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 17:19:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=89728 Change 89728 by rwatson@rwatson_peppercorn on 2006/01/15 17:19:04 Allocate ipq fragment reassembly queue headers using UMA rather than the mbuf allocator. Affected files ... .. //depot/projects/netsmp/src/sys/netinet/ip_input.c#7 edit Differences ... ==== //depot/projects/netsmp/src/sys/netinet/ip_input.c#7 (text+ko) ==== @@ -107,17 +107,6 @@ &ip_keepfaith, 0, "Enable packet capture for FAITH IPv4->IPv6 translater daemon"); -static int nipq = 0; /* total # of reass queues */ -static int maxnipq; -SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_RW, - &maxnipq, 0, - "Maximum number of IPv4 fragment reassembly queue entries"); - -static int maxfragsperpacket; -SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_RW, - &maxfragsperpacket, 0, - "Maximum number of IPv4 fragments allowed per packet"); - static int ip_sendsourcequench = 0; SYSCTL_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, &ip_sendsourcequench, 0, @@ -166,22 +155,41 @@ SYSCTL_STRUCT(_net_inet_ip, IPCTL_STATS, stats, CTLFLAG_RW, &ipstat, ipstat, "IP statistics (struct ipstat, netinet/ip_var.h)"); -/* Packet reassembly stuff */ +/* + * IP datagram reassembly. + */ #define IPREASS_NHASH_LOG2 6 #define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2) #define IPREASS_HMASK (IPREASS_NHASH - 1) #define IPREASS_HASH(x,y) \ (((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK) +/* + * For historical reasons, the max ipq size is maintained outside of the UMA + * zone. At some point, it would be good to start using the UMA zone max. + */ +static uma_zone_t ipq_zone; static TAILQ_HEAD(ipqhead, ipq) ipq[IPREASS_NHASH]; -struct mtx ipqlock; -struct callout ipport_tick_callout; +static struct mtx ipqlock; #define IPQ_LOCK() mtx_lock(&ipqlock) #define IPQ_UNLOCK() mtx_unlock(&ipqlock) #define IPQ_LOCK_INIT() mtx_init(&ipqlock, "ipqlock", NULL, MTX_DEF) #define IPQ_LOCK_ASSERT() mtx_assert(&ipqlock, MA_OWNED) +static int nipq = 0; /* total # of reass queues */ +static int maxnipq; +SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_RW, + &maxnipq, 0, + "Maximum number of IPv4 fragment reassembly queue entries"); + +static int maxfragsperpacket; +SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_RW, + &maxfragsperpacket, 0, + "Maximum number of IPv4 fragments allowed per packet"); + +struct callout ipport_tick_callout; + #ifdef IPCTL_DEFMTU SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, &ip_mtu, 0, "Default MTU"); @@ -249,6 +257,8 @@ TAILQ_INIT(&ipq[i]); maxnipq = nmbclusters / 32; maxfragsperpacket = 16; + ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, + NULL, UMA_ALIGN_PTR, 0); /* Start ipport_tick. */ callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); @@ -865,12 +875,12 @@ * If first fragment to arrive, create a reassembly queue. */ if (fp == NULL) { - if ((t = m_get(M_DONTWAIT, MT_FTABLE)) == NULL) + fp = uma_zalloc(ipq_zone, M_NOWAIT); + if (fp == NULL) goto dropfrag; - fp = mtod(t, struct ipq *); #ifdef MAC if (mac_init_ipq(fp, M_NOWAIT) != 0) { - m_free(t); + uma_zfree(ipq_zone, fp); goto dropfrag; } mac_create_ipq(m, fp); @@ -1038,7 +1048,7 @@ ip->ip_dst = fp->ipq_dst; TAILQ_REMOVE(head, fp, ipq_list); nipq--; - (void) m_free(dtom(fp)); + uma_zfree(ipq_zone, fp); m->m_len += (ip->ip_hl << 2); m->m_data -= (ip->ip_hl << 2); /* some debugging cruft by sklower, below, will go away soon */ @@ -1079,7 +1089,7 @@ m_freem(q); } TAILQ_REMOVE(fhp, fp, ipq_list); - (void) m_free(dtom(fp)); + uma_zfree(ipq_zone, fp); nipq--; } From owner-p4-projects@FreeBSD.ORG Sun Jan 15 17:54:41 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 03D8E16A422; Sun, 15 Jan 2006 17:54:41 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F3E416A41F for ; Sun, 15 Jan 2006 17:54:40 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41DEF43D45 for ; Sun, 15 Jan 2006 17:54:40 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FHsegS001417 for ; Sun, 15 Jan 2006 17:54:40 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FHseii001414 for perforce@freebsd.org; Sun, 15 Jan 2006 17:54:40 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 17:54:40 GMT Message-Id: <200601151754.k0FHseii001414@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89729 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 17:54:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=89729 Change 89729 by rwatson@rwatson_zoo on 2006/01/15 17:54:23 Export nipqs. Affected files ... .. //depot/projects/netsmp/src/sys/netinet/ip_input.c#8 edit Differences ... ==== //depot/projects/netsmp/src/sys/netinet/ip_input.c#8 (text+ko) ==== @@ -178,6 +178,10 @@ #define IPQ_LOCK_ASSERT() mtx_assert(&ipqlock, MA_OWNED) static int nipq = 0; /* total # of reass queues */ +SYSCTL_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, + &nipq, 0, + "Current number of IPv4 fragment reassembly queue entries"); + static int maxnipq; SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_RW, &maxnipq, 0, From owner-p4-projects@FreeBSD.ORG Sun Jan 15 18:42:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 797DF16A423; Sun, 15 Jan 2006 18:42:39 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3745816A41F for ; Sun, 15 Jan 2006 18:42:39 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6AD943D48 for ; Sun, 15 Jan 2006 18:42:38 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FIgcjD004696 for ; Sun, 15 Jan 2006 18:42:38 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FIgc4Z004693 for perforce@freebsd.org; Sun, 15 Jan 2006 18:42:38 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 18:42:38 GMT Message-Id: <200601151842.k0FIgc4Z004693@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89731 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 18:42:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=89731 Change 89731 by rwatson@rwatson_zoo on 2006/01/15 18:42:19 Refine implementation of UMA storage of ipq's. Implement the resource bound in terms of a UMA zone limit, but maintain current sysctl semantics. Affected files ... .. //depot/projects/netsmp/src/sys/netinet/ip_input.c#9 edit Differences ... ==== //depot/projects/netsmp/src/sys/netinet/ip_input.c#9 (text+ko) ==== @@ -177,16 +177,14 @@ #define IPQ_LOCK_INIT() mtx_init(&ipqlock, "ipqlock", NULL, MTX_DEF) #define IPQ_LOCK_ASSERT() mtx_assert(&ipqlock, MA_OWNED) -static int nipq = 0; /* total # of reass queues */ +static void maxnipq_update(void); + +static int maxnipq; /* Administrative limit on # reass queues. */ +static int nipq = 0; /* Total # of reass queues */ SYSCTL_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, &nipq, 0, "Current number of IPv4 fragment reassembly queue entries"); -static int maxnipq; -SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_RW, - &maxnipq, 0, - "Maximum number of IPv4 fragment reassembly queue entries"); - static int maxfragsperpacket; SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_RW, &maxfragsperpacket, 0, @@ -263,6 +261,7 @@ maxfragsperpacket = 16; ipq_zone = uma_zcreate("ipq", sizeof(struct ipq), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + maxnipq_update(); /* Start ipport_tick. */ callout_init(&ipport_tick_callout, CALLOUT_MPSAFE); @@ -761,6 +760,59 @@ } /* + * After maxnipq has been updated, propagate the change to UMA. The UMA zone + * max has slightly different semantics than the sysctl, for historical + * reasons. + */ +static void +maxnipq_update(void) +{ + + /* + * -1 for unlimited allocation. + */ + if (maxnipq < 0) + uma_zone_set_max(ipq_zone, 0); + /* + * Positive number for specific bound. + */ + if (maxnipq > 0) + uma_zone_set_max(ipq_zone, maxnipq); + /* + * Zero specifies no further fragment queue allocation -- set the + * bound very low, but rely on implementation elsewhere to actually + * prevent allocation and reclaim current queues. + */ + if (maxnipq == 0) + uma_zone_set_max(ipq_zone, 1); +} + +static int +sysctl_maxnipq(SYSCTL_HANDLER_ARGS) +{ + int error, i; + + i = maxnipq; + error = sysctl_handle_int(oidp, &i, 0, req); + if (error || !req->newptr) + return (error); + + /* + * XXXRW: Might be a good idea to sanity check the argument and place + * an extreme upper bound. + */ + if (i < -1) + return (EINVAL); + maxnipq = i; + maxnipq_update(); + return (0); +} + +SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, CTLTYPE_INT|CTLFLAG_RW, + NULL, 0, sysctl_maxnipq, "I", + "Maximum number of IPv4 fragment reassembly queue entries"); + +/* * Take incoming datagram fragment and try to reassemble it into * whole datagram. If the argument is the first fragment or one * in between the function will return NULL and store the mbuf @@ -814,9 +866,8 @@ fp = NULL; /* - * Enforce upper bound on number of fragmented packets - * for which we attempt reassembly; - * If maxnipq is -1, accept all fragments without limitation. + * Attempt to trim the number of allocated fragment queues if it + * exceeds the administrative limit. */ if ((nipq > maxnipq) && (maxnipq > 0)) { /* From owner-p4-projects@FreeBSD.ORG Sun Jan 15 19:47:00 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8259516A422; Sun, 15 Jan 2006 19:46:59 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4181E16A41F for ; Sun, 15 Jan 2006 19:46:59 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B65BC43D49 for ; Sun, 15 Jan 2006 19:46:58 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FJkwlU012155 for ; Sun, 15 Jan 2006 19:46:58 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FJkwZ4012152 for perforce@freebsd.org; Sun, 15 Jan 2006 19:46:58 GMT (envelope-from csjp@freebsd.org) Date: Sun, 15 Jan 2006 19:46:58 GMT Message-Id: <200601151946.k0FJkwZ4012152@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 89736 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 19:47:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=89736 Change 89736 by csjp@csjp_xor on 2006/01/15 19:46:01 Move entry point to after we initialize the UID and GID. This may allow policies to make more intelligent decisions for labeling. Affected files ... .. //depot/projects/trustedbsd/mac/sys/nfsserver/nfs_srvsock.c#23 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/nfsserver/nfs_srvsock.c#23 (text+ko) ==== @@ -365,13 +365,13 @@ } nfsm_adv(nfsm_rndup(len)); tl = nfsm_dissect_nonblock(u_int32_t *, 3 * NFSX_UNSIGNED); -#ifdef MAC - mac_associate_nfsd_label(nd->nd_cr); -#endif nd->nd_cr->cr_uid = nd->nd_cr->cr_ruid = nd->nd_cr->cr_svuid = fxdr_unsigned(uid_t, *tl++); nd->nd_cr->cr_groups[0] = nd->nd_cr->cr_rgid = nd->nd_cr->cr_svgid = fxdr_unsigned(gid_t, *tl++); +#ifdef MAC + mac_associate_nfsd_label(nd->nd_cr); +#endif len = fxdr_unsigned(int, *tl); if (len < 0 || len > RPCAUTH_UNIXGIDS) { m_freem(mrep); From owner-p4-projects@FreeBSD.ORG Sun Jan 15 20:05:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EB18D16A422; Sun, 15 Jan 2006 20:05:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC3E916A41F for ; Sun, 15 Jan 2006 20:05:04 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 669A443D45 for ; Sun, 15 Jan 2006 20:05:04 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FK54GN012930 for ; Sun, 15 Jan 2006 20:05:04 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FK54GM012927 for perforce@freebsd.org; Sun, 15 Jan 2006 20:05:04 GMT (envelope-from csjp@freebsd.org) Date: Sun, 15 Jan 2006 20:05:04 GMT Message-Id: <200601152005.k0FK54GM012927@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 89741 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 20:05:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=89741 Change 89741 by csjp@csjp_xor on 2006/01/15 20:04:03 Remove deallocations of the ucred here. The ucred will presist as as long as the NFS descriptor will. This simplifies the code. Affected files ... .. //depot/projects/trustedbsd/mac/sys/nfsserver/nfs_srvsock.c#24 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/nfsserver/nfs_srvsock.c#24 (text+ko) ==== @@ -375,8 +375,6 @@ len = fxdr_unsigned(int, *tl); if (len < 0 || len > RPCAUTH_UNIXGIDS) { m_freem(mrep); - crfree(nd->nd_cr); - nd->nd_cr = NULL; return (EBADRPC); } tl = nfsm_dissect_nonblock(u_int32_t *, (len + 2) * NFSX_UNSIGNED); @@ -391,8 +389,6 @@ len = fxdr_unsigned(int, *++tl); if (len < 0 || len > RPCAUTH_MAXSIZ) { m_freem(mrep); - crfree(nd->nd_cr); - nd->nd_cr = NULL; return (EBADRPC); } if (len > 0) @@ -400,10 +396,6 @@ } else { nd->nd_repstat = (NFSERR_AUTHERR | AUTH_REJECTCRED); nd->nd_procnum = NFSPROC_NOOP; - if (nd->nd_cr != NULL) { - crfree(nd->nd_cr); - nd->nd_cr = NULL; - } return (0); } From owner-p4-projects@FreeBSD.ORG Sun Jan 15 20:29:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 03C6B16A422; Sun, 15 Jan 2006 20:29:36 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA33716A41F for ; Sun, 15 Jan 2006 20:29:35 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B5B943D4C for ; Sun, 15 Jan 2006 20:29:35 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FKTZec013949 for ; Sun, 15 Jan 2006 20:29:35 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FKTY0O013946 for perforce@freebsd.org; Sun, 15 Jan 2006 20:29:34 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 20:29:34 GMT Message-Id: <200601152029.k0FKTY0O013946@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89744 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 20:29:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=89744 Change 89744 by rwatson@rwatson_peppercorn on 2006/01/15 20:29:12 First phase of gratuitous and excessive restyling of libbsm.h to conform to style(9). In addition, use 'void' in function prototypes for functions that do not accept arguments, and comment sets of functions. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#6 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#6 (text+ko) ==== @@ -27,16 +27,15 @@ */ #ifndef _LIBBSM_H_ -#define _LIBBSM_H_ +#define _LIBBSM_H_ /* - * NB: definitions, etc., marked with "OpenSSH compatibility" were - * introduced solely to allow OpenSSH to compile; Darwin/Apple code should - * not use them. + * NB: definitions, etc., marked with "OpenSSH compatibility" were introduced + * solely to allow OpenSSH to compile; Darwin/Apple code should not use them. */ -#define MAX_ARGS 10 -#define MAX_ENV 10 +#define MAX_ARGS 10 +#define MAX_ENV 10 #include #include @@ -51,132 +50,117 @@ #include /* audit_token_t */ #endif -#define AU_PRS_SUCCESS 1 -#define AU_PRS_FAILURE 2 -#define AU_PRS_BOTH (AU_PRS_SUCCESS|AU_PRS_FAILURE) +#define AU_PRS_SUCCESS 1 +#define AU_PRS_FAILURE 2 +#define AU_PRS_BOTH (AU_PRS_SUCCESS|AU_PRS_FAILURE) -#define AU_PRS_USECACHE 0 -#define AU_PRS_REREAD 1 +#define AU_PRS_USECACHE 0 +#define AU_PRS_REREAD 1 -#define AUDIT_EVENT_FILE "/etc/security/audit_event" -#define AUDIT_CLASS_FILE "/etc/security/audit_class" -#define AUDIT_CONTROL_FILE "/etc/security/audit_control" -#define AUDIT_USER_FILE "/etc/security/audit_user" +#define AUDIT_EVENT_FILE "/etc/security/audit_event" +#define AUDIT_CLASS_FILE "/etc/security/audit_class" +#define AUDIT_CONTROL_FILE "/etc/security/audit_control" +#define AUDIT_USER_FILE "/etc/security/audit_user" -#define DIR_CONTROL_ENTRY "dir" -#define MINFREE_CONTROL_ENTRY "minfree" -#define FLAGS_CONTROL_ENTRY "flags" -#define NA_CONTROL_ENTRY "naflags" +#define DIR_CONTROL_ENTRY "dir" +#define MINFREE_CONTROL_ENTRY "minfree" +#define FLAGS_CONTROL_ENTRY "flags" +#define NA_CONTROL_ENTRY "naflags" -#define AU_CLASS_NAME_MAX 8 -#define AU_CLASS_DESC_MAX 72 -#define AU_EVENT_NAME_MAX 30 -#define AU_EVENT_DESC_MAX 50 -#define AU_USER_NAME_MAX 50 -#define AU_LINE_MAX 256 -#define MAX_AUDITSTRING_LEN 256 -#define BSM_TEXTBUFSZ MAX_AUDITSTRING_LEN /* OpenSSH compatibility */ +#define AU_CLASS_NAME_MAX 8 +#define AU_CLASS_DESC_MAX 72 +#define AU_EVENT_NAME_MAX 30 +#define AU_EVENT_DESC_MAX 50 +#define AU_USER_NAME_MAX 50 +#define AU_LINE_MAX 256 +#define MAX_AUDITSTRING_LEN 256 +#define BSM_TEXTBUFSZ MAX_AUDITSTRING_LEN /* OpenSSH compatibility */ /* * These are referenced in Solaris 9 au_open(3BSM); values are guesses. * Provided for OpenSSH compatibility. */ -#define AU_TO_NO_WRITE 0 -#define AU_TO_WRITE 1 +#define AU_TO_NO_WRITE 0 +#define AU_TO_WRITE 1 __BEGIN_DECLS struct au_event_ent { - au_event_t ae_number; - char *ae_name; - char *ae_desc; - au_class_t ae_class; + au_event_t ae_number; + char *ae_name; + char *ae_desc; + au_class_t ae_class; }; typedef struct au_event_ent au_event_ent_t; struct au_class_ent { - char *ac_name; - au_class_t ac_class; - char *ac_desc; + char *ac_name; + au_class_t ac_class; + char *ac_desc; }; typedef struct au_class_ent au_class_ent_t; struct au_user_ent { - char *au_name; - au_mask_t au_always; - au_mask_t au_never; + char *au_name; + au_mask_t au_always; + au_mask_t au_never; }; typedef struct au_user_ent au_user_ent_t; __END_DECLS +#define ADD_TO_MASK(m, c, sel) do { \ + if (sel & AU_PRS_SUCCESS) \ + (m)->am_success |= c; \ + if (sel & AU_PRS_FAILURE) \ + (m)->am_failure |= c; \ +} while (0) -#define ADD_TO_MASK(m, c, sel) \ - do {\ - if(sel & AU_PRS_SUCCESS) {\ - (m)->am_success |= c;\ - }\ - if(sel & AU_PRS_FAILURE) {\ - (m)->am_failure |= c;\ - }\ - }while(0) +#define SUB_FROM_MASK(m, c, sel) do { \ + if (sel & AU_PRS_SUCCESS) \ + (m)->am_success &= ((m)->am_success ^ c); \ + if (sel & AU_PRS_FAILURE) \ + (m)->am_failure &= ((m)->am_failure ^ c); \ +} while (0) -#define SUB_FROM_MASK(m, c, sel) \ - do {\ - if(sel & AU_PRS_SUCCESS) {\ - (m)->am_success &= ((m)->am_success ^ c);\ - }\ - if(sel & AU_PRS_FAILURE) {\ - (m)->am_failure &= ((m)->am_failure ^ c);\ - }\ - }while(0) +#define ADDMASK(m, v) do { \ + (m)->am_success |= (v)->am_success; \ + (m)->am_failure |= (v)->am_failure; \ +} while(0) -#define ADDMASK(m, v) \ - do {\ - (m)->am_success |= (v)->am_success;\ - (m)->am_failure |= (v)->am_failure;\ - } while(0) +#define SUBMASK(m, v) do { \ + (m)->am_success &= ((m)->am_success ^ (v)->am_success); \ + (m)->am_failure &= ((m)->am_failure ^ (v)->am_failure); \ +} while(0) -#define SUBMASK(m, v) \ - do {\ - (m)->am_success &= ((m)->am_success ^ (v)->am_success);\ - (m)->am_failure &= ((m)->am_failure ^ (v)->am_failure);\ - } while(0) - - __BEGIN_DECLS struct audit_event_map { - struct au_event_ent *ev; - LIST_ENTRY(audit_event_map) ev_list; + struct au_event_ent *ev; + LIST_ENTRY(audit_event_map) ev_list; }; - /* - * Internal representation of audit user in libnsl + * Internal representation of audit user in libnsl. */ typedef struct au_user_str_s { - char *au_name; - char *au_always; - char *au_never; + char *au_name; + char *au_always; + char *au_never; } au_user_str_t; +typedef struct au_tid32 { + u_int32_t port; + u_int32_t addr; +} au_tid32_t; -struct au_tid32 { - u_int32_t port; - u_int32_t addr; -}; -typedef struct au_tid32 au_tid32_t; +typedef struct au_tid64 { + u_int64_t port; + u_int32_t addr; +} au_tid64_t; -struct au_tid64 { - u_int64_t port; - u_int32_t addr; -}; -typedef struct au_tid64 au_tid64_t; - -struct au_tidaddr32 { +typedef struct au_tidaddr32 { u_int32_t port; u_int32_t type; u_int32_t addr[4]; -}; -typedef struct au_tidaddr32 au_tidaddr32_t; +} au_tidaddr32_t; /* * argument # 1 byte @@ -185,24 +169,19 @@ * text N bytes + 1 terminating NULL byte */ typedef struct { - u_char no; u_int32_t val; u_int16_t len; char *text; - } au_arg32_t; typedef struct { - u_char no; u_int64_t val; u_int16_t len; char *text; - } au_arg64_t; - /* * how to print 1 byte * basic unit 1 byte @@ -210,16 +189,12 @@ * data items (depends on basic unit) */ typedef struct { - u_char howtopr; u_char bu; u_char uc; u_char *data; - } au_arb_t; - - /* * file access mode 4 bytes * owner user ID 4 bytes @@ -229,49 +204,39 @@ * device 4 bytes/8 bytes (32-bit/64-bit) */ typedef struct { - u_int32_t mode; u_int32_t uid; u_int32_t gid; u_int32_t fsid; u_int64_t nid; u_int32_t dev; - } au_attr32_t; typedef struct { - u_int32_t mode; u_int32_t uid; u_int32_t gid; u_int32_t fsid; u_int64_t nid; u_int64_t dev; - } au_attr64_t; - /* * count 4 bytes * text count null-terminated string(s) */ typedef struct { - u_int32_t count; char *text[MAX_ARGS]; - } au_execarg_t; - /* * count 4 bytes * text count null-terminated string(s) */ typedef struct { - u_int32_t count; char *text[MAX_ENV]; - } au_execenv_t; /* @@ -279,10 +244,8 @@ * return value 4 bytes */ typedef struct { - u_int32_t status; u_int32_t ret; - } au_exit_t; /* @@ -292,12 +255,10 @@ * file pathname N bytes + 1 terminating NULL byte */ typedef struct { - u_int32_t s; u_int32_t ms; u_int16_t len; char *name; - } au_file_t; @@ -306,13 +267,10 @@ * group list N * 4 bytes */ typedef struct { - u_int16_t no; u_int32_t list[BSM_MAX_GROUPS]; - } au_groups_t; - /* * record byte count 4 bytes * version # 1 byte [2] @@ -322,14 +280,12 @@ * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value) */ typedef struct { - u_int32_t size; u_char version; u_int16_t e_type; u_int16_t e_mod; u_int32_t s; u_int32_t ms; - } au_header32_t; /* @@ -343,7 +299,6 @@ * nanoseconds of time 4 bytes/8 bytes (32/64-bits) */ typedef struct { - u_int32_t size; u_char version; u_int16_t e_type; @@ -352,22 +307,18 @@ u_int32_t addr[4]; u_int32_t s; u_int32_t ms; - } au_header32_ex_t; typedef struct { - u_int32_t size; u_char version; u_int16_t e_type; u_int16_t e_mod; u_int64_t s; u_int64_t ms; - } au_header64_t; typedef struct { - u_int32_t size; u_char version; u_int16_t e_type; @@ -376,17 +327,13 @@ u_int32_t addr[4]; u_int64_t s; u_int64_t ms; - } au_header64_ex_t; - /* * internet address 4 bytes */ typedef struct { - u_int32_t addr; - } au_inaddr_t; /* @@ -394,10 +341,8 @@ * internet address 16 bytes */ typedef struct { - u_int32_t type; u_int32_t addr[4]; - } au_inaddr_ex_t; /* @@ -413,7 +358,6 @@ * destination address 4 bytes */ typedef struct { - u_char version; u_char tos; u_int16_t len; @@ -424,7 +368,6 @@ u_int16_t chksm; u_int32_t src; u_int32_t dest; - } au_ip_t; /* @@ -432,10 +375,8 @@ * object ID 4 bytes */ typedef struct { - u_char type; u_int32_t id; - } au_ipc_t; /* @@ -448,7 +389,6 @@ * key 4 bytes */ typedef struct { - u_int32_t uid; u_int32_t gid; u_int32_t puid; @@ -456,45 +396,33 @@ u_int32_t mode; u_int32_t seq; u_int32_t key; - } au_ipcperm_t; - /* * port IP address 2 bytes */ typedef struct { - u_int16_t port; - } au_iport_t; - /* * length 2 bytes * data length bytes */ typedef struct { - u_int16_t size; char *data; - } au_opaque_t; - /* * path length 2 bytes * path N bytes + 1 terminating NULL byte */ typedef struct { - u_int16_t len; char *path; - } au_path_t; - - /* * audit ID 4 bytes * effective user ID 4 bytes @@ -508,7 +436,6 @@ * machine address 4 bytes */ typedef struct { - u_int32_t auid; u_int32_t euid; u_int32_t egid; @@ -517,11 +444,9 @@ u_int32_t pid; u_int32_t sid; au_tid32_t tid; - } au_proc32_t; typedef struct { - u_int32_t auid; u_int32_t euid; u_int32_t egid; @@ -530,7 +455,6 @@ u_int32_t pid; u_int32_t sid; au_tid64_t tid; - } au_proc64_t; /* @@ -547,7 +471,6 @@ * machine address 16 bytes */ typedef struct { - u_int32_t auid; u_int32_t euid; u_int32_t egid; @@ -556,7 +479,6 @@ u_int32_t pid; u_int32_t sid; au_tidaddr32_t tid; - } au_proc32ex_t; /* @@ -564,27 +486,20 @@ * return value 4 bytes/8 bytes (32-bit/64-bit value) */ typedef struct { - u_char status; u_int32_t ret; - } au_ret32_t; typedef struct { - u_char err; u_int64_t val; - } au_ret64_t; - /* * sequence number 4 bytes */ typedef struct { - u_int32_t seqno; - } au_seq_t; /* @@ -595,13 +510,11 @@ * remote Internet address 4 bytes */ typedef struct { - u_int16_t type; u_int16_t l_port; u_int32_t l_addr; u_int16_t r_port; u_int32_t r_addr; - } au_socket_t; /* @@ -613,9 +526,7 @@ * address type/length 4 bytes * remote Internet address 4 bytes/16 bytes (IPv4/IPv6 address) */ - typedef struct { - u_int16_t type; u_int16_t l_port; u_int32_t l_ad_type; @@ -623,7 +534,6 @@ u_int32_t r_port; u_int32_t r_ad_type; u_int32_t r_addr; - } au_socket_ex32_t; /* @@ -632,11 +542,9 @@ * socket address 4 bytes/16 bytes (IPv4/IPv6 address) */ typedef struct { - u_int16_t family; u_int16_t port; u_int32_t addr; - } au_socketinet32_t; /* @@ -644,10 +552,8 @@ * path 104 bytes */ typedef struct { - u_int16_t family; char path[104]; - } au_socketunix_t; /* @@ -663,7 +569,6 @@ * machine address 4 bytes */ typedef struct { - u_int32_t auid; u_int32_t euid; u_int32_t egid; @@ -672,11 +577,9 @@ u_int32_t pid; u_int32_t sid; au_tid32_t tid; - } au_subject32_t; typedef struct { - u_int32_t auid; u_int32_t euid; u_int32_t egid; @@ -685,7 +588,6 @@ u_int32_t pid; u_int32_t sid; au_tid64_t tid; - } au_subject64_t; /* @@ -702,7 +604,6 @@ * machine address 16 bytes */ typedef struct { - u_int32_t auid; u_int32_t euid; u_int32_t egid; @@ -711,60 +612,44 @@ u_int32_t pid; u_int32_t sid; au_tidaddr32_t tid; - } au_subject32ex_t; - /* * text length 2 bytes * text N bytes + 1 terminating NULL byte */ typedef struct { - u_int16_t len; char *text; - } au_text_t; typedef struct { - u_int32_t ident; u_int16_t filter; u_int16_t flags; u_int32_t fflags; u_int32_t data; - } au_kevent_t; typedef struct { - u_int16_t length; char *data; } au_invalid_t; - /* * trailer magic number 2 bytes * record byte count 4 bytes */ typedef struct { - u_int16_t magic; u_int32_t count; - } au_trailer_t; - - struct tokenstr { - u_char id; - u_char *data; size_t len; - union { - au_arg32_t arg32; au_arg64_t arg64; au_arb_t arb; @@ -804,37 +689,38 @@ au_kevent_t kevent; au_invalid_t invalid; au_trailer_t trail; - } tt; /* The token is one of the above types */ +}; -} ; - typedef struct tokenstr tokenstr_t; -void setauevent(); -void endauevent(); -struct au_event_ent *getauevent(); +/* + * Functions relating to querying audit event information. + */ +void setauevent(void); +void endauevent(void); +struct au_event_ent *getauevent(void); struct au_event_ent *getauevnam(char *name); struct au_event_ent *getauevnum(au_event_t event_number); -/* - * Free the au_event_ent structure - */ void free_au_event_ent(struct au_event_ent *e); au_event_t *getauevnonam(char *event_name); void free_au_event(au_event_t *e); -void setauclass(); -void endauclass(); -struct au_class_ent *getauclassent(); +/* + * Functions relating to querying audit class information. + */ +void setauclass(void); +void endauclass(void); +struct au_class_ent *getauclassent(void); struct au_class_ent *getauclassnam(const char *name); struct au_class_ent *getauclassnum(au_class_t class_number); +void free_au_class_ent(struct au_class_ent *c); + /* - * Free the au_class_ent structure + * Functions relating to querying audit control information. */ -void free_au_class_ent(struct au_class_ent *c); - -void setac(); -void endac(); +void setac(void); +void endac(void); int getacdir(char *name, int len); int getacmin(int *min_val); int getacflg(char *auditstr, int len); @@ -845,16 +731,21 @@ int au_preselect(au_event_t event, au_mask_t *mask_p, int sorf, int flag); -void setauuser(); -void endauuser(); -struct au_user_ent *getauuserent(); +/* + * Functions relating to querying audit user information. + */ +void setauuser(void); +void endauuser(void); +struct au_user_ent *getauuserent(void); struct au_user_ent *getauusernam(const char *name); int au_user_mask(char *username, au_mask_t *mask_p); int getfauditflags(au_mask_t *usremask, au_mask_t *usrdmask, au_mask_t *lastmask); void free_au_user_ent(struct au_user_ent *u); - +/* + * Functions for reading and printing records and tokens from audit trails. + */ int au_read_rec(FILE *fp, u_char **buf); int au_fetch_tok(tokenstr_t *tok, u_char *buf, int len); //XXX The following interface has different prototype from BSM @@ -873,7 +764,7 @@ **************************************************************************/ #ifdef __APPLE_API_PRIVATE -#define __BSM_INTERNAL_NOTIFY_KEY "com.apple.audit.change" +#define __BSM_INTERNAL_NOTIFY_KEY "com.apple.audit.change" #endif /* __APPLE_API_PRIVATE */ /* @@ -882,8 +773,8 @@ * AUDIT_ON are deprecated and WILL be removed. */ #ifdef __APPLE_API_PRIVATE -#define AUDIT_OFF AUC_NOAUDIT -#define AUDIT_ON AUC_AUDITING +#define AUDIT_OFF AUC_NOAUDIT +#define AUDIT_ON AUC_AUDITING #endif /* __APPLE_API_PRIVATE */ #endif /* !__APPLE__ */ @@ -922,7 +813,7 @@ * without rebooting. Shame on you. */ #ifdef __APPLE_API_PRIVATE -#define AU_UNIMPL NOTIFY_STATUS_FAILED + 1 /* audit unimplemented */ +#define AU_UNIMPL NOTIFY_STATUS_FAILED + 1 /* audit unimplemented */ #endif /* __APPLE_API_PRIVATE */ #endif /* !__APPLE__ */ @@ -969,7 +860,7 @@ __END_DECLS /* OpenSSH compatibility */ -#define cannot_audit(x) (!(au_get_state() == AUC_AUDITING)) +#define cannot_audit(x) (!(au_get_state() == AUC_AUDITING)) __BEGIN_DECLS /* @@ -1270,8 +1161,6 @@ au_tid_t *tidp); #endif /* !__APPLE__ */ - __END_DECLS - #endif /* !_LIBBSM_H_ */ From owner-p4-projects@FreeBSD.ORG Sun Jan 15 20:34:44 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BC29216A422; Sun, 15 Jan 2006 20:34:43 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A0C116A41F for ; Sun, 15 Jan 2006 20:34:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B854B43D46 for ; Sun, 15 Jan 2006 20:34:42 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FKYgi5014236 for ; Sun, 15 Jan 2006 20:34:42 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FKYfWx014233 for perforce@freebsd.org; Sun, 15 Jan 2006 20:34:41 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 20:34:41 GMT Message-Id: <200601152034.k0FKYfWx014233@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89745 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 20:34:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=89745 Change 89745 by rwatson@rwatson_zoo on 2006/01/15 20:34:06 Integrate netsmp branch: loop back ipq with UMA change. Affected files ... .. //depot/projects/netsmp/src/sys/Makefile#2 integrate .. //depot/projects/netsmp/src/sys/alpha/conf/GENERIC#5 integrate .. //depot/projects/netsmp/src/sys/alpha/include/_types.h#2 integrate .. //depot/projects/netsmp/src/sys/alpha/include/param.h#4 integrate .. //depot/projects/netsmp/src/sys/amd64/amd64/bpf_jit_machdep.c#2 integrate .. //depot/projects/netsmp/src/sys/amd64/amd64/busdma_machdep.c#4 integrate .. //depot/projects/netsmp/src/sys/amd64/amd64/mptable_pci.c#3 integrate .. //depot/projects/netsmp/src/sys/amd64/amd64/trap.c#6 integrate .. //depot/projects/netsmp/src/sys/amd64/conf/GENERIC#7 integrate .. //depot/projects/netsmp/src/sys/amd64/include/_types.h#2 integrate .. //depot/projects/netsmp/src/sys/amd64/include/param.h#3 integrate .. //depot/projects/netsmp/src/sys/amd64/pci/pci_bus.c#4 integrate .. //depot/projects/netsmp/src/sys/arm/arm/trap.c#3 integrate .. //depot/projects/netsmp/src/sys/arm/include/_types.h#2 integrate .. //depot/projects/netsmp/src/sys/arm/include/param.h#3 integrate .. //depot/projects/netsmp/src/sys/boot/common/module.c#2 integrate .. //depot/projects/netsmp/src/sys/cam/cam_periph.c#2 integrate .. //depot/projects/netsmp/src/sys/cam/cam_xpt.c#3 integrate .. //depot/projects/netsmp/src/sys/cam/scsi/scsi_da.c#4 integrate .. //depot/projects/netsmp/src/sys/cam/scsi/scsi_sa.c#2 integrate .. //depot/projects/netsmp/src/sys/coda/coda_vfsops.c#3 integrate .. //depot/projects/netsmp/src/sys/conf/NOTES#7 integrate .. //depot/projects/netsmp/src/sys/conf/files#16 integrate .. //depot/projects/netsmp/src/sys/conf/options#7 integrate .. //depot/projects/netsmp/src/sys/contrib/pf/net/pf_norm.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/acpi_support/acpi_ibm.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/acpica/Osd/OsdSchedule.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/acpica/acpi_pci_link.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/acpica/acpi_pcib_acpi.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/acpica/acpi_pcib_pci.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/acpica/acpi_smbat.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/amr/amr.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/amr/amrreg.h#3 integrate .. //depot/projects/netsmp/src/sys/dev/an/if_an.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/asr/asr.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-all.c#9 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-all.h#7 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-card.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-cbus.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-chipset.c#9 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-disk.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-disk.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-dma.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-isa.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-lowlevel.c#6 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-pci.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-pci.h#8 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-queue.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-raid.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata-raid.h#4 integrate .. //depot/projects/netsmp/src/sys/dev/ata/ata_if.m#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-cd.c#6 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-cd.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-fd.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-fd.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-tape.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ata/atapi-tape.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/ath/if_ath.c#13 integrate .. //depot/projects/netsmp/src/sys/dev/ath/if_athioctl.h#3 integrate .. //depot/projects/netsmp/src/sys/dev/ath/if_athvar.h#5 integrate .. //depot/projects/netsmp/src/sys/dev/atkbdc/psm.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/bge/if_bge.c#12 integrate .. //depot/projects/netsmp/src/sys/dev/bge/if_bgereg.h#5 integrate .. //depot/projects/netsmp/src/sys/dev/cardbus/cardbus_cis.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/dcons/dcons_os.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/ed/if_ed_isa.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/em/if_em.c#12 integrate .. //depot/projects/netsmp/src/sys/dev/em/if_em.h#4 integrate .. //depot/projects/netsmp/src/sys/dev/fxp/if_fxp.c#12 integrate .. //depot/projects/netsmp/src/sys/dev/ichsmb/ichsmb.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ieee488/pcii.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/ips/ips_ioctl.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/ips/ipsreg.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/nmdm/nmdm.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/pci/pci.c#9 integrate .. //depot/projects/netsmp/src/sys/dev/pci/pci_pci.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/pci/pcib_private.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/pci/pcivar.h#4 integrate .. //depot/projects/netsmp/src/sys/dev/si/si.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/si/si2_z280.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/si/si3_t225.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sn/if_sn.c#9 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pci/ds1.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pci/es137x.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pci/fm801.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pci/ich.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pci/maestro.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pci/solo.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pcm/ac97.c#8 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pcm/channel.c#7 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pcm/vchan.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/syscons/syscons.c#5 integrate .. //depot/projects/netsmp/src/sys/dev/ti/if_ti.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ti/if_tireg.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/usb/ufoma.c#1 branch .. //depot/projects/netsmp/src/sys/dev/usb/umass.c#4 integrate .. //depot/projects/netsmp/src/sys/dev/usb/usb_mem.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/usb/usb_quirks.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/usb/usb_quirks.h#3 integrate .. //depot/projects/netsmp/src/sys/dev/usb/usb_subr.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/usb/usbdevs#5 integrate .. //depot/projects/netsmp/src/sys/dev/usb/uscanner.c#3 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_rule.c#5 integrate .. //depot/projects/netsmp/src/sys/fs/ntfs/ntfs_subr.c#4 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_drive.c#7 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_plex.c#3 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_subr.c#2 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_var.h#3 integrate .. //depot/projects/netsmp/src/sys/geom/vinum/geom_vinum_volume.c#3 integrate .. //depot/projects/netsmp/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#4 integrate .. //depot/projects/netsmp/src/sys/gnu/fs/reiserfs/reiserfs_inode.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/conf/GENERIC#7 integrate .. //depot/projects/netsmp/src/sys/i386/i386/bpf_jit_machdep.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/i386/busdma_machdep.c#3 integrate .. //depot/projects/netsmp/src/sys/i386/i386/identcpu.c#6 integrate .. //depot/projects/netsmp/src/sys/i386/i386/mptable_pci.c#3 integrate .. //depot/projects/netsmp/src/sys/i386/i386/trap.c#4 integrate .. //depot/projects/netsmp/src/sys/i386/ibcs2/ibcs2_sysvec.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/include/_types.h#2 integrate .. //depot/projects/netsmp/src/sys/i386/include/param.h#3 integrate .. //depot/projects/netsmp/src/sys/i386/isa/pcvt/pcvt_drv.c#2 integrate .. //depot/projects/netsmp/src/sys/i386/pci/pci_bus.c#5 integrate .. //depot/projects/netsmp/src/sys/i386/xbox/xboxfb.c#2 integrate .. //depot/projects/netsmp/src/sys/ia64/conf/GENERIC#5 integrate .. //depot/projects/netsmp/src/sys/ia64/ia64/ssc.c#3 integrate .. //depot/projects/netsmp/src/sys/ia64/include/_types.h#2 integrate .. //depot/projects/netsmp/src/sys/ia64/include/param.h#5 integrate .. //depot/projects/netsmp/src/sys/isofs/cd9660/cd9660_vnops.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/kern_conf.c#5 integrate .. //depot/projects/netsmp/src/sys/kern/kern_descrip.c#7 integrate .. //depot/projects/netsmp/src/sys/kern/kern_mutex.c#6 integrate .. //depot/projects/netsmp/src/sys/kern/kern_sx.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/kern_thr.c#4 integrate .. //depot/projects/netsmp/src/sys/kern/subr_bus.c#4 integrate .. //depot/projects/netsmp/src/sys/kern/subr_disk.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/subr_taskqueue.c#4 integrate .. //depot/projects/netsmp/src/sys/kern/subr_witness.c#12 integrate .. //depot/projects/netsmp/src/sys/kern/sys_generic.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/tty.c#4 integrate .. //depot/projects/netsmp/src/sys/kern/tty_compat.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/tty_pty.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/uipc_socket.c#24 integrate .. //depot/projects/netsmp/src/sys/kern/uipc_usrreq.c#8 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_aio.c#6 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_default.c#5 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_mount.c#5 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_subr.c#15 integrate .. //depot/projects/netsmp/src/sys/kern/vfs_syscalls.c#6 integrate .. //depot/projects/netsmp/src/sys/libkern/gets.c#2 integrate .. //depot/projects/netsmp/src/sys/modules/Makefile#10 integrate .. //depot/projects/netsmp/src/sys/modules/ufoma/Makefile#1 branch .. //depot/projects/netsmp/src/sys/net/bpf_filter.c#3 integrate .. //depot/projects/netsmp/src/sys/net/if_bridge.c#13 integrate .. //depot/projects/netsmp/src/sys/net/if_bridgevar.h#5 integrate .. //depot/projects/netsmp/src/sys/net/if_ef.c#5 integrate .. //depot/projects/netsmp/src/sys/net/if_fwsubr.c#7 integrate .. //depot/projects/netsmp/src/sys/net/if_mib.c#4 integrate .. //depot/projects/netsmp/src/sys/net/if_mib.h#2 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_node.c#10 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_output.c#8 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_proto.c#5 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_proto.h#5 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_radiotap.h#2 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_var.h#7 integrate .. //depot/projects/netsmp/src/sys/netgraph/netflow/netflow.c#4 integrate .. //depot/projects/netsmp/src/sys/netgraph/netflow/ng_netflow.c#3 integrate .. //depot/projects/netsmp/src/sys/netgraph/netflow/ng_netflow.h#2 integrate .. //depot/projects/netsmp/src/sys/netgraph/netgraph.h#8 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_base.c#8 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_ether.c#6 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_frame_relay.c#2 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_lmi.c#2 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_message.h#2 integrate .. //depot/projects/netsmp/src/sys/netgraph/ng_parse.c#3 integrate .. //depot/projects/netsmp/src/sys/netinet/if_ether.c#9 integrate .. //depot/projects/netsmp/src/sys/netinet/ip_fw2.c#10 integrate .. //depot/projects/netsmp/src/sys/netinet/ip_input.c#10 integrate .. //depot/projects/netsmp/src/sys/netinet/tcp_input.c#5 integrate .. //depot/projects/netsmp/src/sys/netinet/tcp_syncache.c#5 integrate .. //depot/projects/netsmp/src/sys/netinet/udp_usrreq.c#7 integrate .. //depot/projects/netsmp/src/sys/netinet6/ip6_mroute.c#7 integrate .. //depot/projects/netsmp/src/sys/netinet6/ip6_output.c#8 integrate .. //depot/projects/netsmp/src/sys/netinet6/ipcomp_input.c#2 integrate .. //depot/projects/netsmp/src/sys/netipx/ipx_input.c#2 integrate .. //depot/projects/netsmp/src/sys/netipx/spx_usrreq.c#5 integrate .. //depot/projects/netsmp/src/sys/netncp/ncp_conn.c#3 integrate .. //depot/projects/netsmp/src/sys/nfs4client/nfs4_vfsops.c#2 integrate .. //depot/projects/netsmp/src/sys/nfsclient/nfs_lock.c#4 integrate .. //depot/projects/netsmp/src/sys/nfsclient/nfs_vfsops.c#3 integrate .. //depot/projects/netsmp/src/sys/pc98/conf/GENERIC#5 integrate .. //depot/projects/netsmp/src/sys/pc98/include/_types.h#2 integrate .. //depot/projects/netsmp/src/sys/pc98/include/param.h#3 integrate .. //depot/projects/netsmp/src/sys/pccard/cardinfo.h#2 integrate .. //depot/projects/netsmp/src/sys/pccard/driver.h#2 delete .. //depot/projects/netsmp/src/sys/pccard/i82365.h#2 delete .. //depot/projects/netsmp/src/sys/pccard/meciareg.h#2 delete .. //depot/projects/netsmp/src/sys/pccard/pccard_nbk.h#2 delete .. //depot/projects/netsmp/src/sys/pccard/pcic_pci.h#2 delete .. //depot/projects/netsmp/src/sys/pccard/pcicvar.h#2 delete .. //depot/projects/netsmp/src/sys/pccard/slot.h#2 delete .. //depot/projects/netsmp/src/sys/pci/if_sk.c#10 integrate .. //depot/projects/netsmp/src/sys/powerpc/conf/GENERIC#4 integrate .. //depot/projects/netsmp/src/sys/powerpc/ofw/ofw_pcib_pci.c#2 integrate .. //depot/projects/netsmp/src/sys/powerpc/powerpc/machdep.c#6 integrate .. //depot/projects/netsmp/src/sys/security/mac_bsdextended/mac_bsdextended.c#3 integrate .. //depot/projects/netsmp/src/sys/sparc64/conf/GENERIC#5 integrate .. //depot/projects/netsmp/src/sys/sparc64/conf/NOTES#4 integrate .. //depot/projects/netsmp/src/sys/sparc64/include/in_cksum.h#2 integrate .. //depot/projects/netsmp/src/sys/sparc64/pci/apb.c#3 integrate .. //depot/projects/netsmp/src/sys/sparc64/pci/ofw_pcib.c#3 integrate .. //depot/projects/netsmp/src/sys/sparc64/sparc64/pmap.c#4 integrate .. //depot/projects/netsmp/src/sys/sys/_lock.h#3 integrate .. //depot/projects/netsmp/src/sys/sys/ioctl.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/ioctl_compat.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/lock.h#3 integrate .. //depot/projects/netsmp/src/sys/sys/mount.h#6 integrate .. //depot/projects/netsmp/src/sys/sys/param.h#10 integrate .. //depot/projects/netsmp/src/sys/sys/select.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/socketvar.h#8 integrate .. //depot/projects/netsmp/src/sys/sys/taskqueue.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/tree.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/tty.h#3 integrate .. //depot/projects/netsmp/src/sys/sys/ttychars.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/ttydev.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/vnode.h#7 integrate .. //depot/projects/netsmp/src/sys/ufs/ffs/ffs_snapshot.c#3 integrate .. //depot/projects/netsmp/src/sys/ufs/ffs/ffs_softdep.c#7 integrate .. //depot/projects/netsmp/src/sys/ufs/ffs/ffs_vfsops.c#8 integrate .. //depot/projects/netsmp/src/sys/ufs/ufs/ufs_quota.c#4 integrate .. //depot/projects/netsmp/src/sys/vm/uma_core.c#6 integrate .. //depot/projects/netsmp/src/sys/vm/vm_pageq.c#3 integrate Differences ... ==== //depot/projects/netsmp/src/sys/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/Makefile,v 1.33 2005/03/08 00:09:41 grog Exp $ +# $FreeBSD: src/sys/Makefile,v 1.34 2006/01/10 20:58:27 rees Exp $ # The boot loader .if !defined(NO_BOOT) @@ -11,7 +11,8 @@ CSCOPEDIRS= coda compat conf contrib crypto ddb dev fs gnu i4b isa \ isofs kern libkern modules net netatalk netatm netgraph \ netinet netinet6 netipx netkey netnatm netncp netsmb nfs \ - pccard pci posix4 sys ufs vm ${ARCHDIR} + nfsclient nfs4client rpc pccard pci posix4 sys ufs vm \ + ${ARCHDIR} ARCHDIR ?= ${MACHINE} ==== //depot/projects/netsmp/src/sys/alpha/conf/GENERIC#5 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.191 2005/11/27 23:16:58 ru Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.192 2006/01/10 09:19:07 phk Exp $ cpu EV4 cpu EV5 @@ -61,6 +61,7 @@ options PSEUDOFS # Pseudo-filesystem framework options GEOM_GPT # GUID Partition Tables. options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI ==== //depot/projects/netsmp/src/sys/alpha/include/_types.h#2 (text+ko) ==== @@ -33,7 +33,7 @@ * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD: src/sys/alpha/include/_types.h,v 1.6 2005/03/02 21:33:20 joerg Exp $ + * $FreeBSD: src/sys/alpha/include/_types.h,v 1.8 2006/01/09 06:05:55 imp Exp $ */ #ifndef _MACHINE__TYPES_H_ ==== //depot/projects/netsmp/src/sys/alpha/include/param.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/param.h,v 1.40 2005/12/06 13:27:20 ru Exp $ */ +/* $FreeBSD: src/sys/alpha/include/param.h,v 1.41 2006/01/09 06:05:55 imp Exp $ */ /* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */ /*- @@ -66,6 +66,8 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __PCI_REROUTE_INTERRUPT + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ ==== //depot/projects/netsmp/src/sys/amd64/amd64/bpf_jit_machdep.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.3 2005/12/06 07:22:00 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/bpf_jit_machdep.c,v 1.4 2006/01/03 20:26:02 jkim Exp $"); #include "opt_bpf.h" @@ -103,6 +103,10 @@ */ emit_func emitm; + /* Do not compile an empty filter. */ + if (nins == 0) + return NULL; + /* Allocate the reference table for the jumps */ stream.refs = (u_int *)malloc((nins + 1) * sizeof(u_int), M_BPFJIT, M_NOWAIT); ==== //depot/projects/netsmp/src/sys/amd64/amd64/busdma_machdep.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.72 2005/12/16 05:57:18 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.73 2006/01/14 17:22:46 scottl Exp $"); #include #include @@ -285,8 +285,10 @@ /* Must bounce */ - if ((error = alloc_bounce_zone(newtag)) != 0) + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); return (error); + } bz = newtag->bounce_zone; if (ptoa(bz->total_bpages) < maxsize) { ==== //depot/projects/netsmp/src/sys/amd64/amd64/mptable_pci.c#3 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.3 2005/09/18 01:42:43 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mptable_pci.c,v 1.4 2006/01/06 19:22:18 jhb Exp $"); #include #include @@ -100,13 +100,10 @@ { 0, 0 } }; -static driver_t mptable_hostb_driver = { - "pcib", - mptable_hostb_methods, - 1, -}; +static devclass_t hostb_devclass; -DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, pcib_devclass, 0, 0); +DEFINE_CLASS_0(pcib, mptable_hostb_driver, mptable_hostb_methods, 1); +DRIVER_MODULE(mptable_pcib, legacy, mptable_hostb_driver, hostb_devclass, 0, 0); /* PCI to PCI bridge driver. */ @@ -155,11 +152,9 @@ {0, 0} }; -static driver_t mptable_pcib_driver = { - "pcib", - mptable_pcib_pci_methods, - sizeof(struct pcib_softc), -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, mptable_pcib_driver, mptable_pcib_pci_methods, + sizeof(struct pcib_softc)); DRIVER_MODULE(mptable_pcib, pci, mptable_pcib_driver, pcib_devclass, 0, 0); ==== //depot/projects/netsmp/src/sys/amd64/amd64/trap.c#6 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.298 2005/12/09 13:30:34 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.299 2006/01/06 18:02:11 jhb Exp $"); /* * AMD64 Trap and System call handling @@ -220,10 +220,10 @@ printf("kernel trap %d with interrupts disabled\n", type); /* - * We shouldn't enable interrupts while in a critical - * section or servicing an NMI. + * We shouldn't enable interrupts while holding a + * spin lock or servicing an NMI. */ - if (type != T_NMI && td->td_critnest == 0) + if (type != T_NMI && td->td_md.md_spinlock_count == 0) enable_intr(); } } ==== //depot/projects/netsmp/src/sys/amd64/conf/GENERIC#7 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.447 2005/11/27 23:16:58 ru Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.449 2006/01/12 01:20:59 obrien Exp $ cpu HAMMER ident GENERIC @@ -46,10 +46,10 @@ options PSEUDOFS # Pseudo-filesystem framework options GEOM_GPT # GUID Partition Tables. options COMPAT_43 # Needed by COMPAT_LINUX32 +options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options COMPAT_IA32 # Compatible with i386 binaries options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -options COMPAT_LINUX32 # Compatible with i386 linux binaries options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory @@ -77,6 +77,7 @@ options SMP # Symmetric MultiProcessor Kernel # Linux 32-bit ABI support +options COMPAT_LINUX32 # Compatible with i386 linux binaries options LINPROCFS # Cannot be a module yet. # Bus support. ==== //depot/projects/netsmp/src/sys/amd64/include/_types.h#2 (text+ko) ==== @@ -33,7 +33,7 @@ * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD: src/sys/amd64/include/_types.h,v 1.9 2005/07/02 23:13:30 thompsa Exp $ + * $FreeBSD: src/sys/amd64/include/_types.h,v 1.11 2006/01/09 06:05:56 imp Exp $ */ #ifndef _MACHINE__TYPES_H_ ==== //depot/projects/netsmp/src/sys/amd64/include/param.h#3 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/amd64/include/param.h,v 1.19 2005/12/06 13:27:20 ru Exp $ + * $FreeBSD: src/sys/amd64/include/param.h,v 1.20 2006/01/09 06:05:56 imp Exp $ */ /* @@ -66,6 +66,9 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __HAVE_ACPI +#define __PCI_REROUTE_INTERRUPT + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ ==== //depot/projects/netsmp/src/sys/amd64/pci/pci_bus.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.115 2005/12/20 21:09:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_bus.c,v 1.116 2006/01/06 19:22:18 jhb Exp $"); #include "opt_cpu.h" @@ -326,12 +326,9 @@ { 0, 0 } }; -static driver_t legacy_pcib_driver = { - "pcib", - legacy_pcib_methods, - 1, -}; +static devclass_t pcib_devclass; +DEFINE_CLASS_0(pcib, legacy_pcib_driver, legacy_pcib_methods, 1); DRIVER_MODULE(pcib, legacy, legacy_pcib_driver, pcib_devclass, 0, 0); @@ -377,12 +374,7 @@ { 0, 0 } }; -static driver_t pcibus_pnp_driver = { - "pcibus_pnp", - pcibus_pnp_methods, - 1, /* no softc */ -}; - static devclass_t pcibus_pnp_devclass; +DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1); DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0); ==== //depot/projects/netsmp/src/sys/arm/arm/trap.c#3 (text+ko) ==== @@ -82,7 +82,7 @@ #include "opt_ktrace.h" #include -__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.18 2005/10/14 12:43:44 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/trap.c,v 1.19 2006/01/06 18:02:12 jhb Exp $"); #include @@ -269,7 +269,8 @@ /* Grab the current pcb */ pcb = td->td_pcb; /* Re-enable interrupts if they were enabled previously */ - if (td->td_critnest == 0 && __predict_true(tf->tf_spsr & I32_bit) == 0) + if (td->td_md.md_spinlock_count == 0 && + __predict_true(tf->tf_spsr & I32_bit) == 0) enable_interrupts(I32_bit); /* Invoke the appropriate handler, if necessary */ @@ -729,7 +730,7 @@ thread_user_enter(td); } fault_pc = tf->tf_pc; - if (td->td_critnest == 0 && + if (td->td_md.md_spinlock_count == 0 && __predict_true((tf->tf_spsr & I32_bit) == 0)) enable_interrupts(I32_bit); @@ -1007,7 +1008,7 @@ * Since all syscalls *should* come from user mode it will always * be safe to enable them, but check anyway. */ - if (td->td_critnest == 0 && !(frame->tf_spsr & I32_bit)) + if (td->td_md.md_spinlock_count == 0 && !(frame->tf_spsr & I32_bit)) enable_interrupts(I32_bit); syscall(td, frame, insn); ==== //depot/projects/netsmp/src/sys/arm/include/_types.h#2 (text+ko) ==== @@ -33,7 +33,7 @@ * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD: src/sys/arm/include/_types.h,v 1.6 2005/03/02 21:33:22 joerg Exp $ + * $FreeBSD: src/sys/arm/include/_types.h,v 1.8 2006/01/09 06:05:56 imp Exp $ */ #ifndef _MACHINE__TYPES_H_ ==== //depot/projects/netsmp/src/sys/arm/include/param.h#3 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)param.h 5.8 (Berkeley) 6/28/91 - * $FreeBSD: src/sys/arm/include/param.h,v 1.10 2005/12/06 13:27:20 ru Exp $ + * $FreeBSD: src/sys/arm/include/param.h,v 1.11 2006/01/09 06:05:56 imp Exp $ */ /* @@ -59,6 +59,8 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __PCI_REROUTE_INTERRUPT + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ ==== //depot/projects/netsmp/src/sys/boot/common/module.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/module.c,v 1.25 2003/08/25 23:30:41 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/module.c,v 1.26 2006/01/12 13:18:49 marius Exp $"); /* * file/module function dispatcher, support, etc. @@ -864,7 +864,8 @@ if (mdp->d_hints != NULL || (mdp->d_flags & MDIR_NOHINTS)) return; path = moduledir_fullpath(mdp, "linker.hints"); - if (stat(path, &st) != 0 || st.st_size < (sizeof(version) + sizeof(int)) || + if (stat(path, &st) != 0 || + st.st_size < (ssize_t)(sizeof(version) + sizeof(int)) || st.st_size > 100 * 1024 || (fd = open(path, O_RDONLY)) < 0) { free(path); mdp->d_flags |= MDIR_NOHINTS; ==== //depot/projects/netsmp/src/sys/cam/cam_periph.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.60 2005/07/01 15:21:29 avatar Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.61 2006/01/08 20:04:55 iedowse Exp $"); #include #include @@ -1656,6 +1656,8 @@ case CAM_NO_HBA: case CAM_PROVIDE_FAIL: case CAM_REQ_TOO_BIG: + case CAM_LUN_INVALID: + case CAM_TID_INVALID: error = EINVAL; break; case CAM_SCSI_BUS_RESET: ==== //depot/projects/netsmp/src/sys/cam/cam_xpt.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.156 2005/09/16 01:26:17 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.157 2006/01/11 02:06:08 iedowse Exp $"); #include #include @@ -682,6 +682,18 @@ static struct intr_config_hook *xpt_config_hook; +static void dead_sim_action(struct cam_sim *sim, union ccb *ccb); +static void dead_sim_poll(struct cam_sim *sim); + +/* Dummy SIM that is used when the real one has gone. */ +static struct cam_sim cam_dead_sim = { + .sim_action = dead_sim_action, + .sim_poll = dead_sim_poll, + .sim_name = "dead_sim", +}; + +#define SIM_DEAD(sim) ((sim) == &cam_dead_sim) + /* Registered busses */ static TAILQ_HEAD(,cam_eb) xpt_busses; static u_int bus_generation; @@ -3055,12 +3067,22 @@ case XPT_ENG_EXEC: { struct cam_path *path; + struct cam_sim *sim; int s; int runq; path = start_ccb->ccb_h.path; s = splsoftcam(); + sim = path->bus->sim; + if (SIM_DEAD(sim)) { + /* The SIM has gone; just execute the CCB directly. */ + cam_ccbq_send_ccb(&path->device->ccbq, start_ccb); + (*(sim->sim_action))(sim, start_ccb); + splx(s); + break; + } + cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); if (path->device->qfrozen_cnt == 0) runq = xpt_schedule_dev_sendq(path->bus, path->device); @@ -3641,8 +3663,8 @@ dev->ccbq.devq_openings--; dev->ccbq.dev_openings--; - while((devq->send_openings <= 0 || dev->ccbq.dev_openings < 0) - && (--timeout > 0)) { + while(((devq != NULL && devq->send_openings <= 0) || + dev->ccbq.dev_openings < 0) && (--timeout > 0)) { DELAY(1000); (*(sim->sim_poll))(sim); camisr(&cam_bioq); @@ -3684,6 +3706,7 @@ xpt_schedule(struct cam_periph *perph, u_int32_t new_priority) { struct cam_ed *device; + union ccb *work_ccb; int s; int runq; @@ -3702,6 +3725,16 @@ new_priority); } runq = 0; + } else if (SIM_DEAD(perph->path->bus->sim)) { + /* The SIM is gone so just call periph_start directly. */ + work_ccb = xpt_get_ccb(perph->path->device); + splx(s); + if (work_ccb == NULL) + return; /* XXX */ + xpt_setup_ccb(&work_ccb->ccb_h, perph->path, new_priority); + perph->pinfo.priority = new_priority; + perph->periph_start(perph, work_ccb); + return; } else { /* New entry on the queue */ CAM_DEBUG(perph->path, CAM_DEBUG_SUBTRACE, @@ -4337,6 +4370,10 @@ } else { SLIST_INSERT_HEAD(&ccb_freeq, &free_ccb->ccb_h, xpt_links.sle); } + if (bus->sim->devq == NULL) { + splx(s); + return; + } bus->sim->devq->alloc_openings++; bus->sim->devq->alloc_active--; /* XXX Turn this into an inline function - xpt_run_device?? */ @@ -4422,6 +4459,12 @@ xpt_bus_deregister(path_id_t pathid) { struct cam_path bus_path; + struct cam_ed *device; + struct cam_ed_qinfo *qinfo; + struct cam_devq *devq; + struct cam_periph *periph; + struct cam_sim *ccbsim; + union ccb *work_ccb; cam_status status; GIANT_REQUIRED; @@ -4433,11 +4476,51 @@ xpt_async(AC_LOST_DEVICE, &bus_path, NULL); xpt_async(AC_PATH_DEREGISTERED, &bus_path, NULL); - + + /* The SIM may be gone, so use a dummy SIM for any stray operations. */ + devq = bus_path.bus->sim->devq; + bus_path.bus->sim = &cam_dead_sim; + + /* Execute any pending operations now. */ + while ((qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->send_queue, + CAMQ_HEAD)) != NULL || + (qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->alloc_queue, + CAMQ_HEAD)) != NULL) { + do { + device = qinfo->device; + work_ccb = cam_ccbq_peek_ccb(&device->ccbq, CAMQ_HEAD); + if (work_ccb != NULL) { + devq->active_dev = device; + cam_ccbq_remove_ccb(&device->ccbq, work_ccb); + cam_ccbq_send_ccb(&device->ccbq, work_ccb); + ccbsim = work_ccb->ccb_h.path->bus->sim; + (*(ccbsim->sim_action))(ccbsim, work_ccb); + } + + periph = (struct cam_periph *)camq_remove(&device->drvq, + CAMQ_HEAD); + if (periph != NULL) + xpt_schedule(periph, periph->pinfo.priority); + } while (work_ccb != NULL || periph != NULL); + } + + /* Make sure all completed CCBs are processed. */ + while (!TAILQ_EMPTY(&cam_bioq)) { + camisr(&cam_bioq); + + /* Repeat the async's for the benefit of any new devices. */ + xpt_async(AC_LOST_DEVICE, &bus_path, NULL); + xpt_async(AC_PATH_DEREGISTERED, &bus_path, NULL); + } + /* Release the reference count held while registered. */ xpt_release_bus(bus_path.bus); xpt_release_path(&bus_path); + /* Recheck for more completed CCBs. */ + while (!TAILQ_EMPTY(&cam_bioq)) + camisr(&cam_bioq); + return (CAM_REQ_CMP); } @@ -5021,6 +5104,9 @@ struct cam_devq *devq; cam_status status; + if (SIM_DEAD(bus->sim)) + return (NULL); + /* Make space for us in the device queue on our bus */ devq = bus->sim->devq; status = cam_devq_resize(devq, devq->alloc_queue.array_size + 1); @@ -5131,9 +5217,11 @@ TAILQ_REMOVE(&target->ed_entries, device,links); target->generation++; xpt_max_ccbs -= device->ccbq.devq_openings; - /* Release our slot in the devq */ - devq = bus->sim->devq; - cam_devq_resize(devq, devq->alloc_queue.array_size - 1); + if (!SIM_DEAD(bus->sim)) { + /* Release our slot in the devq */ + devq = bus->sim->devq; + cam_devq_resize(devq, devq->alloc_queue.array_size - 1); + } splx(s); camq_fini(&device->drvq); camq_fini(&device->ccbq.queue); @@ -7096,8 +7184,10 @@ s = splcam(); cam_ccbq_ccb_done(&dev->ccbq, (union ccb *)ccb_h); - ccb_h->path->bus->sim->devq->send_active--; - ccb_h->path->bus->sim->devq->send_openings++; + if (!SIM_DEAD(ccb_h->path->bus->sim)) { + ccb_h->path->bus->sim->devq->send_active--; + ccb_h->path->bus->sim->devq->send_openings++; + } splx(s); if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 @@ -7145,3 +7235,16 @@ } splx(s); } + +static void +dead_sim_action(struct cam_sim *sim, union ccb *ccb) +{ + + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + xpt_done(ccb); +} + +static void +dead_sim_poll(struct cam_sim *sim) +{ +} ==== //depot/projects/netsmp/src/sys/cam/scsi/scsi_da.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.183 2005/12/19 03:43:48 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.184 2006/01/13 11:33:40 mnag Exp $"); #include @@ -363,6 +363,22 @@ {T_DIRECT, SIP_MEDIA_REMOVABLE, "Motorola" , "Motorola Phone", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * Qware BeatZkey! Pro + * PR: usb/79164 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "GENERIC", "USB DISK DEVICE", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Time DPA20B 1GB MP3 Player + * PR: usb/81846 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "USB2.0*", "(FS) FLASH DISK*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; ==== //depot/projects/netsmp/src/sys/cam/scsi/scsi_sa.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.105 2005/07/01 15:21:30 avatar Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.106 2006/01/14 14:32:41 mjacob Exp $"); #include #include @@ -44,6 +44,7 @@ #ifdef _KERNEL #include #endif +#include #include #ifndef _KERNEL @@ -255,8 +256,10 @@ * Misc other flags/state */ u_int32_t - : 31, - ctrl_mode : 1; /* control device open */ + : 29, + open_rdonly : 1, /* open read-only */ + open_pending_mount : 1, /* open pending mount */ + ctrl_mode : 1; /* control device open */ }; struct sa_quirk_entry { @@ -468,23 +471,37 @@ cam_periph_unlock(periph); return (ENXIO); } + if (SA_IS_CTRL(dev)) { softc->ctrl_mode = 1; cam_periph_unlock(periph); return (0); } - if (softc->flags & SA_FLAG_OPEN) { error = EBUSY; } else if (softc->flags & SA_FLAG_INVALID) { error = ENXIO; } else { /* + * Preserve whether this is a read_only open. + */ + softc->open_rdonly = (flags & O_RDWR) == O_RDONLY; + + /* * The function samount ensures media is loaded and ready. * It also does a device RESERVE if the tape isn't yet mounted. + * + * If the mount fails and this was a non-blocking open, + * make this a 'open_pending_mount' action. */ error = samount(periph, flags, dev); + if (error && (flags & O_NONBLOCK)) { + softc->flags |= SA_FLAG_OPEN; + softc->open_pending_mount = 1; + cam_periph_unlock(periph); + return (0); + } } if (error) { @@ -521,6 +538,7 @@ return (error); } + softc->open_rdonly = 0; if (SA_IS_CTRL(dev)) { softc->ctrl_mode = 0; cam_periph_release(periph); @@ -528,6 +546,14 @@ return (0); } + if (softc->open_pending_mount) { + softc->flags &= ~SA_FLAG_OPEN; + softc->open_pending_mount = 0; + cam_periph_release(periph); + cam_periph_unlock(periph); + return (0); + } + /* * Were we writing the tape? */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Jan 15 20:51:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C9A7216A422; Sun, 15 Jan 2006 20:51:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8AE1516A41F for ; Sun, 15 Jan 2006 20:51:04 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42C7943D46 for ; Sun, 15 Jan 2006 20:51:04 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FKp4x7022449 for ; Sun, 15 Jan 2006 20:51:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FKp4PC022446 for perforce@freebsd.org; Sun, 15 Jan 2006 20:51:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 20:51:04 GMT Message-Id: <200601152051.k0FKp4PC022446@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89749 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 20:51:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=89749 Change 89749 by rwatson@rwatson_peppercorn on 2006/01/15 20:50:20 Additional restyling of libbsm.h towards style(9). Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#7 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#7 (text+ko) ==== @@ -157,9 +157,9 @@ } au_tid64_t; typedef struct au_tidaddr32 { - u_int32_t port; - u_int32_t type; - u_int32_t addr[4]; + u_int32_t port; + u_int32_t type; + u_int32_t addr[4]; } au_tidaddr32_t; /* @@ -169,17 +169,17 @@ * text N bytes + 1 terminating NULL byte */ typedef struct { - u_char no; - u_int32_t val; - u_int16_t len; - char *text; + u_char no; + u_int32_t val; + u_int16_t len; + char *text; } au_arg32_t; typedef struct { - u_char no; - u_int64_t val; - u_int16_t len; - char *text; + u_char no; + u_int64_t val; + u_int16_t len; + char *text; } au_arg64_t; /* @@ -189,10 +189,10 @@ * data items (depends on basic unit) */ typedef struct { - u_char howtopr; - u_char bu; - u_char uc; - u_char *data; + u_char howtopr; + u_char bu; + u_char uc; + u_char *data; } au_arb_t; /* @@ -204,21 +204,21 @@ * device 4 bytes/8 bytes (32-bit/64-bit) */ typedef struct { - u_int32_t mode; - u_int32_t uid; - u_int32_t gid; - u_int32_t fsid; - u_int64_t nid; - u_int32_t dev; + u_int32_t mode; + u_int32_t uid; + u_int32_t gid; + u_int32_t fsid; + u_int64_t nid; + u_int32_t dev; } au_attr32_t; typedef struct { - u_int32_t mode; - u_int32_t uid; - u_int32_t gid; - u_int32_t fsid; - u_int64_t nid; - u_int64_t dev; + u_int32_t mode; + u_int32_t uid; + u_int32_t gid; + u_int32_t fsid; + u_int64_t nid; + u_int64_t dev; } au_attr64_t; /* @@ -226,8 +226,8 @@ * text count null-terminated string(s) */ typedef struct { - u_int32_t count; - char *text[MAX_ARGS]; + u_int32_t count; + char *text[MAX_ARGS]; } au_execarg_t; /* @@ -235,8 +235,8 @@ * text count null-terminated string(s) */ typedef struct { - u_int32_t count; - char *text[MAX_ENV]; + u_int32_t count; + char *text[MAX_ENV]; } au_execenv_t; /* @@ -244,8 +244,8 @@ * return value 4 bytes */ typedef struct { - u_int32_t status; - u_int32_t ret; + u_int32_t status; + u_int32_t ret; } au_exit_t; /* @@ -255,10 +255,10 @@ * file pathname N bytes + 1 terminating NULL byte */ typedef struct { - u_int32_t s; - u_int32_t ms; - u_int16_t len; - char *name; + u_int32_t s; + u_int32_t ms; + u_int16_t len; + char *name; } au_file_t; @@ -267,8 +267,8 @@ * group list N * 4 bytes */ typedef struct { - u_int16_t no; - u_int32_t list[BSM_MAX_GROUPS]; + u_int16_t no; + u_int32_t list[BSM_MAX_GROUPS]; } au_groups_t; /* @@ -280,12 +280,12 @@ * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value) */ typedef struct { - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int32_t s; - u_int32_t ms; + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int32_t s; + u_int32_t ms; } au_header32_t; /* @@ -299,41 +299,41 @@ * nanoseconds of time 4 bytes/8 bytes (32/64-bits) */ typedef struct { - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int32_t ad_type; - u_int32_t addr[4]; - u_int32_t s; - u_int32_t ms; + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int32_t ad_type; + u_int32_t addr[4]; + u_int32_t s; + u_int32_t ms; } au_header32_ex_t; typedef struct { - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int64_t s; - u_int64_t ms; + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int64_t s; + u_int64_t ms; } au_header64_t; typedef struct { - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int32_t ad_type; - u_int32_t addr[4]; - u_int64_t s; - u_int64_t ms; + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int32_t ad_type; + u_int32_t addr[4]; + u_int64_t s; + u_int64_t ms; } au_header64_ex_t; /* * internet address 4 bytes */ typedef struct { - u_int32_t addr; + u_int32_t addr; } au_inaddr_t; /* @@ -341,8 +341,8 @@ * internet address 16 bytes */ typedef struct { - u_int32_t type; - u_int32_t addr[4]; + u_int32_t type; + u_int32_t addr[4]; } au_inaddr_ex_t; /* @@ -358,16 +358,16 @@ * destination address 4 bytes */ typedef struct { - u_char version; - u_char tos; - u_int16_t len; - u_int16_t id; - u_int16_t offset; - u_char ttl; - u_char prot; - u_int16_t chksm; - u_int32_t src; - u_int32_t dest; + u_char version; + u_char tos; + u_int16_t len; + u_int16_t id; + u_int16_t offset; + u_char ttl; + u_char prot; + u_int16_t chksm; + u_int32_t src; + u_int32_t dest; } au_ip_t; /* @@ -375,8 +375,8 @@ * object ID 4 bytes */ typedef struct { - u_char type; - u_int32_t id; + u_char type; + u_int32_t id; } au_ipc_t; /* @@ -389,20 +389,20 @@ * key 4 bytes */ typedef struct { - u_int32_t uid; - u_int32_t gid; - u_int32_t puid; - u_int32_t pgid; - u_int32_t mode; - u_int32_t seq; - u_int32_t key; + u_int32_t uid; + u_int32_t gid; + u_int32_t puid; + u_int32_t pgid; + u_int32_t mode; + u_int32_t seq; + u_int32_t key; } au_ipcperm_t; /* * port IP address 2 bytes */ typedef struct { - u_int16_t port; + u_int16_t port; } au_iport_t; /* @@ -410,8 +410,8 @@ * data length bytes */ typedef struct { - u_int16_t size; - char *data; + u_int16_t size; + char *data; } au_opaque_t; /* @@ -419,8 +419,8 @@ * path N bytes + 1 terminating NULL byte */ typedef struct { - u_int16_t len; - char *path; + u_int16_t len; + char *path; } au_path_t; /* @@ -436,25 +436,25 @@ * machine address 4 bytes */ typedef struct { - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid32_t tid; + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid32_t tid; } au_proc32_t; typedef struct { - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid64_t tid; + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid64_t tid; } au_proc64_t; /* @@ -471,14 +471,14 @@ * machine address 16 bytes */ typedef struct { - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tidaddr32_t tid; + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tidaddr32_t tid; } au_proc32ex_t; /* @@ -486,20 +486,20 @@ * return value 4 bytes/8 bytes (32-bit/64-bit value) */ typedef struct { - u_char status; - u_int32_t ret; + u_char status; + u_int32_t ret; } au_ret32_t; typedef struct { - u_char err; - u_int64_t val; + u_char err; + u_int64_t val; } au_ret64_t; /* * sequence number 4 bytes */ typedef struct { - u_int32_t seqno; + u_int32_t seqno; } au_seq_t; /* @@ -510,11 +510,11 @@ * remote Internet address 4 bytes */ typedef struct { - u_int16_t type; - u_int16_t l_port; - u_int32_t l_addr; - u_int16_t r_port; - u_int32_t r_addr; + u_int16_t type; + u_int16_t l_port; + u_int32_t l_addr; + u_int16_t r_port; + u_int32_t r_addr; } au_socket_t; /* @@ -527,13 +527,13 @@ * remote Internet address 4 bytes/16 bytes (IPv4/IPv6 address) */ typedef struct { - u_int16_t type; - u_int16_t l_port; - u_int32_t l_ad_type; - u_int32_t l_addr; - u_int32_t r_port; - u_int32_t r_ad_type; - u_int32_t r_addr; + u_int16_t type; + u_int16_t l_port; + u_int32_t l_ad_type; + u_int32_t l_addr; + u_int32_t r_port; + u_int32_t r_ad_type; + u_int32_t r_addr; } au_socket_ex32_t; /* @@ -542,9 +542,9 @@ * socket address 4 bytes/16 bytes (IPv4/IPv6 address) */ typedef struct { - u_int16_t family; - u_int16_t port; - u_int32_t addr; + u_int16_t family; + u_int16_t port; + u_int32_t addr; } au_socketinet32_t; /* @@ -552,8 +552,8 @@ * path 104 bytes */ typedef struct { - u_int16_t family; - char path[104]; + u_int16_t family; + char path[104]; } au_socketunix_t; /* @@ -569,25 +569,25 @@ * machine address 4 bytes */ typedef struct { - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid32_t tid; + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid32_t tid; } au_subject32_t; typedef struct { - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid64_t tid; + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid64_t tid; } au_subject64_t; /* @@ -604,14 +604,14 @@ * machine address 16 bytes */ typedef struct { - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tidaddr32_t tid; + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tidaddr32_t tid; } au_subject32ex_t; /* @@ -619,21 +619,21 @@ * text N bytes + 1 terminating NULL byte */ typedef struct { - u_int16_t len; - char *text; + u_int16_t len; + char *text; } au_text_t; typedef struct { - u_int32_t ident; - u_int16_t filter; - u_int16_t flags; - u_int32_t fflags; - u_int32_t data; + u_int32_t ident; + u_int16_t filter; + u_int16_t flags; + u_int32_t fflags; + u_int32_t data; } au_kevent_t; typedef struct { - u_int16_t length; - char *data; + u_int16_t length; + char *data; } au_invalid_t; /* @@ -641,14 +641,14 @@ * record byte count 4 bytes */ typedef struct { - u_int16_t magic; - u_int32_t count; + u_int16_t magic; + u_int32_t count; } au_trailer_t; struct tokenstr { - u_char id; - u_char *data; - size_t len; + u_char id; + u_char *data; + size_t len; union { au_arg32_t arg32; au_arg64_t arg64; @@ -697,59 +697,61 @@ /* * Functions relating to querying audit event information. */ -void setauevent(void); -void endauevent(void); -struct au_event_ent *getauevent(void); -struct au_event_ent *getauevnam(char *name); -struct au_event_ent *getauevnum(au_event_t event_number); -void free_au_event_ent(struct au_event_ent *e); -au_event_t *getauevnonam(char *event_name); -void free_au_event(au_event_t *e); +void setauevent(void); +void endauevent(void); +struct au_event_ent *getauevent(void); +struct au_event_ent *getauevnam(char *name); +struct au_event_ent *getauevnum(au_event_t event_number); +void free_au_event_ent(struct au_event_ent *e); +au_event_t *getauevnonam(char *event_name); +void free_au_event(au_event_t *e); /* * Functions relating to querying audit class information. */ -void setauclass(void); -void endauclass(void); -struct au_class_ent *getauclassent(void); -struct au_class_ent *getauclassnam(const char *name); -struct au_class_ent *getauclassnum(au_class_t class_number); -void free_au_class_ent(struct au_class_ent *c); +void setauclass(void); +void endauclass(void); +struct au_class_ent *getauclassent(void); +struct au_class_ent *getauclassnam(const char *name); +struct au_class_ent *getauclassnum(au_class_t class_number); +void free_au_class_ent(struct au_class_ent *c); /* * Functions relating to querying audit control information. */ -void setac(void); -void endac(void); -int getacdir(char *name, int len); -int getacmin(int *min_val); -int getacflg(char *auditstr, int len); -int getacna(char *auditstr, int len); +void setac(void); +void endac(void); +int getacdir(char *name, int len); +int getacmin(int *min_val); +int getacflg(char *auditstr, int len); +int getacna(char *auditstr, int len); -int getauditflagsbin(char *auditstr, au_mask_t *masks); -int getauditflagschar(char *auditstr, au_mask_t *masks, int verbose); +int getauditflagsbin(char *auditstr, au_mask_t *masks); +int getauditflagschar(char *auditstr, au_mask_t *masks, + int verbose); int au_preselect(au_event_t event, au_mask_t *mask_p, int sorf, int flag); /* * Functions relating to querying audit user information. */ -void setauuser(void); -void endauuser(void); -struct au_user_ent *getauuserent(void); -struct au_user_ent *getauusernam(const char *name); -int au_user_mask(char *username, au_mask_t *mask_p); -int getfauditflags(au_mask_t *usremask, au_mask_t *usrdmask, - au_mask_t *lastmask); -void free_au_user_ent(struct au_user_ent *u); +void setauuser(void); +void endauuser(void); +struct au_user_ent *getauuserent(void); +struct au_user_ent *getauusernam(const char *name); +int au_user_mask(char *username, au_mask_t *mask_p); +int getfauditflags(au_mask_t *usremask, + au_mask_t *usrdmask, au_mask_t *lastmask); +void free_au_user_ent(struct au_user_ent *u); /* * Functions for reading and printing records and tokens from audit trails. */ -int au_read_rec(FILE *fp, u_char **buf); -int au_fetch_tok(tokenstr_t *tok, u_char *buf, int len); +int au_read_rec(FILE *fp, u_char **buf); +int au_fetch_tok(tokenstr_t *tok, u_char *buf, int len); //XXX The following interface has different prototype from BSM -void au_print_tok(FILE *outfp, tokenstr_t *tok, char *del, char raw, char sfrm); +void au_print_tok(FILE *outfp, tokenstr_t *tok, + char *del, char raw, char sfrm); __END_DECLS #ifdef __APPLE__ @@ -764,7 +766,7 @@ **************************************************************************/ #ifdef __APPLE_API_PRIVATE -#define __BSM_INTERNAL_NOTIFY_KEY "com.apple.audit.change" +#define __BSM_INTERNAL_NOTIFY_KEY "com.apple.audit.change" #endif /* __APPLE_API_PRIVATE */ /* @@ -784,22 +786,20 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -enum -{ - kAUNoErr = 0, - kAUBadParamErr = -66049, +enum { + kAUNoErr = 0, + kAUBadParamErr = -66049, kAUStatErr, kAUSysctlErr, - kAUOpenErr, - kAUMakeSubjectTokErr, - kAUWriteSubjectTokErr, - kAUWriteCallerTokErr, - kAUMakeReturnTokErr, - kAUWriteReturnTokErr, - kAUCloseErr, - kAUMakeTextTokErr, - - kAULastErr + kAUOpenErr, + kAUMakeSubjectTokErr, + kAUWriteSubjectTokErr, + kAUWriteCallerTokErr, + kAUMakeReturnTokErr, + kAUWriteReturnTokErr, + kAUCloseErr, + kAUMakeTextTokErr, + kAULastErr }; #ifdef __APPLE__ @@ -817,7 +817,6 @@ #endif /* __APPLE_API_PRIVATE */ #endif /* !__APPLE__ */ - __BEGIN_DECLS /* * XXX This prototype should be in audit_record.h @@ -840,7 +839,7 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -void au_free_token(token_t *tok); +void au_free_token(token_t *tok); /* * Lightweight check to determine if auditing is enabled. If a client @@ -856,11 +855,11 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int au_get_state(void); +int au_get_state(void); __END_DECLS /* OpenSSH compatibility */ -#define cannot_audit(x) (!(au_get_state() == AUC_AUDITING)) +#define cannot_audit(x) (!(au_get_state() == AUC_AUDITING)) __BEGIN_DECLS /* @@ -877,7 +876,7 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_set_terminal_id(au_tid_t *tid); +int audit_set_terminal_id(au_tid_t *tid); /* * BEGIN au_write() WRAPPERS @@ -932,8 +931,8 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_write(short event_code, token_t *subject, token_t *misctok, char - retval, int errcode); +int audit_write(short event_code, token_t *subject, token_t *misctok, + char retval, int errcode); /* * audit_write_success() @@ -976,9 +975,9 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_write_success(short event_code, token_t *misctok, au_id_t auid, - uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, - pid_t pid, au_asid_t sid, au_tid_t *tid); +int audit_write_success(short event_code, token_t *misctok, au_id_t auid, + uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, + au_asid_t sid, au_tid_t *tid); /* * audit_write_success_self() @@ -999,7 +998,7 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_write_success_self(short event_code, token_t *misctok); +int audit_write_success_self(short event_code, token_t *misctok); /* * audit_write_failure() @@ -1045,10 +1044,9 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_write_failure(short event_code, char *errmsg, int errret, - au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, - gid_t rgid, pid_t pid, au_asid_t sid, - au_tid_t *tid); +int audit_write_failure(short event_code, char *errmsg, int errret, + au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, + pid_t pid, au_asid_t sid, au_tid_t *tid); /* * audit_write_failure_self() @@ -1072,7 +1070,7 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_write_failure_self(short event_code, char *errmsg, int errret); +int audit_write_failure_self(short event_code, char *errmsg, int errret); /* * audit_write_failure_na() @@ -1104,12 +1102,11 @@ * * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ -int audit_write_failure_na(short event_code, char *errmsg, int errret, - uid_t euid, gid_t egid, pid_t pid, au_tid_t *tid); +int audit_write_failure_na(short event_code, char *errmsg, int errret, + uid_t euid, gid_t egid, pid_t pid, au_tid_t *tid); /* END au_write() WRAPPERS */ - #ifdef __APPLE__ /* * audit_token_to_au32() @@ -1150,15 +1147,15 @@ * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE. */ void audit_token_to_au32( - audit_token_t atoken, - uid_t *auidp, - uid_t *euidp, - gid_t *egidp, - uid_t *ruidp, - gid_t *rgidp, - pid_t *pidp, - au_asid_t *asidp, - au_tid_t *tidp); + audit_token_t atoken, + uid_t *auidp, + uid_t *euidp, + gid_t *egidp, + uid_t *ruidp, + gid_t *rgidp, + pid_t *pidp, + au_asid_t *asidp, + au_tid_t *tidp); #endif /* !__APPLE__ */ __END_DECLS From owner-p4-projects@FreeBSD.ORG Sun Jan 15 20:57:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CBF8C16A422; Sun, 15 Jan 2006 20:57:12 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A488916A41F for ; Sun, 15 Jan 2006 20:57:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B56443D4C for ; Sun, 15 Jan 2006 20:57:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FKvCXa022666 for ; Sun, 15 Jan 2006 20:57:12 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FKvBMc022663 for perforce@freebsd.org; Sun, 15 Jan 2006 20:57:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 20:57:11 GMT Message-Id: <200601152057.k0FKvBMc022663@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89750 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 20:57:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=89750 Change 89750 by rwatson@rwatson_peppercorn on 2006/01/15 20:56:24 Sort function sets by category alphabetically. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#8 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#8 (text+ko) ==== @@ -695,18 +695,6 @@ typedef struct tokenstr tokenstr_t; /* - * Functions relating to querying audit event information. - */ -void setauevent(void); -void endauevent(void); -struct au_event_ent *getauevent(void); -struct au_event_ent *getauevnam(char *name); -struct au_event_ent *getauevnum(au_event_t event_number); -void free_au_event_ent(struct au_event_ent *e); -au_event_t *getauevnonam(char *event_name); -void free_au_event(au_event_t *e); - -/* * Functions relating to querying audit class information. */ void setauclass(void); @@ -725,12 +713,24 @@ int getacmin(int *min_val); int getacflg(char *auditstr, int len); int getacna(char *auditstr, int len); - int getauditflagsbin(char *auditstr, au_mask_t *masks); int getauditflagschar(char *auditstr, au_mask_t *masks, int verbose); +int au_preselect(au_event_t event, au_mask_t *mask_p, + int sorf, int flag); + +/* + * Functions relating to querying audit event information. + */ +void setauevent(void); +void endauevent(void); +struct au_event_ent *getauevent(void); +struct au_event_ent *getauevnam(char *name); +struct au_event_ent *getauevnum(au_event_t event_number); +void free_au_event_ent(struct au_event_ent *e); +au_event_t *getauevnonam(char *event_name); +void free_au_event(au_event_t *e); -int au_preselect(au_event_t event, au_mask_t *mask_p, int sorf, int flag); /* * Functions relating to querying audit user information. From owner-p4-projects@FreeBSD.ORG Sun Jan 15 21:43:10 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8F8EC16A422; Sun, 15 Jan 2006 21:43:09 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 639B016A41F for ; Sun, 15 Jan 2006 21:43:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1285343D46 for ; Sun, 15 Jan 2006 21:43:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FLh8U7024378 for ; Sun, 15 Jan 2006 21:43:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FLh8Bi024375 for perforce@freebsd.org; Sun, 15 Jan 2006 21:43:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 21:43:08 GMT Message-Id: <200601152143.k0FLh8Bi024375@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89753 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 21:43:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=89753 Change 89753 by rwatson@rwatson_fledge on 2006/01/15 21:42:47 Darwin requires stdint.h for new POSIX types. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#9 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#9 (text+ko) ==== @@ -45,6 +45,7 @@ #include #include +#include #ifdef __APPLE__ #include /* audit_token_t */ From owner-p4-projects@FreeBSD.ORG Sun Jan 15 21:45:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7ABD416A422; Sun, 15 Jan 2006 21:45:12 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54C5316A41F for ; Sun, 15 Jan 2006 21:45:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 041FA43D46 for ; Sun, 15 Jan 2006 21:45:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FLjBtV024564 for ; Sun, 15 Jan 2006 21:45:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FLjBY7024561 for perforce@freebsd.org; Sun, 15 Jan 2006 21:45:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 21:45:11 GMT Message-Id: <200601152145.k0FLjBY7024561@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89754 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 21:45:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=89754 Change 89754 by rwatson@rwatson_fledge on 2006/01/15 21:44:27 Move audit_event_map from libbsm.h to bsm_mask.h as it is a private data structure used to maintain a cache of audit events, not part of the public API. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#10 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_mask.c#7 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#10 (text+ko) ==== @@ -133,10 +133,6 @@ } while(0) __BEGIN_DECLS -struct audit_event_map { - struct au_event_ent *ev; - LIST_ENTRY(audit_event_map) ev_list; -}; /* * Internal representation of audit user in libnsl. ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_mask.c#7 (text+ko) ==== @@ -46,6 +46,10 @@ * XXXRW: Note that despite (mutex), load_event_table() could race with * other consumers of the getauevents() API. */ +struct audit_event_map { + struct au_event_ent *ev; + LIST_ENTRY(audit_event_map) ev_list; +}; static LIST_HEAD(, audit_event_map) ev_cache; static int From owner-p4-projects@FreeBSD.ORG Sun Jan 15 23:05:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A3BB116A422; Sun, 15 Jan 2006 23:05:56 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 595DB16A41F for ; Sun, 15 Jan 2006 23:05:56 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFC7543D6D for ; Sun, 15 Jan 2006 23:05:49 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FN5nae027999 for ; Sun, 15 Jan 2006 23:05:49 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FN5nsG027996 for perforce@freebsd.org; Sun, 15 Jan 2006 23:05:49 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 23:05:49 GMT Message-Id: <200601152305.k0FN5nsG027996@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89756 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 23:05:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=89756 Change 89756 by rwatson@rwatson_peppercorn on 2006/01/15 23:05:33 Substantially modify the memory management semantics of libbsm: rather than allocating au_*_ent structures using malloc, instead rely on the caller to allocate them for _r() functions, or return statically allocated memory for non-_r() versions. This brings libbsm in line with other base system database APIs, as well as the Open Solaris BSM API. Not all documentation is completely updated yet, as references to array lengths and memory allocation need to be completed. audump is updated to offer options to use both _r and non-_r variants to dump various audit databases. While here, fix a moderate number of bugs, improve consistency between databases, etc. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#11 edit .. //depot/projects/trustedbsd/openbsm/libbsm/au_class.3#2 edit .. //depot/projects/trustedbsd/openbsm/libbsm/au_event.3#2 edit .. //depot/projects/trustedbsd/openbsm/libbsm/au_user.3#2 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#7 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#9 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#6 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#8 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#19 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_mask.c#8 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_user.c#9 edit .. //depot/projects/trustedbsd/openbsm/libbsm/libbsm.3#2 edit .. //depot/projects/trustedbsd/openbsm/tools/audump.c#2 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#11 (text+ko) ==== @@ -697,9 +697,13 @@ void setauclass(void); void endauclass(void); struct au_class_ent *getauclassent(void); +struct au_class_ent *getauclassent_r(au_class_ent_t *class_int); struct au_class_ent *getauclassnam(const char *name); +struct au_class_ent *getauclassnam_r(au_class_ent_t *class_int, + const char *name); struct au_class_ent *getauclassnum(au_class_t class_number); -void free_au_class_ent(struct au_class_ent *c); +struct au_class_ent *getauclassnum_r(au_class_ent_t *class_int, + au_class_t class_number); /* * Functions relating to querying audit control information. @@ -713,33 +717,41 @@ int getauditflagsbin(char *auditstr, au_mask_t *masks); int getauditflagschar(char *auditstr, au_mask_t *masks, int verbose); -int au_preselect(au_event_t event, au_mask_t *mask_p, +int au_preselect(au_event_t event, au_mask_t *mask_p, int sorf, int flag); /* * Functions relating to querying audit event information. + * + * XXXRW: getauevnonam() has no _r version? */ void setauevent(void); void endauevent(void); struct au_event_ent *getauevent(void); -struct au_event_ent *getauevnam(char *name); +struct au_event_ent *getauevent_r(struct au_event_ent *e); +struct au_event_ent *getauevnam(const char *name); +struct au_event_ent *getauevnam_r(struct au_event_ent *e, + const char *name); struct au_event_ent *getauevnum(au_event_t event_number); -void free_au_event_ent(struct au_event_ent *e); -au_event_t *getauevnonam(char *event_name); -void free_au_event(au_event_t *e); +struct au_event_ent *getauevnum_r(struct au_event_ent *e, + au_event_t event_number); +au_event_t *getauevnonam(const char *event_name); +au_event_t *getauevnonam_r(au_event_t *ev, + const char *event_name); - /* * Functions relating to querying audit user information. */ void setauuser(void); void endauuser(void); struct au_user_ent *getauuserent(void); +struct au_user_ent *getauuserent_r(struct au_user_ent *u); struct au_user_ent *getauusernam(const char *name); +struct au_user_ent *getauusernam_r(struct au_user_ent *u, + const char *name); int au_user_mask(char *username, au_mask_t *mask_p); int getfauditflags(au_mask_t *usremask, au_mask_t *usrdmask, au_mask_t *lastmask); -void free_au_user_ent(struct au_user_ent *u); /* * Functions for reading and printing records and tokens from audit trails. ==== //depot/projects/trustedbsd/openbsm/libbsm/au_class.3#2 (text+ko) ==== @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2005 Robert N. M. Watson +.\" Copyright (c) 2005-2006 Robert N. M. Watson .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -29,9 +29,10 @@ .Dt AU_CLASS 3 .Os .Sh NAME -.Nm free_au_class_ent , .Nm getauclassent , +.Nm getauclassent_r , .Nm getauclassnam , +.Nm getauclassnam_r , .Nm setauclass , .Nm endauclass .Nd "Look up information from the audit_class database" @@ -39,12 +40,14 @@ .Lb libbsm .Sh SYNOPSIS .In libbsm.h -.Ft void -.Fn free_au_class_ent "struct au_class_ent *c" .Ft struct au_class_ent * .Fn getauclassent "void" .Ft struct au_class_ent * +.Fn getauclassent_r "struct au_class_ent *e" +.Ft struct au_class_ent * .Fn getauclassnam "const char *name" +.Ft struct au_class_ent * +.Fn getauclassnam_r "struct au_class_ent *e" "const char *name" .Ft void .Fn setauclass "void" .Ft void @@ -56,31 +59,16 @@ Audit event classes are described by .Vt struct au_class_ent . .Pp -.Fn free_au_class_ent -frees a previously allocated -.Vt struct au_class_ent -returned by -.Fn getauclassent -or -.Fn getauclassnam . .Pp .Fn getauclassent will return the next class found in the .Xr audit_class 5 database, or the first if the function has not yet been called. -The returned -.Vt struct au_class_ent -must be freed by calling -.Fn free_au_class_ent . .Dv NULL will be returned if no further records are available. .Pp .Fn getauclassnam looks up a class by name. -The returned -.Vt struct au_class_ent -must be freed by calling -.Fn free_au_class_ent . .Dv NULL will be returned if no matching class can be found. .Pp ==== //depot/projects/trustedbsd/openbsm/libbsm/au_event.3#2 (text+ko) ==== @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2005 Robert N. M. Watson +.\" Copyright (c) 2005-2006 Robert N. M. Watson .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -30,34 +30,41 @@ .Os .Sh NAME .Nm free_au_event_ent , -.Nm setauevent , -.Nm endauevent , +.Nm setauevent , +.Nm endauevent , .Nm getauevent , +.Nm getauevent_r , .Nm getauevnam , +.Nm getauevnam_r , .Nm getauevnum , +.Nm getauevnum_r , .Nm getauevnonam , -.Nm free_au_event +.Nm getauevnonam_r , .Nd "Look up information from the audit_event database" .Sh LIBRARY .Lb libbsm .Sh SYNOPSIS .In libbsm.h .Ft void -.Fn free_au_event_ent "struct au_event_ent *e" -.Ft void .Fn setauevent "void" .Ft void .Fn endauevent "void" .Ft "struct au_event_ent *" .Fn getauevent "void" .Ft "struct au_event_ent *" +.Fn getauevent_r "struct au_event_ent *e" +.Ft "struct au_event_ent *" .Fn getauevnam "char *name" .Ft "struct au_event_ent *" +.Fn getauevnam_r "struct au_event_ent *e" "char *name" +.Ft "struct au_event_ent *" .Fn getauevnum "au_event_t event_number" +.Ft "struct au_event_ent *" +.Fn getauevnum_r "struct au_event_ent *e" "au_event_t event_number" .Ft "au_event_t *" .Fn getauevnonam "char *event_name" -.Ft void -.Fn free_au_event "au_event_t *e" +.Ft "au_event_t *" +.Fn getauevnonam_r "au_event_t *ev" "char *event_name" .Sh DESCRIPTION These interfaces may be used to look up information from the .Xr audit_event 5 @@ -69,21 +76,9 @@ .Fn getauevnam , or .Fn getauevnum . -They must be freed with a call to -.Fn free_au_event_ent . It is also possible look up an event number via a call to -.Nm getauevnonam , -which must be freed with a call to -.Fn free_au_event . +.Nm getauevnonam . .Pp -.Fn free_au_event_ent -frees an audit event description structure that has been allocated by an -earlier call to -.Fn getauevent , -.Fn getauevnam , -or -.Fn getauevnum . -.Pp .Fn setauevent resets the database access session for .Xr audit_event 5 , @@ -99,39 +94,32 @@ .Fn getauevent returns a reference to the next entry in the .Xr audit_event 5 -database, which much be freed with a call to -.Fn free_au_event_ent . +database. .Pp .Fn getauevnam returns a reference to the entry in the .Xr audit_event 5 database with a name of -.Va name , -which must be freed with a call to -.Fn free_au_event_ent . +.Va name . .Pp .Fn getauevnum returns a reference to the entry in the .Xr audit_event 5 database with an event number of -.Va event_number , -which must be freed with a call to -.Fn free_au_event_ent . +.Va event_number . .Pp .Fn getauevnonam returns a reference to an audit event number using the .Xr audit_event 5 -database, which must be freed with a call to -.Fn free_au_event . -.Pp -.Fn free_au_event -frees a reference to an audit event number that was allocated by -.Fn getauevnonam . +database. .Sh RETURN VALUES Functions .Fn getauevent , +.Fn getauevent_r , .Fn getauevnam , +.Fn getauevnam_r , .Fn getauevnum , +.Fn getauevnum_r , and .Fn getauevnuam will return a reference to a ==== //depot/projects/trustedbsd/openbsm/libbsm/au_user.3#2 (text+ko) ==== @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2005 Robert N. M. Watson +.\" Copyright (c) 2005-2006 Robert N. M. Watson .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -29,11 +29,12 @@ .Dt AU_USER 3 .Os .Sh NAME -.Nm free_au_user_ent , .Nm setauuser , .Nm endauuser , .Nm getauuserent , +.Nm getauuserent_r , .Nm getauusernam , +.Nm getauusernam_r , .Nm au_user_mask , .Nm getfauditflags .Nd "Look up information from the audit_user database" @@ -42,15 +43,17 @@ .Sh SYNOPSIS .In libbsm.h .Ft void -.Fn free_au_user_ent "au_user_ent_t *u" -.Ft void .Fn setauuser "void" .Ft void .Fn endauuser "void" -.Ft au_user_ent_t * +.Ft struct au_user_ent * .Fn getauuserent "void" -.Ft au_user_ent_t * +.Ft struct au_user_ent * +.Fn getauuserent_r "struct au_user_ent *u" "void" +.Ft struct au_user_ent * .Fn getauusernam "const char *name" +.Ft struct au_user_ent * +.Fn getauusernam_r "struct au_user_ent *u" "const char *name" .Ft int .Fn au_user_mask "char *username" "au_mask_t *mask_p" .Ft int @@ -67,31 +70,16 @@ .Dv au_always , and events never to audit .Dv au_never . -.Vt au_user_ent -structures allocated by calls to -.Fn getauuserent -and -.Fn getauusernam -may be freed by calling -.Fn free_au_user_ent . .Pp .Fn getauuserent return the next user found in the .Xr audit_user 5 database, or the first if the function has not yet been called. -The returned -.Vt au_user_ent_t -may be freed by calling -.Fn free_au_user_ent . .Dv NULL will be returned if no further records are available. .Pp .Fn getauusernam looks up a user by name. -The returned -.Vt au_user_ent_t -must be freed by calling -.Fn free_au_user_ent . .Dv NULL will be returned if no matching class can be found. .Pp ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#7 (text+ko) ==== @@ -1,5 +1,7 @@ /* - * Copyright (c) 2004, Apple Computer, Inc. All rights reserved. + * Copyright (c) 2004, Apple Computer, Inc. + * Copyright (c) 2006 Robert N. M. Watson + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,56 +46,6 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* - * XXX The reentrant versions of the following functions is TBD - * XXX struct au_class_ent *getclassent_r(au_class_ent_t *class_int); - * XXX struct au_class_ent *getclassnam_r(au_class_ent_t *class_int, const - * char *name); - */ - -/* - * Allocate a au_class_ent structure. - */ -static struct au_class_ent * -get_class_area(void) -{ - struct au_class_ent *c; - - c = malloc(sizeof(struct au_class_ent)); - if (c == NULL) - return (NULL); - c->ac_name = malloc(AU_CLASS_NAME_MAX * sizeof(char)); - if (c->ac_name == NULL) { - free(c); - return (NULL); - } - c->ac_desc = malloc(AU_CLASS_DESC_MAX * sizeof(char)); - if (c->ac_desc == NULL) { - free(c->ac_name); - free(c); - return (NULL); - } - - return (c); -} - - -/* - * Free the au_class_ent structure. - */ -void -free_au_class_ent(struct au_class_ent *c) -{ - - if (c) { - if (c->ac_name) - free(c->ac_name); - if (c->ac_desc) - free(c->ac_desc); - free(c); - } -} - -/* * Parse a single line from the audit_class file passed in str to the struct * au_class_ent elements; store the result in c. */ @@ -137,9 +89,8 @@ * Must be called with mutex held. */ static struct au_class_ent * -getauclassent_locked(void) +getauclassent_r_locked(struct au_class_ent *c) { - struct au_class_ent *c; char *tokptr, *nl; if ((fp == NULL) && ((fp = fopen(AUDIT_CLASS_FILE, "r")) == NULL)) @@ -161,28 +112,41 @@ tokptr = linestr; - c = get_class_area(); /* allocate */ - if (c == NULL) - return (NULL); - /* Parse tokptr to au_class_ent components. */ - if (classfromstr(tokptr, delim, c) == NULL) { - free_au_class_ent(c); + if (classfromstr(tokptr, delim, c) == NULL) return (NULL); - } return (c); } struct au_class_ent * +getauclassent_r(struct au_class_ent *c) +{ + struct au_class_ent *cp; + + pthread_mutex_lock(&mutex); + cp = getauclassent_r_locked(c); + pthread_mutex_unlock(&mutex); + return (cp); +} + +struct au_class_ent * getauclassent(void) { - struct au_class_ent *c; + static char class_ent_name[AU_CLASS_NAME_MAX]; + static char class_ent_desc[AU_CLASS_DESC_MAX]; + static struct au_class_ent c, *cp; + + bzero(&c, sizeof(c)); + bzero(class_ent_name, sizeof(class_ent_name)); + bzero(class_ent_desc, sizeof(class_ent_desc)); + c.ac_name = class_ent_name; + c.ac_desc = class_ent_desc; pthread_mutex_lock(&mutex); - c = getauclassent_locked(); + cp = getauclassent_r_locked(&c); pthread_mutex_unlock(&mutex); - return (c); + return (cp); } /* @@ -210,52 +174,84 @@ /* * Return the next au_class_entry having the given class name. */ -au_class_ent_t * -getauclassnam(const char *name) +struct au_class_ent * +getauclassnam_r(struct au_class_ent *c, const char *name) { - struct au_class_ent *c; + struct au_class_ent *cp; if (name == NULL) return (NULL); pthread_mutex_lock(&mutex); setauclass_locked(); - while ((c = getauclassent()) != NULL) { - if (strcmp(name, c->ac_name) == 0) { + while ((cp = getauclassent_r_locked(c)) != NULL) { + if (strcmp(name, cp->ac_name) == 0) { pthread_mutex_unlock(&mutex); - return (c); + return (cp); } - free_au_class_ent(c); } pthread_mutex_unlock(&mutex); return (NULL); } +struct au_class_ent * +getauclassnam(const char *name) +{ + static char class_ent_name[AU_CLASS_NAME_MAX]; + static char class_ent_desc[AU_CLASS_DESC_MAX]; + static struct au_class_ent c; + + bzero(&c, sizeof(c)); + bzero(class_ent_name, sizeof(class_ent_name)); + bzero(class_ent_desc, sizeof(class_ent_desc)); + c.ac_name = class_ent_name; + c.ac_desc = class_ent_desc; + + return (getauclassnam_r(&c, name)); +} + + /* * Return the next au_class_entry having the given class number. * * OpenBSM extension. */ -au_class_ent_t * -getauclassnum(au_class_t class_number) +struct au_class_ent * +getauclassnum_r(struct au_class_ent *c, au_class_t class_number) { - au_class_ent_t *c; + struct au_class_ent *cp; pthread_mutex_lock(&mutex); setauclass_locked(); - while ((c = getauclassent()) != NULL) { - if (class_number == c->ac_class) - return (c); - free_au_class_ent(c); + while ((cp = getauclassent_r_locked(c)) != NULL) { + if (class_number == cp->ac_class) + return (cp); } pthread_mutex_unlock(&mutex); return (NULL); } +struct au_class_ent * +getauclassnum(au_class_t class_number) +{ + static char class_ent_name[AU_CLASS_NAME_MAX]; + static char class_ent_desc[AU_CLASS_DESC_MAX]; + static struct au_class_ent c; + + bzero(&c, sizeof(c)); + bzero(class_ent_name, sizeof(class_ent_name)); + bzero(class_ent_desc, sizeof(class_ent_desc)); + c.ac_name = class_ent_name; + c.ac_desc = class_ent_desc; + + return (getauclassnum_r(&c, class_number)); +} + /* * audit_class processing is complete; close any open files. */ -void endauclass(void) +void +endauclass(void) { pthread_mutex_lock(&mutex); ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#9 (text+ko) ==== @@ -1,5 +1,6 @@ /* - * Copyright (c) 2004, Apple Computer, Inc. All rights reserved. + * Copyright (c) 2004, Apple Computer, Inc. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#6 (text+ko) ==== @@ -1,5 +1,7 @@ /* - * Copyright (c) 2004, Apple Computer, Inc. All rights reserved. + * Copyright (c) 2004, Apple Computer, Inc. + * Copyright (c) 2006 Robert N. M. Watson + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,55 +46,6 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* - * XXX The reentrant versions of the following functions is TBD - * XXX struct au_event_ent *getauevent_r(au_event_ent_t *e); - * XXX struct au_event_ent *getauevnam_r(au_event_ent_t *e, char *name); - * XXX struct au_event_ent *getauevnum_r(au_event_ent_t *e, au_event_t event_number); - */ - -/* - * Allocate an au_event_ent structure. - */ -static struct au_event_ent * -get_event_area(void) -{ - struct au_event_ent *e; - - e = (struct au_event_ent *) malloc (sizeof(struct au_event_ent)); - if (e == NULL) - return (NULL); - e->ae_name = (char *)malloc(AU_EVENT_NAME_MAX * sizeof(char)); - if (e->ae_name == NULL) { - free(e); - return (NULL); - } - e->ae_desc = (char *)malloc(AU_EVENT_DESC_MAX * sizeof(char)); - if (e->ae_desc == NULL) { - free(e->ae_name); - free(e); - return (NULL); - } - - return (e); -} - -/* - * Free the au_event_ent structure. - */ -void -free_au_event_ent(struct au_event_ent *e) -{ - - if (e) { - if (e->ae_name) - free(e->ae_name); - if (e->ae_desc) - free(e->ae_desc); - free(e); - } -} - -/* * Parse one line from the audit_event file into the au_event_ent structure. */ static struct au_event_ent * @@ -170,71 +123,77 @@ /* * Enumerate the au_event_ent entries. */ -struct au_event_ent * -getauevent(void) +static struct au_event_ent * +getauevent_r_locked(struct au_event_ent *e) { - struct au_event_ent *e; char *nl; - pthread_mutex_lock(&mutex); + if ((fp == NULL) && ((fp = fopen(AUDIT_EVENT_FILE, "r")) == NULL)) + return (NULL); - if ((fp == NULL) && ((fp = fopen(AUDIT_EVENT_FILE, "r")) == NULL)) { - pthread_mutex_unlock(&mutex); + if (fgets(linestr, AU_LINE_MAX, fp) == NULL) return (NULL); - } - if (fgets(linestr, AU_LINE_MAX, fp) == NULL) { - pthread_mutex_unlock(&mutex); - return (NULL); - } /* Remove new lines. */ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; - e = get_event_area(); - if (e == NULL) { - pthread_mutex_unlock(&mutex); + /* + * Get the next event structure. + * + * XXXRW: Perhaps we should keep reading lines until we find a valid + * one, rather than stopping when we hit an invalid one? + */ + if (eventfromstr(linestr, delim, e) == NULL) return (NULL); - } + + return (e); +} - /* Get the next event structure. */ - if (eventfromstr(linestr, delim, e) == NULL) { - free_au_event_ent(e); - pthread_mutex_unlock(&mutex); - return (NULL); - } +struct au_event_ent * +getauevent_r(struct au_event_ent *e) +{ + struct au_event_ent *ep; + pthread_mutex_lock(&mutex); + ep = getauevent_r_locked(e); pthread_mutex_unlock(&mutex); - return (e); + return (ep); +} + +struct au_event_ent * +getauevent(void) +{ + static char event_ent_name[AU_EVENT_NAME_MAX]; + static char event_ent_desc[AU_EVENT_DESC_MAX]; + static struct au_event_ent e; + + bzero(&e, sizeof(e)); + bzero(event_ent_name, sizeof(event_ent_name)); + bzero(event_ent_desc, sizeof(event_ent_desc)); + e.ae_name = event_ent_name; + e.ae_desc = event_ent_desc; + return (getauevent_r(&e)); } /* - * Search for an audit event structure having the given event name + * Search for an audit event structure having the given event name. + * + * XXXRW: Why accept NULL name? */ -struct au_event_ent * -getauevnam(char *name) +static struct au_event_ent * +getauevnam_r_locked(struct au_event_ent *e, const char *name) { - struct au_event_ent *e; char *nl; if (name == NULL) return (NULL); - pthread_mutex_lock(&mutex); - /* Rewind to beginning of the file. */ setauevent_locked(); - if ((fp == NULL) && ((fp = fopen(AUDIT_EVENT_FILE, "r")) == NULL)) { - pthread_mutex_unlock(&mutex); - return (NULL); - } - - e = get_event_area(); - if (e == NULL) { - pthread_mutex_unlock(&mutex); + if ((fp == NULL) && ((fp = fopen(AUDIT_EVENT_FILE, "r")) == NULL)) return (NULL); - } while (fgets(linestr, AU_LINE_MAX, fp) != NULL) { /* Remove new lines. */ @@ -242,61 +201,92 @@ *nl = '\0'; if (eventfromstr(linestr, delim, e) != NULL) { - if (!strcmp(name, e->ae_name)) { - pthread_mutex_unlock(&mutex); + if (strcmp(name, e->ae_name) == 0) return (e); - } } } + return (NULL); +} + +struct au_event_ent * +getauevnam_r(struct au_event_ent *e, const char *name) +{ + struct au_event_ent *ep; + + pthread_mutex_lock(&mutex); + ep = getauevnam_r_locked(e, name); pthread_mutex_unlock(&mutex); + return (ep); +} - free_au_event_ent(e); +struct au_event_ent * +getauevnam(const char *name) +{ + static char event_ent_name[AU_EVENT_NAME_MAX]; + static char event_ent_desc[AU_EVENT_DESC_MAX]; + static struct au_event_ent e; - return (NULL); + bzero(&e, sizeof(e)); + bzero(event_ent_name, sizeof(event_ent_name)); + bzero(event_ent_desc, sizeof(event_ent_desc)); + e.ae_name = event_ent_name; + e.ae_desc = event_ent_desc; + return (getauevnam_r(&e, name)); } /* * Search for an audit event structure having the given event number. */ -struct au_event_ent *getauevnum(au_event_t event_number) +static struct au_event_ent * +getauevnum_r_locked(struct au_event_ent *e, au_event_t event_number) { - struct au_event_ent *e; char *nl; - pthread_mutex_lock(&mutex); - /* Rewind to beginning of the file. */ setauevent_locked(); - if ((fp == NULL) && ((fp = fopen(AUDIT_EVENT_FILE, "r")) == NULL)) { - pthread_mutex_unlock(&mutex); + if ((fp == NULL) && ((fp = fopen(AUDIT_EVENT_FILE, "r")) == NULL)) return (NULL); - } - e = get_event_area(); - if (e == NULL) { - pthread_mutex_unlock(&mutex); - return (NULL); - } - while (fgets(linestr, AU_LINE_MAX, fp) != NULL) { /* Remove new lines. */ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; if (eventfromstr(linestr, delim, e) != NULL) { - if (event_number == e->ae_number) { - pthread_mutex_unlock(&mutex); + if (event_number == e->ae_number) return (e); - } } } + return (NULL); +} + +struct au_event_ent * +getauevnum_r(struct au_event_ent *e, au_event_t event_number) +{ + struct au_event_ent *ep; + + pthread_mutex_lock(&mutex); + ep = getauevnum_r_locked(e, event_number); pthread_mutex_unlock(&mutex); - free_au_event_ent(e); - return (NULL); + return (ep); +} + +struct au_event_ent * +getauevnum(au_event_t event_number) +{ + static char event_ent_name[AU_EVENT_NAME_MAX]; + static char event_ent_desc[AU_EVENT_DESC_MAX]; + static struct au_event_ent e; + bzero(&e, sizeof(e)); + bzero(event_ent_name, sizeof(event_ent_name)); + bzero(event_ent_desc, sizeof(event_ent_desc)); + e.ae_name = event_ent_name; + e.ae_desc = event_ent_desc; + return (getauevnum_r(&e, event_number)); } /* @@ -304,25 +294,30 @@ * corresponding event number. */ au_event_t * -getauevnonam(char *event_name) +getauevnonam_r(au_event_t *ev, const char *event_name) { - struct au_event_ent *e; - au_event_t *n = NULL; + static char event_ent_name[AU_EVENT_NAME_MAX]; + static char event_ent_desc[AU_EVENT_DESC_MAX]; + static struct au_event_ent e, *ep; + + bzero(event_ent_name, sizeof(event_ent_name)); + bzero(event_ent_desc, sizeof(event_ent_desc)); + bzero(&e, sizeof(e)); + e.ae_name = event_ent_name; + e.ae_desc = event_ent_desc; - e = getauevnam(event_name); - if (e != NULL) { - n = malloc (sizeof(au_event_t)); - if (n != NULL) - *n = e->ae_number; - free_au_event_ent(e); - } + ep = getauevnam_r(&e, event_name); + if (ep == NULL) + return (NULL); - return (n); + *ev = e.ae_number; + return (ev); } -void -free_au_event(au_event_t *e) +au_event_t * +getauevnonam(const char *event_name) { - if (e) - free(e); + static au_event_t event; + + return (getauevnonam_r(&event, event_name)); } ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#8 (text+ko) ==== @@ -1,5 +1,7 @@ /* - * Copyright (c) 2004, Apple Computer, Inc. All rights reserved. + * Copyright (c) 2004, Apple Computer, Inc. + * Copyright (c) 2006 Robert N. M. Watson + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,16 +43,25 @@ int getauditflagsbin(char *auditstr, au_mask_t *masks) { + char class_ent_name[AU_CLASS_NAME_MAX]; + char class_ent_desc[AU_CLASS_DESC_MAX]; + struct au_class_ent c, *cp; char *tok; char sel, sub; - struct au_class_ent *c; char *last; + if ((auditstr == NULL) || (masks == NULL)) { errno = EINVAL; return (-1); } + bzero(&c, sizeof(c)); + bzero(class_ent_name, sizeof(class_ent_name)); + bzero(class_ent_desc, sizeof(class_ent_desc)); + c.ac_name = class_ent_name; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Jan 15 23:18:12 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF97016A424; Sun, 15 Jan 2006 23:18:11 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6185616A422 for ; Sun, 15 Jan 2006 23:18:11 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3129743D76 for ; Sun, 15 Jan 2006 23:18:05 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FNI56N029012 for ; Sun, 15 Jan 2006 23:18:05 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FNI4oh029009 for perforce@freebsd.org; Sun, 15 Jan 2006 23:18:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 23:18:04 GMT Message-Id: <200601152318.k0FNI4oh029009@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89757 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 23:18:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=89757 Change 89757 by rwatson@rwatson_peppercorn on 2006/01/15 23:17:17 Update CHANGELOG some. Affected files ... .. //depot/projects/trustedbsd/openbsm/CHANGELOG#3 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/CHANGELOG#3 (text+ko) ==== @@ -41,3 +41,24 @@ to run praudit(1) on basic Solaris BSM streams. - Switched to Solaris spelling of token names; Darwin spellings are now deprecated and will be removed in a future version of OpenBSM. +- Adopt Solaris model for representing IPv4 and IPv6 addresses. +- Prefer C99 types. +- Attempt to universally adopt the BSD style(9) coding style for + consistency. +- auditreduce(1) now has a usage message. +- Update support for auditctl(2) system call to support FreeBSD. +- Add support for /dev/audit as the trigger source on FreeBSD. +- Add additional event types for Darwin, FreeBSD, and Solaris. Annotate + conflicts (there are a few, unfortunately). Correct spellings, comment, + sort, etc. These include {get,set}res[ug]id(), sendfile(), lchflags(), + eaccess(), kqueue(), kevent(), poll(), lchmod(). +- Relicensed under a BSD license, many thanks to Apple, Inc! +- Many bug fixes, cleanups, thread safety in the class, control, event, + and user system audit databases. Annotate some persisting atomicity + bugs associated with the API and implementation. +- Add audump test tool. +- Adopt OpenSolaris BSM API memory semantics: caller allocates memory, + or static memory is returned for non-_r() versions of API calls. + _free() calls dropped as a result, and source code compatibility with + OpenSolaris improved significantly. + From owner-p4-projects@FreeBSD.ORG Sun Jan 15 23:44:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C361C16A422; Sun, 15 Jan 2006 23:44:38 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99D9A16A41F for ; Sun, 15 Jan 2006 23:44:38 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B27643D46 for ; Sun, 15 Jan 2006 23:44:38 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FNicDU029979 for ; Sun, 15 Jan 2006 23:44:38 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FNib8c029976 for perforce@freebsd.org; Sun, 15 Jan 2006 23:44:37 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 23:44:37 GMT Message-Id: <200601152344.k0FNib8c029976@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89759 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 23:44:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=89759 Change 89759 by rwatson@rwatson_zoo on 2006/01/15 23:44:30 Integrate OpenBSM branch into TrustedBSD audit3 contrib/openbsm: - Updated change log. - Updated contributors. - Further style(9)ification. - OpenSolaris BSM API memory allocation model, _r() APIs. - Many bugfixes, especially relating to threading and error handling. - Further audump work. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/openbsm/CHANGELOG#2 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/README#3 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/libbsm.h#3 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/au_class.3#2 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/au_event.3#2 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/au_user.3#2 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_audit.c#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_class.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_control.c#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_event.c#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_flags.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_io.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_mask.c#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_user.c#3 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/libbsm.3#2 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/tools/audump.c#2 integrate Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/CHANGELOG#2 (text+ko) ==== @@ -41,3 +41,24 @@ to run praudit(1) on basic Solaris BSM streams. - Switched to Solaris spelling of token names; Darwin spellings are now deprecated and will be removed in a future version of OpenBSM. +- Adopt Solaris model for representing IPv4 and IPv6 addresses. +- Prefer C99 types. +- Attempt to universally adopt the BSD style(9) coding style for + consistency. +- auditreduce(1) now has a usage message. +- Update support for auditctl(2) system call to support FreeBSD. +- Add support for /dev/audit as the trigger source on FreeBSD. +- Add additional event types for Darwin, FreeBSD, and Solaris. Annotate + conflicts (there are a few, unfortunately). Correct spellings, comment, + sort, etc. These include {get,set}res[ug]id(), sendfile(), lchflags(), + eaccess(), kqueue(), kevent(), poll(), lchmod(). +- Relicensed under a BSD license, many thanks to Apple, Inc! +- Many bug fixes, cleanups, thread safety in the class, control, event, + and user system audit databases. Annotate some persisting atomicity + bugs associated with the API and implementation. +- Add audump test tool. +- Adopt OpenSolaris BSM API memory semantics: caller allocates memory, + or static memory is returned for non-_r() versions of API calls. + _free() calls dropped as a result, and source code compatibility with + OpenSolaris improved significantly. + ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/README#3 (text+ko) ==== @@ -58,6 +58,7 @@ Wayne Salamon Tom Rhodes Wojciech Koszek + Chunyang Yuan Contributions ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/libbsm.h#3 (text+ko) ==== @@ -27,16 +27,15 @@ */ #ifndef _LIBBSM_H_ -#define _LIBBSM_H_ +#define _LIBBSM_H_ /* - * NB: definitions, etc., marked with "OpenSSH compatibility" were - * introduced solely to allow OpenSSH to compile; Darwin/Apple code should - * not use them. + * NB: definitions, etc., marked with "OpenSSH compatibility" were introduced + * solely to allow OpenSSH to compile; Darwin/Apple code should not use them. */ -#define MAX_ARGS 10 -#define MAX_ENV 10 +#define MAX_ARGS 10 +#define MAX_ENV 10 #include #include @@ -46,138 +45,120 @@ #include #include +#include #ifdef __APPLE__ #include /* audit_token_t */ #endif -#define AU_PRS_SUCCESS 1 -#define AU_PRS_FAILURE 2 -#define AU_PRS_BOTH (AU_PRS_SUCCESS|AU_PRS_FAILURE) +#define AU_PRS_SUCCESS 1 +#define AU_PRS_FAILURE 2 +#define AU_PRS_BOTH (AU_PRS_SUCCESS|AU_PRS_FAILURE) -#define AU_PRS_USECACHE 0 -#define AU_PRS_REREAD 1 +#define AU_PRS_USECACHE 0 +#define AU_PRS_REREAD 1 -#define AUDIT_EVENT_FILE "/etc/security/audit_event" -#define AUDIT_CLASS_FILE "/etc/security/audit_class" -#define AUDIT_CONTROL_FILE "/etc/security/audit_control" -#define AUDIT_USER_FILE "/etc/security/audit_user" +#define AUDIT_EVENT_FILE "/etc/security/audit_event" +#define AUDIT_CLASS_FILE "/etc/security/audit_class" +#define AUDIT_CONTROL_FILE "/etc/security/audit_control" +#define AUDIT_USER_FILE "/etc/security/audit_user" -#define DIR_CONTROL_ENTRY "dir" -#define MINFREE_CONTROL_ENTRY "minfree" -#define FLAGS_CONTROL_ENTRY "flags" -#define NA_CONTROL_ENTRY "naflags" +#define DIR_CONTROL_ENTRY "dir" +#define MINFREE_CONTROL_ENTRY "minfree" +#define FLAGS_CONTROL_ENTRY "flags" +#define NA_CONTROL_ENTRY "naflags" -#define AU_CLASS_NAME_MAX 8 -#define AU_CLASS_DESC_MAX 72 -#define AU_EVENT_NAME_MAX 30 -#define AU_EVENT_DESC_MAX 50 -#define AU_USER_NAME_MAX 50 -#define AU_LINE_MAX 256 -#define MAX_AUDITSTRING_LEN 256 -#define BSM_TEXTBUFSZ MAX_AUDITSTRING_LEN /* OpenSSH compatibility */ +#define AU_CLASS_NAME_MAX 8 +#define AU_CLASS_DESC_MAX 72 +#define AU_EVENT_NAME_MAX 30 +#define AU_EVENT_DESC_MAX 50 +#define AU_USER_NAME_MAX 50 +#define AU_LINE_MAX 256 +#define MAX_AUDITSTRING_LEN 256 +#define BSM_TEXTBUFSZ MAX_AUDITSTRING_LEN /* OpenSSH compatibility */ /* * These are referenced in Solaris 9 au_open(3BSM); values are guesses. * Provided for OpenSSH compatibility. */ -#define AU_TO_NO_WRITE 0 -#define AU_TO_WRITE 1 +#define AU_TO_NO_WRITE 0 +#define AU_TO_WRITE 1 __BEGIN_DECLS struct au_event_ent { - au_event_t ae_number; - char *ae_name; - char *ae_desc; - au_class_t ae_class; + au_event_t ae_number; + char *ae_name; + char *ae_desc; + au_class_t ae_class; }; typedef struct au_event_ent au_event_ent_t; struct au_class_ent { - char *ac_name; - au_class_t ac_class; - char *ac_desc; + char *ac_name; + au_class_t ac_class; + char *ac_desc; }; typedef struct au_class_ent au_class_ent_t; struct au_user_ent { - char *au_name; - au_mask_t au_always; - au_mask_t au_never; + char *au_name; + au_mask_t au_always; + au_mask_t au_never; }; typedef struct au_user_ent au_user_ent_t; __END_DECLS +#define ADD_TO_MASK(m, c, sel) do { \ + if (sel & AU_PRS_SUCCESS) \ + (m)->am_success |= c; \ + if (sel & AU_PRS_FAILURE) \ + (m)->am_failure |= c; \ +} while (0) -#define ADD_TO_MASK(m, c, sel) \ - do {\ - if(sel & AU_PRS_SUCCESS) {\ - (m)->am_success |= c;\ - }\ - if(sel & AU_PRS_FAILURE) {\ - (m)->am_failure |= c;\ - }\ - }while(0) +#define SUB_FROM_MASK(m, c, sel) do { \ + if (sel & AU_PRS_SUCCESS) \ + (m)->am_success &= ((m)->am_success ^ c); \ + if (sel & AU_PRS_FAILURE) \ + (m)->am_failure &= ((m)->am_failure ^ c); \ +} while (0) -#define SUB_FROM_MASK(m, c, sel) \ - do {\ - if(sel & AU_PRS_SUCCESS) {\ - (m)->am_success &= ((m)->am_success ^ c);\ - }\ - if(sel & AU_PRS_FAILURE) {\ - (m)->am_failure &= ((m)->am_failure ^ c);\ - }\ - }while(0) +#define ADDMASK(m, v) do { \ + (m)->am_success |= (v)->am_success; \ + (m)->am_failure |= (v)->am_failure; \ +} while(0) -#define ADDMASK(m, v) \ - do {\ - (m)->am_success |= (v)->am_success;\ - (m)->am_failure |= (v)->am_failure;\ - } while(0) - -#define SUBMASK(m, v) \ - do {\ - (m)->am_success &= ((m)->am_success ^ (v)->am_success);\ - (m)->am_failure &= ((m)->am_failure ^ (v)->am_failure);\ - } while(0) - +#define SUBMASK(m, v) do { \ + (m)->am_success &= ((m)->am_success ^ (v)->am_success); \ + (m)->am_failure &= ((m)->am_failure ^ (v)->am_failure); \ +} while(0) __BEGIN_DECLS -struct audit_event_map { - struct au_event_ent *ev; - LIST_ENTRY(audit_event_map) ev_list; -}; - /* - * Internal representation of audit user in libnsl + * Internal representation of audit user in libnsl. */ typedef struct au_user_str_s { - char *au_name; - char *au_always; - char *au_never; + char *au_name; + char *au_always; + char *au_never; } au_user_str_t; +typedef struct au_tid32 { + u_int32_t port; + u_int32_t addr; +} au_tid32_t; -struct au_tid32 { - u_int32_t port; - u_int32_t addr; -}; -typedef struct au_tid32 au_tid32_t; +typedef struct au_tid64 { + u_int64_t port; + u_int32_t addr; +} au_tid64_t; -struct au_tid64 { - u_int64_t port; - u_int32_t addr; -}; -typedef struct au_tid64 au_tid64_t; +typedef struct au_tidaddr32 { + u_int32_t port; + u_int32_t type; + u_int32_t addr[4]; +} au_tidaddr32_t; -struct au_tidaddr32 { - u_int32_t port; - u_int32_t type; - u_int32_t addr[4]; -}; -typedef struct au_tidaddr32 au_tidaddr32_t; - /* * argument # 1 byte * argument value 4 bytes/8 bytes (32-bit/64-bit value) @@ -185,24 +166,19 @@ * text N bytes + 1 terminating NULL byte */ typedef struct { - - u_char no; - u_int32_t val; - u_int16_t len; - char *text; - + u_char no; + u_int32_t val; + u_int16_t len; + char *text; } au_arg32_t; typedef struct { - - u_char no; - u_int64_t val; - u_int16_t len; - char *text; - + u_char no; + u_int64_t val; + u_int16_t len; + char *text; } au_arg64_t; - /* * how to print 1 byte * basic unit 1 byte @@ -210,16 +186,12 @@ * data items (depends on basic unit) */ typedef struct { - - u_char howtopr; - u_char bu; - u_char uc; - u_char *data; - + u_char howtopr; + u_char bu; + u_char uc; + u_char *data; } au_arb_t; - - /* * file access mode 4 bytes * owner user ID 4 bytes @@ -229,49 +201,39 @@ * device 4 bytes/8 bytes (32-bit/64-bit) */ typedef struct { - - u_int32_t mode; - u_int32_t uid; - u_int32_t gid; - u_int32_t fsid; - u_int64_t nid; - u_int32_t dev; - + u_int32_t mode; + u_int32_t uid; + u_int32_t gid; + u_int32_t fsid; + u_int64_t nid; + u_int32_t dev; } au_attr32_t; typedef struct { - - u_int32_t mode; - u_int32_t uid; - u_int32_t gid; - u_int32_t fsid; - u_int64_t nid; - u_int64_t dev; - + u_int32_t mode; + u_int32_t uid; + u_int32_t gid; + u_int32_t fsid; + u_int64_t nid; + u_int64_t dev; } au_attr64_t; - /* * count 4 bytes * text count null-terminated string(s) */ typedef struct { - - u_int32_t count; - char *text[MAX_ARGS]; - + u_int32_t count; + char *text[MAX_ARGS]; } au_execarg_t; - /* * count 4 bytes * text count null-terminated string(s) */ typedef struct { - - u_int32_t count; - char *text[MAX_ENV]; - + u_int32_t count; + char *text[MAX_ENV]; } au_execenv_t; /* @@ -279,10 +241,8 @@ * return value 4 bytes */ typedef struct { - - u_int32_t status; - u_int32_t ret; - + u_int32_t status; + u_int32_t ret; } au_exit_t; /* @@ -292,12 +252,10 @@ * file pathname N bytes + 1 terminating NULL byte */ typedef struct { - - u_int32_t s; - u_int32_t ms; - u_int16_t len; - char *name; - + u_int32_t s; + u_int32_t ms; + u_int16_t len; + char *name; } au_file_t; @@ -306,13 +264,10 @@ * group list N * 4 bytes */ typedef struct { - - u_int16_t no; - u_int32_t list[BSM_MAX_GROUPS]; - + u_int16_t no; + u_int32_t list[BSM_MAX_GROUPS]; } au_groups_t; - /* * record byte count 4 bytes * version # 1 byte [2] @@ -322,14 +277,12 @@ * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value) */ typedef struct { - - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int32_t s; - u_int32_t ms; - + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int32_t s; + u_int32_t ms; } au_header32_t; /* @@ -343,50 +296,41 @@ * nanoseconds of time 4 bytes/8 bytes (32/64-bits) */ typedef struct { - - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int32_t ad_type; - u_int32_t addr[4]; - u_int32_t s; - u_int32_t ms; - + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int32_t ad_type; + u_int32_t addr[4]; + u_int32_t s; + u_int32_t ms; } au_header32_ex_t; typedef struct { - - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int64_t s; - u_int64_t ms; - + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int64_t s; + u_int64_t ms; } au_header64_t; typedef struct { - - u_int32_t size; - u_char version; - u_int16_t e_type; - u_int16_t e_mod; - u_int32_t ad_type; - u_int32_t addr[4]; - u_int64_t s; - u_int64_t ms; - + u_int32_t size; + u_char version; + u_int16_t e_type; + u_int16_t e_mod; + u_int32_t ad_type; + u_int32_t addr[4]; + u_int64_t s; + u_int64_t ms; } au_header64_ex_t; - /* * internet address 4 bytes */ typedef struct { - - u_int32_t addr; - + u_int32_t addr; } au_inaddr_t; /* @@ -394,10 +338,8 @@ * internet address 16 bytes */ typedef struct { - - u_int32_t type; - u_int32_t addr[4]; - + u_int32_t type; + u_int32_t addr[4]; } au_inaddr_ex_t; /* @@ -413,18 +355,16 @@ * destination address 4 bytes */ typedef struct { - - u_char version; - u_char tos; - u_int16_t len; - u_int16_t id; - u_int16_t offset; - u_char ttl; - u_char prot; - u_int16_t chksm; - u_int32_t src; - u_int32_t dest; - + u_char version; + u_char tos; + u_int16_t len; + u_int16_t id; + u_int16_t offset; + u_char ttl; + u_char prot; + u_int16_t chksm; + u_int32_t src; + u_int32_t dest; } au_ip_t; /* @@ -432,10 +372,8 @@ * object ID 4 bytes */ typedef struct { - - u_char type; - u_int32_t id; - + u_char type; + u_int32_t id; } au_ipc_t; /* @@ -448,53 +386,40 @@ * key 4 bytes */ typedef struct { - - u_int32_t uid; - u_int32_t gid; - u_int32_t puid; - u_int32_t pgid; - u_int32_t mode; - u_int32_t seq; - u_int32_t key; - + u_int32_t uid; + u_int32_t gid; + u_int32_t puid; + u_int32_t pgid; + u_int32_t mode; + u_int32_t seq; + u_int32_t key; } au_ipcperm_t; - /* * port IP address 2 bytes */ typedef struct { - - u_int16_t port; - + u_int16_t port; } au_iport_t; - /* * length 2 bytes * data length bytes */ typedef struct { - - u_int16_t size; - char *data; - + u_int16_t size; + char *data; } au_opaque_t; - /* * path length 2 bytes * path N bytes + 1 terminating NULL byte */ typedef struct { - - u_int16_t len; - char *path; - + u_int16_t len; + char *path; } au_path_t; - - /* * audit ID 4 bytes * effective user ID 4 bytes @@ -508,29 +433,25 @@ * machine address 4 bytes */ typedef struct { - - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid32_t tid; - + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid32_t tid; } au_proc32_t; typedef struct { - - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid64_t tid; - + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid64_t tid; } au_proc64_t; /* @@ -547,16 +468,14 @@ * machine address 16 bytes */ typedef struct { - - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tidaddr32_t tid; - + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tidaddr32_t tid; } au_proc32ex_t; /* @@ -564,27 +483,20 @@ * return value 4 bytes/8 bytes (32-bit/64-bit value) */ typedef struct { - - u_char status; - u_int32_t ret; - + u_char status; + u_int32_t ret; } au_ret32_t; typedef struct { - - u_char err; - u_int64_t val; - + u_char err; + u_int64_t val; } au_ret64_t; - /* * sequence number 4 bytes */ typedef struct { - - u_int32_t seqno; - + u_int32_t seqno; } au_seq_t; /* @@ -595,13 +507,11 @@ * remote Internet address 4 bytes */ typedef struct { - - u_int16_t type; - u_int16_t l_port; - u_int32_t l_addr; - u_int16_t r_port; - u_int32_t r_addr; - + u_int16_t type; + u_int16_t l_port; + u_int32_t l_addr; + u_int16_t r_port; + u_int32_t r_addr; } au_socket_t; /* @@ -613,17 +523,14 @@ * address type/length 4 bytes * remote Internet address 4 bytes/16 bytes (IPv4/IPv6 address) */ - typedef struct { - - u_int16_t type; - u_int16_t l_port; - u_int32_t l_ad_type; - u_int32_t l_addr; - u_int32_t r_port; - u_int32_t r_ad_type; - u_int32_t r_addr; - + u_int16_t type; + u_int16_t l_port; + u_int32_t l_ad_type; + u_int32_t l_addr; + u_int32_t r_port; + u_int32_t r_ad_type; + u_int32_t r_addr; } au_socket_ex32_t; /* @@ -632,11 +539,9 @@ * socket address 4 bytes/16 bytes (IPv4/IPv6 address) */ typedef struct { - - u_int16_t family; - u_int16_t port; - u_int32_t addr; - + u_int16_t family; + u_int16_t port; + u_int32_t addr; } au_socketinet32_t; /* @@ -644,10 +549,8 @@ * path 104 bytes */ typedef struct { - - u_int16_t family; - char path[104]; - + u_int16_t family; + char path[104]; } au_socketunix_t; /* @@ -663,29 +566,25 @@ * machine address 4 bytes */ typedef struct { - - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid32_t tid; - + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid32_t tid; } au_subject32_t; typedef struct { - - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tid64_t tid; - + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tid64_t tid; } au_subject64_t; /* @@ -702,69 +601,52 @@ * machine address 16 bytes */ typedef struct { - - u_int32_t auid; - u_int32_t euid; - u_int32_t egid; - u_int32_t ruid; - u_int32_t rgid; - u_int32_t pid; - u_int32_t sid; - au_tidaddr32_t tid; - + u_int32_t auid; + u_int32_t euid; + u_int32_t egid; + u_int32_t ruid; + u_int32_t rgid; + u_int32_t pid; + u_int32_t sid; + au_tidaddr32_t tid; } au_subject32ex_t; - /* * text length 2 bytes * text N bytes + 1 terminating NULL byte */ typedef struct { - - u_int16_t len; - char *text; - + u_int16_t len; + char *text; } au_text_t; typedef struct { - - u_int32_t ident; - u_int16_t filter; - u_int16_t flags; - u_int32_t fflags; - u_int32_t data; - + u_int32_t ident; + u_int16_t filter; + u_int16_t flags; + u_int32_t fflags; + u_int32_t data; } au_kevent_t; typedef struct { - - u_int16_t length; - char *data; + u_int16_t length; + char *data; } au_invalid_t; - /* * trailer magic number 2 bytes * record byte count 4 bytes */ typedef struct { - - u_int16_t magic; - u_int32_t count; - + u_int16_t magic; + u_int32_t count; } au_trailer_t; - - struct tokenstr { - - u_char id; - - u_char *data; - size_t len; - + u_char id; + u_char *data; + size_t len; union { - au_arg32_t arg32; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Sun Jan 15 23:56:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DC88316A422; Sun, 15 Jan 2006 23:56:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C94F16A41F for ; Sun, 15 Jan 2006 23:56:53 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FED143D45 for ; Sun, 15 Jan 2006 23:56:53 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FNurup030588 for ; Sun, 15 Jan 2006 23:56:53 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FNuqQr030585 for perforce@freebsd.org; Sun, 15 Jan 2006 23:56:52 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 23:56:52 GMT Message-Id: <200601152356.k0FNuqQr030585@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89760 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 23:56:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=89760 Change 89760 by rwatson@rwatson_zoo on 2006/01/15 23:56:12 Update license on login from APSL to BSD. Submitted by: Apple, Inc. Affected files ... .. //depot/projects/trustedbsd/audit3/usr.bin/login/login.c#6 edit Differences ... ==== //depot/projects/trustedbsd/audit3/usr.bin/login/login.c#6 (text+ko) ==== @@ -38,27 +38,35 @@ * SUCH DAMAGE. */ /* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.0 (the 'License'). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License." - * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ */ #if 0 From owner-p4-projects@FreeBSD.ORG Sun Jan 15 23:57:56 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D904416A422; Sun, 15 Jan 2006 23:57:55 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C63116A41F for ; Sun, 15 Jan 2006 23:57:55 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BB5B43D48 for ; Sun, 15 Jan 2006 23:57:55 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0FNvt3X030687 for ; Sun, 15 Jan 2006 23:57:55 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0FNvskJ030684 for perforce@freebsd.org; Sun, 15 Jan 2006 23:57:54 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 15 Jan 2006 23:57:54 GMT Message-Id: <200601152357.k0FNvskJ030684@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89761 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2006 23:57:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=89761 Change 89761 by rwatson@rwatson_zoo on 2006/01/15 23:57:39 audit.1 and audit.c are under a BSD license, copyright Apple. Submitted by: Apple, Inc. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/audit/audit.1#3 edit .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/audit/audit.c#6 edit Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/audit/audit.1#3 (text+ko) ==== @@ -1,5 +1,33 @@ .\" Copyright (c) 2004, Apple Computer, Inc. All rights reserved. .\" +.\" @APPLE_BSD_LICENSE_HEADER_START@ +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" @APPLE_BSD_LICENSE_HEADER_END@ +.\" .Dd Jan 24, 2004 .Dt AUDIT 1 .Os ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/audit/audit.c#6 (text+ko) ==== @@ -1,4 +1,35 @@ /* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ + */ +/* * Program to trigger the audit daemon with a message that is either: * - Open a new audit log file * - Read the audit control file and take action on it From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:01:00 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 11FDD16A422; Mon, 16 Jan 2006 00:01:00 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C943116A41F for ; Mon, 16 Jan 2006 00:00:59 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6598C43D45 for ; Mon, 16 Jan 2006 00:00:59 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G00xcG030931 for ; Mon, 16 Jan 2006 00:00:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G00wAo030928 for perforce@freebsd.org; Mon, 16 Jan 2006 00:00:58 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:00:58 GMT Message-Id: <200601160000.k0G00wAo030928@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89762 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:01:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=89762 Change 89762 by rwatson@rwatson_zoo on 2006/01/16 00:00:06 auditd is under a BSD license, copyright Apple. Submitted by: Apple, Inc. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/audit_warn.c#4 edit .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/auditd.8#3 edit .. //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/auditd.h#4 edit Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/audit_warn.c#4 (text+ko) ==== @@ -1,25 +1,33 @@ /* - * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.0 (the 'License'). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License." - * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ */ #include ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/auditd.8#3 (text+ko) ==== @@ -1,5 +1,33 @@ .\" Copyright (c) 2004, Apple Computer, Inc. All rights reserved. .\" +.\" @APPLE_BSD_LICENSE_HEADER_START@ +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +.\" its contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" @APPLE_BSD_LICENSE_HEADER_END@ +.\" .Dd Jan 24, 2004 .Dt AUDITD 8 .Os ==== //depot/projects/trustedbsd/audit3/contrib/audit_supt/auditd/auditd.h#4 (text+ko) ==== @@ -1,3 +1,35 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ + */ + #ifndef _AUDITD_H_ #define _AUDITD_H_ From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:03:04 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F210016A422; Mon, 16 Jan 2006 00:03:03 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB0E116A41F for ; Mon, 16 Jan 2006 00:03:03 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76C9443D55 for ; Mon, 16 Jan 2006 00:03:02 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G03274031016 for ; Mon, 16 Jan 2006 00:03:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G032eV031013 for perforce@freebsd.org; Mon, 16 Jan 2006 00:03:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:03:02 GMT Message-Id: <200601160003.k0G032eV031013@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89763 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:03:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=89763 Change 89763 by rwatson@rwatson_zoo on 2006/01/16 00:02:09 GC older Apple BSM import, we now use OpenBSM. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/bsm/Makefile#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/Makefile#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/auditreduce.c#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/auditreduce.h#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/bin/praudit.c#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/etc/Makefile#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/etc/audit_class#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/etc/audit_control#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/etc/audit_event#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/etc/audit_user#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/etc/audit_warn#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/Makefile#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/audit_uevents.h#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_audit.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_class.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_control.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_event.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_flags.c#5 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_io.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_mask.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_notify.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_token.c#5 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/bsm_user.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/lib_wrappers.c#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/lib/libbsm.h#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/Makefile#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/audit_class.5#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/audit_control.5#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/audit_event.5#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/audit_user.5#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/audit_warn.5#4 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/auditreduce.1#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/man/praudit.1#3 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/test/Makefile#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/test/bsm_lib_test.c#2 delete .. //depot/projects/trustedbsd/audit3/contrib/bsm/test/bsm_tok_test.c#2 delete Differences ... From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:05:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EA69B16A422; Mon, 16 Jan 2006 00:05:05 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADD9116A41F for ; Mon, 16 Jan 2006 00:05:05 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6626643D48 for ; Mon, 16 Jan 2006 00:05:05 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G055gS031293 for ; Mon, 16 Jan 2006 00:05:05 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G055Mi031288 for perforce@freebsd.org; Mon, 16 Jan 2006 00:05:05 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:05:05 GMT Message-Id: <200601160005.k0G055Mi031288@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89764 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:05:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=89764 Change 89764 by rwatson@rwatson_zoo on 2006/01/16 00:04:15 Remove man page MLINK's for APIs now removed. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/Makefile#10 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/Makefile#10 (text+ko) ==== @@ -34,7 +34,6 @@ au_user.3 MLINKS= libbsm.3 bsm.3 \ - au_class.3 free_au_class_ent.3 \ au_class.3 getauclassent.3 \ au_class.3 getauclassnam.3 \ au_class.3 setauclass.3 \ @@ -45,21 +44,18 @@ au_control.3 getacmin.3 \ au_control.3 getacflg.3 \ au_control.3 getacna.3 \ - au_event.3 free_au_event_ent.3 \ au_event.3 setauevent.3 \ au_event.3 endauevent.3 \ au_event.3 getauevent.3 \ au_event.3 getauevnam.3 \ au_event.3 getauevnum.3 \ au_event.3 getauevnonam.3 \ - au_event.3 free_au_event.3 \ au_io.3 au_fetch_tok.3 \ au_io.3 au_print_tok.3 \ au_io.3 au_read_rec.3 \ au_mask.3 au_preselect.3 \ au_mask.3 getauditflagsbin.3 \ au_mask.3 getauditflagschar.3 \ - au_user.3 free_au_user_ent.3 \ au_user.3 setauuser.3 \ au_user.3 endauuser.3 \ au_user.3 getauuserent.3 \ From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:05:07 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 55A3E16A44D; Mon, 16 Jan 2006 00:05:06 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F249B16A41F for ; Mon, 16 Jan 2006 00:05:05 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B443943D45 for ; Mon, 16 Jan 2006 00:05:05 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G055L7031304 for ; Mon, 16 Jan 2006 00:05:05 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G055pl031299 for perforce@freebsd.org; Mon, 16 Jan 2006 00:05:05 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:05:05 GMT Message-Id: <200601160005.k0G055pl031299@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89765 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:05:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=89765 Change 89765 by rwatson@rwatson_zoo on 2006/01/16 00:04:47 Integrate TrustedBSD OpenBSM branch into TrustedBSD audit3: - Remove MLINKs for APIs now removed. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/Makefile#3 integrate Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/Makefile#3 (text+ko) ==== @@ -34,7 +34,6 @@ au_user.3 MLINKS= libbsm.3 bsm.3 \ - au_class.3 free_au_class_ent.3 \ au_class.3 getauclassent.3 \ au_class.3 getauclassnam.3 \ au_class.3 setauclass.3 \ @@ -45,21 +44,18 @@ au_control.3 getacmin.3 \ au_control.3 getacflg.3 \ au_control.3 getacna.3 \ - au_event.3 free_au_event_ent.3 \ au_event.3 setauevent.3 \ au_event.3 endauevent.3 \ au_event.3 getauevent.3 \ au_event.3 getauevnam.3 \ au_event.3 getauevnum.3 \ au_event.3 getauevnonam.3 \ - au_event.3 free_au_event.3 \ au_io.3 au_fetch_tok.3 \ au_io.3 au_print_tok.3 \ au_io.3 au_read_rec.3 \ au_mask.3 au_preselect.3 \ au_mask.3 getauditflagsbin.3 \ au_mask.3 getauditflagschar.3 \ - au_user.3 free_au_user_ent.3 \ au_user.3 setauuser.3 \ au_user.3 endauuser.3 \ au_user.3 getauuserent.3 \ From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:07:09 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 18AA216A423; Mon, 16 Jan 2006 00:07:09 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E585516A420 for ; Mon, 16 Jan 2006 00:07:08 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A895E43D45 for ; Mon, 16 Jan 2006 00:07:08 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G078Np031662 for ; Mon, 16 Jan 2006 00:07:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G078rd031659 for perforce@freebsd.org; Mon, 16 Jan 2006 00:07:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:07:08 GMT Message-Id: <200601160007.k0G078rd031659@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89766 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:07:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=89766 Change 89766 by rwatson@rwatson_zoo on 2006/01/16 00:06:08 Remove references to au_free_*(). Affected files ... .. //depot/projects/trustedbsd/audit3/lib/libbsm/Makefile#13 edit Differences ... ==== //depot/projects/trustedbsd/audit3/lib/libbsm/Makefile#13 (text+ko) ==== @@ -62,7 +62,6 @@ setauid.2 MLINKS= libbsm.3 bsm.3 \ - au_class.3 free_au_class_ent.3 \ au_class.3 getauclassent.3 \ au_class.3 getauclassnam.3 \ au_class.3 setauclass.3 \ @@ -73,21 +72,18 @@ au_control.3 getacmin.3 \ au_control.3 getacflg.3 \ au_control.3 getacna.3 \ - au_event.3 free_au_event_ent.3 \ au_event.3 setauevent.3 \ au_event.3 endauevent.3 \ au_event.3 getauevent.3 \ au_event.3 getauevnam.3 \ au_event.3 getauevnum.3 \ au_event.3 getauevnonam.3 \ - au_event.3 free_au_event.3 \ au_io.3 au_fetch_tok.3 \ au_io.3 au_print_tok.3 \ au_io.3 au_read_rec.3 \ au_mask.3 au_preselect.3 \ au_mask.3 getauditflagsbin.3 \ au_mask.3 getauditflagschar.3 \ - au_user.3 free_au_user_ent.3 \ au_user.3 setauuser.3 \ au_user.3 endauuser.3 \ au_user.3 getauuserent.3 \ From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:12:16 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C7C8A16A422; Mon, 16 Jan 2006 00:12:15 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B80116A41F for ; Mon, 16 Jan 2006 00:12:15 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 514F543D46 for ; Mon, 16 Jan 2006 00:12:15 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G0CFvZ031897 for ; Mon, 16 Jan 2006 00:12:15 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G0CFno031894 for perforce@freebsd.org; Mon, 16 Jan 2006 00:12:15 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:12:15 GMT Message-Id: <200601160012.k0G0CFno031894@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89767 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:12:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=89767 Change 89767 by rwatson@rwatson_peppercorn on 2006/01/16 00:12:13 Since we have a (up) pointer, use it. Found by: Coverity Prevent (tm) Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_user.c#10 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_user.c#10 (text+ko) ==== @@ -214,7 +214,8 @@ /* Get user mask. */ if ((up = getauusernam_r(&u, username)) != NULL) { - if (-1 == getfauditflags(&u.au_always, &u.au_never, mask_p)) + if (-1 == getfauditflags(&up->au_always, &up->au_never, + mask_p)) return (-1); return (0); } From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:15:20 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E5C2216A422; Mon, 16 Jan 2006 00:15:19 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEED116A41F for ; Mon, 16 Jan 2006 00:15:19 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 814EA43D45 for ; Mon, 16 Jan 2006 00:15:19 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G0FJDF032149 for ; Mon, 16 Jan 2006 00:15:19 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G0FJ7h032146 for perforce@freebsd.org; Mon, 16 Jan 2006 00:15:19 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:15:19 GMT Message-Id: <200601160015.k0G0FJ7h032146@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89768 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:15:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=89768 Change 89768 by rwatson@rwatson_peppercorn on 2006/01/16 00:14:19 When aborting audit_write_failure_self() due to trying circumstances, make sure to release the subject token rather than leaking it. Found by: Coverity Prevent (tm) Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#10 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#10 (text+ko) ==== @@ -265,6 +265,7 @@ } /* tokenize and save the error message */ if ((errtok = au_to_text(errmsg)) == NULL) { + au_free_token(subject); syslog(LOG_ERR, "%s: au_to_text() failed", func); return (kAUMakeTextTokErr); } From owner-p4-projects@FreeBSD.ORG Mon Jan 16 00:16:22 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BBD7E16A422; Mon, 16 Jan 2006 00:16:21 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8096116A41F for ; Mon, 16 Jan 2006 00:16:21 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4132943D48 for ; Mon, 16 Jan 2006 00:16:21 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0G0GLM4032242 for ; Mon, 16 Jan 2006 00:16:21 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0G0GKEs032239 for perforce@freebsd.org; Mon, 16 Jan 2006 00:16:20 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 16 Jan 2006 00:16:20 GMT Message-Id: <200601160016.k0G0GKEs032239@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89769 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2006 00:16:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=89769 Change 89769 by rwatson@rwatson_peppercorn on 2006/01/16 00:15:42 In audit_write_failure(), free the subject token if we are aborting generation of the audit record. Found by: Coverity Prevent (tm) Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#11 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#11 (text+ko) ==== @@ -239,6 +239,7 @@ /* tokenize and save the error message */ if ((errtok = au_to_text(errmsg)) == NULL) { + au_free_token(subject); syslog(LOG_ERR, "%s: au_to_text() failed", func); return (kAUMakeTextTokErr); } From owner-p4-projects@FreeBSD.ORG Tue Jan 17 00:07:27 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 64D9616A423; Tue, 17 Jan 2006 00:07:26 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D3B616A41F for ; Tue, 17 Jan 2006 00:07:26 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F93143D66 for ; Tue, 17 Jan 2006 00:07:25 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0H07PhG036572 for ; Tue, 17 Jan 2006 00:07:25 GMT (envelope-from soc-andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0H07Pn9036569 for perforce@freebsd.org; Tue, 17 Jan 2006 00:07:25 GMT (envelope-from soc-andrew@freebsd.org) Date: Tue, 17 Jan 2006 00:07:25 GMT Message-Id: <200601170007.k0H07Pn9036569@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-andrew@freebsd.org using -f From: soc-andrew To: Perforce Change Reviews Cc: Subject: PERFORCE change 89807 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2006 00:07:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=89807 Change 89807 by soc-andrew@soc-andrew_serv on 2006/01/17 00:07:12 Catch up to head Affected files ... .. //depot/projects/soc2005/bsdinstaller/src/Makefile.inc1#9 integrate .. //depot/projects/soc2005/bsdinstaller/src/lib/Makefile#7 integrate .. //depot/projects/soc2005/bsdinstaller/src/release/Makefile#24 integrate .. //depot/projects/soc2005/bsdinstaller/src/release/doc/share/misc/dev.archlist.txt#7 integrate Differences ... ==== //depot/projects/soc2005/bsdinstaller/src/Makefile.inc1#9 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.531 2005/12/07 22:55:29 obrien Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.534 2006/01/02 17:52:16 dfr Exp $ # # Make command line options: # -DNO_DYNAMICROOT do not link /bin and /sbin dynamically @@ -966,7 +966,6 @@ .if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) _prebuild_libs+= kerberos5/lib/libasn1 -_prebuild_libs+= kerberos5/lib/libgssapi _prebuild_libs+= kerberos5/lib/libkrb5 _prebuild_libs+= kerberos5/lib/libroken _generic_libs+= kerberos5/lib @@ -977,7 +976,7 @@ lib/libncurses lib/libnetgraph lib/libopie lib/libpam \ lib/libradius \ lib/libsbuf lib/libtacplus lib/libutil \ - lib/libz lib/msun + lib/libz lib/msun lib/libgssapi lib/libopie__L lib/libtacplus__L: lib/libmd__L @@ -991,9 +990,7 @@ _prebuild_libs+= secure/lib/libssh secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L .if !defined(NO_KERBEROS) -secure/lib/libssh__L: kerberos5/lib/libgssapi__L kerberos5/lib/libkrb5__L \ - kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \ - kerberos5/lib/libroken__L +secure/lib/libssh__L: lib/libgssapi__L .endif .endif .endif ==== //depot/projects/soc2005/bsdinstaller/src/lib/Makefile#7 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/Makefile,v 1.208 2005/10/27 03:09:20 davidxu Exp $ +# $FreeBSD: src/lib/Makefile,v 1.209 2005/12/29 14:40:20 dfr Exp $ # To satisfy shared library or ELF linkage when only the libraries being # built are visible: @@ -28,7 +28,7 @@ libbegemot ${_libbluetooth} libbsnmp libbz2 libc ${_libc_r} \ libcalendar libcam libcompat libdevinfo libdevstat ${_libdisk} \ libedit libexpat libfetch libform libftpio libgeom ${_libgpib} \ - ${_libio} libipsec \ + libgssapi ${_libio} libipsec \ libipx libkiconv libmagic libmemstat libmenu ${_libmilter} ${_libmp} \ ${_libncp} ${_libngatm} libopie libpam libpanel libpcap \ libpmc ${_libpthread} ${_libsdp} ${_libsm} ${_libsmb} ${_libsmdb} \ ==== //depot/projects/soc2005/bsdinstaller/src/release/Makefile#24 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/Makefile,v 1.893 2005/12/15 01:14:35 iedowse Exp $ +# $FreeBSD: src/release/Makefile,v 1.896 2006/01/04 18:02:56 jhb Exp $ # # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ # [RELEASETAG=tag] @@ -35,6 +35,10 @@ # be copied; cvs update will be used instead. #EXTSRCDIR=/usr/src # +# To use a checked-out ports collection directory instead of +# checking out from a local CVS repository, set this option. +#EXTPORTSDIR=/usr/ports +# # To add other options to the CVS subcommands (co,up), set #CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'" # @@ -215,6 +219,12 @@ MFSLABEL= auto SEPARATE_LIVEFS= .elif ${TARGET_ARCH} == "amd64" +MAKE_FLOPPIES= true +FLOPPYSIZE= 1440 +FLOPPYSPLITSIZE= 1392 +FLOPPYINODE= 40000 +FLOPPYLABEL= fd1440 +BOOTINODE= 80000 MFSSIZE= 4096 MFSINODE= 8192 MFSLABEL= auto @@ -384,9 +394,15 @@ .endif rm -rf ${CHROOTDIR}/usr/ports .if !defined(NOPORTSATALL) +.if defined(EXTPORTSDIR) + cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports + # If there are distfiles downloaded removing them + rm -rf ports/distfiles/* +.else cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \ co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE} .endif +.endif .if !defined(NODOC) rm -rf ${CHROOTDIR}/usr/doc .if defined(EXTDOCDIR) @@ -415,7 +431,7 @@ update ${CVSCMDARGS} -P -d -r ${RELEASETAG} .endif rm -f ${CHROOTDIR}/tmp/.world_done -.if !defined(NOPORTS) +.if !defined(NOPORTS) && !defined(EXTPORTSDIR) cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \ update ${CVSCMDARGS} -P -d rm -f ${CHROOTDIR}/tmp/.skip_ports_index @@ -1322,6 +1338,9 @@ .if !exists(${ACPI_KO}) @echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf .endif +.if defined(SPLIT_MFSROOT) + @echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf +.endif .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT} @echo "-P" >> ${IMAGEDIR}/boot.config .endif ==== //depot/projects/soc2005/bsdinstaller/src/release/doc/share/misc/dev.archlist.txt#7 (text+ko) ==== @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $FreeBSD: src/release/doc/share/misc/dev.archlist.txt,v 1.72 2005/11/28 16:53:16 brueffer Exp $ +# $FreeBSD: src/release/doc/share/misc/dev.archlist.txt,v 1.74 2005/12/28 08:35:30 simon Exp $ # # @@ -49,7 +49,7 @@ aue i386,pc98,ia64,amd64 awi i386,pc98,amd64 axe i386,pc98,amd64 -bge i386,pc98,ia64,amd64 +bge i386,pc98,sparc64,ia64,amd64 bktr i386,pc98 bt i386,amd64 cdce i386,pc98,ia64,amd64 @@ -131,7 +131,7 @@ sr i386 ste i386,pc98,alpha,amd64 stg i386,pc98 -ti i386,pc98,amd64 +ti i386,pc98,amd64,sparc64 tl i386,pc98,alpha,amd64 trm i386,amd64 twa i386,amd64 From owner-p4-projects@FreeBSD.ORG Tue Jan 17 01:28:03 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1B3A416A422; Tue, 17 Jan 2006 01:28:03 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCC6F16A41F for ; Tue, 17 Jan 2006 01:28:02 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85E2F43D46 for ; Tue, 17 Jan 2006 01:28:02 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0H1S2fa046627 for ; Tue, 17 Jan 2006 01:28:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0H1S2jl046624 for perforce@freebsd.org; Tue, 17 Jan 2006 01:28:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 17 Jan 2006 01:28:02 GMT Message-Id: <200601170128.k0H1S2jl046624@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 89808 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2006 01:28:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=89808 Change 89808 by rwatson@rwatson_peppercorn on 2006/01/17 01:27:12 More credits. Affected files ... .. //depot/projects/trustedbsd/openbsm/README#8 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/README#8 (text+ko) ==== @@ -56,10 +56,15 @@ SPARTA, Inc. Robert Watson Wayne Salamon + Suresh Krishnaswamy + Kevin Van Vechten Tom Rhodes Wojciech Koszek Chunyang Yuan +In addition, Coverity, Inc.'s Prevent(tm) static analysis tool was used to +identify a number of bugs in the OpenBSM implementation. + Contributions The TrustedBSD Project would appreciate the contribution of bug fixes, From owner-p4-projects@FreeBSD.ORG Tue Jan 17 17:16:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D1FB516A420; Tue, 17 Jan 2006 17:16:32 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E7B416A420 for ; Tue, 17 Jan 2006 17:16:32 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5281E43D4C for ; Tue, 17 Jan 2006 17:16:31 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0HHGVKP026001 for ; Tue, 17 Jan 2006 17:16:31 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0HHGTvq025998 for perforce@freebsd.org; Tue, 17 Jan 2006 17:16:29 GMT (envelope-from jhb@freebsd.org) Date: Tue, 17 Jan 2006 17:16:29 GMT Message-Id: <200601171716.k0HHGTvq025998@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 89851 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2006 17:16:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=89851 Change 89851 by jhb@jhb_slimer on 2006/01/17 17:16:05 IFC @89850. Affected files ... .. //depot/projects/smpng/sys/Makefile#9 integrate .. //depot/projects/smpng/sys/alpha/conf/GENERIC#54 integrate .. //depot/projects/smpng/sys/alpha/include/_types.h#7 integrate .. //depot/projects/smpng/sys/alpha/include/param.h#16 integrate .. //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#21 integrate .. //depot/projects/smpng/sys/amd64/conf/GENERIC#41 integrate .. //depot/projects/smpng/sys/amd64/include/_types.h#7 integrate .. //depot/projects/smpng/sys/amd64/include/param.h#17 integrate .. //depot/projects/smpng/sys/arm/include/_types.h#7 integrate .. //depot/projects/smpng/sys/arm/include/param.h#9 integrate .. //depot/projects/smpng/sys/boot/common/module.c#7 integrate .. //depot/projects/smpng/sys/cam/cam_periph.c#20 integrate .. //depot/projects/smpng/sys/cam/cam_xpt.c#33 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#62 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_sa.c#25 integrate .. //depot/projects/smpng/sys/coda/coda_vfsops.c#25 integrate .. //depot/projects/smpng/sys/conf/NOTES#112 integrate .. //depot/projects/smpng/sys/conf/files#163 integrate .. //depot/projects/smpng/sys/conf/kern.post.mk#51 integrate .. //depot/projects/smpng/sys/conf/options#112 integrate .. //depot/projects/smpng/sys/contrib/pf/net/pf_norm.c#12 integrate .. //depot/projects/smpng/sys/dev/acpi_support/acpi_ibm.c#7 integrate .. //depot/projects/smpng/sys/dev/acpica/Osd/OsdSchedule.c#27 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_smbat.c#3 integrate .. //depot/projects/smpng/sys/dev/amr/amr.c#37 integrate .. //depot/projects/smpng/sys/dev/amr/amrreg.h#8 integrate .. //depot/projects/smpng/sys/dev/an/if_an.c#49 integrate .. //depot/projects/smpng/sys/dev/asr/asr.c#30 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#33 integrate .. //depot/projects/smpng/sys/dev/ath/if_athioctl.h#11 integrate .. //depot/projects/smpng/sys/dev/ath/if_athvar.h#21 integrate .. //depot/projects/smpng/sys/dev/bge/if_bge.c#68 integrate .. //depot/projects/smpng/sys/dev/bge/if_bgereg.h#37 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed_isa.c#15 integrate .. //depot/projects/smpng/sys/dev/em/if_em.c#62 integrate .. //depot/projects/smpng/sys/dev/em/if_em.h#30 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme.c#29 integrate .. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_mod.c#12 integrate .. //depot/projects/smpng/sys/dev/ieee488/pcii.c#4 integrate .. //depot/projects/smpng/sys/dev/sn/if_sn.c#26 integrate .. //depot/projects/smpng/sys/dev/sound/isa/ess.c#17 integrate .. //depot/projects/smpng/sys/dev/sound/pci/ds1.c#19 integrate .. //depot/projects/smpng/sys/dev/sound/pci/es137x.c#20 integrate .. //depot/projects/smpng/sys/dev/sound/pci/fm801.c#18 integrate .. //depot/projects/smpng/sys/dev/sound/pci/ich.c#38 integrate .. //depot/projects/smpng/sys/dev/sound/pci/maestro.c#17 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/ac97.c#32 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/dsp.c#33 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/vchan.c#13 integrate .. //depot/projects/smpng/sys/dev/syscons/syscons.c#53 integrate .. //depot/projects/smpng/sys/dev/usb/ehci.c#22 integrate .. //depot/projects/smpng/sys/dev/usb/ehci_pci.c#18 integrate .. //depot/projects/smpng/sys/dev/usb/ehcivar.h#10 integrate .. //depot/projects/smpng/sys/dev/usb/ohci.c#39 integrate .. //depot/projects/smpng/sys/dev/usb/ohci_pci.c#15 integrate .. //depot/projects/smpng/sys/dev/usb/ufoma.c#1 branch .. //depot/projects/smpng/sys/dev/usb/uhci.c#39 integrate .. //depot/projects/smpng/sys/dev/usb/umass.c#51 integrate .. //depot/projects/smpng/sys/dev/usb/usb_mem.c#6 integrate .. //depot/projects/smpng/sys/dev/usb/usb_quirks.c#17 integrate .. //depot/projects/smpng/sys/dev/usb/usb_quirks.h#6 integrate .. //depot/projects/smpng/sys/dev/usb/usb_subr.c#33 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#83 integrate .. //depot/projects/smpng/sys/dev/usb/uscanner.c#31 integrate .. //depot/projects/smpng/sys/geom/eli/g_eli.c#6 integrate .. //depot/projects/smpng/sys/geom/eli/g_eli_ctl.c#3 integrate .. //depot/projects/smpng/sys/geom/nop/g_nop.c#8 integrate .. //depot/projects/smpng/sys/geom/zero/g_zero.c#3 integrate .. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_vfsops.c#5 integrate .. //depot/projects/smpng/sys/i386/conf/GENERIC#70 integrate .. //depot/projects/smpng/sys/i386/i386/busdma_machdep.c#38 integrate .. //depot/projects/smpng/sys/i386/include/_types.h#11 integrate .. //depot/projects/smpng/sys/i386/include/param.h#17 integrate .. //depot/projects/smpng/sys/ia64/conf/GENERIC#48 integrate .. //depot/projects/smpng/sys/ia64/include/_types.h#9 integrate .. //depot/projects/smpng/sys/ia64/include/param.h#19 integrate .. //depot/projects/smpng/sys/isofs/cd9660/cd9660_vnops.c#24 integrate .. //depot/projects/smpng/sys/kern/kern_conf.c#47 integrate .. //depot/projects/smpng/sys/kern/kern_mutex.c#116 integrate .. //depot/projects/smpng/sys/kern/kern_sx.c#33 integrate .. //depot/projects/smpng/sys/kern/kern_thr.c#30 integrate .. //depot/projects/smpng/sys/kern/md5c.c#8 integrate .. //depot/projects/smpng/sys/kern/subr_bus.c#57 integrate .. //depot/projects/smpng/sys/kern/subr_disk.c#27 integrate .. //depot/projects/smpng/sys/kern/subr_lock.c#1 branch .. //depot/projects/smpng/sys/kern/subr_taskqueue.c#28 integrate .. //depot/projects/smpng/sys/kern/subr_turnstile.c#21 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#148 integrate .. //depot/projects/smpng/sys/kern/tty.c#64 integrate .. //depot/projects/smpng/sys/kern/tty_compat.c#9 integrate .. //depot/projects/smpng/sys/kern/tty_pty.c#43 integrate .. //depot/projects/smpng/sys/kern/uipc_socket.c#79 integrate .. //depot/projects/smpng/sys/kern/uipc_usrreq.c#53 integrate .. //depot/projects/smpng/sys/kern/vfs_aio.c#67 integrate .. //depot/projects/smpng/sys/kern/vfs_bio.c#88 integrate .. //depot/projects/smpng/sys/kern/vfs_default.c#44 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#56 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#117 integrate .. //depot/projects/smpng/sys/libkern/gets.c#2 integrate .. //depot/projects/smpng/sys/modules/Makefile#114 integrate .. //depot/projects/smpng/sys/modules/ufoma/Makefile#1 branch .. //depot/projects/smpng/sys/modules/xfs/Makefile#2 integrate .. //depot/projects/smpng/sys/net/if_bridge.c#21 integrate .. //depot/projects/smpng/sys/net/if_bridgevar.h#8 integrate .. //depot/projects/smpng/sys/net/if_ef.c#22 integrate .. //depot/projects/smpng/sys/net/if_fwsubr.c#11 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_radiotap.h#6 integrate .. //depot/projects/smpng/sys/netgraph/netflow/netflow.c#11 integrate .. //depot/projects/smpng/sys/netgraph/netflow/ng_netflow.c#8 integrate .. //depot/projects/smpng/sys/netgraph/netflow/ng_netflow.h#5 integrate .. //depot/projects/smpng/sys/netgraph/netgraph.h#25 integrate .. //depot/projects/smpng/sys/netgraph/ng_base.c#43 integrate .. //depot/projects/smpng/sys/netgraph/ng_ether.c#30 integrate .. //depot/projects/smpng/sys/netgraph/ng_frame_relay.c#7 integrate .. //depot/projects/smpng/sys/netgraph/ng_lmi.c#10 integrate .. //depot/projects/smpng/sys/netgraph/ng_message.h#13 integrate .. //depot/projects/smpng/sys/netgraph/ng_parse.c#17 integrate .. //depot/projects/smpng/sys/netinet/if_ether.c#45 integrate .. //depot/projects/smpng/sys/netinet/ip_fw2.c#66 integrate .. //depot/projects/smpng/sys/netinet/ip_input.c#73 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#78 integrate .. //depot/projects/smpng/sys/netinet/tcp_syncache.c#44 integrate .. //depot/projects/smpng/sys/netinet/udp_usrreq.c#63 integrate .. //depot/projects/smpng/sys/netinet6/ip6_mroute.c#24 integrate .. //depot/projects/smpng/sys/netinet6/ip6_output.c#44 integrate .. //depot/projects/smpng/sys/netinet6/ipcomp_input.c#7 integrate .. //depot/projects/smpng/sys/netipx/ipx_input.c#16 integrate .. //depot/projects/smpng/sys/netipx/spx_usrreq.c#24 integrate .. //depot/projects/smpng/sys/netncp/ncp_conn.c#13 integrate .. //depot/projects/smpng/sys/netsmb/smb_subr.c#16 integrate .. //depot/projects/smpng/sys/nfs4client/nfs4_vfsops.c#14 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_lock.c#32 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_vfsops.c#52 integrate .. //depot/projects/smpng/sys/pc98/conf/GENERIC#60 integrate .. //depot/projects/smpng/sys/pc98/include/_types.h#3 integrate .. //depot/projects/smpng/sys/pc98/include/param.h#3 integrate .. //depot/projects/smpng/sys/pccard/cardinfo.h#8 integrate .. //depot/projects/smpng/sys/pccard/driver.h#2 delete .. //depot/projects/smpng/sys/pccard/i82365.h#12 delete .. //depot/projects/smpng/sys/pccard/meciareg.h#2 delete .. //depot/projects/smpng/sys/pccard/pccard_nbk.h#4 delete .. //depot/projects/smpng/sys/pccard/pcic_pci.h#13 delete .. //depot/projects/smpng/sys/pccard/pcicvar.h#11 delete .. //depot/projects/smpng/sys/pccard/slot.h#10 delete .. //depot/projects/smpng/sys/pci/agp.c#25 integrate .. //depot/projects/smpng/sys/pci/if_sk.c#54 integrate .. //depot/projects/smpng/sys/pci/if_skreg.h#14 integrate .. //depot/projects/smpng/sys/powerpc/conf/GENERIC#32 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#67 integrate .. //depot/projects/smpng/sys/security/mac_bsdextended/mac_bsdextended.c#17 integrate .. //depot/projects/smpng/sys/sparc64/conf/GENERIC#63 integrate .. //depot/projects/smpng/sys/sparc64/include/in_cksum.h#3 integrate .. //depot/projects/smpng/sys/sparc64/include/trap.h#10 integrate .. //depot/projects/smpng/sys/sparc64/include/utrap.h#4 integrate .. //depot/projects/smpng/sys/sparc64/sparc64/exception.S#15 integrate .. //depot/projects/smpng/sys/sys/ioctl.h#7 integrate .. //depot/projects/smpng/sys/sys/ioctl_compat.h#5 integrate .. //depot/projects/smpng/sys/sys/lock.h#36 integrate .. //depot/projects/smpng/sys/sys/md5.h#6 integrate .. //depot/projects/smpng/sys/sys/mount.h#48 integrate .. //depot/projects/smpng/sys/sys/mutex.h#61 integrate .. //depot/projects/smpng/sys/sys/param.h#95 integrate .. //depot/projects/smpng/sys/sys/proc.h#158 integrate .. //depot/projects/smpng/sys/sys/select.h#9 integrate .. //depot/projects/smpng/sys/sys/socketvar.h#48 integrate .. //depot/projects/smpng/sys/sys/taskqueue.h#11 integrate .. //depot/projects/smpng/sys/sys/tree.h#6 integrate .. //depot/projects/smpng/sys/sys/ttychars.h#4 integrate .. //depot/projects/smpng/sys/sys/ttydev.h#4 integrate .. //depot/projects/smpng/sys/sys/turnstile.h#7 integrate .. //depot/projects/smpng/sys/sys/vnode.h#69 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_snapshot.c#54 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_softdep.c#51 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#80 integrate .. //depot/projects/smpng/sys/ufs/ufs/ufs_quota.c#30 integrate .. //depot/user/jhb/acpipci/Makefile#8 integrate .. //depot/user/jhb/acpipci/alpha/conf/GENERIC#27 integrate .. //depot/user/jhb/acpipci/alpha/include/_types.h#8 integrate .. //depot/user/jhb/acpipci/alpha/include/param.h#13 integrate .. //depot/user/jhb/acpipci/amd64/amd64/busdma_machdep.c#19 integrate .. //depot/user/jhb/acpipci/amd64/conf/GENERIC#37 integrate .. //depot/user/jhb/acpipci/amd64/include/_types.h#6 integrate .. //depot/user/jhb/acpipci/amd64/include/param.h#16 integrate .. //depot/user/jhb/acpipci/arm/include/_types.h#8 integrate .. //depot/user/jhb/acpipci/arm/include/param.h#8 integrate .. //depot/user/jhb/acpipci/boot/common/module.c#4 integrate .. //depot/user/jhb/acpipci/cam/cam_periph.c#18 integrate .. //depot/user/jhb/acpipci/cam/cam_xpt.c#25 integrate .. //depot/user/jhb/acpipci/cam/scsi/scsi_da.c#30 integrate .. //depot/user/jhb/acpipci/cam/scsi/scsi_sa.c#19 integrate .. //depot/user/jhb/acpipci/coda/coda_vfsops.c#18 integrate .. //depot/user/jhb/acpipci/conf/NOTES#75 integrate .. //depot/user/jhb/acpipci/conf/files#98 integrate .. //depot/user/jhb/acpipci/conf/kern.post.mk#38 integrate .. //depot/user/jhb/acpipci/conf/options#65 integrate .. //depot/user/jhb/acpipci/contrib/pf/net/pf_norm.c#11 integrate .. //depot/user/jhb/acpipci/dev/acpi_support/acpi_ibm.c#6 integrate .. //depot/user/jhb/acpipci/dev/acpica/Osd/OsdSchedule.c#11 integrate .. //depot/user/jhb/acpipci/dev/acpica/acpi_smbat.c#4 integrate .. //depot/user/jhb/acpipci/dev/amr/amr.c#27 integrate .. //depot/user/jhb/acpipci/dev/amr/amrreg.h#5 integrate .. //depot/user/jhb/acpipci/dev/an/if_an.c#26 integrate .. //depot/user/jhb/acpipci/dev/asr/asr.c#21 integrate .. //depot/user/jhb/acpipci/dev/ath/if_ath.c#36 integrate .. //depot/user/jhb/acpipci/dev/ath/if_athioctl.h#10 integrate .. //depot/user/jhb/acpipci/dev/ath/if_athvar.h#21 integrate .. //depot/user/jhb/acpipci/dev/bge/if_bge.c#48 integrate .. //depot/user/jhb/acpipci/dev/bge/if_bgereg.h#29 integrate .. //depot/user/jhb/acpipci/dev/ed/if_ed_isa.c#13 integrate .. //depot/user/jhb/acpipci/dev/em/if_em.c#52 integrate .. //depot/user/jhb/acpipci/dev/em/if_em.h#23 integrate .. //depot/user/jhb/acpipci/dev/hme/if_hme.c#38 integrate .. //depot/user/jhb/acpipci/dev/hwpmc/hwpmc_mod.c#10 integrate .. //depot/user/jhb/acpipci/dev/ieee488/pcii.c#3 integrate .. //depot/user/jhb/acpipci/dev/si/si2_z280.c#6 integrate .. //depot/user/jhb/acpipci/dev/sn/if_sn.c#25 integrate .. //depot/user/jhb/acpipci/dev/sound/isa/ess.c#13 integrate .. //depot/user/jhb/acpipci/dev/sound/pci/ds1.c#14 integrate .. //depot/user/jhb/acpipci/dev/sound/pci/es137x.c#15 integrate .. //depot/user/jhb/acpipci/dev/sound/pci/fm801.c#15 integrate .. //depot/user/jhb/acpipci/dev/sound/pci/ich.c#21 integrate .. //depot/user/jhb/acpipci/dev/sound/pci/maestro.c#12 integrate .. //depot/user/jhb/acpipci/dev/sound/pcm/ac97.c#21 integrate .. //depot/user/jhb/acpipci/dev/sound/pcm/dsp.c#26 integrate .. //depot/user/jhb/acpipci/dev/sound/pcm/vchan.c#11 integrate .. //depot/user/jhb/acpipci/dev/syscons/syscons.c#30 integrate .. //depot/user/jhb/acpipci/dev/usb/ehci.c#16 integrate .. //depot/user/jhb/acpipci/dev/usb/ehci_pci.c#17 integrate .. //depot/user/jhb/acpipci/dev/usb/ehcivar.h#10 integrate .. //depot/user/jhb/acpipci/dev/usb/ohci.c#23 integrate .. //depot/user/jhb/acpipci/dev/usb/ohci_pci.c#14 integrate .. //depot/user/jhb/acpipci/dev/usb/ufoma.c#1 branch .. //depot/user/jhb/acpipci/dev/usb/uhci.c#21 integrate .. //depot/user/jhb/acpipci/dev/usb/umass.c#33 integrate .. //depot/user/jhb/acpipci/dev/usb/usb_mem.c#6 integrate .. //depot/user/jhb/acpipci/dev/usb/usb_quirks.c#15 integrate .. //depot/user/jhb/acpipci/dev/usb/usb_quirks.h#6 integrate .. //depot/user/jhb/acpipci/dev/usb/usb_subr.c#21 integrate .. //depot/user/jhb/acpipci/dev/usb/usbdevs#52 integrate .. //depot/user/jhb/acpipci/dev/usb/uscanner.c#23 integrate .. //depot/user/jhb/acpipci/geom/eli/g_eli.c#7 integrate .. //depot/user/jhb/acpipci/geom/eli/g_eli_ctl.c#3 integrate .. //depot/user/jhb/acpipci/geom/nop/g_nop.c#8 integrate .. //depot/user/jhb/acpipci/geom/zero/g_zero.c#3 integrate .. //depot/user/jhb/acpipci/gnu/fs/ext2fs/ext2_vfsops.c#4 integrate .. //depot/user/jhb/acpipci/i386/conf/GENERIC#44 integrate .. //depot/user/jhb/acpipci/i386/i386/busdma_machdep.c#25 integrate .. //depot/user/jhb/acpipci/i386/include/_types.h#11 integrate .. //depot/user/jhb/acpipci/i386/include/param.h#12 integrate .. //depot/user/jhb/acpipci/ia64/conf/GENERIC#23 integrate .. //depot/user/jhb/acpipci/ia64/include/_types.h#10 integrate .. //depot/user/jhb/acpipci/ia64/include/param.h#14 integrate .. //depot/user/jhb/acpipci/isofs/cd9660/cd9660_vnops.c#21 integrate .. //depot/user/jhb/acpipci/kern/kern_conf.c#34 integrate .. //depot/user/jhb/acpipci/kern/kern_mutex.c#31 integrate .. //depot/user/jhb/acpipci/kern/kern_sx.c#11 integrate .. //depot/user/jhb/acpipci/kern/kern_thr.c#22 integrate .. //depot/user/jhb/acpipci/kern/md5c.c#7 integrate .. //depot/user/jhb/acpipci/kern/subr_bus.c#46 integrate .. //depot/user/jhb/acpipci/kern/subr_disk.c#16 integrate .. //depot/user/jhb/acpipci/kern/subr_lock.c#1 branch .. //depot/user/jhb/acpipci/kern/subr_taskqueue.c#16 integrate .. //depot/user/jhb/acpipci/kern/subr_turnstile.c#15 integrate .. //depot/user/jhb/acpipci/kern/subr_witness.c#50 integrate .. //depot/user/jhb/acpipci/kern/tty.c#34 integrate .. //depot/user/jhb/acpipci/kern/tty_compat.c#8 integrate .. //depot/user/jhb/acpipci/kern/tty_pty.c#30 integrate .. //depot/user/jhb/acpipci/kern/uipc_socket.c#51 integrate .. //depot/user/jhb/acpipci/kern/uipc_usrreq.c#31 integrate .. //depot/user/jhb/acpipci/kern/vfs_aio.c#32 integrate .. //depot/user/jhb/acpipci/kern/vfs_bio.c#51 integrate .. //depot/user/jhb/acpipci/kern/vfs_default.c#32 integrate .. //depot/user/jhb/acpipci/kern/vfs_mount.c#43 integrate .. //depot/user/jhb/acpipci/kern/vfs_subr.c#68 integrate .. //depot/user/jhb/acpipci/libkern/gets.c#2 integrate .. //depot/user/jhb/acpipci/modules/Makefile#72 integrate .. //depot/user/jhb/acpipci/modules/ufoma/Makefile#1 branch .. //depot/user/jhb/acpipci/modules/xfs/Makefile#2 integrate .. //depot/user/jhb/acpipci/net/if_bridge.c#24 integrate .. //depot/user/jhb/acpipci/net/if_bridgevar.h#8 integrate .. //depot/user/jhb/acpipci/net/if_ef.c#17 integrate .. //depot/user/jhb/acpipci/net/if_fwsubr.c#14 integrate .. //depot/user/jhb/acpipci/net80211/ieee80211_radiotap.h#6 integrate .. //depot/user/jhb/acpipci/netgraph/netflow/netflow.c#11 integrate .. //depot/user/jhb/acpipci/netgraph/netflow/ng_netflow.c#8 integrate .. //depot/user/jhb/acpipci/netgraph/netflow/ng_netflow.h#5 integrate .. //depot/user/jhb/acpipci/netgraph/netgraph.h#24 integrate .. //depot/user/jhb/acpipci/netgraph/ng_base.c#32 integrate .. //depot/user/jhb/acpipci/netgraph/ng_ether.c#24 integrate .. //depot/user/jhb/acpipci/netgraph/ng_frame_relay.c#6 integrate .. //depot/user/jhb/acpipci/netgraph/ng_lmi.c#9 integrate .. //depot/user/jhb/acpipci/netgraph/ng_message.h#12 integrate .. //depot/user/jhb/acpipci/netgraph/ng_parse.c#11 integrate .. //depot/user/jhb/acpipci/netinet/if_ether.c#31 integrate .. //depot/user/jhb/acpipci/netinet/ip_fw2.c#59 integrate .. //depot/user/jhb/acpipci/netinet/ip_input.c#48 integrate .. //depot/user/jhb/acpipci/netinet/tcp_input.c#50 integrate .. //depot/user/jhb/acpipci/netinet/tcp_syncache.c#32 integrate .. //depot/user/jhb/acpipci/netinet/udp_usrreq.c#36 integrate .. //depot/user/jhb/acpipci/netinet6/ip6_mroute.c#18 integrate .. //depot/user/jhb/acpipci/netinet6/ip6_output.c#31 integrate .. //depot/user/jhb/acpipci/netinet6/ipcomp_input.c#4 integrate .. //depot/user/jhb/acpipci/netipx/ipx_input.c#12 integrate .. //depot/user/jhb/acpipci/netipx/spx_usrreq.c#19 integrate .. //depot/user/jhb/acpipci/netncp/ncp_conn.c#9 integrate .. //depot/user/jhb/acpipci/netsmb/smb_subr.c#10 integrate .. //depot/user/jhb/acpipci/nfs4client/nfs4_vfsops.c#12 integrate .. //depot/user/jhb/acpipci/nfsclient/nfs_lock.c#13 integrate .. //depot/user/jhb/acpipci/nfsclient/nfs_vfsops.c#36 integrate .. //depot/user/jhb/acpipci/pc98/conf/GENERIC#35 integrate .. //depot/user/jhb/acpipci/pc98/include/_types.h#3 integrate .. //depot/user/jhb/acpipci/pc98/include/param.h#3 integrate .. //depot/user/jhb/acpipci/pccard/cardinfo.h#4 integrate .. //depot/user/jhb/acpipci/pccard/driver.h#2 delete .. //depot/user/jhb/acpipci/pccard/i82365.h#5 delete .. //depot/user/jhb/acpipci/pccard/meciareg.h#2 delete .. //depot/user/jhb/acpipci/pccard/pccard_nbk.h#3 delete .. //depot/user/jhb/acpipci/pccard/pcic_pci.h#4 delete .. //depot/user/jhb/acpipci/pccard/pcicvar.h#3 delete .. //depot/user/jhb/acpipci/pccard/slot.h#5 delete .. //depot/user/jhb/acpipci/pci/agp.c#23 integrate .. //depot/user/jhb/acpipci/pci/if_sk.c#42 integrate .. //depot/user/jhb/acpipci/pci/if_skreg.h#13 integrate .. //depot/user/jhb/acpipci/powerpc/conf/GENERIC#21 integrate .. //depot/user/jhb/acpipci/powerpc/powerpc/machdep.c#34 integrate .. //depot/user/jhb/acpipci/security/mac_bsdextended/mac_bsdextended.c#16 integrate .. //depot/user/jhb/acpipci/sparc64/conf/GENERIC#36 integrate .. //depot/user/jhb/acpipci/sparc64/include/in_cksum.h#3 integrate .. //depot/user/jhb/acpipci/sparc64/include/trap.h#4 integrate .. //depot/user/jhb/acpipci/sparc64/include/utrap.h#4 integrate .. //depot/user/jhb/acpipci/sparc64/sparc64/exception.S#12 integrate .. //depot/user/jhb/acpipci/sys/ioctl.h#6 integrate .. //depot/user/jhb/acpipci/sys/ioctl_compat.h#5 integrate .. //depot/user/jhb/acpipci/sys/lock.h#13 integrate .. //depot/user/jhb/acpipci/sys/md5.h#4 integrate .. //depot/user/jhb/acpipci/sys/mount.h#32 integrate .. //depot/user/jhb/acpipci/sys/mutex.h#20 integrate .. //depot/user/jhb/acpipci/sys/param.h#54 integrate .. //depot/user/jhb/acpipci/sys/proc.h#80 integrate .. //depot/user/jhb/acpipci/sys/select.h#7 integrate .. //depot/user/jhb/acpipci/sys/socketvar.h#29 integrate .. //depot/user/jhb/acpipci/sys/taskqueue.h#10 integrate .. //depot/user/jhb/acpipci/sys/tree.h#6 integrate .. //depot/user/jhb/acpipci/sys/ttychars.h#4 integrate .. //depot/user/jhb/acpipci/sys/ttydev.h#4 integrate .. //depot/user/jhb/acpipci/sys/turnstile.h#7 integrate .. //depot/user/jhb/acpipci/sys/vnode.h#43 integrate .. //depot/user/jhb/acpipci/ufs/ffs/ffs_snapshot.c#35 integrate .. //depot/user/jhb/acpipci/ufs/ffs/ffs_softdep.c#30 integrate .. //depot/user/jhb/acpipci/ufs/ffs/ffs_vfsops.c#45 integrate .. //depot/user/jhb/acpipci/ufs/ufs/ufs_quota.c#16 integrate Differences ... ==== //depot/projects/smpng/sys/Makefile#9 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/Makefile,v 1.33 2005/03/08 00:09:41 grog Exp $ +# $FreeBSD: src/sys/Makefile,v 1.34 2006/01/10 20:58:27 rees Exp $ # The boot loader .if !defined(NO_BOOT) @@ -11,7 +11,8 @@ CSCOPEDIRS= coda compat conf contrib crypto ddb dev fs gnu i4b isa \ isofs kern libkern modules net netatalk netatm netgraph \ netinet netinet6 netipx netkey netnatm netncp netsmb nfs \ - pccard pci posix4 sys ufs vm ${ARCHDIR} + nfsclient nfs4client rpc pccard pci posix4 sys ufs vm \ + ${ARCHDIR} ARCHDIR ?= ${MACHINE} ==== //depot/projects/smpng/sys/alpha/conf/GENERIC#54 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.191 2005/11/27 23:16:58 ru Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.192 2006/01/10 09:19:07 phk Exp $ cpu EV4 cpu EV5 @@ -61,6 +61,7 @@ options PSEUDOFS # Pseudo-filesystem framework options GEOM_GPT # GUID Partition Tables. options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI ==== //depot/projects/smpng/sys/alpha/include/_types.h#7 (text+ko) ==== @@ -33,7 +33,7 @@ * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD: src/sys/alpha/include/_types.h,v 1.7 2006/01/01 20:59:27 imp Exp $ + * $FreeBSD: src/sys/alpha/include/_types.h,v 1.8 2006/01/09 06:05:55 imp Exp $ */ #ifndef _MACHINE__TYPES_H_ @@ -43,8 +43,6 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -#define __PCI_REROUTE_INTERRUPT - /* * Basic types upon which most other types are built. */ ==== //depot/projects/smpng/sys/alpha/include/param.h#16 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/include/param.h,v 1.40 2005/12/06 13:27:20 ru Exp $ */ +/* $FreeBSD: src/sys/alpha/include/param.h,v 1.41 2006/01/09 06:05:55 imp Exp $ */ /* From: NetBSD: param.h,v 1.20 1997/09/19 13:52:53 leo Exp */ /*- @@ -66,6 +66,8 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __PCI_REROUTE_INTERRUPT + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ ==== //depot/projects/smpng/sys/amd64/amd64/busdma_machdep.c#21 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.72 2005/12/16 05:57:18 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.73 2006/01/14 17:22:46 scottl Exp $"); #include #include @@ -285,8 +285,10 @@ /* Must bounce */ - if ((error = alloc_bounce_zone(newtag)) != 0) + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); return (error); + } bz = newtag->bounce_zone; if (ptoa(bz->total_bpages) < maxsize) { ==== //depot/projects/smpng/sys/amd64/conf/GENERIC#41 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.447 2005/11/27 23:16:58 ru Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.449 2006/01/12 01:20:59 obrien Exp $ cpu HAMMER ident GENERIC @@ -46,10 +46,10 @@ options PSEUDOFS # Pseudo-filesystem framework options GEOM_GPT # GUID Partition Tables. options COMPAT_43 # Needed by COMPAT_LINUX32 +options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options COMPAT_IA32 # Compatible with i386 binaries options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -options COMPAT_LINUX32 # Compatible with i386 linux binaries options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory @@ -77,6 +77,7 @@ options SMP # Symmetric MultiProcessor Kernel # Linux 32-bit ABI support +options COMPAT_LINUX32 # Compatible with i386 linux binaries options LINPROCFS # Cannot be a module yet. # Bus support. ==== //depot/projects/smpng/sys/amd64/include/_types.h#7 (text+ko) ==== @@ -33,7 +33,7 @@ * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD: src/sys/amd64/include/_types.h,v 1.10 2006/01/01 20:59:27 imp Exp $ + * $FreeBSD: src/sys/amd64/include/_types.h,v 1.11 2006/01/09 06:05:56 imp Exp $ */ #ifndef _MACHINE__TYPES_H_ @@ -44,8 +44,6 @@ #endif #define __NO_STRICT_ALIGNMENT -#define __HAVE_ACPI -#define __PCI_REROUTE_INTERRUPT /* * Basic types upon which most other types are built. ==== //depot/projects/smpng/sys/amd64/include/param.h#17 (text+ko) ==== @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)param.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: src/sys/amd64/include/param.h,v 1.19 2005/12/06 13:27:20 ru Exp $ + * $FreeBSD: src/sys/amd64/include/param.h,v 1.20 2006/01/09 06:05:56 imp Exp $ */ /* @@ -66,6 +66,9 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __HAVE_ACPI +#define __PCI_REROUTE_INTERRUPT + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ ==== //depot/projects/smpng/sys/arm/include/_types.h#7 (text+ko) ==== @@ -33,7 +33,7 @@ * * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD: src/sys/arm/include/_types.h,v 1.7 2006/01/01 20:59:27 imp Exp $ + * $FreeBSD: src/sys/arm/include/_types.h,v 1.8 2006/01/09 06:05:56 imp Exp $ */ #ifndef _MACHINE__TYPES_H_ @@ -43,8 +43,6 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -#define __PCI_REROUTE_INTERRUPT - /* * Basic types upon which most other types are built. */ ==== //depot/projects/smpng/sys/arm/include/param.h#9 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)param.h 5.8 (Berkeley) 6/28/91 - * $FreeBSD: src/sys/arm/include/param.h,v 1.10 2005/12/06 13:27:20 ru Exp $ + * $FreeBSD: src/sys/arm/include/param.h,v 1.11 2006/01/09 06:05:56 imp Exp $ */ /* @@ -59,6 +59,8 @@ #ifndef _NO_NAMESPACE_POLLUTION +#define __PCI_REROUTE_INTERRUPT + #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ ==== //depot/projects/smpng/sys/boot/common/module.c#7 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/common/module.c,v 1.25 2003/08/25 23:30:41 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/module.c,v 1.26 2006/01/12 13:18:49 marius Exp $"); /* * file/module function dispatcher, support, etc. @@ -864,7 +864,8 @@ if (mdp->d_hints != NULL || (mdp->d_flags & MDIR_NOHINTS)) return; path = moduledir_fullpath(mdp, "linker.hints"); - if (stat(path, &st) != 0 || st.st_size < (sizeof(version) + sizeof(int)) || + if (stat(path, &st) != 0 || + st.st_size < (ssize_t)(sizeof(version) + sizeof(int)) || st.st_size > 100 * 1024 || (fd = open(path, O_RDONLY)) < 0) { free(path); mdp->d_flags |= MDIR_NOHINTS; ==== //depot/projects/smpng/sys/cam/cam_periph.c#20 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.60 2005/07/01 15:21:29 avatar Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.61 2006/01/08 20:04:55 iedowse Exp $"); #include #include @@ -1656,6 +1656,8 @@ case CAM_NO_HBA: case CAM_PROVIDE_FAIL: case CAM_REQ_TOO_BIG: + case CAM_LUN_INVALID: + case CAM_TID_INVALID: error = EINVAL; break; case CAM_SCSI_BUS_RESET: ==== //depot/projects/smpng/sys/cam/cam_xpt.c#33 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.156 2005/09/16 01:26:17 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/cam_xpt.c,v 1.157 2006/01/11 02:06:08 iedowse Exp $"); #include #include @@ -682,6 +682,18 @@ static struct intr_config_hook *xpt_config_hook; +static void dead_sim_action(struct cam_sim *sim, union ccb *ccb); +static void dead_sim_poll(struct cam_sim *sim); + +/* Dummy SIM that is used when the real one has gone. */ +static struct cam_sim cam_dead_sim = { + .sim_action = dead_sim_action, + .sim_poll = dead_sim_poll, + .sim_name = "dead_sim", +}; + +#define SIM_DEAD(sim) ((sim) == &cam_dead_sim) + /* Registered busses */ static TAILQ_HEAD(,cam_eb) xpt_busses; static u_int bus_generation; @@ -3055,12 +3067,22 @@ case XPT_ENG_EXEC: { struct cam_path *path; + struct cam_sim *sim; int s; int runq; path = start_ccb->ccb_h.path; s = splsoftcam(); + sim = path->bus->sim; + if (SIM_DEAD(sim)) { + /* The SIM has gone; just execute the CCB directly. */ + cam_ccbq_send_ccb(&path->device->ccbq, start_ccb); + (*(sim->sim_action))(sim, start_ccb); + splx(s); + break; + } + cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); if (path->device->qfrozen_cnt == 0) runq = xpt_schedule_dev_sendq(path->bus, path->device); @@ -3641,8 +3663,8 @@ dev->ccbq.devq_openings--; dev->ccbq.dev_openings--; - while((devq->send_openings <= 0 || dev->ccbq.dev_openings < 0) - && (--timeout > 0)) { + while(((devq != NULL && devq->send_openings <= 0) || + dev->ccbq.dev_openings < 0) && (--timeout > 0)) { DELAY(1000); (*(sim->sim_poll))(sim); camisr(&cam_bioq); @@ -3684,6 +3706,7 @@ xpt_schedule(struct cam_periph *perph, u_int32_t new_priority) { struct cam_ed *device; + union ccb *work_ccb; int s; int runq; @@ -3702,6 +3725,16 @@ new_priority); } runq = 0; + } else if (SIM_DEAD(perph->path->bus->sim)) { + /* The SIM is gone so just call periph_start directly. */ + work_ccb = xpt_get_ccb(perph->path->device); + splx(s); + if (work_ccb == NULL) + return; /* XXX */ + xpt_setup_ccb(&work_ccb->ccb_h, perph->path, new_priority); + perph->pinfo.priority = new_priority; + perph->periph_start(perph, work_ccb); + return; } else { /* New entry on the queue */ CAM_DEBUG(perph->path, CAM_DEBUG_SUBTRACE, @@ -4337,6 +4370,10 @@ } else { SLIST_INSERT_HEAD(&ccb_freeq, &free_ccb->ccb_h, xpt_links.sle); } + if (bus->sim->devq == NULL) { + splx(s); + return; + } bus->sim->devq->alloc_openings++; bus->sim->devq->alloc_active--; /* XXX Turn this into an inline function - xpt_run_device?? */ @@ -4422,6 +4459,12 @@ xpt_bus_deregister(path_id_t pathid) { struct cam_path bus_path; + struct cam_ed *device; + struct cam_ed_qinfo *qinfo; + struct cam_devq *devq; + struct cam_periph *periph; + struct cam_sim *ccbsim; + union ccb *work_ccb; cam_status status; GIANT_REQUIRED; @@ -4433,11 +4476,51 @@ xpt_async(AC_LOST_DEVICE, &bus_path, NULL); xpt_async(AC_PATH_DEREGISTERED, &bus_path, NULL); - + + /* The SIM may be gone, so use a dummy SIM for any stray operations. */ + devq = bus_path.bus->sim->devq; + bus_path.bus->sim = &cam_dead_sim; + + /* Execute any pending operations now. */ + while ((qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->send_queue, + CAMQ_HEAD)) != NULL || + (qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->alloc_queue, + CAMQ_HEAD)) != NULL) { + do { + device = qinfo->device; + work_ccb = cam_ccbq_peek_ccb(&device->ccbq, CAMQ_HEAD); + if (work_ccb != NULL) { + devq->active_dev = device; + cam_ccbq_remove_ccb(&device->ccbq, work_ccb); + cam_ccbq_send_ccb(&device->ccbq, work_ccb); + ccbsim = work_ccb->ccb_h.path->bus->sim; + (*(ccbsim->sim_action))(ccbsim, work_ccb); + } + + periph = (struct cam_periph *)camq_remove(&device->drvq, + CAMQ_HEAD); + if (periph != NULL) + xpt_schedule(periph, periph->pinfo.priority); + } while (work_ccb != NULL || periph != NULL); + } + + /* Make sure all completed CCBs are processed. */ + while (!TAILQ_EMPTY(&cam_bioq)) { + camisr(&cam_bioq); + + /* Repeat the async's for the benefit of any new devices. */ + xpt_async(AC_LOST_DEVICE, &bus_path, NULL); + xpt_async(AC_PATH_DEREGISTERED, &bus_path, NULL); + } + /* Release the reference count held while registered. */ xpt_release_bus(bus_path.bus); xpt_release_path(&bus_path); + /* Recheck for more completed CCBs. */ + while (!TAILQ_EMPTY(&cam_bioq)) + camisr(&cam_bioq); + return (CAM_REQ_CMP); } @@ -5021,6 +5104,9 @@ struct cam_devq *devq; cam_status status; + if (SIM_DEAD(bus->sim)) + return (NULL); + /* Make space for us in the device queue on our bus */ devq = bus->sim->devq; status = cam_devq_resize(devq, devq->alloc_queue.array_size + 1); @@ -5131,9 +5217,11 @@ TAILQ_REMOVE(&target->ed_entries, device,links); target->generation++; xpt_max_ccbs -= device->ccbq.devq_openings; - /* Release our slot in the devq */ - devq = bus->sim->devq; - cam_devq_resize(devq, devq->alloc_queue.array_size - 1); + if (!SIM_DEAD(bus->sim)) { + /* Release our slot in the devq */ + devq = bus->sim->devq; + cam_devq_resize(devq, devq->alloc_queue.array_size - 1); + } splx(s); camq_fini(&device->drvq); camq_fini(&device->ccbq.queue); @@ -7096,8 +7184,10 @@ s = splcam(); cam_ccbq_ccb_done(&dev->ccbq, (union ccb *)ccb_h); - ccb_h->path->bus->sim->devq->send_active--; - ccb_h->path->bus->sim->devq->send_openings++; + if (!SIM_DEAD(ccb_h->path->bus->sim)) { + ccb_h->path->bus->sim->devq->send_active--; + ccb_h->path->bus->sim->devq->send_openings++; + } splx(s); if (((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0 @@ -7145,3 +7235,16 @@ } splx(s); } + +static void +dead_sim_action(struct cam_sim *sim, union ccb *ccb) +{ + + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + xpt_done(ccb); +} + +static void +dead_sim_poll(struct cam_sim *sim) +{ +} ==== //depot/projects/smpng/sys/cam/scsi/scsi_da.c#62 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.183 2005/12/19 03:43:48 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.184 2006/01/13 11:33:40 mnag Exp $"); #include @@ -363,6 +363,22 @@ {T_DIRECT, SIP_MEDIA_REMOVABLE, "Motorola" , "Motorola Phone", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * Qware BeatZkey! Pro + * PR: usb/79164 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "GENERIC", "USB DISK DEVICE", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* + * Time DPA20B 1GB MP3 Player + * PR: usb/81846 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "USB2.0*", "(FS) FLASH DISK*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, }; static disk_strategy_t dastrategy; ==== //depot/projects/smpng/sys/cam/scsi/scsi_sa.c#25 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.105 2005/07/01 15:21:30 avatar Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.106 2006/01/14 14:32:41 mjacob Exp $"); #include #include @@ -44,6 +44,7 @@ #ifdef _KERNEL #include #endif +#include #include #ifndef _KERNEL @@ -255,8 +256,10 @@ * Misc other flags/state */ u_int32_t - : 31, - ctrl_mode : 1; /* control device open */ + : 29, + open_rdonly : 1, /* open read-only */ + open_pending_mount : 1, /* open pending mount */ + ctrl_mode : 1; /* control device open */ }; struct sa_quirk_entry { @@ -468,23 +471,37 @@ cam_periph_unlock(periph); return (ENXIO); } + if (SA_IS_CTRL(dev)) { softc->ctrl_mode = 1; cam_periph_unlock(periph); return (0); } - if (softc->flags & SA_FLAG_OPEN) { error = EBUSY; } else if (softc->flags & SA_FLAG_INVALID) { error = ENXIO; } else { /* + * Preserve whether this is a read_only open. + */ + softc->open_rdonly = (flags & O_RDWR) == O_RDONLY; + + /* * The function samount ensures media is loaded and ready. * It also does a device RESERVE if the tape isn't yet mounted. + * + * If the mount fails and this was a non-blocking open, + * make this a 'open_pending_mount' action. */ error = samount(periph, flags, dev); + if (error && (flags & O_NONBLOCK)) { + softc->flags |= SA_FLAG_OPEN; + softc->open_pending_mount = 1; + cam_periph_unlock(periph); + return (0); + } } if (error) { @@ -521,6 +538,7 @@ return (error); } + softc->open_rdonly = 0; if (SA_IS_CTRL(dev)) { softc->ctrl_mode = 0; cam_periph_release(periph); @@ -528,6 +546,14 @@ return (0); } + if (softc->open_pending_mount) { + softc->flags &= ~SA_FLAG_OPEN; + softc->open_pending_mount = 0; + cam_periph_release(periph); + cam_periph_unlock(periph); + return (0); + } + /* * Were we writing the tape? */ @@ -681,10 +707,32 @@ return; } + /* + * This should actually never occur as the write(2) + * system call traps attempts to write to a read-only + * file descriptor. + */ + if (bp->bio_cmd == BIO_WRITE && softc->open_rdonly) { + splx(s); + biofinish(bp, NULL, EBADF); + return; + } + splx(s); + if (softc->open_pending_mount) { + int error = samount(periph, 0, bp->bio_dev); + if (error) { + biofinish(bp, NULL, ENXIO); + return; + } + saprevent(periph, PR_PREVENT); + softc->open_pending_mount = 0; + } + >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Jan 18 01:10:19 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9119316A422; Wed, 18 Jan 2006 01:10:18 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A95116A41F for ; Wed, 18 Jan 2006 01:10:18 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 219BA43D45 for ; Wed, 18 Jan 2006 01:10:18 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I1AIwK095157 for ; Wed, 18 Jan 2006 01:10:18 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I1AHJU095154 for perforce@freebsd.org; Wed, 18 Jan 2006 01:10:17 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 01:10:17 GMT Message-Id: <200601180110.k0I1AHJU095154@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89879 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 01:10:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=89879 Change 89879 by imp@imp_Speedy on 2006/01/18 01:09:47 Don't destroy the lock on success. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/if_ate.c#21 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#21 (text+ko) ==== @@ -209,9 +209,10 @@ */ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, ate_intr, sc, &sc->intrhand); - if (err) + if (err) { ether_ifdetach(ifp); - ATE_LOCK_DESTROY(sc); + ATE_LOCK_DESTROY(sc); + } out:; if (err) ate_deactivate(dev); From owner-p4-projects@FreeBSD.ORG Wed Jan 18 01:18:29 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C068616A422; Wed, 18 Jan 2006 01:18:28 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A4D616A41F for ; Wed, 18 Jan 2006 01:18:28 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6831943D46 for ; Wed, 18 Jan 2006 01:18:28 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I1ISum095434 for ; Wed, 18 Jan 2006 01:18:28 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I1IS9m095430 for perforce@freebsd.org; Wed, 18 Jan 2006 01:18:28 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 01:18:28 GMT Message-Id: <200601180118.k0I1IS9m095430@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89880 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 01:18:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=89880 Change 89880 by imp@imp_Speedy on 2006/01/18 01:18:07 Let's start the twi device. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#1 add .. //depot/projects/arm/src/sys/arm/conf/KB920X#12 edit Differences ... ==== //depot/projects/arm/src/sys/arm/conf/KB920X#12 (text+ko) ==== @@ -42,7 +42,7 @@ #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories options MD_ROOT #MD is a potential root device -options MD_ROOT_SIZE=1024 # 3MB ram disk +options MD_ROOT_SIZE=4096 # 3MB ram disk options ROOTDEVNAME=\"ufs:md0\" #options NFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server @@ -79,3 +79,4 @@ device mem # Memory and kernel memory devices device md +device at91_twi # TWI: Two Wire Interface From owner-p4-projects@FreeBSD.ORG Wed Jan 18 01:24:37 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD20316A422; Wed, 18 Jan 2006 01:24:36 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8624516A41F for ; Wed, 18 Jan 2006 01:24:36 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EBDE43D46 for ; Wed, 18 Jan 2006 01:24:36 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I1Oar2095669 for ; Wed, 18 Jan 2006 01:24:36 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I1OZCp095666 for perforce@freebsd.org; Wed, 18 Jan 2006 01:24:35 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 01:24:35 GMT Message-Id: <200601180124.k0I1OZCp095666@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89881 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 01:24:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=89881 Change 89881 by imp@imp_Speedy on 2006/01/18 01:23:51 Registers for TWI Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Wed Jan 18 05:32:36 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 17B5C16A422; Wed, 18 Jan 2006 05:32:36 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E093D16A41F for ; Wed, 18 Jan 2006 05:32:35 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD39443D48 for ; Wed, 18 Jan 2006 05:32:35 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I5WZOm014600 for ; Wed, 18 Jan 2006 05:32:35 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I5WZFE014597 for perforce@freebsd.org; Wed, 18 Jan 2006 05:32:35 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 05:32:35 GMT Message-Id: <200601180532.k0I5WZFE014597@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89886 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 05:32:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=89886 Change 89886 by imp@imp_hammer on 2006/01/18 05:32:34 I think we'll want a device to control pio. don't know if we want this optional or standard. I think we'll also want a pmc to control power. Ditto. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/files.at91rm92#9 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/files.at91rm92#9 (text+ko) ==== @@ -8,6 +8,8 @@ arm/at91/uart_dev_at91usart.c optional uart arm/at91/if_ate.c optional ate arm/at91/at91_mci.c optional at91_mci +arm/at91/at91_pio.c optional at91_pio +arm/at91/at91_pmc.c optional at91_pmc arm/at91/at91_ssc.c optional at91_ssc arm/at91/at91_spi.c optional at91_spi arm/at91/at91_twi.c optional at91_twi From owner-p4-projects@FreeBSD.ORG Wed Jan 18 05:34:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1C85F16A422; Wed, 18 Jan 2006 05:34:39 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB7B816A41F for ; Wed, 18 Jan 2006 05:34:38 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D49043D46 for ; Wed, 18 Jan 2006 05:34:38 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I5YcWJ014668 for ; Wed, 18 Jan 2006 05:34:38 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I5YcIS014665 for perforce@freebsd.org; Wed, 18 Jan 2006 05:34:38 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 05:34:38 GMT Message-Id: <200601180534.k0I5YcIS014665@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89887 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 05:34:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=89887 Change 89887 by imp@imp_hammer on 2006/01/18 05:34:25 Add-in the bits for this device, wakeup sc in the interrupt handler, include register definitions. # Still need to write a userland interface for this device. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#2 edit .. //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#2 (text+ko) ==== @@ -37,6 +37,8 @@ #include #include +#include + struct at91_twi_softc { device_t dev; /* Myself */ @@ -44,8 +46,6 @@ struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; /* basically a perimeter lock */ - - int intr; }; static inline uint32_t @@ -170,7 +170,7 @@ { struct at91_twi_softc *sc = xsc; - sc->intr++; + wakeup(sc); } static device_method_t at91_twi_methods[] = { ==== //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#2 (text+ko) ==== @@ -42,4 +42,32 @@ #define TWI_RHR 0x30 /* TWI Receiver Holding Register */ #define TWI_THR 0x34 /* TWI Transmit Holding Register */ +/* TWI_CR */ +#define TWI_CR_START (1U << 0) /* Send a start */ +#define TWT_CR_STOP (1U << 1) /* Send a stop */ +#define TWT_CR_MSEN (1U << 2) /* Master Send Enable */ +#define TWT_CR_MSDIS (1U << 3) /* Master Send Disable */ +#define TWT_CR_SWRST (1U << 7) /* Software Reset */ + +/* TWI_MMR */ +#define TWT_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ +#define TWT_MMR_MREAD (1U << 12) /* Master Read Direction */ +#define TWT_MMR_DADR(n) ((n) << 16) /* Device Address */ + +/* TWI_CWGR */ +#define TWT_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ +#define TWT_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ +#define TWT_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ + +/* TWI_SR */ +/* TWI_IER */ +/* TWI_IDR */ +/* TWI_IMR */ +#define TWT_SR_TXCOMP (1U << 0) /* Transmission Completed */ +#define TWT_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ +#define TWT_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ +#define TWT_SR_OVRE (1U << 6) /* Overrun error */ +#define TWT_SR_UNRE (1U << 7) /* Underrun Error */ +#define TWT_SR_NACK (1U << 8) /* Not Acknowledged */ + #endif /* ARM_AT91_AT91_TWIREG_H */ From owner-p4-projects@FreeBSD.ORG Wed Jan 18 09:03:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2A6F16A425; Wed, 18 Jan 2006 09:03:44 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DCA816A41F for ; Wed, 18 Jan 2006 09:03:44 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3D3843D48 for ; Wed, 18 Jan 2006 09:03:43 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I93hUD039549 for ; Wed, 18 Jan 2006 09:03:43 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I93hAX039546 for perforce@freebsd.org; Wed, 18 Jan 2006 09:03:43 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 09:03:43 GMT Message-Id: <200601180903.k0I93hAX039546@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89894 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 09:03:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=89894 Change 89894 by imp@imp_hammer on 2006/01/18 09:03:16 Add slave bits for completeness. These aren't implemented on the AT91RM9200 or AT91SAM9261, so just leave them here for now. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ #define TWI_CR 0x00 /* TWI Control Register */ #define TWI_MMR 0x04 /* TWI Master Mode Register */ - /* 0x08 reserved */ +#define TWI_SMR 0x08 /* TWI Master Mode Register */ #define TWI_IADR 0x0c /* TWI Internal Address Register */ #define TWI_CWGR 0x10 /* TWI Clock Waveform Generator Reg */ /* 0x14 reserved */ @@ -45,12 +45,16 @@ /* TWI_CR */ #define TWI_CR_START (1U << 0) /* Send a start */ #define TWT_CR_STOP (1U << 1) /* Send a stop */ -#define TWT_CR_MSEN (1U << 2) /* Master Send Enable */ -#define TWT_CR_MSDIS (1U << 3) /* Master Send Disable */ +#define TWT_CR_MSEN (1U << 2) /* Master Transfer Enable */ +#define TWT_CR_MSDIS (1U << 3) /* Master Transfer Disable */ +#define TWT_CR_SVEN (1U << 4) /* Slave Transfer Enable */ +#define TWT_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ #define TWT_CR_SWRST (1U << 7) /* Software Reset */ /* TWI_MMR */ +/* TWI_SMR */ #define TWT_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ +#define TWT_MMR_MWRITE 0U /* Master Read Direction */ #define TWT_MMR_MREAD (1U << 12) /* Master Read Direction */ #define TWT_MMR_DADR(n) ((n) << 16) /* Device Address */ @@ -58,6 +62,7 @@ #define TWT_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ #define TWT_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ #define TWT_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ +#define TWT_CWGR_DIV(rate) ((AT91C_MASTER_CLOCK / 4*(rate)) - 2) /* TWI_SR */ /* TWI_IER */ @@ -66,8 +71,12 @@ #define TWT_SR_TXCOMP (1U << 0) /* Transmission Completed */ #define TWT_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ #define TWT_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ +#define TWT_SR_SVREAD (1U << 3) /* Slave Read */ +#define TWT_SR_SVACC (1U << 4) /* Slave Access */ +#define TWT_SR_GCACC (1U << 5) /* General Call Access */ #define TWT_SR_OVRE (1U << 6) /* Overrun error */ #define TWT_SR_UNRE (1U << 7) /* Underrun Error */ #define TWT_SR_NACK (1U << 8) /* Not Acknowledged */ +#define TWT_SR_ARBLST (1U << 9) /* Arbitration Lost */ #endif /* ARM_AT91_AT91_TWIREG_H */ From owner-p4-projects@FreeBSD.ORG Wed Jan 18 09:04:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A787F16A422; Wed, 18 Jan 2006 09:04:48 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B6B816A41F for ; Wed, 18 Jan 2006 09:04:48 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 238B643D45 for ; Wed, 18 Jan 2006 09:04:48 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I94mjx039634 for ; Wed, 18 Jan 2006 09:04:48 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I94l9O039631 for perforce@freebsd.org; Wed, 18 Jan 2006 09:04:47 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 09:04:47 GMT Message-Id: <200601180904.k0I94l9O039631@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89895 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 09:04:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=89895 Change 89895 by imp@imp_hammer on 2006/01/18 09:04:47 First cut at implementing two ioctls for setting the speed of the device, as well as doing the actual transfer. Sadly, we have to do the xfers as ioctls since we need much more data than the traditional read call can handle. Since we're going to be using either no threads or libpthread/libthr, we don't have to worry about blocking in the ioctl anymore. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#3 (text+ko) ==== @@ -38,6 +38,7 @@ #include #include +#include struct at91_twi_softc { @@ -46,6 +47,14 @@ struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; /* basically a perimeter lock */ + int flags; +#define XFER_PENDING 1 /* true when transfer taking place */ +#define OPENED 2 /* Device opened */ +#define RXRDY 4 +#define TXCOMP 8 +#define TXRDY 0x10 + struct cdev *cdev; + uint32_t cwgr; }; static inline uint32_t @@ -60,14 +69,15 @@ bus_write_4(sc->mem_res, off, val); } -#define AT19_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define AT19_TWI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AT19_TWI_LOCK_INIT(_sc) \ +#define AT91_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define AT91_TWI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define AT91_TWI_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "twi", MTX_DEF) -#define AT19_TWI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define AT19_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define AT19_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define AT91_TWI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define AT91_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define AT91_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define CDEV2SOFTC(dev) ((dev)->si_drv1) static devclass_t at91_twi_devclass; @@ -82,6 +92,19 @@ static int at91_twi_activate(device_t dev); static void at91_twi_deactivate(device_t dev); +/* cdev routines */ +static d_open_t at91_twi_open; +static d_close_t at91_twi_close; +static d_ioctl_t at91_twi_ioctl; + +static struct cdevsw at91_twi_cdevsw = +{ + .d_version = D_VERSION, + .d_open = at91_twi_open, + .d_close = at91_twi_close, + .d_ioctl = at91_twi_ioctl +}; + static int at91_twi_probe(device_t dev) { @@ -100,15 +123,31 @@ if (err) goto out; - AT19_TWI_LOCK_INIT(sc); + AT91_TWI_LOCK_INIT(sc); /* * Activate the interrupt */ - err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, at91_twi_intr, sc, &sc->intrhand); - if (err) - AT19_TWI_LOCK_DESTROY(sc); + if (err) { + AT91_TWI_LOCK_DESTROY(sc); + goto out; + } + sc->cdev = make_dev(at91_twi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "twi%d", device_get_unit(dev)); + if (sc->cdev == NULL) { + err = ENOMEM; + goto out; + } + sc->cdev->si_drv1 = sc; + sc->cwgr = TWT_CWGR_CKDIV(1) | + TWT_CWGR_CHDIV(TWT_CWGR_DIV(TWI_DEF_CLK)) | + TWT_CWGR_CLDIV(TWT_CWGR_DIV(TWI_DEF_CLK)); + + WR4(sc, TWT_CR, TWI_CR_SWRST); + WR4(sc, TWT_CR, TWI_CR_MSEN | TWI_CR_SVDIS); + WR4(sc, TWT_CWGR, sc->csgr); out:; if (err) at91_twi_deactivate(dev); @@ -118,7 +157,7 @@ static int at91_twi_detach(device_t dev) { - return EBUSY; /* XXX */ + return (EBUSY); /* XXX */ } static int @@ -169,8 +208,207 @@ at91_twi_intr(void *xsc) { struct at91_twi_softc *sc = xsc; + uint32_t status; + + /* Reading the status also clears the interrupt */ + status = RD4(SC, TWI_SR); + if (status == 0) + return; + AT91_TWI_LOCK(sc); + if (status & TWI_SR_RXRDY) + sc->flags |= RXRDY; + if (statys & TWI_SR_TXCOMP) + sc->flags |= TXCOMP; + if (statys & TWI_SR_TXRDY) + sc->flags |= TXRDY; + AT91_TWI_UNLOCK(sc); + wakeup(sc); + return; +} + +static int +at91_twi_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct at91_twi_softc *sc; + + sc = CDEV2SOFTC(dev); + AT91_TWI_LOCK(sc); + if (!(sc->flags & OPENED)) { + sc->flags |= OPENED; + WR4(sc, TWI_IER, TWT_SR_TXCOMP | TWT_SR_RXRDY | TWT_SR_TXRDY | + TWT_SR_OVRE | TWT_SR_UNRE | TWT_SR_NACK); + } + AT91_TWI_UNLOCK(sc); + return (0); +} + +static int +at91_twi_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + struct at91_twi_softc *sc; + + sc = CDEV2SOFTC(dev); + AT91_TWI_LOCK(sc); + sc->flags &= ~OPENED; + WR4(sc, TWI_IDR, TWT_SR_TXCOMP | TWT_SR_RXRDY | TWT_SR_TXRDY | + TWT_SR_OVRE | TWT_SR_UNRE | TWT_SR_NACK); + AT91_TWI_UNLOCK(sc); + return (0); +} + + +static int +at91_twi_read_master(struct at91_twi_softc *sc, struct at91_twi_io *xfr) +{ + uint8_t buffer[256]; + size_t len; + int err; + + if (xfr->xfer_len > sizeof(buffer)) + return (EINVAL); + walker = buffer; + len = xfr->xfer_len; + RD4(sc, TWT_RHR); + // Master mode, with the right address and interal addr size + WR4(sc, TWT_MMR, TWT_MMR_IADRSZ(xfr->iadrsz) | TWT_MMR_MREAD | + TWT_MMR_DADR(xfr->xadr)); + WR4(sc, TWT_IADR, xfr->iadr); + WR4(sc, TWT_CR, TWT_CR_START); + while (len-- > 1) { + while (!(sc->flags & RXRDY)) { + err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "twird", + 0); + if (err) + return (err); + } + sc->flags &= ~RXRDY; + *walker++ = RD4(sc, TWI_RHR) & 0xff; + } + WR4(sc, TWT_CR, TWT_CR_STOP); + while (!(sc->flags & TXCOMP)) { + err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "twird2", 0); + if (err) + return (err); + } + sc->flags &= ~TXCOMP; + *walker = RD4(sc, TWI_RHR) & 0xff; + if (xfr->xfer_buf) { + AT91_TWI_UNLOCK(sc); + err = copyout(buffer, xfr->xfer_buf, xfr->xfer_len); + AT91_TWI_LOCK(sc); + } + return (err); +} + +static int +at91_twi_write_master(struct at91_twi_softc *sc, struct at91_twi_io *xfr) +{ + uint8_t buffer[256]; + size_t len; + int err; + + if (xfr->xfer_len > sizeof(buffer)) + return (EINVAL); + walker = buffer; + len = xfr->xfer_len; + AT91_TWI_UNLOCK(sc); + err = copyin(xfr->xfer_buf, buffer, xfr->xfer_len); + AT91_TWI_LOCK(sc); + if (err) + return (err); + /* Setup the xfr for later readback */ + xfr->xfer_buf = 0; + xfr->xfer_len = 1; + while (len--) { + WR4(sc, TWT_MMR, TWT_MMR_IADRSZ(xfr->iadrsz) | TWT_MMR_MWRITE | + TWT_MMR_DADR(xfr->xadr)); + WR4(sc, TWT_IADR, xfr->iadr++); + WR4(sc, TWI_THR, *walker++); + WR4(sc, TWT_CR, TWT_CR_START); + /* + * If we get signal while waiting for TXRDY, make sure we + * try to stop this device + */ + while (!(sc->flags & TXRDY)) { + err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "twiwr", + 0); + if (err) + break; + } + WR4(sc, TWT_CR, TWT_CR_STOP); + if (err) + return (err); + while (!(sc->flags & TXCOMP)) { + err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "twiwr2", + 0); + if (err) + return (err); + } + /* Readback */ + at91_twi_read_master(sc, xfr); + } + return (err); +} +static int +at91_twi_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + int err = 0; + struct at91_twi_softc *sc; + + sc = CDEV2SOFTC(dev); + AT91_TWI_LOCK(sc); + while (sc->flags & XFER_PENDING) { + err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, + "twiwait", 0); + if (err) { + AT91_TWI_UNLOCK(sc); + return (err); + } + } + sc->flags |= XFER_PENDING; + + switch (cmd) + { + case TWIIOCXFER: + { + struct at91_twi_clock *xfr = (struct at91_twi_io *)data; + switch (xfr->type) + { + case TWI_IO_READ_MASTER: + err = at91_twi_read_master(sc, xfr); + break; + case TWI_IO_WRITE_MASTER: + err = at91_twi_write_master(sc, xfr); + break; + default: + err = EINVAL; + break; + } + break; + } + + case TWIIOCSETCLOCK: + { + struct at91_twi_clock *twick = (struct at91_twi_clock *)data; + + sc->cwgr = TWT_CWGR_CKDIV(twick->ckdiv) | + TWT_CWGR_CHDIV(TWT_CWGR_DIV(twick->high_rate)) | + TWT_CWGR_CLDIV(TWT_CWGR_DIV(twick->low_rate)); + WR4(sc, TWT_CR, TWI_CR_SWRST); + WR4(sc, TWT_CR, TWI_CR_MSEN | TWI_CR_SVDIS); + WR4(sc, TWT_CWGR, sc->csgr); + break; + } + default: + err = ENOTTY; + break; + } + sc->flags &= ~XFER_PENDING; + AT91_TWI_UNLOCK(sc); wakeup(sc); + return err; } static device_method_t at91_twi_methods[] = { From owner-p4-projects@FreeBSD.ORG Wed Jan 18 09:05:50 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F97416A422; Wed, 18 Jan 2006 09:05:50 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AE3216A41F for ; Wed, 18 Jan 2006 09:05:50 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5BDF43D45 for ; Wed, 18 Jan 2006 09:05:49 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I95nTg039730 for ; Wed, 18 Jan 2006 09:05:49 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I95nOY039727 for perforce@freebsd.org; Wed, 18 Jan 2006 09:05:49 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 09:05:49 GMT Message-Id: <200601180905.k0I95nOY039727@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89896 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 09:05:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=89896 Change 89896 by imp@imp_hammer on 2006/01/18 09:05:49 Need the ioctls here. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twiio.h#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Wed Jan 18 09:38:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 680BD16A48E; Wed, 18 Jan 2006 09:38:52 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E793B16A48E for ; Wed, 18 Jan 2006 09:38:51 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBF5543E04 for ; Wed, 18 Jan 2006 09:38:05 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0I9bUlT043415 for ; Wed, 18 Jan 2006 09:37:30 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0I9bUfh043412 for perforce@freebsd.org; Wed, 18 Jan 2006 09:37:30 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 09:37:30 GMT Message-Id: <200601180937.k0I9bUfh043412@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89900 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 09:38:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=89900 Change 89900 by imp@imp_plunger on 2006/01/18 09:36:49 Compile... Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#4 edit .. //depot/projects/arm/src/sys/arm/at91/at91_twiio.h#2 edit .. //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#4 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#4 (text+ko) ==== @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include +#include #include #include @@ -78,6 +80,7 @@ #define AT91_TWI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); #define AT91_TWI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); #define CDEV2SOFTC(dev) ((dev)->si_drv1) +#define TWI_DEF_CLK 100000 static devclass_t at91_twi_devclass; @@ -134,20 +137,20 @@ AT91_TWI_LOCK_DESTROY(sc); goto out; } - sc->cdev = make_dev(at91_twi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + sc->cdev = make_dev(&at91_twi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "twi%d", device_get_unit(dev)); if (sc->cdev == NULL) { err = ENOMEM; goto out; } sc->cdev->si_drv1 = sc; - sc->cwgr = TWT_CWGR_CKDIV(1) | - TWT_CWGR_CHDIV(TWT_CWGR_DIV(TWI_DEF_CLK)) | - TWT_CWGR_CLDIV(TWT_CWGR_DIV(TWI_DEF_CLK)); + sc->cwgr = TWI_CWGR_CKDIV(1) | + TWI_CWGR_CHDIV(TWI_CWGR_DIV(TWI_DEF_CLK)) | + TWI_CWGR_CLDIV(TWI_CWGR_DIV(TWI_DEF_CLK)); - WR4(sc, TWT_CR, TWI_CR_SWRST); - WR4(sc, TWT_CR, TWI_CR_MSEN | TWI_CR_SVDIS); - WR4(sc, TWT_CWGR, sc->csgr); + WR4(sc, TWI_CR, TWI_CR_SWRST); + WR4(sc, TWI_CR, TWI_CR_MSEN | TWI_CR_SVDIS); + WR4(sc, TWI_CWGR, sc->cwgr); out:; if (err) at91_twi_deactivate(dev); @@ -211,15 +214,15 @@ uint32_t status; /* Reading the status also clears the interrupt */ - status = RD4(SC, TWI_SR); + status = RD4(sc, TWI_SR); if (status == 0) return; AT91_TWI_LOCK(sc); if (status & TWI_SR_RXRDY) sc->flags |= RXRDY; - if (statys & TWI_SR_TXCOMP) + if (status & TWI_SR_TXCOMP) sc->flags |= TXCOMP; - if (statys & TWI_SR_TXRDY) + if (status & TWI_SR_TXRDY) sc->flags |= TXRDY; AT91_TWI_UNLOCK(sc); wakeup(sc); @@ -235,8 +238,8 @@ AT91_TWI_LOCK(sc); if (!(sc->flags & OPENED)) { sc->flags |= OPENED; - WR4(sc, TWI_IER, TWT_SR_TXCOMP | TWT_SR_RXRDY | TWT_SR_TXRDY | - TWT_SR_OVRE | TWT_SR_UNRE | TWT_SR_NACK); + WR4(sc, TWI_IER, TWI_SR_TXCOMP | TWI_SR_RXRDY | TWI_SR_TXRDY | + TWI_SR_OVRE | TWI_SR_UNRE | TWI_SR_NACK); } AT91_TWI_UNLOCK(sc); return (0); @@ -250,8 +253,8 @@ sc = CDEV2SOFTC(dev); AT91_TWI_LOCK(sc); sc->flags &= ~OPENED; - WR4(sc, TWI_IDR, TWT_SR_TXCOMP | TWT_SR_RXRDY | TWT_SR_TXRDY | - TWT_SR_OVRE | TWT_SR_UNRE | TWT_SR_NACK); + WR4(sc, TWI_IDR, TWI_SR_TXCOMP | TWI_SR_RXRDY | TWI_SR_TXRDY | + TWI_SR_OVRE | TWI_SR_UNRE | TWI_SR_NACK); AT91_TWI_UNLOCK(sc); return (0); } @@ -260,20 +263,21 @@ static int at91_twi_read_master(struct at91_twi_softc *sc, struct at91_twi_io *xfr) { + uint8_t *walker; uint8_t buffer[256]; size_t len; - int err; + int err = 0; if (xfr->xfer_len > sizeof(buffer)) return (EINVAL); walker = buffer; len = xfr->xfer_len; - RD4(sc, TWT_RHR); + RD4(sc, TWI_RHR); // Master mode, with the right address and interal addr size - WR4(sc, TWT_MMR, TWT_MMR_IADRSZ(xfr->iadrsz) | TWT_MMR_MREAD | - TWT_MMR_DADR(xfr->xadr)); - WR4(sc, TWT_IADR, xfr->iadr); - WR4(sc, TWT_CR, TWT_CR_START); + WR4(sc, TWI_MMR, TWI_MMR_IADRSZ(xfr->iadrsz) | TWI_MMR_MREAD | + TWI_MMR_DADR(xfr->dadr)); + WR4(sc, TWI_IADR, xfr->iadr); + WR4(sc, TWI_CR, TWI_CR_START); while (len-- > 1) { while (!(sc->flags & RXRDY)) { err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "twird", @@ -284,7 +288,7 @@ sc->flags &= ~RXRDY; *walker++ = RD4(sc, TWI_RHR) & 0xff; } - WR4(sc, TWT_CR, TWT_CR_STOP); + WR4(sc, TWI_CR, TWI_CR_STOP); while (!(sc->flags & TXCOMP)) { err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "twird2", 0); if (err) @@ -303,6 +307,7 @@ static int at91_twi_write_master(struct at91_twi_softc *sc, struct at91_twi_io *xfr) { + uint8_t *walker; uint8_t buffer[256]; size_t len; int err; @@ -320,11 +325,11 @@ xfr->xfer_buf = 0; xfr->xfer_len = 1; while (len--) { - WR4(sc, TWT_MMR, TWT_MMR_IADRSZ(xfr->iadrsz) | TWT_MMR_MWRITE | - TWT_MMR_DADR(xfr->xadr)); - WR4(sc, TWT_IADR, xfr->iadr++); + WR4(sc, TWI_MMR, TWI_MMR_IADRSZ(xfr->iadrsz) | TWI_MMR_MWRITE | + TWI_MMR_DADR(xfr->dadr)); + WR4(sc, TWI_IADR, xfr->iadr++); WR4(sc, TWI_THR, *walker++); - WR4(sc, TWT_CR, TWT_CR_START); + WR4(sc, TWI_CR, TWI_CR_START); /* * If we get signal while waiting for TXRDY, make sure we * try to stop this device @@ -335,7 +340,7 @@ if (err) break; } - WR4(sc, TWT_CR, TWT_CR_STOP); + WR4(sc, TWI_CR, TWI_CR_STOP); if (err) return (err); while (!(sc->flags & TXCOMP)) { @@ -373,7 +378,7 @@ { case TWIIOCXFER: { - struct at91_twi_clock *xfr = (struct at91_twi_io *)data; + struct at91_twi_io *xfr = (struct at91_twi_io *)data; switch (xfr->type) { case TWI_IO_READ_MASTER: @@ -393,12 +398,12 @@ { struct at91_twi_clock *twick = (struct at91_twi_clock *)data; - sc->cwgr = TWT_CWGR_CKDIV(twick->ckdiv) | - TWT_CWGR_CHDIV(TWT_CWGR_DIV(twick->high_rate)) | - TWT_CWGR_CLDIV(TWT_CWGR_DIV(twick->low_rate)); - WR4(sc, TWT_CR, TWI_CR_SWRST); - WR4(sc, TWT_CR, TWI_CR_MSEN | TWI_CR_SVDIS); - WR4(sc, TWT_CWGR, sc->csgr); + sc->cwgr = TWI_CWGR_CKDIV(twick->ckdiv) | + TWI_CWGR_CHDIV(TWI_CWGR_DIV(twick->high_rate)) | + TWI_CWGR_CLDIV(TWI_CWGR_DIV(twick->low_rate)); + WR4(sc, TWI_CR, TWI_CR_SWRST); + WR4(sc, TWI_CR, TWI_CR_MSEN | TWI_CR_SVDIS); + WR4(sc, TWI_CWGR, sc->cwgr); break; } default: ==== //depot/projects/arm/src/sys/arm/at91/at91_twiio.h#2 (text+ko) ==== @@ -39,14 +39,14 @@ uint32_t iadr; /* Interbak addr */ size_t xfer_len; /* Size to transfer */ caddr_t xfer_buf; /* buffer for xfer */ -} +}; struct at91_twi_clock { int ckdiv; /* Clock divider */ int high_rate; /* rate of clock high period */ int low_rate; /* rate of clock low period */ -} +}; /** TWIIOCXFER: Do a two-wire transfer */ @@ -54,7 +54,7 @@ /** TWIIOCSETCLOCK: Sets the clocking parameters for this operation. */ -#define TWTIOCSETCLOCK _IOW('x', 2, struct at91_twi_clock) +#define TWIIOCSETCLOCK _IOW('x', 2, struct at91_twi_clock) #endif /* !_ARM_AT91_AT91_TWIIO_H */ ==== //depot/projects/arm/src/sys/arm/at91/at91_twireg.h#4 (text+ko) ==== @@ -44,39 +44,39 @@ /* TWI_CR */ #define TWI_CR_START (1U << 0) /* Send a start */ -#define TWT_CR_STOP (1U << 1) /* Send a stop */ -#define TWT_CR_MSEN (1U << 2) /* Master Transfer Enable */ -#define TWT_CR_MSDIS (1U << 3) /* Master Transfer Disable */ -#define TWT_CR_SVEN (1U << 4) /* Slave Transfer Enable */ -#define TWT_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ -#define TWT_CR_SWRST (1U << 7) /* Software Reset */ +#define TWI_CR_STOP (1U << 1) /* Send a stop */ +#define TWI_CR_MSEN (1U << 2) /* Master Transfer Enable */ +#define TWI_CR_MSDIS (1U << 3) /* Master Transfer Disable */ +#define TWI_CR_SVEN (1U << 4) /* Slave Transfer Enable */ +#define TWI_CR_SVDIS (1U << 5) /* Slave Transfer Disable */ +#define TWI_CR_SWRST (1U << 7) /* Software Reset */ /* TWI_MMR */ /* TWI_SMR */ -#define TWT_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ -#define TWT_MMR_MWRITE 0U /* Master Read Direction */ -#define TWT_MMR_MREAD (1U << 12) /* Master Read Direction */ -#define TWT_MMR_DADR(n) ((n) << 16) /* Device Address */ +#define TWI_MMR_IADRSZ(n) ((n) << 8) /* Set size of transfer */ +#define TWI_MMR_MWRITE 0U /* Master Read Direction */ +#define TWI_MMR_MREAD (1U << 12) /* Master Read Direction */ +#define TWI_MMR_DADR(n) ((n) << 16) /* Device Address */ /* TWI_CWGR */ -#define TWT_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ -#define TWT_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ -#define TWT_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ -#define TWT_CWGR_DIV(rate) ((AT91C_MASTER_CLOCK / 4*(rate)) - 2) +#define TWI_CWGR_CKDIV(x) ((x) << 16) /* Clock Divider */ +#define TWI_CWGR_CHDIV(x) ((x) << 8) /* Clock High Divider */ +#define TWI_CWGR_CLDIV(x) ((x) << 0) /* Clock Low Divider */ +#define TWI_CWGR_DIV(rate) ((AT91C_MASTER_CLOCK /(4*(rate))) - 2) /* TWI_SR */ /* TWI_IER */ /* TWI_IDR */ /* TWI_IMR */ -#define TWT_SR_TXCOMP (1U << 0) /* Transmission Completed */ -#define TWT_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ -#define TWT_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ -#define TWT_SR_SVREAD (1U << 3) /* Slave Read */ -#define TWT_SR_SVACC (1U << 4) /* Slave Access */ -#define TWT_SR_GCACC (1U << 5) /* General Call Access */ -#define TWT_SR_OVRE (1U << 6) /* Overrun error */ -#define TWT_SR_UNRE (1U << 7) /* Underrun Error */ -#define TWT_SR_NACK (1U << 8) /* Not Acknowledged */ -#define TWT_SR_ARBLST (1U << 9) /* Arbitration Lost */ +#define TWI_SR_TXCOMP (1U << 0) /* Transmission Completed */ +#define TWI_SR_RXRDY (1U << 1) /* Receive Holding Register Ready */ +#define TWI_SR_TXRDY (1U << 2) /* Transmit Holding Register Ready */ +#define TWI_SR_SVREAD (1U << 3) /* Slave Read */ +#define TWI_SR_SVACC (1U << 4) /* Slave Access */ +#define TWI_SR_GCACC (1U << 5) /* General Call Access */ +#define TWI_SR_OVRE (1U << 6) /* Overrun error */ +#define TWI_SR_UNRE (1U << 7) /* Underrun Error */ +#define TWI_SR_NACK (1U << 8) /* Not Acknowledged */ +#define TWI_SR_ARBLST (1U << 9) /* Arbitration Lost */ #endif /* ARM_AT91_AT91_TWIREG_H */ From owner-p4-projects@FreeBSD.ORG Wed Jan 18 16:53:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3775E16A424; Wed, 18 Jan 2006 16:53:13 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6ACF16A423 for ; Wed, 18 Jan 2006 16:53:12 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B362843D46 for ; Wed, 18 Jan 2006 16:53:12 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0IGrCl1077743 for ; Wed, 18 Jan 2006 16:53:12 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0IGrCOq077740 for perforce@freebsd.org; Wed, 18 Jan 2006 16:53:12 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 16:53:12 GMT Message-Id: <200601181653.k0IGrCOq077740@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89914 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 16:53:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=89914 Change 89914 by imp@imp_plunger on 2006/01/18 16:53:00 now that twi is fleshed out, go ahead and create a spi which will be similar. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_spi.c#1 add .. //depot/projects/arm/src/sys/arm/at91/at91_spiio.h#1 add .. //depot/projects/arm/src/sys/arm/at91/at91_spireg.h#1 add .. //depot/projects/arm/src/sys/arm/conf/KB920X#13 edit Differences ... ==== //depot/projects/arm/src/sys/arm/conf/KB920X#13 (text+ko) ==== @@ -80,3 +80,4 @@ device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface +device at91_spi # SPI: From owner-p4-projects@FreeBSD.ORG Wed Jan 18 20:40:17 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4B66A16A422; Wed, 18 Jan 2006 20:40:16 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B21816A41F for ; Wed, 18 Jan 2006 20:40:16 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 867CE43D5C for ; Wed, 18 Jan 2006 20:40:15 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0IKeFdK087763 for ; Wed, 18 Jan 2006 20:40:15 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0IKeF5E087760 for perforce@freebsd.org; Wed, 18 Jan 2006 20:40:15 GMT (envelope-from millert@freebsd.org) Date: Wed, 18 Jan 2006 20:40:15 GMT Message-Id: <200601182040.k0IKeF5E087760@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 89927 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 20:40:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=89927 Change 89927 by millert@millert_ibook on 2006/01/18 20:39:42 Set DSTROOT when installing pam_sedarwin Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/Makefile#7 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/Makefile#7 (text+ko) ==== @@ -14,7 +14,7 @@ cd darwin && make install for i in $(INSTALL_MODULES); do cd $$i && make install && cd ..; done cd darwin/osx_cmds && make install - gnumake -C darwin/pam_modules/pam_sedarwin install + gnumake -C darwin/pam_modules/pam_sedarwin DSTROOT=$(DESTDIR) install package: cd release && make package From owner-p4-projects@FreeBSD.ORG Wed Jan 18 20:43:22 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 10AB016A423; Wed, 18 Jan 2006 20:43:22 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C649C16A41F for ; Wed, 18 Jan 2006 20:43:21 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B29843D5D for ; Wed, 18 Jan 2006 20:43:20 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0IKhKiJ087913 for ; Wed, 18 Jan 2006 20:43:20 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0IKhKGp087910 for perforce@freebsd.org; Wed, 18 Jan 2006 20:43:20 GMT (envelope-from millert@freebsd.org) Date: Wed, 18 Jan 2006 20:43:20 GMT Message-Id: <200601182043.k0IKhKGp087910@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 89928 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 20:43:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=89928 Change 89928 by millert@millert_ibook on 2006/01/18 20:43:13 add mac_syscall(3) from DSEP Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/libmac/mac_syscall.3#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Wed Jan 18 20:52:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0DAB416A41F; Wed, 18 Jan 2006 20:52:34 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FB4E16A41F for ; Wed, 18 Jan 2006 20:52:34 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E721643D58 for ; Wed, 18 Jan 2006 20:52:33 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0IKqXvV095844 for ; Wed, 18 Jan 2006 20:52:33 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0IKqXav095841 for perforce@freebsd.org; Wed, 18 Jan 2006 20:52:33 GMT (envelope-from millert@freebsd.org) Date: Wed, 18 Jan 2006 20:52:33 GMT Message-Id: <200601182052.k0IKqXav095841@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 89930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 20:52:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=89930 Change 89930 by millert@millert_ibook on 2006/01/18 20:51:57 copy mac.h to the exported headers dir too Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/mach/Makefile#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/xnu/osfmk/mach/Makefile#3 (text+ko) ==== @@ -107,6 +107,7 @@ host_special_ports.h \ kern_return.h \ kmod.h \ + mac.h \ mach_param.h \ mach_time.h \ mach_traps.h \ From owner-p4-projects@FreeBSD.ORG Wed Jan 18 23:37:41 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0384916A422; Wed, 18 Jan 2006 23:37:41 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B527616A41F for ; Wed, 18 Jan 2006 23:37:40 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3768A43D4C for ; Wed, 18 Jan 2006 23:37:40 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0INbeC7004244 for ; Wed, 18 Jan 2006 23:37:40 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0INbdDu004241 for perforce@freebsd.org; Wed, 18 Jan 2006 23:37:39 GMT (envelope-from imp@freebsd.org) Date: Wed, 18 Jan 2006 23:37:39 GMT Message-Id: <200601182337.k0INbdDu004241@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89938 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2006 23:37:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=89938 Change 89938 by imp@imp_Speedy on 2006/01/18 23:37:21 minor nits Affected files ... .. //depot/projects/arm/src/sys/arm/at91/if_ate.c#22 edit .. //depot/projects/arm/src/sys/arm/at91/if_atereg.h#5 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#22 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -64,11 +64,6 @@ #define ATE_MAX_TX_BUFFERS 2 /* We have ping-pong tx buffers */ #define ATE_MAX_RX_BUFFERS 8 -typedef struct { - bus_addr_t addr; - int status; -} rx_desc_t; - struct ate_softc { struct ifnet *ifp; /* ifnet pointer */ @@ -89,7 +84,7 @@ struct mbuf *sent_mbuf[ATE_MAX_TX_BUFFERS]; /* Sent mbufs */ struct mbuf *rx_mbuf[ATE_MAX_RX_BUFFERS]; /* RX mbufs */ bus_addr_t rx_desc_phys; - rx_desc_t *rx_descs; + eth_rx_desc_t *rx_descs; // XXX bogus int intr; @@ -289,10 +284,10 @@ } /* Dma TAG and MAP for the rx descriptors. */ - err = bus_dma_tag_create(NULL, sizeof(rx_desc_t), 0, + err = bus_dma_tag_create(NULL, sizeof(eth_rx_desc_t), 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - ATE_MAX_RX_BUFFERS * sizeof(rx_desc_t), 1, - ATE_MAX_RX_BUFFERS * sizeof(rx_desc_t), 0, busdma_lock_mutex, + ATE_MAX_RX_BUFFERS * sizeof(eth_rx_desc_t), 1, + ATE_MAX_RX_BUFFERS * sizeof(eth_rx_desc_t), 0, busdma_lock_mutex, &sc->sc_mtx, &sc->rx_desc_tag); if (err != 0) goto errout; @@ -300,7 +295,7 @@ &sc->rx_desc_map) != 0) goto errout; if (bus_dmamap_load(sc->rx_desc_tag, sc->rx_desc_map, - sc->rx_descs, ATE_MAX_RX_BUFFERS * sizeof(rx_desc_t), ate_getaddr, + sc->rx_descs, ATE_MAX_RX_BUFFERS * sizeof(eth_rx_desc_t), ate_getaddr, sc, 0) != 0) goto errout; for (i = 0; i < ATE_MAX_RX_BUFFERS; i++) { @@ -530,7 +525,7 @@ bus_dmamap_sync(sc->rx_desc_tag, sc->rx_desc_map, BUS_DMASYNC_POSTREAD); for (i = 0; i < ATE_MAX_RX_BUFFERS; i++) { - if (sc->rx_descs[i].addr & 1) { + if (sc->rx_descs[i].addr & ETH_CPU_OWNER) { struct mbuf *mb = sc->rx_mbuf[i]; bus_dma_segment_t seg; int rx_stat = sc->rx_descs[i].status; @@ -548,7 +543,7 @@ M_PKTHDR); if (!sc->rx_mbuf[i]) { sc->rx_mbuf[i] = mb; - sc->rx_descs[i].addr &= ~1; + sc->rx_descs[i].addr &= ~ETH_CPU_OWNER; bus_dmamap_sync(sc->rx_desc_tag, sc->rx_desc_map, BUS_DMASYNC_PREWRITE); @@ -558,22 +553,22 @@ sc->rx_map[i], sc->rx_mbuf[i], &seg, &nsegs, 0) != 0) { sc->rx_mbuf[i] = mb; - sc->rx_descs[i].addr &= ~1; + sc->rx_descs[i].addr &= ~ETH_CPU_OWNER; bus_dmamap_sync(sc->rx_desc_tag, sc->rx_desc_map, BUS_DMASYNC_PREWRITE); break; } /* - * For the last buffer, set the wrap bit so the controller - * restarts from the first descriptor. + * For the last buffer, set the wrap bit so + * the controller restarts from the first + * descriptor. */ if (i == ATE_MAX_RX_BUFFERS - 1) seg.ds_addr |= 1 << 1; sc->rx_descs[i].addr = seg.ds_addr; sc->rx_descs[i].status = 0; - /* Bits 0-10 of the status file == length. */ - mb->m_len = rx_stat & 0x7ff; + mb->m_len = rx_stat & ETH_LEN_MASK; (*sc->ifp->if_input)(sc->ifp, mb); break; ==== //depot/projects/arm/src/sys/arm/at91/if_atereg.h#5 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 M. Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -155,4 +155,21 @@ (ETH_MAN_BITS | ETH_MAN_READ | ((phy) << ETH_MAN_PHYA_BIT) | \ ((reg) << ETH_MAN_REGA_BIT)) +typedef struct { + uint32_t addr; +#define ETH_CPU_OWNER (1U << 0) +#define ETH_WRAP_BIT (1U << 1) + uint32_t status; +#define ETH_LEN_MASK 0x7ff +#define ETH_MAC_LOCAL_4 (1U << 23) /* Packet matched addr 4 */ +#define ETH_MAC_LOCAL_3 (1U << 24) /* Packet matched addr 3 */ +#define ETH_MAC_LOCAL_2 (1U << 25) /* Packet matched addr 2 */ +#define ETH_MAC_LOCAL_1 (1U << 26) /* Packet matched addr 1 */ +#define ETH_MAC_UNK (1U << 27) /* Unkown source address RFU */ +#define ETH_MAC_EXT (1U << 28) /* External Address */ +#define ETH_MAC_UCAST (1U << 29) /* Unicast hash match */ +#define ETH_MAC_MCAST (1U << 30) /* Multicast hash match */ +#define ETH_MAC_ONES (1U << 31) /* Global all ones bcast addr */ +} eth_rx_desc_t; + #endif /* ARM_AT91_IF_ATEREG_H */ From owner-p4-projects@FreeBSD.ORG Fri Jan 20 14:59:21 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 59D6416A422; Fri, 20 Jan 2006 14:59:21 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01B3416A41F for ; Fri, 20 Jan 2006 14:59:21 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A775243D46 for ; Fri, 20 Jan 2006 14:59:20 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KExKtP073140 for ; Fri, 20 Jan 2006 14:59:20 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KExKjl073137 for perforce@freebsd.org; Fri, 20 Jan 2006 14:59:20 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 14:59:20 GMT Message-Id: <200601201459.k0KExKjl073137@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90004 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 14:59:22 -0000 http://perforce.freebsd.org/chv.cgi?CH=90004 Change 90004 by millert@millert_ibook on 2006/01/20 14:58:35 No longer need to include mac.h Remove useless local variable that shadows one in enclosing scope Deal with waitpid() returning 0. Code adapted from launchd's bootstrap.c which already deals with this case. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/system_cmds/mach_init.tproj/bootstrap.c#7 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/system_cmds/mach_init.tproj/bootstrap.c#7 (text+ko) ==== @@ -43,7 +43,6 @@ #include #include #include -#include #import #import @@ -584,8 +583,9 @@ reap_server(server_t *serverp) { kern_return_t result; - pid_t presult; - int wstatus; + mach_port_t old_port; + pid_t presult; + int wstatus; /* * Reap our children. @@ -593,9 +593,44 @@ do { presult = waitpid(serverp->pid, &wstatus, WNOHANG); } while (presult == -1 && errno == EINTR); - if (presult != serverp->pid) { - unix_error("waitpid: cmd = %s", serverp->cmd); - } else if (wstatus) { + switch (presult) { + case -1: + unix_error("waitpid: cmd = %s, pid = %d", serverp->cmd, + serverp->pid); + break; + + case 0: + /* process must have switched mach tasks */ + old_port = serverp->task_port; + mach_port_deallocate(mach_task_self(), old_port); + serverp->task_port = MACH_PORT_NULL; + + result = task_for_pid(mach_task_self(), serverp->pid, + &serverp->task_port); + if (result != KERN_SUCCESS) { + kern_error(result, + "race getting new server task port for pid[%d]", + serverp->pid); + break; + } + + /* Request dead name notification to tell when new task dies */ + result = mach_port_request_notification( + mach_task_self(), + serverp->task_port, + MACH_NOTIFY_DEAD_NAME, + 0, + notify_port, + MACH_MSG_TYPE_MAKE_SEND_ONCE, + &old_port); + if (result != KERN_SUCCESS) { + kern_error(result, "race setting up notification for " + "new server task port for pid[%d]", serverp->pid); + break; + } + return; + + default: notice("Server %x in bootstrap %x uid %d: \"%s\": %s %d [pid %d]", serverp->port, serverp->bootstrap->bootstrap_port, serverp->uid, serverp->cmd, @@ -604,6 +639,7 @@ "exited as a result of signal"), ((WIFEXITED(wstatus)) ? WEXITSTATUS(wstatus) : WTERMSIG(wstatus)), serverp->pid); + break; } serverp->pid = 0; @@ -1105,7 +1141,7 @@ np = ((mach_port_destroyed_notification_t *)Request)->not_port.name; servicep = lookup_service_by_port(np); if (servicep != NULL) { - server_t *serverp = servicep->server; + serverp = servicep->server; switch (Request->msgh_id) { From owner-p4-projects@FreeBSD.ORG Fri Jan 20 15:16:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6C9C116A423; Fri, 20 Jan 2006 15:16:46 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1137816A41F for ; Fri, 20 Jan 2006 15:16:46 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC21143D48 for ; Fri, 20 Jan 2006 15:16:42 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KFGg0b074056 for ; Fri, 20 Jan 2006 15:16:42 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KFGgr0074053 for perforce@freebsd.org; Fri, 20 Jan 2006 15:16:42 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 15:16:42 GMT Message-Id: <200601201516.k0KFGgr0074053@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90006 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 15:16:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=90006 Change 90006 by millert@millert_ibook on 2006/01/20 15:15:56 Switch to the new module build framework. With it we get a report on unimplemented entry points for free. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/build/PolicyKext.mk#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/build/mkPolicyInfoPlist.sh#1 add .. //depot/projects/trustedbsd/sedarwin7/src/darwin/build/policy-ops.gdb#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/commands/Makefile#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/commands/dotbyproc#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/commands/dumptrace.c#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/commands/ikotnames#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/commands/tr2dot#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/dumptrace.c#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/ikotnames#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/ipctrace.c#5 delete .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/ipctrace.h#4 delete .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/ipctrace.kmodinfo#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/module/Makefile#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/module/ikotnames.h#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/module/ipctrace.c#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/module/ipctrace.h#1 add .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/tr2dot#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/Makefile#2 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/commands/Makefile#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/commands/mac_counter.c#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/mac_count.c#1 add .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/mac_count.h#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/mk_count_decls.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/mk_count_funcs.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/mk_count_policy_ops.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/mk_count_reg.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/module/Makefile#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/module/hash_string.c#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/module/hash_string.h#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/module/mac_count.c#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_count/module/mac_count.kmodinfo#2 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_mls/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_mls/mac_mls.c#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_mls/mac_mls.h#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_mls/mac_mls.kmodinfo#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_none/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_none/mac_none.4#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_none/mac_none.c#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_none/mac_none.kmodinfo#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/mac_stub/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mac_stub.4#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mac_stub.c#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mac_stub.kmodinfo#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/mactest/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/mactest/mac_test.c#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/mactest/mac_test.kmodinfo#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/commands/save_trace/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/commands/save_trace/save_trace.c#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/commands/sec_trace/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/commands/sec_trace/sec_trace.c#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/Makefile#3 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mac_stacktrace.c#4 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mac_stacktrace.kmodinfo#3 delete .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/stacktrace_syscalls.h#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/build/PolicyKext.mk#3 (text+ko) ==== @@ -1,30 +1,103 @@ +# +# Including Makefile MUST have the following variables defined: +# +# POLICY Name of the policy (eg: mac_foo) +# POLICY_VER Policy Version for Bundle +# POLICY_COMPVER Policy OS Compatible Version for Bundle +# POLICY_DESC Description of Policy +# +# The following variables MAY be defined +# +# POLICY_SRCS Override default sources of $(POLICY).c +# POLICY_NOMAN Define if policy module has no manpage. +# POLICY_MAN +# POLICY_LIBS key:string specification of OSBundleLibraries +# +# CLEANFILES Additional build files to remove on 'make clean' +# + +CFLAGS += -g $(DARWIN_HDRS) -nostdinc -mlong-branch -DAPPLE -DKERNEL \ + -DKERNEL_PRIVATE -DKEXT -fno-common -static -fno-builtin \ + -I$(DARWIN)/EXTERNAL_HEADERS -I$(DARWIN)/EXTERNAL_HEADERS/bsd +CFLAGS += $(CWARNFLAGS) +CFLAGS += -DPOLICY_VER=\"$(POLICY_VER)\" \ + -DPOLICY_DESC=\"$(POLICY_DESC)\" +POLICY_SRCS ?= $(POLICY).c +POLICY_OBJS = $(POLICY_SRCS:.c=.o) + +POLICY_LIBS += com.apple.kernel.bsd:1.1 \ + com.apple.kernel.libkern:1.0b1 + +WARNS ?= 6 + +#CWARNFLAGS += -Wsystem-headers +#CWARNFLAGS += -Werror +#CWARNFLAGS += -Wall -Wno-format-y2k +#CWARNFLAGS += -W -Wno-unused-parameter -Wstrict-prototypes \ +# -Wmissing-prototypes -Wpointer-arith +#CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch \ +# -Wshadow -Wcast-align +#CWARNFLAGS += -Wunused-parameter +#CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs \ +# -Wredundant-decls +#CWARNFLAGS += -Wno-uninitialized + +ifndef POLICY_NOMAN +POLICY_MAN ?= $(POLICY).4 +else +POLICY_MAN= +endif + +CLEANFILES += $(POLICY_OBJS) \ + $(POLICY)-test $(POLICY).gdb $(POLICY).report \ + .gdb_history + +all: mac_$(POLICY).kext.tar $(POLICY).report + +clean: + @rm -rf mac_$(POLICY).kext.tar mac_$(POLICY).kext + @rm -f $(CLEANFILES) -CFLAGS += -nostdinc -mlong-branch -DKERNEL -DKERNEL_PRIVATE -fno-common -static -fno-builtin -CFLAGS += -I$(DARWIN)/EXTERNAL_HEADERS -I$(DARWIN)/EXTERNAL_HEADERS/bsd -DKEXT +install: mac_$(POLICY).kext.tar $(POLICY_MAN) +ifndef POLICY_NOMAN + @install -m 644 $(POLICY_MAN) $(DESTDIR)/usr/share/man/man4 +endif + @tar -C $(DESTDIR)/System/Library/Extensions -xf mac_$(POLICY).kext.tar + +mac_$(POLICY).kext.tar: mac_$(POLICY).kext mac_$(POLICY).kext/Contents/Info.plist $(POLICY_OBJS) + @echo "$(POLICY): Creating KEXT tar file..." + @touch mac_$(POLICY).kext/LoadEarly + @tar --owner root --group wheel -cf $@ mac_$(POLICY).kext + +mac_$(POLICY).kext/Contents/Info.plist: Makefile + @echo "$(POLICY): Generating Info.plist..." + @$(DARWIN_ROOT)/build/mkPolicyInfoPlist.sh \ + $(POLICY) $(POLICY_VER) $(POLICY_COMPVER) \ + $(POLICY_DESC) "$(POLICY_LIBS)" > $@ + +mac_$(POLICY).kext: $(POLICY_OBJS) + @echo "$(POLICY): Creating KEXT..." + @mkdir -p mac_$(POLICY).kext/Contents/MacOS + @ld -r -o mac_$(POLICY).kext/Contents/MacOS/$(POLICY) $(POLICY_OBJS) -lkmod -lcc_kext -static + +# Display undefined policy entrypoints. -%.kext.tar: %.o - mkdir -p $*.kext/Contents/MacOS - ld -r -o $*.kext/Contents/MacOS/$* $^ -lkmod -lcc_kext -static - @$(MAKE) $*.kext/Contents/Info.plist - @touch $*.kext/LoadEarly - tar --owner root --group wheel -cf $@ $*.kext +$(POLICY)-test: $(POLICY_OBJS) + @$(LD) -twolevel_namespace -undefined define_a_way -o $@ $(POLICY_OBJS) 2> /dev/null + +$(POLICY).gdb: $(POLICY)-test + @gdb -x $(DARWIN_ROOT)/build/policy-ops.gdb $< \ + | grep mac_policy_ops \ + | sed s/\;// \ + | awk '{print "p " $$4 "\nquit"}' \ + > $@ -%.kext/Contents/Info.plist: %.kmodinfo - @echo "Generating $@ from $<..." - @echo '' > $@ - @echo '' >> $@ - @echo -e '\n' >> $@ - @echo -ne 'CFBundleExecutable\n' >> $@ - @echo -n $* >> $@ - @echo -ne '\nCFBundleIdentifier\n' >> $@ - @echo -n `cat $< | sed -ne '/^name:/ s/^name:// p'` >> $@ - @echo -e '\nCFBundleInfoDictionaryVersion\n6.0' >> $@ - @echo -ne 'CFBundleName\n' >> $@ - @echo -n `cat $< | sed -ne '/^desc:/ s/^desc:// p'` >> $@ - @echo -e '\nCFBundlePackageType\nKEXT' >> $@ - @echo -e 'CFBundleSignature\n9999' >> $@ - @echo -ne 'CFBundleVersion\n' >> $@ - @echo -n `cat $< | sed -ne '/^ver:/ s/^ver:// p'` >> $@ - @echo -ne 'OSBundleCompatibleVersion\n' >> $@ - @echo -n `cat $< | sed -ne '/^compver:/ s/^compver:// p'` >> $@ - @echo -e 'OSBundleLibraries\n\ncom.apple.kernel.bsd1.1\ncom.apple.kernel.libkern1.0b1\n\nOSBundleRequiredNone\n' >> $@ +$(POLICY).report: $(POLICY).gdb $(POLICY)-test + @echo "$(POLICY): Creating policy report..." + @echo "Undefined $(POLICY) policy entrypoints:" > $@ + @gdb -x $(POLICY).gdb $(POLICY)-test \ + | grep ' = 0,' \ + | awk '{print "\t"$$1}' \ + | sort \ + | uniq \ + >> $@ ==== //depot/projects/trustedbsd/sedarwin7/src/ipctrace/Makefile#3 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin7/src/mac_count/Makefile#2 (text+ko) ==== @@ -1,11 +1,58 @@ -all: - cd module && make - cd commands && make +POLICY= count +POLICY_VER= 1.0 +POLICY_COMPVER= 1.0 +POLICY_DESC= "Entry Point Counter" +POLICY_SRCS= mac_count.c +POLICY_NOMAN= yes + +include ../Makeconfig +include $(DARWIN_ROOT)/build/PolicyKext.mk + +CLEANFILES+= count_decls.h count_reg.h count_funcs.h count_policy_ops.h \ + policy.in + +mac_count.c: count_decls.h count_reg.h count_funcs.h count_policy_ops.h + +policy.in: $(EXPORT_HDRS)/bsd/sys/mac_policy.h + @cpp -P $< \ + | grep -v ^\$ \ + | awk 'RS=";" { if ($$1 == "typedef") { print $$0";" } }' \ + | tr -d "\n\t" \ + | tr ";" "\n" \ + | sed -e 's/typedef //g' \ + -e 's/,/, /g' \ + -e 's/_t(/ (/g' \ + -e 's/ mpo_/ /g' \ + > $@ + +count_decls.h: policy.in + @cat $< \ + | grep -v \ + -e ' destroy ' \ + -e ' init_bsd ' \ + -e ' init ' \ + | awk -f mk_count_decls.awk \ + > $@ + +count_reg.h: policy.in + @cat $< \ + | grep -v \ + -e ' destroy ' \ + -e ' init_bsd ' \ + -e ' init ' \ + | awk -f mk_count_reg.awk \ + > $@ -clean: - cd module && make clean - cd commands && make clean +count_funcs.h: policy.in + @cat $< \ + | grep -v \ + -e ' destroy ' \ + -e ' init_bsd ' \ + -e ' init ' \ + | awk -f mk_count_funcs.awk \ + > $@ -install: - cd module && make install - cd commands && make install +count_policy_ops.h: policy.in + @cat $< \ + | awk -f mk_count_policy_ops.awk \ + > $@ ==== //depot/projects/trustedbsd/sedarwin7/src/mac_mls/Makefile#3 (text+ko) ==== @@ -1,16 +1,9 @@ +POLICY= mls +POLICY_VER= 1.0 +POLICY_COMPVER= 1.0 +POLICY_DESC= "TrustedBSD MAC/MLS" +POLICY_SRCS= mac_mls.c +POLICY_NOMAN= yes include ../Makeconfig include $(DARWIN_ROOT)/build/PolicyKext.mk - -CFLAGS += $(DARWIN_HDRS) -DAPPLE -CFLAGS += -g - -mac_mls.kext.tar: mac_mls.o - -clean: - rm -rf mac_mls.kext.tar mac_mls.kext - rm -f mac_mls.o - -install: mac_mls.kext.tar - cat $< | (cd $(DESTDIR)/System/Library/Extensions; tar xf -) - touch $(DESTDIR)/System/Library/Extensions/mac_mls.kext/LoadEarly ==== //depot/projects/trustedbsd/sedarwin7/src/mac_mls/mac_mls.c#5 (text+ko) ==== @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -1794,6 +1795,45 @@ } static int +mac_mls_check_proc_setlcid (struct proc *p0, struct proc *p, + pid_t pid, pid_t lcid) +{ + struct mac_mls *source, *dest; + + /* Create/Join/Leave */ + if (pid == LCID_PROC_SELF) + return (0); + + switch (lcid) { + case LCID_REMOVE: /* Orphan */ + + /* loginwindow.app/MAC.loginPlugin orphaned process. */ + dest = SLOT(p->p_ucred->cr_label); + + mac_mls_set_effective(dest, MAC_MLS_TYPE_EQUAL, 0, NULL); + mac_mls_set_range(dest, MAC_MLS_TYPE_LOW, 0, NULL, + MAC_MLS_TYPE_HIGH, 0, NULL); + break; + + case LCID_CREATE: /* Create */ + /* nop */ + break; + default: /* Adopt */ + + /* loginwindow.app/MAC.loginPlugin adopted process. */ + + source = SLOT(p0->p_ucred->cr_label); + dest = SLOT(p->p_ucred->cr_label); + + mac_mls_copy(source, dest); + + break; + } + + return (0); +} + +static int mac_mls_audit_preselect(struct ucred *cred, unsigned short syscode, void *args) { @@ -1845,27 +1885,7 @@ return (MAC_AUDIT_DEFAULT); } -#ifdef LATER static int -mac_mls_check_bpfdesc_receive(struct bpf_d *bpf_d, struct label *bpflabel, - struct ifnet *ifnet, struct label *ifnetlabel) -{ - struct mac_mls *a, *b; - - if (!mac_mls_enabled) - return (0); - - a = SLOT(bpflabel); - b = SLOT(ifnetlabel); - - if (mac_mls_equal_effective(a, b)) - return (0); - - MLS_RETURN (EACCES); -} -#endif /* LATER */ - -static int mac_mls_check_cred_relabel(struct ucred *cred, struct label *newlabel) { struct mac_mls *subj, *new; @@ -2764,11 +2784,11 @@ return (0); } +#if 0 static int mac_mls_check_vnode_deleteextattr(struct ucred *cred, struct vnode *vp, int attrnamespace, const char *name) { -#if 0 struct mac_mls *subj, *obj; if (!mac_mls_enabled) @@ -2779,10 +2799,10 @@ if (!mac_mls_dominate_effective(obj, subj)) return (EACCES); -#endif return (0); } +#endif static int mac_mls_check_vnode_exchangedata(struct ucred *cred, @@ -2884,11 +2904,11 @@ return (0); } +#if 0 static int mac_mls_check_vnode_listextattr(struct ucred *cred, struct vnode *vp, int attrnamespace) { -#if 0 struct mac_mls *subj, *obj; if (!mac_mls_enabled) @@ -2899,10 +2919,10 @@ if (!mac_mls_dominate_effective(subj, obj)) return (EACCES); -#endif return (0); } +#endif static int mac_mls_check_vnode_lookup(struct ucred *cred, struct vnode *dvp, @@ -3344,41 +3364,6 @@ mac_mls_copy_range(source, dest); } -#if 0 -static void -mac_mls_execve_transition(struct ucred *old, struct ucred *new, - struct vnode *vp, struct label *filelabel, - struct label *interpvnodelabel, struct label *execlabel) -{ -#warning mac_mls_execve_transition unimplemented - printf("mac_mls_execve_transition: not implemented\n"); -} - -static int -mac_mls_execve_will_transition(struct ucred *old, struct vnode *vp, - struct label *filelabel, struct label *interpvnodelabel, - struct label *execlabel, struct proc *proc) -{ -#warning mac_mls_execve_will_transition unimplemented - printf("mac_mls_execve_will_transition: not implemented\n"); - return 0; -} - -static void -mac_mls_reflect_mbuf_icmp(struct mbuf *m, struct label *mlabel) -{ -#warning what to do in mac_mls_reflect_mbuf_icmp - printf("mac_mls_reflect_mbuf_icmp: not implemented\n"); -} - -static void -mac_mls_reflect_mbuf_tcp(struct mbuf *m, struct label *mlabel) -{ -#warning what to do in mac_mls_reflect_mbuf_tcp - printf("mac_mls_reflect_mbuf_tcp: not implemented\n"); -} -#endif /* 0 */ - static struct mac_policy_ops mac_mls_ops = { @@ -3442,11 +3427,11 @@ .mpo_check_vnode_exchangedata = mac_mls_check_vnode_exchangedata, .mpo_check_vnode_getattrlist = mac_mls_check_vnode_getattrlist, .mpo_check_vnode_setattrlist = mac_mls_check_vnode_setattrlist, - .mpo_check_vnode_deleteextattr = mac_mls_check_vnode_deleteextattr, +/* .mpo_check_vnode_deleteextattr = mac_mls_check_vnode_deleteextattr,*/ .mpo_check_vnode_exec = mac_mls_check_vnode_exec, .mpo_check_vnode_getextattr = mac_mls_check_vnode_getextattr, .mpo_check_vnode_link = mac_mls_check_vnode_link, - .mpo_check_vnode_listextattr = mac_mls_check_vnode_listextattr, +/* .mpo_check_vnode_listextattr = mac_mls_check_vnode_listextattr,*/ .mpo_check_vnode_lookup = mac_mls_check_vnode_lookup, .mpo_check_vnode_mmap = mac_mls_check_vnode_mmap, .mpo_check_vnode_open = mac_mls_check_vnode_open, @@ -3531,47 +3516,12 @@ .mpo_check_proc_setauid = mac_mls_check_proc_setauid, .mpo_check_proc_getaudit = mac_mls_check_proc_getaudit, .mpo_check_proc_setaudit = mac_mls_check_proc_setaudit, + .mpo_check_proc_setlcid = mac_mls_check_proc_setlcid, .mpo_audit_preselect = mac_mls_audit_preselect, .mpo_audit_postselect = mac_mls_audit_postselect, }; -/* These are the mac_test policy ops which aren't (yet) implemented by mac_mls - -.mpo_check_kld_load = mac_test_check_kld_load, -.mpo_check_sysarch_ioperm = mac_test_check_sysarch_ioperm, -.mpo_check_vnode_deleteacl = mac_test_check_vnode_deleteacl, -.mpo_check_vnode_getacl = mac_test_check_vnode_getacl, -.mpo_check_vnode_setacl = mac_test_check_vnode_setacl, -.mpo_thread_userret = mac_test_thread_userret, -.mpo_execve_will_transition = mac_mls_execve_will_transition, -.mpo_execve_transition = mac_mls_execve_transition, -.mpo_create_datagram_from_ipq = mac_mls_create_datagram_from_ipq, - .mpo_init_bpfdesc_label = mac_mls_init_label, - .mpo_destroy_bpfdesc_label = mac_mls_destroy_label, - .mpo_create_bpfdesc = mac_mls_create_bpfdesc, - .mpo_create_fragment = mac_mls_create_fragment, - .mpo_destroy_ifnet_label = mac_mls_destroy_label, - .mpo_externalize_ifnet_label = mac_mls_externalize_label, - .mpo_init_ifnet_label = mac_mls_init_label, - .mpo_internalize_ifnet_label = mac_mls_internalize_label, - .mpo_create_ifnet = mac_mls_create_ifnet, - .mpo_relabel_ifnet = mac_mls_relabel_ifnet, - .mpo_init_ipq_label = mac_mls_init_label_waitcheck, - .mpo_update_ipq = mac_mls_update_ipq, - .mpo_fragment_match = mac_mls_fragment_match, - .mpo_create_mbuf_from_bpfdesc = mac_mls_create_mbuf_from_bpfdesc, - .mpo_create_mbuf_from_ifnet = mac_mls_create_mbuf_from_ifnet, - .mpo_create_mbuf_from_mbuf = mac_mls_create_mbuf_from_mbuf, - .mpo_create_mbuf_linklayer = mac_mls_create_mbuf_linklayer, - .mpo_create_mbuf_multicast_encap = mac_mls_create_mbuf_multicast_encap, - .mpo_create_mbuf_netlayer = mac_mls_create_mbuf_netlayer, - .mpo_destroy_mbuf_label = mac_mls_destroy_label, - .mpo_init_mbuf_label = mac_mls_init_label_waitcheck, - .mpo_reflect_mbuf_icmp = mac_mls_reflect_mbuf_icmp, - .mpo_reflect_mbuf_tcp = mac_mls_reflect_mbuf_tcp, -*/ - static char *labelnamespaces[MAC_MLS_LABEL_NAME_COUNT] = {MAC_MLS_LABEL_NAME}; struct mac_policy_conf mac_mls_mac_policy_conf = { "mac_mls", /* policy name */ @@ -3591,13 +3541,15 @@ static kern_return_t kmod_start(kmod_info_t *ki, void *xd) { - return mac_policy_register (&mac_mls_mac_policy_conf); + + return (mac_policy_register(&mac_mls_mac_policy_conf)); } static kern_return_t kmod_stop(kmod_info_t *ki, void *xd) { - return mac_policy_unregister (&mac_mls_mac_policy_conf); + + return (mac_policy_unregister(&mac_mls_mac_policy_conf)); } extern kern_return_t _start(kmod_info_t *ki, void *data); ==== //depot/projects/trustedbsd/sedarwin7/src/mac_mls/mac_mls.h#3 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin7/src/mac_none/Makefile#3 (text+ko) ==== @@ -1,16 +1,9 @@ +POLICY= none +POLICY_VER= 1.0 +POLICY_COMPVER= 1.0 +POLICY_DESC= "MAC None Policy" +POLICY_SRCS= mac_none.c +POLICY_MAN= mac_none.4 + include ../Makeconfig include $(DARWIN_ROOT)/build/PolicyKext.mk - -CFLAGS += $(DARWIN_HDRS) -DAPPLE -CFLAGS += -g - -mac_none.kext.tar: mac_none.o - -clean: - rm -rf mac_none.kext.tar mac_none.kext - rm -f mac_none.o - -install: mac_none.kext.tar mac_none.4 - install -m 644 mac_none.4 $(DESTDIR)/usr/share/man/man4 - cat $< | (cd $(DESTDIR)/System/Library/Extensions; tar xf -) - touch $(DESTDIR)/System/Library/Extensions/mac_none.kext/LoadEarly ==== //depot/projects/trustedbsd/sedarwin7/src/mac_none/mac_none.4#3 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin7/src/mac_none/mac_none.c#3 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin7/src/mac_stub/Makefile#3 (text+ko) ==== @@ -1,16 +1,35 @@ +POLICY= stub +POLICY_VER= 1.0 +POLICY_COMPVER= 1.0 +POLICY_DESC= "MAC Stub Policy" +POLICY_SRCS= mac_stub.c +POLICY_MAN= mac_stub.4 + include ../Makeconfig include $(DARWIN_ROOT)/build/PolicyKext.mk -CFLAGS += $(DARWIN_HDRS) -DAPPLE -CFLAGS += -g -Wall +CLEANFILES+= stub_funcs.h stub_policy_ops.h policy.in + +mac_stub.c: stub_funcs.h stub_policy_ops.h -mac_stub.kext.tar: mac_stub.o +policy.in: $(EXPORT_HDRS)/bsd/sys/mac_policy.h + @cpp -P $< \ + | grep -v ^\$ \ + | awk 'RS=";" { if ($$1 == "typedef") { print $$0";" } }' \ + | tr -d "\n\t" \ + | tr ";" "\n" \ + | sed -e 's/typedef //g' \ + -e 's/,/, /g' \ + -e 's/_t(/ (/g' \ + -e 's/ mpo_/ /g' \ + > $@ -clean: - rm -rf mac_stub.kext.tar mac_stub.kext - rm -f mac_stub.o +stub_funcs.h: policy.in + @cat $< \ + | awk -f mk_stub_funcs.awk \ + > $@ -install: mac_stub.kext.tar mac_stub.4 - install -m 644 mac_stub.4 $(DESTDIR)/usr/share/man/man4 - cat $< | (cd $(DESTDIR)/System/Library/Extensions; tar xf -) - touch $(DESTDIR)/System/Library/Extensions/mac_stub.kext/LoadEarly +stub_policy_ops.h: policy.in + @cat $< \ + | awk -f mk_stub_policy_ops.awk \ + > $@ ==== //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mac_stub.4#3 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mac_stub.c#5 (text+ko) ==== @@ -1,6 +1,7 @@ /*- + * Copyright (c) 2005 SPARTA, Inc. + * Copyright (c) 2001-2003 Networks Associates Technology, Inc. * Copyright (c) 1999-2002 Robert N. M. Watson - * Copyright (c) 2001-2003 Networks Associates Technology, Inc. * All rights reserved. * * This software was developed by Robert Watson for the TrustedBSD Project. @@ -44,25 +45,27 @@ */ #include -#include #include #include -#include #include #include #include #include #include #include +#include +#include #include #include #include #include #include -#include #include #include #include + +#include +#include #include #include @@ -89,1286 +92,18 @@ SYSCTL_INT(_security_mac_stub, OID_AUTO, enabled, CTLFLAG_RW, &mac_stub_enabled, 0, "Enforce stub policy"); -static void -stub_associate_vnode_devfs(struct mount *mp, struct label *fslabel, - struct devnode *de, struct label *delabel, struct vnode *vp, - struct label *vlabel) -{ - -} - -static int -stub_associate_vnode_extattr(struct mount *mp, struct label *fslabel, - struct vnode *vp, struct label *vlabel) -{ - - return (0); -} - -static void -stub_associate_vnode_singlelabel(struct mount *mp, struct label *fslabel, - struct vnode *vp, struct label *vlabel) -{ - -} - -static int -stub_check_cred_relabel(struct ucred *cred, struct label *newlabel) -{ - - return (0); -} - -static int -stub_check_cred_visible(struct ucred *u1, struct ucred *u2) -{ - - return (0); -} - - -static int -stub_check_fcntl(struct ucred *cred, struct file *fd, int cmd, int arg) -{ - - return (0); -} - -static int -stub_check_get_fd(struct ucred *cred, struct file *fd, char *elements, int len) -{ - - return (0); -} - -static int -stub_check_ioctl(struct ucred *cred, struct file *fd, int com, void *data) -{ - - return (0); -} - -static int -stub_check_mount_stat(struct ucred *cred, struct mount *mp, - struct label *mntlabel) -{ - - return (0); -} - -static int -stub_check_port_copy_send(struct label *task, struct label *port) -{ - - return (0); -} - -static int -stub_check_port_hold_receive(struct label *task, struct label *port) -{ - - return (0); -} - -static int -stub_check_port_hold_send(struct label *task, struct label *port) -{ - - return (0); -} - -static int -stub_check_port_make_send(struct label *task, struct label *port) -{ - - return (0); -} - -static int -stub_check_port_move_receive(struct label *task, struct label *port) -{ - - return (0); -} - -static int -stub_check_port_relabel(struct label *task, struct label *old, - struct label *newlabel) -{ - - return (0); -} - -static int -stub_check_port_send(struct label *task, struct label *port) -{ - - return (0); -} - -static int -stub_check_posix_sem_create(struct ucred *cred, const char *semname) -{ - - return (0); -} - -static int -stub_check_posix_sem_open(struct ucred *cred, struct pseminfo *sem, - struct label *semlabel) -{ - - return (0); -} - -static int -stub_check_posix_sem_post(struct ucred *cred, struct pseminfo *sem, - struct label *semlabel) -{ - - return (0); -} - -static int -stub_check_posix_sem_unlink(struct ucred *cred, struct pseminfo *sem, - struct label *semlabel, const char *semname) -{ - - return (0); -} - -static int -stub_check_posix_sem_wait(struct ucred *cred, struct pseminfo *sem, - struct label *semlabel) -{ - - return (0); -} - -static int -stub_check_posix_shm_create(struct ucred *cred, const char *shmname) -{ - - return (0); -} - -static int -stub_check_posix_shm_open(struct ucred *cred, struct pshminfo *shm, - struct label *shmlabel) -{ - - return (0); -} - -static int -stub_check_posix_shm_mmap(struct ucred *cred, struct pshminfo *shm, - struct label *shmlabel, int flags, int prot) -{ - - return (0); -} - -static int -stub_check_posix_shm_stat(struct ucred *cred, struct pshminfo *shm, - struct label *shmlabel) -{ - - return (0); -} - -static int -stub_check_posix_shm_truncate(struct ucred *cred, struct pshminfo *shm, - struct label *shmlabel, size_t size) -{ - - return (0); -} - -static int -stub_check_posix_shm_unlink(struct ucred *cred, struct pshminfo *shm, - struct label *shmlabel, const char *shmname) -{ - - return (0); -} - -static int -stub_check_proc_debug(struct ucred *cred, struct proc *proc) -{ - - return (0); -} - -static int -stub_check_proc_getaudit(struct ucred *cred) -{ - - return (0); -} - -static int -stub_check_proc_getauid(struct ucred *cred) -{ - - return (0); -} - -static int -stub_check_proc_sched(struct ucred *cred, struct proc *proc) -{ - - return (0); -} - -static int -stub_check_proc_setaudit(struct ucred *cred, struct auditinfo *ai) -{ - - return (0); -} - -static int -stub_check_proc_setauid(struct ucred *cred, uid_t auid) -{ - - return (0); -} - -static int -stub_check_proc_signal(struct ucred *cred, struct proc *proc, int signum) -{ - - return (0); -} - -static int -stub_check_proc_wait(struct ucred *cred, struct proc *proc) -{ - - return (0); -} - -static int -stub_check_service_access(struct label *subj, struct label *obj, - const char *serv, const char *perm) -{ - - return (0); -} - -static int -stub_check_set_fd(struct ucred *cred, struct file *fd, char *elements, int len) -{ - - return (0); -} - -static int -stub_check_socket_accept(struct ucred *cred, - struct socket *socket, struct label *socklabel, struct sockaddr *addr) -{ - - return (0); -} - -static int -stub_check_socket_bind(struct ucred *cred, struct socket *socket, - struct label *socklabel, struct sockaddr *addr) -{ - - return (0); -} - -static int -stub_check_socket_connect(struct ucred *cred, struct socket *socket, - struct label *socklabel, struct sockaddr *addr) -{ - - return (0); -} - -static int -stub_check_socket_deliver(struct socket *so, struct label *so_label, - struct mbuf *m, struct label *m_label) -{ - - return (0); -} - -static int >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Jan 20 15:51:28 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF48A16A423; Fri, 20 Jan 2006 15:51:27 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B021116A420 for ; Fri, 20 Jan 2006 15:51:27 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5AAB943D46 for ; Fri, 20 Jan 2006 15:51:27 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KFpRUB076118 for ; Fri, 20 Jan 2006 15:51:27 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KFpQk6076115 for perforce@freebsd.org; Fri, 20 Jan 2006 15:51:26 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 15:51:26 GMT Message-Id: <200601201551.k0KFpQk6076115@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90011 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 15:51:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=90011 Change 90011 by millert@millert_g4tower on 2006/01/20 15:50:46 Update to work with the new module build framework. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/Makefile#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd.c#25 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/Makefile#5 (text+ko) ==== @@ -1,21 +1,16 @@ -include ../../Makeconfig -include $(DARWIN_ROOT)/build/PolicyKext.mk +POLICY= sedarwin +POLICY_VER= 1.0 +POLICY_COMPVER= 1.0 +POLICY_DESC= "SEDarwin (SELinux compatible TE)" +POLICY_NOMAN= yes -CFLAGS += $(DARWIN_HDRS) -DKERNEL -DAPPLE -I.. +POLICY_SRCS= sebsd.c sebsd_syscall.c sebsd_sysctl.c +POLICY_SRCS+= ss/avtab.c ss/ebitmap.c ss/hashtab.c ss/init.c ss/policydb.c \ + ss/queue.c ss/services.c ss/sidtab.c ss/symtab.c ss/mach_av.c \ + ss/conditional.c +POLICY_SRCS+= avc/avc.c -OBJS = sebsd.o sebsd_syscall.o sebsd_sysctl.o ss/avtab.o ss/ebitmap.o \ - ss/hashtab.o ss/init.o ss/policydb.o ss/queue.o ss/services.o \ - ss/sidtab.o ss/symtab.o avc/avc.o ss/mach_av.o ss/conditional.o +CFLAGS+= -DSEFOS_DEBUG -I.. -sedarwin.kext.tar: sedarwin.o - -sedarwin.o: $(OBJS) - ld -r -o $@ $^ - -clean: - rm -rf sedarwin.kext.tar sedarwin.kext - rm -f $(OBJS) sedarwin.o - -install: sedarwin.kext.tar - cat $< | (cd $(DESTDIR)/System/Library/Extensions; tar xf -) - touch $(DESTDIR)/System/Library/Extensions/sedarwin.kext/LoadEarly +include ../../Makeconfig +include $(DARWIN_ROOT)/build/PolicyKext.mk ==== //depot/projects/trustedbsd/sedarwin7/src/sedarwin/sedarwin/sebsd.c#25 (text+ko) ==== @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2005, 2006 SPARTA, Inc. * Copyright (c) 2002, 2003 Networks Associates Technology, Inc. * All rights reserved. * @@ -2769,7 +2770,7 @@ extern kern_return_t _start(kmod_info_t *ki, void *data); extern kern_return_t _stop(kmod_info_t *ki, void *data); -KMOD_EXPLICIT_DECL(security.sedarwin, "1.0", _start, _stop) +KMOD_EXPLICIT_DECL(security.sedarwin, POLICY_VER, _start, _stop) kmod_start_func_t *_realmain = kmod_start; kmod_stop_func_t *_antimain = kmod_stop; int _kext_apple_cc = __APPLE_CC__ ; From owner-p4-projects@FreeBSD.ORG Fri Jan 20 17:59:03 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DBECB16A422; Fri, 20 Jan 2006 17:59:02 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BBE816A41F for ; Fri, 20 Jan 2006 17:59:02 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5604043D49 for ; Fri, 20 Jan 2006 17:59:02 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KHx2li089561 for ; Fri, 20 Jan 2006 17:59:02 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KHx1mJ089558 for perforce@freebsd.org; Fri, 20 Jan 2006 17:59:02 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 17:59:02 GMT Message-Id: <200601201759.k0KHx1mJ089558@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90015 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 17:59:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=90015 Change 90015 by millert@millert_g4tower on 2006/01/20 17:58:24 Back out #90006 for this file. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/ipctrace/Makefile#4 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/ipctrace/Makefile#4 (text+ko) ==== @@ -1,25 +1,11 @@ -include ../Makeconfig -include ../darwin/build/PolicyKext.mk - -CFLAGS += -g -DKERNEL -DAPPLE -I../darwin/xnu/bsd -I../darwin/xnu/osfmk \ - -I../darwin/xnu/EXTERNAL_HEADERS/bsd \ - -I../darwin/xnu/EXTERNAL_HEADERS - -all: dumptrace ipctrace.kext.tar - -ipctrace.kext.tar: ipctrace.o - -ikotnames.h: ../darwin/xnu/osfmk/kern/ipc_kobject.h - perl ikotnames $< > $@ - -dumptrace: dumptrace.c ikotnames.h - gcc -o $@ -I$(EXPORT_HDRS)/osfmk -I$(EXPORT_HDRS)/bsd $< $(LIBMAC) +all: + cd module && make + cd commands && make clean: - rm -f ipctrace.o ipctrace.kext.tar - rm -rf ipctrace.kext + cd module && make clean + cd commands && make clean -install: ipctrace.kext.tar - cat $< | (cd $(DESTDIR)/System/Library/Extensions; tar xf -) - touch $(DESTDIR)/System/Library/Extensions/ipctrace.kext/LoadEarly - install -m 755 dumptrace $(DESTDIR)/$(BINDIR) +install: + cd module && make install + cd commands && make install From owner-p4-projects@FreeBSD.ORG Fri Jan 20 18:01:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C2FEB16A422; Fri, 20 Jan 2006 18:01:05 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8453E16A41F for ; Fri, 20 Jan 2006 18:01:05 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37DC243D46 for ; Fri, 20 Jan 2006 18:01:05 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KI15FT089704 for ; Fri, 20 Jan 2006 18:01:05 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KI14b0089701 for perforce@freebsd.org; Fri, 20 Jan 2006 18:01:04 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 18:01:04 GMT Message-Id: <200601201801.k0KI14b0089701@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90016 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 18:01:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=90016 Change 90016 by millert@millert_g4tower on 2006/01/20 18:00:52 Adapt to new module build method and pull in changes from DSEP Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/Makefile#4 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mac_stacktrace.c#5 edit .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mac_stacktrace.c.in#1 add .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mk_policy_ops.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mk_stubs.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mk_trace.awk#1 add Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/Makefile#4 (text+ko) ==== @@ -1,14 +1,57 @@ +POLICY= stacktrace +POLICY_VER= 1.0 +POLICY_COMPVER= 1.0 +POLICY_DESC= "Stacktrace module" +POLICY_SRCS= mac_stacktrace.c +POLICY_NOMAN= yes + +CFLAGS=-I.. -Wall + include ../../Makeconfig -include ../../darwin/build/PolicyKext.mk +include $(DARWIN_ROOT)/build/PolicyKext.mk + +CLEANFILES += trace.in stubs.in policy_ops.in policy.in \ + funcnames.in + +update: mac_stacktrace.c.in trace.in stubs.in policy_ops.in + @echo Updating mac_stacktrace.c... + @cpp -U__APPLE_CC__ -C -P mac_stacktrace.c.in \ + | sed -e 's/^@@@/#/g' \ + | grep -v ^#pragma \ + > mac_stacktrace.c + +policy.in: $(EXPORT_HDRS)/bsd/sys/mac_policy.h + @cpp -P $< \ + | grep -v ^\$ \ + | awk 'RS=";" { if ($$1 == "typedef") { print $$0";" } }' \ + | tr -d "\n\t" \ + | tr ";" "\n" \ + | sed -e 's/typedef //g' \ + -e 's/,/, /g' \ + -e 's/_t(/ (/g' \ + -e 's/ mpo_/ /g' \ + > $@ -CFLAGS += -DKERNEL -DAPPLE $(DARWIN_HDRS) -I.. +stubs.in: policy.in + @cat $< \ + | grep -v init_bsd \ + | grep -v syscall \ + | awk -f mk_stubs.awk \ + > $@ -mac_stacktrace.kext.tar: mac_stacktrace.o +trace.in: policy.in + @cat $< \ + | grep -v syscall \ + | awk -f mk_trace.awk \ + > $@ -clean: - rm -f mac_stacktrace.o mac_stacktrace.kext.tar - rm -rf mac_stacktrace.kext +funcnames.in: policy.in + @cat $< \ + | grep -v syscall \ + | awk '{if (NR != 1) { printf ",\n" } printf "\t\"" $$2 "\""}' \ + > $@ -install: mac_stacktrace.kext.tar - cat $< | (cd $(DESTDIR)/System/Library/Extensions; tar xf -) - touch $(DESTDIR)/System/Library/Extensions/mac_stacktrace.kext/LoadEarly +policy_ops.in: policy.in + @cat $< \ + | awk -f mk_policy_ops.awk \ + > $@ ==== //depot/projects/trustedbsd/sedarwin7/src/stacktrace/module/mac_stacktrace.c#5 (text+ko) ==== @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2005 SPARTA, Inc. * Copyright (c) 2004 Networks Associates Technology, Inc. * All rights reserved. * @@ -31,9 +32,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -47,15 +46,16 @@ #include #include -#include #include #include #include +#include +#include + #include #include #include -#include #include "stacktrace_syscalls.h" #if 0 @@ -82,189 +82,206 @@ short onoff; }; -#define TRACE_DATA(name, num, onoff) \ - static struct function_info name##_td = { \ - num, \ - onoff, \ - } +#define TRACE_DATA(name, num, onoff) static struct function_info name##_td = { num, onoff } + TRACE_DATA(destroy, 0, STACKTRACE_ON); -TRACE_DATA(init, 1, STACKTRACE_OFF); // not tracing this because buffer not malloc'd yet -TRACE_DATA(syscall, 2, STACKTRACE_ON); -TRACE_DATA(init_bpfdesc_label, 3, STACKTRACE_ON); -TRACE_DATA(init_cred_label, 4, STACKTRACE_ON); +TRACE_DATA(init, 1, STACKTRACE_ON); +TRACE_DATA(init_bsd, 2, STACKTRACE_ON); +TRACE_DATA(init_cred_label, 3, STACKTRACE_ON); +TRACE_DATA(init_lctx_label, 4, STACKTRACE_ON); TRACE_DATA(init_devfsdirent_label, 5, STACKTRACE_ON); -TRACE_DATA(init_ifnet_label, 6, STACKTRACE_ON); -TRACE_DATA(init_ipq_label, 7, STACKTRACE_ON); -TRACE_DATA(init_mbuf_label, 8, STACKTRACE_ON); -TRACE_DATA(init_mount_label,9 , STACKTRACE_ON); -TRACE_DATA(init_mount_fs_label, 10, STACKTRACE_ON); -TRACE_DATA(init_socket_label, 11, STACKTRACE_ON); -TRACE_DATA(init_socket_peer_label, 12, STACKTRACE_ON); -TRACE_DATA(init_pipe_label, 13, STACKTRACE_ON); -TRACE_DATA(init_proc_label, 14, STACKTRACE_ON); -TRACE_DATA(init_task_label, 15, STACKTRACE_ON); -TRACE_DATA(init_port_label, 16, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(init_vnode_label, 17, STACKTRACE_ON); -TRACE_DATA(destroy_bpfdesc_label, 18, STACKTRACE_ON); -TRACE_DATA(destroy_cred_label, 19 , STACKTRACE_ON); -TRACE_DATA(destroy_devfsdirent_label, 20, STACKTRACE_ON); -TRACE_DATA(destroy_ifnet_label, 21, STACKTRACE_ON); -TRACE_DATA(destroy_ipq_label, 22, STACKTRACE_ON); -TRACE_DATA(destroy_mbuf_label, 23, STACKTRACE_ON); -TRACE_DATA(destroy_mount_label, 24, STACKTRACE_ON); -TRACE_DATA(destroy_mount_fs_label, 25, STACKTRACE_ON); -TRACE_DATA(destroy_socket_label, 26, STACKTRACE_ON); -TRACE_DATA(destroy_socket_peer_label, 27, STACKTRACE_ON); -TRACE_DATA(destroy_pipe_label, 28, STACKTRACE_ON); -TRACE_DATA(destroy_proc_label, 29 , STACKTRACE_ON); -TRACE_DATA(destroy_task_label, 30, STACKTRACE_ON); -TRACE_DATA(destroy_port_label, 31, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(destroy_vnode_label, 32, STACKTRACE_ON); -TRACE_DATA(copy_cred_to_task, 33, STACKTRACE_ON); -TRACE_DATA(copy_mbuf_label, 34, STACKTRACE_ON); -TRACE_DATA(update_port_from_cred_label, 35, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(copy_pipe_label, 36, STACKTRACE_ON); -TRACE_DATA(copy_vnode_label, 37, STACKTRACE_ON); -TRACE_DATA(copy_devfs_label, 38, STACKTRACE_ON); -TRACE_DATA(copy_port_label, 39 , STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(externalize_cred_label, 40, STACKTRACE_ON); -TRACE_DATA(externalize_ifnet_label, 41, STACKTRACE_ON); -TRACE_DATA(externalize_pipe_label, 42, STACKTRACE_ON); -TRACE_DATA(externalize_socket_label, 43, STACKTRACE_ON); -TRACE_DATA(externalize_socket_peer_label, 44, STACKTRACE_ON); -TRACE_DATA(externalize_vnode_label, 45, STACKTRACE_ON); -TRACE_DATA(internalize_cred_label, 46, STACKTRACE_ON); -TRACE_DATA(internalize_ifnet_label, 47, STACKTRACE_ON); -TRACE_DATA(internalize_pipe_label, 48, STACKTRACE_ON); -TRACE_DATA(internalize_socket_label, 49 , STACKTRACE_ON); -TRACE_DATA(internalize_vnode_label, 50, STACKTRACE_ON); -TRACE_DATA(associate_vnode_devfs, 51, STACKTRACE_ON); -TRACE_DATA(associate_vnode_extattr, 52, STACKTRACE_ON); -TRACE_DATA(associate_vnode_singlelabel, 53, STACKTRACE_ON); -TRACE_DATA(create_devfs_device, 54, STACKTRACE_ON); -TRACE_DATA(create_devfs_directory, 55, STACKTRACE_ON); -TRACE_DATA(create_devfs_symlink, 56, STACKTRACE_ON); -TRACE_DATA(create_vnode_extattr, 57, STACKTRACE_ON); -TRACE_DATA(create_mount, 58, STACKTRACE_ON); -TRACE_DATA(create_root_mount, 59, STACKTRACE_ON); // deprecated & removed -TRACE_DATA(relabel_vnode, 60, STACKTRACE_ON); -TRACE_DATA(setlabel_vnode_extattr, 61, STACKTRACE_ON); -TRACE_DATA(update_devfsdirent, 62, STACKTRACE_ON); -TRACE_DATA(create_mbuf_from_socket, 63, STACKTRACE_ON); -TRACE_DATA(create_socket, 64, STACKTRACE_ON); -TRACE_DATA(create_socket_from_socket, 65, STACKTRACE_ON); -TRACE_DATA(relabel_socket, 66, STACKTRACE_ON); -TRACE_DATA(relabel_pipe, 67, STACKTRACE_ON); -TRACE_DATA(set_socket_peer_from_mbuf, 68, STACKTRACE_ON); -TRACE_DATA(set_socket_peer_from_socket, 69 , STACKTRACE_ON); -TRACE_DATA(create_pipe, 70, STACKTRACE_ON); -TRACE_DATA(create_port, 71, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(create_bpfdesc, 72, STACKTRACE_ON); -TRACE_DATA(create_ifnet, 73, STACKTRACE_ON); -TRACE_DATA(create_ipq, 74, STACKTRACE_ON); -TRACE_DATA(create_datagram_from_ipq, 75, STACKTRACE_ON); -TRACE_DATA(create_fragment, 76, STACKTRACE_ON); -TRACE_DATA(create_mbuf_from_mbuf, 77, STACKTRACE_ON); -TRACE_DATA(create_mbuf_linklayer, 78, STACKTRACE_ON); -TRACE_DATA(create_mbuf_from_bpfdesc, 79 , STACKTRACE_ON); -TRACE_DATA(create_mbuf_from_ifnet, 80, STACKTRACE_ON); -TRACE_DATA(create_mbuf_multicast_encap, 81, STACKTRACE_ON); -TRACE_DATA(create_mbuf_netlayer, 82, STACKTRACE_ON); -TRACE_DATA(fragment_match, 83, STACKTRACE_ON); -TRACE_DATA(reflect_mbuf_icmp, 84, STACKTRACE_ON); -TRACE_DATA(reflect_mbuf_tcp, 85, STACKTRACE_ON); -TRACE_DATA(relabel_ifnet, 86, STACKTRACE_ON); -TRACE_DATA(update_ipq, 87, STACKTRACE_ON); -TRACE_DATA(update_mbuf_from_cipso, 88, STACKTRACE_ON); -TRACE_DATA(create_cred, 89 , STACKTRACE_ON); -TRACE_DATA(create_task,90, STACKTRACE_ON); -TRACE_DATA(execve_transition,91, STACKTRACE_ON); -TRACE_DATA(execve_will_transition,92, STACKTRACE_ON); -TRACE_DATA(create_proc0,93, STACKTRACE_ON); -TRACE_DATA(create_proc1,94, STACKTRACE_ON); -TRACE_DATA(relabel_cred,95, STACKTRACE_ON); -TRACE_DATA(thread_userret,96, STACKTRACE_ON); -TRACE_DATA(check_service_access,97, STACKTRACE_ON); -TRACE_DATA(check_bpfdesc_receive,98, STACKTRACE_ON); -TRACE_DATA(check_cred_relabel,99 , STACKTRACE_ON); -TRACE_DATA(check_port_relabel, 100, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(check_port_send, 101, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(check_port_make_send, 102, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(check_port_copy_send, 103, STACKTRACE_OFF); // disabled 2004-07-14 per RW -TRACE_DATA(check_port_move_receive, 104, STACKTRACE_OFF); // disabled 2004-07-14 per RW +TRACE_DATA(init_mbuf_failed_label, 6, STACKTRACE_ON); +TRACE_DATA(init_mbuf_socket_label, 7, STACKTRACE_ON); +TRACE_DATA(init_mount_label, 8, STACKTRACE_ON); +TRACE_DATA(init_mount_fs_label, 9, STACKTRACE_ON); +TRACE_DATA(init_port_label, 10, STACKTRACE_ON); +TRACE_DATA(init_posix_sem_label, 11, STACKTRACE_ON); +TRACE_DATA(init_posix_shm_label, 12, STACKTRACE_ON); +TRACE_DATA(init_proc_label, 13, STACKTRACE_ON); +TRACE_DATA(init_socket_label, 14, STACKTRACE_ON); +TRACE_DATA(init_socket_peer_label, 15, STACKTRACE_ON); +TRACE_DATA(init_sysv_sem_label, 16, STACKTRACE_ON); +TRACE_DATA(init_sysv_shm_label, 17, STACKTRACE_ON); +TRACE_DATA(init_task_label, 18, STACKTRACE_ON); +TRACE_DATA(init_tcp_label, 19, STACKTRACE_ON); +TRACE_DATA(init_mbuf_unknown_source_label, 20, STACKTRACE_ON); +TRACE_DATA(init_vnode_label, 21, STACKTRACE_ON); +TRACE_DATA(destroy_cred_label, 22, STACKTRACE_ON); +TRACE_DATA(destroy_lctx_label, 23, STACKTRACE_ON); +TRACE_DATA(destroy_devfsdirent_label, 24, STACKTRACE_ON); +TRACE_DATA(destroy_mbuf_socket_label, 25, STACKTRACE_ON); +TRACE_DATA(destroy_mount_label, 26, STACKTRACE_ON); +TRACE_DATA(destroy_mount_fs_label, 27, STACKTRACE_ON); +TRACE_DATA(destroy_port_label, 28, STACKTRACE_ON); +TRACE_DATA(destroy_posix_sem_label, 29, STACKTRACE_ON); +TRACE_DATA(destroy_posix_shm_label, 30, STACKTRACE_ON); +TRACE_DATA(destroy_proc_label, 31, STACKTRACE_ON); +TRACE_DATA(destroy_socket_label, 32, STACKTRACE_ON); +TRACE_DATA(destroy_socket_peer_label, 33, STACKTRACE_ON); +TRACE_DATA(destroy_sysv_sem_label, 34, STACKTRACE_ON); +TRACE_DATA(destroy_sysv_shm_label, 35, STACKTRACE_ON); +TRACE_DATA(destroy_task_label, 36, STACKTRACE_ON); +TRACE_DATA(destroy_vnode_label, 37, STACKTRACE_ON); +TRACE_DATA(cleanup_sysv_sem_label, 38, STACKTRACE_ON); +TRACE_DATA(cleanup_sysv_shm_label, 39, STACKTRACE_ON); +TRACE_DATA(copy_cred_to_task, 40, STACKTRACE_ON); +TRACE_DATA(update_port_from_cred_label, 41, STACKTRACE_ON); +TRACE_DATA(copy_vnode_label, 42, STACKTRACE_ON); +TRACE_DATA(copy_devfs_label, 43, STACKTRACE_ON); +TRACE_DATA(copy_mbuf_socket_label, 44, STACKTRACE_ON); +TRACE_DATA(copy_port_label, 45, STACKTRACE_ON); +TRACE_DATA(externalize_cred_label, 46, STACKTRACE_ON); +TRACE_DATA(externalize_cred_audit_label, 47, STACKTRACE_ON); +TRACE_DATA(externalize_lctx_label, 48, STACKTRACE_ON); +TRACE_DATA(externalize_vnode_label, 49, STACKTRACE_ON); +TRACE_DATA(externalize_vnode_audit_label, 50, STACKTRACE_ON); +TRACE_DATA(internalize_cred_label, 51, STACKTRACE_ON); +TRACE_DATA(internalize_lctx_label, 52, STACKTRACE_ON); +TRACE_DATA(internalize_vnode_label, 53, STACKTRACE_ON); +TRACE_DATA(associate_vnode_devfs, 54, STACKTRACE_ON); +TRACE_DATA(associate_vnode_extattr, 55, STACKTRACE_ON); +TRACE_DATA(associate_vnode_singlelabel, 56, STACKTRACE_ON); +TRACE_DATA(create_devfs_device, 57, STACKTRACE_ON); +TRACE_DATA(create_devfs_directory, 58, STACKTRACE_ON); +TRACE_DATA(create_devfs_symlink, 59, STACKTRACE_ON); +TRACE_DATA(create_vnode_extattr, 60, STACKTRACE_ON); +TRACE_DATA(create_mount, 61, STACKTRACE_ON); +TRACE_DATA(relabel_vnode, 62, STACKTRACE_ON); +TRACE_DATA(setlabel_vnode_extattr, 63, STACKTRACE_ON); +TRACE_DATA(update_devfsdirent, 64, STACKTRACE_ON); +TRACE_DATA(copy_socket_label, 65, STACKTRACE_ON); +TRACE_DATA(create_socket, 66, STACKTRACE_ON); +TRACE_DATA(create_socket_from_socket, 67, STACKTRACE_ON); +TRACE_DATA(create_mbuf_from_socket, 68, STACKTRACE_ON); +TRACE_DATA(externalize_socket_label, 69, STACKTRACE_ON); +TRACE_DATA(externalize_socket_peer_label, 70, STACKTRACE_ON); +TRACE_DATA(internalize_socket_label, 71, STACKTRACE_ON); +TRACE_DATA(relabel_socket, 72, STACKTRACE_ON); +TRACE_DATA(set_socket_peer_from_socket, 73, STACKTRACE_ON); +TRACE_DATA(set_socket_peer_from_mbuf, 74, STACKTRACE_ON); +TRACE_DATA(create_port, 75, STACKTRACE_ON); +TRACE_DATA(create_kernel_port, 76, STACKTRACE_ON); +TRACE_DATA(update_port_kobject, 77, STACKTRACE_ON); +TRACE_DATA(create_posix_sem, 78, STACKTRACE_ON); +TRACE_DATA(create_posix_shm, 79, STACKTRACE_ON); +TRACE_DATA(create_sysv_sem, 80, STACKTRACE_ON); +TRACE_DATA(create_sysv_shm, 81, STACKTRACE_ON); +TRACE_DATA(create_cred, 82, STACKTRACE_ON); +TRACE_DATA(create_task, 83, STACKTRACE_ON); +TRACE_DATA(create_kernel_task, 84, STACKTRACE_ON); +TRACE_DATA(execve_transition, 85, STACKTRACE_ON); +TRACE_DATA(execve_will_transition, 86, STACKTRACE_ON); +TRACE_DATA(create_proc0, 87, STACKTRACE_ON); +TRACE_DATA(create_proc1, 88, STACKTRACE_ON); +TRACE_DATA(relabel_cred, 89, STACKTRACE_ON); +TRACE_DATA(request_object_label, 90, STACKTRACE_ON); +TRACE_DATA(proc_create_lctx, 91, STACKTRACE_ON); +TRACE_DATA(proc_join_lctx, 92, STACKTRACE_ON); +TRACE_DATA(proc_leave_lctx, 93, STACKTRACE_ON); +TRACE_DATA(relabel_lctx, 94, STACKTRACE_ON); +TRACE_DATA(check_service_access, 95, STACKTRACE_ON); +TRACE_DATA(check_cred_relabel, 96, STACKTRACE_ON); +TRACE_DATA(check_lctx_relabel, 97, STACKTRACE_ON); +TRACE_DATA(check_port_relabel, 98, STACKTRACE_ON); +TRACE_DATA(check_port_send, 99, STACKTRACE_ON); +TRACE_DATA(check_port_make_send, 100, STACKTRACE_ON); +TRACE_DATA(check_port_copy_send, 101, STACKTRACE_ON); +TRACE_DATA(check_port_hold_send, 102, STACKTRACE_ON); +TRACE_DATA(check_port_hold_receive, 103, STACKTRACE_ON); +TRACE_DATA(check_port_move_receive, 104, STACKTRACE_ON); TRACE_DATA(check_cred_visible, 105, STACKTRACE_ON); -TRACE_DATA(check_ifnet_relabel, 106, STACKTRACE_ON); -TRACE_DATA(check_ifnet_transmit, 107, STACKTRACE_ON); -TRACE_DATA(check_kenv_dump, 108, STACKTRACE_ON); -TRACE_DATA(check_kenv_get, 109 , STACKTRACE_ON); -TRACE_DATA(check_kenv_set, 110, STACKTRACE_ON); -TRACE_DATA(check_kenv_unset, 111, STACKTRACE_ON); -TRACE_DATA(check_kld_load, 112, STACKTRACE_ON); -TRACE_DATA(check_kld_stat, 113, STACKTRACE_ON); -TRACE_DATA(check_kld_unload, 114, STACKTRACE_ON); -TRACE_DATA(check_mount_stat, 115, STACKTRACE_ON); -TRACE_DATA(check_pipe_ioctl, 116, STACKTRACE_ON); -TRACE_DATA(check_pipe_poll, 117, STACKTRACE_ON); -TRACE_DATA(check_pipe_read, 118, STACKTRACE_ON); -TRACE_DATA(check_pipe_relabel, 119 , STACKTRACE_ON); -TRACE_DATA(check_pipe_stat, 120, STACKTRACE_ON); -TRACE_DATA(check_pipe_write, 121, STACKTRACE_ON); -TRACE_DATA(check_proc_debug, 122, STACKTRACE_ON); -TRACE_DATA(check_proc_sched, 123, STACKTRACE_ON); -TRACE_DATA(check_proc_signal, 124, STACKTRACE_ON); -TRACE_DATA(check_proc_wait, 125, STACKTRACE_ON); -TRACE_DATA(check_socket_bind, 126, STACKTRACE_ON); -TRACE_DATA(check_socket_connect, 127, STACKTRACE_ON); -TRACE_DATA(check_socket_deliver, 128, STACKTRACE_ON); -TRACE_DATA(check_socket_listen, 129 , STACKTRACE_ON); -TRACE_DATA(check_socket_receive, 130, STACKTRACE_ON); -TRACE_DATA(check_socket_relabel, 131, STACKTRACE_ON); -TRACE_DATA(check_socket_send, 132, STACKTRACE_ON); -TRACE_DATA(check_socket_visible, 133, STACKTRACE_ON); -TRACE_DATA(check_sysarch_ioperm, 134, STACKTRACE_ON); -TRACE_DATA(check_system_acct, 135, STACKTRACE_ON); -TRACE_DATA(check_system_nfsd, 136, STACKTRACE_ON); -TRACE_DATA(check_system_reboot, 137, STACKTRACE_ON); -TRACE_DATA(check_system_settime, 138, STACKTRACE_ON); -TRACE_DATA(check_system_swapon, 139 , STACKTRACE_ON); -TRACE_DATA(check_system_swapoff, 140, STACKTRACE_ON); -TRACE_DATA(check_system_sysctl, 141, STACKTRACE_ON); -TRACE_DATA(check_vnode_access, 142, STACKTRACE_ON); -TRACE_DATA(check_vnode_chdir, 143, STACKTRACE_ON); -TRACE_DATA(check_vnode_chroot, 144, STACKTRACE_ON); -TRACE_DATA(check_vnode_create, 145, STACKTRACE_ON); -TRACE_DATA(check_vnode_delete, 146, STACKTRACE_ON); -TRACE_DATA(check_vnode_deleteextattr, 147, STACKTRACE_ON); -TRACE_DATA(check_vnode_exec, 148, STACKTRACE_ON); -TRACE_DATA(check_vnode_deleteacl, 149 , STACKTRACE_ON); -TRACE_DATA(check_vnode_getacl, 150, STACKTRACE_ON); -TRACE_DATA(check_vnode_getextattr, 151, STACKTRACE_ON); -TRACE_DATA(check_vnode_link, 152, STACKTRACE_ON); -TRACE_DATA(check_vnode_listextattr, 153, STACKTRACE_ON); -TRACE_DATA(check_vnode_lookup, 154, STACKTRACE_ON); -TRACE_DATA(check_vnode_mmap, 155, STACKTRACE_ON); -TRACE_DATA(check_vnode_mmap_downgrade, 156, STACKTRACE_ON); -TRACE_DATA(check_vnode_mprotect, 157, STACKTRACE_ON); -TRACE_DATA(check_vnode_open, 158, STACKTRACE_ON); -TRACE_DATA(check_vnode_poll, 159 , STACKTRACE_ON); -TRACE_DATA(check_vnode_read, 160, STACKTRACE_ON); -TRACE_DATA(check_vnode_readdir, 161, STACKTRACE_ON); -TRACE_DATA(check_vnode_readlink, 162, STACKTRACE_ON); -TRACE_DATA(check_vnode_relabel, 163, STACKTRACE_ON); -TRACE_DATA(check_vnode_rename_from, 164, STACKTRACE_ON); -TRACE_DATA(check_vnode_rename_to, 165, STACKTRACE_ON); -TRACE_DATA(check_vnode_revoke, 166, STACKTRACE_ON); -TRACE_DATA(check_vnode_setacl, 167, STACKTRACE_ON); -TRACE_DATA(check_vnode_setextattr, 168, STACKTRACE_ON); -TRACE_DATA(check_vnode_setflags, 169 , STACKTRACE_ON); -TRACE_DATA(check_vnode_setmode, 170, STACKTRACE_ON); -TRACE_DATA(check_vnode_setowner, 171, STACKTRACE_ON); -TRACE_DATA(check_vnode_setutimes, 172, STACKTRACE_ON); -TRACE_DATA(check_vnode_stat, 173, STACKTRACE_ON); -TRACE_DATA(check_vnode_write, 174, STACKTRACE_ON); -TRACE_DATA(init_bsd, 175, STACKTRACE_ON); - +TRACE_DATA(check_fcntl, 106, STACKTRACE_ON); +TRACE_DATA(check_get_fd, 107, STACKTRACE_ON); +TRACE_DATA(check_ioctl, 108, STACKTRACE_ON); +TRACE_DATA(check_ipc_method, 109, STACKTRACE_ON); +TRACE_DATA(check_posix_sem_create, 110, STACKTRACE_ON); +TRACE_DATA(check_posix_sem_open, 111, STACKTRACE_ON); +TRACE_DATA(check_posix_sem_post, 112, STACKTRACE_ON); +TRACE_DATA(check_posix_sem_unlink, 113, STACKTRACE_ON); +TRACE_DATA(check_posix_sem_wait, 114, STACKTRACE_ON); +TRACE_DATA(check_posix_shm_create, 115, STACKTRACE_ON); +TRACE_DATA(check_posix_shm_open, 116, STACKTRACE_ON); +TRACE_DATA(check_posix_shm_mmap, 117, STACKTRACE_ON); +TRACE_DATA(check_posix_shm_stat, 118, STACKTRACE_ON); +TRACE_DATA(check_posix_shm_truncate, 119, STACKTRACE_ON); +TRACE_DATA(check_posix_shm_unlink, 120, STACKTRACE_ON); +TRACE_DATA(check_sysv_semctl, 121, STACKTRACE_ON); +TRACE_DATA(check_sysv_semget, 122, STACKTRACE_ON); +TRACE_DATA(check_sysv_semop, 123, STACKTRACE_ON); +TRACE_DATA(check_sysv_shmat, 124, STACKTRACE_ON); +TRACE_DATA(check_sysv_shmctl, 125, STACKTRACE_ON); +TRACE_DATA(check_sysv_shmdt, 126, STACKTRACE_ON); +TRACE_DATA(check_sysv_shmget, 127, STACKTRACE_ON); +TRACE_DATA(check_mount_stat, 128, STACKTRACE_ON); +TRACE_DATA(check_proc_debug, 129, STACKTRACE_ON); +TRACE_DATA(check_proc_sched, 130, STACKTRACE_ON); +TRACE_DATA(check_proc_signal, 131, STACKTRACE_ON); +TRACE_DATA(check_proc_wait, 132, STACKTRACE_ON); +TRACE_DATA(check_set_fd, 133, STACKTRACE_ON); +TRACE_DATA(check_socket_accept, 134, STACKTRACE_ON); +TRACE_DATA(check_socket_bind, 135, STACKTRACE_ON); +TRACE_DATA(check_socket_connect, 136, STACKTRACE_ON); +TRACE_DATA(check_socket_deliver, 137, STACKTRACE_ON); +TRACE_DATA(check_socket_listen, 138, STACKTRACE_ON); +TRACE_DATA(check_socket_poll, 139, STACKTRACE_ON); +TRACE_DATA(check_socket_receive, 140, STACKTRACE_ON); +TRACE_DATA(check_socket_relabel, 141, STACKTRACE_ON); +TRACE_DATA(check_socket_select, 142, STACKTRACE_ON); +TRACE_DATA(check_socket_send, 143, STACKTRACE_ON); +TRACE_DATA(check_socket_stat, 144, STACKTRACE_ON); +TRACE_DATA(check_system_acct, 145, STACKTRACE_ON); +TRACE_DATA(check_system_nfsd, 146, STACKTRACE_ON); +TRACE_DATA(check_system_reboot, 147, STACKTRACE_ON); +TRACE_DATA(check_system_settime, 148, STACKTRACE_ON); +TRACE_DATA(check_system_swapon, 149, STACKTRACE_ON); +TRACE_DATA(check_system_swapoff, 150, STACKTRACE_ON); +TRACE_DATA(check_system_sysctl, 151, STACKTRACE_ON); +TRACE_DATA(check_vnode_access, 152, STACKTRACE_ON); +TRACE_DATA(check_vnode_chdir, 153, STACKTRACE_ON); +TRACE_DATA(check_vnode_chroot, 154, STACKTRACE_ON); +TRACE_DATA(check_vnode_create, 155, STACKTRACE_ON); +TRACE_DATA(check_vnode_delete, 156, STACKTRACE_ON); +TRACE_DATA(check_vnode_deleteextattr, 157, STACKTRACE_ON); +TRACE_DATA(check_vnode_exchangedata, 158, STACKTRACE_ON); +TRACE_DATA(check_vnode_exec, 159, STACKTRACE_ON); +TRACE_DATA(check_vnode_getattrlist, 160, STACKTRACE_ON); +TRACE_DATA(check_vnode_getextattr, 161, STACKTRACE_ON); +TRACE_DATA(check_vnode_link, 162, STACKTRACE_ON); +TRACE_DATA(check_vnode_listextattr, 163, STACKTRACE_ON); +TRACE_DATA(check_vnode_lookup, 164, STACKTRACE_ON); +TRACE_DATA(check_vnode_mmap, 165, STACKTRACE_ON); +TRACE_DATA(check_vnode_mmap_downgrade, 166, STACKTRACE_ON); +TRACE_DATA(check_vnode_mprotect, 167, STACKTRACE_ON); +TRACE_DATA(check_vnode_open, 168, STACKTRACE_ON); +TRACE_DATA(check_vnode_poll, 169, STACKTRACE_ON); +TRACE_DATA(check_vnode_read, 170, STACKTRACE_ON); +TRACE_DATA(check_vnode_readdir, 171, STACKTRACE_ON); +TRACE_DATA(check_vnode_readlink, 172, STACKTRACE_ON); +TRACE_DATA(check_vnode_relabel, 173, STACKTRACE_ON); +TRACE_DATA(check_vnode_rename_from, 174, STACKTRACE_ON); +TRACE_DATA(check_vnode_rename_to, 175, STACKTRACE_ON); +TRACE_DATA(check_vnode_revoke, 176, STACKTRACE_ON); +TRACE_DATA(check_vnode_select, 177, STACKTRACE_ON); +TRACE_DATA(check_vnode_setattrlist, 178, STACKTRACE_ON); +TRACE_DATA(check_vnode_setextattr, 179, STACKTRACE_ON); +TRACE_DATA(check_vnode_setflags, 180, STACKTRACE_ON); +TRACE_DATA(check_vnode_setmode, 181, STACKTRACE_ON); +TRACE_DATA(check_vnode_setowner, 182, STACKTRACE_ON); +TRACE_DATA(check_vnode_setutimes, 183, STACKTRACE_ON); +TRACE_DATA(check_vnode_stat, 184, STACKTRACE_ON); +TRACE_DATA(check_vnode_write, 185, STACKTRACE_ON); +TRACE_DATA(check_system_audit, 186, STACKTRACE_ON); +TRACE_DATA(check_system_auditon, 187, STACKTRACE_ON); +TRACE_DATA(check_system_auditctl, 188, STACKTRACE_ON); +TRACE_DATA(check_proc_getauid, 189, STACKTRACE_ON); +TRACE_DATA(check_proc_getlcid, 190, STACKTRACE_ON); +TRACE_DATA(check_proc_setauid, 191, STACKTRACE_ON); +TRACE_DATA(check_proc_setlcid, 192, STACKTRACE_ON); +TRACE_DATA(check_proc_getaudit, 193, STACKTRACE_ON); +TRACE_DATA(check_proc_setaudit, 194, STACKTRACE_ON); +TRACE_DATA(audit_preselect, 195, STACKTRACE_ON); +TRACE_DATA(audit_postselect, 196, STACKTRACE_ON); /* * Buffer control. */ @@ -278,9 +295,7 @@ static int global_naxdepth = 0; // highest recursion level // TODO add a timestamp for time of last call // TODO add a timestamp for time of last reset -static mutex_t *buff_mtx; // mutex that protects a trace -static short global_enable = STACKTRACE_OFF; // STACKTRACE_ON or STACKTRACE_OFF, starts OFF till init_bsd -static int debugcount = 0; +static short global_enable = STACKTRACE_OFF; // STACKTRACE_ON, STACKTRACE_OFF or STACKTRACE_FULL; starts OFF till init_bsd /* * Initialize buffer pointers. @@ -303,18 +318,6 @@ // TODO add a timestamp for buffer reset } // initpointers -/* - * Return 1 if a pointer could be a code return address. - */ -static int -validcodeptr(const char *cp) -{ - - if ((cp != 0) && (((vm_address_t)cp & 0x80000000) == 0)) - return (1); - else - return (0); -} // validcodeptr /* * Return 1 if a pointer could be a stack frame pointer. @@ -416,7 +419,8 @@ initpointers(); // Reset the buffer to empty. global_resets++; } else if (global_fullbuffer_action == FULLBUFF_STOP) - global_enable = STACKTRACE_OFF; // Turn off tracing when buffer is full. + global_enable = STACKTRACE_FULL; + printf("stacktrace: buffer full, tracing disabled\n"); } // copy the temp slot into buffer, hopefully no page fault // TODO lock buffer, disable tracing @@ -443,7 +447,7 @@ * Syscall machinery. */ static int -stacktrace_syscall(struct proc *td, int call, void *args) +stacktrace_syscall(struct proc *td, int call, void *args, int *retv) { struct stacktrace_user_args p; int err = EINVAL; @@ -463,17 +467,20 @@ /* * If tracing goes from off too on, reset the buffer. */ - if (global_enable == STACKTRACE_OFF) + if (global_enable != STACKTRACE_ON) { initpointers(); - global_enable = STACKTRACE_ON; + global_enable = STACKTRACE_ON; + } err = 0; break; case STACKTRACE_OFF: - if (global_enable == STACKTRACE_ON) { - //kfree((vm_offset_t)buffer_basep, bufsize); - //buffer_basep = NULL; - } + + + + + + global_enable = STACKTRACE_OFF; err = 0; break; @@ -536,9 +543,11 @@ /* * Restore master trace setting following copyout() and - * buffer reset. + * buffer reset. If we had disabled tracing due to a full + * buffer, enable it now that the buffer has been flushed. */ - global_enable = prev_global_enable; + global_enable = (prev_global_enable == STACKTRACE_FULL) ? + STACKTRACE_ON : prev_global_enable; break; default: @@ -552,23 +561,8 @@ // ================================================================ static void -stacktrace_destroy(struct mac_policy_conf *conf) -{ - - trace(&destroy_td); -} // stacktrace_destroy - -static void -stacktrace_init(struct mac_policy_conf *conf) -{ - - trace(&init_td); -} // stacktrace_init - -static void -stacktrace_init_bsd(struct mac_policy_conf *conf) +stacktrace_init_bsd (struct mac_policy_conf *mpc) { - /* * We don't trace anything before this call. Thus we miss two calls: * to init and init_task_label (from machine_startup -> setup_main). @@ -576,1643 +570,1525 @@ global_enable = STACKTRACE_ON; initpointers(); trace(&init_bsd_td); -} // stacktrace_init_bsd +} -// stacktrace_syscall is above static void -stacktrace_init_bpfdesc_label(struct label *label) +stacktrace_destroy(struct mac_policy_conf *mpc) { + trace(&destroy_td); +} - trace(&init_bpfdesc_label_td); +static void +stacktrace_init(struct mac_policy_conf *mpc) +{ + trace(&init_td); } static void -stacktrace_init_cred_label(struct label *label) +stacktrace_init_cred_label(struct label *label) { - trace(&init_cred_label_td); } static void -stacktrace_init_devfsdirent_label(struct label *label) +stacktrace_init_lctx_label(struct label *label) { + trace(&init_lctx_label_td); +} +static void +stacktrace_init_devfsdirent_label(struct label *label) +{ trace(&init_devfsdirent_label_td); } static void -stacktrace_init_ifnet_label(struct label *label) +stacktrace_init_mbuf_failed_label(struct label *label) { - - trace(&init_ifnet_label_td); + trace(&init_mbuf_failed_label_td); } static int -stacktrace_init_ipq_label(struct label *label, int flag) +stacktrace_init_mbuf_socket_label(struct label *label, int waitok) { - - trace(&init_ipq_label_td); + trace(&init_mbuf_socket_label_td); return (0); } -static int -stacktrace_init_mbuf_label(struct label *label, int flag) +static void +stacktrace_init_mount_label(struct label *label) { + trace(&init_mount_label_td); +} - trace(&init_mbuf_label_td); - return (0); +static void +stacktrace_init_mount_fs_label(struct label *label) +{ + trace(&init_mount_fs_label_td); } static void -stacktrace_init_mount_label(struct label *label) +stacktrace_init_port_label(struct label *label) { + trace(&init_port_label_td); +} - trace(&init_mount_label_td); +static void +stacktrace_init_posix_sem_label(struct label *label) +{ + trace(&init_posix_sem_label_td); } static void -stacktrace_init_mount_fs_label(struct label *label) +stacktrace_init_posix_shm_label(struct label *label) { + trace(&init_posix_shm_label_td); +} - trace(&init_mount_fs_label_td); +static void +stacktrace_init_proc_label(struct label *label) +{ + trace(&init_proc_label_td); } static int -stacktrace_init_socket_label(struct label *label, int flag) +stacktrace_init_socket_label(struct label *label, int waitok) { - trace(&init_socket_label_td); return (0); } static int -stacktrace_init_socket_peer_label(struct label *label, int flag) +stacktrace_init_socket_peer_label(struct label *label, int waitok) { trace(&init_socket_peer_label_td); return (0); } -#if 0 // this is currently disabled in mac_policy.h (5-19-04) static void -stacktrace_init_pipe_label(struct label *label) +stacktrace_init_sysv_sem_label(struct label *label) { - - trace(&init_pipe_label_td); + trace(&init_sysv_sem_label_td); } -#endif static void -stacktrace_init_proc_label(struct label *label) +stacktrace_init_sysv_shm_label(struct label *label) { - - trace(&init_proc_label_td); + trace(&init_sysv_shm_label_td); } static void -stacktrace_init_task_label(struct label *label) +stacktrace_init_task_label(struct label *label) { - trace(&init_task_label_td); } static void -stacktrace_init_port_label(struct label *label) +stacktrace_init_tcp_label(struct label *label) { + trace(&init_tcp_label_td); +} -#ifndef NOPORTS - trace(&init_port_label_td); -#endif +static void +stacktrace_init_mbuf_unknown_source_label(struct label *label) +{ + trace(&init_mbuf_unknown_source_label_td); } static void -stacktrace_init_vnode_label(struct label *label) +stacktrace_init_vnode_label(struct label *label) { - trace(&init_vnode_label_td); } static void -stacktrace_destroy_bpfdesc_label(struct label *label) +stacktrace_destroy_cred_label(struct label *label) { - - trace(&destroy_bpfdesc_label_td); + trace(&destroy_cred_label_td); } static void -stacktrace_destroy_cred_label(struct label *label) +stacktrace_destroy_lctx_label(struct label *label) { - - trace(&destroy_cred_label_td); + trace(&destroy_lctx_label_td); } static void -stacktrace_destroy_devfsdirent_label(struct label *label) +stacktrace_destroy_devfsdirent_label(struct label *label) { - trace(&destroy_devfsdirent_label_td); } static void -stacktrace_destroy_ifnet_label(struct label *label) +stacktrace_destroy_mbuf_socket_label(struct label *label) { + trace(&destroy_mbuf_socket_label_td); +} - trace(&destroy_ifnet_label_td); +static void +stacktrace_destroy_mount_label(struct label *label) +{ + trace(&destroy_mount_label_td); } static void -stacktrace_destroy_ipq_label(struct label *label) +stacktrace_destroy_mount_fs_label(struct label *label) { + trace(&destroy_mount_fs_label_td); +} - trace(&destroy_ipq_label_td); +static void +stacktrace_destroy_port_label(struct label *label) +{ + trace(&destroy_port_label_td); } static void -stacktrace_destroy_mbuf_label(struct label *label) +stacktrace_destroy_posix_sem_label(struct label *label) { - - trace(&destroy_mbuf_label_td); + trace(&destroy_posix_sem_label_td); } static void -stacktrace_destroy_mount_label(struct label *label) +stacktrace_destroy_posix_shm_label(struct label *label) { - - trace(&destroy_mount_label_td); + trace(&destroy_posix_shm_label_td); } static void -stacktrace_destroy_mount_fs_label(struct label *label) +stacktrace_destroy_proc_label(struct label *label) { - - trace(&destroy_mount_fs_label_td); + trace(&destroy_proc_label_td); } static void -stacktrace_destroy_socket_label(struct label *label) +stacktrace_destroy_socket_label(struct label *label) { - trace(&destroy_socket_label_td); } static void -stacktrace_destroy_socket_peer_label(struct label *label) +stacktrace_destroy_socket_peer_label(struct label *label) { - trace(&destroy_socket_peer_label_td); } -#if 0 static void -stacktrace_destroy_pipe_label(struct label *label) +stacktrace_destroy_sysv_sem_label(struct label *label) { - - trace(&destroy_pipe_label_td); + trace(&destroy_sysv_sem_label_td); } -#endif static void -stacktrace_destroy_proc_label(struct label *label) +stacktrace_destroy_sysv_shm_label(struct label *label) { - - trace(&destroy_proc_label_td); + trace(&destroy_sysv_shm_label_td); } static void -stacktrace_destroy_task_label(struct label *label) +stacktrace_destroy_task_label(struct label *label) { - trace(&destroy_task_label_td); } static void -stacktrace_destroy_port_label(struct label *label) +stacktrace_destroy_vnode_label(struct label *label) { - - trace(&destroy_port_label_td); + trace(&destroy_vnode_label_td); } static void -stacktrace_destroy_vnode_label(struct label *label) +stacktrace_cleanup_sysv_sem_label(struct label *label) { - - trace(&destroy_vnode_label_td); + trace(&cleanup_sysv_sem_label_td); } static void -stacktrace_copy_cred_to_task(struct label *src, struct label *dest) +stacktrace_cleanup_sysv_shm_label(struct label *shmlabel) { - - trace(©_cred_to_task_td); + trace(&cleanup_sysv_shm_label_td); } static void -stacktrace_copy_mbuf_label(struct label *src, struct label *dest) +stacktrace_copy_cred_to_task(struct label *cred, struct label *task) { - - trace(©_mbuf_label_td); + trace(©_cred_to_task_td); } static void -stacktrace_update_port_from_cred_label(struct label *src, struct label *dest) +stacktrace_update_port_from_cred_label(struct label *cred, struct label *task) { - trace(&update_port_from_cred_label_td); } -#if 0 static void -stacktrace_copy_pipe_label(struct label *src, struct label *dest) +stacktrace_copy_vnode_label(struct label *src, struct label *dest) { - - trace(©_pipe_label_td); + trace(©_vnode_label_td); } -#endif static void -stacktrace_copy_vnode_label(struct label *src, struct label *dest) +stacktrace_copy_devfs_label(struct label *src, struct label *dest) { - - trace(©_vnode_label_td); + trace(©_devfs_label_td); } static void -stacktrace_copy_devfs_label(struct label *src, struct label *dest) +stacktrace_copy_mbuf_socket_label(struct label *src, struct label *dest) { - - trace(©_devfs_label_td); + trace(©_mbuf_socket_label_td); } static void -stacktrace_copy_port_label(struct label *src, struct label *dest) +stacktrace_copy_port_label(struct label *src, struct label *dest) { >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Jan 20 18:05:15 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 76F0A16A422; Fri, 20 Jan 2006 18:05:15 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21D5F16A41F for ; Fri, 20 Jan 2006 18:05:15 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD74B43D72 for ; Fri, 20 Jan 2006 18:05:10 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KI5Awb089899 for ; Fri, 20 Jan 2006 18:05:10 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KI5AP5089896 for perforce@freebsd.org; Fri, 20 Jan 2006 18:05:10 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 18:05:10 GMT Message-Id: <200601201805.k0KI5AP5089896@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90017 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 18:05:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=90017 Change 90017 by millert@millert_g4tower on 2006/01/20 18:04:23 Scripts to generate the function and policy operation lists From DSEP. Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mk_stub_funcs.awk#1 add .. //depot/projects/trustedbsd/sedarwin7/src/mac_stub/mk_stub_policy_ops.awk#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Fri Jan 20 19:05:27 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA4C016A422; Fri, 20 Jan 2006 19:05:26 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F55316A41F for ; Fri, 20 Jan 2006 19:05:26 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8C2743D4C for ; Fri, 20 Jan 2006 19:05:25 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KJ5P5p094035 for ; Fri, 20 Jan 2006 19:05:25 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KJ5OUh094032 for perforce@freebsd.org; Fri, 20 Jan 2006 19:05:24 GMT (envelope-from peter@freebsd.org) Date: Fri, 20 Jan 2006 19:05:24 GMT Message-Id: <200601201905.k0KJ5OUh094032@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 90020 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 19:05:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=90020 Change 90020 by peter@peter_daintree on 2006/01/20 19:05:00 IFC @90019 Affected files ... .. //depot/projects/hammer/COPYRIGHT#4 integrate .. //depot/projects/hammer/ObsoleteFiles.inc#13 integrate .. //depot/projects/hammer/UPDATING#90 integrate .. //depot/projects/hammer/contrib/bind9/FREEBSD-Upgrade#7 integrate .. //depot/projects/hammer/contrib/libpcap/pcap-bpf.c#8 integrate .. //depot/projects/hammer/etc/portsnap.conf#3 integrate .. //depot/projects/hammer/etc/rc.d/addswap#5 integrate .. //depot/projects/hammer/etc/rc.d/ntpdate#13 integrate .. //depot/projects/hammer/etc/rc.d/root#10 integrate .. //depot/projects/hammer/gnu/usr.bin/cc/cc_int/Makefile#13 integrate .. //depot/projects/hammer/lib/libarchive/Makefile#30 integrate .. //depot/projects/hammer/lib/libarchive/archive.h.in#9 integrate .. //depot/projects/hammer/lib/libarchive/archive_read.c#15 integrate .. //depot/projects/hammer/lib/libarchive/archive_read_open_fd.c#5 integrate .. //depot/projects/hammer/lib/libarchive/archive_read_support_format_tp.c#1 branch .. //depot/projects/hammer/lib/libarchive/libarchive-formats.5#10 integrate .. //depot/projects/hammer/lib/libc/stdlib/malloc.3#7 integrate .. //depot/projects/hammer/lib/libc/stdlib/malloc.c#20 integrate .. //depot/projects/hammer/lib/libfetch/ftp.c#9 integrate .. //depot/projects/hammer/lib/libkvm/kvm.c#8 integrate .. //depot/projects/hammer/lib/libmd/md2.h#2 integrate .. //depot/projects/hammer/lib/libmd/md2c.c#3 integrate .. //depot/projects/hammer/lib/libmd/md4.h#2 integrate .. //depot/projects/hammer/lib/libmd/md4c.c#3 integrate .. //depot/projects/hammer/lib/libmd/md5c.c#3 integrate .. //depot/projects/hammer/lib/libmd/mdX.3#6 integrate .. //depot/projects/hammer/lib/libmd/mdXhl.c#3 integrate .. //depot/projects/hammer/lib/libmd/ripemd.h#2 integrate .. //depot/projects/hammer/lib/libmd/rmd160c.c#2 integrate .. //depot/projects/hammer/lib/libmd/sha.h#2 integrate .. //depot/projects/hammer/lib/libmd/sha0c.c#2 integrate .. //depot/projects/hammer/lib/libmd/sha1c.c#2 integrate .. //depot/projects/hammer/lib/libmd/sha256.h#2 integrate .. //depot/projects/hammer/lib/libmd/sha256c.c#2 integrate .. //depot/projects/hammer/lib/libmemstat/memstat_uma.c#7 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_mutex.c#26 integrate .. //depot/projects/hammer/lib/libutil/login_ok.c#4 integrate .. //depot/projects/hammer/lib/libutil/login_times.c#3 integrate .. //depot/projects/hammer/libexec/rtld-elf/ia64/reloc.c#9 integrate .. //depot/projects/hammer/sbin/atacontrol/atacontrol.c#19 integrate .. //depot/projects/hammer/sbin/ifconfig/af_link.c#3 integrate .. //depot/projects/hammer/sbin/ifconfig/ifieee80211.c#22 integrate .. //depot/projects/hammer/sbin/md5/md5.c#8 integrate .. //depot/projects/hammer/sbin/mount/mount.c#23 integrate .. //depot/projects/hammer/sbin/mount_nullfs/mount_nullfs.8#8 integrate .. //depot/projects/hammer/sbin/rcorder/rcorder.c#4 integrate .. //depot/projects/hammer/sbin/reboot/nextboot.sh#2 integrate .. //depot/projects/hammer/share/man/man3/Makefile#14 integrate .. //depot/projects/hammer/share/man/man3/tree.3#6 integrate .. //depot/projects/hammer/share/man/man4/bge.4#19 integrate .. //depot/projects/hammer/share/man/man4/bktr.4#9 integrate .. //depot/projects/hammer/share/man/man4/if_bridge.4#8 integrate .. //depot/projects/hammer/share/man/man4/man4.i386/acpi_ibm.4#8 integrate .. //depot/projects/hammer/share/man/man4/nge.4#9 integrate .. //depot/projects/hammer/share/man/man4/re.4#16 integrate .. //depot/projects/hammer/share/man/man4/splash.4#4 integrate .. //depot/projects/hammer/share/man/man4/syscons.4#9 integrate .. //depot/projects/hammer/share/man/man4/umass.4#18 integrate .. //depot/projects/hammer/share/man/man7/security.7#15 integrate .. //depot/projects/hammer/share/man/man9/make_dev.9#7 integrate .. //depot/projects/hammer/sys/amd64/amd64/busdma_machdep.c#38 integrate .. //depot/projects/hammer/sys/arm/arm/elf_trampoline.c#5 integrate .. //depot/projects/hammer/sys/boot/ia64/efi/start.S#2 integrate .. //depot/projects/hammer/sys/cam/scsi/scsi_sa.c#17 integrate .. //depot/projects/hammer/sys/cam/scsi/scsi_ses.h#3 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_misc.c#39 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_proto.h#39 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_syscall.h#37 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_syscalls.c#37 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_sysent.c#37 integrate .. //depot/projects/hammer/sys/compat/freebsd32/syscalls.master#41 integrate .. //depot/projects/hammer/sys/conf/Makefile.arm#18 integrate .. //depot/projects/hammer/sys/conf/NOTES#104 integrate .. //depot/projects/hammer/sys/conf/files#135 integrate .. //depot/projects/hammer/sys/conf/kern.post.mk#37 integrate .. //depot/projects/hammer/sys/contrib/pf/net/pf_norm.c#11 integrate .. //depot/projects/hammer/sys/dev/acpi_support/acpi_ibm.c#8 integrate .. //depot/projects/hammer/sys/dev/acpica/Osd/OsdSchedule.c#15 integrate .. //depot/projects/hammer/sys/dev/amr/amr.c#29 integrate .. //depot/projects/hammer/sys/dev/amr/amrreg.h#7 integrate .. //depot/projects/hammer/sys/dev/an/if_an.c#29 integrate .. //depot/projects/hammer/sys/dev/asr/asr.c#18 integrate .. //depot/projects/hammer/sys/dev/ata/ata-all.c#57 integrate .. //depot/projects/hammer/sys/dev/ata/ata-all.h#37 integrate .. //depot/projects/hammer/sys/dev/ata/ata-chipset.c#67 integrate .. //depot/projects/hammer/sys/dev/ata/ata-disk.c#38 integrate .. //depot/projects/hammer/sys/dev/ata/ata-lowlevel.c#35 integrate .. //depot/projects/hammer/sys/dev/ata/ata-pci.c#36 integrate .. //depot/projects/hammer/sys/dev/ata/ata-pci.h#39 integrate .. //depot/projects/hammer/sys/dev/ata/ata-queue.c#29 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.c#34 integrate .. //depot/projects/hammer/sys/dev/ata/ata-raid.h#20 integrate .. //depot/projects/hammer/sys/dev/bge/if_bge.c#62 integrate .. //depot/projects/hammer/sys/dev/bge/if_bgereg.h#31 integrate .. //depot/projects/hammer/sys/dev/ed/if_ed_isa.c#14 integrate .. //depot/projects/hammer/sys/dev/em/if_em.c#57 integrate .. //depot/projects/hammer/sys/dev/hme/if_hme.c#26 integrate .. //depot/projects/hammer/sys/dev/hwpmc/hwpmc_mod.c#11 integrate .. //depot/projects/hammer/sys/dev/ieee488/pcii.c#5 integrate .. //depot/projects/hammer/sys/dev/sound/isa/ess.c#12 integrate .. //depot/projects/hammer/sys/dev/sound/pci/ds1.c#14 integrate .. //depot/projects/hammer/sys/dev/sound/pci/ich.c#26 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/dsp.c#25 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/vchan.c#11 integrate .. //depot/projects/hammer/sys/dev/syscons/syscons.c#36 integrate .. //depot/projects/hammer/sys/dev/usb/ehci.c#23 integrate .. //depot/projects/hammer/sys/dev/usb/ehci_pci.c#18 integrate .. //depot/projects/hammer/sys/dev/usb/ehcivar.h#9 integrate .. //depot/projects/hammer/sys/dev/usb/ohci.c#23 integrate .. //depot/projects/hammer/sys/dev/usb/ohci_pci.c#13 integrate .. //depot/projects/hammer/sys/dev/usb/uhci.c#20 integrate .. //depot/projects/hammer/sys/fs/hpfs/hpfs_vnops.c#21 integrate .. //depot/projects/hammer/sys/fs/msdosfs/msdosfs_denode.c#24 integrate .. //depot/projects/hammer/sys/fs/ntfs/ntfs_vnops.c#19 integrate .. //depot/projects/hammer/sys/fs/nwfs/nwfs_node.c#14 integrate .. //depot/projects/hammer/sys/fs/smbfs/smbfs_node.c#19 integrate .. //depot/projects/hammer/sys/fs/udf/udf_vnops.c#31 integrate .. //depot/projects/hammer/sys/geom/eli/g_eli.c#6 integrate .. //depot/projects/hammer/sys/geom/eli/g_eli_ctl.c#3 integrate .. //depot/projects/hammer/sys/geom/label/g_label_ntfs.c#4 integrate .. //depot/projects/hammer/sys/geom/mirror/g_mirror.c#27 integrate .. //depot/projects/hammer/sys/geom/nop/g_nop.c#9 integrate .. //depot/projects/hammer/sys/geom/raid3/g_raid3.c#20 integrate .. //depot/projects/hammer/sys/geom/uzip/g_uzip.c#8 integrate .. //depot/projects/hammer/sys/geom/zero/g_zero.c#3 integrate .. //depot/projects/hammer/sys/i386/i386/busdma_machdep.c#28 integrate .. //depot/projects/hammer/sys/i386/i386/swtch.s#15 integrate .. //depot/projects/hammer/sys/ia64/ia64/elf_machdep.c#20 integrate .. //depot/projects/hammer/sys/ia64/ia64/genassym.c#10 integrate .. //depot/projects/hammer/sys/ia64/ia64/locore.S#7 integrate .. //depot/projects/hammer/sys/ia64/include/elf.h#4 integrate .. //depot/projects/hammer/sys/isofs/cd9660/cd9660_node.c#12 integrate .. //depot/projects/hammer/sys/kern/kern_mutex.c#36 integrate .. //depot/projects/hammer/sys/kern/kern_proc.c#52 integrate .. //depot/projects/hammer/sys/kern/kern_sx.c#9 integrate .. //depot/projects/hammer/sys/kern/md5c.c#7 integrate .. //depot/projects/hammer/sys/kern/subr_bus.c#46 integrate .. //depot/projects/hammer/sys/kern/subr_disk.c#16 integrate .. //depot/projects/hammer/sys/kern/subr_lock.c#1 branch .. //depot/projects/hammer/sys/kern/subr_taskqueue.c#16 integrate .. //depot/projects/hammer/sys/kern/subr_turnstile.c#18 integrate .. //depot/projects/hammer/sys/kern/subr_witness.c#53 integrate .. //depot/projects/hammer/sys/kern/vfs_aio.c#39 integrate .. //depot/projects/hammer/sys/kern/vfs_bio.c#64 integrate .. //depot/projects/hammer/sys/kern/vfs_mount.c#66 integrate .. //depot/projects/hammer/sys/libkern/gets.c#2 integrate .. //depot/projects/hammer/sys/modules/xfs/Makefile#2 integrate .. //depot/projects/hammer/sys/net/if_arcsubr.c#19 integrate .. //depot/projects/hammer/sys/net/if_bridge.c#21 integrate .. //depot/projects/hammer/sys/net/if_bridgevar.h#7 integrate .. //depot/projects/hammer/sys/net/if_ef.c#16 integrate .. //depot/projects/hammer/sys/net/if_ethersubr.c#54 integrate .. //depot/projects/hammer/sys/net/if_fddisubr.c#20 integrate .. //depot/projects/hammer/sys/net/if_fwsubr.c#15 integrate .. //depot/projects/hammer/sys/net/if_iso88025subr.c#18 integrate .. //depot/projects/hammer/sys/net/if_ppp.c#26 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_ioctl.c#27 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_ioctl.h#14 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_node.c#31 integrate .. //depot/projects/hammer/sys/netgraph/netflow/ng_netflow.c#8 integrate .. //depot/projects/hammer/sys/netgraph/ng_frame_relay.c#6 integrate .. //depot/projects/hammer/sys/netgraph/ng_lmi.c#9 integrate .. //depot/projects/hammer/sys/netgraph/ng_parse.c#11 integrate .. //depot/projects/hammer/sys/netinet/in_var.h#11 integrate .. //depot/projects/hammer/sys/netinet/ip_fastfwd.c#26 integrate .. //depot/projects/hammer/sys/netinet/ip_fw2.c#72 integrate .. //depot/projects/hammer/sys/netinet/ip_input.c#57 integrate .. //depot/projects/hammer/sys/netinet/ip_output.c#56 integrate .. //depot/projects/hammer/sys/netinet/tcp_input.c#58 integrate .. //depot/projects/hammer/sys/netinet/tcp_syncache.c#32 integrate .. //depot/projects/hammer/sys/netinet/udp_usrreq.c#38 integrate .. //depot/projects/hammer/sys/netinet6/ip6_output.c#38 integrate .. //depot/projects/hammer/sys/netinet6/ipcomp_input.c#4 integrate .. //depot/projects/hammer/sys/netipx/ipx_input.c#8 integrate .. //depot/projects/hammer/sys/netipx/spx_usrreq.c#16 integrate .. //depot/projects/hammer/sys/netncp/ncp_conn.c#8 integrate .. //depot/projects/hammer/sys/netsmb/smb_subr.c#10 integrate .. //depot/projects/hammer/sys/nfs4client/nfs4_vfsops.c#17 integrate .. //depot/projects/hammer/sys/nfsclient/nfs_lock.c#14 integrate .. //depot/projects/hammer/sys/nfsclient/nfs_node.c#22 integrate .. //depot/projects/hammer/sys/nfsclient/nfs_socket.c#34 integrate .. //depot/projects/hammer/sys/pccard/driver.h#2 delete .. //depot/projects/hammer/sys/pccard/i82365.h#5 delete .. //depot/projects/hammer/sys/pccard/meciareg.h#2 delete .. //depot/projects/hammer/sys/pccard/pccard_nbk.h#3 delete .. //depot/projects/hammer/sys/pccard/pcic_pci.h#4 delete .. //depot/projects/hammer/sys/pccard/pcicvar.h#3 delete .. //depot/projects/hammer/sys/pccard/slot.h#5 delete .. //depot/projects/hammer/sys/pci/agp.c#18 integrate .. //depot/projects/hammer/sys/pci/if_sk.c#46 integrate .. //depot/projects/hammer/sys/pci/if_skreg.h#14 integrate .. //depot/projects/hammer/sys/pci/if_xl.c#62 integrate .. //depot/projects/hammer/sys/rpc/rpcclnt.c#13 integrate .. //depot/projects/hammer/sys/security/mac_bsdextended/mac_bsdextended.c#17 integrate .. //depot/projects/hammer/sys/sparc64/include/trap.h#4 integrate .. //depot/projects/hammer/sys/sparc64/include/utrap.h#4 integrate .. //depot/projects/hammer/sys/sparc64/sparc64/exception.S#16 integrate .. //depot/projects/hammer/sys/sys/lock.h#12 integrate .. //depot/projects/hammer/sys/sys/mbuf.h#49 integrate .. //depot/projects/hammer/sys/sys/md5.h#4 integrate .. //depot/projects/hammer/sys/sys/mutex.h#22 integrate .. //depot/projects/hammer/sys/sys/proc.h#93 integrate .. //depot/projects/hammer/sys/sys/taskqueue.h#10 integrate .. //depot/projects/hammer/sys/sys/tree.h#7 integrate .. //depot/projects/hammer/sys/sys/turnstile.h#6 integrate .. //depot/projects/hammer/sys/sys/user.h#20 integrate .. //depot/projects/hammer/sys/sys/vnode.h#63 integrate .. //depot/projects/hammer/tools/tools/mfc/mfc.pl#2 integrate .. //depot/projects/hammer/tools/tools/nanobsd/nanobsd.sh#8 integrate Differences ... ==== //depot/projects/hammer/COPYRIGHT#4 (text+ko) ==== @@ -1,10 +1,10 @@ -# $FreeBSD: src/COPYRIGHT,v 1.6 2005/01/01 07:29:19 sobomax Exp $ +# $FreeBSD: src/COPYRIGHT,v 1.7 2006/01/15 22:06:10 imp Exp $ # @(#)COPYRIGHT 8.2 (Berkeley) 3/21/94 The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (C) 1992-2005 The FreeBSD Project. All rights reserved. +Copyright (C) 1992-2006 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ==== //depot/projects/hammer/ObsoleteFiles.inc#13 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/ObsoleteFiles.inc,v 1.25 2006/01/04 15:54:02 netchild Exp $ +# $FreeBSD: src/ObsoleteFiles.inc,v 1.26 2006/01/18 18:48:42 netchild Exp $ # # This file lists old files (OLD_FILES), libraries (OLD_LIBS) and # directories (OLD_DIRS) which should get removed at an update. Recently @@ -2589,8 +2589,6 @@ OLD_FILES+=usr/share/games/cribbage.instr OLD_FILES+=usr/share/games/fish.instr OLD_FILES+=usr/share/games/wump.info -OLD_FILES+=usr/share/tmac/mm/locale -OLD_FILES+=usr/share/tmac/mm/se_locale OLD_FILES+=usr/games/hide/adventure OLD_FILES+=usr/games/hide/arithmetic OLD_FILES+=usr/games/hide/atc ==== //depot/projects/hammer/UPDATING#90 (text+ko) ==== @@ -21,6 +21,21 @@ developers choose to disable these features on build machines to maximize performance. +20060118: + This actually occured some time ago, but installing the kernel + now also installs a bunch of symbol files for the kernel modules. + This increases the size of /boot/kernel to about 67Mbytes. You + will need twice this if you will eventually back this up to kernel.old + on your next install. + If you have a shortage of room in your root partition, you should add + -DINSTALL_NODEBUG to your make arguments or add INSTALL_NODEBUG="yes" + to your /etc/make.conf. + +20060113: + libc's malloc implementation has been replaced. This change has the + potential to uncover application bugs that previously went unnoticed. + See the malloc(3) manual page for more details. + 20060112: The generic netgraph(4) cookie has been changed. If you upgrade kernel passing this point, you also need to upgrade userland @@ -478,4 +493,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.433 2006/01/13 17:32:22 glebius Exp $ +$FreeBSD: src/UPDATING,v 1.436 2006/01/18 20:36:58 pav Exp $ ==== //depot/projects/hammer/contrib/bind9/FREEBSD-Upgrade#7 (text+ko) ==== @@ -31,6 +31,8 @@ As of 28 December 2005, we have no local patches against BIND 9; thus there are no conflicts to merge. This may change at a later date. +5a) Remove any files that are no longer in the tarball from the vendor branch. + 6) Remove any references to the {bin,lib}/tests and docutil directories from the configure and Makefile templates: @@ -114,4 +116,4 @@ -- des@FreeBSD.org -- dougb@FreeBSD.org -$FreeBSD: src/contrib/bind9/FREEBSD-Upgrade,v 1.6 2005/12/29 04:41:09 dougb Exp $ +$FreeBSD: src/contrib/bind9/FREEBSD-Upgrade,v 1.7 2006/01/14 02:45:49 dougb Exp $ ==== //depot/projects/hammer/contrib/libpcap/pcap-bpf.c#8 (text+ko) ==== @@ -746,7 +746,7 @@ u_int i; int is_ethernet; - bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * bdl.bfl_len + 1); + bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * (bdl.bfl_len + 1)); if (bdl.bfl_list == NULL) { (void)snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno)); ==== //depot/projects/hammer/etc/portsnap.conf#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/portsnap.conf,v 1.2 2005/09/06 19:28:37 cperciva Exp $ +# $FreeBSD: src/etc/portsnap.conf,v 1.3 2006/01/18 03:40:57 cperciva Exp $ # Default directory where compressed snapshots are stored. # WORKDIR=/var/db/portsnap @@ -20,5 +20,11 @@ # Example of ignoring parts of the ports tree. If you know that you # absolutely will not need certain parts of the tree, this will save # some bandwidth and disk space. See the manual page for more details. +# +# WARNING: Working with an incomplete ports tree is not supported and +# can cause problems due to missing dependencies. If you have REFUSE +# directives and experience problems, remove them and update your tree +# before asking for help on the mailing lists. +# # REFUSE arabic chinese french german hebrew hungarian japanese # REFUSE korean polish portuguese russian ukrainian vietnamese ==== //depot/projects/hammer/etc/rc.d/addswap#5 (text+ko) ==== @@ -2,7 +2,7 @@ # # Add additional swap files # -# $FreeBSD: src/etc/rc.d/addswap,v 1.4 2004/10/07 13:55:25 mtm Exp $ +# $FreeBSD: src/etc/rc.d/addswap,v 1.6 2006/01/17 19:29:31 philip Exp $ # # PROVIDE: addswap @@ -22,7 +22,7 @@ [Nn][Oo] | '') ;; *) - if [ -w "${swapfile}" -a -c /dev/mdctl ]; then + if [ -w "${swapfile}" ]; then echo "Adding ${swapfile} as additional swap" mdev=`mdconfig -a -t vnode -f ${swapfile}` && swapon /dev/${mdev} fi ==== //depot/projects/hammer/etc/rc.d/ntpdate#13 (text+ko) ==== @@ -1,10 +1,10 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/ntpdate,v 1.14 2005/12/21 09:48:41 dougb Exp $ +# $FreeBSD: src/etc/rc.d/ntpdate,v 1.15 2006/01/16 06:03:42 dougb Exp $ # # PROVIDE: ntpdate -# REQUIRE: NETWORKING syslogd +# REQUIRE: NETWORKING syslogd named # KEYWORD: nojail . /etc/rc.subr ==== //depot/projects/hammer/etc/rc.d/root#10 (text+ko) ==== @@ -1,7 +1,7 @@ #!/bin/sh # # $NetBSD: root,v 1.2 2000/05/13 08:45:09 lukem Exp $ -# $FreeBSD: src/etc/rc.d/root,v 1.11 2005/12/02 21:33:43 ru Exp $ +# $FreeBSD: src/etc/rc.d/root,v 1.13 2006/01/18 04:53:48 wes Exp $ # # PROVIDE: root @@ -34,9 +34,7 @@ # If we booted a special kernel remove the record # so we will boot the default kernel next time. - if [ -e /boot/nextkernel ]; then - rm -f /boot/nextkernel - fi + /sbin/nextboot -D } load_rc_config $name ==== //depot/projects/hammer/gnu/usr.bin/cc/cc_int/Makefile#13 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/gnu/usr.bin/cc/cc_int/Makefile,v 1.45 2004/10/24 15:32:27 ru Exp $ +# $FreeBSD: src/gnu/usr.bin/cc/cc_int/Makefile,v 1.46 2006/01/14 20:48:50 ru Exp $ .include "../Makefile.inc" @@ -67,7 +67,8 @@ SRCS+= insn-$F.c CLEANFILES+= insn-$F.c insn-$F.c: ${.OBJDIR}/../cc_tools/gen$F ${MD_FILE} - ${.OBJDIR}/../cc_tools/gen$F ${MD_FILE} > insn-$F.c + ${.OBJDIR}/../cc_tools/gen$F ${MD_FILE} > insn-$F.c \ + ${.MAKEFLAGS:M-s:S;-s;2>/dev/null;} .endfor .for F in modes SRCS+= insn-$F.c ==== //depot/projects/hammer/lib/libarchive/Makefile#30 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/lib/libarchive/Makefile,v 1.42 2005/11/10 18:07:05 ru Exp $ +# $FreeBSD: src/lib/libarchive/Makefile,v 1.44 2006/01/18 06:26:42 kientzle Exp $ # This Makefile is for use with the FreeBSD buid system. For # non-FreeBSD systems, you should first "make distfile" on FreeBSD, @@ -25,7 +25,7 @@ # Note: Do NOT reset this to zero after bumping ARCHIVE_API_MAJOR! ARCHIVE_API_MINOR= 2 # Bumped often. ;-) -ARCHIVE_API_REVISION= 36 +ARCHIVE_API_REVISION= 37 # Full libarchive version combines the above three numbers. VERSION= ${ARCHIVE_API_MAJOR}.${ARCHIVE_API_MINOR}.${ARCHIVE_API_REVISION} ==== //depot/projects/hammer/lib/libarchive/archive.h.in#9 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.26 2005/11/08 07:41:03 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive.h.in,v 1.27 2006/01/17 03:40:42 kientzle Exp $ */ #ifndef ARCHIVE_H_INCLUDED @@ -180,6 +180,7 @@ int archive_read_support_format_gnutar(struct archive *); int archive_read_support_format_iso9660(struct archive *); int archive_read_support_format_tar(struct archive *); +int archive_read_support_format_tp(struct archive *); int archive_read_support_format_zip(struct archive *); ==== //depot/projects/hammer/lib/libarchive/archive_read.c#15 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.19 2005/09/24 21:15:00 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read.c,v 1.20 2006/01/17 04:49:04 kientzle Exp $"); #include #include @@ -107,8 +107,8 @@ */ int archive_read_open(struct archive *a, void *client_data, - archive_open_callback *opener, archive_read_callback *reader, - archive_close_callback *closer) + archive_open_callback *client_opener, archive_read_callback *client_reader, + archive_close_callback *client_closer) { const void *buffer; ssize_t bytes_read; @@ -117,36 +117,59 @@ __archive_check_magic(a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_open"); - if (reader == NULL) + if (client_reader == NULL) __archive_errx(1, "No reader function provided to archive_read_open"); - a->client_reader = reader; - a->client_opener = opener; - a->client_closer = closer; - a->client_data = client_data; + /* + * Set these NULL initially. If the open or initial read fails, + * we'll leave them NULL to indicate that the file is invalid. + * (In particular, this helps ensure that the closer doesn't + * get called more than once.) + */ + a->client_opener = NULL; + a->client_reader = NULL; + a->client_closer = NULL; + a->client_data = NULL; /* Open data source. */ - if (a->client_opener != NULL) { - e =(a->client_opener)(a, a->client_data); - if (e != 0) + if (client_opener != NULL) { + e =(client_opener)(a, client_data); + if (e != 0) { + /* If the open failed, call the closer to clean up. */ + if (client_closer) + (client_closer)(a, client_data); return (e); + } } /* Read first block now for format detection. */ - bytes_read = (a->client_reader)(a, a->client_data, &buffer); + bytes_read = (client_reader)(a, client_data, &buffer); - /* client_reader should have already set error information. */ - if (bytes_read < 0) + if (bytes_read < 0) { + /* If the first read fails, close before returning error. */ + if (client_closer) + (client_closer)(a, client_data); + /* client_reader should have already set error information. */ return (ARCHIVE_FATAL); + } /* An empty archive is a serious error. */ if (bytes_read == 0) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, "Empty input file"); + /* Close the empty file. */ + if (client_closer) + (client_closer)(a, client_data); return (ARCHIVE_FATAL); } + /* Now that the client callbacks have worked, remember them. */ + a->client_opener = client_opener; /* Do we need to remember this? */ + a->client_reader = client_reader; + a->client_closer = client_closer; + a->client_data = client_data; + /* Select a decompression routine. */ high_bidder = choose_decompressor(a, buffer, bytes_read); if (high_bidder < 0) ==== //depot/projects/hammer/lib/libarchive/archive_read_open_fd.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.4 2005/09/21 04:25:05 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_fd.c,v 1.5 2006/01/17 04:49:04 kientzle Exp $"); #include #include @@ -99,7 +99,8 @@ struct read_fd_data *mine = client_data; (void)a; /* UNUSED */ - free(mine->buffer); + if (mine->buffer != NULL) + free(mine->buffer); free(mine); return (ARCHIVE_OK); } ==== //depot/projects/hammer/lib/libarchive/libarchive-formats.5#10 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libarchive/libarchive-formats.5,v 1.9 2005/11/17 12:59:59 ru Exp $ +.\" $FreeBSD: src/lib/libarchive/libarchive-formats.5,v 1.10 2006/01/17 03:40:42 kientzle Exp $ .\" .Dd April 27, 2004 .Dt libarchive-formats 3 @@ -235,6 +235,16 @@ .Dq deflate algorithm. Older zip compression algorithms are not supported. +.Ss Tp Formats +The libarchive library has experimental support for tp format, +which was used in Fourth Edition through Sixth Edition Unix. +(It was supplanted by tar in Seventh Edition Unix.) +There were several distinct variants of this format; libarchive +supports the original tp format and the itp variant. +Currently, tp format support is not enabled by +.Fn archive_read_support_format_all , +it must be explicitly enabled by calling +.Fn archive_read_support_format_tp . .Sh SEE ALSO .Xr cpio 1 , .Xr mkisofs 1 , ==== //depot/projects/hammer/lib/libc/stdlib/malloc.3#7 (text+ko) ==== @@ -13,11 +13,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" @@ -34,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)malloc.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.64 2005/11/23 20:34:37 ru Exp $ +.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.65 2006/01/13 18:38:56 jasone Exp $ .\" -.Dd August 19, 2004 +.Dd January 12, 2006 .Dt MALLOC 3 .Os .Sh NAME @@ -67,25 +63,9 @@ .Fn malloc function allocates .Fa size -bytes of memory. +bytes of uninitialized memory. The allocated space is suitably aligned (after possible pointer coercion) for storage of any type of object. -If the space is at least -.Va pagesize -bytes in length (see -.Xr getpagesize 3 ) , -the returned memory will be page boundary aligned as well. -If -.Fn malloc -fails, a -.Dv NULL -pointer is returned. -.Pp -Note that -.Fn malloc -does -.Em NOT -normally initialize the returned memory to zero bytes. .Pp The .Fn calloc @@ -113,20 +93,14 @@ old sizes. If the new size is larger, the value of the newly allocated portion of the memory is undefined. -If the requested memory cannot be allocated, -.Dv NULL -is returned and -the memory referenced by +Upon success, the memory referenced by .Fa ptr -is valid and unchanged. -If memory can be allocated, the memory referenced by -.Fa ptr is freed and a pointer to the newly allocated memory is returned. Note that .Fn realloc and .Fn reallocf -may move the memory allocation resulting in a different return value than +may move the memory allocation, resulting in a different return value than .Fa ptr . If .Fa ptr @@ -182,34 +156,46 @@ The process will call .Xr abort 3 in these cases. +.It C +Increase/decrease the size of the cache by a factor of two. +The default cache size is 256 objects for each arena. +This option can be specified multiple times. .It J Each byte of new memory allocated by .Fn malloc , .Fn realloc or .Fn reallocf -as well as all memory returned by +will be initialized to 0xa5. +All memory returned by .Fn free , .Fn realloc or .Fn reallocf -will be initialized to 0xd0. -This options also sets the -.Dq R -option. +will be initialized to 0x5a. This is intended for debugging and will impact performance negatively. -.It H -Pass a hint to the kernel about pages unused by the allocation functions. -This will help performance if the system is paging excessively. -This option is off by default. -.It R -Causes the -.Fn realloc -and -.Fn reallocf -functions to always reallocate memory even if the initial allocation was -sufficiently large. -This can substantially aid in compacting memory. +.It K +Increase/decrease the virtual memory chunk size by a factor of two. +The default chunk size is 16 MB. +This option can be specified multiple times. +.It N +Increase/decrease the number of arenas by a factor of two. +The default number of arenas is twice the number of CPUs, or one if there is a +single CPU. +This option can be specified multiple times. +.It P +Various statistics are printed at program exit via an +.Xr atexit 3 +function. +This has the potential to cause deadlock for a multi-threaded process that exits +while one or more threads are executing in the memory allocation functions. +Therefore, this option should only be used with care; it is primarily intended +as a performance tuning aid during application development. +.It Q +Increase/decrease the size of the allocation quantum by a factor of two. +The default quantum is the minimum allowed by the architecture (typically 8 or +16 bytes). +This option can be specified multiple times. .It U Generate .Dq utrace @@ -241,20 +227,18 @@ _malloc_options = "X"; .Ed .It Z -This option implicitly sets the -.Dq J +Each byte of new memory allocated by +.Fn malloc , +.Fn realloc +or +.Fn reallocf +will be initialized to 0x0. +Note that this initialization only happens once for each byte, so +.Fn realloc and -.Dq R -options, and then zeros out the bytes that were requested. +.Fn reallocf +calls do not zero memory that was previously allocated. This is intended for debugging and will impact performance negatively. -.It < -Reduce the size of the cache by a factor of two. -The default cache size is 16 pages. -This option can be specified multiple times. -.It > -Double the size of the cache by a factor of two. -The default cache size is 16 pages. -This option can be specified multiple times. .El .Pp The @@ -301,31 +285,63 @@ The .Fn free function returns no value. -.Sh DEBUGGING MALLOC PROBLEMS -The major difference between this implementation and other allocation -implementations is that the free pages are not accessed unless allocated, -and are aggressively returned to the kernel for reuse. -.Bd -ragged -offset indent -Most allocation implementations will store a data structure containing a -linked list in the free chunks of memory, -used to tie all the free memory together. -That can be suboptimal, -as every time the free-list is traversed, -the otherwise unused, and likely paged out, -pages are faulted into primary memory. -On systems which are paging, -this can result in a factor of five increase in the number of page-faults -done by a process. -.Ed +.Sh IMPLEMENTATION NOTES +This allocator uses multiple arenas in order to reduce lock contention for +threaded programs on multi-processor systems. +This works well with regard to threading scalability, but incurs some costs. +There is a small fixed per-arena overhead, and additionally, arenas manage +memory completely independently of each other, which means a small fixed +increase in overall memory fragmentation. +These overheads aren't generally an issue, given the number of arenas normally +used. +Note that using substantially more arenas than the default is not likely to +improve performance, mainly due to reduced cache performance. +However, it may make sense to reduce the number of arenas if an application +does not make much use of the allocation functions. .Pp -A side effect of this architecture is that many minor transgressions on -the interface which would traditionally not be detected are in fact -detected. -As a result, programs that have been running happily for -years may suddenly start to complain loudly, when linked with this -allocation implementation. +This allocator uses a novel approach to object caching. +For objects below a size threshold (use the +.Dq P +option to discover the threshold), full deallocation and attempted coalescence +with adjacent memory regions are delayed. +This is so that if the application requests an allocation of that size soon +thereafter, the request can be met much more quickly. +Most applications heavily use a small number of object sizes, so this caching +has the potential to have a large positive performance impact. +However, the effectiveness of the cache depends on the cache being large enough +to absorb typical fluctuations in the number of allocated objects. +If an application routinely fluctuates by thousands of objects, then it may +make sense to increase the size of the cache. +Conversely, if an application's memory usage fluctuates very little, it may +make sense to reduce the size of the cache, so that unused regions can be +coalesced sooner. .Pp -The first and most important thing to do is to set the +This allocator is very aggressive about tightly packing objects in memory, even +for objects much larger than the system page size. +For programs that allocate objects larger than half the system page size, this +has the potential to reduce memory footprint in comparison to other allocators. +However, it has some side effects that are important to keep in mind. +First, even multi-page objects can start at non-page-aligned addresses, since +the implementation only guarantees quantum alignment. +Second, this tight packing of objects can cause objects to share L1 cache +lines, which can be a performance issue for multi-threaded applications. +There are two ways to approach these issues. +First, +.Fn posix_memalign +provides the ability to align allocations as needed. +By aligning an allocation to at least the L1 cache line size, and padding the +allocation request by one cache line unit, the programmer can rest assured that +no cache line sharing will occur for the object. +Second, the +.Dq Q +option can be used to force all allocations to be aligned with the L1 cache +lines. +This approach should be used with care though, because although easy to +implement, it means that all allocations must be at least as large as the +quantum, which can cause severe internal fragmentation if the application +allocates many small objects. +.Sh DEBUGGING MALLOC PROBLEMS +The first thing to do is to set the .Dq A option. This option forces a coredump (if possible) at the first sign of trouble, @@ -335,16 +351,15 @@ options and symbols for debugger support. .Pp If the program starts to give unusual results, coredump or generally behave -differently without emitting any of the messages listed in the next +differently without emitting any of the messages mentioned in the next section, it is likely because it depends on the storage being filled with zero bytes. -Try running it with +Try running it with the .Dq Z option set; if that improves the situation, this diagnosis has been confirmed. If the program still misbehaves, -the likely problem is accessing memory outside the allocated area, -more likely after than before the allocated area. +the likely problem is accessing memory outside the allocated area. .Pp Alternatively, if the symptoms are not easy to reproduce, setting the .Dq J @@ -356,20 +371,14 @@ all calls made to these functions. .Pp Unfortunately this implementation does not provide much detail about -the problems it detects, the performance impact for storing such information +the problems it detects; the performance impact for storing such information would be prohibitive. -There are a number of allocation implementations available on the 'Net -which focus on detecting and pinpointing problems by trading performance -for extra sanity checks and detailed diagnostics. +There are a number of allocation implementations available on the Internet +which focus on detecting and pinpointing problems by trading performance for +extra sanity checks and detailed diagnostics. .Sh DIAGNOSTIC MESSAGES -If -.Fn malloc , -.Fn calloc , -.Fn realloc -or -.Fn free -detect an error or warning condition, -a message will be printed to file descriptor STDERR_FILENO. +If any of the memory allocation/deallocation functions detect an error or +warning condition, a message will be printed to file descriptor STDERR_FILENO. Errors will result in the process dumping core. If the .Dq A @@ -383,65 +392,11 @@ .Dv stderr file descriptor is not suitable for this. Please note that doing anything which tries to allocate memory in -this function will assure death of the process. +this function is likely to result in a crash or deadlock. .Pp -The following is a brief description of possible error messages and -their meanings: -.Pp +All messages are prefixed by: .Bl -diag -.It "(ES): mumble mumble mumble" -The allocation functions were compiled with -.Dq EXTRA_SANITY -defined, and an error was found during the additional error checking. -Consult the source code for further information. -.It "mmap(2) failed, check limits" -This most likely means that the system is dangerously overloaded or that -the process' limits are incorrectly specified. -.It "freelist is destroyed" -The internal free-list has been corrupted. -.It "out of memory" -The -.Dq X -option was specified and an allocation of memory failed. -.El -.Pp -The following is a brief description of possible warning messages and -their meanings: -.Bl -diag -.It "chunk/page is already free" -The process attempted to -.Fn free -memory which had already been freed. -.It "junk pointer, ..." -A pointer specified to one of the allocation functions points outside the -bounds of the memory of which they are aware. -.It "malloc() has never been called" -No memory has been allocated, -yet something is being freed or -realloc'ed. -.It "modified (chunk-/page-) pointer" -The pointer passed to -.Fn free -or -.Fn realloc -has been modified. -.It "pointer to wrong page" -The pointer that -.Fn free , -.Fn realloc , -or -.Fn reallocf -is trying to free does not reference a possible page. -.It "recursive call" -A process has attempted to call an allocation function recursively. -This is not permitted. -In particular, signal handlers should not -attempt to allocate memory. -.It "unknown char in MALLOC_OPTIONS" -An unknown option was specified. -Even with the -.Dq A -option set, this warning is still only a warning. +.It : (malloc) .El .Sh ENVIRONMENT The following environment variables affect the execution of the allocation @@ -454,11 +409,10 @@ allocation functions. .El .Sh EXAMPLES -To set a systemwide reduction of cache size, and to dump core whenever -a problem occurs: +To dump core whenever a problem occurs: .Pp .Bd -literal -offset indent -ln -s 'A<' /etc/malloc.conf +ln -s 'A' /etc/malloc.conf .Ed .Pp To specify in the source that a program does no return value checking @@ -467,12 +421,12 @@ _malloc_options = "X"; .Ed .Sh SEE ALSO -.Xr brk 2 , .Xr mmap 2 , .Xr alloca 3 , +.Xr atexit 3 , .Xr getpagesize 3 , -.Xr memory 3 -.Pa /usr/share/doc/papers/malloc.ascii.gz +.Xr memory 3 , +.Xr posix_memalign 3 .Sh STANDARDS >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Jan 20 19:54:42 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D9C5816A422; Fri, 20 Jan 2006 19:54:41 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F89316A41F for ; Fri, 20 Jan 2006 19:54:41 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FB9B43D48 for ; Fri, 20 Jan 2006 19:54:41 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0KJsf3G096108 for ; Fri, 20 Jan 2006 19:54:41 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0KJsfvl096105 for perforce@freebsd.org; Fri, 20 Jan 2006 19:54:41 GMT (envelope-from millert@freebsd.org) Date: Fri, 20 Jan 2006 19:54:41 GMT Message-Id: <200601201954.k0KJsfvl096105@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 90025 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2006 19:54:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=90025 Change 90025 by millert@millert_g4tower on 2006/01/20 19:54:16 Fix pasto in pam_lctx.8 and install it Affected files ... .. //depot/projects/trustedbsd/sedarwin7/src/darwin/pam_modules/pam_lctx/Makefile#2 edit .. //depot/projects/trustedbsd/sedarwin7/src/darwin/pam_modules/pam_lctx/pam_lctx.8#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/pam_modules/pam_lctx/Makefile#2 (text+ko) ==== @@ -3,6 +3,6 @@ LIB= pam_lctx SRCS= pam_lctx.c lctx.c -NO_MAN= +MAN= pam_lctx.8 .include ==== //depot/projects/trustedbsd/sedarwin7/src/darwin/pam_modules/pam_lctx/pam_lctx.8#2 (text+ko) ==== @@ -36,7 +36,7 @@ .Op Ar service-name .Ar module-type .Ar control-flag -.Pa pam_unix +.Pa pam_lctx .Op Ar options .Sh DESCRIPTION The Login Context session service module for PAM, @@ -60,7 +60,7 @@ .Nm login . .Sh SEE ALSO .Xr pam.conf 5 , -.Xr pam 8 , +.Xr pam 8 .Sh AUTHORS This manual page was written by From owner-p4-projects@FreeBSD.ORG Sat Jan 21 11:46:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EB98B16A422; Sat, 21 Jan 2006 11:46:39 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB34116A41F for ; Sat, 21 Jan 2006 11:46:39 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76C8943D48 for ; Sat, 21 Jan 2006 11:46:39 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LBkdqW068677 for ; Sat, 21 Jan 2006 11:46:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LBkdbb068674 for perforce@freebsd.org; Sat, 21 Jan 2006 11:46:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 11:46:39 GMT Message-Id: <200601211146.k0LBkdbb068674@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90054 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 11:46:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=90054 Change 90054 by rwatson@rwatson_sesame on 2006/01/21 11:46:34 Leave sufficient room for a full struct IP in the token generated in au_to_ip(). Submitted by: phk Found by: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#22 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#22 (text+ko) ==== @@ -401,7 +401,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(struct ip)); if (t == NULL) return (NULL); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 11:48:43 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F18AF16A423; Sat, 21 Jan 2006 11:48:42 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E8E716A41F for ; Sat, 21 Jan 2006 11:48:42 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CF3C43D48 for ; Sat, 21 Jan 2006 11:48:42 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LBmgsY068790 for ; Sat, 21 Jan 2006 11:48:42 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LBmghS068787 for perforce@freebsd.org; Sat, 21 Jan 2006 11:48:42 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 11:48:42 GMT Message-Id: <200601211148.k0LBmghS068787@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90055 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 11:48:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=90055 Change 90055 by rwatson@rwatson_sesame on 2006/01/21 11:48:17 Parenthesize macros with arithmetic. Submitted by: phk Found by: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit.h#12 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit.h#12 (text+ko) ==== @@ -37,7 +37,7 @@ #define AUDIT_RECORD_MAGIC 0x828a0f1b #define MAX_AUDIT_RECORDS 20 #define MAX_AUDIT_RECORD_SIZE 4096 -#define MIN_AUDIT_FILE_SIZE 512 * 1024 +#define MIN_AUDIT_FILE_SIZE (512 * 1024) /* * Triggers for the audit daemon From owner-p4-projects@FreeBSD.ORG Sat Jan 21 11:53:50 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 883E216A422; Sat, 21 Jan 2006 11:53:49 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4732216A41F for ; Sat, 21 Jan 2006 11:53:49 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1316F43D45 for ; Sat, 21 Jan 2006 11:53:49 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LBrmXL068992 for ; Sat, 21 Jan 2006 11:53:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LBrmiZ068989 for perforce@freebsd.org; Sat, 21 Jan 2006 11:53:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 11:53:48 GMT Message-Id: <200601211153.k0LBrmiZ068989@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90056 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 11:53:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=90056 Change 90056 by rwatson@rwatson_sesame on 2006/01/21 11:53:37 Avoid variable aliasing by not allowing configurable delimiters for user entries. Submitted by: phk Found by: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_user.c#11 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_user.c#11 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_user file into au_user_ent structures. */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *user_delim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -49,14 +49,14 @@ * Parse one line from the audit_user file into the au_user_ent structure. */ static struct au_user_ent * -userfromstr(char *str, char *delim, struct au_user_ent *u) +userfromstr(char *str, struct au_user_ent *u) { char *username, *always, *never; char *last; - username = strtok_r(str, delim, &last); - always = strtok_r(NULL, delim, &last); - never = strtok_r(NULL, delim, &last); + username = strtok_r(str, user_delim, &last); + always = strtok_r(NULL, user_delim, &last); + never = strtok_r(NULL, user_delim, &last); if ((username == NULL) || (always == NULL) || (never == NULL)) return (NULL); @@ -128,7 +128,7 @@ *nl = '\0'; /* Get the next structure. */ - if (userfromstr(linestr, delim, u) == NULL) + if (userfromstr(linestr, u) == NULL) return (NULL); return (u); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 12:05:04 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0E6C116A422; Sat, 21 Jan 2006 12:05:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B948016A420 for ; Sat, 21 Jan 2006 12:05:03 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83DCF43D49 for ; Sat, 21 Jan 2006 12:05:03 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LC53wT069525 for ; Sat, 21 Jan 2006 12:05:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LC5378069522 for perforce@freebsd.org; Sat, 21 Jan 2006 12:05:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 12:05:03 GMT Message-Id: <200601211205.k0LC5378069522@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90058 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 12:05:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=90058 Change 90058 by rwatson@rwatson_sesame on 2006/01/21 12:04:59 Missing includes, warnings. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/tools/Makefile#2 edit .. //depot/projects/trustedbsd/openbsm/tools/audump.c#3 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/tools/Makefile#2 (text+ko) ==== @@ -8,5 +8,6 @@ DPADD= /usr/lib/libbsm.a LDADD= -lbsm BINDIR= /usr/sbin +WARNS= 3 .include ==== //depot/projects/trustedbsd/openbsm/tools/audump.c#3 (text+ko) ==== @@ -25,8 +25,11 @@ */ #include +#include +#include #include #include +#include /* * Simple tool to dump various /etc/security databases using the defined APIs. From owner-p4-projects@FreeBSD.ORG Sat Jan 21 12:09:10 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EDEFF16A422; Sat, 21 Jan 2006 12:09:09 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C99716A422 for ; Sat, 21 Jan 2006 12:09:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7E2E43D55 for ; Sat, 21 Jan 2006 12:09:08 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LC98Nt069748 for ; Sat, 21 Jan 2006 12:09:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LC98AQ069745 for perforce@freebsd.org; Sat, 21 Jan 2006 12:09:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 12:09:08 GMT Message-Id: <200601211209.k0LC98AQ069745@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90059 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 12:09:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=90059 Change 90059 by rwatson@rwatson_sesame on 2006/01/21 12:08:41 Parenthesize macro arguments. Don't check unsigned variable for negative values. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#23 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#23 (text+ko) ==== @@ -59,13 +59,13 @@ #define GET_TOKEN_AREA(t, dptr, length) do { \ t = malloc (sizeof(token_t)); \ if (t != NULL) { \ - t->len = length; \ - t->t_data = malloc (length * sizeof(u_char)); \ + t->len = (length); \ + t->t_data = malloc ((length) * sizeof(u_char)); \ if ((dptr = t->t_data) == NULL) { \ free(t); \ t = NULL; \ } else \ - memset(dptr, 0, length); \ + memset(dptr, 0, (length)); \ } \ } while (0) @@ -527,7 +527,7 @@ token_t *t; u_char *dptr = NULL; - if ((data == NULL) || (bytes <= 0)) { + if (data == NULL) { errno = EINVAL; return (NULL); } From owner-p4-projects@FreeBSD.ORG Sat Jan 21 12:11:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD88516A422; Sat, 21 Jan 2006 12:11:12 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52F9816A420 for ; Sat, 21 Jan 2006 12:11:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0285843D4C for ; Sat, 21 Jan 2006 12:11:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LCBBHs069945 for ; Sat, 21 Jan 2006 12:11:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LCBBZc069942 for perforce@freebsd.org; Sat, 21 Jan 2006 12:11:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 12:11:11 GMT Message-Id: <200601211211.k0LCBBZc069942@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90060 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 12:11:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=90060 Change 90060 by rwatson@rwatson_sesame on 2006/01/21 12:10:52 Don't take a pointer to an array. Don't return (void) -- gcc is fine with it, but is C? Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#20 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#20 (text+ko) ==== @@ -551,7 +551,7 @@ break; case AU_IPv6: - READ_TOKEN_BYTES(buf, len, &tok->tt.hdr32_ex.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.hdr32_ex.addr, sizeof(tok->tt.hdr32_ex.addr), tok->len, err); break; } @@ -2533,115 +2533,115 @@ switch(tok->id) { case AUT_HEADER32: - return (print_header32_tok(outfp, tok, del, raw, sfrm)); + print_header32_tok(outfp, tok, del, raw, sfrm); case AUT_HEADER32_EX: - return (print_header32_ex_tok(outfp, tok, del, raw, sfrm)); + print_header32_ex_tok(outfp, tok, del, raw, sfrm); case AUT_HEADER64: - return (print_header64_tok(outfp, tok, del, raw, sfrm)); + print_header64_tok(outfp, tok, del, raw, sfrm); case AUT_HEADER64_EX: - return (print_header64_ex_tok(outfp, tok, del, raw, sfrm)); + print_header64_ex_tok(outfp, tok, del, raw, sfrm); case AUT_TRAILER: - return (print_trailer_tok(outfp, tok, del, raw, sfrm)); + print_trailer_tok(outfp, tok, del, raw, sfrm); case AUT_ARG32: - return (print_arg32_tok(outfp, tok, del, raw, sfrm)); + print_arg32_tok(outfp, tok, del, raw, sfrm); case AUT_ARG64: - return (print_arg64_tok(outfp, tok, del, raw, sfrm)); + print_arg64_tok(outfp, tok, del, raw, sfrm); case AUT_DATA: - return (print_arb_tok(outfp, tok, del, raw, sfrm)); + print_arb_tok(outfp, tok, del, raw, sfrm); case AUT_ATTR32: - return (print_attr32_tok(outfp, tok, del, raw, sfrm)); + print_attr32_tok(outfp, tok, del, raw, sfrm); case AUT_ATTR64: - return (print_attr64_tok(outfp, tok, del, raw, sfrm)); + print_attr64_tok(outfp, tok, del, raw, sfrm); case AUT_EXIT: - return (print_exit_tok(outfp, tok, del, raw, sfrm)); + print_exit_tok(outfp, tok, del, raw, sfrm); case AUT_EXEC_ARGS: - return (print_execarg_tok(outfp, tok, del, raw, sfrm)); + print_execarg_tok(outfp, tok, del, raw, sfrm); case AUT_EXEC_ENV: - return (print_execenv_tok(outfp, tok, del, raw, sfrm)); + print_execenv_tok(outfp, tok, del, raw, sfrm); case AUT_OTHER_FILE32: - return (print_file_tok(outfp, tok, del, raw, sfrm)); + print_file_tok(outfp, tok, del, raw, sfrm); case AUT_NEWGROUPS: - return (print_newgroups_tok(outfp, tok, del, raw, sfrm)); + print_newgroups_tok(outfp, tok, del, raw, sfrm); case AUT_IN_ADDR: - return (print_inaddr_tok(outfp, tok, del, raw, sfrm)); + print_inaddr_tok(outfp, tok, del, raw, sfrm); case AUT_IN_ADDR_EX: - return (print_inaddr_ex_tok(outfp, tok, del, raw, sfrm)); + print_inaddr_ex_tok(outfp, tok, del, raw, sfrm); case AUT_IP: - return (print_ip_tok(outfp, tok, del, raw, sfrm)); + print_ip_tok(outfp, tok, del, raw, sfrm); case AUT_IPC: - return (print_ipc_tok(outfp, tok, del, raw, sfrm)); + print_ipc_tok(outfp, tok, del, raw, sfrm); case AUT_IPC_PERM: - return (print_ipcperm_tok(outfp, tok, del, raw, sfrm)); + print_ipcperm_tok(outfp, tok, del, raw, sfrm); case AUT_IPORT: - return (print_iport_tok(outfp, tok, del, raw, sfrm)); + print_iport_tok(outfp, tok, del, raw, sfrm); case AUT_OPAQUE: - return (print_opaque_tok(outfp, tok, del, raw, sfrm)); + print_opaque_tok(outfp, tok, del, raw, sfrm); case AUT_PATH: - return (print_path_tok(outfp, tok, del, raw, sfrm)); + print_path_tok(outfp, tok, del, raw, sfrm); case AUT_PROCESS32: - return (print_process32_tok(outfp, tok, del, raw, sfrm)); + print_process32_tok(outfp, tok, del, raw, sfrm); case AUT_PROCESS32_EX: - return (print_process32ex_tok(outfp, tok, del, raw, sfrm)); + print_process32ex_tok(outfp, tok, del, raw, sfrm); case AUT_RETURN32: - return (print_return32_tok(outfp, tok, del, raw, sfrm)); + print_return32_tok(outfp, tok, del, raw, sfrm); case AUT_RETURN64: - return (print_return64_tok(outfp, tok, del, raw, sfrm)); + print_return64_tok(outfp, tok, del, raw, sfrm); case AUT_SEQ: - return (print_seq_tok(outfp, tok, del, raw, sfrm)); + print_seq_tok(outfp, tok, del, raw, sfrm); case AUT_SOCKET: - return (print_socket_tok(outfp, tok, del, raw, sfrm)); + print_socket_tok(outfp, tok, del, raw, sfrm); case AUT_SOCKINET32: - return (print_sock_inet32_tok(outfp, tok, del, raw, sfrm)); + print_sock_inet32_tok(outfp, tok, del, raw, sfrm); case AUT_SOCKUNIX: - return (print_sock_unix_tok(outfp, tok, del, raw, sfrm)); + print_sock_unix_tok(outfp, tok, del, raw, sfrm); case AUT_SUBJECT32: - return (print_subject32_tok(outfp, tok, del, raw, sfrm)); + print_subject32_tok(outfp, tok, del, raw, sfrm); case AUT_SUBJECT64: - return (print_subject64_tok(outfp, tok, del, raw, sfrm)); + print_subject64_tok(outfp, tok, del, raw, sfrm); case AUT_SUBJECT32_EX: - return (print_subject32ex_tok(outfp, tok, del, raw, sfrm)); + print_subject32ex_tok(outfp, tok, del, raw, sfrm); case AUT_TEXT: - return (print_text_tok(outfp, tok, del, raw, sfrm)); + print_text_tok(outfp, tok, del, raw, sfrm); case AUT_SOCKET_EX: - return (print_socketex32_tok(outfp, tok, del, raw, sfrm)); + print_socketex32_tok(outfp, tok, del, raw, sfrm); default: - return (print_invalid_tok(outfp, tok, del, raw, sfrm)); + print_invalid_tok(outfp, tok, del, raw, sfrm); } } From owner-p4-projects@FreeBSD.ORG Sat Jan 21 12:53:07 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5123C16A41F; Sat, 21 Jan 2006 12:53:07 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BEE716A41F for ; Sat, 21 Jan 2006 12:53:07 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB18D43D46 for ; Sat, 21 Jan 2006 12:53:06 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LCr6aV079573 for ; Sat, 21 Jan 2006 12:53:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LCr6KD079570 for perforce@freebsd.org; Sat, 21 Jan 2006 12:53:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 12:53:06 GMT Message-Id: <200601211253.k0LCr6KD079570@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90067 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 12:53:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=90067 Change 90067 by rwatson@rwatson_sesame on 2006/01/21 12:52:09 Avoid hard-coded assumptions about C type lengths; make sure to include nul terminations in buffer sizing. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#24 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#24 (text+ko) ==== @@ -89,12 +89,13 @@ } textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, 9 + textlen); + textlen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_char) + + sizeof(u_int32_t) + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_ARG32); ADD_U_CHAR(dptr, n); ADD_U_INT32(dptr, v); @@ -118,12 +119,13 @@ } textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, 13 + textlen); + textlen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_char) + + sizeof(u_int64_t) + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_ARG64); ADD_U_CHAR(dptr, n); ADD_U_INT64(dptr, v); @@ -164,7 +166,8 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 29); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2*sizeof(u_int16_t) + + 3*sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -256,7 +259,7 @@ totdata = datasize * unit_count; - GET_TOKEN_AREA(t, dptr, totdata + 4); + GET_TOKEN_AREA(t, dptr, totdata + 4 * sizeof(u_char)); if (t == NULL) return (NULL); @@ -281,7 +284,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 9); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -460,7 +463,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 29); + GET_TOKEN_AREA(t, dptr, 12 * sizeof(u_int16_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -505,7 +508,7 @@ u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t)); if (t == NULL) return (NULL); @@ -532,7 +535,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, bytes + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + bytes); if (t == NULL) return (NULL); @@ -574,11 +577,13 @@ return (NULL); } filelen = strlen(file); - GET_TOKEN_AREA(t, dptr, filelen + 12); + filelen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int32_t) + + sizeof(u_int16_t) + filelen); if (t == NULL) return (NULL); - filelen += 1; timems = tm.tv_usec/1000; ADD_U_CHAR(dptr, AUT_OTHER_FILE32); @@ -607,12 +612,12 @@ return (NULL); } textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, textlen + 4); + textlen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_TEXT); ADD_U_INT16(dptr, textlen); ADD_STRING(dptr, text, textlen); @@ -637,12 +642,12 @@ return (NULL); } textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, textlen + 4); + textlen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_PATH); ADD_U_INT16(dptr, textlen); ADD_STRING(dptr, text, textlen); @@ -675,7 +680,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 37); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -737,7 +742,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 53); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -788,7 +793,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -805,7 +810,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 10); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int64_t)); if (t == NULL) return (NULL); @@ -833,7 +838,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -901,7 +906,7 @@ if (so == NULL) return (NULL); - GET_TOKEN_AREA(t, dptr, 107); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + strlen(so->sun_path) + 1); if (t == NULL) return (NULL); @@ -909,7 +914,7 @@ /* BSM token has two bytes for family */ ADD_U_CHAR(dptr, 0); ADD_U_CHAR(dptr, so->sun_family); - ADD_STRING(dptr, so->sun_path, strlen(so->sun_path)); + ADD_STRING(dptr, so->sun_path, strlen(so->sun_path) + 1); return (t); } @@ -931,7 +936,8 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 9); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -960,7 +966,8 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + + 4 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1014,7 +1021,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 37); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1076,7 +1083,7 @@ return (NULL); } - GET_TOKEN_AREA(t, dptr, 53); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1164,7 +1171,8 @@ nextarg = *(args + count); } - GET_TOKEN_AREA(t, dptr, 5 + totlen); + totlen += count * sizeof(char); /* nul terminations. */ + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); if (t == NULL) return (NULL); @@ -1209,7 +1217,8 @@ nextenv = *(env + count); } - GET_TOKEN_AREA(t, dptr, 5 + totlen); + totlen += sizeof(char) * count; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); if (t == NULL) return (NULL); @@ -1252,7 +1261,8 @@ return (NULL); #endif - GET_TOKEN_AREA(t, dptr, 18); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + + sizeof(u_char) + 2 * sizeof(u_int16_t) + 2 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1297,7 +1307,8 @@ u_char *dptr = NULL; u_int16_t magic = TRAILER_PAD_MAGIC; - GET_TOKEN_AREA(t, dptr, 7); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int32_t)); if (t == NULL) return (NULL); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 12:55:10 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 338BD16A422; Sat, 21 Jan 2006 12:55:10 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB0B416A41F for ; Sat, 21 Jan 2006 12:55:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B66DC43D49 for ; Sat, 21 Jan 2006 12:55:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LCt9r9079690 for ; Sat, 21 Jan 2006 12:55:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LCt9TK079687 for perforce@freebsd.org; Sat, 21 Jan 2006 12:55:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 12:55:09 GMT Message-Id: <200601211255.k0LCt9TK079687@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90068 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 12:55:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=90068 Change 90068 by rwatson@rwatson_sesame on 2006/01/21 12:54:35 Credit phk, FlexeLint. Affected files ... .. //depot/projects/trustedbsd/openbsm/README#9 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/README#9 (text+ko) ==== @@ -61,9 +61,11 @@ Tom Rhodes Wojciech Koszek Chunyang Yuan + Poul-Henning Kamp -In addition, Coverity, Inc.'s Prevent(tm) static analysis tool was used to -identify a number of bugs in the OpenBSM implementation. +In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel +Software's FlexeLint tool were used to identify a number of bugs in the +OpenBSM implementation. Contributions From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:06:24 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6B9E016A422; Sat, 21 Jan 2006 13:06:24 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29A0D16A41F for ; Sat, 21 Jan 2006 13:06:24 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E78F843D46 for ; Sat, 21 Jan 2006 13:06:23 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LD6Num080142 for ; Sat, 21 Jan 2006 13:06:23 GMT (envelope-from gnn@neville-neil.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LD6NoD080139 for perforce@freebsd.org; Sat, 21 Jan 2006 13:06:23 GMT (envelope-from gnn@neville-neil.com) Date: Sat, 21 Jan 2006 13:06:23 GMT Message-Id: <200601211306.k0LD6NoD080139@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gnn@neville-neil.com using -f From: "George V. Neville-Neil" To: Perforce Change Reviews Cc: Subject: PERFORCE change 90069 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:06:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=90069 Change 90069 by gnn@gnn_tahi_fast_ipsec on 2006/01/21 13:06:06 Fix pointer arithmetic so that we actually put the key in the database and not random garbage. First working version with new structures. Affected files ... .. //depot/projects/gnn_fast_ipsec/src/sys/netipsec/key.c#3 edit Differences ... ==== //depot/projects/gnn_fast_ipsec/src/sys/netipsec/key.c#3 (text+ko) ==== @@ -2799,10 +2799,14 @@ bzero(sav->key_enc->key_data, _KEYLEN(sav->key_enc)); } if (sav->key_auth != NULL) { + if (sav->key_auth->key_data != NULL) + free(sav->key_auth->key_data, M_IPSEC_MISC); free(sav->key_auth, M_IPSEC_MISC); sav->key_auth = NULL; } if (sav->key_enc != NULL) { + if (sav->key_enc->key_data != NULL) + free(sav->key_enc->key_data, M_IPSEC_MISC); free(sav->key_enc, M_IPSEC_MISC); sav->key_enc = NULL; } @@ -3070,7 +3074,6 @@ } switch (mhp->msg->sadb_msg_satype) { case SADB_SATYPE_ESP: - /* XXX FIX ME */ if (len == PFKEY_ALIGN8(sizeof(struct sadb_key)) && sav->alg_enc != SADB_EALG_NULL) { error = EINVAL; @@ -3620,18 +3623,14 @@ key_dup_keymsg(const struct sadb_key *src, u_int len, struct malloc_type *type) { - struct seckey *dst = NULL; + struct seckey *dst; dst = (struct seckey *)malloc(sizeof(struct seckey), type, M_NOWAIT); if (dst != NULL) { dst->bits = src->sadb_key_bits; dst->key_data = (char *)malloc(len, type, M_NOWAIT); if (dst->key_data != NULL) { - bcopy(src + sizeof(struct sadb_key), + bcopy((const char *)src + sizeof(struct sadb_key), dst->key_data, len); - ipseclog((LOG_DEBUG, "%s: source bits %p\n", __func__, - src + sizeof(struct sadb_key))); - ipseclog((LOG_DEBUG, "%s: dst bits %p\n", __func__, - dst->key_data)); } else { ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__)); @@ -7265,12 +7264,25 @@ return m; } +/* + * Take one of the kernel's security keys and convert it into a PF_KEY + * structure within an mbuf, suitable for sending up to a waiting + * application in user land. + * + * IN: + * src: A pointer to a kernel security key. + * exttype: Which type of key this is. Refer to the PF_KEY data structures. + * OUT: + * a valid mbuf or NULL indicating an error + * + */ + static struct mbuf * key_setkey(struct seckey *src, u_int16_t exttype) { struct mbuf *m; struct sadb_key *p; - int len = PFKEY_ALIGN8(sizeof(struct sadb_key)); + int len = PFKEY_ALIGN8(sizeof(struct sadb_key) + _KEYLEN(src)); if (src == NULL) return NULL; @@ -7285,11 +7297,25 @@ p->sadb_key_bits = src->bits; ipseclog((LOG_DEBUG, "%s: setting key data %s\n", __func__, src->key_data)); - bcopy(src->key_data, _KEYBUF(p), len); + bcopy(src->key_data, _KEYBUF(p), _KEYLEN(src)); return m; } +/* + * Take one of the kernel's lifetime data structures and convert it + * into a PF_KEY structure within an mbuf, suitable for sending up to + * a waiting application in user land. + * + * IN: + * src: A pointer to a kernel lifetime structure. + * exttype: Which type of lifetime this is. Refer to the PF_KEY + * data structures for more information. + * OUT: + * a valid mbuf or NULL indicating an error + * + */ + static struct mbuf * key_setlifetime(struct seclifetime *src, u_int16_t exttype) { From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:13:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 033F616A422; Sat, 21 Jan 2006 13:13:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B07E16A41F for ; Sat, 21 Jan 2006 13:13:52 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B60643D45 for ; Sat, 21 Jan 2006 13:13:52 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDDqXG080450 for ; Sat, 21 Jan 2006 13:13:52 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDDphj080447 for perforce@freebsd.org; Sat, 21 Jan 2006 13:13:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:13:51 GMT Message-Id: <200601211313.k0LDDphj080447@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90070 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:13:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=90070 Change 90070 by rwatson@rwatson_sesame on 2006/01/21 13:12:53 Be less tolerant of NULL pointer arguments to token generation functions: Solaris will core dump apps that try this, and it adds significant complexity for cases not actually supported by the API. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#25 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#25 (text+ko) ==== @@ -83,11 +83,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } - textlen = strlen(text); textlen += 1; @@ -113,11 +108,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } - textlen = strlen(text); textlen += 1; @@ -161,11 +151,6 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - if (vni == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2*sizeof(u_int16_t) + 3*sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); if (t == NULL) @@ -233,11 +218,6 @@ u_char *dptr = NULL; size_t datasize, totdata; - if (p == NULL) { - errno = EINVAL; - return (NULL); - } - /* Determine the size of the basic unit. */ switch (unit_type) { case AUR_BYTE: @@ -316,11 +296,6 @@ u_char *dptr = NULL; int i; - if (groups == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, n * 4 + 3); if (t == NULL) return (NULL); @@ -343,11 +318,6 @@ token_t *t; u_char *dptr = NULL; - if (internet_addr == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 5); if (t == NULL) return (NULL); @@ -370,11 +340,6 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - if (internet_addr == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 21); if (t == NULL) return (NULL); @@ -399,11 +364,6 @@ token_t *t; u_char *dptr = NULL; - if (ip == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(struct ip)); if (t == NULL) return (NULL); @@ -457,12 +417,6 @@ u_char *dptr = NULL; u_int16_t pad0 = 0; - - if (perm == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 12 * sizeof(u_int16_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -507,7 +461,6 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t)); if (t == NULL) return (NULL); @@ -530,11 +483,6 @@ token_t *t; u_char *dptr = NULL; - if (data == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + bytes); if (t == NULL) return (NULL); @@ -572,10 +520,6 @@ return (NULL); #endif - if (file == NULL) { - errno = EINVAL; - return (NULL); - } filelen = strlen(file); filelen += 1; @@ -607,10 +551,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } textlen = strlen(text); textlen += 1; @@ -637,10 +577,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } textlen = strlen(text); textlen += 1; @@ -675,11 +611,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -737,11 +668,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -903,9 +829,6 @@ token_t *t; u_char *dptr; - if (so == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + strlen(so->sun_path) + 1); if (t == NULL) return (NULL); @@ -931,11 +854,6 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + sizeof(u_int32_t)); if (t == NULL) @@ -961,11 +879,6 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + 4 * sizeof(u_int32_t)); if (t == NULL) @@ -1016,11 +929,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1078,11 +986,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1155,11 +1058,6 @@ int i, count = 0; size_t totlen = 0; - if (args == NULL) { - errno = EINVAL; - return (NULL); - } - nextarg = *args; while (nextarg != NULL) { @@ -1201,11 +1099,6 @@ size_t totlen = 0; const char *nextenv; - if (env == NULL) { - errno = EINVAL; - return (NULL); - } - nextenv = *env; while (nextenv != NULL) { From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:17:58 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6794716A422; Sat, 21 Jan 2006 13:17:58 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E8B116A41F for ; Sat, 21 Jan 2006 13:17:58 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D503043D45 for ; Sat, 21 Jan 2006 13:17:57 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDHvDg080702 for ; Sat, 21 Jan 2006 13:17:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDHvO1080699 for perforce@freebsd.org; Sat, 21 Jan 2006 13:17:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:17:57 GMT Message-Id: <200601211317.k0LDHvO1080699@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90071 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:17:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=90071 Change 90071 by rwatson@rwatson_sesame on 2006/01/21 13:17:29 Reflect OpenBSM changes to token construction APIs in kernel, especially now that we only conditionally pass things to the constructors: don't accept NULL arguments. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#3 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#3 (text+ko) ==== @@ -78,9 +78,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) - return (NULL); - textlen = strlen(text); GET_TOKEN_AREA(t, dptr, 9 + textlen); @@ -103,9 +100,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) - return (NULL); - textlen = strlen(text); GET_TOKEN_AREA(t, dptr, 13 + textlen); @@ -146,8 +140,6 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - if (vni == NULL) - return (NULL); GET_TOKEN_AREA(t, dptr, 29); ADD_U_CHAR(dptr, AUT_ATTR32); @@ -211,9 +203,6 @@ u_char *dptr = NULL; size_t datasize, totdata; - if (p == NULL) - return (NULL); - /* Determine the size of the basic unit. */ switch (unit_type) { case AUR_BYTE: @@ -287,9 +276,6 @@ u_char *dptr = NULL; int i; - if (groups == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, n * 4 + 3); ADD_U_CHAR(dptr, AUT_NEWGROUPS); @@ -310,9 +296,6 @@ token_t *t; u_char *dptr = NULL; - if (internet_addr == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 5); ADD_U_CHAR(dptr, AUT_IN_ADDR); @@ -333,9 +316,6 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - if (internet_addr == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 21); ADD_U_CHAR(dptr, AUT_IN_ADDR_EX); @@ -358,9 +338,6 @@ token_t *t; u_char *dptr = NULL; - if (ip == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 21); ADD_U_CHAR(dptr, AUT_IP); @@ -383,7 +360,6 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); ADD_U_CHAR(dptr, AUT_IPC); @@ -410,10 +386,6 @@ u_char *dptr = NULL; u_int16_t pad0 = 0; - - if (perm == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 29); ADD_U_CHAR(dptr, AUT_IPC_PERM); @@ -456,7 +428,6 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 3); ADD_U_CHAR(dptr, AUT_IPORT); @@ -477,9 +448,6 @@ token_t *t; u_char *dptr = NULL; - if ((data == NULL) || (bytes <= 0)) - return (NULL); - GET_TOKEN_AREA(t, dptr, bytes + 3); ADD_U_CHAR(dptr, AUT_OPAQUE); @@ -516,9 +484,6 @@ #endif /* XXXRW: else ...? */ - if (file == NULL) - return (NULL); - filelen = strlen(file); GET_TOKEN_AREA(t, dptr, filelen + 12); @@ -546,9 +511,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) - return (NULL); - textlen = strlen(text); GET_TOKEN_AREA(t, dptr, textlen + 4); @@ -573,9 +535,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) - return (NULL); - textlen = strlen(text); GET_TOKEN_AREA(t, dptr, textlen + 4); @@ -608,9 +567,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 37); ADD_U_CHAR(dptr, AUT_PROCESS32); @@ -665,9 +621,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 53); ADD_U_CHAR(dptr, AUT_PROCESS32_EX); @@ -792,9 +745,6 @@ u_char *dptr; u_int16_t so_type; - if (soi == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 15); ADD_U_CHAR(dptr, AU_SOCK_TOKEN); @@ -847,9 +797,6 @@ token_t *t; u_char *dptr; - if (so == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 107); ADD_U_CHAR(dptr, AU_SOCK_UNIX_TOKEN); @@ -873,9 +820,6 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 9); ADD_U_CHAR(dptr, AUT_SOCKINET32); @@ -898,9 +842,6 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 21); ADD_U_CHAR(dptr, AUT_SOCKINET128); @@ -948,9 +889,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 37); ADD_U_CHAR(dptr, AUT_SUBJECT32); @@ -1005,9 +943,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 53); ADD_U_CHAR(dptr, AUT_SUBJECT32_EX); @@ -1077,9 +1012,6 @@ int i, count = 0; size_t totlen = 0; - if (args == NULL) - return (NULL); - nextarg = *args; while (nextarg != NULL) { @@ -1118,9 +1050,6 @@ size_t totlen = 0; const char *nextenv; - if (env == NULL) - return (NULL); - nextenv = *env; while (nextenv != NULL) { From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:25:08 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB5AF16A422; Sat, 21 Jan 2006 13:25:07 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B3CC16A41F for ; Sat, 21 Jan 2006 13:25:07 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53AB343D4C for ; Sat, 21 Jan 2006 13:25:07 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDP7jQ081076 for ; Sat, 21 Jan 2006 13:25:07 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDP7JA081073 for perforce@freebsd.org; Sat, 21 Jan 2006 13:25:07 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:25:07 GMT Message-Id: <200601211325.k0LDP7JA081073@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90073 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:25:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=90073 Change 90073 by rwatson@rwatson_sesame on 2006/01/21 13:24:29 More compact and readable representations of size addition. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#26 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#26 (text+ko) ==== @@ -86,8 +86,8 @@ textlen = strlen(text); textlen += 1; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_char) + - sizeof(u_int32_t) + sizeof(u_int16_t) + textlen); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t) + + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); @@ -111,8 +111,8 @@ textlen = strlen(text); textlen += 1; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_char) + - sizeof(u_int64_t) + sizeof(u_int16_t) + textlen); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int64_t) + + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:49:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 66D9C16A422; Sat, 21 Jan 2006 13:49:38 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0682316A41F for ; Sat, 21 Jan 2006 13:49:38 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEAEA43D45 for ; Sat, 21 Jan 2006 13:49:37 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDnbr7082123 for ; Sat, 21 Jan 2006 13:49:37 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDnbL0082114 for perforce@freebsd.org; Sat, 21 Jan 2006 13:49:37 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:49:37 GMT Message-Id: <200601211349.k0LDnbL0082114@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90075 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:49:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=90075 Change 90075 by rwatson@rwatson_sesame on 2006/01/21 13:48:38 When I removed the marginally incorrect return() calls, I introduced a much larger bug in that everything fell through the switch. The perils of not fully thinking through things... Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#21 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#21 (text+ko) ==== @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -2534,111 +2533,146 @@ switch(tok->id) { case AUT_HEADER32: print_header32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_HEADER32_EX: print_header32_ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_HEADER64: print_header64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_HEADER64_EX: print_header64_ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_TRAILER: print_trailer_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ARG32: print_arg32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ARG64: print_arg64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_DATA: print_arb_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ATTR32: print_attr32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ATTR64: print_attr64_tok(outfp, tok, del, raw, sfrm); case AUT_EXIT: print_exit_tok(outfp, tok, del, raw, sfrm); + return; case AUT_EXEC_ARGS: print_execarg_tok(outfp, tok, del, raw, sfrm); + return; case AUT_EXEC_ENV: print_execenv_tok(outfp, tok, del, raw, sfrm); + return; case AUT_OTHER_FILE32: print_file_tok(outfp, tok, del, raw, sfrm); + return; case AUT_NEWGROUPS: print_newgroups_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IN_ADDR: print_inaddr_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IN_ADDR_EX: print_inaddr_ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IP: print_ip_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IPC: print_ipc_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IPC_PERM: print_ipcperm_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IPORT: print_iport_tok(outfp, tok, del, raw, sfrm); + return; case AUT_OPAQUE: print_opaque_tok(outfp, tok, del, raw, sfrm); + return; case AUT_PATH: print_path_tok(outfp, tok, del, raw, sfrm); + return; case AUT_PROCESS32: print_process32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_PROCESS32_EX: print_process32ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_RETURN32: print_return32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_RETURN64: print_return64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SEQ: print_seq_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKET: print_socket_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKINET32: print_sock_inet32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKUNIX: print_sock_unix_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SUBJECT32: print_subject32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SUBJECT64: print_subject64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SUBJECT32_EX: print_subject32ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_TEXT: print_text_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKET_EX: print_socketex32_tok(outfp, tok, del, raw, sfrm); + return; default: print_invalid_tok(outfp, tok, del, raw, sfrm); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:49:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F329116A458; Sat, 21 Jan 2006 13:49:38 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AED316A41F for ; Sat, 21 Jan 2006 13:49:38 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 315E843D45 for ; Sat, 21 Jan 2006 13:49:38 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDncfo082132 for ; Sat, 21 Jan 2006 13:49:38 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDnbJu082126 for perforce@freebsd.org; Sat, 21 Jan 2006 13:49:37 GMT (envelope-from wsalamon@computer.org) Date: Sat, 21 Jan 2006 13:49:37 GMT Message-Id: <200601211349.k0LDnbJu082126@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 90076 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:49:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=90076 Change 90076 by wsalamon@gretsch on 2006/01/21 13:48:47 Audit the monut() and unmount() system calls; nmount() still to come. For mount(), we copy in the user path explicitly for audit because there are many possible error exits before the path is normally copied in. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/kern/vfs_mount.c#6 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/kern/vfs_mount.c#6 (text+ko) ==== @@ -58,6 +58,8 @@ #include #include +#include + #include #include @@ -366,6 +368,11 @@ int error; u_int iovcnt; + /* XXXAUDIT Audit is not complete for nmount() yet; need to create + * a new audit event. + */ + AUDIT_ARG(fflags, uap->flags); + /* Kick out MNT_ROOTFS early as it is legal internally */ if (uap->flags & MNT_ROOTFS) return (EINVAL); @@ -488,7 +495,6 @@ error = EINVAL; goto bail; } - /* * Be ultra-paranoid about making sure the type and fspath * variables will fit in our mp buffers, including the @@ -536,6 +542,8 @@ struct mntarg *ma = NULL; int error; + AUDIT_ARG(fflags, uap->flags); + /* Kick out MNT_ROOTFS early as it is legal internally */ uap->flags &= ~MNT_ROOTFS; @@ -545,11 +553,30 @@ fstype = malloc(MFSNAMELEN, M_TEMP, M_WAITOK); error = copyinstr(uap->type, fstype, MFSNAMELEN, NULL); if (!error) { + /* Audit the fstype here, even though it will be copied + * again later. But if an error is detected, it won't get + * copied later, so grab as much info as possible. + */ + AUDIT_ARG(text, fstype); mtx_lock(&Giant); /* XXX ? */ vfsp = vfs_byname_kld(fstype, td, &error); mtx_unlock(&Giant); } free(fstype, M_TEMP); + +#ifdef AUDIT + { + /* Even though it will get captured again during vnode lookup, + * capture the user-supplied path here because there are several + * error-out cases before the lookup, or the lookup may fail. + */ + char *pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); + error = copyinstr(uap->path, pathbuf, MNAMELEN, NULL); + if (!error) + AUDIT_ARG(upath, td, pathbuf, ARG_UPATH1); + free(pathbuf, M_TEMP); + } +#endif if (error) return (error); if (vfsp == NULL) @@ -563,6 +590,12 @@ ma = mount_argb(ma, !(uap->flags & MNT_NOSUID), "nosuid"); ma = mount_argb(ma, !(uap->flags & MNT_NOEXEC), "noexec"); + /* Note that for auditing purposes, the we depend on the + * file system cmount function to call kernel_mount(), which + * calls vfs_donmount(), and that is where the user path and + * type information is copied into the kernel; only then can + * we capture the path information for auditing. + */ error = vfsp->vfc_vfsops->vfs_cmount(ma, uap->data, uap->flags, td); return (error); } @@ -620,7 +653,8 @@ /* * Get vnode to be covered */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspath, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_SYSSPACE, + fspath, td); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -845,6 +879,7 @@ free(pathbuf, M_TEMP); return (error); } + AUDIT_ARG(upath, td, pathbuf, ARG_UPATH1); if (uap->flags & MNT_BYFSID) { /* Decode the filesystem ID. */ if (sscanf(pathbuf, "FSID:%d:%d", &id0, &id1) != 2) { @@ -878,6 +913,21 @@ return ((uap->flags & MNT_BYFSID) ? ENOENT : EINVAL); } +#ifdef AUDIT + { + int vfslocked; + struct vnode *vp = mp->mnt_vnodecovered; + + if (vp != NULL) { + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); + AUDIT_ARG(vnode, vp, ARG_VNODE1); + VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); + } + } +#endif + /* * Only privileged root, or (if MNT_USER is set) the user that did the * original mount is permitted to unmount this filesystem. From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:54:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BA2C16A422; Sat, 21 Jan 2006 13:54:45 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB10E16A41F for ; Sat, 21 Jan 2006 13:54:44 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4CF743D46 for ; Sat, 21 Jan 2006 13:54:44 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDsigW082385 for ; Sat, 21 Jan 2006 13:54:44 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDsi85082382 for perforce@freebsd.org; Sat, 21 Jan 2006 13:54:44 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:54:44 GMT Message-Id: <200601211354.k0LDsi85082382@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90077 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:54:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=90077 Change 90077 by rwatson@rwatson_sesame on 2006/01/21 13:53:51 More avoidance of hand-calculated token sizes. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#27 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#27 (text+ko) ==== @@ -151,8 +151,8 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2*sizeof(u_int16_t) + - 3*sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + + 3 * sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -296,7 +296,8 @@ u_char *dptr = NULL; int i; - GET_TOKEN_AREA(t, dptr, n * 4 + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + n * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -318,7 +319,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -340,7 +341,7 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 5 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -389,7 +390,7 @@ u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -450,7 +451,6 @@ return (t); } - /* * token ID 1 byte * port IP address 2 bytes From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:55:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 21E7316A422; Sat, 21 Jan 2006 13:55:47 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8E0F16A41F for ; Sat, 21 Jan 2006 13:55:46 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EDBD43D45 for ; Sat, 21 Jan 2006 13:55:46 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDtkaA082540 for ; Sat, 21 Jan 2006 13:55:46 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDtkIH082537 for perforce@freebsd.org; Sat, 21 Jan 2006 13:55:46 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:55:46 GMT Message-Id: <200601211355.k0LDtkIH082537@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90078 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:55:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=90078 Change 90078 by rwatson@rwatson_sesame on 2006/01/21 13:55:02 Replicate avoidance of hand-coded token sizes in the kernel bsm token generation code. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#4 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#4 (text+ko) ==== @@ -79,9 +79,10 @@ u_int16_t textlen; textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, 9 + textlen); + textlen += 1; - textlen += 1; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_char) + + sizeof(u_int32_t) + sizeof(u_int16_t) + textlen); ADD_U_CHAR(dptr, AUT_ARG32); ADD_U_CHAR(dptr, n); @@ -101,9 +102,10 @@ u_int16_t textlen; textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, 13 + textlen); + textlen += 1; - textlen += 1; + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int64_t) + + sizeof(u_int16_t) + textlen); ADD_U_CHAR(dptr, AUT_ARG64); ADD_U_CHAR(dptr, n); @@ -140,7 +142,8 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - GET_TOKEN_AREA(t, dptr, 29); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + + 3 * sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_ATTR32); @@ -223,7 +226,7 @@ totdata = datasize * unit_count; - GET_TOKEN_AREA(t, dptr, totdata + 4); + GET_TOKEN_AREA(t, dptr, totdata + 4 * sizeof(u_char)); ADD_U_CHAR(dptr, AUT_DATA); ADD_U_CHAR(dptr, unit_print); @@ -246,7 +249,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 9); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_EXIT); ADD_U_INT32(dptr, err); @@ -276,7 +279,8 @@ u_char *dptr = NULL; int i; - GET_TOKEN_AREA(t, dptr, n * 4 + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + n * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_NEWGROUPS); ADD_U_INT16(dptr, n); @@ -296,7 +300,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_IN_ADDR); ADD_U_INT32(dptr, internet_addr->s_addr); @@ -316,7 +320,7 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 5 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_IN_ADDR_EX); ADD_U_INT32(dptr, type); @@ -338,7 +342,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(struct ip)); ADD_U_CHAR(dptr, AUT_IP); /* @@ -360,7 +364,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_IPC); ADD_U_CHAR(dptr, type); @@ -386,7 +390,7 @@ u_char *dptr = NULL; u_int16_t pad0 = 0; - GET_TOKEN_AREA(t, dptr, 29); + GET_TOKEN_AREA(t, dptr, 12 * sizeof(u_int16_t) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_IPC_PERM); @@ -417,7 +421,6 @@ return (t); } - /* * token ID 1 byte * port IP address 2 bytes @@ -428,7 +431,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t)); ADD_U_CHAR(dptr, AUT_IPORT); ADD_U_INT16(dptr, iport); @@ -436,7 +439,6 @@ return (t); } - /* * token ID 1 byte * size 2 bytes @@ -448,7 +450,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, bytes + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + bytes); ADD_U_CHAR(dptr, AUT_OPAQUE); ADD_U_INT16(dptr, bytes); @@ -485,9 +487,11 @@ /* XXXRW: else ...? */ filelen = strlen(file); - GET_TOKEN_AREA(t, dptr, filelen + 12); + filelen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int32_t) + + sizeof(u_int16_t) + filelen); - filelen += 1; timems = tm.tv_usec/1000; ADD_U_CHAR(dptr, AUT_OTHER_FILE32); @@ -512,9 +516,9 @@ u_int16_t textlen; textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, textlen + 4); + textlen += 1; - textlen += 1; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen); ADD_U_CHAR(dptr, AUT_TEXT); ADD_U_INT16(dptr, textlen); @@ -536,9 +540,9 @@ u_int16_t textlen; textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, textlen + 4); + textlen += 1; - textlen += 1; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen); ADD_U_CHAR(dptr, AUT_PATH); ADD_U_INT16(dptr, textlen); @@ -567,7 +571,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 37); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_PROCESS32); ADD_U_INT32(dptr, auid); @@ -621,7 +625,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 53); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_PROCESS32_EX); ADD_U_INT32(dptr, auid); @@ -669,7 +673,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_RETURN32); ADD_U_CHAR(dptr, status); @@ -684,7 +688,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 10); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int64_t)); ADD_U_CHAR(dptr, AUT_RETURN64); ADD_U_CHAR(dptr, status); @@ -710,7 +714,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_SEQ); ADD_U_INT32(dptr, audit_count); @@ -745,7 +749,8 @@ u_char *dptr; u_int16_t so_type; - GET_TOKEN_AREA(t, dptr, 15); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + + sizeof(u_int32_t) + sizeof(u_int16_t) + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AU_SOCK_TOKEN); /* Coerce the socket type into a short value */ @@ -797,13 +802,13 @@ token_t *t; u_char *dptr; - GET_TOKEN_AREA(t, dptr, 107); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + strlen(so->sun_path) + 1); ADD_U_CHAR(dptr, AU_SOCK_UNIX_TOKEN); /* BSM token has two bytes for family */ ADD_U_CHAR(dptr, 0); ADD_U_CHAR(dptr, so->sun_family); - ADD_STRING(dptr, so->sun_path, strlen(so->sun_path)); + ADD_STRING(dptr, so->sun_path, strlen(so->sun_path) + 1); return (t); } @@ -820,7 +825,8 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 9); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_SOCKINET32); /* @@ -842,7 +848,8 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + + 4 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_SOCKINET128); /* @@ -889,7 +896,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 37); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_SUBJECT32); ADD_U_INT32(dptr, auid); @@ -943,7 +950,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 53); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_SUBJECT32_EX); ADD_U_INT32(dptr, auid); @@ -1023,7 +1030,8 @@ nextarg = *(args + count); } - GET_TOKEN_AREA(t, dptr, 5 + totlen); + totlen += count * sizeof(char); /* nul terminations. */ + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); ADD_U_CHAR(dptr, AUT_EXEC_ARGS); ADD_U_INT32(dptr, count); @@ -1061,7 +1069,8 @@ nextenv = *(env + count); } - GET_TOKEN_AREA(t, dptr, 5 + totlen); + totlen += sizeof(char) * count; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); ADD_U_CHAR(dptr, AUT_EXEC_ENV); ADD_U_INT32(dptr, count); @@ -1103,7 +1112,8 @@ #endif /* XXXRW: else ...? */ - GET_TOKEN_AREA(t, dptr, 18); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + + sizeof(u_char) + 2 * sizeof(u_int16_t) + 2 * sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_HEADER32); ADD_U_INT32(dptr, rec_size); @@ -1154,7 +1164,8 @@ u_char *dptr = NULL; u_int16_t magic = TRAILER_PAD_MAGIC; - GET_TOKEN_AREA(t, dptr, 7); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int32_t)); ADD_U_CHAR(dptr, AUT_TRAILER); ADD_U_INT16(dptr, magic); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:59:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9997316A422; Sat, 21 Jan 2006 13:59:52 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CFEA16A41F for ; Sat, 21 Jan 2006 13:59:52 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19A5B43D48 for ; Sat, 21 Jan 2006 13:59:52 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDxpgd082676 for ; Sat, 21 Jan 2006 13:59:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDxpdE082673 for perforce@freebsd.org; Sat, 21 Jan 2006 13:59:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:59:51 GMT Message-Id: <200601211359.k0LDxpdE082673@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90079 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:59:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=90079 Change 90079 by rwatson@rwatson_sesame on 2006/01/21 13:59:50 White space consistency. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#28 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#28 (text+ko) ==== @@ -389,7 +389,6 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -471,7 +470,6 @@ return (t); } - /* * token ID 1 byte * size 2 bytes From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:00:54 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 616CF16A427; Sat, 21 Jan 2006 14:00:54 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22F5C16A422 for ; Sat, 21 Jan 2006 14:00:54 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B250743D45 for ; Sat, 21 Jan 2006 14:00:53 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LE0r2g082775 for ; Sat, 21 Jan 2006 14:00:53 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LE0rIu082772 for perforce@freebsd.org; Sat, 21 Jan 2006 14:00:53 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:00:53 GMT Message-Id: <200601211400.k0LE0rIu082772@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90080 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:00:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=90080 Change 90080 by rwatson@rwatson_sesame on 2006/01/21 14:00:15 Fix count of u_chars in one case. White space synchronization to OpenBSM. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#5 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#5 (text+ko) ==== @@ -81,7 +81,7 @@ textlen = strlen(text); textlen += 1; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_char) + + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + 2 * sizeof(u_char) + sizeof(u_int32_t) + sizeof(u_int16_t) + textlen); ADD_U_CHAR(dptr, AUT_ARG32); @@ -1031,7 +1031,7 @@ } totlen += count * sizeof(char); /* nul terminations. */ - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); ADD_U_CHAR(dptr, AUT_EXEC_ARGS); ADD_U_INT32(dptr, count); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:05:00 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C589216A422; Sat, 21 Jan 2006 14:04:59 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 707ED16A41F for ; Sat, 21 Jan 2006 14:04:59 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22C3343D45 for ; Sat, 21 Jan 2006 14:04:59 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LE4xAc082914 for ; Sat, 21 Jan 2006 14:04:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LE4wZQ082911 for perforce@freebsd.org; Sat, 21 Jan 2006 14:04:58 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:04:58 GMT Message-Id: <200601211404.k0LE4wZQ082911@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90081 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:05:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=90081 Change 90081 by rwatson@rwatson_sesame on 2006/01/21 14:04:43 Integrate OpenBSM branch into audit3 to pick up recent results from FlexeLint. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/openbsm/README#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/audit.h#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_io.c#6 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_token.c#6 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_user.c#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_wrappers.c#3 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/tools/Makefile#2 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/tools/audump.c#3 integrate Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/README#4 (text+ko) ==== @@ -56,9 +56,16 @@ SPARTA, Inc. Robert Watson Wayne Salamon + Suresh Krishnaswamy + Kevin Van Vechten Tom Rhodes Wojciech Koszek Chunyang Yuan + Poul-Henning Kamp + +In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel +Software's FlexeLint tool were used to identify a number of bugs in the +OpenBSM implementation. Contributions ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/audit.h#5 (text+ko) ==== @@ -37,7 +37,7 @@ #define AUDIT_RECORD_MAGIC 0x828a0f1b #define MAX_AUDIT_RECORDS 20 #define MAX_AUDIT_RECORD_SIZE 4096 -#define MIN_AUDIT_FILE_SIZE 512 * 1024 +#define MIN_AUDIT_FILE_SIZE (512 * 1024) /* * Triggers for the audit daemon ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_io.c#6 (text+ko) ==== @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -551,7 +550,7 @@ break; case AU_IPv6: - READ_TOKEN_BYTES(buf, len, &tok->tt.hdr32_ex.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.hdr32_ex.addr, sizeof(tok->tt.hdr32_ex.addr), tok->len, err); break; } @@ -2533,115 +2532,150 @@ switch(tok->id) { case AUT_HEADER32: - return (print_header32_tok(outfp, tok, del, raw, sfrm)); + print_header32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_HEADER32_EX: - return (print_header32_ex_tok(outfp, tok, del, raw, sfrm)); + print_header32_ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_HEADER64: - return (print_header64_tok(outfp, tok, del, raw, sfrm)); + print_header64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_HEADER64_EX: - return (print_header64_ex_tok(outfp, tok, del, raw, sfrm)); + print_header64_ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_TRAILER: - return (print_trailer_tok(outfp, tok, del, raw, sfrm)); + print_trailer_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ARG32: - return (print_arg32_tok(outfp, tok, del, raw, sfrm)); + print_arg32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ARG64: - return (print_arg64_tok(outfp, tok, del, raw, sfrm)); + print_arg64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_DATA: - return (print_arb_tok(outfp, tok, del, raw, sfrm)); + print_arb_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ATTR32: - return (print_attr32_tok(outfp, tok, del, raw, sfrm)); + print_attr32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_ATTR64: - return (print_attr64_tok(outfp, tok, del, raw, sfrm)); + print_attr64_tok(outfp, tok, del, raw, sfrm); case AUT_EXIT: - return (print_exit_tok(outfp, tok, del, raw, sfrm)); + print_exit_tok(outfp, tok, del, raw, sfrm); + return; case AUT_EXEC_ARGS: - return (print_execarg_tok(outfp, tok, del, raw, sfrm)); + print_execarg_tok(outfp, tok, del, raw, sfrm); + return; case AUT_EXEC_ENV: - return (print_execenv_tok(outfp, tok, del, raw, sfrm)); + print_execenv_tok(outfp, tok, del, raw, sfrm); + return; case AUT_OTHER_FILE32: - return (print_file_tok(outfp, tok, del, raw, sfrm)); + print_file_tok(outfp, tok, del, raw, sfrm); + return; case AUT_NEWGROUPS: - return (print_newgroups_tok(outfp, tok, del, raw, sfrm)); + print_newgroups_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IN_ADDR: - return (print_inaddr_tok(outfp, tok, del, raw, sfrm)); + print_inaddr_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IN_ADDR_EX: - return (print_inaddr_ex_tok(outfp, tok, del, raw, sfrm)); + print_inaddr_ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IP: - return (print_ip_tok(outfp, tok, del, raw, sfrm)); + print_ip_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IPC: - return (print_ipc_tok(outfp, tok, del, raw, sfrm)); + print_ipc_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IPC_PERM: - return (print_ipcperm_tok(outfp, tok, del, raw, sfrm)); + print_ipcperm_tok(outfp, tok, del, raw, sfrm); + return; case AUT_IPORT: - return (print_iport_tok(outfp, tok, del, raw, sfrm)); + print_iport_tok(outfp, tok, del, raw, sfrm); + return; case AUT_OPAQUE: - return (print_opaque_tok(outfp, tok, del, raw, sfrm)); + print_opaque_tok(outfp, tok, del, raw, sfrm); + return; case AUT_PATH: - return (print_path_tok(outfp, tok, del, raw, sfrm)); + print_path_tok(outfp, tok, del, raw, sfrm); + return; case AUT_PROCESS32: - return (print_process32_tok(outfp, tok, del, raw, sfrm)); + print_process32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_PROCESS32_EX: - return (print_process32ex_tok(outfp, tok, del, raw, sfrm)); + print_process32ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_RETURN32: - return (print_return32_tok(outfp, tok, del, raw, sfrm)); + print_return32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_RETURN64: - return (print_return64_tok(outfp, tok, del, raw, sfrm)); + print_return64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SEQ: - return (print_seq_tok(outfp, tok, del, raw, sfrm)); + print_seq_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKET: - return (print_socket_tok(outfp, tok, del, raw, sfrm)); + print_socket_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKINET32: - return (print_sock_inet32_tok(outfp, tok, del, raw, sfrm)); + print_sock_inet32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKUNIX: - return (print_sock_unix_tok(outfp, tok, del, raw, sfrm)); + print_sock_unix_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SUBJECT32: - return (print_subject32_tok(outfp, tok, del, raw, sfrm)); + print_subject32_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SUBJECT64: - return (print_subject64_tok(outfp, tok, del, raw, sfrm)); + print_subject64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SUBJECT32_EX: - return (print_subject32ex_tok(outfp, tok, del, raw, sfrm)); + print_subject32ex_tok(outfp, tok, del, raw, sfrm); + return; case AUT_TEXT: - return (print_text_tok(outfp, tok, del, raw, sfrm)); + print_text_tok(outfp, tok, del, raw, sfrm); + return; case AUT_SOCKET_EX: - return (print_socketex32_tok(outfp, tok, del, raw, sfrm)); + print_socketex32_tok(outfp, tok, del, raw, sfrm); + return; default: - return (print_invalid_tok(outfp, tok, del, raw, sfrm)); + print_invalid_tok(outfp, tok, del, raw, sfrm); } } ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_token.c#6 (text+ko) ==== @@ -59,13 +59,13 @@ #define GET_TOKEN_AREA(t, dptr, length) do { \ t = malloc (sizeof(token_t)); \ if (t != NULL) { \ - t->len = length; \ - t->t_data = malloc (length * sizeof(u_char)); \ + t->len = (length); \ + t->t_data = malloc ((length) * sizeof(u_char)); \ if ((dptr = t->t_data) == NULL) { \ free(t); \ t = NULL; \ } else \ - memset(dptr, 0, length); \ + memset(dptr, 0, (length)); \ } \ } while (0) @@ -83,18 +83,14 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } + textlen = strlen(text); + textlen += 1; - textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, 9 + textlen); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t) + + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_ARG32); ADD_U_CHAR(dptr, n); ADD_U_INT32(dptr, v); @@ -112,18 +108,14 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } + textlen = strlen(text); + textlen += 1; - textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, 13 + textlen); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int64_t) + + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_ARG64); ADD_U_CHAR(dptr, n); ADD_U_INT64(dptr, v); @@ -159,12 +151,8 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - if (vni == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 29); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int16_t) + + 3 * sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -230,11 +218,6 @@ u_char *dptr = NULL; size_t datasize, totdata; - if (p == NULL) { - errno = EINVAL; - return (NULL); - } - /* Determine the size of the basic unit. */ switch (unit_type) { case AUR_BYTE: @@ -256,7 +239,7 @@ totdata = datasize * unit_count; - GET_TOKEN_AREA(t, dptr, totdata + 4); + GET_TOKEN_AREA(t, dptr, totdata + 4 * sizeof(u_char)); if (t == NULL) return (NULL); @@ -281,7 +264,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 9); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -313,12 +296,8 @@ u_char *dptr = NULL; int i; - if (groups == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, n * 4 + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + n * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -340,12 +319,7 @@ token_t *t; u_char *dptr = NULL; - if (internet_addr == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -367,12 +341,7 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - if (internet_addr == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 5 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -396,12 +365,7 @@ token_t *t; u_char *dptr = NULL; - if (ip == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(struct ip)); if (t == NULL) return (NULL); @@ -425,8 +389,7 @@ token_t *t; u_char *dptr = NULL; - - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -454,13 +417,7 @@ u_char *dptr = NULL; u_int16_t pad0 = 0; - - if (perm == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 29); + GET_TOKEN_AREA(t, dptr, 12 * sizeof(u_int16_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -493,7 +450,6 @@ return (t); } - /* * token ID 1 byte * port IP address 2 bytes @@ -504,8 +460,7 @@ token_t *t; u_char *dptr = NULL; - - GET_TOKEN_AREA(t, dptr, 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t)); if (t == NULL) return (NULL); @@ -515,7 +470,6 @@ return (t); } - /* * token ID 1 byte * size 2 bytes @@ -527,12 +481,7 @@ token_t *t; u_char *dptr = NULL; - if ((data == NULL) || (bytes <= 0)) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, bytes + 3); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + bytes); if (t == NULL) return (NULL); @@ -569,16 +518,14 @@ return (NULL); #endif - if (file == NULL) { - errno = EINVAL; - return (NULL); - } filelen = strlen(file); - GET_TOKEN_AREA(t, dptr, filelen + 12); + filelen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2 * sizeof(u_int32_t) + + sizeof(u_int16_t) + filelen); if (t == NULL) return (NULL); - filelen += 1; timems = tm.tv_usec/1000; ADD_U_CHAR(dptr, AUT_OTHER_FILE32); @@ -602,17 +549,13 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, textlen + 4); + textlen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_TEXT); ADD_U_INT16(dptr, textlen); ADD_STRING(dptr, text, textlen); @@ -632,17 +575,13 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } textlen = strlen(text); - GET_TOKEN_AREA(t, dptr, textlen + 4); + textlen += 1; + + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen); if (t == NULL) return (NULL); - textlen += 1; - ADD_U_CHAR(dptr, AUT_PATH); ADD_U_INT16(dptr, textlen); ADD_STRING(dptr, text, textlen); @@ -670,12 +609,7 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 37); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -732,12 +666,7 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 53); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -788,7 +717,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 6); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -805,7 +734,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 10); + GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int64_t)); if (t == NULL) return (NULL); @@ -833,7 +762,7 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, 5); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -898,10 +827,7 @@ token_t *t; u_char *dptr; - if (so == NULL) - return (NULL); - - GET_TOKEN_AREA(t, dptr, 107); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + strlen(so->sun_path) + 1); if (t == NULL) return (NULL); @@ -909,7 +835,7 @@ /* BSM token has two bytes for family */ ADD_U_CHAR(dptr, 0); ADD_U_CHAR(dptr, so->sun_family); - ADD_STRING(dptr, so->sun_path, strlen(so->sun_path)); + ADD_STRING(dptr, so->sun_path, strlen(so->sun_path) + 1); return (t); } @@ -926,12 +852,8 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 9); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -955,12 +877,8 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 21); + GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + + 4 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1009,12 +927,7 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 37); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1071,12 +984,7 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - - GET_TOKEN_AREA(t, dptr, 53); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1148,11 +1056,6 @@ int i, count = 0; size_t totlen = 0; - if (args == NULL) { - errno = EINVAL; - return (NULL); - } - nextarg = *args; while (nextarg != NULL) { @@ -1164,7 +1067,8 @@ nextarg = *(args + count); } - GET_TOKEN_AREA(t, dptr, 5 + totlen); + totlen += count * sizeof(char); /* nul terminations. */ + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); if (t == NULL) return (NULL); @@ -1193,11 +1097,6 @@ size_t totlen = 0; const char *nextenv; - if (env == NULL) { - errno = EINVAL; - return (NULL); - } - nextenv = *env; while (nextenv != NULL) { @@ -1209,7 +1108,8 @@ nextenv = *(env + count); } - GET_TOKEN_AREA(t, dptr, 5 + totlen); + totlen += sizeof(char) * count; + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + totlen); if (t == NULL) return (NULL); @@ -1252,7 +1152,8 @@ return (NULL); #endif - GET_TOKEN_AREA(t, dptr, 18); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int32_t) + + sizeof(u_char) + 2 * sizeof(u_int16_t) + 2 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1297,7 +1198,8 @@ u_char *dptr = NULL; u_int16_t magic = TRAILER_PAD_MAGIC; - GET_TOKEN_AREA(t, dptr, 7); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + + sizeof(u_int32_t)); if (t == NULL) return (NULL); ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_user.c#4 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_user file into au_user_ent structures. */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *user_delim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -49,14 +49,14 @@ * Parse one line from the audit_user file into the au_user_ent structure. */ static struct au_user_ent * -userfromstr(char *str, char *delim, struct au_user_ent *u) +userfromstr(char *str, struct au_user_ent *u) { char *username, *always, *never; char *last; - username = strtok_r(str, delim, &last); - always = strtok_r(NULL, delim, &last); - never = strtok_r(NULL, delim, &last); + username = strtok_r(str, user_delim, &last); + always = strtok_r(NULL, user_delim, &last); + never = strtok_r(NULL, user_delim, &last); if ((username == NULL) || (always == NULL) || (never == NULL)) return (NULL); @@ -128,7 +128,7 @@ *nl = '\0'; /* Get the next structure. */ - if (userfromstr(linestr, delim, u) == NULL) + if (userfromstr(linestr, u) == NULL) return (NULL); return (u); @@ -214,7 +214,8 @@ /* Get user mask. */ if ((up = getauusernam_r(&u, username)) != NULL) { - if (-1 == getfauditflags(&u.au_always, &u.au_never, mask_p)) + if (-1 == getfauditflags(&up->au_always, &up->au_never, + mask_p)) return (-1); return (0); } ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_wrappers.c#3 (text+ko) ==== @@ -239,6 +239,7 @@ /* tokenize and save the error message */ if ((errtok = au_to_text(errmsg)) == NULL) { + au_free_token(subject); syslog(LOG_ERR, "%s: au_to_text() failed", func); return (kAUMakeTextTokErr); } @@ -265,6 +266,7 @@ } /* tokenize and save the error message */ if ((errtok = au_to_text(errmsg)) == NULL) { + au_free_token(subject); syslog(LOG_ERR, "%s: au_to_text() failed", func); return (kAUMakeTextTokErr); } ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/tools/Makefile#2 (text+ko) ==== @@ -8,5 +8,6 @@ DPADD= /usr/lib/libbsm.a LDADD= -lbsm BINDIR= /usr/sbin +WARNS= 3 .include ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/tools/audump.c#3 (text+ko) ==== @@ -25,8 +25,11 @@ */ #include +#include +#include #include #include +#include /* * Simple tool to dump various /etc/security databases using the defined APIs. From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:08:05 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 958B216A423; Sat, 21 Jan 2006 14:08:04 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 54CD816A41F for ; Sat, 21 Jan 2006 14:08:04 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA18E43D58 for ; Sat, 21 Jan 2006 14:08:03 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LE8318083229 for ; Sat, 21 Jan 2006 14:08:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LE83H1083226 for perforce@freebsd.org; Sat, 21 Jan 2006 14:08:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:08:03 GMT Message-Id: <200601211408.k0LE83H1083226@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90083 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:08:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=90083 Change 90083 by rwatson@rwatson_sesame on 2006/01/21 14:07:04 Add an assert to help FlexeLint figure out GET_TOKEN_AREA(). phk and I can't see the bug in the macro that causes FlexeLint to get unhappy, which doesn't mean it doesn't exist, just that it's got us stumped, so the assert helps FlexeLint figure out what we meant (and maybe said). Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#29 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#29 (text+ko) ==== @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -67,6 +68,7 @@ } else \ memset(dptr, 0, (length)); \ } \ + assert(t == NULL || dptr != NULL); \ } while (0) /* From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:16:18 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D622B16A479; Sat, 21 Jan 2006 14:16:14 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5319F16A44A for ; Sat, 21 Jan 2006 14:16:14 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17DAD43D49 for ; Sat, 21 Jan 2006 14:16:14 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LEGDgw083622 for ; Sat, 21 Jan 2006 14:16:13 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LEGDYw083619 for perforce@freebsd.org; Sat, 21 Jan 2006 14:16:13 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:16:13 GMT Message-Id: <200601211416.k0LEGDYw083619@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90084 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:16:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=90084 Change 90084 by rwatson@rwatson_sesame on 2006/01/21 14:15:54 Constify delimiter for class file, no need to make it a variable to the parsing function. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#8 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#8 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_class file to return struct au_class_ent * entries. */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *classdelim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -50,15 +50,15 @@ * au_class_ent elements; store the result in c. */ static struct au_class_ent * -classfromstr(char *str, char *delim, struct au_class_ent *c) +classfromstr(char *str, struct au_class_ent *c) { char *classname, *classdesc, *classflag; char *last; /* Each line contains flag:name:desc. */ - classflag = strtok_r(str, delim, &last); - classname = strtok_r(NULL, delim, &last); - classdesc = strtok_r(NULL, delim, &last); + classflag = strtok_r(str, classdelim, &last); + classname = strtok_r(NULL, classdelim, &last); + classdesc = strtok_r(NULL, classdelim, &last); if ((classflag == NULL) || (classname == NULL) || (classdesc == NULL)) return (NULL); @@ -113,7 +113,7 @@ tokptr = linestr; /* Parse tokptr to au_class_ent components. */ - if (classfromstr(tokptr, delim, c) == NULL) + if (classfromstr(tokptr, c) == NULL) return (NULL); return (c); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:26:28 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EA39616A422; Sat, 21 Jan 2006 14:26:27 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94D3116A41F for ; Sat, 21 Jan 2006 14:26:27 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36C8043D46 for ; Sat, 21 Jan 2006 14:26:27 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LEQR48084017 for ; Sat, 21 Jan 2006 14:26:27 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LEQQBF084014 for perforce@freebsd.org; Sat, 21 Jan 2006 14:26:26 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:26:26 GMT Message-Id: <200601211426.k0LEQQBF084014@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90086 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:26:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=90086 Change 90086 by rwatson@rwatson_sesame on 2006/01/21 14:25:31 Don't return in a case that can't be reached, this will help gcc generate a warning if a bug is introduced so that it is reachable. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#10 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#10 (text+ko) ==== @@ -94,8 +94,6 @@ } } } - - return (0); /* EOF */ } /* From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:27:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 23D1416A422; Sat, 21 Jan 2006 14:27:30 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DADA016A41F for ; Sat, 21 Jan 2006 14:27:29 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21E5143D6A for ; Sat, 21 Jan 2006 14:27:28 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LERSkt084062 for ; Sat, 21 Jan 2006 14:27:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LERSjD084059 for perforce@freebsd.org; Sat, 21 Jan 2006 14:27:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:27:28 GMT Message-Id: <200601211427.k0LERSjD084059@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90087 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:27:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=90087 Change 90087 by rwatson@rwatson_sesame on 2006/01/21 14:26:49 Constify eventdelim and don't make it per-call. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#7 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#7 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_event file to return * au_event_ent entries */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *eventdelim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -49,16 +49,16 @@ * Parse one line from the audit_event file into the au_event_ent structure. */ static struct au_event_ent * -eventfromstr(char *str, char *delim, struct au_event_ent *e) +eventfromstr(char *str, struct au_event_ent *e) { char *evno, *evname, *evdesc, *evclass; struct au_mask evmask; char *last; - evno = strtok_r(str, delim, &last); - evname = strtok_r(NULL, delim, &last); - evdesc = strtok_r(NULL, delim, &last); - evclass = strtok_r(NULL, delim, &last); + evno = strtok_r(str, eventdelim, &last); + evname = strtok_r(NULL, eventdelim, &last); + evdesc = strtok_r(NULL, eventdelim, &last); + evclass = strtok_r(NULL, eventdelim, &last); if ((evno == NULL) || (evname == NULL) || (evdesc == NULL) || (evclass == NULL)) @@ -144,7 +144,7 @@ * XXXRW: Perhaps we should keep reading lines until we find a valid * one, rather than stopping when we hit an invalid one? */ - if (eventfromstr(linestr, delim, e) == NULL) + if (eventfromstr(linestr, e) == NULL) return (NULL); return (e); @@ -200,7 +200,7 @@ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; - if (eventfromstr(linestr, delim, e) != NULL) { + if (eventfromstr(linestr, e) != NULL) { if (strcmp(name, e->ae_name) == 0) return (e); } @@ -254,7 +254,7 @@ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; - if (eventfromstr(linestr, delim, e) != NULL) { + if (eventfromstr(linestr, e) != NULL) { if (event_number == e->ae_number) return (e); } From owner-p4-projects@FreeBSD.ORG Sat Jan 21 14:29:33 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 75CF616A422; Sat, 21 Jan 2006 14:29:32 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21E2616A41F for ; Sat, 21 Jan 2006 14:29:32 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF5B143D46 for ; Sat, 21 Jan 2006 14:29:31 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LETVZs084607 for ; Sat, 21 Jan 2006 14:29:31 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LETVCR084604 for perforce@freebsd.org; Sat, 21 Jan 2006 14:29:31 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 14:29:31 GMT Message-Id: <200601211429.k0LETVCR084604@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90088 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 14:29:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=90088 Change 90088 by rwatson@rwatson_sesame on 2006/01/21 14:29:29 Pointer is almost not a boolean. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#16 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#16 (text+ko) ==== @@ -237,7 +237,7 @@ token_t *tok; /* Free the token list */ - while ((tok = TAILQ_FIRST(&rec->token_q))) { + while ((tok = TAILQ_FIRST(&rec->token_q)) != NULL) { TAILQ_REMOVE(&rec->token_q, tok, tokens); free(tok->t_data); free(tok); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 15:27:44 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3A98516A422; Sat, 21 Jan 2006 15:27:44 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3A9916A41F for ; Sat, 21 Jan 2006 15:27:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCFBE43D46 for ; Sat, 21 Jan 2006 15:27:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LFRh9k087319 for ; Sat, 21 Jan 2006 15:27:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LFRhbL087316 for perforce@freebsd.org; Sat, 21 Jan 2006 15:27:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 15:27:43 GMT Message-Id: <200601211527.k0LFRhbL087316@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90092 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 15:27:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=90092 Change 90092 by rwatson@rwatson_sesame on 2006/01/21 15:26:59 Rename 'delim' to 'flagdelim' to match changes in other BSM related database code. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#9 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#9 (text+ko) ==== @@ -34,7 +34,7 @@ #include #include -static const char *delim = ","; +static const char *flagdelim = ","; /* * Convert the character representation of audit values into the au_mask_t @@ -65,7 +65,7 @@ masks->am_success = 0; masks->am_failure = 0; - tok = strtok_r(auditstr, delim, &last); + tok = strtok_r(auditstr, flagdelim, &last); while (tok != NULL) { /* Check for the events that should not be audited. */ if (tok[0] == '^') { @@ -95,7 +95,7 @@ } /* Get the next class. */ - tok = strtok_r(NULL, delim, &last); + tok = strtok_r(NULL, flagdelim, &last); } return (0); } From owner-p4-projects@FreeBSD.ORG Sat Jan 21 15:29:47 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3244416A422; Sat, 21 Jan 2006 15:29:47 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E86CA16A41F for ; Sat, 21 Jan 2006 15:29:46 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0C9E43D45 for ; Sat, 21 Jan 2006 15:29:46 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LFTks0087449 for ; Sat, 21 Jan 2006 15:29:46 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LFTkrZ087446 for perforce@freebsd.org; Sat, 21 Jan 2006 15:29:46 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 15:29:46 GMT Message-Id: <200601211529.k0LFTkrZ087446@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90093 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 15:29:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=90093 Change 90093 by rwatson@rwatson_sesame on 2006/01/21 15:28:57 Remove unneeded class entry pointers. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#10 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#10 (text+ko) ==== @@ -45,7 +45,7 @@ { char class_ent_name[AU_CLASS_NAME_MAX]; char class_ent_desc[AU_CLASS_DESC_MAX]; - struct au_class_ent c, *cp; + struct au_class_ent c; char *tok; char sel, sub; char *last; @@ -84,7 +84,7 @@ } else sel = AU_PRS_BOTH; - if ((cp = getauclassnam_r(&c, tok)) != NULL) { + if ((getauclassnam_r(&c, tok)) != NULL) { if (sub) SUB_FROM_MASK(masks, c.ac_class, sel); else @@ -118,7 +118,7 @@ { char class_ent_name[AU_CLASS_NAME_MAX]; char class_ent_desc[AU_CLASS_DESC_MAX]; - struct au_class_ent c, *cp; + struct au_class_ent c; char *strptr = auditstr; u_char sel; @@ -138,7 +138,7 @@ * the success or failure masks. */ setauclass(); - while ((cp = getauclassent_r(&c)) != NULL) { + while ((getauclassent_r(&c)) != NULL) { sel = 0; /* Dont do anything for class = no. */ From owner-p4-projects@FreeBSD.ORG Sat Jan 21 15:30:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E8B8A16A423; Sat, 21 Jan 2006 15:30:48 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA2A316A422 for ; Sat, 21 Jan 2006 15:30:48 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6E83E43D45 for ; Sat, 21 Jan 2006 15:30:48 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LFUm95087603 for ; Sat, 21 Jan 2006 15:30:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LFUmj6087600 for perforce@freebsd.org; Sat, 21 Jan 2006 15:30:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 15:30:48 GMT Message-Id: <200601211530.k0LFUmj6087600@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90094 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 15:30:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=90094 Change 90094 by rwatson@rwatson_sesame on 2006/01/21 15:30:22 Remove unnecessary argument sanity checks. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#11 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_flags.c#11 (text+ko) ==== @@ -50,12 +50,6 @@ char sel, sub; char *last; - - if ((auditstr == NULL) || (masks == NULL)) { - errno = EINVAL; - return (-1); - } - bzero(&c, sizeof(c)); bzero(class_ent_name, sizeof(class_ent_name)); bzero(class_ent_desc, sizeof(class_ent_desc)); @@ -122,11 +116,6 @@ char *strptr = auditstr; u_char sel; - if ((auditstr == NULL) || (masks == NULL)) { - return (EINVAL); - return (-1); - } - bzero(&c, sizeof(c)); bzero(class_ent_name, sizeof(class_ent_name)); bzero(class_ent_desc, sizeof(class_ent_desc)); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 15:36:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CABDA16A422; Sat, 21 Jan 2006 15:36:56 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A0FD16A41F for ; Sat, 21 Jan 2006 15:36:56 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47AB943D45 for ; Sat, 21 Jan 2006 15:36:56 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LFauib087945 for ; Sat, 21 Jan 2006 15:36:56 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LFathl087942 for perforce@freebsd.org; Sat, 21 Jan 2006 15:36:55 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 15:36:55 GMT Message-Id: <200601211536.k0LFathl087942@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90095 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 15:36:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=90095 Change 90095 by rwatson@rwatson_sesame on 2006/01/21 15:36:25 Void '- ... -' expressions, because FlexeLint tells me I will find it confusing. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#22 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#22 (text+ko) ==== @@ -2372,7 +2372,7 @@ int err = 0; int recoversize; - recoversize = len - tok->len - BSM_TRAILER_SIZE; + recoversize = len - (tok->len + BSM_TRAILER_SIZE); if (recoversize <= 0) return (-1); @@ -2737,7 +2737,7 @@ bptr += sizeof(u_int32_t); /* now read remaining record bytes */ - bytestoread = recsize - sizeof(u_int32_t) - sizeof(u_char); + bytestoread = recsize - (sizeof(u_int32_t) + sizeof(u_char)); if (fread(bptr, 1, bytestoread, fp) < bytestoread) { free(*buf); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 15:53:20 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E193216A422; Sat, 21 Jan 2006 15:53:19 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9920F16A41F for ; Sat, 21 Jan 2006 15:53:19 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A06C43D58 for ; Sat, 21 Jan 2006 15:53:17 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LFrHXx088646 for ; Sat, 21 Jan 2006 15:53:17 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LFrHPS088643 for perforce@freebsd.org; Sat, 21 Jan 2006 15:53:17 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 15:53:17 GMT Message-Id: <200601211553.k0LFrHPS088643@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90098 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 15:53:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=90098 Change 90098 by rwatson@rwatson_sesame on 2006/01/21 15:52:38 More FlexeLinting: - Parenthesize macro arguments. - Constify a bit. - Mark unused arguments as __unused. - Don't shadow time() with a variable. - Remove unnecessary local variables. - Print 'invalid' for non-IP addresses that can't be printed. - Don't use '&' on arrays. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#23 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#23 (text+ko) ==== @@ -97,11 +97,11 @@ } while (0) #define SET_PTR(buf, len, ptr, size, bytesread, err) do { \ - if (bytesread + size > len) \ - err = 1; \ + if ((bytesread) + (size) > (len)) \ + (err) = 1; \ else { \ - ptr = buf + bytesread; \ - bytesread += size; \ + (ptr) = (buf) + (bytesread); \ + (bytesread) += (size); \ } \ } while (0) @@ -109,7 +109,7 @@ * Prints the delimiter string. */ static void -print_delim(FILE *fp, char *del) +print_delim(FILE *fp, const char *del) { fprintf(fp, "%s", del); @@ -288,14 +288,14 @@ static void print_sec32(FILE *fp, u_int32_t sec, char raw) { - time_t time; + time_t timestamp; char timestr[26]; if (raw) fprintf(fp, "%u", sec); else { - time = (time_t)sec; - ctime_r(&time, timestr); + timestamp = (time_t)sec; + ctime_r(×tamp, timestr); timestr[24] = '\0'; /* No new line */ fprintf(fp, "%s", timestr); } @@ -369,12 +369,12 @@ struct in_addr ipv4; struct in6_addr ipv6; char dst[INET6_ADDRSTRLEN]; - const char *ret = NULL; switch (type) { case AU_IPv4: ipv4.s_addr = (in_addr_t)(ipaddr[0]); - ret = inet_ntop(AF_INET, &ipv4, dst, INET6_ADDRSTRLEN); + fprintf(fp, "%s", inet_ntop(AF_INET, &ipv4, dst, + INET6_ADDRSTRLEN)); break; case AU_IPv6: @@ -382,13 +382,12 @@ ipv6.__u6_addr.__u6_addr32[1] = ipaddr[1]; ipv6.__u6_addr.__u6_addr32[2] = ipaddr[2]; ipv6.__u6_addr.__u6_addr32[3] = ipaddr[3]; - ret = inet_ntop(AF_INET6, &ipv6, dst, INET6_ADDRSTRLEN); + fprintf(fp, "%s", inet_ntop(AF_INET6, &ipv6, dst, + INET6_ADDRSTRLEN)); break; - } - if (ret != NULL) { - fprintf(fp, "%s", ret); - /* XXX Is ret heap memory? Leaked if so */ + default: + fprintf(fp, "invalid"); } } @@ -696,7 +695,7 @@ break; case AU_IPv6: - READ_TOKEN_BYTES(buf, len, &tok->tt.hdr64_ex.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.hdr64_ex.addr, sizeof(tok->tt.hdr64_ex.addr), tok->len, err); break; } @@ -755,7 +754,8 @@ } static void -print_trailer_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_trailer_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "trailer", raw); @@ -795,7 +795,8 @@ } static void -print_arg32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_arg32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "argument", raw); @@ -833,7 +834,8 @@ } static void -print_arg64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_arg64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "argument", raw); @@ -898,7 +900,8 @@ } static void -print_arb_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_arb_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { char *str; char *format; @@ -1022,7 +1025,8 @@ } static void -print_attr32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_attr32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "attribute", raw); @@ -1081,7 +1085,8 @@ } static void -print_attr64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_attr64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "attribute", raw); @@ -1120,7 +1125,8 @@ } static void -print_exit_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_exit_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "exit", raw); @@ -1163,7 +1169,8 @@ } static void -print_execarg_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_execarg_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { int i; @@ -1209,7 +1216,8 @@ } static void -print_execenv_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_execenv_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { int i; @@ -1252,7 +1260,8 @@ } static void -print_file_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_file_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "file", raw); @@ -1289,7 +1298,8 @@ } static void -print_newgroups_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_newgroups_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { int i; @@ -1317,7 +1327,8 @@ } static void -print_inaddr_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_inaddr_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip addr", raw); @@ -1355,7 +1366,8 @@ } static void -print_inaddr_ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_inaddr_ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip addr ex", raw); @@ -1418,7 +1430,8 @@ } static void -print_ip_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_ip_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip", raw); @@ -1465,7 +1478,8 @@ } static void -print_ipc_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_ipc_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "IPC", raw); @@ -1521,7 +1535,8 @@ } static void -print_ipcperm_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_ipcperm_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "IPC perm", raw); @@ -1557,7 +1572,8 @@ } static void -print_iport_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_iport_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip port", raw); @@ -1587,7 +1603,8 @@ } static void -print_opaque_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_opaque_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "opaque", raw); @@ -1618,7 +1635,8 @@ } static void -print_path_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_path_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "path", raw); @@ -1684,7 +1702,8 @@ } static void -print_process32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_process32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "process", raw); @@ -1769,7 +1788,7 @@ static void print_process32ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "process_ex", raw); @@ -1815,7 +1834,8 @@ } static void -print_return32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_return32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "return", raw); @@ -1842,7 +1862,8 @@ } static void -print_return64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_return64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "return", raw); @@ -1868,7 +1889,8 @@ } static void -print_seq_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_seq_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "sequence", raw); @@ -1905,7 +1927,7 @@ static void print_sock_inet32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, -char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "socket-inet", raw); @@ -1939,7 +1961,7 @@ static void print_sock_unix_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "socket-unix", raw); @@ -1987,7 +2009,8 @@ } static void -print_socket_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_socket_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "socket", raw); @@ -2061,7 +2084,8 @@ } static void -print_subject32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_subject32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "subject", raw); @@ -2143,7 +2167,8 @@ } static void -print_subject64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_subject64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "subject", raw); @@ -2241,7 +2266,7 @@ static void print_subject32ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "subject_ex", raw); @@ -2288,7 +2313,8 @@ } static void -print_text_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_text_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "text", raw); @@ -2350,7 +2376,7 @@ static void print_socketex32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "socket", raw); @@ -2386,7 +2412,8 @@ } static void -print_invalid_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_invalid_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "unknown", raw); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:02:31 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B430C16A426; Sat, 21 Jan 2006 16:02:30 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D16D16A420 for ; Sat, 21 Jan 2006 16:02:30 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3814743D45 for ; Sat, 21 Jan 2006 16:02:29 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LG2TeF089016 for ; Sat, 21 Jan 2006 16:02:29 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LG2SE1089013 for perforce@freebsd.org; Sat, 21 Jan 2006 16:02:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:02:28 GMT Message-Id: <200601211602.k0LG2SE1089013@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90099 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:02:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=90099 Change 90099 by rwatson@rwatson_sesame on 2006/01/21 16:02:18 Mark unused arguments as __unused. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#30 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#30 (text+ko) ==== @@ -630,8 +630,9 @@ } token_t * -au_to_process64(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, - pid_t pid, au_asid_t sid, au_tid_t *tid) +au_to_process64(__unused au_id_t auid, __unused uid_t euid, + __unused gid_t egid, __unused uid_t ruid, __unused gid_t rgid, + __unused pid_t pid, __unused au_asid_t sid, __unused au_tid_t *tid) { errno = ENOTSUP; @@ -639,8 +640,9 @@ } token_t * -au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, - pid_t pid, au_asid_t sid, au_tid_t *tid) +au_to_process(__unused au_id_t auid, __unused uid_t euid, + __unused gid_t egid, __unused uid_t ruid, __unused gid_t rgid, + __unused pid_t pid, __unused au_asid_t sid, __unused au_tid_t *tid) { return (au_to_process32(auid, euid, egid, ruid, rgid, pid, sid, @@ -1174,7 +1176,8 @@ } token_t * -au_to_header64(int rec_size, au_event_t e_type, au_emod_t e_mod) +au_to_header64(__unused int rec_size, __unused au_event_t e_type, + __unused au_emod_t e_mod) { errno = ENOTSUP; From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:05:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DA94316A422; Sat, 21 Jan 2006 16:05:34 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8691516A41F for ; Sat, 21 Jan 2006 16:05:34 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6187443D49 for ; Sat, 21 Jan 2006 16:05:33 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LG5Xaw089192 for ; Sat, 21 Jan 2006 16:05:33 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LG5XEN089189 for perforce@freebsd.org; Sat, 21 Jan 2006 16:05:33 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:05:33 GMT Message-Id: <200601211605.k0LG5XEN089189@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90100 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:05:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=90100 Change 90100 by rwatson@rwatson_sesame on 2006/01/21 16:04:36 Remove unused include. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#12 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#12 (text+ko) ==== @@ -34,7 +34,6 @@ #include #include -#include #include #include From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:10:43 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6579D16A423; Sat, 21 Jan 2006 16:10:43 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F93616A41F for ; Sat, 21 Jan 2006 16:10:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 045BF43D73 for ; Sat, 21 Jan 2006 16:10:40 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGAdZ8089385 for ; Sat, 21 Jan 2006 16:10:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGAdZS089382 for perforce@freebsd.org; Sat, 21 Jan 2006 16:10:39 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:10:39 GMT Message-Id: <200601211610.k0LGAdZS089382@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90101 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:10:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=90101 Change 90101 by rwatson@rwatson_sesame on 2006/01/21 16:10:14 Don't shadow 'time' with a variable. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#24 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#24 (text+ko) ==== @@ -308,14 +308,14 @@ static void print_sec64(FILE *fp, u_int64_t sec, char raw) { - time_t time; + time_t timestamp; char timestr[26]; if (raw) fprintf(fp, "%u", (u_int32_t)sec); else { - time = (time_t)sec; - ctime_r(&time, timestr); + timestamp = (time_t)sec; + ctime_r(×tamp, timestr); timestr[24] = '\0'; /* No new line */ fprintf(fp, "%s", timestr); } From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:27:02 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF82216A422; Sat, 21 Jan 2006 16:27:01 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7067416A41F for ; Sat, 21 Jan 2006 16:27:01 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D70443D45 for ; Sat, 21 Jan 2006 16:27:01 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGR1Gb090119 for ; Sat, 21 Jan 2006 16:27:01 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGR0fm090116 for perforce@freebsd.org; Sat, 21 Jan 2006 16:27:00 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:27:00 GMT Message-Id: <200601211627.k0LGR0fm090116@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90104 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:27:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=90104 Change 90104 by rwatson@rwatson_sesame on 2006/01/21 16:26:22 Fix typos, avoid &'s of arrays, and insert a missing return; Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#25 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#25 (text+ko) ==== @@ -1140,7 +1140,8 @@ * count 4 bytes * text count null-terminated string(s) */ -static int fetch_execarg_tok(tokenstr_t *tok, char *buf, int len) +static int +fetch_execarg_tok(tokenstr_t *tok, char *buf, int len) { int err = 0; int i; @@ -1150,7 +1151,7 @@ if (err) return (-1); - for (i = 0; i< tok->tt.execarg.count; i++) { + for (i = 0; i < tok->tt.execarg.count; i++) { bptr = buf + tok->len; tok->tt.execarg.text[i] = bptr; @@ -1355,7 +1356,7 @@ if (err) return (-1); } else if (tok->tt.inaddr_ex.type == AU_IPv6) { - READ_TOKEN_BYTES(buf, len, &tok->tt.inaddr_ex.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.inaddr_ex.addr, sizeof(tok->tt.inaddr_ex.addr), tok->len, err); if (err) return (-1); @@ -1776,7 +1777,7 @@ if (err) return (-1); } else if (tok->tt.proc32_ex.tid.type == AU_IPv6) { - READ_TOKEN_BYTES(buf, len, &tok->tt.proc32_ex.tid.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.proc32_ex.tid.addr, sizeof(tok->tt.proc32_ex.tid.addr), tok->len, err); if (err) return (-1); @@ -1951,7 +1952,7 @@ if (err) return (-1); - READ_TOKEN_BYTES(buf, len, &tok->tt.sockunix.path, 104, tok->len, + READ_TOKEN_BYTES(buf, len, tok->tt.sockunix.path, 104, tok->len, err); if (err) return (-1); @@ -2596,6 +2597,7 @@ case AUT_ATTR64: print_attr64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_EXIT: print_exit_tok(outfp, tok, del, raw, sfrm); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:28:03 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 67B0B16A422; Sat, 21 Jan 2006 16:28:03 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A15A16A41F for ; Sat, 21 Jan 2006 16:28:03 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6A6F43D4C for ; Sat, 21 Jan 2006 16:28:02 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGS2qh090219 for ; Sat, 21 Jan 2006 16:28:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGS2XU090216 for perforce@freebsd.org; Sat, 21 Jan 2006 16:28:02 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:28:02 GMT Message-Id: <200601211628.k0LGS2XU090216@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90105 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:28:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=90105 Change 90105 by rwatson@rwatson_sesame on 2006/01/21 16:27:16 When load_event_table() fails, cause the entire lookup to fail up front. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_mask.c#9 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_mask.c#9 (text+ko) ==== @@ -165,7 +165,10 @@ switch (flag) { case AU_PRS_REREAD: flush_cache(); - load_event_table(); + if (load_event_table() == -1) { + pthread_mutex_unlock(&mutex); + return (-1); + } ev = read_from_cache(event); break; case AU_PRS_USECACHE: From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:31:08 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B708616A422; Sat, 21 Jan 2006 16:31:07 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62BCE16A41F for ; Sat, 21 Jan 2006 16:31:07 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20BB143D49 for ; Sat, 21 Jan 2006 16:31:07 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGV7De090617 for ; Sat, 21 Jan 2006 16:31:07 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGV6Mh090614 for perforce@freebsd.org; Sat, 21 Jan 2006 16:31:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:31:06 GMT Message-Id: <200601211631.k0LGV6Mh090614@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90106 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:31:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=90106 Change 90106 by rwatson@rwatson_sesame on 2006/01/21 16:30:41 Always clear 'dptr' if the allocation of t fails in GET_TOKEN_AREA() to prevent accidents. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#31 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#31 (text+ko) ==== @@ -58,17 +58,17 @@ #include #define GET_TOKEN_AREA(t, dptr, length) do { \ - t = malloc (sizeof(token_t)); \ + t = malloc(sizeof(token_t)); \ if (t != NULL) { \ t->len = (length); \ - t->t_data = malloc ((length) * sizeof(u_char)); \ - if ((dptr = t->t_data) == NULL) { \ + dptr = t->t_data = malloc ((length) * sizeof(u_char)); \ + if (dptr == NULL) { \ free(t); \ t = NULL; \ } else \ memset(dptr, 0, (length)); \ - } \ - assert(t == NULL || dptr != NULL); \ + } else \ + dptr = NULL; \ } while (0) /* From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:33:11 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 92E3316A422; Sat, 21 Jan 2006 16:33:10 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AD0816A41F for ; Sat, 21 Jan 2006 16:33:10 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14DD543D4C for ; Sat, 21 Jan 2006 16:33:10 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGX9h9090785 for ; Sat, 21 Jan 2006 16:33:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGX9Us090781 for perforce@freebsd.org; Sat, 21 Jan 2006 16:33:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:33:09 GMT Message-Id: <200601211633.k0LGX9Us090781@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90107 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:33:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=90107 Change 90107 by rwatson@rwatson_sesame on 2006/01/21 16:32:55 Depend target. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/Makefile#6 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/Makefile#6 (text+ko) ==== @@ -13,6 +13,7 @@ all: default: +depend: clean: install: From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:34:12 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 52FAE16A422; Sat, 21 Jan 2006 16:34:12 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1551016A41F for ; Sat, 21 Jan 2006 16:34:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C761843D53 for ; Sat, 21 Jan 2006 16:34:11 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGYBId090894 for ; Sat, 21 Jan 2006 16:34:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGYBLW090891 for perforce@freebsd.org; Sat, 21 Jan 2006 16:34:11 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:34:11 GMT Message-Id: <200601211634.k0LGYBLW090891@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90108 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:34:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=90108 Change 90108 by rwatson@rwatson_sesame on 2006/01/21 16:33:34 Parenthesize macro arguments. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit_internal.h#6 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit_internal.h#6 (text+ko) ==== @@ -63,33 +63,33 @@ */ #define ADD_U_CHAR(loc, val) \ do { \ - *loc = val; \ - loc += sizeof(u_char); \ + *(loc) = (val); \ + (loc) += sizeof(u_char); \ } while(0) #define ADD_U_INT16(loc, val) \ do { \ - be16enc(loc, val); \ - loc += sizeof(u_int16_t); \ + be16enc((loc), (val)); \ + (loc) += sizeof(u_int16_t); \ } while(0) #define ADD_U_INT32(loc, val) \ do { \ - be32enc(loc, val); \ - loc += sizeof(u_int32_t); \ + be32enc((loc), (val)); \ + (loc) += sizeof(u_int32_t); \ } while(0) #define ADD_U_INT64(loc, val) \ do { \ - be64enc(loc, val); \ - loc += sizeof(u_int64_t); \ + be64enc((loc), (val)); \ + (loc) += sizeof(u_int64_t); \ } while(0) #define ADD_MEM(loc, data, size) \ do { \ - memcpy(loc, data, size); \ - loc += size; \ + memcpy((loc), (data), (size)); \ + (loc) += size; \ } while(0) #define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size) From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:40:24 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 28CF516A422; Sat, 21 Jan 2006 16:40:24 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC24D16A41F for ; Sat, 21 Jan 2006 16:40:23 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A2A4343D49 for ; Sat, 21 Jan 2006 16:40:23 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGeNkM091674 for ; Sat, 21 Jan 2006 16:40:23 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGeNUe091669 for perforce@freebsd.org; Sat, 21 Jan 2006 16:40:23 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:40:23 GMT Message-Id: <200601211640.k0LGeNUe091669@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90109 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:40:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=90109 Change 90109 by rwatson@rwatson_sesame on 2006/01/21 16:39:52 Re-add assertion for FlexeLint's benefit, it's still confused (or we still are). Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#32 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#32 (text+ko) ==== @@ -58,17 +58,18 @@ #include #define GET_TOKEN_AREA(t, dptr, length) do { \ - t = malloc(sizeof(token_t)); \ - if (t != NULL) { \ - t->len = (length); \ - dptr = t->t_data = malloc ((length) * sizeof(u_char)); \ - if (dptr == NULL) { \ + (t) = malloc(sizeof(token_t)); \ + if ((t) != NULL) { \ + (t)->len = (length); \ + (dptr) = (t->t_data) = malloc((length) * sizeof(u_char)); \ + if ((dptr) == NULL) { \ free(t); \ - t = NULL; \ + (t) = NULL; \ } else \ - memset(dptr, 0, (length)); \ + memset((dptr), 0, (length)); \ } else \ - dptr = NULL; \ + (dptr) = NULL; \ + assert(t == NULL || dptr != NULL); \ } while (0) /* From owner-p4-projects@FreeBSD.ORG Sat Jan 21 16:41:26 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DA83716A422; Sat, 21 Jan 2006 16:41:25 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9DA0716A41F for ; Sat, 21 Jan 2006 16:41:25 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 650EF43D49 for ; Sat, 21 Jan 2006 16:41:25 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LGfP8t091814 for ; Sat, 21 Jan 2006 16:41:25 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LGfPw9091811 for perforce@freebsd.org; Sat, 21 Jan 2006 16:41:25 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 16:41:25 GMT Message-Id: <200601211641.k0LGfPw9091811@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90110 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 16:41:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=90110 Change 90110 by rwatson@rwatson_sesame on 2006/01/21 16:40:47 Remove unneeded '&' on array. Submitted by: phk Found with: FlexeLint Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#26 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#26 (text+ko) ==== @@ -2255,7 +2255,7 @@ if (err) return (-1); } else if (tok->tt.subj32_ex.tid.type == AU_IPv6) { - READ_TOKEN_BYTES(buf, len, &tok->tt.subj32_ex.tid.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.subj32_ex.tid.addr, sizeof(tok->tt.subj32_ex.tid.addr), tok->len, err); if (err) return (-1); From owner-p4-projects@FreeBSD.ORG Sat Jan 21 22:12:22 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 719C616A422; Sat, 21 Jan 2006 22:12:22 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1879B16A41F for ; Sat, 21 Jan 2006 22:12:22 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C111343D45 for ; Sat, 21 Jan 2006 22:12:21 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LMCLeW028027 for ; Sat, 21 Jan 2006 22:12:21 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LMCL09028024 for perforce@freebsd.org; Sat, 21 Jan 2006 22:12:21 GMT (envelope-from wsalamon@computer.org) Date: Sat, 21 Jan 2006 22:12:21 GMT Message-Id: <200601212212.k0LMCL09028024@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 90132 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 22:12:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=90132 Change 90132 by wsalamon@gretsch on 2006/01/21 22:11:21 Add the AUE_NMOUNT event for the nmount() system call. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit_kevents.h#26 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit_kevents.h#26 (text+ko) ==== @@ -355,6 +355,7 @@ #define AUE_KQUEUE 377 /* FreeBSD */ #define AUE_KEVENT 378 /* FreeBSD */ #define AUE_FSYNC 379 +#define AUE_NMOUNT 380 /* FreeBSD */ /* * XXXRW: Values not yet assigned. From owner-p4-projects@FreeBSD.ORG Sat Jan 21 22:30:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2D71516A422; Sat, 21 Jan 2006 22:30:45 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF74B16A41F for ; Sat, 21 Jan 2006 22:30:44 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E98F43D46 for ; Sat, 21 Jan 2006 22:30:44 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LMUiq6028937 for ; Sat, 21 Jan 2006 22:30:44 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LMUh25028933 for perforce@freebsd.org; Sat, 21 Jan 2006 22:30:43 GMT (envelope-from wsalamon@computer.org) Date: Sat, 21 Jan 2006 22:30:43 GMT Message-Id: <200601212230.k0LMUh25028933@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 90133 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 22:30:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=90133 Change 90133 by wsalamon@gretsch on 2006/01/21 22:29:50 Integrate the recent changes in the OpenBSM branch into audit3, picking up more FlexeLint changes and the AUE_NMOUNT event. Affected files ... .. //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/Makefile#3 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/audit_internal.h#4 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/audit_kevents.h#12 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_audit.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_class.c#6 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_control.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_event.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_flags.c#6 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_io.c#7 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_mask.c#5 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_token.c#7 integrate .. //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_wrappers.c#4 integrate Differences ... ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/Makefile#3 (text+ko) ==== @@ -13,6 +13,7 @@ all: default: +depend: clean: install: ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/audit_internal.h#4 (text+ko) ==== @@ -63,33 +63,33 @@ */ #define ADD_U_CHAR(loc, val) \ do { \ - *loc = val; \ - loc += sizeof(u_char); \ + *(loc) = (val); \ + (loc) += sizeof(u_char); \ } while(0) #define ADD_U_INT16(loc, val) \ do { \ - be16enc(loc, val); \ - loc += sizeof(u_int16_t); \ + be16enc((loc), (val)); \ + (loc) += sizeof(u_int16_t); \ } while(0) #define ADD_U_INT32(loc, val) \ do { \ - be32enc(loc, val); \ - loc += sizeof(u_int32_t); \ + be32enc((loc), (val)); \ + (loc) += sizeof(u_int32_t); \ } while(0) #define ADD_U_INT64(loc, val) \ do { \ - be64enc(loc, val); \ - loc += sizeof(u_int64_t); \ + be64enc((loc), (val)); \ + (loc) += sizeof(u_int64_t); \ } while(0) #define ADD_MEM(loc, data, size) \ do { \ - memcpy(loc, data, size); \ - loc += size; \ + memcpy((loc), (data), (size)); \ + (loc) += size; \ } while(0) #define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size) ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/bsm/audit_kevents.h#12 (text+ko) ==== @@ -355,6 +355,7 @@ #define AUE_KQUEUE 377 /* FreeBSD */ #define AUE_KEVENT 378 /* FreeBSD */ #define AUE_FSYNC 379 +#define AUE_NMOUNT 380 /* FreeBSD */ /* * XXXRW: Values not yet assigned. ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_audit.c#5 (text+ko) ==== @@ -237,7 +237,7 @@ token_t *tok; /* Free the token list */ - while ((tok = TAILQ_FIRST(&rec->token_q))) { + while ((tok = TAILQ_FIRST(&rec->token_q)) != NULL) { TAILQ_REMOVE(&rec->token_q, tok, tokens); free(tok->t_data); free(tok); ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_class.c#6 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_class file to return struct au_class_ent * entries. */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *classdelim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -50,15 +50,15 @@ * au_class_ent elements; store the result in c. */ static struct au_class_ent * -classfromstr(char *str, char *delim, struct au_class_ent *c) +classfromstr(char *str, struct au_class_ent *c) { char *classname, *classdesc, *classflag; char *last; /* Each line contains flag:name:desc. */ - classflag = strtok_r(str, delim, &last); - classname = strtok_r(NULL, delim, &last); - classdesc = strtok_r(NULL, delim, &last); + classflag = strtok_r(str, classdelim, &last); + classname = strtok_r(NULL, classdelim, &last); + classdesc = strtok_r(NULL, classdelim, &last); if ((classflag == NULL) || (classname == NULL) || (classdesc == NULL)) return (NULL); @@ -113,7 +113,7 @@ tokptr = linestr; /* Parse tokptr to au_class_ent components. */ - if (classfromstr(tokptr, delim, c) == NULL) + if (classfromstr(tokptr, c) == NULL) return (NULL); return (c); ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_control.c#5 (text+ko) ==== @@ -94,8 +94,6 @@ } } } - - return (0); /* EOF */ } /* ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_event.c#5 (text+ko) ==== @@ -39,9 +39,9 @@ * Parse the contents of the audit_event file to return * au_event_ent entries */ -static FILE *fp = NULL; -static char linestr[AU_LINE_MAX]; -static char *delim = ":"; +static FILE *fp = NULL; +static char linestr[AU_LINE_MAX]; +static const char *eventdelim = ":"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -49,16 +49,16 @@ * Parse one line from the audit_event file into the au_event_ent structure. */ static struct au_event_ent * -eventfromstr(char *str, char *delim, struct au_event_ent *e) +eventfromstr(char *str, struct au_event_ent *e) { char *evno, *evname, *evdesc, *evclass; struct au_mask evmask; char *last; - evno = strtok_r(str, delim, &last); - evname = strtok_r(NULL, delim, &last); - evdesc = strtok_r(NULL, delim, &last); - evclass = strtok_r(NULL, delim, &last); + evno = strtok_r(str, eventdelim, &last); + evname = strtok_r(NULL, eventdelim, &last); + evdesc = strtok_r(NULL, eventdelim, &last); + evclass = strtok_r(NULL, eventdelim, &last); if ((evno == NULL) || (evname == NULL) || (evdesc == NULL) || (evclass == NULL)) @@ -144,7 +144,7 @@ * XXXRW: Perhaps we should keep reading lines until we find a valid * one, rather than stopping when we hit an invalid one? */ - if (eventfromstr(linestr, delim, e) == NULL) + if (eventfromstr(linestr, e) == NULL) return (NULL); return (e); @@ -200,7 +200,7 @@ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; - if (eventfromstr(linestr, delim, e) != NULL) { + if (eventfromstr(linestr, e) != NULL) { if (strcmp(name, e->ae_name) == 0) return (e); } @@ -254,7 +254,7 @@ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; - if (eventfromstr(linestr, delim, e) != NULL) { + if (eventfromstr(linestr, e) != NULL) { if (event_number == e->ae_number) return (e); } ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_flags.c#6 (text+ko) ==== @@ -34,7 +34,7 @@ #include #include -static const char *delim = ","; +static const char *flagdelim = ","; /* * Convert the character representation of audit values into the au_mask_t @@ -45,17 +45,11 @@ { char class_ent_name[AU_CLASS_NAME_MAX]; char class_ent_desc[AU_CLASS_DESC_MAX]; - struct au_class_ent c, *cp; + struct au_class_ent c; char *tok; char sel, sub; char *last; - - if ((auditstr == NULL) || (masks == NULL)) { - errno = EINVAL; - return (-1); - } - bzero(&c, sizeof(c)); bzero(class_ent_name, sizeof(class_ent_name)); bzero(class_ent_desc, sizeof(class_ent_desc)); @@ -65,7 +59,7 @@ masks->am_success = 0; masks->am_failure = 0; - tok = strtok_r(auditstr, delim, &last); + tok = strtok_r(auditstr, flagdelim, &last); while (tok != NULL) { /* Check for the events that should not be audited. */ if (tok[0] == '^') { @@ -84,7 +78,7 @@ } else sel = AU_PRS_BOTH; - if ((cp = getauclassnam_r(&c, tok)) != NULL) { + if ((getauclassnam_r(&c, tok)) != NULL) { if (sub) SUB_FROM_MASK(masks, c.ac_class, sel); else @@ -95,7 +89,7 @@ } /* Get the next class. */ - tok = strtok_r(NULL, delim, &last); + tok = strtok_r(NULL, flagdelim, &last); } return (0); } @@ -118,15 +112,10 @@ { char class_ent_name[AU_CLASS_NAME_MAX]; char class_ent_desc[AU_CLASS_DESC_MAX]; - struct au_class_ent c, *cp; + struct au_class_ent c; char *strptr = auditstr; u_char sel; - if ((auditstr == NULL) || (masks == NULL)) { - return (EINVAL); - return (-1); - } - bzero(&c, sizeof(c)); bzero(class_ent_name, sizeof(class_ent_name)); bzero(class_ent_desc, sizeof(class_ent_desc)); @@ -138,7 +127,7 @@ * the success or failure masks. */ setauclass(); - while ((cp = getauclassent_r(&c)) != NULL) { + while ((getauclassent_r(&c)) != NULL) { sel = 0; /* Dont do anything for class = no. */ ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_io.c#7 (text+ko) ==== @@ -97,11 +97,11 @@ } while (0) #define SET_PTR(buf, len, ptr, size, bytesread, err) do { \ - if (bytesread + size > len) \ - err = 1; \ + if ((bytesread) + (size) > (len)) \ + (err) = 1; \ else { \ - ptr = buf + bytesread; \ - bytesread += size; \ + (ptr) = (buf) + (bytesread); \ + (bytesread) += (size); \ } \ } while (0) @@ -109,7 +109,7 @@ * Prints the delimiter string. */ static void -print_delim(FILE *fp, char *del) +print_delim(FILE *fp, const char *del) { fprintf(fp, "%s", del); @@ -288,14 +288,14 @@ static void print_sec32(FILE *fp, u_int32_t sec, char raw) { - time_t time; + time_t timestamp; char timestr[26]; if (raw) fprintf(fp, "%u", sec); else { - time = (time_t)sec; - ctime_r(&time, timestr); + timestamp = (time_t)sec; + ctime_r(×tamp, timestr); timestr[24] = '\0'; /* No new line */ fprintf(fp, "%s", timestr); } @@ -308,14 +308,14 @@ static void print_sec64(FILE *fp, u_int64_t sec, char raw) { - time_t time; + time_t timestamp; char timestr[26]; if (raw) fprintf(fp, "%u", (u_int32_t)sec); else { - time = (time_t)sec; - ctime_r(&time, timestr); + timestamp = (time_t)sec; + ctime_r(×tamp, timestr); timestr[24] = '\0'; /* No new line */ fprintf(fp, "%s", timestr); } @@ -369,12 +369,12 @@ struct in_addr ipv4; struct in6_addr ipv6; char dst[INET6_ADDRSTRLEN]; - const char *ret = NULL; switch (type) { case AU_IPv4: ipv4.s_addr = (in_addr_t)(ipaddr[0]); - ret = inet_ntop(AF_INET, &ipv4, dst, INET6_ADDRSTRLEN); + fprintf(fp, "%s", inet_ntop(AF_INET, &ipv4, dst, + INET6_ADDRSTRLEN)); break; case AU_IPv6: @@ -382,13 +382,12 @@ ipv6.__u6_addr.__u6_addr32[1] = ipaddr[1]; ipv6.__u6_addr.__u6_addr32[2] = ipaddr[2]; ipv6.__u6_addr.__u6_addr32[3] = ipaddr[3]; - ret = inet_ntop(AF_INET6, &ipv6, dst, INET6_ADDRSTRLEN); + fprintf(fp, "%s", inet_ntop(AF_INET6, &ipv6, dst, + INET6_ADDRSTRLEN)); break; - } - if (ret != NULL) { - fprintf(fp, "%s", ret); - /* XXX Is ret heap memory? Leaked if so */ + default: + fprintf(fp, "invalid"); } } @@ -696,7 +695,7 @@ break; case AU_IPv6: - READ_TOKEN_BYTES(buf, len, &tok->tt.hdr64_ex.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.hdr64_ex.addr, sizeof(tok->tt.hdr64_ex.addr), tok->len, err); break; } @@ -755,7 +754,8 @@ } static void -print_trailer_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_trailer_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "trailer", raw); @@ -795,7 +795,8 @@ } static void -print_arg32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_arg32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "argument", raw); @@ -833,7 +834,8 @@ } static void -print_arg64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_arg64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "argument", raw); @@ -898,7 +900,8 @@ } static void -print_arb_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_arb_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { char *str; char *format; @@ -1022,7 +1025,8 @@ } static void -print_attr32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_attr32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "attribute", raw); @@ -1081,7 +1085,8 @@ } static void -print_attr64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_attr64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "attribute", raw); @@ -1120,7 +1125,8 @@ } static void -print_exit_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_exit_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "exit", raw); @@ -1134,7 +1140,8 @@ * count 4 bytes * text count null-terminated string(s) */ -static int fetch_execarg_tok(tokenstr_t *tok, char *buf, int len) +static int +fetch_execarg_tok(tokenstr_t *tok, char *buf, int len) { int err = 0; int i; @@ -1144,7 +1151,7 @@ if (err) return (-1); - for (i = 0; i< tok->tt.execarg.count; i++) { + for (i = 0; i < tok->tt.execarg.count; i++) { bptr = buf + tok->len; tok->tt.execarg.text[i] = bptr; @@ -1163,7 +1170,8 @@ } static void -print_execarg_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_execarg_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { int i; @@ -1209,7 +1217,8 @@ } static void -print_execenv_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_execenv_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { int i; @@ -1252,7 +1261,8 @@ } static void -print_file_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_file_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "file", raw); @@ -1289,7 +1299,8 @@ } static void -print_newgroups_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_newgroups_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { int i; @@ -1317,7 +1328,8 @@ } static void -print_inaddr_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_inaddr_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip addr", raw); @@ -1344,7 +1356,7 @@ if (err) return (-1); } else if (tok->tt.inaddr_ex.type == AU_IPv6) { - READ_TOKEN_BYTES(buf, len, &tok->tt.inaddr_ex.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.inaddr_ex.addr, sizeof(tok->tt.inaddr_ex.addr), tok->len, err); if (err) return (-1); @@ -1355,7 +1367,8 @@ } static void -print_inaddr_ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_inaddr_ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip addr ex", raw); @@ -1418,7 +1431,8 @@ } static void -print_ip_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_ip_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip", raw); @@ -1465,7 +1479,8 @@ } static void -print_ipc_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_ipc_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "IPC", raw); @@ -1521,7 +1536,8 @@ } static void -print_ipcperm_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_ipcperm_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "IPC perm", raw); @@ -1557,7 +1573,8 @@ } static void -print_iport_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_iport_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "ip port", raw); @@ -1587,7 +1604,8 @@ } static void -print_opaque_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_opaque_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "opaque", raw); @@ -1618,7 +1636,8 @@ } static void -print_path_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_path_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "path", raw); @@ -1684,7 +1703,8 @@ } static void -print_process32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_process32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "process", raw); @@ -1757,7 +1777,7 @@ if (err) return (-1); } else if (tok->tt.proc32_ex.tid.type == AU_IPv6) { - READ_TOKEN_BYTES(buf, len, &tok->tt.proc32_ex.tid.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.proc32_ex.tid.addr, sizeof(tok->tt.proc32_ex.tid.addr), tok->len, err); if (err) return (-1); @@ -1769,7 +1789,7 @@ static void print_process32ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "process_ex", raw); @@ -1815,7 +1835,8 @@ } static void -print_return32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_return32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "return", raw); @@ -1842,7 +1863,8 @@ } static void -print_return64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_return64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "return", raw); @@ -1868,7 +1890,8 @@ } static void -print_seq_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_seq_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "sequence", raw); @@ -1905,7 +1928,7 @@ static void print_sock_inet32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, -char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "socket-inet", raw); @@ -1929,7 +1952,7 @@ if (err) return (-1); - READ_TOKEN_BYTES(buf, len, &tok->tt.sockunix.path, 104, tok->len, + READ_TOKEN_BYTES(buf, len, tok->tt.sockunix.path, 104, tok->len, err); if (err) return (-1); @@ -1939,7 +1962,7 @@ static void print_sock_unix_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "socket-unix", raw); @@ -1987,7 +2010,8 @@ } static void -print_socket_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_socket_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "socket", raw); @@ -2061,7 +2085,8 @@ } static void -print_subject32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_subject32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "subject", raw); @@ -2143,7 +2168,8 @@ } static void -print_subject64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_subject64_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "subject", raw); @@ -2229,7 +2255,7 @@ if (err) return (-1); } else if (tok->tt.subj32_ex.tid.type == AU_IPv6) { - READ_TOKEN_BYTES(buf, len, &tok->tt.subj32_ex.tid.addr, + READ_TOKEN_BYTES(buf, len, tok->tt.subj32_ex.tid.addr, sizeof(tok->tt.subj32_ex.tid.addr), tok->len, err); if (err) return (-1); @@ -2241,7 +2267,7 @@ static void print_subject32ex_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "subject_ex", raw); @@ -2288,7 +2314,8 @@ } static void -print_text_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_text_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "text", raw); @@ -2350,7 +2377,7 @@ static void print_socketex32_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, - char sfrm) + __unused char sfrm) { print_tok_type(fp, tok->id, "socket", raw); @@ -2372,7 +2399,7 @@ int err = 0; int recoversize; - recoversize = len - tok->len - BSM_TRAILER_SIZE; + recoversize = len - (tok->len + BSM_TRAILER_SIZE); if (recoversize <= 0) return (-1); @@ -2386,7 +2413,8 @@ } static void -print_invalid_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, char sfrm) +print_invalid_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, + __unused char sfrm) { print_tok_type(fp, tok->id, "unknown", raw); @@ -2569,6 +2597,7 @@ case AUT_ATTR64: print_attr64_tok(outfp, tok, del, raw, sfrm); + return; case AUT_EXIT: print_exit_tok(outfp, tok, del, raw, sfrm); @@ -2737,7 +2766,7 @@ bptr += sizeof(u_int32_t); /* now read remaining record bytes */ - bytestoread = recsize - sizeof(u_int32_t) - sizeof(u_char); + bytestoread = recsize - (sizeof(u_int32_t) + sizeof(u_char)); if (fread(bptr, 1, bytestoread, fp) < bytestoread) { free(*buf); ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_mask.c#5 (text+ko) ==== @@ -165,7 +165,10 @@ switch (flag) { case AU_PRS_REREAD: flush_cache(); - load_event_table(); + if (load_event_table() == -1) { + pthread_mutex_unlock(&mutex); + return (-1); + } ev = read_from_cache(event); break; case AU_PRS_USECACHE: ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_token.c#7 (text+ko) ==== @@ -47,6 +47,7 @@ #include #include +#include #include #include #include @@ -57,16 +58,18 @@ #include #define GET_TOKEN_AREA(t, dptr, length) do { \ - t = malloc (sizeof(token_t)); \ - if (t != NULL) { \ - t->len = (length); \ - t->t_data = malloc ((length) * sizeof(u_char)); \ - if ((dptr = t->t_data) == NULL) { \ + (t) = malloc(sizeof(token_t)); \ + if ((t) != NULL) { \ + (t)->len = (length); \ + (dptr) = (t->t_data) = malloc((length) * sizeof(u_char)); \ + if ((dptr) == NULL) { \ free(t); \ - t = NULL; \ + (t) = NULL; \ } else \ - memset(dptr, 0, (length)); \ - } \ + memset((dptr), 0, (length)); \ + } else \ + (dptr) = NULL; \ + assert(t == NULL || dptr != NULL); \ } while (0) /* @@ -628,8 +631,9 @@ } token_t * -au_to_process64(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, - pid_t pid, au_asid_t sid, au_tid_t *tid) +au_to_process64(__unused au_id_t auid, __unused uid_t euid, + __unused gid_t egid, __unused uid_t ruid, __unused gid_t rgid, + __unused pid_t pid, __unused au_asid_t sid, __unused au_tid_t *tid) { errno = ENOTSUP; @@ -637,8 +641,9 @@ } token_t * -au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, - pid_t pid, au_asid_t sid, au_tid_t *tid) +au_to_process(__unused au_id_t auid, __unused uid_t euid, + __unused gid_t egid, __unused uid_t ruid, __unused gid_t rgid, + __unused pid_t pid, __unused au_asid_t sid, __unused au_tid_t *tid) { return (au_to_process32(auid, euid, egid, ruid, rgid, pid, sid, @@ -1172,7 +1177,8 @@ } token_t * -au_to_header64(int rec_size, au_event_t e_type, au_emod_t e_mod) +au_to_header64(__unused int rec_size, __unused au_event_t e_type, + __unused au_emod_t e_mod) { errno = ENOTSUP; ==== //depot/projects/trustedbsd/audit3/contrib/openbsm/libbsm/bsm_wrappers.c#4 (text+ko) ==== @@ -34,7 +34,6 @@ #include #include -#include #include #include From owner-p4-projects@FreeBSD.ORG Sat Jan 21 22:39:57 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A71AF16A422; Sat, 21 Jan 2006 22:39:56 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 685F116A41F for ; Sat, 21 Jan 2006 22:39:56 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1606543D53 for ; Sat, 21 Jan 2006 22:39:56 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LMdtNS029187 for ; Sat, 21 Jan 2006 22:39:55 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LMdtqr029184 for perforce@freebsd.org; Sat, 21 Jan 2006 22:39:55 GMT (envelope-from wsalamon@computer.org) Date: Sat, 21 Jan 2006 22:39:55 GMT Message-Id: <200601212239.k0LMdtqr029184@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 90134 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 22:39:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=90134 Change 90134 by wsalamon@gretsch on 2006/01/21 22:39:29 Integrate recent changes from the OpenBSM branch, via contrib/openbsm, into the kernel headers. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/bsm/Makefile#1 branch .. //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#18 integrate .. //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#4 integrate .. //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#13 integrate .. //depot/projects/trustedbsd/audit3/sys/bsm/audit_uevents.h#1 branch .. //depot/projects/trustedbsd/audit3/sys/bsm/libbsm.h#1 branch Differences ... ==== //depot/projects/trustedbsd/audit3/sys/bsm/audit.h#18 (text+ko) ==== @@ -41,7 +41,7 @@ #define AUDIT_RECORD_MAGIC 0x828a0f1b #define MAX_AUDIT_RECORDS 20 #define MAX_AUDIT_RECORD_SIZE 4096 -#define MIN_AUDIT_FILE_SIZE 512 * 1024 +#define MIN_AUDIT_FILE_SIZE (512 * 1024) /* The special device filename */ #define AUDITDEV_FILENAME "audit" ==== //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#4 (text+ko) ==== @@ -63,33 +63,33 @@ */ #define ADD_U_CHAR(loc, val) \ do { \ - *loc = val; \ - loc += sizeof(u_char); \ + *(loc) = (val); \ + (loc) += sizeof(u_char); \ } while(0) #define ADD_U_INT16(loc, val) \ do { \ - be16enc(loc, val); \ - loc += sizeof(u_int16_t); \ + be16enc((loc), (val)); \ + (loc) += sizeof(u_int16_t); \ } while(0) #define ADD_U_INT32(loc, val) \ do { \ - be32enc(loc, val); \ - loc += sizeof(u_int32_t); \ + be32enc((loc), (val)); \ + (loc) += sizeof(u_int32_t); \ } while(0) #define ADD_U_INT64(loc, val) \ do { \ - be64enc(loc, val); \ - loc += sizeof(u_int64_t); \ + be64enc((loc), (val)); \ + (loc) += sizeof(u_int64_t); \ } while(0) #define ADD_MEM(loc, data, size) \ do { \ - memcpy(loc, data, size); \ - loc += size; \ + memcpy((loc), (data), (size)); \ + (loc) += size; \ } while(0) #define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size) ==== //depot/projects/trustedbsd/audit3/sys/bsm/audit_kevents.h#13 (text+ko) ==== @@ -355,6 +355,7 @@ #define AUE_KQUEUE 377 /* FreeBSD */ #define AUE_KEVENT 378 /* FreeBSD */ #define AUE_FSYNC 379 +#define AUE_NMOUNT 380 /* FreeBSD */ /* * XXXRW: Values not yet assigned. From owner-p4-projects@FreeBSD.ORG Sat Jan 21 23:08:32 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DFD7C16A422; Sat, 21 Jan 2006 23:08:31 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B623E16A41F for ; Sat, 21 Jan 2006 23:08:31 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 438B543D46 for ; Sat, 21 Jan 2006 23:08:31 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LN8Vge030518 for ; Sat, 21 Jan 2006 23:08:31 GMT (envelope-from soc-andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LN8UIr030515 for perforce@freebsd.org; Sat, 21 Jan 2006 23:08:30 GMT (envelope-from soc-andrew@freebsd.org) Date: Sat, 21 Jan 2006 23:08:30 GMT Message-Id: <200601212308.k0LN8UIr030515@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-andrew@freebsd.org using -f From: soc-andrew To: Perforce Change Reviews Cc: Subject: PERFORCE change 90136 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 23:08:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=90136 Change 90136 by soc-andrew@soc-andrew_serv on 2006/01/21 23:07:34 Move the release.[89] targets around Increase the root image size Affected files ... .. //depot/projects/soc2005/bsdinstaller/src/release/Makefile#25 edit Differences ... ==== //depot/projects/soc2005/bsdinstaller/src/release/Makefile#25 (text+ko) ==== @@ -709,9 +709,9 @@ .endif touch ${.TARGET} -.if !defined(BSDINSTALLER) # Build the memory root filesystem. release.8: +.if !defined(BSDINSTALLER) cp ${RD}/trees/base/etc/disktab /etc rm -rf ${RD}/mfsfd mkdir ${RD}/mfsfd @@ -774,8 +774,12 @@ @gzip -9fnv ${RD}/mfsroot/mfsroot touch ${.TARGET} .else + @true +.endif + # Build the BSD Installer mfs images -release.8: +release.9: +.if defined(BSDINSTALLER) rm -rf ${RD}/bsdinstaller mkdir ${RD}/bsdinstaller ( for dir in root usr var ; do \ @@ -818,9 +822,11 @@ pwd_mkdb -p -d ${RD}/bsdinstaller/root/etc \ ${RD}/bsdinstaller/master.passwd sh -e ${DOFS_SH} ${RD}/bsdinstaller/mfsroot ${RD} ${MNT} \ - 10000 ${RD}/bsdinstaller/root ${MFSINODE} auto + 20000 ${RD}/bsdinstaller/root ${MFSINODE} auto @gzip -9fnv ${RD}/bsdinstaller/mfsroot touch ${.TARGET} +.else + @true .endif KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz @@ -1192,7 +1198,7 @@ ) doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \ - release.5 release.6 release.7 release.8 ${EXTRAS} + release.5 release.6 release.7 release.8 release.9 ${EXTRAS} @echo "Release done" floppies: