From 5d171016e7ded77bb3a5eaff82d036a250f515bb Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Fri, 17 Jul 2009 12:18:39 +0000 Subject: Vendor import of OpenBSM 1.1p1, which incorporates the following changes since the last imported OpenBSM release: OpenBSM 1.1p1 - Fixes to AUT_SOCKUNIX token parsing. - IPv6 support for au_to_me(3). - Improved robustness in the parsing of audit_control, especially long flags/naflags strings and whitespace in all fields. - Add missing conversion of a number of FreeBSD/Mac OS X errnos to/from BSM error number space. Obtained from: TrustedBSD Project Sponsored by: Apple, Inc. --- libbsm/bsm_control.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libbsm/bsm_control.c') diff --git a/libbsm/bsm_control.c b/libbsm/bsm_control.c index a58db0ef6ea46..378035db729ed 100644 --- a/libbsm/bsm_control.c +++ b/libbsm/bsm_control.c @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#33 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#34 $ */ #include @@ -121,9 +121,13 @@ getstrfromtype_locked(char *name, char **str) if (linestr[0] == '#') continue; - /* Remove trailing new line character. */ - if ((nl = strrchr(linestr, '\n')) != NULL) + /* Remove trailing new line character and white space. */ + nl = strchr(linestr, '\0') - 1; + while (nl >= linestr && ('\n' == *nl || ' ' == *nl || + '\t' == *nl)) { *nl = '\0'; + nl--; + } tokptr = linestr; if ((type = strtok_r(tokptr, delim, &last)) != NULL) { -- cgit v1.2.3