From owner-svn-src-all@freebsd.org Sun Aug 2 00:03:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B019B1815; Sun, 2 Aug 2015 00:03:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C36671940; Sun, 2 Aug 2015 00:03:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7203BST014334; Sun, 2 Aug 2015 00:03:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72039mS014328; Sun, 2 Aug 2015 00:03:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020003.t72039mS014328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286166 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:03:12 -0000 Author: markj Date: Sun Aug 2 00:03:08 2015 New Revision: 286166 URL: https://svnweb.freebsd.org/changeset/base/286166 Log: Don't modify curthread->td_locks unless INVARIANTS is enabled. This field is only used in a KASSERT that verifies that no locks are held when returning to user mode. Moreover, the td_locks accounting is only correct when LOCK_DEBUG > 0, which is implied by INVARIANTS. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3205 Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rmlock.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/proc.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_lock.c Sun Aug 2 00:03:08 2015 (r286166) @@ -69,12 +69,8 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & #ifndef INVARIANTS #define _lockmgr_assert(lk, what, file, line) -#define TD_LOCKS_INC(td) -#define TD_LOCKS_DEC(td) -#else -#define TD_LOCKS_INC(td) ((td)->td_locks++) -#define TD_LOCKS_DEC(td) ((td)->td_locks--) #endif + #define TD_SLOCKS_INC(td) ((td)->td_lk_slocks++) #define TD_SLOCKS_DEC(td) ((td)->td_lk_slocks--) Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_mutex.c Sun Aug 2 00:03:08 2015 (r286166) @@ -224,7 +224,7 @@ __mtx_lock_flags(volatile uintptr_t *c, line); WITNESS_LOCK(&m->lock_object, (opts & ~MTX_RECURSE) | LOP_EXCLUSIVE, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } void @@ -248,7 +248,7 @@ __mtx_unlock_flags(volatile uintptr_t *c mtx_assert(m, MA_OWNED); __mtx_unlock(m, curthread, opts, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } void @@ -347,7 +347,7 @@ _mtx_trylock_flags_(volatile uintptr_t * if (rval) { WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); if (m->mtx_recurse == 0) LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, waittime, file, line); @@ -958,7 +958,7 @@ _mtx_destroy(volatile uintptr_t *c) if (LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin) spinlock_exit(); else - curthread->td_locks--; + TD_LOCKS_DEC(curthread); lock_profile_release_lock(&m->lock_object); /* Tell witness this isn't locked to make it happy. */ Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_rmlock.c Sun Aug 2 00:03:08 2015 (r286166) @@ -608,11 +608,8 @@ _rm_wlock_debug(struct rmlock *rm, const _rm_wlock(rm); LOCK_LOG_LOCK("RMWLOCK", &rm->lock_object, 0, 0, file, line); - WITNESS_LOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); - - curthread->td_locks++; - + TD_LOCKS_INC(curthread); } void @@ -628,7 +625,7 @@ _rm_wunlock_debug(struct rmlock *rm, con WITNESS_UNLOCK(&rm->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("RMWUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_wunlock(rm); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } int @@ -670,9 +667,7 @@ _rm_rlock_debug(struct rmlock *rm, struc LOCK_LOG_LOCK("RMRLOCK", &rm->lock_object, 0, 0, file, line); WITNESS_LOCK(&rm->lock_object, 0, file, line); - - curthread->td_locks++; - + TD_LOCKS_INC(curthread); return (1); } else if (trylock) LOCK_LOG_TRY("RMRLOCK", &rm->lock_object, 0, 0, file, line); @@ -694,7 +689,7 @@ _rm_runlock_debug(struct rmlock *rm, str WITNESS_UNLOCK(&rm->lock_object, 0, file, line); LOCK_LOG_LOCK("RMRUNLOCK", &rm->lock_object, 0, 0, file, line); _rm_runlock(rm, tracker); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } #else Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_rwlock.c Sun Aug 2 00:03:08 2015 (r286166) @@ -268,7 +268,7 @@ _rw_wlock_cookie(volatile uintptr_t *c, __rw_wlock(rw, curthread, file, line); LOCK_LOG_LOCK("WLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line); WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } int @@ -303,7 +303,7 @@ __rw_try_wlock(volatile uintptr_t *c, co if (!rw_recursed(rw)) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line, LOCKSTAT_WRITER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (rval); } @@ -325,8 +325,9 @@ _rw_wunlock_cookie(volatile uintptr_t *c LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line); __rw_wunlock(rw, curthread, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } + /* * Determines whether a new reader can acquire a lock. Succeeds if the * reader already owns a read lock and the lock is locked for read to @@ -565,7 +566,7 @@ __rw_rlock(volatile uintptr_t *c, const waittime, file, line, LOCKSTAT_READER); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); curthread->td_rw_rlocks++; } @@ -596,7 +597,7 @@ __rw_try_rlock(volatile uintptr_t *c, co WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line); LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line, LOCKSTAT_READER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); curthread->td_rw_rlocks++; return (1); } @@ -714,7 +715,7 @@ _rw_runlock_cookie(volatile uintptr_t *c break; } LOCKSTAT_PROFILE_RELEASE_RWLOCK(rw__release, rw, LOCKSTAT_READER); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); curthread->td_rw_rlocks--; } Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/kern/kern_sx.c Sun Aug 2 00:03:08 2015 (r286166) @@ -261,7 +261,7 @@ _sx_slock(struct sx *sx, int opts, const if (!error) { LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); WITNESS_LOCK(&sx->lock_object, 0, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (error); @@ -290,7 +290,7 @@ sx_try_slock_(struct sx *sx, const char WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line); LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line, LOCKSTAT_READER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); return (1); } } @@ -318,7 +318,7 @@ _sx_xlock(struct sx *sx, int opts, const LOCK_LOG_LOCK("XLOCK", &sx->lock_object, 0, sx->sx_recurse, file, line); WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (error); @@ -353,7 +353,7 @@ sx_try_xlock_(struct sx *sx, const char if (!sx_recursed(sx)) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line, LOCKSTAT_WRITER); - curthread->td_locks++; + TD_LOCKS_INC(curthread); } return (rval); @@ -371,7 +371,7 @@ _sx_sunlock(struct sx *sx, const char *f WITNESS_UNLOCK(&sx->lock_object, 0, file, line); LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); __sx_sunlock(sx, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } void @@ -387,7 +387,7 @@ _sx_xunlock(struct sx *sx, const char *f LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, line); __sx_xunlock(sx, curthread, file, line); - curthread->td_locks--; + TD_LOCKS_DEC(curthread); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Aug 1 23:10:36 2015 (r286165) +++ head/sys/sys/proc.h Sun Aug 2 00:03:08 2015 (r286166) @@ -238,7 +238,7 @@ struct thread { int td_oncpu; /* (t) Which cpu we are on. */ volatile u_char td_owepreempt; /* (k*) Preempt on last critical_exit */ u_char td_tsqueue; /* (t) Turnstile queue blocked on. */ - short td_locks; /* (k) Count of non-spin locks. */ + short td_locks; /* (k) Debug: count of non-spin locks */ short td_rw_rlocks; /* (k) Count of rwlock read locks. */ short td_lk_slocks; /* (k) Count of lockmgr shared locks. */ short td_stopsched; /* (k) Scheduler stopped. */ @@ -351,8 +351,14 @@ do { \ KASSERT((__m == &blocked_lock || __m == (lock)), \ ("Thread %p lock %p does not match %p", td, __m, (lock))); \ } while (0) + +#define TD_LOCKS_INC(td) ((td)->td_locks++) +#define TD_LOCKS_DEC(td) ((td)->td_locks--) #else #define THREAD_LOCKPTR_ASSERT(td, lock) + +#define TD_LOCKS_INC(td) +#define TD_LOCKS_DEC(td) #endif /* From owner-svn-src-all@freebsd.org Sun Aug 2 00:11:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D04C9B198E; Sun, 2 Aug 2015 00:11:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 737BF1E2D; Sun, 2 Aug 2015 00:11:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720BvlN018595; Sun, 2 Aug 2015 00:11:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720Bvei018594; Sun, 2 Aug 2015 00:11:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020011.t720Bvei018594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286167 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:11:57 -0000 Author: markj Date: Sun Aug 2 00:11:56 2015 New Revision: 286167 URL: https://svnweb.freebsd.org/changeset/base/286167 Log: Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context. When a process is exiting, there is a narrow window where p_cred may be NULL while its threads are still executing. Specifically, the last thread to exit a process sets the process state to PRS_ZOMBIE with the proc spinlock held and then calls thread_exit(). thread_exit() drops the spin lock, permitting the process to be reaped and thus causing its cred struct to be released. However, the exiting thread may still cause DTrace probes to fire by calling sched_throw(), resulting in a double fault if such a probe enabling attempts to access the GID or UID DIF variables. The thread's cred reference is not susceptible to this race since it is not released until after the thread has exited. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Aug 2 00:03:08 2015 (r286166) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sun Aug 2 00:11:56 2015 (r286167) @@ -3510,7 +3510,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU)) return ((uint64_t)p0.p_cred->cr_uid); -#endif /* * It is always safe to dereference one's own t_procp pointer: @@ -3522,6 +3521,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst * credential, since this is never NULL after process birth. */ return ((uint64_t)curthread->t_procp->p_cred->cr_uid); +#else + return ((uint64_t)curthread->td_ucred->cr_uid); +#endif case DIF_VAR_GID: if (!dtrace_priv_proc(state)) @@ -3533,7 +3535,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU)) return ((uint64_t)p0.p_cred->cr_gid); -#endif /* * It is always safe to dereference one's own t_procp pointer: @@ -3545,6 +3546,9 @@ dtrace_dif_variable(dtrace_mstate_t *mst * credential, since this is never NULL after process birth. */ return ((uint64_t)curthread->t_procp->p_cred->cr_gid); +#else + return ((uint64_t)curthread->td_ucred->cr_gid); +#endif case DIF_VAR_ERRNO: { #ifdef illumos From owner-svn-src-all@freebsd.org Sun Aug 2 00:15:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4F339B19CF; Sun, 2 Aug 2015 00:15:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2C8C1FD3; Sun, 2 Aug 2015 00:15:53 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720FrlQ018930; Sun, 2 Aug 2015 00:15:53 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720Fr6R018929; Sun, 2 Aug 2015 00:15:53 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508020015.t720Fr6R018929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 00:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286168 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:15:54 -0000 Author: jmg Date: Sun Aug 2 00:15:52 2015 New Revision: 286168 URL: https://svnweb.freebsd.org/changeset/base/286168 Log: convert to C11's _Static_assert, and pull in sys/cdefs.h for compatibility w/ older non-C11 compilers... passed make tinerdbox.. Suggested by: imp Modified: head/sys/net/pfkeyv2.h Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Sun Aug 2 00:11:56 2015 (r286167) +++ head/sys/net/pfkeyv2.h Sun Aug 2 00:15:52 2015 (r286168) @@ -39,9 +39,7 @@ #ifndef _NET_PFKEYV2_H_ #define _NET_PFKEYV2_H_ -#ifndef _KERNEL -#define CTASSERT(x) struct __thisisjustnothing; -#endif +#include /* This file defines structures and symbols for the PF_KEY Version 2 @@ -231,7 +229,7 @@ struct sadb_x_policy { u_int32_t sadb_x_policy_id; u_int32_t sadb_x_policy_reserved2; }; -CTASSERT(sizeof(struct sadb_x_policy) == 16); +_Static_assert(sizeof(struct sadb_x_policy) == 16, "struct size mismatch"); /* * When policy_type == IPSEC, it is followed by some of @@ -267,7 +265,7 @@ struct sadb_x_nat_t_type { u_int8_t sadb_x_nat_t_type_type; u_int8_t sadb_x_nat_t_type_reserved[3]; }; -CTASSERT(sizeof(struct sadb_x_nat_t_type) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_type) == 8, "struct size mismatch"); /* NAT-Traversal source or destination port. */ struct sadb_x_nat_t_port { @@ -276,7 +274,7 @@ struct sadb_x_nat_t_port { u_int16_t sadb_x_nat_t_port_port; u_int16_t sadb_x_nat_t_port_reserved; }; -CTASSERT(sizeof(struct sadb_x_nat_t_port) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_port) == 8, "struct size mismatch"); /* ESP fragmentation size. */ struct sadb_x_nat_t_frag { @@ -285,7 +283,7 @@ struct sadb_x_nat_t_frag { u_int16_t sadb_x_nat_t_frag_fraglen; u_int16_t sadb_x_nat_t_frag_reserved; }; -CTASSERT(sizeof(struct sadb_x_nat_t_frag) == 8); +_Static_assert(sizeof(struct sadb_x_nat_t_frag) == 8, "struct size mismatch"); #define SADB_EXT_RESERVED 0 From owner-svn-src-all@freebsd.org Sun Aug 2 00:18:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8379B1A06; Sun, 2 Aug 2015 00:18:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BAC21B3; Sun, 2 Aug 2015 00:18:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720Inki019185; Sun, 2 Aug 2015 00:18:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720In8x019184; Sun, 2 Aug 2015 00:18:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020018.t720In8x019184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286169 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:18:49 -0000 Author: markj Date: Sun Aug 2 00:18:48 2015 New Revision: 286169 URL: https://svnweb.freebsd.org/changeset/base/286169 Log: Perform bounds checking when constructing a format string. This was detected by the FORTIFY_SOURCE build. PR: 201657 Reported by: pfg MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Sun Aug 2 00:15:52 2015 (r286168) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Sun Aug 2 00:18:48 2015 (r286169) @@ -1348,6 +1348,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE dtrace_aggdesc_t *agg; caddr_t lim = (caddr_t)buf + len, limit; char format[64] = "%"; + size_t ret; int i, aggrec, curagg = -1; uint64_t normal; @@ -1379,7 +1380,9 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE int prec = pfd->pfd_prec; int rval; + const char *start; char *f = format + 1; /* skip initial '%' */ + size_t fmtsz = sizeof(format) - 1; const dtrace_recdesc_t *rec; dt_pfprint_f *func; caddr_t addr; @@ -1536,6 +1539,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE break; } + start = f; if (pfd->pfd_flags & DT_PFCONV_ALT) *f++ = '#'; if (pfd->pfd_flags & DT_PFCONV_ZPAD) @@ -1548,6 +1552,7 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE *f++ = '\''; if (pfd->pfd_flags & DT_PFCONV_SPACE) *f++ = ' '; + fmtsz -= f - start; /* * If we're printing a stack and DT_PFCONV_LEFT is set, we @@ -1558,13 +1563,20 @@ dt_printf_format(dtrace_hdl_t *dtp, FILE if (func == pfprint_stack && (pfd->pfd_flags & DT_PFCONV_LEFT)) width = 0; - if (width != 0) - f += snprintf(f, sizeof (format), "%d", ABS(width)); + if (width != 0) { + ret = snprintf(f, fmtsz, "%d", ABS(width)); + f += ret; + fmtsz = MAX(0, fmtsz - ret); + } - if (prec > 0) - f += snprintf(f, sizeof (format), ".%d", prec); + if (prec > 0) { + ret = snprintf(f, fmtsz, ".%d", prec); + f += ret; + fmtsz = MAX(0, fmtsz - ret); + } - (void) strcpy(f, pfd->pfd_fmt); + if (strlcpy(f, pfd->pfd_fmt, fmtsz) >= fmtsz) + return (dt_set_errno(dtp, EDT_COMPILER)); pfd->pfd_rec = rec; if (func(dtp, fp, format, pfd, addr, size, normal) < 0) From owner-svn-src-all@freebsd.org Sun Aug 2 00:22:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6ABF9B1B4F; Sun, 2 Aug 2015 00:22:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6C56867; Sun, 2 Aug 2015 00:22:15 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720MFCJ023072; Sun, 2 Aug 2015 00:22:15 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720MFqp023071; Sun, 2 Aug 2015 00:22:15 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508020022.t720MFqp023071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 00:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286170 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:22:16 -0000 Author: jmg Date: Sun Aug 2 00:22:14 2015 New Revision: 286170 URL: https://svnweb.freebsd.org/changeset/base/286170 Log: mark this function as deprecated, and put the warning first, since I doubt most people will read to the end... Note the use of sys/cdefs.h for pre-C11 compilers... I didn't included a note about being compatibile w/ userland since a C11 feature should be obviously usable in userland... Suggested by: imp Modified: head/share/man/man9/CTASSERT.9 Modified: head/share/man/man9/CTASSERT.9 ============================================================================== --- head/share/man/man9/CTASSERT.9 Sun Aug 2 00:18:48 2015 (r286169) +++ head/share/man/man9/CTASSERT.9 Sun Aug 2 00:22:14 2015 (r286170) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2015 +.Dd August 1, 2015 .Dt CTASSERT 9 .Os .Sh NAME @@ -39,6 +39,15 @@ .Sh DESCRIPTION The .Fn CTASSERT +macro is deprecated and the C11 standard +.Fn _Static_assert +should be used instead. +The header +.Fa sys/cdefs.h +should be included to provide compatibility for pre-C11 compilers. +.Pp +The +.Fn CTASSERT macro evaluates .Fa expression at compile time and causes a compiler error if it is false. @@ -48,10 +57,6 @@ The macro is useful for asserting the size or alignment of important data structures and variables during compilation, which would otherwise cause the code to fail at run time. -.Pp -The -.Fn CTASSERT -macro is not usable in userland. .Sh EXAMPLES Assert that the size of the .Vt uuid From owner-svn-src-all@freebsd.org Sun Aug 2 00:23:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0353A9B1B9D; Sun, 2 Aug 2015 00:23:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB23C9D4; Sun, 2 Aug 2015 00:23:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720NLnx023200; Sun, 2 Aug 2015 00:23:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720NJbP023190; Sun, 2 Aug 2015 00:23:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020023.t720NJbP023190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286171 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:23:22 -0000 Author: markj Date: Sun Aug 2 00:23:18 2015 New Revision: 286171 URL: https://svnweb.freebsd.org/changeset/base/286171 Log: - Remove hardcoded paths for the perl executable. - Rather than assuming that a process is listening on 127.0.0.1:22, use nc(1) to find an available port and bind to it for the duration of the test. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Sun Aug 2 00:22:14 2015 (r286170) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl Sun Aug 2 00:23:18 2015 (r286171) @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # CDDL HEADER START # Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Sun Aug 2 00:22:14 2015 (r286170) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl Sun Aug 2 00:23:18 2015 (r286171) @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # CDDL HEADER START # Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Sun Aug 2 00:22:14 2015 (r286170) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh Sun Aug 2 00:23:18 2015 (r286171) @@ -58,12 +58,25 @@ fi dtrace=$1 local=127.0.0.1 -tcpport=22 DIR=/var/tmp/dtest.$$ +tcpport=1024 +bound=5000 +while [ $tcpport -lt $bound ]; do + nc -z $local $tcpport >/dev/null || break + tcpport=$(($tcpport + 1)) +done +if [ $tcpport -eq $bound ]; then + echo "couldn't find an available TCP port" + exit 1 +fi + mkdir $DIR cd $DIR +# nc will exit when the connection is closed. +nc -l $local $tcpport & + cat > test.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( @@ -76,7 +89,7 @@ cat > test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < test.pl <<-EOPERL sleep(2); EOPERL -$dtrace -c '/usr/bin/perl test.pl' -qs /dev/stdin < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0207C9B1BCE; Sun, 2 Aug 2015 00:24:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5FDFB2C; Sun, 2 Aug 2015 00:24:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720OOUl023324; Sun, 2 Aug 2015 00:24:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720OMv2023316; Sun, 2 Aug 2015 00:24:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020024.t720OMv2023316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286172 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:24:25 -0000 Author: markj Date: Sun Aug 2 00:24:21 2015 New Revision: 286172 URL: https://svnweb.freebsd.org/changeset/base/286172 Log: Don't hardcode the module or function component of lockstat probes. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d Sun Aug 2 00:24:21 2015 (r286172) @@ -34,7 +34,7 @@ * */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_owned(); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d Sun Aug 2 00:24:21 2015 (r286172) @@ -34,7 +34,7 @@ * */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_owned((kmutex_t *)arg0, 99); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d Sun Aug 2 00:24:21 2015 (r286172) @@ -36,7 +36,7 @@ */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_type_adaptive(); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d Sun Aug 2 00:24:21 2015 (r286172) @@ -35,7 +35,7 @@ */ -lockstat:kernel:mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { mutex_type_adaptive((kmutex_t *)arg0, 99); exit(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d Sun Aug 2 00:24:21 2015 (r286172) @@ -48,7 +48,7 @@ BEGIN i = 0; } -lockstat::mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { ptr = mutex_owner((struct mtx *)arg0); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d Sun Aug 2 00:23:18 2015 (r286171) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d Sun Aug 2 00:24:21 2015 (r286172) @@ -44,7 +44,7 @@ BEGIN ret = -99; } -mtx_lock:adaptive-acquire +lockstat:::adaptive-acquire { ret = mutex_type_adaptive((struct mtx *)arg0); i++; From owner-svn-src-all@freebsd.org Sun Aug 2 00:33:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FBD9B1DBC; Sun, 2 Aug 2015 00:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3814F0F; Sun, 2 Aug 2015 00:33:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720XZY0027709; Sun, 2 Aug 2015 00:33:35 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720XZrA027708; Sun, 2 Aug 2015 00:33:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508020033.t720XZrA027708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 00:33:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286173 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:33:35 -0000 Author: bapt Date: Sun Aug 2 00:33:34 2015 New Revision: 286173 URL: https://svnweb.freebsd.org/changeset/base/286173 Log: Remove netbsd tests on pw(8) First they are redundant with the tests we currently have on pw(8) Second they to modify the host database instead of being self contained withing the test directory Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:24:21 2015 (r286172) +++ head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:33:34 2015 (r286173) @@ -1,8 +1,5 @@ # $FreeBSD$ -TESTSRC= ${.CURDIR}/../../../contrib/netbsd-tests/usr.sbin/useradd -.PATH: ${TESTSRC} - TESTSDIR= ${TESTSBASE}/usr.sbin/pw ATF_TESTS_SH= pw_etcdir \ @@ -24,12 +21,4 @@ FILES= group helper_functions.shin mast pw-modified.conf FILESDIR= ${TESTSDIR} -ATF_TESTS_SH+= pw_test -# - user{add,del} does not exist on FreeBSD; use pw user{add,del} instead -# - The command passes on FreeBSD -ATF_TESTS_SH_SED_pw_test= -e 's/useradd /pw useradd /' -ATF_TESTS_SH_SED_pw_test+= -e 's/userdel /pw userdel /' -ATF_TESTS_SH_SED_pw_test+= -e '/atf_expect_fail "PR bin\/39546"/d' -ATF_TESTS_SH_SRC_pw_test= t_useradd.sh - .include From owner-svn-src-all@freebsd.org Sun Aug 2 00:37:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C4F59B1E8D; Sun, 2 Aug 2015 00:37:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29B7310C8; Sun, 2 Aug 2015 00:37:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720bZ02028058; Sun, 2 Aug 2015 00:37:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720bYPt028055; Sun, 2 Aug 2015 00:37:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020037.t720bYPt028055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286174 - in head: cddl/usr.sbin/dtrace share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:37:35 -0000 Author: markj Date: Sun Aug 2 00:37:33 2015 New Revision: 286174 URL: https://svnweb.freebsd.org/changeset/base/286174 Log: Add a src.conf option to build and install the DTrace test suite. Reviewed by: gnn, ngie Differential Revision: https://reviews.freebsd.org/D3195 Added: head/tools/build/options/WITH_DTRACE_TESTS (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/Makefile head/share/mk/src.opts.mk Modified: head/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/Makefile Sun Aug 2 00:33:34 2015 (r286173) +++ head/cddl/usr.sbin/dtrace/Makefile Sun Aug 2 00:37:33 2015 (r286174) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace PROG= dtrace @@ -22,4 +24,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ LIBADD= dtrace +.if ${MK_DTRACE_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Aug 2 00:33:34 2015 (r286173) +++ head/share/mk/src.opts.mk Sun Aug 2 00:37:33 2015 (r286174) @@ -178,6 +178,7 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ + DTRACE_TESTS \ EISA \ HESIOD \ LLDB \ @@ -318,6 +319,10 @@ MK_KERBEROS:= no MK_AUTHPF:= no .endif +.if ${MK_TESTS} == "no" +MK_DTRACE_TESTS:= no +.endif + .if ${MK_TEXTPROC} == "no" MK_GROFF:= no .endif Added: head/tools/build/options/WITH_DTRACE_TESTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_DTRACE_TESTS Sun Aug 2 00:37:33 2015 (r286174) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build and install the DTrace test suite in +.Pa /usr/tests/cddl/usr.sbin/dtrace . +This test suite is considered experimental on architectures other than +amd64/amd64 and running it may cause system instability. From owner-svn-src-all@freebsd.org Sun Aug 2 00:56:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 653009A5286; Sun, 2 Aug 2015 00:56:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 498471A65; Sun, 2 Aug 2015 00:56:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t720uH21036541; Sun, 2 Aug 2015 00:56:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t720uHW8036540; Sun, 2 Aug 2015 00:56:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201508020056.t720uHW8036540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 2 Aug 2015 00:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286175 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 00:56:17 -0000 Author: markj Date: Sun Aug 2 00:56:16 2015 New Revision: 286175 URL: https://svnweb.freebsd.org/changeset/base/286175 Log: Regenerate after r286174. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Aug 2 00:37:33 2015 (r286174) +++ head/share/man/man5/src.conf.5 Sun Aug 2 00:56:16 2015 (r286175) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 284708 2015-06-22 20:21:57Z sjg .\" $FreeBSD$ -.Dd July 29, 2015 +.Dd August 1, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -137,8 +137,8 @@ associated utilities, and examples. .Pp This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 266158 2014-05-15 16:51:45Z brooks -Set to not build or install binutils (as, c++-filt, gconv, +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 286036 2015-07-29 20:02:20Z emaste +Set to not build or install binutils (as, c++-filt, ld, nm, objcopy, objdump, readelf, size and strip) as part of the normal system build. The resulting system cannot build programs from source. @@ -274,14 +274,14 @@ Set to avoid building the ARCMigrate, Re the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, arm/armv6hf, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. .It Va WITH_CLANG_FULL .\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp It is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv6hf, arm64/aarch64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_CLANG_IS_CC .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks Set to install the GCC compiler as @@ -414,6 +414,12 @@ Set to not build dma Mail Transport Agen .\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 266752 2014-05-27 15:52:27Z gjb Set to not to install compressed system documentation. Only the uncompressed version will be installed. +.It Va WITH_DTRACE_TESTS +.\" from FreeBSD: head/tools/build/options/WITH_DTRACE_TESTS 286174 2015-08-02 00:37:33Z markj +Set to build and install the DTrace test suite in +.Pa /usr/tests/cddl/usr.sbin/dtrace . +This test suite is considered experimental on architectures other than +amd64/amd64 and running it may cause system instability. .It Va WITHOUT_DYNAMICROOT .\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link @@ -1268,6 +1274,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_DTRACE_TESTS +.It .Va WITHOUT_TESTS_SUPPORT .El .It Va WITHOUT_TESTS_SUPPORT From owner-svn-src-all@freebsd.org Sun Aug 2 01:09:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEFE89A5420; Sun, 2 Aug 2015 01:09:32 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA7E1EB4; Sun, 2 Aug 2015 01:09:32 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7219WEC041163; Sun, 2 Aug 2015 01:09:32 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7219UvB041157; Sun, 2 Aug 2015 01:09:30 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508020109.t7219UvB041157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 2 Aug 2015 01:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286176 - in head/tools/bus_space: . C Python X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 01:09:32 -0000 Author: marcel Date: Sun Aug 2 01:09:30 2015 New Revision: 286176 URL: https://svnweb.freebsd.org/changeset/base/286176 Log: Rename busdma_sync() to busdma_sync_range() and rename the base and size parameters to ofs and len (resp). Add a new busdma_sync() that makes the entire MD coherent. Modified: head/tools/bus_space/C/lang.c head/tools/bus_space/C/libbus.h head/tools/bus_space/Python/lang.c head/tools/bus_space/busdma.c head/tools/bus_space/busdma.h Modified: head/tools/bus_space/C/lang.c ============================================================================== --- head/tools/bus_space/C/lang.c Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/C/lang.c Sun Aug 2 01:09:30 2015 (r286176) @@ -227,8 +227,15 @@ busdma_seg_get_size(busdma_seg_t seg) } int -busdma_sync(busdma_md_t md, int op, bus_addr_t base, bus_size_t size) +busdma_sync(busdma_md_t md, int op) { - return (bd_sync(md, op, base, size)); + return (bd_sync(md, op, 0UL, ~0UL)); +} + +int +busdma_sync_range(busdma_md_t md, int op, bus_size_t ofs, bus_size_t len) +{ + + return (bd_sync(md, op, ofs, len)); } Modified: head/tools/bus_space/C/libbus.h ============================================================================== --- head/tools/bus_space/C/libbus.h Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/C/libbus.h Sun Aug 2 01:09:30 2015 (r286176) @@ -78,6 +78,7 @@ bus_size_t busdma_seg_get_size(busdma_se #define BUSDMA_SYNC_PREWRITE 4 #define BUSDMA_SYNC_POSTWRITE 8 -int busdma_sync(busdma_md_t md, int op, bus_addr_t, bus_size_t); +int busdma_sync(busdma_md_t md, int op); +int busdma_sync_range(busdma_md_t md, int op, bus_size_t, bus_size_t); #endif /* _LIBBUS_SPACE_H_ */ Modified: head/tools/bus_space/Python/lang.c ============================================================================== --- head/tools/bus_space/Python/lang.c Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/Python/lang.c Sun Aug 2 01:09:30 2015 (r286176) @@ -384,12 +384,27 @@ busdma_seg_get_size(PyObject *self, PyOb static PyObject * busdma_sync(PyObject *self, PyObject *args) { - u_long base, size; int error, mdid, op; - if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &base, &size)) + if (!PyArg_ParseTuple(args, "ii", &mdid, &op)) return (NULL); - error = bd_sync(mdid, op, base, size); + error = bd_sync(mdid, op, 0UL, ~0UL); + if (error) { + PyErr_SetString(PyExc_IOError, strerror(error)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +busdma_sync_range(PyObject *self, PyObject *args) +{ + u_long ofs, len; + int error, mdid, op; + + if (!PyArg_ParseTuple(args, "iikk", &mdid, &op, &ofs, &len)) + return (NULL); + error = bd_sync(mdid, op, ofs, len); if (error) { PyErr_SetString(PyExc_IOError, strerror(error)); return (NULL); @@ -448,7 +463,9 @@ static PyMethodDef busdma_methods[] = { "Return the size of the segment." }, { "sync", busdma_sync, METH_VARARGS, - "Keep memory/caches coherent WRT to DMA." }, + "Make the entire memory descriptor coherent WRT to DMA." }, + { "sync_range", busdma_sync_range, METH_VARARGS, + "Make part of the memory descriptor coherent WRT to DMA." }, { NULL, NULL, 0, NULL } }; Modified: head/tools/bus_space/busdma.c ============================================================================== --- head/tools/bus_space/busdma.c Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/busdma.c Sun Aug 2 01:09:30 2015 (r286176) @@ -536,7 +536,7 @@ bd_seg_get_size(int sid, u_long *size_p) } int -bd_sync(int mdid, u_int op, u_long base, u_long size) +bd_sync(int mdid, u_int op, u_long ofs, u_long len) { struct proto_ioc_busdma ioc; struct obj *md; @@ -549,8 +549,8 @@ bd_sync(int mdid, u_int op, u_long base, ioc.request = PROTO_IOC_BUSDMA_SYNC; ioc.key = md->key; ioc.u.sync.op = op; - ioc.u.sync.base = base; - ioc.u.sync.size = size; + ioc.u.sync.base = ofs; + ioc.u.sync.size = len; if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) return (errno); Modified: head/tools/bus_space/busdma.h ============================================================================== --- head/tools/bus_space/busdma.h Sun Aug 2 00:56:16 2015 (r286175) +++ head/tools/bus_space/busdma.h Sun Aug 2 01:09:30 2015 (r286176) @@ -51,6 +51,6 @@ int bd_md_next_seg(int mdid, int sid); int bd_seg_get_addr(int sid, u_long *); int bd_seg_get_size(int sid, u_long *); -int bd_sync(int mdid, u_int op, u_long base, u_long size); +int bd_sync(int mdid, u_int op, u_long ofs, u_long len); #endif /* _TOOLS_BUS_DMA_H_ */ From owner-svn-src-all@freebsd.org Sun Aug 2 02:00:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F3AD9A5E4F; Sun, 2 Aug 2015 02:00:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC9215AC; Sun, 2 Aug 2015 02:00:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7220Let062981; Sun, 2 Aug 2015 02:00:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7220LCW062980; Sun, 2 Aug 2015 02:00:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508020200.t7220LCW062980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Aug 2015 02:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286177 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 02:00:21 -0000 Author: jhb Date: Sun Aug 2 02:00:20 2015 New Revision: 286177 URL: https://svnweb.freebsd.org/changeset/base/286177 Log: Fix a couple of markup typos. MFC after: 2 weeks Modified: head/lib/libc/stdio/open_memstream.3 Modified: head/lib/libc/stdio/open_memstream.3 ============================================================================== --- head/lib/libc/stdio/open_memstream.3 Sun Aug 2 01:09:30 2015 (r286176) +++ head/lib/libc/stdio/open_memstream.3 Sun Aug 2 02:00:20 2015 (r286177) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2014 +.Dd August 1, 2015 .Dt OPEN_MEMSTREAM 3 .Os .Sh NAME @@ -86,13 +86,13 @@ will contain the start of the memory buf will contain the smaller of the current position and the current buffer length. .Pp After a successful call to -.Xr fflush 3, +.Xr fflush 3 , the pointer referenced by .Fa bufp and the variable referenced by .Fa sizep are only valid until the next write operation or a call to -.Xr fclose 3. +.Xr fclose 3 . .Pp Once a stream is closed, the allocated buffer referenced by From owner-svn-src-all@freebsd.org Sun Aug 2 02:03:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB8A9AA02D; Sun, 2 Aug 2015 02:03:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B2E91994; Sun, 2 Aug 2015 02:03:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pachj5 with SMTP id hj5so63341930pac.3; Sat, 01 Aug 2015 19:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Ml8fx/NoV4PSUv0/P32hIAkcpbAQPlRch8Z7oqjVL8Q=; b=cRCeVVYgOksgwbytTbelLgRnRRxcpbd0WCNh1RhbA7pVcBExFDedLRyiOnBkoq9SN7 5tl4iqKRGsfFjgs/TXe+pQS0AI3oM/9vrh9avimill4it8tgiIY0xT2c912fQGA6TtM8 MGmBM3lTtX9wiZYvOFsbIYhSQYNkHSnZ+pMCwB/DYgRHqZBwIxhlHsSkf3BWN22KY82j sfKuon9TWL3FnT8pkTQix6v4/IVLxlrNp2oFFEKo7QfIuZzLH4xcrNyb3zMnBORBgkFE j4opsYaYr61uY5laS8G7u3Pgkp9XOejdBGRrdBCcjeRMTvRrUIX1/UzlYBTHMawlO6Rt eshQ== X-Received: by 10.68.198.37 with SMTP id iz5mr389949pbc.129.1438481013914; Sat, 01 Aug 2015 19:03:33 -0700 (PDT) Received: from [33.172.230.148] ([172.56.32.252]) by smtp.gmail.com with ESMTPSA id au10sm3355397pbd.33.2015.08.01.19.03.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Aug 2015 19:03:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r286173 - head/usr.sbin/pw/tests From: Garrett Cooper X-Mailer: iPhone Mail (12H143) In-Reply-To: <201508020033.t720XZrA027708@repo.freebsd.org> Date: Sat, 1 Aug 2015 19:03:31 -0700 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <171F8C8E-9FEC-4F30-BF9D-42F3D74F6B50@gmail.com> References: <201508020033.t720XZrA027708@repo.freebsd.org> To: Baptiste Daroussin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 02:03:34 -0000 > On Aug 1, 2015, at 17:33, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Sun Aug 2 00:33:34 2015 > New Revision: 286173 > URL: https://svnweb.freebsd.org/changeset/base/286173 >=20 > Log: > Remove netbsd tests on pw(8) >=20 > First they are redundant with the tests we currently have on pw(8) > Second they to modify the host database instead of being self contained w= ithing > the test directory >=20 > Modified: > head/usr.sbin/pw/tests/Makefile >=20 > Modified: head/usr.sbin/pw/tests/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:24:21 2015 (r28617= 2) > +++ head/usr.sbin/pw/tests/Makefile Sun Aug 2 00:33:34 2015 (r28617= 3) > @@ -1,8 +1,5 @@ > # $FreeBSD$ >=20 > -TESTSRC=3D ${.CURDIR}/../../../contrib/netbsd-tests/usr.sbin/useradd > -.PATH: ${TESTSRC} > - > TESTSDIR=3D ${TESTSBASE}/usr.sbin/pw >=20 > ATF_TESTS_SH=3D pw_etcdir \ > @@ -24,12 +21,4 @@ FILES=3D group helper_functions.shin mast > pw-modified.conf > FILESDIR=3D ${TESTSDIR} >=20 > -ATF_TESTS_SH+=3D pw_test > -# - user{add,del} does not exist on FreeBSD; use pw user{add,del} instead= > -# - The command passes on FreeBSD > -ATF_TESTS_SH_SED_pw_test=3D -e 's/useradd /pw useradd /' > -ATF_TESTS_SH_SED_pw_test+=3D -e 's/userdel /pw userdel /' > -ATF_TESTS_SH_SED_pw_test+=3D -e '/atf_expect_fail "PR bin\/39546"/d' > -ATF_TESTS_SH_SRC_pw_test=3D t_useradd.sh > - > .include You forgot to add an ObsoleteFiles.inc entry..= From owner-svn-src-all@freebsd.org Sun Aug 2 02:23:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EFE29AA45A; Sun, 2 Aug 2015 02:23:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F96D389; Sun, 2 Aug 2015 02:23:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t722NVrG075470; Sun, 2 Aug 2015 02:23:31 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t722NVMx075469; Sun, 2 Aug 2015 02:23:31 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508020223.t722NVMx075469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 02:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286178 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 02:23:31 -0000 Author: bapt Date: Sun Aug 2 02:23:30 2015 New Revision: 286178 URL: https://svnweb.freebsd.org/changeset/base/286178 Log: Add removed tests to ObsoleteFiles.inc Submitted by: ngie Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 2 02:00:20 2015 (r286177) +++ head/ObsoleteFiles.inc Sun Aug 2 02:23:30 2015 (r286178) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20150802: Remove netbsd's test on pw(8) +OLD_FILES+=usr/tests/usr.sbin/pw/pw_test # 20150719: Remove libarchive.pc OLD_FILES+=usr/libdata/pkgconfig/libarchive.pc # 20150705: Rename DTrace provider man pages. From owner-svn-src-all@freebsd.org Sun Aug 2 03:09:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1201D9AAAD4; Sun, 2 Aug 2015 03:09:22 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0141.outbound.protection.outlook.com [65.55.169.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47A8B1A91; Sun, 2 Aug 2015 03:09:20 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from BLUPR05CA0055.namprd05.prod.outlook.com (10.141.20.25) by BLUPR05MB706.namprd05.prod.outlook.com (10.141.207.13) with Microsoft SMTP Server (TLS) id 15.1.225.19; Sun, 2 Aug 2015 02:34:34 +0000 Received: from BN1BFFO11FD038.protection.gbl (2a01:111:f400:7c10::1:138) by BLUPR05CA0055.outlook.office365.com (2a01:111:e400:855::25) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Sun, 2 Aug 2015 02:34:34 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BN1BFFO11FD038.mail.protection.outlook.com (10.58.144.101) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Sun, 2 Aug 2015 02:34:34 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 1 Aug 2015 19:34:33 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t722YWD72406; Sat, 1 Aug 2015 19:34:32 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 08273580AB; Sat, 1 Aug 2015 19:34:32 -0700 (PDT) To: Baptiste Daroussin CC: , , Subject: Re: svn commit: r284345 - in head: . bin/cat bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/expr bin/freebsd-version bin/getfacl bin/hostname bi... In-Reply-To: <20150726204948.GD1522@ivaldir.etoilebsd.net> References: <201506131920.t5DJKwMH033508@svn.freebsd.org> <20150726204948.GD1522@ivaldir.etoilebsd.net> Comments: In-reply-to: Baptiste Daroussin message dated "Sun, 26 Jul 2015 22:49:48 +0200." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Sat, 1 Aug 2015 19:34:31 -0700 Message-ID: <852.1438482871@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD038; 1:1WfYNFERfo/zOG8AJq2zcccV2ZxJI78p73xXRwYfJ2wFfxjdhacSYgdBDsQEg5PgfiIwEwwKIDoVY5QPHRGYvPd+gqctOAP0R1W9FPaYLbn+ngjNoG6cF8Jmwf7OqV2Ucp68114KslLbzXh5TKUUunQV2Z23hmjwxuVu0QPgmLSyHvuVhVqqd/vlL7CH7nWuxeuIQ9EUUG1JItJICYeVgaAwkhHFzeT3pAnNZ9AAEa8rYdq0mKHosXID+9EBuS56BequxfSve7bY+WkGX756uSF68XOeG8ZQ8Q8Nb0V0isM= X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(979002)(6009001)(2980300002)(24454002)(199003)(189002)(48376002)(77156002)(62966003)(105596002)(450100001)(106466001)(19580395003)(76506005)(57986006)(86362001)(19580405001)(189998001)(2950100001)(6806004)(50226001)(77096005)(92566002)(110136002)(117636001)(87936001)(50986999)(46102003)(47776003)(76176999)(5001960100002)(5001920100001)(5003940100001)(50466002)(33716001)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB706; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 2:m+Syck2nmmIvpQEtscJ+mE1PVEgUyfW6oFPbfKGpdOgTEnb/TPUwSzNKeSTqk9jeZDGWOH4+R0vrAM5nC22pA/BmHmD4FhYsOxIghLnyuWUlpPiTXnj5yF5bzyhFsP763chKYgpQKY5RiwPbo3PkCJhC3iHsIpoqqU66k/7k6q0=; 3:ghswePUtJ6R016WnX8EcM+MjN5hreVMt14kTd843ZzMJ7bvZfnluAxwrsEswZADrdKEBfpy2bUNev+SnKF4GNQoEpLVleUQagejQ9sShCGrldNefBljEBmV1CnyXdy3ZEkrmr+u1o+n1MGKS6xc+mW4edoWJ/l7cxxabtBJxgUoedaBGQ8NsC+Hz2X/4byMh9UoIKqqa10Aye0nWGF5BlIUhxhIIz4hp8kCLc6Ygo3g=; 25:C2EJQQfyd2yv8Hf/FwQNsskz3dayN0ELm72JQwO4TUNNVYP5FKqtb4ijGrZjFbeki8SjddBRxuA5yGiT09vtAXapuWQHVvp925gvD9UYW5LI5l0KYMVHdnJ01PAzDX/V3bZpXIG8i4GWwlyfIvUEIF2TnCilnqvbtqyDAKGM12BaivHuwBJZ6n//7fUVsHcFNYXr8Mn0JPdzZys1iktcmMvXfYdtuMlRX0zpz3nPiOwoI7l+YlI95T0Kv51uK9ihii7uzAsCH+1iZdQd/FPeYQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB706; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 20:AutHj0wbSMYhaEl1zi4rOxjcKidBxjS2ltEuKjIhOjinifUG0trM1RN0NMpJrDs7bBwQdjpogfTLXjcYLGAJMDrUpbQ2qA3niaU1RJRKkvsjxeY7TV9lraHonNXXxt6Oje76Fo86w1OCWNM9npcO8RMzN9DIKfxB9DHDhYak/UraUYCmKcApd4Rshh6w3vP81+z3joaVrBdvtHQ0F0R/NIirOvM2tbm288kHQwy8b4xpUuT8m9RsiDcInkSPIoYyQWZ905Nko8DxkEZ+p6+3JZ11UODjmcKocu6OZXBsq3Sj+X/GcmB9bH2IaUJZmLl3vZKQJxVjrtcvmEP86D+LxH/4hlCJyxMgRrwnWsKZJpbmT8c1iXIOojgLWKmI/HRhI7Cwz85CMcHEc6V4nrSQgtQUp7FhO/Fneurn4t2RZMM3gySKJGU8tW7KGQPvJJPKz64wuvhHeeBL6PjBJVC5bA2O9qm66IRNqFl9Cu+DZoYqaGhenRYrePM4wH/iwHQk; 4:q+/u1zcaaWlv2nnyf78fXMqeqAaFtlP87Vj0bMYsw3N5bYDFMe/ZMLuaP7o0VnBg4GikgtDxJrvI0U8hJAgt6skQarysrUAkWlNzX5HGblSdwvC/OJPFkHwvSY81xGK1VEGHuF81qzubRUOOAP97tDSpswmn3lb6/8Vf5VxnofyHEBOURX+DFbGyNl88aDd+jZX7XIEncGy3HF+V8m1Kn9P/gzc61RwgXD7zR5vvOylFBMMFdjlu8+kobBWyHbH4v5KxC58O5n39g6iI4s51SDNK5g5P6y2OYQ94yBRfsHM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(10322497157591); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR05MB706; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB706; X-Forefront-PRVS: 0656A4403B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB706; 23:Oq09VV6ESbpgLPS45MPQYh+5168k31ql/8y0BCxd3o?= =?us-ascii?Q?VPU7DCAjG7hOOsjbhlN+dClu2LqUtcTyNN8aINU1jnPt0QtniD+yYOL26qKe?= =?us-ascii?Q?PRBSDn5G3AWDnt3pBFgqatIRR0YbFawlamRznXuQme8CxVW7EvAtSwQoD7wj?= =?us-ascii?Q?tM6anlrKhEe2JC+DLHS6pZBWNM6xjn8S6RvxpZRU+NYXGircmpiKeiiJPHrv?= =?us-ascii?Q?+17f+ervHRcY12L7V4ewB4YFjrSA2A0Vl+CqFpyLNcD8oVU3+eOg3X/ARG7D?= =?us-ascii?Q?4idIlxezgmtrLY+7Oo7goC+BMU9kL930fPLKvtvfZdfw23gQ0yzRm/eGGQq3?= =?us-ascii?Q?CUZN+DOndeHB+/nTwtAibCzvL5tk2ikEX5guiFsoPuMoxPMV7BFnc3SzPxAT?= =?us-ascii?Q?8Rjc5pKW/vuekXXGOhnQ6838NNLg6Z7Lp4ZvcXwLWY2K8cTFv2rxblP315c0?= =?us-ascii?Q?4NKRGJzQubwqKyFEUqknDZOQPw4kqyHplVG3UFxfhaEDwMeCMukViriXenlc?= =?us-ascii?Q?WZnVwufZANnKipdxqnJunux0avFgDiyhGbxzRbd3xXQGlQwJnyd0YB8SUpIG?= =?us-ascii?Q?xYtLSelD7inX85wvFToiM1KiUoyGdG8Wexq0qv8VdYtncMRjrJiVtocb13Qr?= =?us-ascii?Q?hpREP62yEYN/Syxr5R8MkbN2ZMJhjMhy27ijQLCR5UpSaganbOtTOEslWvGD?= =?us-ascii?Q?xOAwp1g/3qzQBJOdzDbzDJKDF7zxSUP6NpkhgaMJaNX+ZcoaTz0Tg6NTuAK1?= =?us-ascii?Q?5rdslfaIM9wnpcIYZgz2UIELptjL0SBfidhEi44EMaVmPM+qmzD4NqukRbmZ?= =?us-ascii?Q?JLOZalYz4e7kmJ4etFBdC/5YBMgb8qvlMmmteZ5UTg/5O4CZLEqwNDkxm1yY?= =?us-ascii?Q?8BDwqgEGItYQZVk7Jg4AVG5YEkygISw+kzGC0sV8uKkY8kmRAAf1CSAy007U?= =?us-ascii?Q?AHn2Xx4ZmLpLVhwEERzDu9NM6brBkBJS99tC8mT9xQa/PCRtxjh/XYDhsqe9?= =?us-ascii?Q?zsfP6Gp+nrrcv5GoO9J3yn1o6ZAxmZU3qJhl7dDBswfg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB706; 5:MO3EEVQaPmHR4wph4byTfSUg/ZOIN/o/tkcYEH4VnJsdmT/U05ZD0L/EoLyvEuyQONJ1EKZlx3d/CegFTGoZz29PjOSq507eIM7gvjzu0iu24+plABoQG7h3afLbHEOROgsCxlfzoQz8r0+iuYzHCg==; 24:DzDz5EvAzl448Q41jIw/YiPcfzXtz+nVL2dIDeoag22s2Rv65RGXfeROn/Acz3hjLt33GI8vV4thviUxY96KoOPGy85A1JrrB4g8wopqgzI=; 20:v/DTV1LzgGuRaEOQDYPnKwNtKtogN42J2tPYXhjCYROL+oRULky4mF5RG1Z25aXkAZqr19Tbnz1aTkpIC7Ogrw== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2015 02:34:34.0230 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB706 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 03:09:22 -0000 Baptiste Daroussin wrote: > This breaks using fmake from ports because of usage of :U in sys.mk Oops - sorry. I saw Warner posted a patch for this which looked ok, but doesn't appear to have been committed. > is compatible with FreeBSD 9 (not that I'm just speaking about sys.mk not other > parts) Understood. AFAICT the following allows fmake to consume sys.mk Index: share/mk/sys.mk =================================================================== --- share/mk/sys.mk (revision 286177) +++ share/mk/sys.mk (working copy) @@ -33,8 +33,10 @@ # early include for customization # see local.sys.mk below -.-include +.sinclude +.if defined(.PARSEDIR) +# none of this is relevant without bmake .if ${MK_META_MODE} == "yes" .-include .elif ${MK_META_FILES} == "yes" && ${.MAKEFLAGS:U:M-B} == "" @@ -44,6 +46,7 @@ # This needs to be done early - before .PATH is computed .-include .endif +.endif # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall @@ -361,7 +364,7 @@ .endif # late include for customization -.-include +.sinclude .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL} @@ -378,11 +381,12 @@ # when running target scripts, this is a problem for many makefiles here. # So define a shell that will do what FreeBSD expects. .ifndef WITHOUT_SHELL_ERRCTL +___MAKE_SHELL?= /bin/sh .SHELL: name=sh \ quiet="set -" echo="set -v" filter="set -" \ hasErrCtl=yes check="set -e" ignore="set +e" \ echoFlag=v errFlag=e \ - path=${__MAKE_SHELL:U/bin/sh} + path=${__MAKE_SHELL} .endif .include From owner-svn-src-all@freebsd.org Sun Aug 2 04:10:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD1539AF744; Sun, 2 Aug 2015 04:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF4E1B66; Sun, 2 Aug 2015 04:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id C4C2310406B6; Sun, 2 Aug 2015 14:10:34 +1000 (AEST) Date: Sun, 2 Aug 2015 14:10:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286168 - head/sys/net In-Reply-To: <201508020015.t720Fr6R018929@repo.freebsd.org> Message-ID: <20150802133842.N894@besplex.bde.org> References: <201508020015.t720Fr6R018929@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=XMDNMlVE c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=z-DsBK8JfUJZqYZcnlkA:9 a=2pKiAXyLDbeUMeCR:21 a=tvztPCtJRzYOqW92:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 04:10:43 -0000 On Sun, 2 Aug 2015, John-Mark Gurney wrote: > Log: > convert to C11's _Static_assert, and pull in sys/cdefs.h for > compatibility w/ older non-C11 compilers... This include is bogus. already depends on the includer including other headers that include . Mainly . defined massive namespace pollution that includes everything in . It includes an infinite number of times via recursion, except the recursion is stopped by anti-reinclude guards. Th recursion makes the static number of nested includes of hard to count. Also, this is a kernel header. All kernel headers depend on the includer including and . Some work accidentally without this, and broken includers depend on this. For example, this file didn't depend on for the definition of CTASSERT() and wasn't broken when CTASSERT() was added, but if any includers of it that didn't include had there brokenness exposed. and defined much more massive namespace pollution than , together with some names that that are not pollution. Almost everything in is now part of the API. As a result, most kernel headers should not include . Some leaf headers like the x86 _types.h check that it is included before them. Some headers that are intentionally shared between the kernel and userland have a sloppy but non-polluting _KERNEL section that depends on many includes (mainly all the ones in and doesn't include anything explicitly, followed by a non-sloppy userland section that begins with an include of . This include used to be used for __BEGIN/__END_DECLS and __P(()) but is now just used for the former. Macros like __BEGIN/__END_DECLS and _Static_assert are just as ugly as __P(()) and should go away, but they have proliferated faster than __P(()) went away. The non-sloppyness includes not including but using basic types and declaring the few ufoo_t types that are part of the documented API of the header. If an application wants to abuse a kernel header, then it must fake the kernel environment for it. I don't know much about this header, but it is not documented in any man page so it can do anything. Bruce From owner-svn-src-all@freebsd.org Sun Aug 2 04:15:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B30239AF862; Sun, 2 Aug 2015 04:15:50 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0126.outbound.protection.outlook.com [207.46.100.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98361DAB; Sun, 2 Aug 2015 04:15:49 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from SN1PR0501CA0029.namprd05.prod.outlook.com (10.163.126.167) by CO2PR05MB634.namprd05.prod.outlook.com (10.141.199.17) with Microsoft SMTP Server (TLS) id 15.1.225.19; Sun, 2 Aug 2015 04:15:42 +0000 Received: from BY2FFO11FD022.protection.gbl (2a01:111:f400:7c0c::176) by SN1PR0501CA0029.outlook.office365.com (2a01:111:e400:52fe::39) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Sun, 2 Aug 2015 04:15:41 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.18) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.18 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.18) by BY2FFO11FD022.mail.protection.outlook.com (10.1.15.211) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Sun, 2 Aug 2015 04:15:40 +0000 Received: from magenta.juniper.net (172.17.27.123) by p-emfe01b-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sat, 1 Aug 2015 21:15:40 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t724FeD12834; Sat, 1 Aug 2015 21:15:40 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id D23EF580AB; Sat, 1 Aug 2015 21:15:39 -0700 (PDT) To: Bryan Drewery CC: , , Subject: Re: svn commit: r284598 - head/share/mk In-Reply-To: <55B8268A.5030305@FreeBSD.org> References: <201506191456.t5JEuPDU074336@svn.freebsd.org> <55B8268A.5030305@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Tue, 28 Jul 2015 18:04:10 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Sat, 1 Aug 2015 21:15:39 -0700 Message-ID: <4974.1438488939@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD022; 1:ZAgONPxEYyA/lxRARhiiNzFA3ZIzeBjP7Ri/Wy1+jAW1LWDoUa2WsESJFVR4I1yWp0Px3f0B07w9JaARhV4FxZltl6jgq9UtTIMSEn9mYFejomuFZpLscsKMPEw/8tLYFJNh+ldUQ3y/sZW8ub3rcbvD1jFfYvq3yHrS6BkG542MaR4hnrfKR/R4R+r+4M7dsJTe0UE345BQZvKXZ/ClzaCy5f/tS4UWcSIoTYZviMVzY7PCncp7BK9Dji7ncyBVDsTXRccr41KS1qO5zDMZsMrzapmRD556J62OXplo+o8= X-Forefront-Antispam-Report: CIP:66.129.239.18; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(24454002)(189002)(57986006)(87936001)(76506005)(50466002)(47776003)(19580405001)(450100001)(5001960100002)(62966003)(189998001)(110136002)(106466001)(77156002)(105596002)(48376002)(50226001)(117636001)(46102003)(50986999)(92566002)(77096005)(2950100001)(33716001)(76176999)(86362001)(6806004)(19580395003)(62816006)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB634; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 2:J9sIMeBQxh4C/VMuWiJkOOSuL4dtRvWtFxztHjx6R3Yj+gwlvu5AKsQB69viN6sdwxkCAXQxycgOmwHdAzPVaGX0+Dt+W8xrJg4jNtC5zBRwclDWSaEn0+A7EhEXX+en8I9cGrGcBDkxexbx6K2TzolX+FWyXQXa5VgHC8CzFdI=; 3:SfFyYbjk9xEDOrslYQORi/+8Biq0ZvczCw2ZBI/6aJ85Am9baymZuqEJRPWzmSoTO6BAJXqRzZ+OUqtqRUyt3y5qq8Ah5SbwamOYunrcfX6MaIKeSSMRnDhT/HGYKmGUO1tIaqHKAuIPP4AdVCLqV6vNF0d/SgQog/yXZV6YtTIenKx4z/QYGlpMk/cFPY9JBnw6Z/0TOjqZ1icXfOS5QvnUnNZzIGw5tHqBJU2c4bM=; 25:+Hy+slv74EI+JG+N9jGoYvAmWs3Sy+UbdhjXmLE8I4exygSD9ONNeKXDa613b2AcjD/o/0l4KjsQ/j1/y6dlSrnBya6dXSPyVHsMg+g6WnmrN5TBq09R+j9ooo+JyDVxN5E57DaUKiXk/Deoh6WSsE9bmj5ktG9NNv7oOAoqwcEocvt4oZj92/CRISO5QW9ePppyfOyXJgcOK+Fj3GZa3dYGnSWtT/EXottTZD6dJrHXxYaCc14A4VoV6dC1uCV71Aaw1rbQ3VJF9SMkHfCmlw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR05MB634; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 20:lBJ9UeVEuE13AZkO1anlHMQX/WH2XwpgPpr90kufUQJ5NLfLdl/cdeUe0vOlssJ0+lvM3Dop5c8Ea6nAwH2z6zopLMd3pL4OL+IxQCHcmiGoZZ2P5cWjuICUO2quIf06d2/2FesWg8IbJkqJdUXmJs1t+OzpcEMS+wKEbSPXZxxr7Jtf6DI1mSqp6oQD7gBmb+/Doas49/LVug7VW4MRXyGezF1qb7FCQEIWl2lz3Nl+/Z3JIPqQFQmHVszem5y5km9+7v+DHqtWX54cLS/2AAX89jFxwNGzzwzrhg/hDL6jJLQzUfr5D1QEiy/E2VDsgSzBFks71AG2YrfHCPqgN2tr21wZTidqWartgZX1qjX7KuFX4rhRYLgQFKg4dlz8hruFHHbePDTvw33Ss1HgwHTTRyI8+woCepuoYnV0TTNqE+3OlOdgSA0gRg53QN4OqVV/4Wd1n3FDYO5bw5Mxftglp7zed/ATeje9NZwuj+D5cb/kZYHNDVAo9gw9rbgJ; 4:RhzTd3xJI9eHZKLqfzoCN/LZlPZL8u+yUk3H7gm4+ctidH5zFaw2vMihInmonxiGl4V2Q2aFkxVkzuXlcjT05A2odDh0KQK/jjTmPSEmbGvdHB1tD4Hm96FpUeuQkkCD0Ni+PxJnrjjYDL79NNyOPgPKhv39cOLk9cQNCERmjkMaSpB0ddwrLk+AnbexxnjjqEmUFGXqQByqG3j+LNJNUSffsou3fYER7qG+uETzm/CIkHvZEJvXmq4jvz00BUCzKKmHj5I0Hh4K07ktLwipcmU+lk5d4VkcDTTnrWi2NMY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CO2PR05MB634; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB634; X-Forefront-PRVS: 0656A4403B X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 23:qw3OUvgS1JgRuHZT/zKsRq4+vIh+khgTTCKffhmS3Y3ktb/ZuAFw1xO2z7CHSV7oZYlsALSO6UR5jBm48FQkMl2HsTyuwwMB9m3PavlbpqyCf+6yOw8keKfql9fHATO+gh6HrvPvTnmTDuoLg4vFjlqjHdkT5H4MQVbzZg8AgN7CCNlJdwgjMz38RpVjm8wghoX6D+CYEbcml1uUL6RYEb2N/r0q79D5liJ6rfog2H9pefncJKmv+cvRbjuEPtOluUemEjLHMvP0bsmn1Xge2+15wTJE7rPkSs2n4Qtt5dhf0wV6VhFWVymml4Y7l9Km4Zx66rnzLlECTPn/MkqHxGL7O81JchwSsAKnl3sTaoHRvxrA9d0RFZSW6GAk+7ItamB3G5MXfP294KIVKnGtqKmkxFQELRR8sqSfgn6JEla/mSiZlmRU4bcObTkuuapEbd5ylotICHfE9m+tScYNoZsRLejrPLGJ4oXHN2II85kHG4463uO5VoAkQc0hgrND4zT2JpwsJ661lJBE4ILVQ2lfLYqIb0RVssB5KBshii9Bv/TWU3pXl3Ziw3nhqzppwxAd42/MFddcmiVuGIVYQC1rhwZmJfaWJGW/NUqI9VW+E7GQyEXwIk1itpccag8Claka6bUcSkoL4leciGGhqvd3IzG4IBEA1U4qWWzE0/8u3iyDBE9mlzdZQ0NnKTaf4VdZ4P1L41iIJPfIJJSjZRKgZWym9wc2p4aUro90Apcty7STR0pHuwwhjxH7U8uoLjXxOq1kd3FgOv7kXoK8ws8NgL7X73/IMiMBA0z6oFZIz9Gd36TE+9ROYDBLIHWJHbE/3+iXD46WYUd6qVDbBXVP68/2xKao9Ge0bD32s9qEaZxchWpiGLn/X3jM1IJKAiasPcI/tv9IL5ySW4H/IA== X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB634; 5:WDFhYw3HqXSbRwoeBlJOrFOogkX7w2ilnZ/WcR1tGZackAC74OD4AHoOdWfq2M8vIDQrAUMsIipkQA3KV+LavY4QHzDb2tSNLokrna01CamivcUAJcKx0a33a4Y2/l+ST1/aGB36YZ/nDW8Bqyd5xw==; 24:MVcHemA2guvVWfVmQhfmkL4UA3YbmjQ/zvxoTn04f/YS1iCgiZUP3mLY7RhT3FOG05Rz+/3Y6Zm+FBLAynZyuMGs7jQ6MPCG0CtvILhgYjQ=; 20:grZ8GXkWEFeyfifPz6dUN+36IzFgbxVkUaUx0VGpRouHZlOwrfIO3Ah8Jr10a79XUQZV6+yiGAfWJSe/q8efFA== X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2015 04:15:40.9231 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.18]; Helo=[p-emfe01b-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR05MB634 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 04:15:50 -0000 Bryan Drewery wrote: > > head/share/mk/local.sys.mk > > I'm bothered by the amount of local.* files committed in the tree. I > expect, as a user and working in a downstream product, that a local.* > file is MINE, not FREEBSD. The pattern of using 'local' is quite common > as a *user* file. Yes that's exactly the point. local*mk (and src*) do not get installed in /usr/share/mk, yet the inlcudes exist as points for you to customize the behavior. > Why are these named as such? It seems they should just be 'src.' with > .sinclude hooks for actual local overrides. local* are name as such since that's all that bsd* should know about. Providing for local customization. Ideally the local.*.mk in src/share/mk would do nothing except include src.*mk which is where the smarts for building src should be. But /usr/share/mk/ should know noting about src* since it is supposed to be generically useful infra. There's extra stuff there because it might be useful as an example. We can work on that over time I guess. After many years consulting and providing tools to customers, I really like making it possible for them to customize without touching (hacking) any of the original bits, it has worked very well. That's key when you get to something really complicated like dirdeps.mk > > +# site customizations that do not depend on anything! > > +SRC_ENV_CONF?= /etc/src-env.conf > > +.if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_) > > +.-include "${SRC_ENV_CONF}" > > +_src_env_conf_included_: .NOTMAIN > > .endif > > This needs to be documented in at least src.conf(5). I'm concerned that > the need to add this indicates subtle changes elsewhere that may break > existing /etc/src.conf setups, but I cannot find an example. Sorry, I didn't do the above originally; what is the concern? > > +# late include for customization > > +.-include > > In local.sys.mk from r284345 is an inclusion of SRCCONF, which is now > different and earlier than before. I wonder if this should move back to > only being included from bsd.own.mk (there is even a lingering > WITHOUT_SRCCONF check in that file). The way it is now is very obscure > in terms of when it is actually included and from where. Since I didn't move the inlcude of src.conf from bsd.own.mk (I would *guess* it was part of the src.opts changes) I'm not sure what the pros/cons of the two locations are. Certainly changing *anything* has potential to bite someone, but it is very hard to improve without change. From owner-svn-src-all@freebsd.org Sun Aug 2 04:34:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E70089AFD24; Sun, 2 Aug 2015 04:34:03 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AEA366A2; Sun, 2 Aug 2015 04:34:03 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t724Y2Ar081690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Aug 2015 21:34:02 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t724Y2AX081689; Sat, 1 Aug 2015 21:34:02 -0700 (PDT) (envelope-from jmg) Date: Sat, 1 Aug 2015 21:34:02 -0700 From: John-Mark Gurney To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286168 - head/sys/net Message-ID: <20150802043402.GP78154@funkthat.com> References: <201508020015.t720Fr6R018929@repo.freebsd.org> <20150802133842.N894@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150802133842.N894@besplex.bde.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 01 Aug 2015 21:34:03 -0700 (PDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 04:34:04 -0000 Bruce Evans wrote this message on Sun, Aug 02, 2015 at 14:10 +1000: > On Sun, 2 Aug 2015, John-Mark Gurney wrote: > > > Log: > > convert to C11's _Static_assert, and pull in sys/cdefs.h for > > compatibility w/ older non-C11 compilers... > > This include is bogus. already depends on the includer > including other headers that include . Mainly . > defined massive namespace pollution that includes everything > in . It includes an infinite number of times > via recursion, except the recursion is stopped by anti-reinclude guards. > Th recursion makes the static number of nested includes of > hard to count. I'll test w/o sys/cdefs.h and if it compiles, I'll remove it... > Also, this is a kernel header. All kernel headers depend on the includer Except it isn't just a kernel header as we found out, otherwise CTASSERT would have been perfectly fine... It defines an API between kernel and userland for adding and changing the kernel SA/SP database... See sbin/setkey and lib/libipsec... [comments about kernel only headers deleted] > If an application wants to abuse a kernel header, then it must fake > the kernel environment for it. I don't know much about this header, > but it is not documented in any man page so it can do anything. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@freebsd.org Sun Aug 2 04:44:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 995129AFF01; Sun, 2 Aug 2015 04:44:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id C935FA9B; Sun, 2 Aug 2015 04:44:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 644D83C3D90; Sun, 2 Aug 2015 14:44:44 +1000 (AEST) Date: Sun, 2 Aug 2015 14:44:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker cc: Bruce Evans , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285985 - in head/usr.sbin/pw: . tests In-Reply-To: <20150801192419.GB94932@stack.nl> Message-ID: <20150802141200.G894@besplex.bde.org> References: <201507282110.t6SLAx0k035167@repo.freebsd.org> <20150729080932.S5059@besplex.bde.org> <20150801133629.GA94932@stack.nl> <20150802022204.O3247@besplex.bde.org> <20150801192419.GB94932@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eZjABOwH c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=-i_Z2ZMzrw89SmjDpHoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 04:44:48 -0000 On Sat, 1 Aug 2015, Jilles Tjoelker wrote: > On Sun, Aug 02, 2015 at 02:59:00AM +1000, Bruce Evans wrote: >> On Sat, 1 Aug 2015, Jilles Tjoelker wrote: >>> These values are easily written using arithmetic expansion, for example >>> largeid=$((0x100000000)). > >> Not really. Shells are also very buggy or limited in this area. I >> often use old versions of sh and bash that only support up to INT32_MAX >> and have broken overflow handling. /bin/sh in -current only supports >> up to INT64_MAX (or maybe INTMAX_MAX) and has broken overflow handling >> (it clamps to INT64_MAX). Not so old versions of bash only support >> up to INT64_MAX and have differently broken overflow handling (4.3.99 >> blindly assigns to int64_t, so $((0x8000000000000000)) becomes >> -0x8000000000000000. > >> expr is also limited to INT64_MAX, but attempts to have non-broken >> overflow handling. > > The tests need not work with old versions of sh and bash (they already > rely on many more recent features and bugfixes). The broken overflow > handling in parsing literals does not affect the given example. But I complained about the example being deficient. It only needs to test up to UINT32_MAX now, but that may change. A similar test in dd already needs to go up to UINT64_MAX. dd does support hex numbers, and is suppose to support offsets about OFF_MAX, but this is broken by excessive support for the signedness of off_t. All kernel addresses in /dev/kmem are above 0xffffffff00000000 on amd64. I tried to get green@ to fix this in Y2K, but the result was a larger mess. >>> When using strtol() or similar functions, accepting hex typically >>> implies accepting octal as well, which causes confusing and >>> POSIX-violating results like 010 interpreted as eight. > >> This is a problem. strtonum could accept hex but not octal by calling >> strtoimax() twice for bases 10 and 16. Also dehumanized formats like >> 1k and 1K. It should also actually accept numbers as input. 1.1e1 if >> not I * Pi. > > Silently expanding what strtonum() accepts might cause breakage or even > security vulnerabilities. It is hard to fix broken APIs/UIs once they are used. strtonum() is not used often in /usr/src. Its main use is in openssh, and that is hard to fix since both strtonum and opensh are from OpenBSD. Using names in the reserved namespace causes portability problems. FreeBSD's expand_number() is a much worse name, but at least it doesn't conflict with better future uses of a reserved name. Bruce From owner-svn-src-all@freebsd.org Sun Aug 2 05:35:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 285A79AF680; Sun, 2 Aug 2015 05:35:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id A60D5199A; Sun, 2 Aug 2015 05:35:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id EAB8C1A2646; Sun, 2 Aug 2015 15:35:25 +1000 (AEST) Date: Sun, 2 Aug 2015 15:35:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286170 - head/share/man/man9 In-Reply-To: <201508020022.t720MFqp023071@repo.freebsd.org> Message-ID: <20150802145434.V1128@besplex.bde.org> References: <201508020022.t720MFqp023071@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=XMDNMlVE c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=JJchhklRDgoQpUDWXggA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 05:35:30 -0000 On Sun, 2 Aug 2015, John-Mark Gurney wrote: > Log: > mark this function as deprecated, and put the warning first, since I > doubt most people will read to the end... Note the use of sys/cdefs.h > for pre-C11 compilers... This function shouldn't be deprecated. It is a kernel wrapper with a good name for hiding the implementation detail or not-yet standard interface _Static_assert(). CTASSERT() is the compile-time variant of KASSERT(). We intentionally use KASSERT() instead of anything like the standard assert(3) since we don't like the API or semantics of assert() and want one with different design and implementation bugs. I can't think of any use for different semantics to _Static_assert(), but using CTASSERT() retains flexibility. isn't a prerequisite for this function. The correct prerequisites for this function are already documented. They are and . > I didn't included a note about being compatibile w/ userland since a > C11 feature should be obviously usable in userland... If CTASSERT() is abused in userland, then the kernel environment must be faked. > Modified: head/share/man/man9/CTASSERT.9 > ============================================================================== > --- head/share/man/man9/CTASSERT.9 Sun Aug 2 00:18:48 2015 (r286169) > +++ head/share/man/man9/CTASSERT.9 Sun Aug 2 00:22:14 2015 (r286170) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 30, 2015 > +.Dd August 1, 2015 > .Dt CTASSERT 9 > .Os > .Sh NAME > @@ -39,6 +39,15 @@ > .Sh DESCRIPTION > The > .Fn CTASSERT > +macro is deprecated and the C11 standard > +.Fn _Static_assert > +should be used instead. > +The header > +.Fa sys/cdefs.h > +should be included to provide compatibility for pre-C11 compilers. _Static_assert() shoudn't be used instead, but when it is including sys/cdefs.h isn' optional. Then the documented prerequisites for this function might not be needed for the replacement but in the kernel they must be provided for other functions. Some section 9 man pages, e.g., atomic.9, document a minimal prerequisite like , but this sets a bad example and inhibits adding conditional features like KASSERTS()s in atomic.h. atomic.h is so low-level that you normally wouldn't want to bloat it with assertions, but you might want to add them for debugging. In fact, it is a style bug for any kernel file to use the documented prerequisite for the atomic functions. is part of the standard pollution in and it is a style bug to not depend on that. sys/param.h is a documented prerequisite in 264 section 9 man pages (at the source level; many more counting links). sys/systm.h is in only 34. sys/types.h is in 41. > +.Pp > +The > +.Fn CTASSERT > macro evaluates > .Fa expression > at compile time and causes a compiler error if it is false. > @@ -48,10 +57,6 @@ The > macro is useful for asserting the size or alignment of important > data structures and variables during compilation, which would > otherwise cause the code to fail at run time. > -.Pp > -The > -.Fn CTASSERT > -macro is not usable in userland. The CTASSERT() macro is still not usable in userland. It is only abusable. Its alternative _Static_assert() is usable, but most people won't read to the beginning of this to find it here. > .Sh EXAMPLES > Assert that the size of the > .Vt uuid Bruce From owner-svn-src-all@freebsd.org Sun Aug 2 07:25:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 503649B0CAB; Sun, 2 Aug 2015 07:25:07 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40522ADC; Sun, 2 Aug 2015 07:25:07 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t727P7T3099066; Sun, 2 Aug 2015 07:25:07 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t727P6OH099064; Sun, 2 Aug 2015 07:25:06 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201508020725.t727P6OH099064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sun, 2 Aug 2015 07:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286181 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 07:25:07 -0000 Author: brueffer Date: Sun Aug 2 07:25:05 2015 New Revision: 286181 URL: https://svnweb.freebsd.org/changeset/base/286181 Log: MFC: r286090 The kernel option and module are actually called pmspcv. Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/pms.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Sun Aug 2 03:52:51 2015 (r286180) +++ stable/10/share/man/man4/Makefile Sun Aug 2 07:25:05 2015 (r286181) @@ -658,6 +658,7 @@ MLINKS+=pccbb.4 cbb.4 MLINKS+=pcm.4 snd.4 \ pcm.4 sound.4 MLINKS+=pcn.4 if_pcn.4 +MLINKS+=pms.4 pmspcv.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 Modified: stable/10/share/man/man4/pms.4 ============================================================================== --- stable/10/share/man/man4/pms.4 Sun Aug 2 03:52:51 2015 (r286180) +++ stable/10/share/man/man4/pms.4 Sun Aug 2 07:25:05 2015 (r286181) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2015 +.Dd July 30, 2015 .Dt PMS 4 .Os .Sh NAME @@ -35,14 +35,14 @@ To compile the driver into the kernel, place the following line in the kernel configuration file: .Bd -ragged -offset indent -.Cd "device pms" +.Cd "device pmspcv" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -pms_load="YES" +pmspcv_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-all@freebsd.org Sun Aug 2 09:08:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCA209AF44D; Sun, 2 Aug 2015 09:08:02 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A41EB10E3; Sun, 2 Aug 2015 09:08:02 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 542FBB9B; Sun, 2 Aug 2015 02:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1438506482; bh=kOenrv9vOI54ng9vQGGAEIBKAJ8/uo2FHz13wNkGems=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DwZA/R1DBMwA1VmvR6CV5j0jq9zjeSoGMeReDZQf3sflnQBUJ5laH3kwsvfHscQGS i8qQaqfNBZ6iJQyUxIZUfTNcbPvM1gA63FKKfsQZMVZZUjMzai6rI6zKvUM0crIQjG FgCb5w5D/0D9/gXgJju+b3IDfG2gVZnSKuaP1YNM= From: Peter Wemm To: svn-src-all@freebsd.org Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r285967 - stable/10/sys/kern Date: Sun, 02 Aug 2015 02:07:57 -0700 Message-ID: <15144036.GlIf25C7QW@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <201507281712.t6SHCfQE026689@repo.freebsd.org> References: <201507281712.t6SHCfQE026689@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart51377094.oKn2YAAcBO"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:08:02 -0000 --nextPart51377094.oKn2YAAcBO Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Tuesday, July 28, 2015 05:12:41 PM Konstantin Belousov wrote: > Author: kib > Date: Tue Jul 28 17:12:41 2015 > New Revision: 285967 > URL: https://svnweb.freebsd.org/changeset/base/285967 >=20 > Log: > MFC r284956: > Do not calculate the stack's bottom address twice. This is a bad MFC. stack_addr is different for ia64 in 10.x and this b= reaks=20 threading on ia64. eg: ntpd crashes on startup in the cluster machin= es. > Modified: > stable/10/sys/kern/kern_exec.c > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/sys/kern/kern_exec.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > =3D=3D --- stable/10/sys/kern/kern_exec.c=09Tue Jul 28 17:08:32 2015=09= (r285966) +++ > stable/10/sys/kern/kern_exec.c=09Tue Jul 28 17:12:41 2015=09(r285967)= @@ > -1116,7 +1116,7 @@ exec_new_vmspace(imgp, sv) > =09 * process stack so we can check the stack rlimit. > =09 */ > =09vmspace->vm_ssize =3D sgrowsiz >> PAGE_SHIFT; > -=09vmspace->vm_maxsaddr =3D (char *)sv->sv_usrstack - ssiz; > +=09vmspace->vm_maxsaddr =3D (char *)stack_addr; >=20 > =09return (0); > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org= " =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart51377094.oKn2YAAcBO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVvd3tAAoJEDXWlwnsgJ4EgaIIAKJ3uqkp7HdN883XLA5SgUQU gE7233tpMNUHOStkB0o1OT07CH/eLq40Py6LfBXPIC+DKXt7UZlZp2cdnzVgzBEK S+B60Ct2drDK7P/0B2gHHzidP4d9KezYt2gs8+u9Z9iaJkbSsp1WKO90pO2PvaJT 0pvZDc00PERG7FYKm6bmK93xDdl+4JNGRJWF3z20nLXR2ex+pvrpucGtYVXlK2At wkT/z9aclBeOF2iUTZRjjh9IwBzqRhF5F8vBUNEAaCULCAIovkFBe7qD/QHBLMUd mIOWHxzf1vcgLzDPq4GGVe6YZr3WlvcLsE9JNO4RKg701al/n8xoWvPBQmaI6LQ= =IyRt -----END PGP SIGNATURE----- --nextPart51377094.oKn2YAAcBO-- From owner-svn-src-all@freebsd.org Sun Aug 2 09:14:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 296309AF642; Sun, 2 Aug 2015 09:14:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 191A41610; Sun, 2 Aug 2015 09:14:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729EqVS043499; Sun, 2 Aug 2015 09:14:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729EqOE043498; Sun, 2 Aug 2015 09:14:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020914.t729EqOE043498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286182 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:14:53 -0000 Author: trasz Date: Sun Aug 2 09:14:52 2015 New Revision: 286182 URL: https://svnweb.freebsd.org/changeset/base/286182 Log: MFC r283286: Start documenting ctl(4) sysctls. Differential Revision: The FreeBSD Foundation Modified: stable/10/share/man/man4/ctl.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ctl.4 ============================================================================== --- stable/10/share/man/man4/ctl.4 Sun Aug 2 07:25:05 2015 (r286181) +++ stable/10/share/man/man4/ctl.4 Sun Aug 2 09:14:52 2015 (r286182) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 8, 2015 +.Dd May 22, 2015 .Dt CTL 4 .Os .Sh NAME @@ -84,6 +84,22 @@ All I/O handled in-kernel, no userland c .El .Pp It also serves as a kernel component of the native iSCSI target. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va kern.cam.ctl.iscsi.maxcmdsn_delta +The number of outstanding commands to advertise to the initiator. +Technically, it's the difference between ExpCmdSN and MaxCmdSN fields +in the iSCSI PDU. +.It Va kern.cam.ctl.iscsi.ping_timeout +The number of seconds to wait for the initiator to respond to a NOP-In +PDU. +In the event that there is no response within that time the session gets +forcibly terminated. .Sh SEE ALSO .Xr ctladm 8 , .Xr ctld 8 , From owner-svn-src-all@freebsd.org Sun Aug 2 09:21:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC4F49AF7FB; Sun, 2 Aug 2015 09:21:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEC951A9E; Sun, 2 Aug 2015 09:21:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729LWB0046746; Sun, 2 Aug 2015 09:21:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729LWC4046744; Sun, 2 Aug 2015 09:21:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020921.t729LWC4046744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286183 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:21:33 -0000 Author: trasz Date: Sun Aug 2 09:21:31 2015 New Revision: 286183 URL: https://svnweb.freebsd.org/changeset/base/286183 Log: MFC r284682: Expand sysctls descriptions for iscsi(4) and ctl(4). Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man4/ctl.4 stable/10/share/man/man4/iscsi.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ctl.4 ============================================================================== --- stable/10/share/man/man4/ctl.4 Sun Aug 2 09:14:52 2015 (r286182) +++ stable/10/share/man/man4/ctl.4 Sun Aug 2 09:21:31 2015 (r286183) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd May 22, 2015 +.Dd June 20, 2015 .Dt CTL 4 .Os .Sh NAME @@ -91,12 +91,17 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent +.It Va kern.cam.ctl.iscsi.debug +Verbosity level for log messages from the kernel part of iSCSI target. +Set to 0 to disable logging or 1 to warn about potential problems. +Larger values enable debugging output. +Defaults to 1. .It Va kern.cam.ctl.iscsi.maxcmdsn_delta -The number of outstanding commands to advertise to the initiator. -Technically, it's the difference between ExpCmdSN and MaxCmdSN fields +The number of outstanding commands to advertise to the iSCSI initiator. +Technically, it is the difference between ExpCmdSN and MaxCmdSN fields in the iSCSI PDU. .It Va kern.cam.ctl.iscsi.ping_timeout -The number of seconds to wait for the initiator to respond to a NOP-In +The number of seconds to wait for the iSCSI initiator to respond to a NOP-In PDU. In the event that there is no response within that time the session gets forcibly terminated. Modified: stable/10/share/man/man4/iscsi.4 ============================================================================== --- stable/10/share/man/man4/iscsi.4 Sun Aug 2 09:14:52 2015 (r286182) +++ stable/10/share/man/man4/iscsi.4 Sun Aug 2 09:21:31 2015 (r286183) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd September 11, 2014 +.Dd June 20, 2015 .Dt ISCSI 4 .Os .Sh NAME @@ -65,6 +65,13 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent +.It Va kern.iscsi.debug +Verbosity level for log messages from the +.Nm +driver. +Set to 0 to disable logging or 1 to warn about potential problems. +Larger values enable debugging output. +Defaults to 1. .It Va kern.iscsi.ping_timeout The number of seconds to wait for the target to respond to a NOP-Out PDU. From owner-svn-src-all@freebsd.org Sun Aug 2 09:23:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B24F9AF863; Sun, 2 Aug 2015 09:23:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AEBC1C51; Sun, 2 Aug 2015 09:23:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729NPPO047551; Sun, 2 Aug 2015 09:23:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729NPFa047550; Sun, 2 Aug 2015 09:23:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020923.t729NPFa047550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286184 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:23:25 -0000 Author: trasz Date: Sun Aug 2 09:23:24 2015 New Revision: 286184 URL: https://svnweb.freebsd.org/changeset/base/286184 Log: MFC r285100: Make ctl(4) appear in "man -k iscsi" results. Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man4/ctl.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ctl.4 ============================================================================== --- stable/10/share/man/man4/ctl.4 Sun Aug 2 09:21:31 2015 (r286183) +++ stable/10/share/man/man4/ctl.4 Sun Aug 2 09:23:24 2015 (r286184) @@ -23,12 +23,12 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 20, 2015 +.Dd July 3, 2015 .Dt CTL 4 .Os .Sh NAME .Nm ctl -.Nd CAM Target Layer +.Nd CAM Target Layer / iSCSI target .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your From owner-svn-src-all@freebsd.org Sun Aug 2 09:25:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 945A79AF900; Sun, 2 Aug 2015 09:25:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8397F1DB0; Sun, 2 Aug 2015 09:25:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729P6QZ047683; Sun, 2 Aug 2015 09:25:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729P60b047682; Sun, 2 Aug 2015 09:25:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020925.t729P60b047682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286185 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:25:06 -0000 Author: trasz Date: Sun Aug 2 09:25:05 2015 New Revision: 286185 URL: https://svnweb.freebsd.org/changeset/base/286185 Log: MFC r285251: Fix markup. Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libc/sys/open.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/open.2 ============================================================================== --- stable/10/lib/libc/sys/open.2 Sun Aug 2 09:23:24 2015 (r286184) +++ stable/10/lib/libc/sys/open.2 Sun Aug 2 09:25:05 2015 (r286185) @@ -427,7 +427,7 @@ of .Dv O_RDWR and .Dv O_EXEC . -.It Bq Eq EBADF +.It Bq Er EBADF The .Fa path argument does not specify an absolute path and the @@ -436,7 +436,7 @@ argument is neither .Dv AT_FDCWD nor a valid file descriptor open for searching. -.It Bq Eq ENOTDIR +.It Bq Er ENOTDIR The .Fa path argument is not an absolute path and @@ -444,7 +444,7 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. -.It Bq Eq ENOTDIR +.It Bq Er ENOTDIR .Dv O_DIRECTORY is specified and the file is not a directory. .El From owner-svn-src-all@freebsd.org Sun Aug 2 09:27:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B05F89AF980; Sun, 2 Aug 2015 09:27:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8115A1F03; Sun, 2 Aug 2015 09:27:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729R8Bu047828; Sun, 2 Aug 2015 09:27:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729R7qR047826; Sun, 2 Aug 2015 09:27:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020927.t729R7qR047826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286186 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:27:08 -0000 Author: trasz Date: Sun Aug 2 09:27:07 2015 New Revision: 286186 URL: https://svnweb.freebsd.org/changeset/base/286186 Log: MFC r285676: Expand sysctl descriptions in iscsi(4) and ctl(4). Sponsored by: The FreeBSD Foundation Modified: stable/10/share/man/man4/ctl.4 stable/10/share/man/man4/iscsi.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ctl.4 ============================================================================== --- stable/10/share/man/man4/ctl.4 Sun Aug 2 09:25:05 2015 (r286185) +++ stable/10/share/man/man4/ctl.4 Sun Aug 2 09:27:07 2015 (r286186) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd July 3, 2015 +.Dd July 11, 2015 .Dt CTL 4 .Os .Sh NAME @@ -100,11 +100,14 @@ Defaults to 1. The number of outstanding commands to advertise to the iSCSI initiator. Technically, it is the difference between ExpCmdSN and MaxCmdSN fields in the iSCSI PDU. +Defaults to 256. .It Va kern.cam.ctl.iscsi.ping_timeout The number of seconds to wait for the iSCSI initiator to respond to a NOP-In PDU. In the event that there is no response within that time the session gets forcibly terminated. +Set to 0 to disable sending NOP-In PDUs. +Defaults to 5. .Sh SEE ALSO .Xr ctladm 8 , .Xr ctld 8 , Modified: stable/10/share/man/man4/iscsi.4 ============================================================================== --- stable/10/share/man/man4/iscsi.4 Sun Aug 2 09:25:05 2015 (r286185) +++ stable/10/share/man/man4/iscsi.4 Sun Aug 2 09:27:07 2015 (r286186) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 20, 2015 +.Dd July 11, 2015 .Dt ISCSI 4 .Os .Sh NAME @@ -77,20 +77,25 @@ The number of seconds to wait for the ta PDU. In the event that there is no response within that time the session gets forcibly restarted. +Set to 0 to disable sending NOP-Out PDUs. +Defaults to 5. .It Va kern.iscsi.iscsid_timeout The number of seconds to wait for -.Xr ctld 8 +.Xr iscsid 8 to establish a session. After that time .Nm will abort and retry. +Defaults to 60. .It Va kern.iscsi.login_timeout The number of seconds to wait for a login attempt to succeed. After that time .Nm will abort and retry. +Defaults to 60. .It Va kern.iscsi.maxtags The maximum number of outstanding IO requests. +Defaults to 255. .It Va kern.iscsi.fail_on_disconnection Controls the behavior after an iSCSI connection has been dropped due to network problems. From owner-svn-src-all@freebsd.org Sun Aug 2 09:28:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB9A9AF9DA; Sun, 2 Aug 2015 09:28:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1FEA2; Sun, 2 Aug 2015 09:28:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729Sqm1047945; Sun, 2 Aug 2015 09:28:52 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729SqJD047944; Sun, 2 Aug 2015 09:28:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020928.t729SqJD047944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286187 - stable/10/usr.sbin/uefisign X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:28:52 -0000 Author: trasz Date: Sun Aug 2 09:28:51 2015 New Revision: 286187 URL: https://svnweb.freebsd.org/changeset/base/286187 Log: MFC r285671: uefisign(8) ships with 10.2. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/uefisign/uefisign.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/uefisign/uefisign.8 ============================================================================== --- stable/10/usr.sbin/uefisign/uefisign.8 Sun Aug 2 09:27:07 2015 (r286186) +++ stable/10/usr.sbin/uefisign/uefisign.8 Sun Aug 2 09:28:51 2015 (r286187) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2014 +.Dd July 11, 2015 .Dt UEFISIGN 8 .Os .Sh NAME @@ -84,7 +84,7 @@ View signature: The .Nm command appeared in -.Fx 11.0 . +.Fx 10.2 . .Sh AUTHORS The .Nm From owner-svn-src-all@freebsd.org Sun Aug 2 09:30:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF199AFBD5; Sun, 2 Aug 2015 09:30:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEC0E3A4; Sun, 2 Aug 2015 09:30:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729UiYw048772; Sun, 2 Aug 2015 09:30:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729UiTK048771; Sun, 2 Aug 2015 09:30:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020930.t729UiTK048771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286188 - stable/10/usr.sbin/fstyp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:30:45 -0000 Author: trasz Date: Sun Aug 2 09:30:43 2015 New Revision: 286188 URL: https://svnweb.freebsd.org/changeset/base/286188 Log: MFC r285672: fstyp(8) ships with 10.2. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/fstyp/fstyp.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/fstyp/fstyp.8 ============================================================================== --- stable/10/usr.sbin/fstyp/fstyp.8 Sun Aug 2 09:28:51 2015 (r286187) +++ stable/10/usr.sbin/fstyp/fstyp.8 Sun Aug 2 09:30:43 2015 (r286188) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2015 +.Dd July 11, 2015 .Dt FSTYP 8 .Os .Sh NAME @@ -88,7 +88,7 @@ type is not recognized. The .Nm command appeared in -.Fx 11.0 . +.Fx 10.2 . .Sh AUTHORS The .Nm From owner-svn-src-all@freebsd.org Sun Aug 2 09:34:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 881839AFC54; Sun, 2 Aug 2015 09:34:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75D61939; Sun, 2 Aug 2015 09:34:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729Y95l051880; Sun, 2 Aug 2015 09:34:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729Y4PE051864; Sun, 2 Aug 2015 09:34:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020934.t729Y4PE051864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286189 - in stable/10: lib/libc/posix1e share/man/man4 share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:34:09 -0000 Author: trasz Date: Sun Aug 2 09:34:03 2015 New Revision: 286189 URL: https://svnweb.freebsd.org/changeset/base/286189 Log: MFC r285873: Update Capsicum and Mandatory Access Control manual pages to no longer claim they are experimental. Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libc/posix1e/mac.3 stable/10/lib/libc/posix1e/mac.conf.5 stable/10/share/man/man4/capsicum.4 stable/10/share/man/man4/mac.4 stable/10/share/man/man4/mac_ifoff.4 stable/10/share/man/man4/mac_mls.4 stable/10/share/man/man4/mac_none.4 stable/10/share/man/man4/mac_partition.4 stable/10/share/man/man4/mac_seeotheruids.4 stable/10/share/man/man4/mac_stub.4 stable/10/share/man/man4/mac_test.4 stable/10/share/man/man4/procdesc.4 stable/10/share/man/man9/mac.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/posix1e/mac.3 ============================================================================== --- stable/10/lib/libc/posix1e/mac.3 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/lib/libc/posix1e/mac.3 Sun Aug 2 09:34:03 2015 (r286189) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2009 +.Dd July 25, 2015 .Dt MAC 3 .Os .Sh NAME @@ -163,14 +163,3 @@ Support for Mandatory Access Control was as part of the .Tn TrustedBSD Project. -.Sh BUGS -The -.Tn TrustedBSD -MAC Framework and associated policies, interfaces, and -applications are considered to be an experimental feature in -.Fx . -Sites considering production deployment should keep the experimental -status of these services in mind during any deployment process. -See also -.Xr mac 9 -for related considerations regarding the kernel framework. Modified: stable/10/lib/libc/posix1e/mac.conf.5 ============================================================================== --- stable/10/lib/libc/posix1e/mac.conf.5 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/lib/libc/posix1e/mac.conf.5 Sun Aug 2 09:34:03 2015 (r286189) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2003 +.Dd July 25, 2015 .Dt MAC.CONF 5 .Os .Sh NAME @@ -110,14 +110,3 @@ Support for Mandatory Access Control was as part of the .Tn TrustedBSD Project. -.Sh BUGS -The -.Tn TrustedBSD -MAC Framework and associated policies, interfaces, and -applications are considered to be an experimental feature in -.Fx . -Sites considering production deployment should keep the experimental -status of these services in mind during any deployment process. -See also -.Xr mac 9 -for related considerations regarding the kernel framework. Modified: stable/10/share/man/man4/capsicum.4 ============================================================================== --- stable/10/share/man/man4/capsicum.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/capsicum.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2013 +.Dd July 25, 2015 .Dt CAPSICUM 4 .Os .Sh NAME @@ -124,7 +124,3 @@ and .An "Kris Kennaway" Aq kris@FreeBSD.org at Google, Inc., and .An "Pawel Jakub Dawidek" Aq pawel@dawidek.net . -.Sh BUGS -.Nm -is considered experimental in -.Fx . Modified: stable/10/share/man/man4/mac.4 ============================================================================== --- stable/10/share/man/man4/mac.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd July 25, 2015 .Dt MAC 4 .Os .Sh NAME @@ -239,14 +239,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_ifoff.4 ============================================================================== --- stable/10/share/man/man4/mac_ifoff.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_ifoff.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 10, 2002 +.Dd July 25, 2015 .Dt MAC_IFOFF 4 .Os .Sh NAME @@ -118,14 +118,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_mls.4 ============================================================================== --- stable/10/share/man/man4/mac_mls.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_mls.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_MLS 4 .Os .Sh NAME @@ -236,14 +236,6 @@ Inc.\& under DARPA/SPAWAR contract N6600 .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_none.4 ============================================================================== --- stable/10/share/man/man4/mac_none.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_none.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_NONE 4 .Os .Sh NAME @@ -98,14 +98,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_partition.4 ============================================================================== --- stable/10/share/man/man4/mac_partition.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_partition.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2002 +.Dd July 25, 2015 .Dt MAC_PARTITION 4 .Os .Sh NAME @@ -118,14 +118,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_seeotheruids.4 ============================================================================== --- stable/10/share/man/man4/mac_seeotheruids.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_seeotheruids.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2005 +.Dd July 25, 2015 .Dt MAC_SEEOTHERUIDS 4 .Os .Sh NAME @@ -116,14 +116,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_stub.4 ============================================================================== --- stable/10/share/man/man4/mac_stub.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_stub.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_STUB 4 .Os .Sh NAME @@ -101,14 +101,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/mac_test.4 ============================================================================== --- stable/10/share/man/man4/mac_test.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/mac_test.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2002 +.Dd July 25, 2015 .Dt MAC_TEST 4 .Os .Sh NAME @@ -102,14 +102,6 @@ under DARPA/SPAWAR contract N66001-01-C- .Pq Dq CBOSS , as part of the DARPA CHATS research program. .Sh BUGS -See -.Xr mac 9 -concerning appropriateness for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. Modified: stable/10/share/man/man4/procdesc.4 ============================================================================== --- stable/10/share/man/man4/procdesc.4 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man4/procdesc.4 Sun Aug 2 09:34:03 2015 (r286189) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2013 +.Dd July 25, 2015 .Dt PROCDESC 4 .Os .Sh NAME @@ -87,7 +87,3 @@ at the University of Cambridge, and and .An "Kris Kennaway" Aq kris@FreeBSD.org at Google, Inc. -.Sh BUGS -.Nm -is considered experimental in -.Fx . Modified: stable/10/share/man/man9/mac.9 ============================================================================== --- stable/10/share/man/man9/mac.9 Sun Aug 2 09:30:43 2015 (r286188) +++ stable/10/share/man/man9/mac.9 Sun Aug 2 09:34:03 2015 (r286189) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2006 +.Dd July 25, 2015 .Dt MAC 9 .Os .Sh NAME @@ -62,14 +62,6 @@ opportunity to modify security behavior Both consumers of the API (normal kernel services) and security modules must be aware of the semantics of the API calls, particularly with respect to synchronization primitives (such as locking). -.Ss Note on Appropriateness for Production Use -The -.Tn TrustedBSD -MAC Framework included in -.Fx 5.0 -is considered experimental, and should not be deployed in production -environments without careful consideration of the risks associated with -the use of experimental operating system features. .Ss Kernel Objects Supported by the Framework The MAC framework manages labels on a variety of types of in-kernel objects, including process credentials, vnodes, devfs_dirents, mount @@ -232,13 +224,6 @@ Additional contributors include: and .An Tim Robbins . .Sh BUGS -See the earlier section in this document concerning appropriateness -for production use. -The -.Tn TrustedBSD -MAC Framework is considered experimental in -.Fx . -.Pp While the MAC Framework design is intended to support the containment of the root user, not all attack channels are currently protected by entry point checks. From owner-svn-src-all@freebsd.org Sun Aug 2 09:35:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C44A9AFCAE; Sun, 2 Aug 2015 09:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0A5A71; Sun, 2 Aug 2015 09:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729ZrKT052011; Sun, 2 Aug 2015 09:35:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729ZrWX052010; Sun, 2 Aug 2015 09:35:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020935.t729ZrWX052010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286190 - stable/10/sbin/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:35:54 -0000 Author: trasz Date: Sun Aug 2 09:35:53 2015 New Revision: 286190 URL: https://svnweb.freebsd.org/changeset/base/286190 Log: MFC r285673: Add CARP events description to devd.conf(5). Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/devd/devd.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.conf.5 ============================================================================== --- stable/10/sbin/devd/devd.conf.5 Sun Aug 2 09:34:03 2015 (r286189) +++ stable/10/sbin/devd/devd.conf.5 Sun Aug 2 09:35:53 2015 (r286190) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd May 13, 2015 +.Dd July 11, 2015 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -336,6 +336,26 @@ Processor state/configuration ($notify=0 Thermal zone events. .El .Pp +.It Li CARP +Events related to the +.Xr carp 8 +protocol. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Ar vhid@interface +The +.Dq subsystem +contains the actual CARP vhid and the name of the network interface +on which the event took place. +.Bl -tag -width ".Li MASTER" -compact +.It Sy Type +.It Li MASTER +Node become the master for a virtual host. +.It Li BACKUP +Node become the backup for a virtual host. +.El +.El +.Pp .It Li IFNET Events related to the network subsystem. .Bl -tag -width ".Sy Subsystem" -compact From owner-svn-src-all@freebsd.org Sun Aug 2 09:37:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE3959AFD01; Sun, 2 Aug 2015 09:37:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF16BF3; Sun, 2 Aug 2015 09:37:48 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729bmx1052146; Sun, 2 Aug 2015 09:37:48 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729bmGa052145; Sun, 2 Aug 2015 09:37:48 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020937.t729bmGa052145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286191 - stable/10/sbin/devd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:37:48 -0000 Author: trasz Date: Sun Aug 2 09:37:47 2015 New Revision: 286191 URL: https://svnweb.freebsd.org/changeset/base/286191 Log: MFC r285674: Document suspend/resume notification in devd.conf(5). Sponsored by: The FreeBSD Foundation Modified: stable/10/sbin/devd/devd.conf.5 Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.conf.5 ============================================================================== --- stable/10/sbin/devd/devd.conf.5 Sun Aug 2 09:35:53 2015 (r286190) +++ stable/10/sbin/devd/devd.conf.5 Sun Aug 2 09:37:47 2015 (r286191) @@ -332,6 +332,10 @@ Battery events. Lid state ($notify=0x00 is closed, 0x01 is open). .It Li PROCESSOR Processor state/configuration ($notify=0x81 is a change in available Cx states). +.It Li Resume +Resume notification. +.It Li Suspend +Suspend notification. .It Li Thermal Thermal zone events. .El From owner-svn-src-all@freebsd.org Sun Aug 2 09:39:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55149AFDA3; Sun, 2 Aug 2015 09:39:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A545AD3C; Sun, 2 Aug 2015 09:39:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t729dgLj052277; Sun, 2 Aug 2015 09:39:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t729dgnD052276; Sun, 2 Aug 2015 09:39:42 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508020939.t729dgnD052276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 09:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286192 - stable/10/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 09:39:42 -0000 Author: trasz Date: Sun Aug 2 09:39:41 2015 New Revision: 286192 URL: https://svnweb.freebsd.org/changeset/base/286192 Log: MFC r285675: Remove a comment in the wrong place. Sponsored by: The FreeBSD Foundation Modified: stable/10/etc/devd.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/devd.conf ============================================================================== --- stable/10/etc/devd.conf Sun Aug 2 09:37:47 2015 (r286191) +++ stable/10/etc/devd.conf Sun Aug 2 09:39:41 2015 (r286192) @@ -296,7 +296,6 @@ detach 10 { # Button: Button pressed (0 for power, 1 for sleep) # CMBAT: ACPI battery events # Lid: Lid state (0 is closed, 1 is open) -# RCTL: Resource limits # Suspend, Resume: Suspend and resume notification # Thermal: ACPI thermal zone events # From owner-svn-src-all@freebsd.org Sun Aug 2 10:09:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18ECC9B043D; Sun, 2 Aug 2015 10:09:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07BFA1911; Sun, 2 Aug 2015 10:09:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72A90W3064476; Sun, 2 Aug 2015 10:09:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72A8wKo064462; Sun, 2 Aug 2015 10:08:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508021008.t72A8wKo064462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 2 Aug 2015 10:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286193 - in stable/10: sys/geom/label usr.sbin/fstyp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 10:09:01 -0000 Author: trasz Date: Sun Aug 2 10:08:57 2015 New Revision: 286193 URL: https://svnweb.freebsd.org/changeset/base/286193 Log: MFC r284582: Fix off-by-one error in fstyp(8) and geom_label(4) that made them use a single space (" ") as a CD9660 label name when no label was present. Similar problem was also present in msdosfs label recognition. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/geom/label/g_label.c stable/10/sys/geom/label/g_label.h stable/10/sys/geom/label/g_label_iso9660.c stable/10/sys/geom/label/g_label_msdosfs.c stable/10/usr.sbin/fstyp/cd9660.c stable/10/usr.sbin/fstyp/fstyp.c stable/10/usr.sbin/fstyp/fstyp.h stable/10/usr.sbin/fstyp/msdosfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/label/g_label.c ============================================================================== --- stable/10/sys/geom/label/g_label.c Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/sys/geom/label/g_label.c Sun Aug 2 10:08:57 2015 (r286193) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -93,6 +94,20 @@ const struct g_label_desc *g_labels[] = NULL }; +void +g_label_rtrim(char *label, size_t size) +{ + ptrdiff_t i; + + for (i = size - 1; i >= 0; i--) { + if (label[i] == '\0') + continue; + else if (label[i] == ' ') + label[i] = '\0'; + else + break; + } +} static int g_label_destroy_geom(struct gctl_req *req __unused, struct g_class *mp, Modified: stable/10/sys/geom/label/g_label.h ============================================================================== --- stable/10/sys/geom/label/g_label.h Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/sys/geom/label/g_label.h Sun Aug 2 10:08:57 2015 (r286193) @@ -88,6 +88,8 @@ extern struct g_label_desc g_label_ntfs; extern struct g_label_desc g_label_gpt; extern struct g_label_desc g_label_gpt_uuid; extern struct g_label_desc g_label_disk_ident; + +extern void g_label_rtrim(char *label, size_t size); #endif /* _KERNEL */ struct g_label_metadata { Modified: stable/10/sys/geom/label/g_label_iso9660.c ============================================================================== --- stable/10/sys/geom/label/g_label_iso9660.c Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/sys/geom/label/g_label_iso9660.c Sun Aug 2 10:08:57 2015 (r286193) @@ -47,7 +47,6 @@ g_label_iso9660_taste(struct g_consumer { struct g_provider *pp; char *sector, *volume; - int i; g_topology_assert_not(); pp = cp->provider; @@ -68,14 +67,7 @@ g_label_iso9660_taste(struct g_consumer bzero(label, size); strlcpy(label, volume, MIN(size, VOLUME_LEN)); g_free(sector); - for (i = size - 1; i > 0; i--) { - if (label[i] == '\0') - continue; - else if (label[i] == ' ') - label[i] = '\0'; - else - break; - } + g_label_rtrim(label, size); } struct g_label_desc g_label_iso9660 = { Modified: stable/10/sys/geom/label/g_label_msdosfs.c ============================================================================== --- stable/10/sys/geom/label/g_label_msdosfs.c Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/sys/geom/label/g_label_msdosfs.c Sun Aug 2 10:08:57 2015 (r286193) @@ -48,7 +48,6 @@ g_label_msdosfs_taste(struct g_consumer FAT32_BSBPB *pfat32_bsbpb; FAT_DES *pfat_entry; uint8_t *sector0, *sector; - uint32_t i; g_topology_assert_not(); pp = cp->provider; @@ -200,14 +199,7 @@ g_label_msdosfs_taste(struct g_consumer } endofchecks: - for (i = size - 1; i > 0; i--) { - if (label[i] == '\0') - continue; - else if (label[i] == ' ') - label[i] = '\0'; - else - break; - } + g_label_rtrim(label, size); error: if (sector0 != NULL) Modified: stable/10/usr.sbin/fstyp/cd9660.c ============================================================================== --- stable/10/usr.sbin/fstyp/cd9660.c Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/usr.sbin/fstyp/cd9660.c Sun Aug 2 10:08:57 2015 (r286193) @@ -45,7 +45,6 @@ int fstyp_cd9660(FILE *fp, char *label, size_t size) { char *sector, *volume; - int i; sector = read_buf(fp, ISO9660_OFFSET, 512); if (sector == NULL) @@ -58,13 +57,6 @@ fstyp_cd9660(FILE *fp, char *label, size bzero(label, size); strlcpy(label, volume, MIN(size, VOLUME_LEN)); free(sector); - for (i = size - 1; i > 0; i--) { - if (label[i] == '\0') - continue; - else if (label[i] == ' ') - label[i] = '\0'; - else - break; - } + rtrim(label, size); return (0); } Modified: stable/10/usr.sbin/fstyp/fstyp.c ============================================================================== --- stable/10/usr.sbin/fstyp/fstyp.c Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/usr.sbin/fstyp/fstyp.c Sun Aug 2 10:08:57 2015 (r286193) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,6 +105,21 @@ checked_strdup(const char *s) return (c); } +void +rtrim(char *label, size_t size) +{ + ptrdiff_t i; + + for (i = size - 1; i >= 0; i--) { + if (label[i] == '\0') + continue; + else if (label[i] == ' ') + label[i] = '\0'; + else + break; + } +} + static void usage(void) { Modified: stable/10/usr.sbin/fstyp/fstyp.h ============================================================================== --- stable/10/usr.sbin/fstyp/fstyp.h Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/usr.sbin/fstyp/fstyp.h Sun Aug 2 10:08:57 2015 (r286193) @@ -36,6 +36,7 @@ void *read_buf(FILE *fp, off_t off, size_t len); char *checked_strdup(const char *s); +void rtrim(char *label, size_t size); int fstyp_cd9660(FILE *fp, char *label, size_t size); int fstyp_ext2fs(FILE *fp, char *label, size_t size); Modified: stable/10/usr.sbin/fstyp/msdosfs.c ============================================================================== --- stable/10/usr.sbin/fstyp/msdosfs.c Sun Aug 2 09:39:41 2015 (r286192) +++ stable/10/usr.sbin/fstyp/msdosfs.c Sun Aug 2 10:08:57 2015 (r286193) @@ -48,7 +48,6 @@ fstyp_msdosfs(FILE *fp, char *label, siz FAT32_BSBPB *pfat32_bsbpb; FAT_DES *pfat_entry; uint8_t *sector0, *sector; - uint32_t i; sector0 = NULL; sector = NULL; @@ -161,14 +160,7 @@ fstyp_msdosfs(FILE *fp, char *label, siz } endofchecks: - for (i = size - 1; i > 0; i--) { - if (label[i] == '\0') - continue; - else if (label[i] == ' ') - label[i] = '\0'; - else - break; - } + rtrim(label, size); free(sector0); free(sector); From owner-svn-src-all@freebsd.org Sun Aug 2 11:43:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 447279B1A18; Sun, 2 Aug 2015 11:43:32 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 017871F18; Sun, 2 Aug 2015 11:43:31 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8387A25D3897; Sun, 2 Aug 2015 11:43:28 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 701D9C76FD4; Sun, 2 Aug 2015 11:43:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id JTys-3dlMZ3U; Sun, 2 Aug 2015 11:43:26 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:a9f2:c962:3e4a:6bcd] (unknown [IPv6:fde9:577b:c1a9:4410:a9f2:c962:3e4a:6bcd]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0E0D8C76FD3; Sun, 2 Aug 2015 11:43:24 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: svn commit: r286168 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <201508020015.t720Fr6R018929@repo.freebsd.org> Date: Sun, 2 Aug 2015 11:42:50 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201508020015.t720Fr6R018929@repo.freebsd.org> To: John-Mark Gurney X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 11:43:32 -0000 > On 02 Aug 2015, at 00:15 , John-Mark Gurney wrote: > -CTASSERT(sizeof(struct sadb_x_policy) =3D=3D 16); > +_Static_assert(sizeof(struct sadb_x_policy) =3D=3D 16, "struct size = mismatch"); If this fires, how does it look like? I am assuming the string at the = end is the error message? If so and if the assertion is not printed = that string should be improved rather than being the same for all = checks. /bz= From owner-svn-src-all@freebsd.org Sun Aug 2 11:58:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5E269B1C04; Sun, 2 Aug 2015 11:58:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D32D96EB; Sun, 2 Aug 2015 11:58:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72BwPDu009656; Sun, 2 Aug 2015 11:58:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72BwPe2009655; Sun, 2 Aug 2015 11:58:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201508021158.t72BwPe2009655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 2 Aug 2015 11:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286194 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 11:58:26 -0000 Author: ae Date: Sun Aug 2 11:58:24 2015 New Revision: 286194 URL: https://svnweb.freebsd.org/changeset/base/286194 Log: Remove redundant check. Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Aug 2 10:08:57 2015 (r286193) +++ head/sys/netinet6/in6_src.c Sun Aug 2 11:58:24 2015 (r286194) @@ -640,14 +640,9 @@ selectroute(struct sockaddr_in6 *dstsock if (ron->ro_rt == NULL) { in6_rtalloc(ron, fibnum); /* multi path case? */ if (ron->ro_rt == NULL) { - /* XXX-BZ WT.? */ - if (ron->ro_rt) { - RTFREE(ron->ro_rt); - ron->ro_rt = NULL; - } error = EHOSTUNREACH; goto done; - } + } } rt = ron->ro_rt; From owner-svn-src-all@freebsd.org Sun Aug 2 12:40:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCBD99B0960; Sun, 2 Aug 2015 12:40:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B479A18AD; Sun, 2 Aug 2015 12:40:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72Cevgi028635; Sun, 2 Aug 2015 12:40:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72Cev9i028634; Sun, 2 Aug 2015 12:40:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201508021240.t72Cev9i028634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 2 Aug 2015 12:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286195 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 12:40:58 -0000 Author: ae Date: Sun Aug 2 12:40:56 2015 New Revision: 286195 URL: https://svnweb.freebsd.org/changeset/base/286195 Log: Properly handle IPV6_NEXTHOP socket option in selectroute(). o remove disabled code; o if nexthop address is link-local, use embedded scope zone id to determine outgoing interface; o properly fill ro_dst before doing route lookup; o remove LLE lookup, instead check rt_flags for RTF_GATEWAY bit. Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Sun Aug 2 11:58:24 2015 (r286194) +++ head/sys/netinet6/in6_src.c Sun Aug 2 12:40:56 2015 (r286195) @@ -616,77 +616,38 @@ selectroute(struct sockaddr_in6 *dstsock */ if (opts && opts->ip6po_nexthop) { struct route_in6 *ron; - struct llentry *la; - - sin6_next = satosin6(opts->ip6po_nexthop); - - /* at this moment, we only support AF_INET6 next hops */ - if (sin6_next->sin6_family != AF_INET6) { - error = EAFNOSUPPORT; /* or should we proceed? */ - goto done; - } - - /* - * If the next hop is an IPv6 address, then the node identified - * by that address must be a neighbor of the sending host. - */ - ron = &opts->ip6po_nextroute; - /* - * XXX what do we do here? - * PLZ to be fixing - */ - - if (ron->ro_rt == NULL) { - in6_rtalloc(ron, fibnum); /* multi path case? */ - if (ron->ro_rt == NULL) { - error = EHOSTUNREACH; + sin6_next = satosin6(opts->ip6po_nexthop); + if (IN6_IS_ADDR_LINKLOCAL(&sin6_next->sin6_addr)) { + /* + * Next hop is LLA, thus it should be neighbor. + * Determine outgoing interface by zone index. + */ + zoneid = ntohs(in6_getscope(&sin6_next->sin6_addr)); + if (zoneid > 0) { + ifp = in6_getlinkifnet(zoneid); goto done; } } - - rt = ron->ro_rt; - ifp = rt->rt_ifp; - IF_AFDATA_RLOCK(ifp); - la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)sin6_next); - IF_AFDATA_RUNLOCK(ifp); - if (la != NULL) - LLE_RUNLOCK(la); - else { - error = EHOSTUNREACH; - goto done; - } -#if 0 - if ((ron->ro_rt && - (ron->ro_rt->rt_flags & (RTF_UP | RTF_LLINFO)) != - (RTF_UP | RTF_LLINFO)) || - !IN6_ARE_ADDR_EQUAL(&satosin6(&ron->ro_dst)->sin6_addr, - &sin6_next->sin6_addr)) { - if (ron->ro_rt) { - RTFREE(ron->ro_rt); - ron->ro_rt = NULL; - } - *satosin6(&ron->ro_dst) = *sin6_next; - } + ron = &opts->ip6po_nextroute; + /* Use a cached route if it exists and is valid. */ + if (ron->ro_rt != NULL && ( + (ron->ro_rt->rt_flags & RTF_UP) == 0 || + ron->ro_dst.sin6_family != AF_INET6 || + !IN6_ARE_ADDR_EQUAL(&ron->ro_dst.sin6_addr, + &sin6_next->sin6_addr))) + RO_RTFREE(ron); if (ron->ro_rt == NULL) { + ron->ro_dst = *sin6_next; in6_rtalloc(ron, fibnum); /* multi path case? */ - if (ron->ro_rt == NULL || - !(ron->ro_rt->rt_flags & RTF_LLINFO)) { - if (ron->ro_rt) { - RTFREE(ron->ro_rt); - ron->ro_rt = NULL; - } - error = EHOSTUNREACH; - goto done; - } } -#endif - /* - * When cloning is required, try to allocate a route to the - * destination so that the caller can store path MTU - * information. + * The node identified by that address must be a + * neighbor of the sending host. */ + if (ron->ro_rt == NULL || + (ron->ro_rt->rt_flags & RTF_GATEWAY) != 0) + error = EHOSTUNREACH; goto done; } From owner-svn-src-all@freebsd.org Sun Aug 2 12:47:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D18C9B0AE4; Sun, 2 Aug 2015 12:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71C641BCF; Sun, 2 Aug 2015 12:47:53 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72ClrkO032200; Sun, 2 Aug 2015 12:47:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72ClpqG032194; Sun, 2 Aug 2015 12:47:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021247.t72ClpqG032194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286196 - in head/usr.sbin/pw: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 12:47:53 -0000 Author: bapt Date: Sun Aug 2 12:47:50 2015 New Revision: 286196 URL: https://svnweb.freebsd.org/changeset/base/286196 Log: Rewrite parsing subcommands arguments of pw(8) Now each subcommands checks its arguments in a dedicated functions. This helps improving input validation, code readability/maintainability While here: - Add a -y option to pw userdel/usermod so it can maintain NIS servers if nispasswd is not defined in pw.conf(5) - Allow pw -r to remove directory with userdel -r - Fix bug when renaming a user which was not renaming the user name it groups it is a member of. - Only parse pw.conf(5) when needed. Added: head/usr.sbin/pw/pw_utils.c (contents, props changed) Modified: head/usr.sbin/pw/Makefile head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pwupd.h head/usr.sbin/pw/strtounum.c head/usr.sbin/pw/tests/pw_groupdel.sh head/usr.sbin/pw/tests/pw_useradd.sh head/usr.sbin/pw/tests/pw_userdel.sh head/usr.sbin/pw/tests/pw_usermod.sh Modified: head/usr.sbin/pw/Makefile ============================================================================== --- head/usr.sbin/pw/Makefile Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/Makefile Sun Aug 2 12:47:50 2015 (r286196) @@ -3,7 +3,8 @@ PROG= pw MAN= pw.conf.5 pw.8 SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ - grupd.c pwupd.c psdate.c bitmap.c cpdir.c rm_r.c strtounum.c + grupd.c pwupd.c psdate.c bitmap.c cpdir.c rm_r.c strtounum.c \ + pw_utils.c WARNS?= 3 Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw.c Sun Aug 2 12:47:50 2015 (r286196) @@ -37,9 +37,6 @@ static const char rcsid[] = #include #include "pw.h" -#if !defined(_PATH_YP) -#define _PATH_YP "/var/yp/" -#endif const char *Modes[] = { "add", "del", "mod", "show", "next", NULL}; @@ -85,55 +82,39 @@ struct pwf VPWF = vgetgrnam, }; -struct pwconf conf; - -static struct cargs arglist; +static int (*cmdfunc[W_NUM][M_NUM])(int argc, char **argv, char *_name) = { + { /* user */ + pw_user_add, + pw_user_del, + pw_user_mod, + pw_user_show, + pw_user_next, + pw_user_lock, + pw_user_unlock, + }, + { /* group */ + pw_group_add, + pw_group_del, + pw_group_mod, + pw_group_show, + pw_group_next, + } +}; -static int getindex(const char *words[], const char *word); -static void cmdhelp(int mode, int which); +struct pwconf conf; +static int getindex(const char *words[], const char *word); +static void cmdhelp(int mode, int which); int main(int argc, char *argv[]) { - int ch; - int mode = -1; - int which = -1; - long id = -1; - char *config = NULL; + int mode = -1, which = -1, tmp; struct stat st; - const char *errstr; - char arg, *name; + char arg, *arg1; bool relocated, nis; - static const char *opts[W_NUM][M_NUM] = - { - { /* user */ - "R:V:C:qn:u:c:d:e:p:g:G:mM:k:s:oL:i:w:h:H:Db:NPy:Y", - "R:V:C:qn:u:rY", - "R:V:C:qn:u:c:d:e:p:g:G:mM:l:k:s:w:L:h:H:FNPY", - "R:V:C:qn:u:FPa7", - "R:V:C:q", - "R:V:C:q", - "R:V:C:q" - }, - { /* grp */ - "R:V:C:qn:g:h:H:M:opNPY", - "R:V:C:qn:g:Y", - "R:V:C:qn:d:g:l:h:H:FM:m:NPY", - "R:V:C:qn:g:FPa", - "R:V:C:q" - } - }; - - static int (*funcs[W_NUM]) (int _mode, char *_name, long _id, - struct cargs * _args) = - { /* Request handlers */ - pw_user, - pw_group - }; - - name = NULL; + arg1 = NULL; relocated = nis = false; memset(&conf, 0, sizeof(conf)); strlcpy(conf.rootdir, "/", sizeof(conf.rootdir)); @@ -141,17 +122,13 @@ main(int argc, char *argv[]) conf.fd = -1; conf.checkduplicate = true; - LIST_INIT(&arglist); - - (void)setlocale(LC_ALL, ""); + setlocale(LC_ALL, ""); /* * Break off the first couple of words to determine what exactly * we're being asked to do */ while (argc > 1) { - int tmp; - if (*argv[1] == '-') { /* * Special case, allow pw -V [args] for scripts etc. @@ -197,15 +174,9 @@ main(int argc, char *argv[]) mode = tmp % M_NUM; } else if (strcmp(argv[1], "help") == 0 && argv[2] == NULL) cmdhelp(mode, which); - else if (which != -1 && mode != -1) { - if (strspn(argv[1], "0123456789") == strlen(argv[1])) { - id = strtounum(argv[1], 0, UID_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad id '%s': %s", - argv[1], errstr); - } else - name = argv[1]; - } else + else if (which != -1 && mode != -1) + arg1 = argv[1]; + else errx(EX_USAGE, "unknown keyword `%s'", argv[1]); ++argv; --argc; @@ -220,193 +191,22 @@ main(int argc, char *argv[]) conf.rootfd = open(conf.rootdir, O_DIRECTORY|O_CLOEXEC); if (conf.rootfd == -1) errx(EXIT_FAILURE, "Unable to open '%s'", conf.rootdir); - conf.which = which; - /* - * We know which mode we're in and what we're about to do, so now - * let's dispatch the remaining command line args in a genric way. - */ - optarg = NULL; - - while ((ch = getopt(argc, argv, opts[which][mode])) != -1) { - switch (ch) { - case '?': - errx(EX_USAGE, "unknown switch"); - break; - case '7': - conf.v7 = true; - break; - case 'C': - conf.config = optarg; - config = conf.config; - break; - case 'F': - conf.force = true; - break; - case 'N': - conf.dryrun = true; - break; - case 'l': - if (strlen(optarg) >= MAXLOGNAME) - errx(EX_USAGE, "new name too long: %s", optarg); - conf.newname = optarg; - break; - case 'P': - conf.pretty = true; - break; - case 'Y': - nis = true; - break; - case 'a': - conf.all = true; - break; - case 'c': - conf.gecos = pw_checkname(optarg, 1); - break; - case 'g': - if (which == 0) { /* for user* */ - addarg(&arglist, 'g', optarg); - break; - } - if (strspn(optarg, "0123456789") != strlen(optarg)) - errx(EX_USAGE, "-g expects a number"); - id = strtounum(optarg, 0, GID_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad id '%s': %s", optarg, - errstr); - break; - case 'u': - if (strspn(optarg, "0123456789,") != strlen(optarg)) - errx(EX_USAGE, "-u expects a number"); - if (strchr(optarg, ',') != NULL) { - addarg(&arglist, 'u', optarg); - break; - } - id = strtounum(optarg, 0, UID_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad id '%s': %s", optarg, - errstr); - break; - case 'n': - name = optarg; - break; - case 'H': - if (conf.fd != -1) - errx(EX_USAGE, "'-h' and '-H' are mutually " - "exclusive options"); - conf.precrypted = true; - if (strspn(optarg, "0123456789") != strlen(optarg)) - errx(EX_USAGE, "'-H' expects a file descriptor"); - - conf.fd = strtonum(optarg, 0, INT_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "Bad file descriptor '%s': %s", - optarg, errstr); - break; - case 'h': - if (conf.fd != -1) - errx(EX_USAGE, "'-h' and '-H' are mutually " - "exclusive options"); - - if (strcmp(optarg, "-") == 0) - conf.fd = '-'; - else if (strspn(optarg, "0123456789") == strlen(optarg)) { - conf.fd = strtonum(optarg, 0, INT_MAX, &errstr); - if (errstr != NULL) - errx(EX_USAGE, "'-h' expects a " - "file descriptor or '-'"); - } else - errx(EX_USAGE, "'-h' expects a file " - "descriptor or '-'"); - break; - case 'o': - conf.checkduplicate = false; - break; - case 'q': - conf.quiet = true; - break; - case 'r': - conf.deletehome = true; - break; - default: - addarg(&arglist, ch, optarg); - break; - } - optarg = NULL; - } - - if (name != NULL && strlen(name) >= MAXLOGNAME) - errx(EX_USAGE, "name too long: %s", name); - - /* - * Must be root to attempt an update - */ - if (geteuid() != 0 && mode != M_PRINT && mode != M_NEXT && !conf.dryrun) - errx(EX_NOPERM, "you must be root to run this program"); - - /* - * We should immediately look for the -q 'quiet' switch so that we - * don't bother with extraneous errors - */ - if (conf.quiet) - freopen(_PATH_DEVNULL, "w", stderr); - - /* - * Set our base working path if not overridden - */ - - if (config == NULL) { /* Only override config location if -C not specified */ - asprintf(&config, "%s/pw.conf", conf.etcpath); - if (config == NULL) - errx(EX_OSERR, "out of memory"); - } - - /* - * Now, let's do the common initialisation - */ - conf.userconf = read_userconfig(config); - - ch = funcs[which] (mode, name, id, &arglist); - - /* - * If everything went ok, and we've been asked to update - * the NIS maps, then do it now - */ - if (ch == EXIT_SUCCESS && nis) { - pid_t pid; - fflush(NULL); - if (chdir(_PATH_YP) == -1) - warn("chdir(" _PATH_YP ")"); - else if ((pid = fork()) == -1) - warn("fork()"); - else if (pid == 0) { - /* Is make anywhere else? */ - execlp("/usr/bin/make", "make", (char *)NULL); - _exit(1); - } else { - int i; - waitpid(pid, &i, 0); - if ((i = WEXITSTATUS(i)) != 0) - errx(ch, "make exited with status %d", i); - else - pw_log(conf.userconf, mode, which, "NIS maps updated"); - } - } - return ch; + return (cmdfunc[which][mode](argc, argv, arg1)); } static int getindex(const char *words[], const char *word) { - int i = 0; + int i = 0; while (words[i]) { if (strcmp(words[i], word) == 0) - return i; + return (i); i++; } - return -1; + return (-1); } @@ -456,7 +256,7 @@ cmdhelp(int mode, int which) " Setting defaults:\n" "\t-V etcdir alternate /etc location\n" "\t-R rootir alternate root directory\n" - "\t-D set user defaults\n" + "\t-D set user defaults\n" "\t-b dir default home root dir\n" "\t-e period default expiry period\n" "\t-p period default password change period\n" @@ -476,6 +276,7 @@ cmdhelp(int mode, int which) "\t-n name login name\n" "\t-u uid user id\n" "\t-Y update NIS maps\n" + "\t-y path set NIS passwd file path\n" "\t-r remove home & contents\n", "usage: pw usermod [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" @@ -500,6 +301,7 @@ cmdhelp(int mode, int which) "\t-h fd read password on fd\n" "\t-H fd read encrypted password on fd\n" "\t-Y update NIS maps\n" + "\t-y path set NIS passwd file path\n" "\t-N no update\n", "usage: pw usershow [uid|name] [switches]\n" "\t-V etcdir alternate /etc location\n" @@ -576,31 +378,3 @@ cmdhelp(int mode, int which) } exit(EXIT_FAILURE); } - -struct carg * -getarg(struct cargs * _args, int ch) -{ - struct carg *c; - - if (_args == NULL) - return (NULL); - - c = LIST_FIRST(_args); - - while (c != NULL && c->ch != ch) - c = LIST_NEXT(c, list); - return c; -} - -struct carg * -addarg(struct cargs * _args, int ch, char *argstr) -{ - struct carg *ca = malloc(sizeof(struct carg)); - - if (ca == NULL) - errx(EX_OSERR, "out of memory"); - ca->ch = ch; - ca->val = argstr; - LIST_INSERT_HEAD(_args, ca, list); - return ca; -} Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw.h Sun Aug 2 12:47:50 2015 (r286196) @@ -78,21 +78,41 @@ LIST_HEAD(cargs, carg); #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 +struct userconf *get_userconfig(const char *cfg); struct userconf *read_userconfig(char const * file); -int write_userconfig(char const * file); +int write_userconfig(struct userconf *cnf, char const * file); struct carg *addarg(struct cargs * _args, int ch, char *argstr); struct carg *getarg(struct cargs * _args, int ch); -int pw_user(int mode, char *name, long id, struct cargs * _args); -int pw_usernext(struct userconf *cnf, bool quiet); -int pw_group(int mode, char *name, long id, struct cargs * _args); +int pw_group_add(int argc, char **argv, char *name); +int pw_group_del(int argc, char **argv, char *name); +int pw_group_mod(int argc, char **argv, char *name); +int pw_group_next(int argc, char **argv, char *name); +int pw_group_show(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_add(int argc, char **argv, char *name); +int pw_user_del(int argc, char **argv, char *name); +int pw_user_lock(int argc, char **argv, char *name); +int pw_user_mod(int argc, char **argv, char *name); +int pw_user_next(int argc, char **argv, char *name); +int pw_user_show(int argc, char **argv, char *name); +int pw_user_unlock(int argc, char **argv, char *name); int pw_groupnext(struct userconf *cnf, bool quiet); char *pw_checkname(char *name, int gecos); +uintmax_t pw_checkid(char *nptr, uintmax_t maxval); +int pw_checkfd(char *nptr); int addnispwent(const char *path, struct passwd *pwd); int delnispwent(const char *path, const char *login); int chgnispwent(const char *path, const char *login, struct passwd *pwd); +int groupadd(struct userconf *, char *name, gid_t id, char *members, int fd, + bool dryrun, bool pretty, bool precrypted); + +int nis_update(void); + int boolean_val(char const * str, int dflt); char const *boolean_str(int val); char *newstr(char const * p); Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 12:47:50 2015 (r286196) @@ -235,9 +235,6 @@ read_userconfig(char const * file) buf = NULL; linecap = 0; - config.groups = sl_init(); - if (config.groups == NULL) - err(1, "sl_init()"); if (file == NULL) file = _PATH_PW_CONF; @@ -316,8 +313,11 @@ read_userconfig(char const * file) ? NULL : newstr(q); break; case _UC_EXTRAGROUPS: - for (i = 0; q != NULL; q = strtok(NULL, toks)) + for (i = 0; q != NULL; q = strtok(NULL, toks)) { + if (config.groups == NULL) + config.groups = sl_init(); sl_add(config.groups, newstr(q)); + } break; case _UC_DEFAULTCLASS: config.default_class = (q == NULL || !boolean_val(q, 1)) @@ -391,7 +391,7 @@ read_userconfig(char const * file) int -write_userconfig(char const * file) +write_userconfig(struct userconf *cnf, const char *file) { int fd; int i, j; @@ -416,40 +416,39 @@ write_userconfig(char const * file) sbuf_clear(buf); switch (i) { case _UC_DEFAULTPWD: - sbuf_cat(buf, boolean_str(config.default_password)); + sbuf_cat(buf, boolean_str(cnf->default_password)); break; case _UC_REUSEUID: - sbuf_cat(buf, boolean_str(config.reuse_uids)); + sbuf_cat(buf, boolean_str(cnf->reuse_uids)); break; case _UC_REUSEGID: - sbuf_cat(buf, boolean_str(config.reuse_gids)); + sbuf_cat(buf, boolean_str(cnf->reuse_gids)); break; case _UC_NISPASSWD: - sbuf_cat(buf, config.nispasswd ? config.nispasswd : - ""); + sbuf_cat(buf, cnf->nispasswd ? cnf->nispasswd : ""); quote = 0; break; case _UC_DOTDIR: - sbuf_cat(buf, config.dotdir ? config.dotdir : + sbuf_cat(buf, cnf->dotdir ? cnf->dotdir : boolean_str(0)); break; case _UC_NEWMAIL: - sbuf_cat(buf, config.newmail ? config.newmail : + sbuf_cat(buf, cnf->newmail ? cnf->newmail : boolean_str(0)); break; case _UC_LOGFILE: - sbuf_cat(buf, config.logfile ? config.logfile : + sbuf_cat(buf, cnf->logfile ? cnf->logfile : boolean_str(0)); break; case _UC_HOMEROOT: - sbuf_cat(buf, config.home); + sbuf_cat(buf, cnf->home); break; case _UC_HOMEMODE: - sbuf_printf(buf, "%04o", config.homemode); + sbuf_printf(buf, "%04o", cnf->homemode); quote = 0; break; case _UC_SHELLPATH: - sbuf_cat(buf, config.shelldir); + sbuf_cat(buf, cnf->shelldir); break; case _UC_SHELLS: for (j = 0; j < _UC_MAXSHELLS && @@ -459,46 +458,46 @@ write_userconfig(char const * file) quote = 0; break; case _UC_DEFAULTSHELL: - sbuf_cat(buf, config.shell_default ? - config.shell_default : bourne_shell); + sbuf_cat(buf, cnf->shell_default ? + cnf->shell_default : bourne_shell); break; case _UC_DEFAULTGROUP: - sbuf_cat(buf, config.default_group ? - config.default_group : ""); + sbuf_cat(buf, cnf->default_group ? + cnf->default_group : ""); break; case _UC_EXTRAGROUPS: - for (j = 0; config.groups != NULL && - j < (int)config.groups->sl_cur; j++) + for (j = 0; cnf->groups != NULL && + j < (int)cnf->groups->sl_cur; j++) sbuf_printf(buf, "%s\"%s\"", j ? - "," : "", config.groups->sl_str[j]); + "," : "", cnf->groups->sl_str[j]); quote = 0; break; case _UC_DEFAULTCLASS: - sbuf_cat(buf, config.default_class ? - config.default_class : ""); + sbuf_cat(buf, cnf->default_class ? + cnf->default_class : ""); break; case _UC_MINUID: - sbuf_printf(buf, "%ju", (uintmax_t)config.min_uid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_uid); quote = 0; break; case _UC_MAXUID: - sbuf_printf(buf, "%ju", (uintmax_t)config.max_uid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_uid); quote = 0; break; case _UC_MINGID: - sbuf_printf(buf, "%ju", (uintmax_t)config.min_gid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->min_gid); quote = 0; break; case _UC_MAXGID: - sbuf_printf(buf, "%ju", (uintmax_t)config.max_gid); + sbuf_printf(buf, "%ju", (uintmax_t)cnf->max_gid); quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%d", config.expire_days); + sbuf_printf(buf, "%ld", cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%d", config.password_days); + sbuf_printf(buf, "%ld", cnf->password_days); quote = 0; break; case _UC_NONE: Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 12:40:56 2015 (r286195) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 12:47:50 2015 (r286196) @@ -31,47 +31,50 @@ static const char rcsid[] = #include #include +#include #include -#include +#include +#include #include +#include #include -#include -#include #include "pw.h" #include "bitmap.h" - static struct passwd *lookup_pwent(const char *user); static void delete_members(struct group *grp, char *list); -static int print_group(struct group * grp); -static gid_t gr_gidpolicy(struct userconf * cnf, long id); +static int print_group(struct group * grp, bool pretty); +static gid_t gr_gidpolicy(struct userconf * cnf, intmax_t id); static void -set_passwd(struct group *grp, bool update) +grp_set_passwd(struct group *grp, bool update, int fd, bool precrypted) { int b; int istty; struct termios t, n; char *p, line[256]; - if (conf.fd == '-') { + if (fd == -1) + return; + + if (fd == '-') { grp->gr_passwd = "*"; /* No access */ return; } - if ((istty = isatty(conf.fd))) { + if ((istty = isatty(fd))) { n = t; /* Disable echo */ n.c_lflag &= ~(ECHO); - tcsetattr(conf.fd, TCSANOW, &n); + tcsetattr(fd, TCSANOW, &n); printf("%sassword for group %s:", update ? "New p" : "P", grp->gr_name); fflush(stdout); } - b = read(conf.fd, line, sizeof(line) - 1); + b = read(fd, line, sizeof(line) - 1); if (istty) { /* Restore state */ - tcsetattr(conf.fd, TCSANOW, &t); + tcsetattr(fd, TCSANOW, &t); fputc('\n', stdout); fflush(stdout); } @@ -83,7 +86,7 @@ set_passwd(struct group *grp, bool updat if (!*line) errx(EX_DATAERR, "empty password read on file descriptor %d", conf.fd); - if (conf.precrypted) { + if (precrypted) { if (strchr(line, ':') != 0) errx(EX_DATAERR, "wrong encrypted passwrd"); grp->gr_passwd = line; @@ -103,193 +106,24 @@ pw_groupnext(struct userconf *cnf, bool return (EXIT_SUCCESS); } -static int -pw_groupshow(const char *name, long id, struct group *fakegroup) -{ - struct group *grp = NULL; - - if (id < 0 && name == NULL && !conf.all) - errx(EX_DATAERR, "groupname or id or '-a' required"); - - if (conf.all) { - SETGRENT(); - while ((grp = GETGRENT()) != NULL) - print_group(grp); - ENDGRENT(); - - return (EXIT_SUCCESS); - } - - grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id); - if (grp == NULL) { - if (conf.force) { - grp = fakegroup; - } else { - if (name == NULL) - errx(EX_DATAERR, "unknown gid `%ld'", id); - errx(EX_DATAERR, "unknown group `%s'", name); - } - } - - return (print_group(grp)); -} - -static int -pw_groupdel(const char *name, long id) +static struct group * +getgroup(char *name, intmax_t id, bool fatal) { - struct group *grp = NULL; - int rc; + struct group *grp; + if (id < 0 && name == NULL) + errx(EX_DATAERR, "groupname or id required"); grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id); if (grp == NULL) { + if (!fatal) + return (NULL); if (name == NULL) - errx(EX_DATAERR, "unknown gid `%ld'", id); + errx(EX_DATAERR, "unknown gid `%ju'", id); errx(EX_DATAERR, "unknown group `%s'", name); } - - rc = delgrent(grp); - if (rc == -1) - err(EX_IOERR, "group '%s' not available (NIS?)", name); - else if (rc != 0) - err(EX_IOERR, "group update"); - pw_log(conf.userconf, M_DELETE, W_GROUP, "%s(%ld) removed", name, id); - - return (EXIT_SUCCESS); -} - -int -pw_group(int mode, char *name, long id, struct cargs * args) -{ - int rc; - struct carg *arg; - struct group *grp = NULL; - struct userconf *cnf = conf.userconf; - - static struct group fakegroup = - { - "nogroup", - "*", - -1, - NULL - }; - - if (mode == M_NEXT) - return (pw_groupnext(cnf, conf.quiet)); - - if (mode == M_PRINT) - return (pw_groupshow(name, id, &fakegroup)); - - if (mode == M_DELETE) - return (pw_groupdel(name, id)); - - if (mode == M_LOCK || mode == M_UNLOCK) - errx(EX_USAGE, "'lock' command is not available for groups"); - - if (id < 0 && name == NULL) - errx(EX_DATAERR, "group name or id required"); - - grp = (name != NULL) ? GETGRNAM(name) : GETGRGID(id); - - if (mode == M_UPDATE) { - if (name == NULL && grp == NULL) /* Try harder */ - grp = GETGRGID(id); - - if (grp == NULL) { - if (name == NULL) - errx(EX_DATAERR, "unknown group `%s'", name); - else - errx(EX_DATAERR, "unknown group `%ld'", id); - } - if (name == NULL) /* Needed later */ - name = grp->gr_name; - - if (id > 0) - grp->gr_gid = (gid_t) id; - - if (conf.newname != NULL) - grp->gr_name = pw_checkname(conf.newname, 0); - } else { - if (name == NULL) /* Required */ - errx(EX_DATAERR, "group name required"); - else if (grp != NULL) /* Exists */ - errx(EX_DATAERR, "group name `%s' already exists", name); - - grp = &fakegroup; - grp->gr_name = pw_checkname(name, 0); - grp->gr_passwd = "*"; - grp->gr_gid = gr_gidpolicy(cnf, id); - grp->gr_mem = NULL; - } - - /* - * This allows us to set a group password Group passwords is an - * antique idea, rarely used and insecure (no secure database) Should - * be discouraged, but it is apparently still supported by some - * software. - */ - - if (conf.which == W_GROUP && conf.fd != -1) - set_passwd(grp, mode == M_UPDATE); - - if (((arg = getarg(args, 'M')) != NULL || - (arg = getarg(args, 'd')) != NULL || - (arg = getarg(args, 'm')) != NULL) && arg->val) { - char *p; - struct passwd *pwd; - - /* Make sure this is not stay NULL with -M "" */ - if (arg->ch == 'd') - delete_members(grp, arg->val); - else if (arg->ch == 'M') - grp->gr_mem = NULL; - - for (p = strtok(arg->val, ", \t"); arg->ch != 'd' && p != NULL; - p = strtok(NULL, ", \t")) { - int j; - - /* - * Check for duplicates - */ - pwd = lookup_pwent(p); - for (j = 0; grp->gr_mem != NULL && grp->gr_mem[j] != NULL; j++) { - if (strcmp(grp->gr_mem[j], pwd->pw_name) == 0) - break; - } - if (grp->gr_mem != NULL && grp->gr_mem[j] != NULL) - continue; - grp = gr_add(grp, pwd->pw_name); - } - } - - if (conf.dryrun) - return print_group(grp); - - if (mode == M_ADD && (rc = addgrent(grp)) != 0) { - if (rc == -1) - errx(EX_IOERR, "group '%s' already exists", - grp->gr_name); - else - err(EX_IOERR, "group update"); - } else if (mode == M_UPDATE && (rc = chggrent(name, grp)) != 0) { - if (rc == -1) - errx(EX_IOERR, "group '%s' not available (NIS?)", - grp->gr_name); - else - err(EX_IOERR, "group update"); - } - - if (conf.newname != NULL) - name = conf.newname; - /* grp may have been invalidated */ - if ((grp = GETGRNAM(name)) == NULL) - errx(EX_SOFTWARE, "group disappeared during update"); - - pw_log(cnf, mode, W_GROUP, "%s(%ju)", grp->gr_name, (uintmax_t)grp->gr_gid); - - return EXIT_SUCCESS; + return (grp); } - /* * Lookup a passwd entry using a name or UID. */ @@ -332,11 +166,11 @@ delete_members(struct group *grp, char * } } - -static gid_t -gr_gidpolicy(struct userconf * cnf, long id) +static gid_t +gr_gidpolicy(struct userconf * cnf, intmax_t id) { struct group *grp; + struct bitmap bm; gid_t gid = (gid_t) - 1; /* @@ -347,66 +181,59 @@ gr_gidpolicy(struct userconf * cnf, long if ((grp = GETGRGID(gid)) != NULL && conf.checkduplicate) errx(EX_DATAERR, "gid `%ju' has already been allocated", (uintmax_t)grp->gr_gid); - } else { - struct bitmap bm; + return (gid); + } - /* - * We need to allocate the next available gid under one of - * two policies a) Grab the first unused gid b) Grab the - * highest possible unused gid - */ - if (cnf->min_gid >= cnf->max_gid) { /* Sanity claus^H^H^H^Hheck */ - cnf->min_gid = 1000; - cnf->max_gid = 32000; - } - bm = bm_alloc(cnf->max_gid - cnf->min_gid + 1); + /* + * We need to allocate the next available gid under one of + * two policies a) Grab the first unused gid b) Grab the + * highest possible unused gid + */ + if (cnf->min_gid >= cnf->max_gid) { /* Sanity claus^H^H^H^Hheck */ + cnf->min_gid = 1000; + cnf->max_gid = 32000; + } + bm = bm_alloc(cnf->max_gid - cnf->min_gid + 1); - /* - * Now, let's fill the bitmap from the password file - */ - SETGRENT(); - while ((grp = GETGRENT()) != NULL) - if ((gid_t)grp->gr_gid >= (gid_t)cnf->min_gid && - (gid_t)grp->gr_gid <= (gid_t)cnf->max_gid) - bm_setbit(&bm, grp->gr_gid - cnf->min_gid); - ENDGRENT(); + /* + * Now, let's fill the bitmap from the password file + */ + SETGRENT(); + while ((grp = GETGRENT()) != NULL) + if ((gid_t)grp->gr_gid >= (gid_t)cnf->min_gid && + (gid_t)grp->gr_gid <= (gid_t)cnf->max_gid) + bm_setbit(&bm, grp->gr_gid - cnf->min_gid); + ENDGRENT(); - /* - * Then apply the policy, with fallback to reuse if necessary - */ - if (cnf->reuse_gids) + /* + * Then apply the policy, with fallback to reuse if necessary + */ + if (cnf->reuse_gids) + gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid); + else { + gid = (gid_t) (bm_lastset(&bm) + 1); + if (!bm_isset(&bm, gid)) + gid += cnf->min_gid; + else gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid); - else { - gid = (gid_t) (bm_lastset(&bm) + 1); - if (!bm_isset(&bm, gid)) - gid += cnf->min_gid; - else - gid = (gid_t) (bm_firstunset(&bm) + cnf->min_gid); - } - - /* - * Another sanity check - */ - if (gid < cnf->min_gid || gid > cnf->max_gid) - errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used"); - bm_dealloc(&bm); } - return gid; -} + /* + * Another sanity check + */ + if (gid < cnf->min_gid || gid > cnf->max_gid) + errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used"); + bm_dealloc(&bm); + return (gid); +} static int -print_group(struct group * grp) +print_group(struct group * grp, bool pretty) { - if (!conf.pretty) { - char *buf = NULL; - - buf = gr_make(grp); - printf("%s\n", buf); - free(buf); - } else { - int i; + char *buf = NULL; + int i; + if (pretty) { printf("Group Name: %-15s #%lu\n" " Members: ", grp->gr_name, (long) grp->gr_gid); @@ -415,6 +242,444 @@ print_group(struct group * grp) printf("%s%s", i ? "," : "", grp->gr_mem[i]); } fputs("\n\n", stdout); + return (EXIT_SUCCESS); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Aug 2 12:48:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB72A9B0B21; Sun, 2 Aug 2015 12:48:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC6E71D17; Sun, 2 Aug 2015 12:48:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72Cmbse032274; Sun, 2 Aug 2015 12:48:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72Cmb4T032273; Sun, 2 Aug 2015 12:48:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021248.t72Cmb4T032273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286197 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 12:48:37 -0000 Author: bapt Date: Sun Aug 2 12:48:36 2015 New Revision: 286197 URL: https://svnweb.freebsd.org/changeset/base/286197 Log: Remove dead code Modified: head/usr.sbin/pw/pw.h Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sun Aug 2 12:47:50 2015 (r286196) +++ head/usr.sbin/pw/pw.h Sun Aug 2 12:48:36 2015 (r286197) @@ -64,15 +64,6 @@ enum _which W_NUM }; -struct carg -{ - int ch; - char *val; - LIST_ENTRY(carg) list; -}; - -LIST_HEAD(cargs, carg); - #define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) #define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 @@ -81,8 +72,6 @@ LIST_HEAD(cargs, carg); struct userconf *get_userconfig(const char *cfg); struct userconf *read_userconfig(char const * file); int write_userconfig(struct userconf *cnf, char const * file); -struct carg *addarg(struct cargs * _args, int ch, char *argstr); -struct carg *getarg(struct cargs * _args, int ch); int pw_group_add(int argc, char **argv, char *name); int pw_group_del(int argc, char **argv, char *name); From owner-svn-src-all@freebsd.org Sun Aug 2 12:54:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ACF39B0D43; Sun, 2 Aug 2015 12:54:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF5EF0; Sun, 2 Aug 2015 12:54:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72CsGLM036104; Sun, 2 Aug 2015 12:54:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72CsGfW036103; Sun, 2 Aug 2015 12:54:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021254.t72CsGfW036103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286198 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 12:54:16 -0000 Author: bapt Date: Sun Aug 2 12:54:15 2015 New Revision: 286198 URL: https://svnweb.freebsd.org/changeset/base/286198 Log: Fix regression: report again if a username already exists when creating it Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Aug 2 12:48:36 2015 (r286197) +++ head/usr.sbin/pw/pw_user.c Sun Aug 2 12:54:15 2015 (r286198) @@ -1275,6 +1275,9 @@ pw_user_add(int argc, char **argv, char if (name == NULL) errx(EX_DATAERR, "login name required"); + if (GETPWNAM(name) != NULL) + errx(EX_DATAERR, "login name `%s' already exists", name); + pwd = &fakeuser; pwd->pw_name = name; pwd->pw_class = cmdcnf->default_class ? cmdcnf->default_class : ""; From owner-svn-src-all@freebsd.org Sun Aug 2 12:56:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2352E9B0DB5; Sun, 2 Aug 2015 12:56:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13CCF259; Sun, 2 Aug 2015 12:56:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72CuPqK036266; Sun, 2 Aug 2015 12:56:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72CuPPk036265; Sun, 2 Aug 2015 12:56:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021256.t72CuPPk036265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 12:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286199 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 12:56:26 -0000 Author: bapt Date: Sun Aug 2 12:56:25 2015 New Revision: 286199 URL: https://svnweb.freebsd.org/changeset/base/286199 Log: Fix regression: report if a group already exists when creating it Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 12:54:15 2015 (r286198) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 12:56:25 2015 (r286199) @@ -546,6 +546,8 @@ pw_group_add(int argc, char **argv, char freopen(_PATH_DEVNULL, "w", stderr); if (name == NULL) errx(EX_DATAERR, "group name required"); + if (GETGRNAM(name) != NULL) + errx(EX_DATAERR, "group name `%s' already exists", name); cnf = get_userconfig(cfg); rc = groupadd(cnf, name, gr_gidpolicy(cnf, id), members, fd, dryrun, pretty, precrypted); From owner-svn-src-all@freebsd.org Sun Aug 2 13:02:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8C19B0F08; Sun, 2 Aug 2015 13:02:55 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D05818E6; Sun, 2 Aug 2015 13:02:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72D2sRh040155; Sun, 2 Aug 2015 13:02:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72D2sU4040153; Sun, 2 Aug 2015 13:02:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021302.t72D2sU4040153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286200 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 13:02:55 -0000 Author: bapt Date: Sun Aug 2 13:02:53 2015 New Revision: 286200 URL: https://svnweb.freebsd.org/changeset/base/286200 Log: Add regression tests about adding already existsing groups/users Modified: head/usr.sbin/pw/tests/pw_groupadd.sh head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/tests/pw_groupadd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_groupadd.sh Sun Aug 2 12:56:25 2015 (r286199) +++ head/usr.sbin/pw/tests/pw_groupadd.sh Sun Aug 2 13:02:53 2015 (r286200) @@ -10,6 +10,17 @@ group_add_gid_too_large_body() { ${PW} groupadd -n test1 -g 9999999999999 } +atf_test_case group_add_already_exists +group_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd foo + atf_check -s exit:65 \ + -e inline:"pw: group name \`foo' already exists\n" \ + ${PW} groupadd foo +} + atf_init_test_cases() { atf_add_test_case group_add_gid_too_large + atf_add_test_case group_add_already_exists } Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 12:56:25 2015 (r286199) +++ head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 13:02:53 2015 (r286200) @@ -304,6 +304,16 @@ user_add_bad_shell_body() { atf_check -s exit:78 -e ignore ${PW} useradd bar -s badshell } +atf_test_case user_add_already_exists +user_add_already_exists_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:65 \ + -e inline:"pw: login name \`foo' already exists\n" \ + ${PW} useradd foo +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -330,4 +340,5 @@ atf_init_test_cases() { atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large atf_add_test_case user_add_bad_shell + atf_add_test_case user_add_already_exists } From owner-svn-src-all@freebsd.org Sun Aug 2 13:22:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD309B1320; Sun, 2 Aug 2015 13:22:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF6CFED; Sun, 2 Aug 2015 13:22:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DMpip048203; Sun, 2 Aug 2015 13:22:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DMlPC048188; Sun, 2 Aug 2015 13:22:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021322.t72DMlPC048188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286201 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 13:22:52 -0000 Author: bapt Date: Sun Aug 2 13:22:46 2015 New Revision: 286201 URL: https://svnweb.freebsd.org/changeset/base/286201 Log: Cleanup a bit includes Modified: head/usr.sbin/pw/cpdir.c head/usr.sbin/pw/grupd.c head/usr.sbin/pw/psdate.c head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_log.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pw_utils.c head/usr.sbin/pw/pwupd.c Modified: head/usr.sbin/pw/cpdir.c ============================================================================== --- head/usr.sbin/pw/cpdir.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/cpdir.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,17 +29,12 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include #include "pw.h" #include "pwupd.h" Modified: head/usr.sbin/pw/grupd.c ============================================================================== --- head/usr.sbin/pw/grupd.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/grupd.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,13 +29,11 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include -#include #include #include -#include -#include #include "pwupd.h" Modified: head/usr.sbin/pw/psdate.c ============================================================================== --- head/usr.sbin/pw/psdate.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/psdate.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,12 +29,11 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include +#include +#include #include #include -#include #include -#include #include "psdate.h" Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw.c Sun Aug 2 13:22:46 2015 (r286201) @@ -32,9 +32,10 @@ static const char rcsid[] = #include #include #include -#include -#include -#include +#include +#include +#include + #include "pw.h" const char *Modes[] = { Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw.h Sun Aug 2 13:22:46 2015 (r286201) @@ -26,23 +26,13 @@ * $FreeBSD$ */ +#include + #define _WITH_GETLINE +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "psdate.h" #include "pwupd.h" enum _mode Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:22:46 2015 (r286201) @@ -31,11 +31,11 @@ static const char rcsid[] = #include #include -#include -#include -#include -#include + #include +#include +#include +#include #include "pw.h" Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 13:22:46 2015 (r286201) @@ -32,10 +32,10 @@ static const char rcsid[] = #include #include #include -#include #include #include -#include +#include +#include #include #include Modified: head/usr.sbin/pw/pw_log.c ============================================================================== --- head/usr.sbin/pw/pw_log.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_log.c Sun Aug 2 13:22:46 2015 (r286201) @@ -30,6 +30,8 @@ static const char rcsid[] = #endif /* not lint */ #include +#include +#include #include "pw.h" Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_nis.c Sun Aug 2 13:22:46 2015 (r286201) @@ -30,6 +30,7 @@ static const char rcsid[] = #endif /* not lint */ #include + #include #include #include Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_user.c Sun Aug 2 13:22:46 2015 (r286201) @@ -30,23 +30,28 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#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 +#include + #include "pw.h" #include "bitmap.h" +#include "psdate.h" #define LOGNAMESIZE (MAXLOGNAME-1) Modified: head/usr.sbin/pw/pw_utils.c ============================================================================== --- head/usr.sbin/pw/pw_utils.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pw_utils.c Sun Aug 2 13:22:46 2015 (r286201) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "pw.h" Modified: head/usr.sbin/pw/pwupd.c ============================================================================== --- head/usr.sbin/pw/pwupd.c Sun Aug 2 13:02:53 2015 (r286200) +++ head/usr.sbin/pw/pwupd.c Sun Aug 2 13:22:46 2015 (r286201) @@ -29,18 +29,16 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include + +#include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include "pwupd.h" From owner-svn-src-all@freebsd.org Sun Aug 2 13:32:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 991C59B15A4; Sun, 2 Aug 2015 13:32:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE09169B; Sun, 2 Aug 2015 13:32:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DWOGt052333; Sun, 2 Aug 2015 13:32:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DWOQl052332; Sun, 2 Aug 2015 13:32:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021332.t72DWOQl052332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286202 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 13:32:24 -0000 Author: bapt Date: Sun Aug 2 13:32:23 2015 New Revision: 286202 URL: https://svnweb.freebsd.org/changeset/base/286202 Log: Split some extra long lines Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Aug 2 13:22:46 2015 (r286201) +++ head/usr.sbin/pw/pw_user.c Sun Aug 2 13:32:23 2015 (r286202) @@ -623,7 +623,8 @@ rmat(uid_t uid) st.st_uid == uid) { char tmp[MAXPATHLEN]; - snprintf(tmp, sizeof(tmp), "/usr/bin/atrm %s", e->d_name); + snprintf(tmp, sizeof(tmp), "/usr/bin/atrm %s", + e->d_name); system(tmp); } } @@ -869,7 +870,8 @@ pw_user_del(int argc, char **argv, char /* Remove crontabs */ snprintf(file, sizeof(file), "/var/cron/tabs/%s", pwd->pw_name); if (access(file, F_OK) == 0) { - snprintf(file, sizeof(file), "crontab -u %s -r", pwd->pw_name); + snprintf(file, sizeof(file), "crontab -u %s -r", + pwd->pw_name); system(file); } } @@ -1321,7 +1323,8 @@ pw_user_add(int argc, char **argv, char printf("%s\n", cmdcnf->nispasswd); rc = addnispwent(cmdcnf->nispasswd, pwd); if (rc == -1) - warnx("User '%s' already exists in NIS passwd", pwd->pw_name); + warnx("User '%s' already exists in NIS passwd", + pwd->pw_name); else if (rc != 0) warn("NIS passwd update"); /* NOTE: we treat NIS-only update errors as non-fatal */ @@ -1351,7 +1354,8 @@ pw_user_add(int argc, char **argv, char grp = GETGRGID(pwd->pw_gid); pw_log(cnf, M_ADD, W_USER, "%s(%ju):%s(%ju):%s:%s:%s", pwd->pw_name, (uintmax_t)pwd->pw_uid, - grp ? grp->gr_name : "unknown", (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), + grp ? grp->gr_name : "unknown", + (uintmax_t)(grp ? grp->gr_gid : (uid_t)-1), pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); /* @@ -1582,7 +1586,8 @@ pw_user_mod(int argc, char **argv, char if (pwd->pw_uid != 0 && strcmp(pwd->pw_name, "root") == 0) errx(EX_DATAERR, "can't change uid of `root' account"); if (pwd->pw_uid == 0 && strcmp(pwd->pw_name, "root") != 0) - warnx("WARNING: account `%s' will have a uid of 0 (superuser access!)", pwd->pw_name); + warnx("WARNING: account `%s' will have a uid of 0 " + "(superuser access!)", pwd->pw_name); } if (grname && pwd->pw_uid != 0) { From owner-svn-src-all@freebsd.org Sun Aug 2 13:33:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F95F9B1620; Sun, 2 Aug 2015 13:33:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20BA81986; Sun, 2 Aug 2015 13:33:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DXIJ9052433; Sun, 2 Aug 2015 13:33:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DXH8q052432; Sun, 2 Aug 2015 13:33:17 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021333.t72DXH8q052432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286203 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 13:33:18 -0000 Author: bapt Date: Sun Aug 2 13:33:17 2015 New Revision: 286203 URL: https://svnweb.freebsd.org/changeset/base/286203 Log: Split some extra long lines Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Sun Aug 2 13:32:23 2015 (r286202) +++ head/usr.sbin/pw/pw_group.c Sun Aug 2 13:33:17 2015 (r286203) @@ -180,7 +180,8 @@ gr_gidpolicy(struct userconf * cnf, intm gid = (gid_t) id; if ((grp = GETGRGID(gid)) != NULL && conf.checkduplicate) - errx(EX_DATAERR, "gid `%ju' has already been allocated", (uintmax_t)grp->gr_gid); + errx(EX_DATAERR, "gid `%ju' has already been allocated", + (uintmax_t)grp->gr_gid); return (gid); } @@ -222,7 +223,8 @@ gr_gidpolicy(struct userconf * cnf, intm * Another sanity check */ if (gid < cnf->min_gid || gid > cnf->max_gid) - errx(EX_SOFTWARE, "unable to allocate a new gid - range fully used"); + errx(EX_SOFTWARE, "unable to allocate a new gid - range fully " + "used"); bm_dealloc(&bm); return (gid); } From owner-svn-src-all@freebsd.org Sun Aug 2 13:50:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66BD69B19D8; Sun, 2 Aug 2015 13:50:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5805917A; Sun, 2 Aug 2015 13:50:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72DoCMg056889; Sun, 2 Aug 2015 13:50:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72DoC5M056888; Sun, 2 Aug 2015 13:50:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021350.t72DoC5M056888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 13:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286204 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 13:50:12 -0000 Author: bapt Date: Sun Aug 2 13:50:11 2015 New Revision: 286204 URL: https://svnweb.freebsd.org/changeset/base/286204 Log: Fix build on 32bits Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:33:17 2015 (r286203) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 13:50:11 2015 (r286204) @@ -493,11 +493,11 @@ write_userconfig(struct userconf *cnf, c quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%ld", cnf->expire_days); + sbuf_printf(buf, "%lld", (long long)cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%ld", cnf->password_days); + sbuf_printf(buf, "%lld", (long long)cnf->password_days); quote = 0; break; case _UC_NONE: From owner-svn-src-all@freebsd.org Sun Aug 2 14:56:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6171A9B0865; Sun, 2 Aug 2015 14:56:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40E7D1E6E; Sun, 2 Aug 2015 14:56:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72EuWsA085567; Sun, 2 Aug 2015 14:56:32 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72EuVPg085565; Sun, 2 Aug 2015 14:56:31 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508021456.t72EuVPg085565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Sun, 2 Aug 2015 14:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286205 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 14:56:32 -0000 Author: ed Date: Sun Aug 2 14:56:30 2015 New Revision: 286205 URL: https://svnweb.freebsd.org/changeset/base/286205 Log: Add a manual page for the cloudabi and cloudabi64 kernel modules. CloudABI has two separate kernel modules: cloudabi and cloudabi64. The first module contains all the pointer size independent code, whereas cloudabi64 contains the actual 64-bits specific system calls and the ELF loader. Reviewed by: wblock Obtained from: https://github.com/NuxiNL/freebsd Differential Revision: https://reviews.freebsd.org/D3258 Added: head/share/man/man4/cloudabi.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Aug 2 13:50:11 2015 (r286204) +++ head/share/man/man4/Makefile Sun Aug 2 14:56:30 2015 (r286205) @@ -96,6 +96,7 @@ MAN= aac.4 \ cdce.4 \ ch.4 \ ciss.4 \ + cloudabi.4 \ cm.4 \ cmx.4 \ ${_coretemp.4} \ @@ -583,6 +584,7 @@ MLINKS+=bwn.4 if_bwn.4 MLINKS+=${_bxe.4} ${_if_bxe.4} MLINKS+=cas.4 if_cas.4 MLINKS+=cdce.4 if_cdce.4 +MLINKS+=cloudabi.4 cloudabi64.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 Added: head/share/man/man4/cloudabi.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cloudabi.4 Sun Aug 2 14:56:30 2015 (r286205) @@ -0,0 +1,103 @@ +.\" Copyright (c) 2015 Nuxi, https://nuxi.nl/ +.\" +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND 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 THE AUTHOR OR 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. +.\" +.\" $FreeBSD$ +.Dd July 31, 2015 +.Dt CLOUDABI 4 +.Os +.Sh NAME +.Nm cloudabi , +.Nm cloudabi64 +.Nd CloudABI support +.Sh SYNOPSIS +Support for 64-bit CloudABI executables can be compiled into the kernel +by adding this line to the kernel configuration file: +.Bd -ragged -offset indent +.Cd "options COMPAT_CLOUDABI64" +.Ed +.Pp +CloudABI support can also be loaded at boot time from +.Xr loader.conf 5 : +.Bd -literal -offset indent +cloudabi_load="YES" +cloudabi64_load="YES" +.Ed +.Sh DESCRIPTION +CloudABI is a POSIX-like pure capability-based runtime environment, +similar to +.Xr capsicum 4 . +It can be used to develop applications that are cross-platform, +easier to test, +and hardened against security exploits. +.Pp +Support for CloudABI on +.Fx +consists of two separate kernel modules. +The +.Nm cloudabi +kernel module implements all of the system calls that do not depend on +data structures that differ between architectures. +.Pp +The +.Nm cloudabi64 +kernel module provides implementations of all of the machine-dependent +system calls. +It assumes that pointers stored in data structures provided as system +call arguments are 64 bits in size. +It also provides the image activator that loads and starts 64-bit ELF +executables. +.Pp +Though the +.Nm cloudabi +module can be loaded on any architecture supported by +.Fx , +the +.Nm cloudabi64 +module is only available for amd64. +.Pp +A full cross compilation toolchain for CloudABI is available in the +.Pa devel/cloudabi-toolchain +port. +.Pp +The +.Pa sysutils/cloudabi-utils +port provides the +.Xr cloudabi-run 1 +utility. +.Xr cloudabi-run 1 +can be used to safely execute CloudABI processes with access to a +restricted set of resources. +.Sh SEE ALSO +.Xr cloudabi-run 1 , +.Xr capsicum 4 , +.Xr linux 4 , +.Xr elf 5 +.Pp +cloudlibc on GitHub: +.Pa https://github.com/NuxiNL/cloudlibc . +.Sh HISTORY +CloudABI support first appeared in +.Fx 11.0 . +.Sh AUTHORS +Nuxi: +.Pa https://nuxi.nl/ . From owner-svn-src-all@freebsd.org Sun Aug 2 16:07:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA5969B194D; Sun, 2 Aug 2015 16:07:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DADB61F73; Sun, 2 Aug 2015 16:07:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72G7VpG019159; Sun, 2 Aug 2015 16:07:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72G7U1I019156; Sun, 2 Aug 2015 16:07:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201508021607.t72G7U1I019156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 2 Aug 2015 16:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286206 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 16:07:32 -0000 Author: tuexen Date: Sun Aug 2 16:07:30 2015 New Revision: 286206 URL: https://svnweb.freebsd.org/changeset/base/286206 Log: Don't take the port numbers for packets containing ABORT chunks from a freed mbuf. Just use them from the stcb. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Aug 2 14:56:30 2015 (r286205) +++ head/sys/netinet/sctp_indata.c Sun Aug 2 16:07:30 2015 (r286206) @@ -2312,11 +2312,8 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, - struct sockaddr *src, struct sockaddr *dst, - struct sctphdr *sh, struct sctp_inpcb *inp, - struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, - uint8_t mflowtype, uint32_t mflowid, - uint32_t vrf_id, uint16_t port) + struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_nets *net, uint32_t * high_tsn) { struct sctp_data_chunk *ch, chunk_buf; struct sctp_association *asoc; @@ -2408,10 +2405,7 @@ sctp_process_data(struct mbuf **mm, int chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; - sctp_abort_association(inp, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } if ((size_t)chk_length == sizeof(struct sctp_data_chunk)) { @@ -2423,10 +2417,7 @@ sctp_process_data(struct mbuf **mm, int op_err = sctp_generate_no_user_data_cause(ch->dp.tsn); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; - sctp_abort_association(inp, stcb, m, iphlen, - src, dst, sh, op_err, - mflowtype, mflowid, - vrf_id, port); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } #ifdef SCTP_AUDITING_ENABLED @@ -2493,12 +2484,7 @@ sctp_process_data(struct mbuf **mm, int snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", ch->ch.chunk_type); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); - sctp_abort_association(inp, stcb, - m, iphlen, - src, dst, - sh, op_err, - mflowtype, mflowid, - vrf_id, port); + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); } break; Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Sun Aug 2 14:56:30 2015 (r286205) +++ head/sys/netinet/sctp_indata.h Sun Aug 2 16:07:30 2015 (r286206) @@ -112,12 +112,8 @@ void int sctp_process_data(struct mbuf **, int, int *, int, - struct sockaddr *src, struct sockaddr *dst, - struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint32_t *, - uint8_t, uint32_t, - uint32_t, uint16_t); + struct sctp_nets *, uint32_t *); void sctp_slide_mapping_arrays(struct sctp_tcb *stcb); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Aug 2 14:56:30 2015 (r286205) +++ head/sys/netinet/sctp_input.c Sun Aug 2 16:07:30 2015 (r286206) @@ -5981,10 +5981,7 @@ sctp_common_input_processing(struct mbuf } /* plow through the data chunks while length > offset */ retval = sctp_process_data(mm, iphlen, &offset, length, - src, dst, sh, - inp, stcb, net, &high_tsn, - mflowtype, mflowid, - vrf_id, port); + inp, stcb, net, &high_tsn); if (retval == 2) { /* * The association aborted, NO UNLOCK needed since From owner-svn-src-all@freebsd.org Sun Aug 2 16:25:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A3469B1E25; Sun, 2 Aug 2015 16:25:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A42FC53; Sun, 2 Aug 2015 16:25:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72GPMBt027255; Sun, 2 Aug 2015 16:25:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72GPMnM027254; Sun, 2 Aug 2015 16:25:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201508021625.t72GPMnM027254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 2 Aug 2015 16:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286207 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 16:25:22 -0000 Author: ae Date: Sun Aug 2 16:25:21 2015 New Revision: 286207 URL: https://svnweb.freebsd.org/changeset/base/286207 Log: MFC r285889: Report the scheme and provider names in warning message about unaligned partition. PR: 201873 Modified: stable/10/sys/geom/part/g_part.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part.c ============================================================================== --- stable/10/sys/geom/part/g_part.c Sun Aug 2 16:07:30 2015 (r286206) +++ stable/10/sys/geom/part/g_part.c Sun Aug 2 16:25:21 2015 (r286207) @@ -321,8 +321,10 @@ g_part_check_integrity(struct g_part_tab if (e1->gpe_offset > offset) offset = e1->gpe_offset; if ((offset + pp->stripeoffset) % pp->stripesize) { - DPRINTF("partition %d is not aligned on %u " - "bytes\n", e1->gpe_index, pp->stripesize); + DPRINTF("partition %d on (%s, %s) is not " + "aligned on %u bytes\n", e1->gpe_index, + pp->name, table->gpt_scheme->name, + pp->stripesize); /* Don't treat this as a critical failure */ } } From owner-svn-src-all@freebsd.org Sun Aug 2 16:26:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A12919B1E7C; Sun, 2 Aug 2015 16:26:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90A69D92; Sun, 2 Aug 2015 16:26:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72GQghL027377; Sun, 2 Aug 2015 16:26:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72GQgxR027375; Sun, 2 Aug 2015 16:26:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201508021626.t72GQgxR027375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 2 Aug 2015 16:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286208 - in head/sys/dev/pms/freebsd/driver: common ini/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 16:26:42 -0000 Author: imp Date: Sun Aug 2 16:26:41 2015 New Revision: 286208 URL: https://svnweb.freebsd.org/changeset/base/286208 Log: Don't forget to check the vendor when probing. Also, there's no need to double check for if the card has probed before. In fact, there's no reason to single check either. Simplify the code as a result. $FreeBSD$ added to lxutil.c in a non-standard way to help keep the diffs with upstream to a minimum. Differential Revision: https://reviews.freebsd.org/D3263 Modified: head/sys/dev/pms/freebsd/driver/common/lxutil.c head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Modified: head/sys/dev/pms/freebsd/driver/common/lxutil.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/common/lxutil.c Sun Aug 2 16:25:21 2015 (r286207) +++ head/sys/dev/pms/freebsd/driver/common/lxutil.c Sun Aug 2 16:26:41 2015 (r286208) @@ -19,6 +19,7 @@ *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE ******************************************************************************/ +/* $FreeBSD$ */ /****************************************************************************** This program is part of PMC-Sierra initiator/target device driver. The functions here are commonly used by different type of drivers that support @@ -756,37 +757,30 @@ STATIC int agtiapi_ProbeCard( device_t d int thisCard ) { int idx; - static U32 cardMap[4] = { 0, 0, 0, 0 }; + u_int16_t agtiapi_vendor; // PCI vendor ID u_int16_t agtiapi_dev; // PCI device ID AGTIAPI_PRINTK("agtiapi_ProbeCard: start\n"); - if ( ! atomic_cmpset_32( &cardMap[thisCard], 0, 5 ) ) { // card already ran - AGTIAPI_PRINTK( "We'll only ID this card once -- %d\n", thisCard ); - return 2; // error return value; card already ran this function - } - else { - agtiapi_dev = pci_get_device( dev ); // get PCI device ID - for( idx = 0; idx < COUNT(ag_card_type); idx++ ) - { - if( ag_card_type[idx].deviceId == agtiapi_dev ) - { // device ID match - memset( (void *)&agCardInfoList[ thisCard ], 0, - sizeof(ag_card_info_t) ); - thisCardInst->cardIdIndex = idx; - thisCardInst->pPCIDev = dev; - thisCardInst->cardNameIndex = ag_card_type[idx].cardNameIndex; - thisCardInst->cardID = - pci_read_config( dev, ag_card_type[idx].membar, 4 ); // memAddr - AGTIAPI_PRINTK("agtiapi_ProbeCard: We've got PMC SAS, probe successful %p / %p\n", - thisCardInst->pPCIDev, thisCardInst ); - device_printf( dev, - "agtiapi PCI Probe Vendor ID : 0x%x Device ID : 0x%x\n", - pci_get_vendor(dev), agtiapi_dev ); - device_set_desc( dev, ag_card_names[ag_card_type[idx].cardNameIndex] ); - return 0; - } + agtiapi_vendor = pci_get_vendor( dev ); // get PCI vendor ID + agtiapi_dev = pci_get_device( dev ); // get PCI device ID + for( idx = 0; idx < COUNT(ag_card_type); idx++ ) + { + if ( ag_card_type[idx].deviceId == agtiapi_dev && + ag_card_type[idx].vendorId == agtiapi_vendor) + { // device ID match + memset( (void *)&agCardInfoList[ thisCard ], 0, + sizeof(ag_card_info_t) ); + thisCardInst->cardIdIndex = idx; + thisCardInst->pPCIDev = dev; + thisCardInst->cardNameIndex = ag_card_type[idx].cardNameIndex; + thisCardInst->cardID = + pci_read_config( dev, ag_card_type[idx].membar, 4 ); // memAddr + AGTIAPI_PRINTK("agtiapi_ProbeCard: We've got PMC SAS, probe successful %p / %p\n", + thisCardInst->pPCIDev, thisCardInst ); + device_set_desc( dev, ag_card_names[ag_card_type[idx].cardNameIndex] ); + return 0; } } - return 7; + return 1; } Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sun Aug 2 16:25:21 2015 (r286207) +++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sun Aug 2 16:26:41 2015 (r286208) @@ -214,7 +214,6 @@ STATIC void agtiapi_CheckIOTimeout(void -static unsigned char cardMap[AGTIAPI_MAX_CARDS] = { 0, 0, 0, 0 }; static ag_card_info_t agCardInfoList[ AGTIAPI_MAX_CARDS ]; // card info list static void agtiapi_cam_action( struct cam_sim *, union ccb * ); static void agtiapi_cam_poll( struct cam_sim * ); @@ -695,37 +694,20 @@ Note: static int agtiapi_probe( device_t dev ) { int retVal; - - if ( pci_get_vendor(dev) == PCI_VENDOR_ID_PMC_SIERRA || - pci_get_vendor(dev) == PCI_VENDOR_ID_HIALEAH ) + int thisCard; + ag_card_info_t *thisCardInst; + + thisCard = device_get_unit( dev ); + if ( thisCard >= AGTIAPI_MAX_CARDS ) { - int thisCard = device_get_unit( dev ); -// AGTIAPI_PRINTK("agtiapi_probe: thisCard %d\n", thisCard); - if( thisCard >= AGTIAPI_MAX_CARDS) - { - device_printf( dev, "Too many PMC-Sierra cards detected ERROR!\n" ); - return (ENXIO); // maybe change to different return value? - } - ag_card_info_t *thisCardInst = &agCardInfoList[ thisCard ]; - retVal = agtiapi_ProbeCard( dev, thisCardInst, thisCard ); - if ( retVal ) { - // error on probe - if( retVal == 2 ) return 0; // another thread ran probe on this card - device_printf( dev, - "agtiapi_probe: PCI DEVICE NOT SUPPORTED by this driver!!" - "Vendor ID : 0x%x Device ID : 0x%x\n", - pci_get_vendor(dev), pci_get_device( dev ) ); - return (ENXIO); // maybe change to different return value? - } - else { - // AGTIAPI_PRINTK( "agtiapi_ProbeCard: returned with pointer values " - // "%p / %p\n", - // thisCardInst->pPCIDev, thisCardInst ); - cardMap[thisCard] = 11; // record this card is present - return( BUS_PROBE_DEFAULT ); // successful probe - } + device_printf( dev, "Too many PMC-Sierra cards detected ERROR!\n" ); + return (ENXIO); // maybe change to different return value? } - return (ENXIO); + thisCardInst = &agCardInfoList[ thisCard ]; + retVal = agtiapi_ProbeCard( dev, thisCardInst, thisCard ); + if ( retVal ) + return (ENXIO); // maybe change to different return value? + return( BUS_PROBE_DEFAULT ); // successful probe } From owner-svn-src-all@freebsd.org Sun Aug 2 16:29:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CDD9B1EF8; Sun, 2 Aug 2015 16:29:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A190EF07; Sun, 2 Aug 2015 16:29:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72GTVNx027548; Sun, 2 Aug 2015 16:29:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72GTVTL027547; Sun, 2 Aug 2015 16:29:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201508021629.t72GTVTL027547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 2 Aug 2015 16:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r286209 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 16:29:31 -0000 Author: ae Date: Sun Aug 2 16:29:30 2015 New Revision: 286209 URL: https://svnweb.freebsd.org/changeset/base/286209 Log: MFC r286207: Report the scheme and provider names in warning message about unaligned partition. PR: 201873 Modified: stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Sun Aug 2 16:26:41 2015 (r286208) +++ stable/9/sys/geom/part/g_part.c Sun Aug 2 16:29:30 2015 (r286209) @@ -309,8 +309,10 @@ g_part_check_integrity(struct g_part_tab if (e1->gpe_offset > offset) offset = e1->gpe_offset; if ((offset + pp->stripeoffset) % pp->stripesize) { - DPRINTF("partition %d is not aligned on %u " - "bytes\n", e1->gpe_index, pp->stripesize); + DPRINTF("partition %d on (%s, %s) is not " + "aligned on %u bytes\n", e1->gpe_index, + pp->name, table->gpt_scheme->name, + pp->stripesize); /* Don't treat this as a critical failure */ } } From owner-svn-src-all@freebsd.org Sun Aug 2 16:34:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E1E89B00D2 for ; Sun, 2 Aug 2015 16:34:43 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) by mx1.freebsd.org (Postfix) with SMTP id F19221487 for ; Sun, 2 Aug 2015 16:34:42 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 2 Aug 2015 16:35:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t72GYX9v013990; Sun, 2 Aug 2015 10:34:33 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1438533273.50703.2.camel@freebsd.org> Subject: Re: svn commit: r286168 - head/sys/net From: Ian Lepore To: "Bjoern A. Zeeb" Cc: John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 02 Aug 2015 10:34:33 -0600 In-Reply-To: References: <201508020015.t720Fr6R018929@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 16:34:43 -0000 On Sun, 2015-08-02 at 11:42 +0000, Bjoern A. Zeeb wrote: > > On 02 Aug 2015, at 00:15 , John-Mark Gurney wrote: > > -CTASSERT(sizeof(struct sadb_x_policy) == 16); > > +_Static_assert(sizeof(struct sadb_x_policy) == 16, "struct size mismatch"); > > > If this fires, how does it look like? I am assuming the string at the end is the error message? If so and if the assertion is not printed that string should be improved rather than being the same for all checks. > > /bz > It generates a compiler error, so the output is going to contain file-and-line like any other compiler error, as well as the message from the source code. -- Ian From owner-svn-src-all@freebsd.org Sun Aug 2 16:41:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB8549B0334; Sun, 2 Aug 2015 16:41:14 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BB8551A21; Sun, 2 Aug 2015 16:41:13 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.0.7] (cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61]) (authenticated bits=0) by theravensnest.org (8.15.1/8.15.1) with ESMTPSA id t72Gf66i082161 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Aug 2015 16:41:11 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc16-cmbg15-2-0-cust60.5-4.cable.virginm.net [86.5.162.61] claimed to be [192.168.0.7] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r286168 - head/sys/net From: David Chisnall In-Reply-To: <1438533273.50703.2.camel@freebsd.org> Date: Sun, 2 Aug 2015 17:42:05 +0100 Cc: "Bjoern A. Zeeb" , John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <064AFABE-35B4-48B9-9F95-545792504984@FreeBSD.org> References: <201508020015.t720Fr6R018929@repo.freebsd.org> <1438533273.50703.2.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 16:41:15 -0000 On 2 Aug 2015, at 17:34, Ian Lepore wrote: > > It generates a compiler error, so the output is going to contain > file-and-line like any other compiler error, as well as the message from > the source code. It will, of course, vary between compilers, but this is what clang generates: $ cat static.c _Static_assert(0, "example assert failed"); $ cc static.c static.c:1:1: error: static_assert failed "example assert failed" _Static_assert(0, "example assert failed"); ^ ~ 1 error generated. GCC 4.8 and later produce very similar output: $ gcc-4.8 static.c static.c:1:1: error: static assertion failed: "example assert failed" _Static_assert(0, "example assert failed"); ^ gcc 4.7 only provides the first line: $ gcc-4.7 static.c static.c:1:1: error: static assertion failed: "example assert failed" David From owner-svn-src-all@freebsd.org Sun Aug 2 18:20:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D37739B17EE; Sun, 2 Aug 2015 18:20:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4CD513B; Sun, 2 Aug 2015 18:20:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72IKbh1075215; Sun, 2 Aug 2015 18:20:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72IKbXW075196; Sun, 2 Aug 2015 18:20:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021820.t72IKbXW075196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 18:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286210 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 18:20:37 -0000 Author: bapt Date: Sun Aug 2 18:20:36 2015 New Revision: 286210 URL: https://svnweb.freebsd.org/changeset/base/286210 Log: Convert the year used for regression test fro 2043 to 2037 This makes the regression tests pass on systems where time_t is 32bits Modified: head/usr.sbin/pw/tests/pw_useradd.sh Modified: head/usr.sbin/pw/tests/pw_useradd.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 16:29:30 2015 (r286209) +++ head/usr.sbin/pw/tests/pw_useradd.sh Sun Aug 2 18:20:36 2015 (r286210) @@ -181,29 +181,29 @@ user_add_expiration_body() { populate_etc_skel atf_check -s exit:0 \ - ${PW} useradd foo -e 20-03-2043 - atf_check -o inline:"foo:*:1001:1001::0:2310422400:User &:/home/foo:/bin/sh\n" \ + ${PW} useradd foo -e 20-03-2037 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ -s exit:0 grep "^foo" ${HOME}/master.passwd atf_check -s exit:0 ${PW} userdel foo atf_check -s exit:0 \ - ${PW} useradd foo -e 20-03-43 - atf_check -o inline:"foo:*:1001:1001::0:2310422400:User &:/home/foo:/bin/sh\n" \ + ${PW} useradd foo -e 20-03-37 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ -s exit:0 grep "^foo" ${HOME}/master.passwd atf_check -s exit:0 ${PW} userdel foo atf_check -s exit:0 \ - ${PW} useradd foo -e 20-Mar-2043 - atf_check -o inline:"foo:*:1001:1001::0:2310422400:User &:/home/foo:/bin/sh\n" \ + ${PW} useradd foo -e 20-Mar-2037 + atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \ -s exit:0 grep "^foo" ${HOME}/master.passwd atf_check -s exit:0 ${PW} userdel foo atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ - ${PW} useradd foo -e 20-Foo-2043 + ${PW} useradd foo -e 20-Foo-2037 atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ - ${PW} useradd foo -e 20-13-2043 - atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2043" + ${PW} useradd foo -e 20-13-2037 + atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2037" atf_check -s exit:0 ${PW} userdel foo atf_check -e inline:"pw: Invalid date\n" -s exit:1 \ - ${PW} useradd foo -e "12 20-03-2043" - atf_check -s exit:0 ${PW} useradd foo -e "20-03-2043 12:00" + ${PW} useradd foo -e "12 20-03-2037" + atf_check -s exit:0 ${PW} useradd foo -e "20-03-2037 12:00" atf_check -s exit:0 ${PW} userdel foo } From owner-svn-src-all@freebsd.org Sun Aug 2 18:40:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DDED9B1C51; Sun, 2 Aug 2015 18:40:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F6F9B03; Sun, 2 Aug 2015 18:40:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by padck2 with SMTP id ck2so72176682pad.0; Sun, 02 Aug 2015 11:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=c5CtOLyfsJQ+Qm/zkvPU1Tncn8pO8ynFpxw4bO0YkAk=; b=uMQt+nY2/qfMiz+Cufl538jP4yBI40vI/+5F3vAVgBmr4Z96tQs4nMOx4rVjx7kfCW p5sz5faMSTyejKNx+O3rZIy9nmRlar77nK0+uxprkfF3usaJoBkVz+yRFXX4D9wPcAkl HgudoVHpFVVQk1TmXO82iTmTdTKrGwOV4ceb7nCiIbniZI53T/eIrP6U57eZID5ATlGY vSZinNNTJv2UrIMTgo/fiHgZroKr7jfFPTtcDWYmWuqHZbQ+djyC+fmgB+L56YcQ5mY+ Z1Ig5SBQ3s+0kb3dwaXoLQ4bIr1W/F/Dx6pP/OhumKoq4ifI+SBabFPlG0nCxvRPVlWm mwgg== X-Received: by 10.66.101.71 with SMTP id fe7mr28593683pab.89.1438540824763; Sun, 02 Aug 2015 11:40:24 -0700 (PDT) Received: from raichu ([104.232.114.184]) by smtp.gmail.com with ESMTPSA id v9sm14900116pdr.96.2015.08.02.11.40.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 11:40:23 -0700 (PDT) Sender: Mark Johnston Date: Sun, 2 Aug 2015 11:40:21 -0700 From: Mark Johnston To: Ermal =?iso-8859-1?Q?Lu=E7i?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286028 - head/sys/netinet Message-ID: <20150802184021.GB59626@raichu> References: <201507291804.t6TI42iH065403@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201507291804.t6TI42iH065403@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 18:40:25 -0000 On Wed, Jul 29, 2015 at 06:04:02PM +0000, Ermal Luçi wrote: > Author: eri > Date: Wed Jul 29 18:04:01 2015 > New Revision: 286028 > URL: https://svnweb.freebsd.org/changeset/base/286028 > > Log: > ip_output normalization and fixes > > ip_output has a big chunk of code used to handle special cases with pfil consumers which also forces a reloop on it. > Gather all this code together to make it readable and properly handle the reloop cases. > > Some of the issues identified: > > M_IP_NEXTHOP is not handled properly in existing code. > route reference leaking is possible with in FIB number change > route flags checking is not consistent in the function > > Differential Revision: https://reviews.freebsd.org/D3022 > Reviewed by: gnn > Approved by: gnn(mentor) > MFC after: 4 weeks > > Modified: > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/ip_output.c > ============================================================================== > --- head/sys/netinet/ip_output.c Wed Jul 29 17:59:13 2015 (r286027) > +++ head/sys/netinet/ip_output.c Wed Jul 29 18:04:01 2015 (r286028) > @@ -106,6 +106,94 @@ static void ip_mloopback > extern int in_mcast_loop; > extern struct protosw inetsw[]; > > +static inline int > +ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, > + struct sockaddr_in *dst, int *fibnum, int *error) > +{ > + struct m_tag *fwd_tag = NULL; > + struct in_addr odst; > + struct ip *ip; > + > + ip = mtod(m, struct ip *); > + > + /* Run through list of hooks for output packets. */ > + odst.s_addr = ip->ip_dst.s_addr; > + *error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); > + if ((*error) != 0 || m == NULL) > + return 1; /* Finished */ > + This can result in a use-after-free in ip_output() if a pfil hook consumes the first mbuf in the chain. This happens for example when ipfw nat is in use: m_megapullup() copies the input packet into a single cluster, which is returned above. However, ip_output() will continue to reference the original mbuf chain. The patch below fixes the problem for me. Thanks, -Mark diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 0790777..086a8c9 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -107,18 +107,21 @@ extern int in_mcast_loop; extern struct protosw inetsw[]; static inline int -ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, - struct sockaddr_in *dst, int *fibnum, int *error) +ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp, + struct sockaddr_in *dst, int *fibnum, int *error) { struct m_tag *fwd_tag = NULL; + struct mbuf *m; struct in_addr odst; struct ip *ip; + m = *mp; ip = mtod(m, struct ip *); /* Run through list of hooks for output packets. */ odst.s_addr = ip->ip_dst.s_addr; - *error = pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, inp); + *error = pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, PFIL_OUT, inp); + m = *mp; if ((*error) != 0 || m == NULL) return 1; /* Finished */ @@ -552,7 +555,7 @@ sendit: /* Jump over all PFIL processing if hooks are not active. */ if (PFIL_HOOKED(&V_inet_pfil_hook)) { - switch (ip_output_pfil(m, ifp, inp, dst, &fibnum, &error)) { + switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, &error)) { case 1: /* Finished */ goto done; From owner-svn-src-all@freebsd.org Sun Aug 2 19:37:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 310D09B193C for ; Sun, 2 Aug 2015 19:37:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04A1E2C3 for ; Sun, 2 Aug 2015 19:37:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by pabkd10 with SMTP id kd10so72695235pab.2 for ; Sun, 02 Aug 2015 12:37:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=2hvezxoA3O8/ySOkDP1xgSdlTn0ImyWTz5ehnNDrOD0=; b=dRjSNsP3KLjjNj6k3OURNClJpbQwWGF+Hey6VhA3zrJnsNh8qeUo/BIlDsAhKICXmW AcunHvGLr28tS1NFlLduA/MR3KUbDVKqXSza7+5P3OqTDX9turZjSJgYrnsMWfyRKlbT W8+24RhqJob/xZ5ANIlgxeE19VFwbEv3Jrr09UxYFVkB+Z8oo9lV0DDvSNmrmrLOrxrJ BJ2yzxxhjkWSO7V388n/xQQvak0aBU1KsdGSazJFzvou98I3es4f0Jl3/0RGR6s1FSJW EB5GAkv37ZHXdASv3DkY2HPclTyj+sM+FU4++Xz2zP+i1b7T1kdkf5tIICkuTRGxIKJe R4Ig== X-Gm-Message-State: ALoCoQmbd7tkAcUxbRmFOG+gcc+i8gJT4gpWTA8rBWxAG2mFifiW+QVwSu/lKXmS8nAS5GAgOLcq X-Received: by 10.67.5.37 with SMTP id cj5mr29095497pad.44.1438544256321; Sun, 02 Aug 2015 12:37:36 -0700 (PDT) Received: from [10.64.26.198] ([69.53.236.236]) by smtp.gmail.com with ESMTPSA id zb2sm5446993pbb.46.2015.08.02.12.37.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Aug 2015 12:37:35 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r284345 - in head: . bin/cat bin/chflags bin/chio bin/chmod bin/cp bin/csh bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/expr bin/freebsd-version bin/getfacl bin/hostname bi... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/signed; boundary="Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: <852.1438482871@chaos> Date: Sun, 2 Aug 2015 13:37:32 -0600 Cc: Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-Id: <7B84DD3E-87F3-48C9-82CD-687A83CFFB4E@bsdimp.com> References: <201506131920.t5DJKwMH033508@svn.freebsd.org> <20150726204948.GD1522@ivaldir.etoilebsd.net> <852.1438482871@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2102) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 19:37:43 -0000 --Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 1, 2015, at 8:34 PM, Simon J. Gerraty wrote: >=20 > Baptiste Daroussin wrote: >> This breaks using fmake from ports because of usage of :U in sys.mk >=20 > Oops - sorry. > I saw Warner posted a patch for this which looked ok, but doesn't = appear > to have been committed. Yea, I wanted to roll in your comments first, but my week has been quite = busy since then=E2=80=A6 Wanrer >> is compatible with FreeBSD 9 (not that I'm just speaking about sys.mk = not other >> parts) >=20 > Understood. >=20 > AFAICT the following allows fmake to consume sys.mk >=20 > Index: share/mk/sys.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/mk/sys.mk (revision 286177) > +++ share/mk/sys.mk (working copy) > @@ -33,8 +33,10 @@ >=20 > # early include for customization > # see local.sys.mk below > -.-include > +.sinclude >=20 > +.if defined(.PARSEDIR) > +# none of this is relevant without bmake > .if ${MK_META_MODE} =3D=3D "yes" > .-include > .elif ${MK_META_FILES} =3D=3D "yes" && ${.MAKEFLAGS:U:M-B} =3D=3D "" > @@ -44,6 +46,7 @@ > # This needs to be done early - before .PATH is computed > .-include > .endif > +.endif >=20 > # If the special target .POSIX appears (without prerequisites or > # commands) before the first noncomment line in the makefile, make = shall > @@ -361,7 +364,7 @@ > .endif >=20 > # late include for customization > -.-include > +.sinclude >=20 > .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) > SHELL=3D ${__MAKE_SHELL} > @@ -378,11 +381,12 @@ > # when running target scripts, this is a problem for many makefiles = here. > # So define a shell that will do what FreeBSD expects. > .ifndef WITHOUT_SHELL_ERRCTL > +___MAKE_SHELL?=3D /bin/sh > .SHELL: name=3Dsh \ > quiet=3D"set -" echo=3D"set -v" filter=3D"set -" \ > hasErrCtl=3Dyes check=3D"set -e" ignore=3D"set +e" \ > echoFlag=3Dv errFlag=3De \ > - path=3D${__MAKE_SHELL:U/bin/sh} > + path=3D${__MAKE_SHELL} > .endif >=20 > .include >=20 --Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVvnF9AAoJEGwc0Sh9sBEAAPYP/2oWZ72BwG9aqum2+6/cCsj1 QpjnDVGafhdDlWY0LHCzfQoENDcQKBxiD3wV0JcH+bggG6sZsxN1ylCLPRoP8PND /JtzzsCZuScagCFwxKSgRAg2djm1+5DTlFJuHpb2swvFPe4Nxn4aXIQEbSbZFKaK 5dqo9m9cQTkeHs7tl2Ky+WmHA0Rz8c/KcNaRnPy1TYUUau+wJ3jQE6pG8C8jNiAI EF9syF5ur1VPpy7TqA02112W8VtI3Kw9x74NpuiFWPifP5I228BOwVvXx6VCOxdr UXf3W2sJ6jdhH/fFdbLi69n7z+3HplUKCmSbuccerdeN4rR8QB94HifEAhhIpiGU Ec16RSJZjTX4qpGGwEDpeO9k+4oFFxdhvsSoJjLGQjPoZ1kDFj5Gj385hntn+Geo w9jN0JD0tG/gPTwtrW3pKVji60VpEHvXDcGjXDJ1G1eh3H4INVLzWaWXLFmzNRtH 3ayPU5Ajd9qBFXJdqeGojScPfTD9BmAHswbfBxyW6VgCKvXnyG6YwNdoJyjytta2 87IiHD2CqqzuQCUd3t8LHR3tq25e8j51uboJsUoey0rTiaiePtur1+OBOcWMMKx7 Bb3ahzUOSdH7nKMN/cVwyHKPVW9cSo8BhlGskkC+kxBRox3LMh11czs+1J7zlO63 N10juwCUnPSfMJYUt41E =vhJu -----END PGP SIGNATURE----- --Apple-Mail=_87BD33B6-CB4E-401F-9333-8536CC1BE24A-- From owner-svn-src-all@freebsd.org Sun Aug 2 19:49:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3196D9B1C02; Sun, 2 Aug 2015 19:49:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221D0B29; Sun, 2 Aug 2015 19:49:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72JnPDd011080; Sun, 2 Aug 2015 19:49:25 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72JnO2U011079; Sun, 2 Aug 2015 19:49:24 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508021949.t72JnO2U011079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 2 Aug 2015 19:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286211 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 19:49:25 -0000 Author: bapt Date: Sun Aug 2 19:49:24 2015 New Revision: 286211 URL: https://svnweb.freebsd.org/changeset/base/286211 Log: Use intmax_t rather than long long Modified: head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 18:20:36 2015 (r286210) +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 19:49:24 2015 (r286211) @@ -493,11 +493,11 @@ write_userconfig(struct userconf *cnf, c quote = 0; break; case _UC_EXPIRE: - sbuf_printf(buf, "%lld", (long long)cnf->expire_days); + sbuf_printf(buf, "%jd", (intmax_t)cnf->expire_days); quote = 0; break; case _UC_PASSWORD: - sbuf_printf(buf, "%lld", (long long)cnf->password_days); + sbuf_printf(buf, "%jd", (intmax_t)cnf->password_days); quote = 0; break; case _UC_NONE: From owner-svn-src-all@freebsd.org Sun Aug 2 21:24:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5651B9B12FA; Sun, 2 Aug 2015 21:24:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44FBC1C15; Sun, 2 Aug 2015 21:24:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72LO4Qs056003; Sun, 2 Aug 2015 21:24:04 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72LO4Jc056002; Sun, 2 Aug 2015 21:24:04 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508022124.t72LO4Jc056002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sun, 2 Aug 2015 21:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286212 - head/tools/bus_space/examples X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 21:24:04 -0000 Author: marcel Date: Sun Aug 2 21:24:03 2015 New Revision: 286212 URL: https://svnweb.freebsd.org/changeset/base/286212 Log: Add an example program (in Python) for the AMD Am79c900 (ILACC) ethernet controller. The ethernet controller is emulated by VMware Fusion (for example) and is a good device to demonstrate how to use the bus space and busdma functions due to its simple programming. The program sets up the DMA structures, sends a DHCP discover packet, waits 2 seconds, and iterates over the receive ring for an offer. Added: head/tools/bus_space/examples/ head/tools/bus_space/examples/am79c900_diag.py (contents, props changed) Added: head/tools/bus_space/examples/am79c900_diag.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/examples/am79c900_diag.py Sun Aug 2 21:24:03 2015 (r286212) @@ -0,0 +1,344 @@ +#!/usr/bin/env python +# +# Copyright (c) 2014 Marcel Moolenaar +# All rights reserved. +# +# 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. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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. +# +# $FreeBSD$ +# + +''' +Simple diagnostics program fo the AMD Am89c900 series ILACC. +This ethernet controller is emulated by VMware Fusion among +possibly other virtualization platforms. + +The datasheet can be found here: + http://support.amd.com/TechDocs/18219.pdf + +This example program sends a single DHCP discovery packet, +waits 2 seconds and then iterates over the receive ring for +a targeted packet. + +For this program to function, connect the network interface +to a network with a DHCP server. In VMware Fusion this can +best be done by configuring the interface as a NAT interface +using the "Share with my Mac" setting. +''' + +import ctypes +import logging +import os +import sys +import time + +sys.path.append('/usr/lib') + +import bus +import busdma + + +# ILACC initialization block definition +class initblock(ctypes.LittleEndianStructure): + _fields_ = [('mode', ctypes.c_uint32), + ('hwaddr', ctypes.c_uint8 * 6), + ('_pad1_', ctypes.c_uint16), + ('filter', ctypes.c_uint16 * 4), + ('rxdesc', ctypes.c_uint32), + ('txdesc', ctypes.c_uint32), + ('_pad2_', ctypes.c_uint32)] + + +# ILACC ring buffer descriptor +class bufdesc(ctypes.LittleEndianStructure): + _fields_ = [('buffer', ctypes.c_uint32), + ('flags', ctypes.c_uint32), + ('length', ctypes.c_uint32), + ('_pad_', ctypes.c_uint32)] + + +# The DHCP packet definition (incl. all headers) +class packet(ctypes.BigEndianStructure): + _pack_ = 1 + _fields_ = [('eth_dest', ctypes.c_uint8 * 6), + ('eth_src', ctypes.c_uint8 * 6), + ('eth_type', ctypes.c_uint16), + ('ip_vl', ctypes.c_uint8), + ('ip_de', ctypes.c_uint8), + ('ip_len', ctypes.c_uint16), + ('ip_id', ctypes.c_uint16), + ('ip_ff', ctypes.c_uint16), + ('ip_ttl', ctypes.c_uint8), + ('ip_proto', ctypes.c_uint8), + ('ip_cksum', ctypes.c_uint16), + ('ip_src', ctypes.c_uint32), + ('ip_dest', ctypes.c_uint32), + ('udp_src', ctypes.c_uint16), + ('udp_dest', ctypes.c_uint16), + ('udp_len', ctypes.c_uint16), + ('udp_cksum', ctypes.c_uint16), + ('bootp_op', ctypes.c_uint8), + ('bootp_htype', ctypes.c_uint8), + ('bootp_hlen', ctypes.c_uint8), + ('bootp_hops', ctypes.c_uint8), + ('bootp_xid', ctypes.c_uint32), + ('bootp_secs', ctypes.c_uint16), + ('bootp_flags', ctypes.c_uint16), + ('bootp_ciaddr', ctypes.c_uint32), + ('bootp_yiaddr', ctypes.c_uint32), + ('bootp_siaddr', ctypes.c_uint32), + ('bootp_giaddr', ctypes.c_uint32), + ('bootp_chaddr', ctypes.c_uint8 * 16), + ('bootp_sname', ctypes.c_uint8 * 64), + ('bootp_file', ctypes.c_uint8 * 128), + ('dhcp_magic', ctypes.c_uint32), + ('dhcp_options', ctypes.c_uint8 * 60)] + +MACFMT = '%02x:%02x:%02x:%02x:%02x:%02x' + +dev = 'pci0:2:1:0' + +logging.basicConfig(level=logging.DEBUG) + +pcicfg = bus.map(dev, 'pcicfg') +logging.debug('pcicfg=%s (%s)' % (pcicfg, dev)) + +vendor = bus.read_2(pcicfg, 0) +device = bus.read_2(pcicfg, 2) +if vendor != 0x1022 or device != 0x2000: + logging.error('Not an AMD PCnet-PCI (vendor=%x, device=%x)' % + (vendor, device)) + sys.exit(1) + +command = bus.read_2(pcicfg, 4) +if not (command & 1): + logging.info('enabling I/O port decoding') + command |= 1 + bus.write_2(pcicfg, 4, command) + +if not (command & 4): + logging.info('enabling bus mastering') + command |= 4 + bus.write_2(pcicfg, 4, command) + +bus.unmap(pcicfg) + +io = bus.map(dev, '10.io') +logging.debug('io=%s (%s)' % (io, dev)) + + +def delay(msec): + time.sleep(msec / 1000.0) + + +def ffs(x): + y = (1 + (x ^ (x-1))) >> 1 + return y.bit_length() + + +def ip_str(a): + return '%d.%d.%d.%d' % ((a >> 24) & 255, (a >> 16) & 255, (a >> 8) & 255, + a & 255) + + +def mac_is(l, r): + for i in xrange(6): + if l[i] != r[i]: + return False + return True + + +def mac_str(m): + return MACFMT % (m[0], m[1], m[2], m[3], m[4], m[5]) + + +def rdbcr(reg): + bus.write_2(io, 0x12, reg & 0xffff) + return bus.read_2(io, 0x16) + + +def wrbcr(reg, val): + bus.write_2(io, 0x12, reg & 0xffff) + bus.write_2(io, 0x16, val & 0xffff) + + +def rdcsr(reg): + bus.write_2(io, 0x12, reg & 0xffff) + return bus.read_2(io, 0x10) + + +def wrcsr(reg, val): + bus.write_2(io, 0x12, reg & 0xffff) + bus.write_2(io, 0x10, val & 0xffff) + + +def start(): + wrcsr(0, 0x42) + delay(100) + + +def stop(): + wrcsr(0, 4) + delay(100) + + +mac = () +bcast = () +for o in xrange(6): + mac += (bus.read_1(io, o),) + bcast += (0xff,) +logging.info('ethernet address = ' + MACFMT % mac) + +stop() +wrbcr(20, 2) # reset +wrcsr(3, 0) # byte swapping mode +wrbcr(2, rdbcr(2) | 2) # Autoneg + +memsize = 32*1024 +bufsize = 1536 +nrxbufs = 16 +ntxbufs = 4 +logging.debug("DMA memory: size = %#x (TX buffers: %u, RX buffers: %u)" % + (memsize, ntxbufs, nrxbufs)) + +mem_tag = busdma.tag_create(dev, 16, 0, 0xffffffff, memsize, 1, memsize, 0, 0) +dmamem = busdma.mem_alloc(mem_tag, 0) +busseg = busdma.md_first_seg(dmamem, busdma.MD_BUS_SPACE) +cpuseg = busdma.md_first_seg(dmamem, busdma.MD_VIRT_SPACE) +busaddr = busdma.seg_get_addr(busseg) +cpuaddr = busdma.seg_get_addr(cpuseg) +logging.debug("DMA memory: CPU address: %#x, device address: %#x" % + (cpuaddr, busaddr)) + +addr_initblock = cpuaddr +addr_rxdesc = addr_initblock + ctypes.sizeof(initblock) +addr_txdesc = addr_rxdesc + ctypes.sizeof(bufdesc) * nrxbufs +addr_rxbufs = addr_txdesc + ctypes.sizeof(bufdesc) * ntxbufs +addr_txbufs = addr_rxbufs + bufsize * nrxbufs + +ib = initblock.from_address(addr_initblock) +ib.mode = ((ffs(ntxbufs) - 1) << 28) | ((ffs(nrxbufs) - 1) << 20) +for i in xrange(len(mac)): + ib.hwaddr[i] = mac[i] +for i in xrange(4): + ib.filter[i] = 0xffff +ib.rxdesc = busaddr + (addr_rxdesc - cpuaddr) +ib.txdesc = busaddr + (addr_txdesc - cpuaddr) +ib._pad1_ = 0 +ib._pad2_ = 0 + +for i in xrange(nrxbufs): + bd = bufdesc.from_address(addr_rxdesc + ctypes.sizeof(bufdesc) * i) + bd.buffer = busaddr + (addr_rxbufs - cpuaddr) + bufsize * i + bd.flags = (1 << 31) | (15 << 12) | (-bufsize & 0xfff) + bd.length = 0 + bd._pad_ = 0 + +for i in xrange(ntxbufs): + bd = bufdesc.from_address(addr_txdesc + ctypes.sizeof(bufdesc) * i) + bd.buffer = busaddr + (addr_txbufs - cpuaddr) + bufsize * i + bd.flags = (15 << 12) + bd.length = 0 + bd._pad_ = 0 + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, 0, addr_rxbufs - cpuaddr) + +# Program address of DMA memory +wrcsr(1, busaddr) +wrcsr(2, busaddr >> 16) +delay(100) + +# Initialize hardware +wrcsr(0, 1) +logging.debug('Waiting for initialization to complete') +csr = rdcsr(0) +while (csr & 0x100) == 0: + logging.debug('CSR=%#x' % (csr)) + csr = rdcsr(0) + +start() + +pkt = packet.from_address(addr_txbufs) +ctypes.memset(addr_txbufs, 0, ctypes.sizeof(pkt)) +options = [53, 1, 1] +for i in xrange(len(options)): + pkt.dhcp_options[i] = options[i] +pkt.dhcp_magic = 0x63825363 +for i in xrange(6): + pkt.bootp_chaddr[i] = mac[i] +pkt.bootp_hlen = 6 +pkt.bootp_htype = 1 +pkt.bootp_op = 1 +pkt.udp_len = ctypes.sizeof(pkt) - 34 +pkt.udp_dest = 67 +pkt.udp_src = 68 +pkt.ip_dest = 0xffffffff +pkt.ip_cksum = 0x79a6 +pkt.ip_proto = 17 +pkt.ip_ttl = 64 +pkt.ip_len = ctypes.sizeof(pkt) - 14 +pkt.ip_vl = 0x45 +pkt.eth_type = 0x0800 +for i in xrange(6): + pkt.eth_src[i] = mac[i] + pkt.eth_dest[i] = bcast[i] +pktlen = ctypes.sizeof(pkt) + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, addr_txbufs - cpuaddr, bufsize) + +bd = bufdesc.from_address(addr_txdesc) +bd.length = 0 +bd.flags = (1 << 31) | (1 << 25) | (1 << 24) | (0xf << 12) | (-pktlen & 0xfff) + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, addr_txdesc - cpuaddr, + ctypes.sizeof(bufdesc)) + +wrcsr(0, 0x48) + +logging.info('DHCP discovery packet sent') + +# Now wait 2 seconds for a DHCP offer to be received. +logging.debug('Waiting 2 seconds for an offer to be received') +time.sleep(2) + +stop() + +busdma.sync_range(dmamem, busdma.SYNC_PREWRITE, addr_rxdesc - cpuaddr, + ctypes.sizeof(bufdesc) * nrxbufs) + +for i in xrange(nrxbufs): + bd = bufdesc.from_address(addr_rxdesc + ctypes.sizeof(bufdesc) * i) + if (bd.flags & 0x80000000): + continue + pkt = packet.from_address(addr_rxbufs + i * bufsize) + if mac_is(pkt.eth_dest, bcast): + logging.debug('RX #%d: broadcast packet: length %u' % (i, bd.length)) + continue + if not mac_is(pkt.eth_dest, mac): + logging.debug('RX #%d: packet for %s?' % (i, mac_str(pkt.eth_dest))) + continue + logging.debug('RX %d: packet from %s!' % (i, mac_str(pkt.eth_src))) + logging.info('Our IP address = %s' % (ip_str(pkt.ip_dest))) + +busdma.mem_free(dmamem) +busdma.tag_destroy(mem_tag) +bus.unmap(io) From owner-svn-src-all@freebsd.org Sun Aug 2 21:33:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 191319B191C; Sun, 2 Aug 2015 21:33:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09DE834A; Sun, 2 Aug 2015 21:33:41 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t72LXeVB060621; Sun, 2 Aug 2015 21:33:40 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t72LXeZc060620; Sun, 2 Aug 2015 21:33:40 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201508022133.t72LXeZc060620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Aug 2015 21:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286213 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 21:33:41 -0000 Author: jmg Date: Sun Aug 2 21:33:40 2015 New Revision: 286213 URL: https://svnweb.freebsd.org/changeset/base/286213 Log: looks like all archs either have clang or cdefs included before.. drop this include as unnecessary.. Requested by: bde Modified: head/sys/net/pfkeyv2.h Modified: head/sys/net/pfkeyv2.h ============================================================================== --- head/sys/net/pfkeyv2.h Sun Aug 2 21:24:03 2015 (r286212) +++ head/sys/net/pfkeyv2.h Sun Aug 2 21:33:40 2015 (r286213) @@ -39,8 +39,6 @@ #ifndef _NET_PFKEYV2_H_ #define _NET_PFKEYV2_H_ -#include - /* This file defines structures and symbols for the PF_KEY Version 2 key management interface. It was written at the U.S. Naval Research From owner-svn-src-all@freebsd.org Mon Aug 3 01:22:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 998739AFA64; Mon, 3 Aug 2015 01:22:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A44F1C7D; Mon, 3 Aug 2015 01:22:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t731Moqi056318; Mon, 3 Aug 2015 01:22:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t731MoXh056317; Mon, 3 Aug 2015 01:22:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201508030122.t731MoXh056317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 3 Aug 2015 01:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286214 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 01:22:50 -0000 Author: gonzo Date: Mon Aug 3 01:22:49 2015 New Revision: 286214 URL: https://svnweb.freebsd.org/changeset/base/286214 Log: Pass correct type of argument to ti_gpio_unmask_irq in ti_gpio_activate_resource Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Sun Aug 2 21:33:40 2015 (r286213) +++ head/sys/arm/ti/ti_gpio.c Mon Aug 3 01:22:49 2015 (r286214) @@ -849,14 +849,16 @@ static int ti_gpio_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { - int pin; + struct ti_gpio_mask_arg mask_arg; if (type != SYS_RES_IRQ) return (ENXIO); /* Unmask the interrupt. */ - pin = rman_get_start(res); - ti_gpio_unmask_irq((void *)(uintptr_t)pin); + mask_arg.pin = rman_get_start(res); + mask_arg.softc = device_get_softc(dev); + + ti_gpio_unmask_irq((void *)&mask_arg); return (0); } From owner-svn-src-all@freebsd.org Mon Aug 3 01:24:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 863359AFC11; Mon, 3 Aug 2015 01:24:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76D081E2F; Mon, 3 Aug 2015 01:24:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t731OnRr056437; Mon, 3 Aug 2015 01:24:49 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t731Om1f056435; Mon, 3 Aug 2015 01:24:48 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201508030124.t731Om1f056435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 3 Aug 2015 01:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286215 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 01:24:49 -0000 Author: marcel Date: Mon Aug 3 01:24:48 2015 New Revision: 286215 URL: https://svnweb.freebsd.org/changeset/base/286215 Log: Make image_copyout_zeroes() an interface function. Modified: head/usr.bin/mkimg/image.c head/usr.bin/mkimg/image.h Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Mon Aug 3 01:22:49 2015 (r286214) +++ head/usr.bin/mkimg/image.c Mon Aug 3 01:24:48 2015 (r286215) @@ -517,14 +517,14 @@ image_copyout_memory(int fd, size_t size return (0); } -static int -image_copyout_zeroes(int fd, size_t size) +int +image_copyout_zeroes(int fd, size_t count) { static uint8_t *zeroes = NULL; size_t sz; int error; - if (lseek(fd, (off_t)size, SEEK_CUR) != -1) + if (lseek(fd, (off_t)count, SEEK_CUR) != -1) return (0); /* @@ -537,12 +537,12 @@ image_copyout_zeroes(int fd, size_t size return (ENOMEM); } - while (size > 0) { - sz = (size > secsz) ? secsz : size; + while (count > 0) { + sz = (count > secsz) ? secsz : count; error = image_copyout_memory(fd, sz, zeroes); if (error) return (error); - size -= sz; + count -= sz; } return (0); } Modified: head/usr.bin/mkimg/image.h ============================================================================== --- head/usr.bin/mkimg/image.h Mon Aug 3 01:22:49 2015 (r286214) +++ head/usr.bin/mkimg/image.h Mon Aug 3 01:24:48 2015 (r286215) @@ -35,6 +35,7 @@ int image_copyin(lba_t blk, int fd, uint int image_copyout(int fd); int image_copyout_done(int fd); int image_copyout_region(int fd, lba_t blk, lba_t size); +int image_copyout_zeroes(int fd, size_t count); int image_data(lba_t blk, lba_t size); lba_t image_get_size(void); int image_init(void); From owner-svn-src-all@freebsd.org Mon Aug 3 03:08:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F5E99B2EAB; Mon, 3 Aug 2015 03:08:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F683191A; Mon, 3 Aug 2015 03:08:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7338mxu097851; Mon, 3 Aug 2015 03:08:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7338mfK097850; Mon, 3 Aug 2015 03:08:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508030308.t7338mfK097850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Aug 2015 03:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286216 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 03:08:49 -0000 Author: kib Date: Mon Aug 3 03:08:48 2015 New Revision: 286216 URL: https://svnweb.freebsd.org/changeset/base/286216 Log: Fix ia64 to not override the call stack bottom address with the register stack bottom address, after the merge of r284956 in r285967. Note: this is a direct commit to stable/10. Reported and tested by: clusteradm (peter) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/kern/kern_exec.c Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Mon Aug 3 01:24:48 2015 (r286215) +++ stable/10/sys/kern/kern_exec.c Mon Aug 3 03:08:48 2015 (r286216) @@ -1104,8 +1104,7 @@ exec_new_vmspace(imgp, sv) #ifdef __ia64__ /* Allocate a new register stack */ - stack_addr = IA64_BACKINGSTORE; - error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, + error = vm_map_stack(map, IA64_BACKINGSTORE, (vm_size_t)ssiz, sv->sv_stackprot, VM_PROT_ALL, MAP_STACK_GROWS_UP); if (error) return (error); From owner-svn-src-all@freebsd.org Mon Aug 3 05:58:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFB1C99C111; Mon, 3 Aug 2015 05:58:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE33C100F; Mon, 3 Aug 2015 05:58:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iodd187 with SMTP id d187so134722190iod.2; Sun, 02 Aug 2015 22:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zj6zIW44ciMGgZpDGlP3u7XU/JzvAfYC20gr70xmwlc=; b=lSgNqSPEOCR6d503ZsaFlEykWJK5xgr1n8lmf2ZnpA7iGUMGnI1+Tkp1y89q6GT6BM qDwTA3D8C0lpvn85oG+L+OLzbgDPweXkL8OW0Q7BQPgCtpvjN6nEmkauU5inTJhLdgs0 47788NuZ3e0DvIM8aSKMuio+hPY5qiYR21ijZ5GAZtqPgg8WTza5uq8bLrB/C9tw0jJF vIjVc969WIwTdAMt3RTe0U3Rig9Ik7Ub49llPOblNnQKOVdQR9OZB0578hSkqhCnxZ7U 7VnPN1hcH1rwVBqltV+ZMSqDW9xf8/9rHMvs1glRhFkpaacNKvV04kIZWp3jC2hSmMZa 3tbQ== MIME-Version: 1.0 X-Received: by 10.107.169.138 with SMTP id f10mr17617355ioj.75.1438581497205; Sun, 02 Aug 2015 22:58:17 -0700 (PDT) Received: by 10.36.38.133 with HTTP; Sun, 2 Aug 2015 22:58:17 -0700 (PDT) In-Reply-To: <201508021949.t72JnO2U011079@repo.freebsd.org> References: <201508021949.t72JnO2U011079@repo.freebsd.org> Date: Sun, 2 Aug 2015 22:58:17 -0700 Message-ID: Subject: Re: svn commit: r286211 - head/usr.sbin/pw From: Adrian Chadd To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 05:58:18 -0000 pw is still broken, compiling mips: cc1: warnings being treated as errors /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_show': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:758: warning: comparison of unsigned expression < 0 is always false /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_del': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:831: warning: comparison of unsigned expression < 0 is always false /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_mod': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:1433: warning: suggest parentheses around assignment used as truth value --- pw_user.o --- .. tsk bapt! I'm on holiday and I can't build -head. :( -a On 2 August 2015 at 12:49, Baptiste Daroussin wrote: > Author: bapt > Date: Sun Aug 2 19:49:24 2015 > New Revision: 286211 > URL: https://svnweb.freebsd.org/changeset/base/286211 > > Log: > Use intmax_t rather than long long > > Modified: > head/usr.sbin/pw/pw_conf.c > > Modified: head/usr.sbin/pw/pw_conf.c > ============================================================================== > --- head/usr.sbin/pw/pw_conf.c Sun Aug 2 18:20:36 2015 (r286210) > +++ head/usr.sbin/pw/pw_conf.c Sun Aug 2 19:49:24 2015 (r286211) > @@ -493,11 +493,11 @@ write_userconfig(struct userconf *cnf, c > quote = 0; > break; > case _UC_EXPIRE: > - sbuf_printf(buf, "%lld", (long long)cnf->expire_days); > + sbuf_printf(buf, "%jd", (intmax_t)cnf->expire_days); > quote = 0; > break; > case _UC_PASSWORD: > - sbuf_printf(buf, "%lld", (long long)cnf->password_days); > + sbuf_printf(buf, "%jd", (intmax_t)cnf->password_days); > quote = 0; > break; > case _UC_NONE: > From owner-svn-src-all@freebsd.org Mon Aug 3 05:59:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B0A799C178; Mon, 3 Aug 2015 05:59:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C88811B0; Mon, 3 Aug 2015 05:59:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t735xVG6036550; Mon, 3 Aug 2015 05:59:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t735xVsI036549; Mon, 3 Aug 2015 05:59:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201508030559.t735xVsI036549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 3 Aug 2015 05:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286217 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 05:59:31 -0000 Author: adrian Date: Mon Aug 3 05:59:30 2015 New Revision: 286217 URL: https://svnweb.freebsd.org/changeset/base/286217 Log: Actually set quiet to something. /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Mon Aug 3 03:08:48 2015 (r286216) +++ head/usr.sbin/pw/pw_user.c Mon Aug 3 05:59:30 2015 (r286217) @@ -677,7 +677,7 @@ pw_user_next(int argc, char **argv, char cfg = optarg; break; case 'q': - quiet; + quiet = true; break; } } From owner-svn-src-all@freebsd.org Mon Aug 3 06:06:57 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41B399C385; Mon, 3 Aug 2015 06:06:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF9C81A1A; Mon, 3 Aug 2015 06:06:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7366vjs040600; Mon, 3 Aug 2015 06:06:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7366vBn040599; Mon, 3 Aug 2015 06:06:57 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508030606.t7366vBn040599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 3 Aug 2015 06:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286218 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 06:06:58 -0000 Author: bapt Date: Mon Aug 3 06:06:56 2015 New Revision: 286218 URL: https://svnweb.freebsd.org/changeset/base/286218 Log: Fix bugs spotted by gcc Reported by: adrian Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Mon Aug 3 05:59:30 2015 (r286217) +++ head/usr.sbin/pw/pw_user.c Mon Aug 3 06:06:56 2015 (r286218) @@ -700,7 +700,7 @@ pw_user_show(int argc, char **argv, char { struct passwd *pwd = NULL; char *name = NULL; - uid_t id = -1; + intmax_t id = -1; int ch; bool all = false; bool pretty = false; @@ -786,7 +786,7 @@ pw_user_del(int argc, char **argv, char char home[MAXPATHLEN]; const char *cfg = NULL; struct stat st; - uid_t id; + intmax_t id = -1; int ch, rc; bool nis = false; bool deletehome = false; @@ -1423,8 +1423,9 @@ pw_user_mod(int argc, char **argv, char int ch, fd = -1; size_t i, j; bool quiet, createhome, pretty, dryrun, nis, edited, docreatehome; + bool precrypted; mode_t homemode = 0; - time_t expire_days, password_days, now, precrypted; + time_t expire_days, password_days, now; expire_days = password_days = -1; gecos = homedir = grname = name = newname = skel = shell =NULL; From owner-svn-src-all@freebsd.org Mon Aug 3 06:52:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F9B199CDFF; Mon, 3 Aug 2015 06:52:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yk0-x22b.google.com (mail-yk0-x22b.google.com [IPv6:2607:f8b0:4002:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B9F3D26; Mon, 3 Aug 2015 06:52:43 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by ykdu72 with SMTP id u72so103246074ykd.2; Sun, 02 Aug 2015 23:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yb3ibPIAx9kyT58AeOYJcrxuykd3yFAF5eNUE7pv2vA=; b=P/p2vbAA/pWSKA6a/oGJJePiGpC2cDniwE92XtrZPueISO3/C9t9i0nLV7ZYcSNp0i N78Pem5x8E926iOjlbAB/b+jIu54BJczpMYnadhU1zlfQaZqhOEnxPSr8Qp3yDCDyuAk ybzp7OebRNH9HxgSO7i2Bc1tkdleXHjsW0DZ7z638p/cxG8vrI/tQ64IBtGhKvIoHrij h3InuUyzeatbCdM7ecpUFIQeWWFUHck6uMVeUOOAjd7Whb07inCh+pme1wpFL4hiqwdq 4WQaapVeCrUxgKyXwGh6uph40cQop2nNDYXPk0Kqkj3iaVe2J3MmTcqPgqDBcOLfbsVb +Vug== MIME-Version: 1.0 X-Received: by 10.129.45.68 with SMTP id t65mr19133849ywt.152.1438584762390; Sun, 02 Aug 2015 23:52:42 -0700 (PDT) Sender: ermal.luci@gmail.com Received: by 10.129.83.139 with HTTP; Sun, 2 Aug 2015 23:52:42 -0700 (PDT) In-Reply-To: <20150802184021.GB59626@raichu> References: <201507291804.t6TI42iH065403@repo.freebsd.org> <20150802184021.GB59626@raichu> Date: Mon, 3 Aug 2015 08:52:42 +0200 X-Google-Sender-Auth: S4oAVOtBo0MjtJpT9dYOYvQ-tIg Message-ID: Subject: Re: svn commit: r286028 - head/sys/netinet From: =?UTF-8?Q?Ermal_Lu=C3=A7i?= To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 06:52:43 -0000 On Sun, Aug 2, 2015 at 8:40 PM, Mark Johnston wrote: > On Wed, Jul 29, 2015 at 06:04:02PM +0000, Ermal Lu=C3=A7i wrote: > > Author: eri > > Date: Wed Jul 29 18:04:01 2015 > > New Revision: 286028 > > URL: https://svnweb.freebsd.org/changeset/base/286028 > > > > Log: > > ip_output normalization and fixes > > > > ip_output has a big chunk of code used to handle special cases with > pfil consumers which also forces a reloop on it. > > Gather all this code together to make it readable and properly handle > the reloop cases. > > > > Some of the issues identified: > > > > M_IP_NEXTHOP is not handled properly in existing code. > > route reference leaking is possible with in FIB number change > > route flags checking is not consistent in the function > > > > Differential Revision: https://reviews.freebsd.org/D3022 > > Reviewed by: gnn > > Approved by: gnn(mentor) > > MFC after: 4 weeks > > > > Modified: > > head/sys/netinet/ip_output.c > > > > Modified: head/sys/netinet/ip_output.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/netinet/ip_output.c Wed Jul 29 17:59:13 2015 > (r286027) > > +++ head/sys/netinet/ip_output.c Wed Jul 29 18:04:01 2015 > (r286028) > > @@ -106,6 +106,94 @@ static void ip_mloopback > > extern int in_mcast_loop; > > extern struct protosw inetsw[]; > > > > +static inline int > > +ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, > > + struct sockaddr_in *dst, int *fibnum, int *error) > > +{ > > + struct m_tag *fwd_tag =3D NULL; > > + struct in_addr odst; > > + struct ip *ip; > > + > > + ip =3D mtod(m, struct ip *); > > + > > + /* Run through list of hooks for output packets. */ > > + odst.s_addr =3D ip->ip_dst.s_addr; > > + *error =3D pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, i= np); > > + if ((*error) !=3D 0 || m =3D=3D NULL) > > + return 1; /* Finished */ > > + > > This can result in a use-after-free in ip_output() if a pfil hook > consumes the first mbuf in the chain. This happens for example when ipfw > nat is in use: m_megapullup() copies the input packet into a single > cluster, which is returned above. However, ip_output() will continue to > reference the original mbuf chain. > > The patch below fixes the problem for me. > > Good catch just push it in. Ok for me. > Thanks, > -Mark > > diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c > index 0790777..086a8c9 100644 > --- a/sys/netinet/ip_output.c > +++ b/sys/netinet/ip_output.c > @@ -107,18 +107,21 @@ extern int in_mcast_loop; > extern struct protosw inetsw[]; > > static inline int > -ip_output_pfil(struct mbuf *m, struct ifnet *ifp, struct inpcb *inp, > - struct sockaddr_in *dst, int *fibnum, int *error) > +ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp, > + struct sockaddr_in *dst, int *fibnum, int *error) > { > struct m_tag *fwd_tag =3D NULL; > + struct mbuf *m; > struct in_addr odst; > struct ip *ip; > > + m =3D *mp; > ip =3D mtod(m, struct ip *); > > /* Run through list of hooks for output packets. */ > odst.s_addr =3D ip->ip_dst.s_addr; > - *error =3D pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, i= np); > + *error =3D pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, PFIL_OUT, i= np); > + m =3D *mp; > if ((*error) !=3D 0 || m =3D=3D NULL) > return 1; /* Finished */ > > @@ -552,7 +555,7 @@ sendit: > > /* Jump over all PFIL processing if hooks are not active. */ > if (PFIL_HOOKED(&V_inet_pfil_hook)) { > - switch (ip_output_pfil(m, ifp, inp, dst, &fibnum, &error)= ) > { > + switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, > &error)) { > case 1: /* Finished */ > goto done; > > --=20 Ermal From owner-svn-src-all@freebsd.org Mon Aug 3 07:20:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3B8D9B256C; Mon, 3 Aug 2015 07:20:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA05D1FC4; Mon, 3 Aug 2015 07:20:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t737Kac1071037; Mon, 3 Aug 2015 07:20:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t737KYpF070643; Mon, 3 Aug 2015 07:20:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508030720.t737KYpF070643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 07:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286219 - in stable/10/usr.sbin: ctld iscsid X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 07:20:37 -0000 Author: trasz Date: Mon Aug 3 07:20:33 2015 New Revision: 286219 URL: https://svnweb.freebsd.org/changeset/base/286219 Log: MFC r285086: Remove OpenSSL dependency from iscsid(8) and ctld(8). Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/Makefile stable/10/usr.sbin/ctld/chap.c stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/iscsid/Makefile stable/10/usr.sbin/iscsid/chap.c stable/10/usr.sbin/iscsid/iscsid.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/Makefile ============================================================================== --- stable/10/usr.sbin/ctld/Makefile Mon Aug 3 06:06:56 2015 (r286218) +++ stable/10/usr.sbin/ctld/Makefile Mon Aug 3 07:20:33 2015 (r286219) @@ -10,8 +10,8 @@ CFLAGS+= -I${.CURDIR}/../../sys/dev/iscs #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -DPADD= ${LIBBSDXML} ${LIBCRYPTO} ${LIBL} ${LIBSBUF} ${LIBUTIL} -LDADD= -lbsdxml -lcrypto -ll -lsbuf -lutil +DPADD= ${LIBBSDXML} ${LIBL} ${LIBMD} ${LIBSBUF} ${LIBUTIL} +LDADD= -lbsdxml -ll -lmd -lsbuf -lutil YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output Modified: stable/10/usr.sbin/ctld/chap.c ============================================================================== --- stable/10/usr.sbin/ctld/chap.c Mon Aug 3 06:06:56 2015 (r286218) +++ stable/10/usr.sbin/ctld/chap.c Mon Aug 3 07:20:33 2015 (r286219) @@ -32,12 +32,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include -#include -#include -#include +#include #include "ctld.h" @@ -47,17 +46,14 @@ chap_compute_md5(const char id, const ch size_t response_len) { MD5_CTX ctx; - int rv; - assert(response_len == MD5_DIGEST_LENGTH); + assert(response_len == CHAP_DIGEST_LEN); - MD5_Init(&ctx); - MD5_Update(&ctx, &id, sizeof(id)); - MD5_Update(&ctx, secret, strlen(secret)); - MD5_Update(&ctx, challenge, challenge_len); - rv = MD5_Final(response, &ctx); - if (rv != 1) - log_errx(1, "MD5_Final"); + MD5Init(&ctx); + MD5Update(&ctx, &id, sizeof(id)); + MD5Update(&ctx, secret, strlen(secret)); + MD5Update(&ctx, challenge, challenge_len); + MD5Final(response, &ctx); } static int @@ -235,7 +231,6 @@ struct chap * chap_new(void) { struct chap *chap; - int rv; chap = calloc(sizeof(*chap), 1); if (chap == NULL) @@ -244,16 +239,8 @@ chap_new(void) /* * Generate the challenge. */ - rv = RAND_bytes(chap->chap_challenge, sizeof(chap->chap_challenge)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } - rv = RAND_bytes(&chap->chap_id, sizeof(chap->chap_id)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } + arc4random_buf(chap->chap_challenge, sizeof(chap->chap_challenge)); + arc4random_buf(&chap->chap_id, sizeof(chap->chap_id)); return (chap); } @@ -320,7 +307,7 @@ chap_receive(struct chap *chap, const ch int chap_authenticate(struct chap *chap, const char *secret) { - char expected_response[MD5_DIGEST_LENGTH]; + char expected_response[CHAP_DIGEST_LEN]; chap_compute_md5(chap->chap_id, secret, chap->chap_challenge, sizeof(chap->chap_challenge), @@ -397,7 +384,7 @@ rchap_get_response_bin(struct rchap *rch void **responsep, size_t *response_lenp) { void *response_bin; - size_t response_bin_len = MD5_DIGEST_LENGTH; + size_t response_bin_len = CHAP_DIGEST_LEN; response_bin = calloc(response_bin_len, 1); if (response_bin == NULL) Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Mon Aug 3 06:06:56 2015 (r286218) +++ stable/10/usr.sbin/ctld/ctld.h Mon Aug 3 07:20:33 2015 (r286219) @@ -39,7 +39,6 @@ #include #include #include -#include #define DEFAULT_CONFIG_PATH "/etc/ctl.conf" #define DEFAULT_PIDFILE "/var/run/ctld.pid" @@ -261,11 +260,12 @@ struct keys { }; #define CHAP_CHALLENGE_LEN 1024 +#define CHAP_DIGEST_LEN 16 /* Equal to MD5 digest size. */ struct chap { unsigned char chap_id; char chap_challenge[CHAP_CHALLENGE_LEN]; - char chap_response[MD5_DIGEST_LENGTH]; + char chap_response[CHAP_DIGEST_LEN]; }; struct rchap { Modified: stable/10/usr.sbin/iscsid/Makefile ============================================================================== --- stable/10/usr.sbin/iscsid/Makefile Mon Aug 3 06:06:56 2015 (r286218) +++ stable/10/usr.sbin/iscsid/Makefile Mon Aug 3 07:20:33 2015 (r286219) @@ -8,8 +8,8 @@ CFLAGS+= -I${.CURDIR}/../../sys/dev/iscs #CFLAGS+= -DICL_KERNEL_PROXY MAN= iscsid.8 -DPADD= ${LIBCRYPTO} ${LIBSSL} ${LIBUTIL} -LDADD= -lcrypto -lssl -lutil +DPADD= ${LIBMD} ${LIBUTIL} +LDADD= -lmd -lutil WARNS= 6 Modified: stable/10/usr.sbin/iscsid/chap.c ============================================================================== --- stable/10/usr.sbin/iscsid/chap.c Mon Aug 3 06:06:56 2015 (r286218) +++ stable/10/usr.sbin/iscsid/chap.c Mon Aug 3 07:20:33 2015 (r286219) @@ -32,12 +32,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include -#include -#include -#include +#include #include "iscsid.h" @@ -47,17 +46,14 @@ chap_compute_md5(const char id, const ch size_t response_len) { MD5_CTX ctx; - int rv; - assert(response_len == MD5_DIGEST_LENGTH); + assert(response_len == CHAP_DIGEST_LEN); - MD5_Init(&ctx); - MD5_Update(&ctx, &id, sizeof(id)); - MD5_Update(&ctx, secret, strlen(secret)); - MD5_Update(&ctx, challenge, challenge_len); - rv = MD5_Final(response, &ctx); - if (rv != 1) - log_errx(1, "MD5_Final"); + MD5Init(&ctx); + MD5Update(&ctx, &id, sizeof(id)); + MD5Update(&ctx, secret, strlen(secret)); + MD5Update(&ctx, challenge, challenge_len); + MD5Final(response, &ctx); } static int @@ -235,7 +231,6 @@ struct chap * chap_new(void) { struct chap *chap; - int rv; chap = calloc(sizeof(*chap), 1); if (chap == NULL) @@ -244,16 +239,8 @@ chap_new(void) /* * Generate the challenge. */ - rv = RAND_bytes(chap->chap_challenge, sizeof(chap->chap_challenge)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } - rv = RAND_bytes(&chap->chap_id, sizeof(chap->chap_id)); - if (rv != 1) { - log_errx(1, "RAND_bytes failed: %s", - ERR_error_string(ERR_get_error(), NULL)); - } + arc4random_buf(chap->chap_challenge, sizeof(chap->chap_challenge)); + arc4random_buf(&chap->chap_id, sizeof(chap->chap_id)); return (chap); } @@ -320,7 +307,7 @@ chap_receive(struct chap *chap, const ch int chap_authenticate(struct chap *chap, const char *secret) { - char expected_response[MD5_DIGEST_LENGTH]; + char expected_response[CHAP_DIGEST_LEN]; chap_compute_md5(chap->chap_id, secret, chap->chap_challenge, sizeof(chap->chap_challenge), @@ -397,7 +384,7 @@ rchap_get_response_bin(struct rchap *rch void **responsep, size_t *response_lenp) { void *response_bin; - size_t response_bin_len = MD5_DIGEST_LENGTH; + size_t response_bin_len = CHAP_DIGEST_LEN; response_bin = calloc(response_bin_len, 1); if (response_bin == NULL) Modified: stable/10/usr.sbin/iscsid/iscsid.h ============================================================================== --- stable/10/usr.sbin/iscsid/iscsid.h Mon Aug 3 06:06:56 2015 (r286218) +++ stable/10/usr.sbin/iscsid/iscsid.h Mon Aug 3 07:20:33 2015 (r286219) @@ -34,7 +34,6 @@ #include #include -#include #include @@ -82,11 +81,12 @@ struct keys { }; #define CHAP_CHALLENGE_LEN 1024 +#define CHAP_DIGEST_LEN 16 /* Equal to MD5 digest size. */ struct chap { unsigned char chap_id; char chap_challenge[CHAP_CHALLENGE_LEN]; - char chap_response[MD5_DIGEST_LENGTH]; + char chap_response[CHAP_DIGEST_LEN]; }; struct rchap { From owner-svn-src-all@freebsd.org Mon Aug 3 07:28:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9864F9B2639; Mon, 3 Aug 2015 07:28:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 895C975B; Mon, 3 Aug 2015 07:28:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t737SO8q074676; Mon, 3 Aug 2015 07:28:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t737SOFv074675; Mon, 3 Aug 2015 07:28:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508030728.t737SOFv074675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 07:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286220 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 07:28:24 -0000 Author: trasz Date: Mon Aug 3 07:28:23 2015 New Revision: 286220 URL: https://svnweb.freebsd.org/changeset/base/286220 Log: MFC r284542: Allow '@' in unquoted strings, such as with the "path" statement. Note that one can use any character they like by using double quotes. PR: 200895 Sponsored by: The FreeBDS Foundation Modified: stable/10/usr.sbin/ctld/token.l Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/token.l ============================================================================== --- stable/10/usr.sbin/ctld/token.l Mon Aug 3 07:20:33 2015 (r286219) +++ stable/10/usr.sbin/ctld/token.l Mon Aug 3 07:28:23 2015 (r286220) @@ -80,7 +80,7 @@ target { return TARGET; } timeout { return TIMEOUT; } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } -[a-zA-Z0-9\.\-_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } +[a-zA-Z0-9\.\-@_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } \{ { return OPENING_BRACKET; } \} { return CLOSING_BRACKET; } #.*$ /* ignore comments */; From owner-svn-src-all@freebsd.org Mon Aug 3 07:29:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4699B26A8; Mon, 3 Aug 2015 07:29:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C11AC8AC; Mon, 3 Aug 2015 07:29:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t737TwpL074815; Mon, 3 Aug 2015 07:29:58 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t737TwlP074814; Mon, 3 Aug 2015 07:29:58 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201508030729.t737TwlP074814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 3 Aug 2015 07:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286221 - head/sys/amd64/cloudabi64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 07:29:58 -0000 Author: ed Date: Mon Aug 3 07:29:57 2015 New Revision: 286221 URL: https://svnweb.freebsd.org/changeset/base/286221 Log: Set p_osrel to __FreeBSD_version on process startup. Certain system calls have quirks applied to make them work as if called on an older version of FreeBSD. As CloudABI executables don't have the FreeBSD OS release number in the ELF header, this value is set to zero, making the system calls fall back to typically historic, non-standard behaviour. Reviewed by: kib Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Aug 3 07:28:23 2015 (r286220) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Mon Aug 3 07:29:57 2015 (r286221) @@ -73,10 +73,20 @@ cloudabi64_fixup(register_t **stack_base { char canarybuf[64]; Elf64_Auxargs *args; + struct thread *td; void *argdata, *canary; size_t argdatalen; int error; + /* + * CloudABI executables do not store the FreeBSD OS release + * number in their header. Set the OS release number to the + * latest version of FreeBSD, so that system calls behave as if + * called natively. + */ + td = curthread; + td->td_proc->p_osrel = __FreeBSD_version; + /* Store canary for stack smashing protection. */ argdata = *stack_base; arc4rand(canarybuf, sizeof(canarybuf), 0); @@ -108,7 +118,7 @@ cloudabi64_fixup(register_t **stack_base VAL(CLOUDABI_AT_PAGESZ, args->pagesz), PTR(CLOUDABI_AT_PHDR, args->phdr), VAL(CLOUDABI_AT_PHNUM, args->phnum), - VAL(CLOUDABI_AT_TID, curthread->td_tid), + VAL(CLOUDABI_AT_TID, td->td_tid), #undef VAL #undef PTR { .a_type = CLOUDABI_AT_NULL }, From owner-svn-src-all@freebsd.org Mon Aug 3 08:04:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEBA79B2F7C; Mon, 3 Aug 2015 08:04:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F619A7A; Mon, 3 Aug 2015 08:04:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t7384Wj0090662; Mon, 3 Aug 2015 08:04:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t7384Wds090660; Mon, 3 Aug 2015 08:04:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201508030804.t7384Wds090660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Aug 2015 08:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286222 - in stable/10: sys/kern usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 08:04:32 -0000 Author: trasz Date: Mon Aug 3 08:04:31 2015 New Revision: 286222 URL: https://svnweb.freebsd.org/changeset/base/286222 Log: MFC r282086: Make setproctitle(3) work in Capsicum capability mode. This makes ctld(8) child processes to indicate initiator address and name in their titles, similar to what iscsid(8) child processes do. PR: 181352 Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/kern/kern_proc.c stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Mon Aug 3 07:29:57 2015 (r286221) +++ stable/10/sys/kern/kern_proc.c Mon Aug 3 08:04:31 2015 (r286222) @@ -2782,7 +2782,7 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC sysctl_kern_proc, "Return process table, no threads"); static SYSCTL_NODE(_kern_proc, KERN_PROC_ARGS, args, - CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, + CTLFLAG_RW | CTLFLAG_CAPWR | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_args, "Process argument list"); static SYSCTL_NODE(_kern_proc, KERN_PROC_ENV, env, CTLFLAG_RD | CTLFLAG_MPSAFE, Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Mon Aug 3 07:29:57 2015 (r286221) +++ stable/10/usr.sbin/ctld/login.c Mon Aug 3 08:04:31 2015 (r286222) @@ -789,9 +789,6 @@ login(struct connection *conn) } conn->conn_initiator_name = checked_strdup(initiator_name); log_set_peer_name(conn->conn_initiator_name); - /* - * XXX: This doesn't work (does nothing) because of Capsicum. - */ setproctitle("%s (%s)", conn->conn_initiator_addr, conn->conn_initiator_name); redirected = login_portal_redirect(conn, request); From owner-svn-src-all@freebsd.org Mon Aug 3 09:34:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 054E09B1547; Mon, 3 Aug 2015 09:34:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7978FE1; Mon, 3 Aug 2015 09:34:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t739YA9l026669; Mon, 3 Aug 2015 09:34:10 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t739YAkT026668; Mon, 3 Aug 2015 09:34:10 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201508030934.t739YAkT026668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 3 Aug 2015 09:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 09:34:11 -0000 Author: smh Date: Mon Aug 3 09:34:09 2015 New Revision: 286223 URL: https://svnweb.freebsd.org/changeset/base/286223 Log: Fix KSTACK_PAGES check in ZFS module The check introduced by r285946 failed to add the dependency on opt_kstack_pages.h which meant the default value for the platform instead of the customised options KSTACK_PAGES=X was being tested. Also wrap in #ifdef __FreeBSD__ for portability. MFC after: 3 days Sponsored by: Multiplay Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 3 08:04:31 2015 (r286222) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Aug 3 09:34:09 2015 (r286223) @@ -132,6 +132,9 @@ * distinguish between the operation failing, and * deserialization failing. */ +#ifdef __FreeBSD__ +#include "opt_kstack_pages.h" +#endif #include #include @@ -6491,18 +6494,22 @@ static void zfs_shutdown(void *, int); static eventhandler_tag zfs_shutdown_event_tag; +#ifdef __FreeBSD__ #define ZFS_MIN_KSTACK_PAGES 4 +#endif int zfs__init(void) { +#ifdef __FreeBSD__ #if KSTACK_PAGES < ZFS_MIN_KSTACK_PAGES printf("ZFS NOTICE: KSTACK_PAGES is %d which could result in stack " "overflow panic!\nPlease consider adding " "'options KSTACK_PAGES=%d' to your kernel config\n", KSTACK_PAGES, ZFS_MIN_KSTACK_PAGES); #endif +#endif zfs_root_token = root_mount_hold("ZFS"); mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@freebsd.org Mon Aug 3 09:47:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 734C59B1A26; Mon, 3 Aug 2015 09:47:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 315081979; Mon, 3 Aug 2015 09:47:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMCLC-0002tQ-7S; Mon, 03 Aug 2015 12:47:30 +0300 Date: Mon, 3 Aug 2015 12:47:30 +0300 From: Slawa Olhovchenkov To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803094730.GA24698@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> MIME-Version: 1.0 Co