CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sat Jun 20 00:16:51 UTC 2020 Modified Files: src/common/lib/libprop: prop_string.c Log Message: Fix lint To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/common/lib/libprop/prop_string.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_string.c diff -u src/common/lib/libprop/prop_string.c:1.14 src/common/lib/libprop/prop_string.c:1.15 --- src/common/lib/libprop/prop_string.c:1.14 Sat Jun 6 17:25:59 2020 +++ src/common/lib/libprop/prop_string.c Fri Jun 19 20:16:50 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_string.c,v 1.14 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_string.c,v 1.15 2020/06/20 00:16:50 christos Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -314,6 +314,7 @@ prop_string_create_format(const char *fm prop_string_t ps; char *str = NULL; int len; + size_t nlen; va_list ap; _PROP_ASSERT(fmt != NULL); @@ -324,16 +325,17 @@ prop_string_create_format(const char *fm if (len < 0) return (NULL); + nlen = len + 1; - str = _PROP_MALLOC(len + 1, M_PROP_STRING); + str = _PROP_MALLOC(nlen, M_PROP_STRING); if (str == NULL) return (NULL); va_start(ap, fmt); - vsnprintf(str, len + 1, fmt, ap); + vsnprintf(str, nlen, fmt, ap); va_end(ap); - ps = _prop_string_instantiate(0, str, len); + ps = _prop_string_instantiate(0, str, (size_t)len); if (ps == NULL) _PROP_FREE(str, M_PROP_STRING);
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Mon Jun 15 00:46:00 UTC 2020 Modified Files: src/common/lib/libprop: prop_dictionary_util.c Log Message: remove error(1) comments To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_dictionary_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary_util.c diff -u src/common/lib/libprop/prop_dictionary_util.c:1.7 src/common/lib/libprop/prop_dictionary_util.c:1.8 --- src/common/lib/libprop/prop_dictionary_util.c:1.7 Sun Jun 14 17:31:01 2020 +++ src/common/lib/libprop/prop_dictionary_util.c Sun Jun 14 20:46:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary_util.c,v 1.7 2020/06/14 21:31:01 christos Exp $ */ +/* $NetBSD: prop_dictionary_util.c,v 1.8 2020/06/15 00:46:00 christos Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -154,8 +154,6 @@ UTEMPLATE(uchar, unsigned char) UTEMPLATE(ushort,unsigned short) UTEMPLATE(uint, unsigned int) UTEMPLATE(ulong, unsigned long) -/*###155 [lint] warning conversion to 'unsigned long' due to prototype, arg #3 [259]%%%*/ -/*###155 [lint] warning conversion from 'unsigned long long' to 'unsigned long' may lose accuracy, arg #3 [298]%%%*/ UTEMPLATE(ulonglong, unsigned long long) UTEMPLATE(uintptr, uintptr_t) UTEMPLATE(uint8, uint8_t)
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sun Jun 14 21:31:01 UTC 2020 Modified Files: src/common/lib/libprop: prop_array_util.c prop_dictionary_util.c Log Message: add/fix linted comments To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_array_util.c cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_dictionary_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array_util.c diff -u src/common/lib/libprop/prop_array_util.c:1.7 src/common/lib/libprop/prop_array_util.c:1.8 --- src/common/lib/libprop/prop_array_util.c:1.7 Sun Jun 14 17:28:58 2020 +++ src/common/lib/libprop/prop_array_util.c Sun Jun 14 17:31:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_array_util.c,v 1.7 2020/06/14 21:28:58 christos Exp $ */ +/* $NetBSD: prop_array_util.c,v 1.8 2020/06/14 21:31:01 christos Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -136,7 +136,7 @@ prop_array_set_ ## name (prop_array_t ar unsigned int indx,\ typ val) \ { \ - /*LINTED: for conversion from long long to 'long'*/ \ + /*LINTED: for conversion from 'long long' to 'long'*/ \ return prop_array_set_ ## which ## _number(array, indx, val); \ } \ \ @@ -144,7 +144,7 @@ bool \ prop_array_add_ ## name (prop_array_t array,\ typ val) \ { \ - /*LINTED: for conversion from long long to 'long'*/ \ + /*LINTED: for conversion from 'long long' to 'long'*/ \ return prop_array_add_ ## which ## _number(array, val); \ } Index: src/common/lib/libprop/prop_dictionary_util.c diff -u src/common/lib/libprop/prop_dictionary_util.c:1.6 src/common/lib/libprop/prop_dictionary_util.c:1.7 --- src/common/lib/libprop/prop_dictionary_util.c:1.6 Sat Jun 6 17:25:59 2020 +++ src/common/lib/libprop/prop_dictionary_util.c Sun Jun 14 17:31:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary_util.c,v 1.6 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_dictionary_util.c,v 1.7 2020/06/14 21:31:01 christos Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -121,6 +121,7 @@ static bool prop_dictionary_set_unsigned_number(prop_dictionary_t dict, const char *key, uintmax_t val) { + /*LINTED: for conversion from 'long long' to 'long'*/ \ return prop_dictionary_set_and_rel(dict, key, prop_number_create_unsigned(val)); } @@ -131,6 +132,7 @@ prop_dictionary_set_ ## name (prop_dicti const char *key,\ typ val) \ { \ + /*LINTED: for conversion from long long to 'long'*/ \ return prop_dictionary_set_ ## which ## _number(dict, key, val);\ } @@ -152,6 +154,8 @@ UTEMPLATE(uchar, unsigned char) UTEMPLATE(ushort,unsigned short) UTEMPLATE(uint, unsigned int) UTEMPLATE(ulong, unsigned long) +/*###155 [lint] warning conversion to 'unsigned long' due to prototype, arg #3 [259]%%%*/ +/*###155 [lint] warning conversion from 'unsigned long long' to 'unsigned long' may lose accuracy, arg #3 [298]%%%*/ UTEMPLATE(ulonglong, unsigned long long) UTEMPLATE(uintptr, uintptr_t) UTEMPLATE(uint8, uint8_t)
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sun Jun 14 21:28:58 UTC 2020 Modified Files: src/common/lib/libprop: prop_array_util.c Log Message: Fix incorrect type (found by lint), and add linted comments for the long long -> long (uintmax_t on LP64) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_array_util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array_util.c diff -u src/common/lib/libprop/prop_array_util.c:1.6 src/common/lib/libprop/prop_array_util.c:1.7 --- src/common/lib/libprop/prop_array_util.c:1.6 Sat Jun 6 17:25:59 2020 +++ src/common/lib/libprop/prop_array_util.c Sun Jun 14 17:28:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_array_util.c,v 1.6 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_array_util.c,v 1.7 2020/06/14 21:28:58 christos Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ prop_array_set_unsigned_number(prop_arra } static bool -prop_array_add_unsigned_number(prop_array_t array, intmax_t val) +prop_array_add_unsigned_number(prop_array_t array, uintmax_t val) { return prop_array_add_and_rel(array, prop_number_create_unsigned(val)); } @@ -136,6 +136,7 @@ prop_array_set_ ## name (prop_array_t ar unsigned int indx,\ typ val) \ { \ + /*LINTED: for conversion from long long to 'long'*/ \ return prop_array_set_ ## which ## _number(array, indx, val); \ } \ \ @@ -143,6 +144,7 @@ bool \ prop_array_add_ ## name (prop_array_t array,\ typ val) \ { \ + /*LINTED: for conversion from long long to 'long'*/ \ return prop_array_add_ ## which ## _number(array, val); \ }
CVS commit: src/common/lib/libprop
Module Name:src Committed By: thorpej Date: Fri Jun 12 00:02:26 UTC 2020 Modified Files: src/common/lib/libprop: prop_object_impl.h Log Message: Change previous to only apply when building with clang. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/common/lib/libprop/prop_object_impl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_object_impl.h diff -u src/common/lib/libprop/prop_object_impl.h:1.35 src/common/lib/libprop/prop_object_impl.h:1.36 --- src/common/lib/libprop/prop_object_impl.h:1.35 Thu Jun 11 22:25:44 2020 +++ src/common/lib/libprop/prop_object_impl.h Fri Jun 12 00:02:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object_impl.h,v 1.35 2020/06/11 22:25:44 joerg Exp $ */ +/* $NetBSD: prop_object_impl.h,v 1.36 2020/06/12 00:02:26 thorpej Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -492,7 +492,11 @@ do { \ #if defined(__NetBSD__) #include #define _PROP_ARG_UNUSED __unused -#define _PROP_DEPRECATED(s, m) +#if defined(__clang__) +#define _PROP_DEPRECATED(s, m) /* delete */ +#else /* ! __clang__ */ +#define _PROP_DEPRECATED(s, m) __warn_references(s, m) +#endif /* __clang__ */ #else #define _PROP_ARG_UNUSED /* delete */ #define _PROP_DEPRECATED(s, m) /* delete */
CVS commit: src/common/lib/libprop
Module Name:src Committed By: joerg Date: Thu Jun 11 22:25:44 UTC 2020 Modified Files: src/common/lib/libprop: prop_object_impl.h Log Message: Unbreak clang builds by removing questionable linker warning sections trggered all over the place. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/common/lib/libprop/prop_object_impl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_object_impl.h diff -u src/common/lib/libprop/prop_object_impl.h:1.34 src/common/lib/libprop/prop_object_impl.h:1.35 --- src/common/lib/libprop/prop_object_impl.h:1.34 Sat Jun 6 21:25:59 2020 +++ src/common/lib/libprop/prop_object_impl.h Thu Jun 11 22:25:44 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object_impl.h,v 1.34 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_object_impl.h,v 1.35 2020/06/11 22:25:44 joerg Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -492,7 +492,7 @@ do { \ #if defined(__NetBSD__) #include #define _PROP_ARG_UNUSED __unused -#define _PROP_DEPRECATED(s, m) __warn_references(s, m) +#define _PROP_DEPRECATED(s, m) #else #define _PROP_ARG_UNUSED /* delete */ #define _PROP_DEPRECATED(s, m) /* delete */
CVS commit: src/common/lib/libprop
Module Name:src Committed By: thorpej Date: Mon Jun 8 21:31:56 UTC 2020 Modified Files: src/common/lib/libprop: prop_data.c Log Message: Fix a paste-o that caused prop_data_create_copy() to be intolerant of creating empty data objects. Fixes t_ifconfig::ifconfig_description unit test. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/common/lib/libprop/prop_data.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_data.c diff -u src/common/lib/libprop/prop_data.c:1.16 src/common/lib/libprop/prop_data.c:1.17 --- src/common/lib/libprop/prop_data.c:1.16 Sat Jun 6 21:25:59 2020 +++ src/common/lib/libprop/prop_data.c Mon Jun 8 21:31:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_data.c,v 1.16 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_data.c,v 1.17 2020/06/08 21:31:56 thorpej Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -273,9 +273,6 @@ prop_data_create_copy(const void *v, siz prop_data_t pd; void *nv; - if (v == NULL || size == 0) - return (NULL); - /* Tolerate the creation of empty data objects. */ if (v != NULL && size != 0) { nv = _PROP_MALLOC(size, M_PROP_DATA);
CVS commit: src/common/lib/libprop
Module Name:src Committed By: thorpej Date: Sat Jun 6 22:23:31 UTC 2020 Modified Files: src/common/lib/libprop: prop_number.c Log Message: Correct a deprecation warning. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/common/lib/libprop/prop_number.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.32 src/common/lib/libprop/prop_number.c:1.33 --- src/common/lib/libprop/prop_number.c:1.32 Sat Jun 6 21:25:59 2020 +++ src/common/lib/libprop/prop_number.c Sat Jun 6 22:23:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.32 2020/06/06 21:25:59 thorpej Exp $ */ +/* $NetBSD: prop_number.c,v 1.33 2020/06/06 22:23:31 thorpej Exp $ */ /*- * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc. @@ -366,7 +366,7 @@ prop_number_create_unsigned(uintmax_t va } _PROP_DEPRECATED(prop_number_create_unsigned_integer, -"this program uses prop_number_create_uinteger(), " +"this program uses prop_number_create_unsigned_integer(), " "which is deprecated; use prop_number_create_unsigned() instead.") prop_number_t prop_number_create_unsigned_integer(uint64_t val)
CVS commit: src/common/lib/libprop
Module Name:src Committed By: thorpej Date: Wed May 8 04:34:33 UTC 2019 Modified Files: src/common/lib/libprop: prop_object.c Log Message: Use posix_madvise() rather than the legacy madvise() call, and wrapp the calls in #ifdef for the advice we're giving. Should address reports of host tool build issues. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/common/lib/libprop/prop_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_object.c diff -u src/common/lib/libprop/prop_object.c:1.30 src/common/lib/libprop/prop_object.c:1.31 --- src/common/lib/libprop/prop_object.c:1.30 Tue May 12 14:59:35 2015 +++ src/common/lib/libprop/prop_object.c Wed May 8 04:34:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object.c,v 1.30 2015/05/12 14:59:35 christos Exp $ */ +/* $NetBSD: prop_object.c,v 1.31 2019/05/08 04:34:33 thorpej Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -950,7 +950,10 @@ _prop_object_internalize_map_file(const _PROP_FREE(mf, M_TEMP); return (NULL); } - (void) madvise(mf->poimf_xml, mf->poimf_mapsize, MADV_SEQUENTIAL); +#ifdef POSIX_MADV_SEQUENTIAL + (void) posix_madvise(mf->poimf_xml, mf->poimf_mapsize, + POSIX_MADV_SEQUENTIAL); +#endif if (need_guard) { if (mmap(mf->poimf_xml + mf->poimf_mapsize, @@ -976,7 +979,10 @@ _prop_object_internalize_unmap_file( struct _prop_object_internalize_mapped_file *mf) { - (void) madvise(mf->poimf_xml, mf->poimf_mapsize, MADV_DONTNEED); +#ifdef POSIX_MADV_DONTNEED + (void) posix_madvise(mf->poimf_xml, mf->poimf_mapsize, + POSIX_MADV_DONTNEED); +#endif (void) munmap(mf->poimf_xml, mf->poimf_mapsize); _PROP_FREE(mf, M_TEMP); }
CVS commit: src/common/lib/libprop
Module Name:src Committed By: njoly Date: Tue Mar 7 19:10:07 UTC 2017 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Fix commas in NAME section. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.14 src/common/lib/libprop/prop_copyin_ioctl.9:1.15 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.14 Sun Feb 5 00:47:33 2017 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Tue Mar 7 19:10:07 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_copyin_ioctl.9,v 1.14 2017/02/05 00:47:33 pgoyette Exp $ +.\" $NetBSD: prop_copyin_ioctl.9,v 1.15 2017/03/07 19:10:07 njoly Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -41,8 +41,8 @@ .Nm prop_dictionary_copyin_size , .Nm prop_dictionary_copyin_ioctl , .Nm prop_dictionary_copyin_ioctl_size , -.Nm prop_dictionary_copyout -.Nm prop_dictionary_copyout_ioctl , +.Nm prop_dictionary_copyout , +.Nm prop_dictionary_copyout_ioctl .Nd Copy property lists to and from kernel space .Sh SYNOPSIS .In prop/proplib.h
CVS commit: src/common/lib/libprop
Module Name:src Committed By: abhinav Date: Sun Feb 12 16:18:48 UTC 2017 Modified Files: src/common/lib/libprop: prop_ingest.3 Log Message: Add entry for prop_ingest in the NAME section. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_ingest.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_ingest.3 diff -u src/common/lib/libprop/prop_ingest.3:1.7 src/common/lib/libprop/prop_ingest.3:1.8 --- src/common/lib/libprop/prop_ingest.3:1.7 Sun Feb 12 16:00:53 2017 +++ src/common/lib/libprop/prop_ingest.3 Sun Feb 12 16:18:48 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_ingest.3,v 1.7 2017/02/12 16:00:53 abhinav Exp $ +.\" $NetBSD: prop_ingest.3,v 1.8 2017/02/12 16:18:48 abhinav Exp $ .\" .\" Copyright (c) 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -31,6 +31,7 @@ .Dt PROP_INGEST 3 .Os .Sh NAME +.Nm prop_ingest , .Nm prop_ingest_context_alloc , .Nm prop_ingest_context_free , .Nm prop_ingest_context_error ,
CVS commit: src/common/lib/libprop
Module Name:src Committed By: abhinav Date: Sun Feb 12 16:00:53 UTC 2017 Modified Files: src/common/lib/libprop: prop_array.3 prop_array_util.3 prop_bool.3 prop_data.3 prop_dictionary.3 prop_dictionary_util.3 prop_ingest.3 prop_number.3 prop_object.3 prop_send_ioctl.3 prop_send_syscall.3 prop_string.3 Log Message: Use .Fn to refer a function name instead of Nm. Also, use Xr to refer problib(3) in the HISTORY section instead of Nm. While parsing the man pages, any .Nm occurrence gets replaced by the value specified in the NAME section. Referencing individual function names with .Nm was causing makemandb(8) to replicate the complete NAME section for every such occurrence. This was leading to an ugly looking snippet in apropos(1)'s output when searched for any of these man pages. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/common/lib/libprop/prop_array.3 cvs rdiff -u -r1.9 -r1.10 src/common/lib/libprop/prop_array_util.3 \ src/common/lib/libprop/prop_send_ioctl.3 cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_bool.3 \ src/common/lib/libprop/prop_ingest.3 cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_data.3 cvs rdiff -u -r1.18 -r1.19 src/common/lib/libprop/prop_dictionary.3 cvs rdiff -u -r1.8 -r1.9 src/common/lib/libprop/prop_dictionary_util.3 \ src/common/lib/libprop/prop_object.3 src/common/lib/libprop/prop_string.3 cvs rdiff -u -r1.10 -r1.11 src/common/lib/libprop/prop_number.3 cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_send_syscall.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array.3 diff -u src/common/lib/libprop/prop_array.3:1.13 src/common/lib/libprop/prop_array.3:1.14 --- src/common/lib/libprop/prop_array.3:1.13 Fri Sep 30 22:08:18 2011 +++ src/common/lib/libprop/prop_array.3 Sun Feb 12 16:00:53 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_array.3,v 1.13 2011/09/30 22:08:18 jym Exp $ +.\" $NetBSD: prop_array.3,v 1.14 2017/02/12 16:00:53 abhinav Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -113,7 +113,7 @@ .Fn prop_array_equals "prop_array_t array1" "prop_array_t array2" .Sh DESCRIPTION The -.Nm prop_array +.Fn prop_array family of functions operate on the array property collection object type. An array is an ordered set; an iterated array will return objects in the same order with which they were stored. @@ -303,6 +303,6 @@ Note: Objects contained in the array are .Xr proplib 3 .Sh HISTORY The -.Nm proplib +.Xr proplib 3 property container object library first appeared in .Nx 4.0 . Index: src/common/lib/libprop/prop_array_util.3 diff -u src/common/lib/libprop/prop_array_util.3:1.9 src/common/lib/libprop/prop_array_util.3:1.10 --- src/common/lib/libprop/prop_array_util.3:1.9 Tue May 31 09:31:13 2016 +++ src/common/lib/libprop/prop_array_util.3 Sun Feb 12 16:00:53 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_array_util.3,v 1.9 2016/05/31 09:31:13 wiz Exp $ +.\" $NetBSD: prop_array_util.3,v 1.10 2017/02/12 16:00:53 abhinav Exp $ .\" .\" Copyright (c) 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -176,7 +176,7 @@ "prop_object_t obj" .Sh DESCRIPTION The -.Nm prop_array_util +.Fn prop_array_util family of functions are provided to make getting and setting values in arrays more convenient in some applications. .Pp @@ -211,7 +211,7 @@ function adds the object to the end of t The object is also released on failure. .Sh RETURN VALUES The -.Nm prop_array_util +.Fn prop_array_util getter functions return .Dv true if the object exists in the array and the value is in-range, or @@ -219,7 +219,7 @@ if the object exists in the array and th otherwise. .Pp The -.Nm prop_array_util +.Fn prop_array_util setter functions return .Dv true if creating the object and storing it in the array is successful, or @@ -232,6 +232,6 @@ otherwise. .Xr proplib 3 .Sh HISTORY The -.Nm proplib +.Xr proplib 3 property container object library first appeared in .Nx 4.0 . Index: src/common/lib/libprop/prop_send_ioctl.3 diff -u src/common/lib/libprop/prop_send_ioctl.3:1.9 src/common/lib/libprop/prop_send_ioctl.3:1.10 --- src/common/lib/libprop/prop_send_ioctl.3:1.9 Thu Aug 20 15:55:09 2015 +++ src/common/lib/libprop/prop_send_ioctl.3 Sun Feb 12 16:00:53 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_send_ioctl.3,v 1.9 2015/08/20 15:55:09 phx Exp $ +.\" $NetBSD: prop_send_ioctl.3,v 1.10 2017/02/12 16:00:53 abhinav Exp $ .\" .\" Copyright (c) 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -54,12 +54,12 @@ "unsigned long cmd" "prop_dictionary_t *dictp" .Sh DESCRIPTION The -.Nm prop_array_send_ioctl , -.Nm prop_array_recv_ioctl , -.Nm prop_dictionary_send_ioctl , -.Nm prop_dictionary_recv_ioctl , +.Fn prop_array_send_ioctl , +.Fn prop_array_recv_ioctl , +.Fn prop_dictionary_send_ioctl , +.Fn
CVS commit: src/common/lib/libprop
Module Name:src Committed By: pgoyette Date: Sun Feb 5 00:47:33 UTC 2017 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Add the *_size() variants to the .Nm list so it will be found by apropos(1). While here, reorder the function lists to improve readability. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.13 src/common/lib/libprop/prop_copyin_ioctl.9:1.14 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.13 Sat Feb 4 23:32:43 2017 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Sun Feb 5 00:47:33 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_copyin_ioctl.9,v 1.13 2017/02/04 23:32:43 wiz Exp $ +.\" $NetBSD: prop_copyin_ioctl.9,v 1.14 2017/02/05 00:47:33 pgoyette Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -31,41 +31,39 @@ .Dt PROP_COPYIN_IOCTL 9 .Os .Sh NAME -.Nm prop_array_copyin_ioctl , -.Nm prop_array_copyout_ioctl , .Nm prop_array_copyin , +.Nm prop_array_copyin_size , +.Nm prop_array_copyin_ioctl , +.Nm prop_array_copyin_ioctl_size , .Nm prop_array_copyout , -.Nm prop_dictionary_copyin_ioctl , -.Nm prop_dictionary_copyout_ioctl , +.Nm prop_array_copyout_ioctl , .Nm prop_dictionary_copyin , +.Nm prop_dictionary_copyin_size , +.Nm prop_dictionary_copyin_ioctl , +.Nm prop_dictionary_copyin_ioctl_size , .Nm prop_dictionary_copyout +.Nm prop_dictionary_copyout_ioctl , .Nd Copy property lists to and from kernel space .Sh SYNOPSIS .In prop/proplib.h .Ft int -.Fn prop_array_copyin_ioctl "const struct plistref *pref" \ -"const u_long cmd" "prop_array_t *arrayp" -.Ft int -.Fn prop_array_copyin_ioctl_size "const struct plistref *pref" \ -"const u_long cmd" "prop_array_t *arrayp" "size_t lim" -.Ft int .Fn prop_array_copyin "const struct plistref *pref" \ "prop_array_t *arrayp" .Ft int .Fn prop_array_copyin_size "const struct plistref *pref" \ "prop_array_t *arrayp" "size_t lim" .Ft int -.Fn prop_array_copyout_ioctl "struct plistref *pref" \ -"const u_long cmd" "prop_array_t array" +.Fn prop_array_copyin_ioctl "const struct plistref *pref" \ +"const u_long cmd" "prop_array_t *arrayp" +.Ft int +.Fn prop_array_copyin_ioctl_size "const struct plistref *pref" \ +"const u_long cmd" "prop_array_t *arrayp" "size_t lim" .Ft int .Fn prop_array_copyout "struct plistref *pref" \ "prop_array_t array" .Ft int -.Fn prop_dictionary_copyin_ioctl "const struct plistref *pref" \ -"const u_long cmd" "prop_dictionary_t *dictp" -.Ft int -.Fn prop_dictionary_copyin_ioctl_size "const struct plistref *pref" \ -"const u_long cmd" "prop_dictionary_t *dictp" "size_t lim" +.Fn prop_array_copyout_ioctl "struct plistref *pref" \ +"const u_long cmd" "prop_array_t array" .Ft int .Fn prop_dictionary_copyin "const struct plistref *pref" \ "prop_dictionary_t *dictp" @@ -73,14 +71,19 @@ .Fn prop_dictionary_copyin_size "const struct plistref *pref" \ "prop_dictionary_t *dictp" "size_t lim" .Ft int -.Fn prop_dictionary_copyout_ioctl "struct plistref *pref" \ -"const u_long cmd" "prop_dictionary_t dict" +.Fn prop_dictionary_copyin_ioctl "const struct plistref *pref" \ +"const u_long cmd" "prop_dictionary_t *dictp" +.Ft int +.Fn prop_dictionary_copyin_ioctl_size "const struct plistref *pref" \ +"const u_long cmd" "prop_dictionary_t *dictp" "size_t lim" .Ft int .Fn prop_dictionary_copyout "struct plistref *pref" \ "prop_dictionary_t dict" +.Ft int +.Fn prop_dictionary_copyout_ioctl "struct plistref *pref" \ +"const u_long cmd" "prop_dictionary_t dict" .Sh DESCRIPTION The -.Nm prop_array_ioctl , .Nm prop_array_copyin_ioctl , .Nm prop_array_copyin_ioctl_size , .Nm prop_array_copyout_ioctl , @@ -109,19 +112,19 @@ This structure encapsulates the referenc form. .Pp The functions -.Nm prop_array_copyin_ioctl_size , -.Nm prop_dictionary_copyin_ioctl_size , .Nm prop_array_copyin_size , +.Nm prop_array_copyin_ioctl_size , +.Nm prop_dictionary_copyin_size , and -.Nm prop_dictionary_copyin_size +.Nm prop_dictionary_copyin_ioctl_size take an explicit limit argument .Ar lim while -.Nm prop_array_copyin_ioctl , -.Nm prop_dictionary_copyin_ioctl , .Nm prop_array_copyin , +.Nm prop_array_copyin_ioctl , +.Nm prop_dictionary_copyin , and -.Nm prop_dictionary_copyin +.Nm prop_dictionary_copyin_ioctl have an implicit size limit of 128KB. Attempts to transfer objects larger than the limit result in an .Er E2BIG
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Sat Feb 4 23:32:44 UTC 2017 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Use just the right amount of commas. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.12 src/common/lib/libprop/prop_copyin_ioctl.9:1.13 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.12 Sun Jan 29 01:38:02 2017 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Sat Feb 4 23:32:43 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_copyin_ioctl.9,v 1.12 2017/01/29 01:38:02 pgoyette Exp $ +.\" $NetBSD: prop_copyin_ioctl.9,v 1.13 2017/02/04 23:32:43 wiz Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -113,7 +113,7 @@ The functions .Nm prop_dictionary_copyin_ioctl_size , .Nm prop_array_copyin_size , and -.Nm prop_dictionary_copyin_size , +.Nm prop_dictionary_copyin_size take an explicit limit argument .Ar lim while @@ -121,7 +121,7 @@ while .Nm prop_dictionary_copyin_ioctl , .Nm prop_array_copyin , and -.Nm prop_dictionary_copyin , +.Nm prop_dictionary_copyin have an implicit size limit of 128KB. Attempts to transfer objects larger than the limit result in an .Er E2BIG
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sun Jan 29 02:29:06 UTC 2017 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: call the proper size functions To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.22 src/common/lib/libprop/prop_kern.c:1.23 --- src/common/lib/libprop/prop_kern.c:1.22 Sat Jan 28 21:07:57 2017 +++ src/common/lib/libprop/prop_kern.c Sat Jan 28 21:29:06 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.22 2017/01/29 02:07:57 christos Exp $ */ +/* $NetBSD: prop_kern.c,v 1.23 2017/01/29 02:29:06 christos Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -510,7 +510,7 @@ int prop_array_copyin_ioctl(const struct plistref *pref, const u_long cmd, prop_array_t *arrayp) { - return prop_array_copyin_ioctl(pref, cmd, arrayp, + return prop_array_copyin_ioctl_size(pref, cmd, arrayp, prop_object_copyin_limit); } @@ -530,7 +530,7 @@ int prop_dictionary_copyin_ioctl(const struct plistref *pref, const u_long cmd, prop_dictionary_t *dictp) { -return prop_dictionary_copyin_ioctl(pref, cmd, dictp, +return prop_dictionary_copyin_ioctl_size(pref, cmd, dictp, prop_object_copyin_limit); }
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sun Jan 29 02:07:57 UTC 2017 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: missing brace To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.21 src/common/lib/libprop/prop_kern.c:1.22 --- src/common/lib/libprop/prop_kern.c:1.21 Sat Jan 28 19:16:42 2017 +++ src/common/lib/libprop/prop_kern.c Sat Jan 28 21:07:57 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.21 2017/01/29 00:16:42 christos Exp $ */ +/* $NetBSD: prop_kern.c,v 1.22 2017/01/29 02:07:57 christos Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -492,7 +492,7 @@ prop_dictionary_copyin(const struct plis { return prop_dictionary_copyin_size(pref, dictp, prop_object_copyin_limit); - +} /* * prop_array_copyin_ioctl --
CVS commit: src/common/lib/libprop
Module Name:src Committed By: pgoyette Date: Sun Jan 29 01:38:02 UTC 2017 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Update for the new *_size() functions recently added. Mention the implicit size limit (128KB) for the functions which do not take an explicit limit argument. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.11 src/common/lib/libprop/prop_copyin_ioctl.9:1.12 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.11 Sun Jan 15 22:14:22 2017 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Sun Jan 29 01:38:02 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_copyin_ioctl.9,v 1.11 2017/01/15 22:14:22 wiz Exp $ +.\" $NetBSD: prop_copyin_ioctl.9,v 1.12 2017/01/29 01:38:02 pgoyette Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 17, 2011 +.Dd January 29, 2017 .Dt PROP_COPYIN_IOCTL 9 .Os .Sh NAME @@ -46,9 +46,15 @@ .Fn prop_array_copyin_ioctl "const struct plistref *pref" \ "const u_long cmd" "prop_array_t *arrayp" .Ft int +.Fn prop_array_copyin_ioctl_size "const struct plistref *pref" \ +"const u_long cmd" "prop_array_t *arrayp" "size_t lim" +.Ft int .Fn prop_array_copyin "const struct plistref *pref" \ "prop_array_t *arrayp" .Ft int +.Fn prop_array_copyin_size "const struct plistref *pref" \ +"prop_array_t *arrayp" "size_t lim" +.Ft int .Fn prop_array_copyout_ioctl "struct plistref *pref" \ "const u_long cmd" "prop_array_t array" .Ft int @@ -58,9 +64,15 @@ .Fn prop_dictionary_copyin_ioctl "const struct plistref *pref" \ "const u_long cmd" "prop_dictionary_t *dictp" .Ft int +.Fn prop_dictionary_copyin_ioctl_size "const struct plistref *pref" \ +"const u_long cmd" "prop_dictionary_t *dictp" "size_t lim" +.Ft int .Fn prop_dictionary_copyin "const struct plistref *pref" \ "prop_dictionary_t *dictp" .Ft int +.Fn prop_dictionary_copyin_size "const struct plistref *pref" \ +"prop_dictionary_t *dictp" "size_t lim" +.Ft int .Fn prop_dictionary_copyout_ioctl "struct plistref *pref" \ "const u_long cmd" "prop_dictionary_t dict" .Ft int @@ -68,9 +80,12 @@ "prop_dictionary_t dict" .Sh DESCRIPTION The +.Nm prop_array_ioctl , .Nm prop_array_copyin_ioctl , +.Nm prop_array_copyin_ioctl_size , .Nm prop_array_copyout_ioctl , .Nm prop_dictionary_copyin_ioctl , +.Nm prop_dictionary_copyin_ioctl_size , and .Nm prop_dictionary_copyout_ioctl functions implement the kernel side of a protocol for copying property lists @@ -78,8 +93,10 @@ to and from the kernel using .Xr ioctl 2 . The functions .Nm prop_array_copyin , +.Nm prop_array_copyin_size , .Nm prop_array_copyout , .Nm prop_dictionary_copyin , +.Nm prop_dictionary_copyin_size , and .Nm prop_dictionary_copyout implement the kernel side of a protocol for copying property lists to the @@ -90,6 +107,25 @@ pointer to a .Vt struct plistref . This structure encapsulates the reference to the property list in externalized form. +.Pp +The functions +.Nm prop_array_copyin_ioctl_size , +.Nm prop_dictionary_copyin_ioctl_size , +.Nm prop_array_copyin_size , +and +.Nm prop_dictionary_copyin_size , +take an explicit limit argument +.Ar lim +while +.Nm prop_array_copyin_ioctl , +.Nm prop_dictionary_copyin_ioctl , +.Nm prop_array_copyin , +and +.Nm prop_dictionary_copyin , +have an implicit size limit of 128KB. +Attempts to transfer objects larger than the limit result in an +.Er E2BIG +return value. .Sh RETURN VALUES If successful, functions return zero. Otherwise, an error number will be returned to indicate the error.
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sun Jan 29 00:16:42 UTC 2017 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: add sized versions of the copyin ioctls To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.20 src/common/lib/libprop/prop_kern.c:1.21 --- src/common/lib/libprop/prop_kern.c:1.20 Sun Jan 15 13:15:45 2017 +++ src/common/lib/libprop/prop_kern.c Sat Jan 28 19:16:42 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.20 2017/01/15 18:15:45 christos Exp $ */ +/* $NetBSD: prop_kern.c,v 1.21 2017/01/29 00:16:42 christos Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -401,13 +401,13 @@ prop_kern_init(void) static int _prop_object_copyin(const struct plistref *pref, const prop_type_t type, - prop_object_t *objp) + prop_object_t *objp, size_t lim) { prop_object_t obj = NULL; char *buf; int error; - if (pref->pref_len >= prop_object_copyin_limit) + if (pref->pref_len >= lim) return E2BIG; /* @@ -449,12 +449,12 @@ _prop_object_copyin(const struct plistre static int _prop_object_copyin_ioctl(const struct plistref *pref, const prop_type_t type, - const u_long cmd, prop_object_t *objp) + const u_long cmd, prop_object_t *objp, size_t lim) { if ((cmd & IOC_IN) == 0) return (EFAULT); - return _prop_object_copyin(pref, type, objp); + return _prop_object_copyin(pref, type, objp, lim); } /* @@ -462,10 +462,17 @@ _prop_object_copyin_ioctl(const struct p * Copy in an array passed as a syscall arg. */ int +prop_array_copyin_size(const struct plistref *pref, prop_array_t *arrayp, + size_t lim) +{ + return _prop_object_copyin(pref, PROP_TYPE_ARRAY, + (prop_object_t *)arrayp, lim); +} + +int prop_array_copyin(const struct plistref *pref, prop_array_t *arrayp) { - return (_prop_object_copyin(pref, PROP_TYPE_ARRAY, - (prop_object_t *)arrayp)); + return prop_array_copyin_size(pref, arrayp, prop_object_copyin_limit); } /* @@ -473,23 +480,38 @@ prop_array_copyin(const struct plistref * Copy in a dictionary passed as a syscall arg. */ int -prop_dictionary_copyin(const struct plistref *pref, prop_dictionary_t *dictp) +prop_dictionary_copyin_size(const struct plistref *pref, +prop_dictionary_t *dictp, size_t lim) { - return (_prop_object_copyin(pref, PROP_TYPE_DICTIONARY, - (prop_object_t *)dictp)); + return _prop_object_copyin(pref, PROP_TYPE_DICTIONARY, + (prop_object_t *)dictp, lim); } +int +prop_dictionary_copyin(const struct plistref *pref, prop_dictionary_t *dictp) +{ + return prop_dictionary_copyin_size(pref, dictp, + prop_object_copyin_limit); + /* * prop_array_copyin_ioctl -- * Copy in an array send with an ioctl. */ int +prop_array_copyin_ioctl_size(const struct plistref *pref, const u_long cmd, +prop_array_t *arrayp, size_t lim) +{ + return _prop_object_copyin_ioctl(pref, PROP_TYPE_ARRAY, + cmd, (prop_object_t *)arrayp, lim); +} + +int prop_array_copyin_ioctl(const struct plistref *pref, const u_long cmd, - prop_array_t *arrayp) +prop_array_t *arrayp) { - return (_prop_object_copyin_ioctl(pref, PROP_TYPE_ARRAY, - cmd, (prop_object_t *)arrayp)); + return prop_array_copyin_ioctl(pref, cmd, arrayp, + prop_object_copyin_limit); } /* @@ -497,11 +519,19 @@ prop_array_copyin_ioctl(const struct pli * Copy in a dictionary sent with an ioctl. */ int +prop_dictionary_copyin_ioctl_size(const struct plistref *pref, const u_long cmd, +prop_dictionary_t *dictp, size_t lim) +{ + return _prop_object_copyin_ioctl(pref, PROP_TYPE_DICTIONARY, + cmd, (prop_object_t *)dictp, lim); +} + +int prop_dictionary_copyin_ioctl(const struct plistref *pref, const u_long cmd, - prop_dictionary_t *dictp) +prop_dictionary_t *dictp) { - return (_prop_object_copyin_ioctl(pref, PROP_TYPE_DICTIONARY, - cmd, (prop_object_t *)dictp)); +return prop_dictionary_copyin_ioctl(pref, cmd, dictp, + prop_object_copyin_limit); } static int
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Sun Jan 15 22:14:22 UTC 2017 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Sort errors. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.10 src/common/lib/libprop/prop_copyin_ioctl.9:1.11 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.10 Sun Jan 15 21:42:09 2017 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Sun Jan 15 22:14:22 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_copyin_ioctl.9,v 1.10 2017/01/15 21:42:09 pgoyette Exp $ +.\" $NetBSD: prop_copyin_ioctl.9,v 1.11 2017/01/15 22:14:22 wiz Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -159,6 +159,9 @@ and .Fn prop_dictionary_copyin_ioctl will fail if: .Bl -tag -width Er +.It Bq Er E2BIG +The object being copied is larger than an arbitrarily established limit +(currently set to 128Kbytes). .It Bq Er EFAULT Bad address .It Bq Er EIO @@ -167,9 +170,6 @@ Input/output error Cannot allocate memory .It Bq Er ENOTSUP Not supported -.It Bq Er E2BIG -The object being copied is larger than an arbitrarily established limit -(currently set to 128Kbytes). .El .Pp .Fn prop_array_copyout_ioctl
CVS commit: src/common/lib/libprop
Module Name:src Committed By: pgoyette Date: Sun Jan 15 21:42:09 UTC 2017 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Document E2BIG error when copying a large object. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.9 src/common/lib/libprop/prop_copyin_ioctl.9:1.10 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.9 Thu Jan 20 10:47:33 2011 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Sun Jan 15 21:42:09 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_copyin_ioctl.9,v 1.9 2011/01/20 10:47:33 wiz Exp $ +.\" $NetBSD: prop_copyin_ioctl.9,v 1.10 2017/01/15 21:42:09 pgoyette Exp $ .\" .\" Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -167,6 +167,9 @@ Input/output error Cannot allocate memory .It Bq Er ENOTSUP Not supported +.It Bq Er E2BIG +The object being copied is larger than an arbitrarily established limit +(currently set to 128Kbytes). .El .Pp .Fn prop_array_copyout_ioctl
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sun Jan 15 18:15:45 UTC 2017 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: bump to 128K (because of npf large rules) and return E2BIG. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.19 src/common/lib/libprop/prop_kern.c:1.20 --- src/common/lib/libprop/prop_kern.c:1.19 Mon May 11 12:48:34 2015 +++ src/common/lib/libprop/prop_kern.c Sun Jan 15 13:15:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.19 2015/05/11 16:48:34 christos Exp $ */ +/* $NetBSD: prop_kern.c,v 1.20 2017/01/15 18:15:45 christos Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -384,8 +384,8 @@ prop_dictionary_sendrecv_ioctl(prop_dict #include "prop_object_impl.h" -/* Arbitrary limit ioctl input to 64KB */ -unsigned int prop_object_copyin_limit = 65536; +/* Arbitrary limit ioctl input to 128KB */ +unsigned int prop_object_copyin_limit = 128 * 1024; /* initialize proplib for use in the kernel */ void @@ -408,7 +408,7 @@ _prop_object_copyin(const struct plistre int error; if (pref->pref_len >= prop_object_copyin_limit) - return EINVAL; + return E2BIG; /* * Allocate an extra byte so we can guarantee NUL-termination.
CVS commit: src/common/lib/libprop
Module Name:src Committed By: pgoyette Date: Tue Jun 28 06:47:35 UTC 2016 Modified Files: src/common/lib/libprop: prop_number.c Log Message: Fix the previous fix - there's only one _node suffix here! To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/common/lib/libprop/prop_number.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.29 src/common/lib/libprop/prop_number.c:1.30 --- src/common/lib/libprop/prop_number.c:1.29 Tue Jun 28 05:21:15 2016 +++ src/common/lib/libprop/prop_number.c Tue Jun 28 06:47:35 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.29 2016/06/28 05:21:15 pgoyette Exp $ */ +/* $NetBSD: prop_number.c,v 1.30 2016/06/28 06:47:35 pgoyette Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -308,7 +308,7 @@ _prop_number_alloc(const struct _prop_nu * we have to check again if it is in the tree. */ _PROP_MUTEX_LOCK(_prop_number_tree_mutex); - opn = rb_tree_find_node_node(&_prop_number_tree, pnv); + opn = rb_tree_find_node(&_prop_number_tree, pnv); if (opn != NULL) { prop_object_retain(opn); _PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
CVS commit: src/common/lib/libprop
Module Name:src Committed By: pgoyette Date: Tue Jun 28 05:21:15 UTC 2016 Modified Files: src/common/lib/libprop: prop_dictionary.c prop_number.c Log Message: Missed a couple of function-call renames in previous To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/common/lib/libprop/prop_dictionary.c cvs rdiff -u -r1.28 -r1.29 src/common/lib/libprop/prop_number.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary.c diff -u src/common/lib/libprop/prop_dictionary.c:1.40 src/common/lib/libprop/prop_dictionary.c:1.41 --- src/common/lib/libprop/prop_dictionary.c:1.40 Tue Jun 28 05:18:11 2016 +++ src/common/lib/libprop/prop_dictionary.c Tue Jun 28 05:21:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary.c,v 1.40 2016/06/28 05:18:11 pgoyette Exp $ */ +/* $NetBSD: prop_dictionary.c,v 1.41 2016/06/28 05:21:15 pgoyette Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -293,7 +293,7 @@ _prop_dict_keysym_alloc(const char *key) * we just retain it and return it. */ _PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex); - opdk = rb_tree_find(&_prop_dict_keysym_tree, key); + opdk = rb_tree_find_node(&_prop_dict_keysym_tree, key); if (opdk != NULL) { prop_object_retain(opdk); _PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex); @@ -329,7 +329,7 @@ _prop_dict_keysym_alloc(const char *key) * we have to check again if it is in the tree. */ _PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex); - opdk = rb_tree_find(&_prop_dict_keysym_tree, key); + opdk = rb_tree_find_node(&_prop_dict_keysym_tree, key); if (opdk != NULL) { prop_object_retain(opdk); _PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex); Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.28 src/common/lib/libprop/prop_number.c:1.29 --- src/common/lib/libprop/prop_number.c:1.28 Tue Jun 28 05:18:11 2016 +++ src/common/lib/libprop/prop_number.c Tue Jun 28 05:21:15 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.28 2016/06/28 05:18:11 pgoyette Exp $ */ +/* $NetBSD: prop_number.c,v 1.29 2016/06/28 05:21:15 pgoyette Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -283,7 +283,7 @@ _prop_number_alloc(const struct _prop_nu * we just retain it and return it. */ _PROP_MUTEX_LOCK(_prop_number_tree_mutex); - opn = rb_tree_find(&_prop_number_tree, pnv); + opn = rb_tree_find_node(&_prop_number_tree, pnv); if (opn != NULL) { prop_object_retain(opn); _PROP_MUTEX_UNLOCK(_prop_number_tree_mutex); @@ -308,7 +308,7 @@ _prop_number_alloc(const struct _prop_nu * we have to check again if it is in the tree. */ _PROP_MUTEX_LOCK(_prop_number_tree_mutex); - opn = rb_tree_find_node(&_prop_number_tree, pnv); + opn = rb_tree_find_node_node(&_prop_number_tree, pnv); if (opn != NULL) { prop_object_retain(opn); _PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
CVS commit: src/common/lib/libprop
Module Name:src Committed By: pgoyette Date: Tue Jun 28 05:18:11 UTC 2016 Modified Files: src/common/lib/libprop: Makefile.inc prop_dictionary.c prop_number.c Removed Files: src/common/lib/libprop: prop_rb.c prop_rb_impl.h Log Message: The local copy of rb_tree code has been unused for quite some time. So we can just remove it, and adjust callers to use the "real" rbtree function names. Addresses PR lib/44090 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/common/lib/libprop/Makefile.inc cvs rdiff -u -r1.39 -r1.40 src/common/lib/libprop/prop_dictionary.c cvs rdiff -u -r1.27 -r1.28 src/common/lib/libprop/prop_number.c cvs rdiff -u -r1.10 -r0 src/common/lib/libprop/prop_rb.c cvs rdiff -u -r1.9 -r0 src/common/lib/libprop/prop_rb_impl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/Makefile.inc diff -u src/common/lib/libprop/Makefile.inc:1.9 src/common/lib/libprop/Makefile.inc:1.10 --- src/common/lib/libprop/Makefile.inc:1.9 Fri Jul 27 09:10:59 2012 +++ src/common/lib/libprop/Makefile.inc Tue Jun 28 05:18:11 2016 @@ -1,11 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.9 2012/07/27 09:10:59 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.10 2016/06/28 05:18:11 pgoyette Exp $ .PATH: ${.PARSEDIR} SRCS+= prop_array.c prop_array_util.c prop_bool.c prop_data.c \ prop_dictionary.c prop_dictionary_util.c prop_ingest.c \ prop_kern.c prop_number.c prop_object.c prop_stack.c prop_string.c - -.ifdef (PROPLIB_WANT_RB) -SRCS+= prop_rb.c -.endif Index: src/common/lib/libprop/prop_dictionary.c diff -u src/common/lib/libprop/prop_dictionary.c:1.39 src/common/lib/libprop/prop_dictionary.c:1.40 --- src/common/lib/libprop/prop_dictionary.c:1.39 Fri Oct 18 18:26:20 2013 +++ src/common/lib/libprop/prop_dictionary.c Tue Jun 28 05:18:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary.c,v 1.39 2013/10/18 18:26:20 martin Exp $ */ +/* $NetBSD: prop_dictionary.c,v 1.40 2016/06/28 05:18:11 pgoyette Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -33,7 +33,8 @@ #include #include #include -#include "prop_rb_impl.h" + +#include #if !defined(_KERNEL) && !defined(_STANDALONE) #include @@ -210,7 +211,7 @@ _prop_dict_init(void) { _PROP_MUTEX_INIT(_prop_dict_keysym_tree_mutex); - _prop_rb_tree_init(&_prop_dict_keysym_tree, + rb_tree_init(&_prop_dict_keysym_tree, &_prop_dict_keysym_rb_tree_ops); return 0; } @@ -235,7 +236,7 @@ _prop_dict_keysym_free(prop_stack_t stac { prop_dictionary_keysym_t pdk = *obj; - _prop_rb_tree_remove_node(&_prop_dict_keysym_tree, pdk); + rb_tree_remove_node(&_prop_dict_keysym_tree, pdk); _prop_dict_keysym_put(pdk); return _PROP_OBJECT_FREE_DONE; @@ -292,7 +293,7 @@ _prop_dict_keysym_alloc(const char *key) * we just retain it and return it. */ _PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex); - opdk = _prop_rb_tree_find(&_prop_dict_keysym_tree, key); + opdk = rb_tree_find(&_prop_dict_keysym_tree, key); if (opdk != NULL) { prop_object_retain(opdk); _PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex); @@ -328,14 +329,14 @@ _prop_dict_keysym_alloc(const char *key) * we have to check again if it is in the tree. */ _PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex); - opdk = _prop_rb_tree_find(&_prop_dict_keysym_tree, key); + opdk = rb_tree_find(&_prop_dict_keysym_tree, key); if (opdk != NULL) { prop_object_retain(opdk); _PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex); _prop_dict_keysym_put(pdk); return (opdk); } - rpdk = _prop_rb_tree_insert_node(&_prop_dict_keysym_tree, pdk); + rpdk = rb_tree_insert_node(&_prop_dict_keysym_tree, pdk); _PROP_ASSERT(rpdk == pdk); _PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex); return (rpdk); Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.27 src/common/lib/libprop/prop_number.c:1.28 --- src/common/lib/libprop/prop_number.c:1.27 Fri Sep 5 05:19:24 2014 +++ src/common/lib/libprop/prop_number.c Tue Jun 28 05:18:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.27 2014/09/05 05:19:24 matt Exp $ */ +/* $NetBSD: prop_number.c,v 1.28 2016/06/28 05:18:11 pgoyette Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -29,9 +29,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include "prop_object_impl.h" -#include "prop_rb_impl.h" #if defined(_KERNEL) #include @@ -157,7 +157,7 @@ _prop_number_free(prop_stack_t stack, pr { prop_number_t pn = *obj; - _prop_rb_tree_remove_node(&_prop_number_tree, pn); + rb_tree_remove_node(&_prop_number_tree, pn); _PROP_POOL_PUT(_prop_number_pool, pn); @@ -171,7 +171,7 @@ _prop_number_init(void) { _PROP_MUTEX_INIT(_prop_number_tree_mutex); - _prop_rb_tree_init(&_prop_number_tree, &_prop_number_rb_tree_ops); + rb_tree_init(&_prop_number_tree, &_prop_number_rb_tree_ops); return 0; }
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Tue May 31 09:31:13 UTC 2016 Modified Files: src/common/lib/libprop: prop_array_util.3 Log Message: Punctuation nits. (adding space makes sure they are not marked up) To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/common/lib/libprop/prop_array_util.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array_util.3 diff -u src/common/lib/libprop/prop_array_util.3:1.8 src/common/lib/libprop/prop_array_util.3:1.9 --- src/common/lib/libprop/prop_array_util.3:1.8 Tue May 31 09:29:25 2016 +++ src/common/lib/libprop/prop_array_util.3 Tue May 31 09:31:13 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: prop_array_util.3,v 1.8 2016/05/31 09:29:25 pgoyette Exp $ +.\" $NetBSD: prop_array_util.3,v 1.9 2016/05/31 09:31:13 wiz Exp $ .\" .\" Copyright (c) 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -196,8 +196,8 @@ See for more information. .Pp The -.Fn prop_array_add_cstring_nocopy, -.Fn prop_array_get_cstring_nocopy, +.Fn prop_array_add_cstring_nocopy , +.Fn prop_array_get_cstring_nocopy , and .Fn prop_array_set_cstring_nocopy functions do not copy the string that is set or returned.
CVS commit: src/common/lib/libprop
Module Name:src Committed By: phx Date: Thu Aug 20 15:55:09 UTC 2015 Modified Files: src/common/lib/libprop: prop_send_ioctl.3 Log Message: Fixed typo: propertly - property. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/common/lib/libprop/prop_send_ioctl.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_send_ioctl.3 diff -u src/common/lib/libprop/prop_send_ioctl.3:1.8 src/common/lib/libprop/prop_send_ioctl.3:1.9 --- src/common/lib/libprop/prop_send_ioctl.3:1.8 Tue Sep 27 11:12:49 2011 +++ src/common/lib/libprop/prop_send_ioctl.3 Thu Aug 20 15:55:09 2015 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_send_ioctl.3,v 1.8 2011/09/27 11:12:49 jym Exp $ +.\ $NetBSD: prop_send_ioctl.3,v 1.9 2015/08/20 15:55:09 phx Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -36,7 +36,7 @@ .Nm prop_dictionary_send_ioctl , .Nm prop_dictionary_recv_ioctl , .Nm prop_dictionary_sendrecv_ioctl -.Nd Send and receive propertly lists to and from the kernel using ioctl +.Nd Send and receive property lists to and from the kernel using ioctl .Sh SYNOPSIS .In prop/proplib.h .Ft int
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Tue May 12 14:59:35 UTC 2015 Modified Files: src/common/lib/libprop: prop_object.c Log Message: Now that _PROP_ISSPACE does not include the EOF check, put the check for EOF inside the loop. Also fix another unbounded loop that did not check for EOF. From Mateusz Kocielski XXX: pullup-7 To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/common/lib/libprop/prop_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_object.c diff -u src/common/lib/libprop/prop_object.c:1.29 src/common/lib/libprop/prop_object.c:1.30 --- src/common/lib/libprop/prop_object.c:1.29 Fri Oct 18 14:26:20 2013 +++ src/common/lib/libprop/prop_object.c Tue May 12 10:59:35 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object.c,v 1.29 2013/10/18 18:26:20 martin Exp $ */ +/* $NetBSD: prop_object.c,v 1.30 2015/05/12 14:59:35 christos Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -416,10 +416,11 @@ _prop_object_internalize_find_tag(struct ctx-poic_tagname = cp; - while (!_PROP_ISSPACE(*cp) *cp != '/' *cp != '') + while (!_PROP_ISSPACE(*cp) *cp != '/' *cp != '') { + if (_PROP_EOF(*cp)) + return (false); cp++; - if (_PROP_EOF(*cp)) - return (false); + } ctx-poic_tagname_len = cp - ctx-poic_tagname; @@ -462,10 +463,11 @@ _prop_object_internalize_find_tag(struct ctx-poic_tagattr = cp; - while (!_PROP_ISSPACE(*cp) *cp != '=') + while (!_PROP_ISSPACE(*cp) *cp != '=') { + if (_PROP_EOF(*cp)) + return (false); cp++; - if (_PROP_EOF(*cp)) - return (false); + } ctx-poic_tagattr_len = cp - ctx-poic_tagattr; @@ -477,10 +479,11 @@ _prop_object_internalize_find_tag(struct return (false); ctx-poic_tagattrval = cp; - while (*cp != '\') + while (*cp != '\') { + if (_PROP_EOF(*cp)) + return (false); cp++; - if (_PROP_EOF(*cp)) - return (false); + } ctx-poic_tagattrval_len = cp - ctx-poic_tagattrval; cp++;
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Mon May 11 16:50:35 UTC 2015 Modified Files: src/common/lib/libprop: prop_object_impl.h Log Message: Don't treat NUL (EOF) as SPACE. All the code that uses _PROP_ISSPACE() checks explicitly for _PROP_EOF() anyway, and this can be abused to cause run beyond the end of buffer DoS (Mateusz Kocielski) XXX: pullup-7 To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/common/lib/libprop/prop_object_impl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_object_impl.h diff -u src/common/lib/libprop/prop_object_impl.h:1.31 src/common/lib/libprop/prop_object_impl.h:1.32 --- src/common/lib/libprop/prop_object_impl.h:1.31 Fri Jul 27 05:10:59 2012 +++ src/common/lib/libprop/prop_object_impl.h Mon May 11 12:50:35 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object_impl.h,v 1.31 2012/07/27 09:10:59 pooka Exp $ */ +/* $NetBSD: prop_object_impl.h,v 1.32 2015/05/11 16:50:35 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -112,8 +112,7 @@ typedef enum { #define _PROP_EOF(c) ((c) == '\0') #define _PROP_ISSPACE(c) \ - ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r' || \ - _PROP_EOF(c)) + ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r') #define _PROP_TAG_MATCH(ctx, t) \ _prop_object_internalize_match((ctx)-poic_tagname, \
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Mon May 11 16:48:34 UTC 2015 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: Limit size of xml buffer for userland requests (From Mateusz Kocielski) XXX: pullup-7 To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.18 src/common/lib/libprop/prop_kern.c:1.19 --- src/common/lib/libprop/prop_kern.c:1.18 Sun Dec 14 18:48:58 2014 +++ src/common/lib/libprop/prop_kern.c Mon May 11 12:48:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.18 2014/12/14 23:48:58 chs Exp $ */ +/* $NetBSD: prop_kern.c,v 1.19 2015/05/11 16:48:34 christos Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -407,6 +407,9 @@ _prop_object_copyin(const struct plistre char *buf; int error; + if (pref-pref_len = prop_object_copyin_limit) + return EINVAL; + /* * Allocate an extra byte so we can guarantee NUL-termination. *
CVS commit: src/common/lib/libprop
Module Name:src Committed By: matt Date: Fri Sep 5 05:19:24 UTC 2014 Modified Files: src/common/lib/libprop: prop_ingest.c prop_number.c Log Message: Eliminate use of C++ keywords and don't nest struct definitions. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/common/lib/libprop/prop_ingest.c cvs rdiff -u -r1.26 -r1.27 src/common/lib/libprop/prop_number.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_ingest.c diff -u src/common/lib/libprop/prop_ingest.c:1.4 src/common/lib/libprop/prop_ingest.c:1.5 --- src/common/lib/libprop/prop_ingest.c:1.4 Fri Jul 27 09:10:59 2012 +++ src/common/lib/libprop/prop_ingest.c Fri Sep 5 05:19:24 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_ingest.c,v 1.4 2012/07/27 09:10:59 pooka Exp $ */ +/* $NetBSD: prop_ingest.c,v 1.5 2014/09/05 05:19:24 matt Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ struct _prop_ingest_context { * Allocate and initialize an ingest context. */ prop_ingest_context_t -prop_ingest_context_alloc(void *private) +prop_ingest_context_alloc(void *xprivate) { prop_ingest_context_t ctx; @@ -53,7 +53,7 @@ prop_ingest_context_alloc(void *private) ctx-pic_error = PROP_INGEST_ERROR_NO_ERROR; ctx-pic_type = PROP_TYPE_UNKNOWN; ctx-pic_key = NULL; - ctx-pic_private = private; + ctx-pic_private = xprivate; } return (ctx); } Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.26 src/common/lib/libprop/prop_number.c:1.27 --- src/common/lib/libprop/prop_number.c:1.26 Wed Mar 26 18:12:46 2014 +++ src/common/lib/libprop/prop_number.c Fri Sep 5 05:19:24 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.26 2014/03/26 18:12:46 christos Exp $ */ +/* $NetBSD: prop_number.c,v 1.27 2014/09/05 05:19:24 matt Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -43,19 +43,21 @@ #include stdlib.h #endif +struct _prop_number_value { + union { + int64_t pnu_signed; + uint64_t pnu_unsigned; + } pnv_un; +#define pnv_signed pnv_un.pnu_signed +#define pnv_unsigned pnv_un.pnu_unsigned + unsigned int pnv_is_unsigned :1, + :31; +}; + struct _prop_number { struct _prop_object pn_obj; struct rb_node pn_link; - struct _prop_number_value { - union { - int64_t pnu_signed; - uint64_t pnu_unsigned; - } pnv_un; -#define pnv_signed pnv_un.pnu_signed -#define pnv_unsigned pnv_un.pnu_unsigned - unsigned int pnv_is_unsigned :1, - :31; - } pn_value; + struct _prop_number_value pn_value; }; _PROP_POOL_INIT(_prop_number_pool, sizeof(struct _prop_number), propnmbr)
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Wed Mar 26 18:12:46 UTC 2014 Modified Files: src/common/lib/libprop: prop_number.c prop_string.c Log Message: kill sprintf To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/common/lib/libprop/prop_number.c cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_string.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.25 src/common/lib/libprop/prop_number.c:1.26 --- src/common/lib/libprop/prop_number.c:1.25 Fri Oct 18 14:26:20 2013 +++ src/common/lib/libprop/prop_number.c Wed Mar 26 14:12:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.25 2013/10/18 18:26:20 martin Exp $ */ +/* $NetBSD: prop_number.c,v 1.26 2014/03/26 18:12:46 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -199,9 +199,11 @@ _prop_number_externalize(struct _prop_ob * we output in decimal. */ if (pn-pn_value.pnv_is_unsigned) - sprintf(tmpstr, 0x% PRIx64, pn-pn_value.pnv_unsigned); + snprintf(tmpstr, sizeof(tmpstr), 0x% PRIx64, + pn-pn_value.pnv_unsigned); else - sprintf(tmpstr, % PRIi64, pn-pn_value.pnv_signed); + snprintf(tmpstr, sizeof(tmpstr), % PRIi64, + pn-pn_value.pnv_signed); if (_prop_object_externalize_start_tag(ctx, integer) == false || _prop_object_externalize_append_cstring(ctx, tmpstr) == false || Index: src/common/lib/libprop/prop_string.c diff -u src/common/lib/libprop/prop_string.c:1.11 src/common/lib/libprop/prop_string.c:1.12 --- src/common/lib/libprop/prop_string.c:1.11 Sun Aug 3 00:00:12 2008 +++ src/common/lib/libprop/prop_string.c Wed Mar 26 14:12:46 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_string.c,v 1.11 2008/08/03 04:00:12 thorpej Exp $ */ +/* $NetBSD: prop_string.c,v 1.12 2014/03/26 18:12:46 christos Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -339,7 +339,7 @@ prop_string_append(prop_string_t dst, pr cp = _PROP_MALLOC(len + 1, M_PROP_STRING); if (cp == NULL) return (false); - sprintf(cp, %s%s, prop_string_contents(dst), + snprintf(cp, len + 1, %s%s, prop_string_contents(dst), prop_string_contents(src)); ocp = dst-ps_mutable; dst-ps_mutable = cp; @@ -373,7 +373,7 @@ prop_string_append_cstring(prop_string_t cp = _PROP_MALLOC(len + 1, M_PROP_STRING); if (cp == NULL) return (false); - sprintf(cp, %s%s, prop_string_contents(dst), src); + snprintf(cp, len + 1, %s%s, prop_string_contents(dst), src); ocp = dst-ps_mutable; dst-ps_mutable = cp; dst-ps_size = len;
CVS commit: src/common/lib/libprop
Module Name:src Committed By: martin Date: Fri Oct 18 18:26:20 UTC 2013 Modified Files: src/common/lib/libprop: prop_dictionary.c prop_number.c prop_object.c Log Message: Make this compilable with gcc 4.8.1 without options DIAGNOSTIC. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/common/lib/libprop/prop_dictionary.c cvs rdiff -u -r1.24 -r1.25 src/common/lib/libprop/prop_number.c cvs rdiff -u -r1.28 -r1.29 src/common/lib/libprop/prop_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary.c diff -u src/common/lib/libprop/prop_dictionary.c:1.38 src/common/lib/libprop/prop_dictionary.c:1.39 --- src/common/lib/libprop/prop_dictionary.c:1.38 Fri Jul 27 09:10:59 2012 +++ src/common/lib/libprop/prop_dictionary.c Fri Oct 18 18:26:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary.c,v 1.38 2012/07/27 09:10:59 pooka Exp $ */ +/* $NetBSD: prop_dictionary.c,v 1.39 2013/10/18 18:26:20 martin Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -338,7 +338,7 @@ _prop_dict_keysym_alloc(const char *key) rpdk = _prop_rb_tree_insert_node(_prop_dict_keysym_tree, pdk); _PROP_ASSERT(rpdk == pdk); _PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex); - return (pdk); + return (rpdk); } static _prop_object_free_rv_t Index: src/common/lib/libprop/prop_number.c diff -u src/common/lib/libprop/prop_number.c:1.24 src/common/lib/libprop/prop_number.c:1.25 --- src/common/lib/libprop/prop_number.c:1.24 Fri Jul 27 09:10:59 2012 +++ src/common/lib/libprop/prop_number.c Fri Oct 18 18:26:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_number.c,v 1.24 2012/07/27 09:10:59 pooka Exp $ */ +/* $NetBSD: prop_number.c,v 1.25 2013/10/18 18:26:20 martin Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -314,7 +314,7 @@ _prop_number_alloc(const struct _prop_nu rpn = _prop_rb_tree_insert_node(_prop_number_tree, pn); _PROP_ASSERT(rpn == pn); _PROP_MUTEX_UNLOCK(_prop_number_tree_mutex); - return (pn); + return (rpn); } /* Index: src/common/lib/libprop/prop_object.c diff -u src/common/lib/libprop/prop_object.c:1.28 src/common/lib/libprop/prop_object.c:1.29 --- src/common/lib/libprop/prop_object.c:1.28 Fri Jul 27 09:10:59 2012 +++ src/common/lib/libprop/prop_object.c Fri Oct 18 18:26:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object.c,v 1.28 2012/07/27 09:10:59 pooka Exp $ */ +/* $NetBSD: prop_object.c,v 1.29 2013/10/18 18:26:20 martin Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -987,7 +987,7 @@ void prop_object_retain(prop_object_t obj) { struct _prop_object *po = obj; - uint32_t ncnt; + uint32_t ncnt __unused; _PROP_ATOMIC_INC32_NV(po-po_refcnt, ncnt); _PROP_ASSERT(ncnt != 0);
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Mon Oct 17 09:24:54 UTC 2011 Modified Files: src/common/lib/libprop: prop_array_util.3 prop_dictionary_util.3 Log Message: Add missing Nd. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_array_util.3 cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_dictionary_util.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array_util.3 diff -u src/common/lib/libprop/prop_array_util.3:1.6 src/common/lib/libprop/prop_array_util.3:1.7 --- src/common/lib/libprop/prop_array_util.3:1.6 Sun Mar 27 22:44:47 2011 +++ src/common/lib/libprop/prop_array_util.3 Mon Oct 17 09:24:54 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_array_util.3,v 1.6 2011/03/27 22:44:47 wiz Exp $ +.\ $NetBSD: prop_array_util.3,v 1.7 2011/10/17 09:24:54 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -63,6 +63,7 @@ .Nm prop_array_get_cstring_nocopy , .Nm prop_array_set_cstring_nocopy , .Nm prop_array_add_and_rel +.Nd array property collection object utility functions .Sh LIBRARY .Lb libprop .Sh SYNOPSIS Index: src/common/lib/libprop/prop_dictionary_util.3 diff -u src/common/lib/libprop/prop_dictionary_util.3:1.7 src/common/lib/libprop/prop_dictionary_util.3:1.8 --- src/common/lib/libprop/prop_dictionary_util.3:1.7 Sun Aug 7 11:33:03 2011 +++ src/common/lib/libprop/prop_dictionary_util.3 Mon Oct 17 09:24:54 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_dictionary_util.3,v 1.7 2011/08/07 11:33:03 jmcneill Exp $ +.\ $NetBSD: prop_dictionary_util.3,v 1.8 2011/10/17 09:24:54 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -56,6 +56,7 @@ .Nm prop_dictionary_get_cstring_nocopy , .Nm prop_dictionary_set_cstring_nocopy , .Nm prop_dictionary_set_and_rel +.Nd dictionary property collection object utility functions .Sh LIBRARY .Lb libprop .Sh SYNOPSIS
CVS commit: src/common/lib/libprop
Module Name:src Committed By: jym Date: Tue Sep 27 11:12:49 UTC 2011 Modified Files: src/common/lib/libprop: prop_send_ioctl.3 Log Message: Indicate type of return variable for prop_dictionary_sendrecv_ioctl. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_send_ioctl.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_send_ioctl.3 diff -u src/common/lib/libprop/prop_send_ioctl.3:1.7 src/common/lib/libprop/prop_send_ioctl.3:1.8 --- src/common/lib/libprop/prop_send_ioctl.3:1.7 Thu Jan 20 10:45:10 2011 +++ src/common/lib/libprop/prop_send_ioctl.3 Tue Sep 27 11:12:49 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_send_ioctl.3,v 1.7 2011/01/20 10:45:10 wiz Exp $ +.\ $NetBSD: prop_send_ioctl.3,v 1.8 2011/09/27 11:12:49 jym Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -49,6 +49,7 @@ .Ft int .Fn prop_dictionary_recv_ioctl int fd unsigned long cmd \ prop_dictionary_t *dictp +.Ft int .Fn prop_dictionary_sendrecv_ioctl prop_dictionary_t dict int fd \ unsigned long cmd prop_dictionary_t *dictp .Sh DESCRIPTION
CVS commit: src/common/lib/libprop
Module Name:src Committed By: jmcneill Date: Sun Aug 7 11:33:03 UTC 2011 Modified Files: src/common/lib/libprop: prop_dictionary_util.3 Log Message: prop_dictionary_get_dict: last argument is prop_dictionary_t *, not bool * To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_dictionary_util.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary_util.3 diff -u src/common/lib/libprop/prop_dictionary_util.3:1.6 src/common/lib/libprop/prop_dictionary_util.3:1.7 --- src/common/lib/libprop/prop_dictionary_util.3:1.6 Sun Mar 27 22:45:30 2011 +++ src/common/lib/libprop/prop_dictionary_util.3 Sun Aug 7 11:33:03 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_dictionary_util.3,v 1.6 2011/03/27 22:45:30 wiz Exp $ +.\ $NetBSD: prop_dictionary_util.3,v 1.7 2011/08/07 11:33:03 jmcneill Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -27,7 +27,7 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd March 12, 2011 +.Dd August 7, 2011 .Dt PROP_DICTIONARY_UTIL 3 .Os .Sh NAME @@ -63,7 +63,7 @@ .\ .Ft bool .Fn prop_dictionary_get_dict prop_dictionary_t dict const char *key \ -bool *dictp +prop_dictionary_t *dictp .Ft bool .Fn prop_dictionary_get_bool prop_dictionary_t dict const char *key \ bool *valp
CVS commit: src/common/lib/libprop
Module Name:src Committed By: martin Date: Wed Apr 20 20:00:07 UTC 2011 Modified Files: src/common/lib/libprop: prop_object.c Log Message: Update also the non-void pointers to the current test objects. Finaly fixes PR lib/43964. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/common/lib/libprop/prop_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_object.c diff -u src/common/lib/libprop/prop_object.c:1.26 src/common/lib/libprop/prop_object.c:1.27 --- src/common/lib/libprop/prop_object.c:1.26 Mon Mar 30 07:42:51 2009 +++ src/common/lib/libprop/prop_object.c Wed Apr 20 20:00:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object.c,v 1.26 2009/03/30 07:42:51 haad Exp $ */ +/* $NetBSD: prop_object.c,v 1.27 2011/04/20 20:00:07 martin Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -1158,6 +1158,8 @@ if (!_prop_stack_pop(stack, obj1, obj2, stored_pointer1, stored_pointer2)) return true; + po1 = obj1; + po2 = obj2; goto continue_subtree; } _PROP_ASSERT(ret == _PROP_OBJECT_EQUALS_RECURSE);
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Sun Mar 27 22:44:47 UTC 2011 Modified Files: src/common/lib/libprop: prop_array_util.3 Log Message: Fix a typo and a punctuation nit. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_array_util.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array_util.3 diff -u src/common/lib/libprop/prop_array_util.3:1.5 src/common/lib/libprop/prop_array_util.3:1.6 --- src/common/lib/libprop/prop_array_util.3:1.5 Thu Mar 24 17:05:39 2011 +++ src/common/lib/libprop/prop_array_util.3 Sun Mar 27 22:44:47 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_array_util.3,v 1.5 2011/03/24 17:05:39 bouyer Exp $ +.\ $NetBSD: prop_array_util.3,v 1.6 2011/03/27 22:44:47 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -61,7 +61,7 @@ .Nm prop_array_get_cstring , .Nm prop_array_set_cstring , .Nm prop_array_get_cstring_nocopy , -.Nm prop_array_set_cstring_nocopy, +.Nm prop_array_set_cstring_nocopy , .Nm prop_array_add_and_rel .Sh LIBRARY .Lb libprop @@ -197,7 +197,7 @@ .Pp The .Fn prop_array_add_and_rel -function adds the object to the end of the array and release it. +function adds the object to the end of the array and releases it. The object is also released on failure. .Sh RETURN VALUES The
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Sun Mar 27 22:45:31 UTC 2011 Modified Files: src/common/lib/libprop: prop_dictionary_util.3 Log Message: Fix a typo and a punctuation nit. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_dictionary_util.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary_util.3 diff -u src/common/lib/libprop/prop_dictionary_util.3:1.5 src/common/lib/libprop/prop_dictionary_util.3:1.6 --- src/common/lib/libprop/prop_dictionary_util.3:1.5 Thu Mar 24 17:05:39 2011 +++ src/common/lib/libprop/prop_dictionary_util.3 Sun Mar 27 22:45:30 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_dictionary_util.3,v 1.5 2011/03/24 17:05:39 bouyer Exp $ +.\ $NetBSD: prop_dictionary_util.3,v 1.6 2011/03/27 22:45:30 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -54,7 +54,7 @@ .Nm prop_dictionary_get_cstring , .Nm prop_dictionary_set_cstring , .Nm prop_dictionary_get_cstring_nocopy , -.Nm prop_dictionary_set_cstring_nocopy, +.Nm prop_dictionary_set_cstring_nocopy , .Nm prop_dictionary_set_and_rel .Sh LIBRARY .Lb libprop @@ -169,7 +169,7 @@ .Pp The .Fn prop_dictionary_set_and_rel -function adds the object to the dictionary and release it. +function adds the object to the dictionary and releases it. The object is also released on failure. .Sh RETURN VALUES The
CVS commit: src/common/lib/libprop
Module Name:src Committed By: njoly Date: Mon Feb 21 13:42:57 UTC 2011 Modified Files: src/common/lib/libprop: prop_array.3 prop_dictionary.3 Log Message: Fix section for umask xrefs. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_array.3 cvs rdiff -u -r1.16 -r1.17 src/common/lib/libprop/prop_dictionary.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array.3 diff -u src/common/lib/libprop/prop_array.3:1.11 src/common/lib/libprop/prop_array.3:1.12 --- src/common/lib/libprop/prop_array.3:1.11 Mon Dec 14 06:03:23 2009 +++ src/common/lib/libprop/prop_array.3 Mon Feb 21 13:42:57 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_array.3,v 1.11 2009/12/14 06:03:23 dholland Exp $ +.\ $NetBSD: prop_array.3,v 1.12 2011/02/21 13:42:57 njoly Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -253,7 +253,7 @@ The file is saved with the mode .Dv 0666 as modified by the process's file creation mask -.Pq see Xr umask 3 +.Pq see Xr umask 2 and is written atomically. Returns .Dv false Index: src/common/lib/libprop/prop_dictionary.3 diff -u src/common/lib/libprop/prop_dictionary.3:1.16 src/common/lib/libprop/prop_dictionary.3:1.17 --- src/common/lib/libprop/prop_dictionary.3:1.16 Wed Feb 2 16:37:27 2011 +++ src/common/lib/libprop/prop_dictionary.3 Mon Feb 21 13:42:57 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_dictionary.3,v 1.16 2011/02/02 16:37:27 plunky Exp $ +.\ $NetBSD: prop_dictionary.3,v 1.17 2011/02/21 13:42:57 njoly Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -305,7 +305,7 @@ The file is saved with the mode .Dv 0666 as modified by the process's file creation mask -.Pq see Xr umask 3 +.Pq see Xr umask 2 and is written atomically. Returns .Dv false
CVS commit: src/common/lib/libprop
Module Name:src Committed By: plunky Date: Wed Feb 2 16:37:27 UTC 2011 Modified Files: src/common/lib/libprop: prop_dictionary.3 Log Message: prop_dictionary_internalize_from_file_returns_a_dictionary_not_an_array To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/common/lib/libprop/prop_dictionary.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary.3 diff -u src/common/lib/libprop/prop_dictionary.3:1.15 src/common/lib/libprop/prop_dictionary.3:1.16 --- src/common/lib/libprop/prop_dictionary.3:1.15 Sat Dec 5 10:17:17 2009 +++ src/common/lib/libprop/prop_dictionary.3 Wed Feb 2 16:37:27 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_dictionary.3,v 1.15 2009/12/05 10:17:17 wiz Exp $ +.\ $NetBSD: prop_dictionary.3,v 1.16 2011/02/02 16:37:27 plunky Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -313,7 +313,7 @@ .It Fn prop_dictionary_internalize_from_file const char *path Reads the XML property list contained in the file specified by .Fa path , -internalizes it, and returns the corresponding array. +internalizes it, and returns the corresponding dictionary. Returns .Dv NULL on failure.
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Thu Jan 20 10:42:19 UTC 2011 Modified Files: src/common/lib/libprop: prop_array_util.3 prop_send_syscall.3 Log Message: Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/common/lib/libprop/prop_array_util.3 cvs rdiff -u -r1.1 -r1.2 src/common/lib/libprop/prop_send_syscall.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array_util.3 diff -u src/common/lib/libprop/prop_array_util.3:1.3 src/common/lib/libprop/prop_array_util.3:1.4 --- src/common/lib/libprop/prop_array_util.3:1.3 Thu Sep 11 13:15:13 2008 +++ src/common/lib/libprop/prop_array_util.3 Thu Jan 20 10:42:19 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_array_util.3,v 1.3 2008/09/11 13:15:13 haad Exp $ +.\ $NetBSD: prop_array_util.3,v 1.4 2011/01/20 10:42:19 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -127,12 +127,12 @@ uint64_t val .\ .Ft bool -.Fn prop_array_set_int32 prop_array_t dict unsigned int indx \ +.Fn prop_array_set_int32 prop_array_t dict unsigned int indx \ int32_t val .Ft bool -.Fn prop_array_set_uint32 prop_array_t dict unsigned int indx \ +.Fn prop_array_set_uint32 prop_array_t dict unsigned int indx \ uint32_t val -.\ +.\ .Ft bool .Fn prop_array_add_int8 prop_array_t dict int8_t val .Ft bool Index: src/common/lib/libprop/prop_send_syscall.3 diff -u src/common/lib/libprop/prop_send_syscall.3:1.1 src/common/lib/libprop/prop_send_syscall.3:1.2 --- src/common/lib/libprop/prop_send_syscall.3:1.1 Wed Jan 19 20:34:23 2011 +++ src/common/lib/libprop/prop_send_syscall.3 Thu Jan 20 10:42:19 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_send_syscall.3,v 1.1 2011/01/19 20:34:23 bouyer Exp $ +.\ $NetBSD: prop_send_syscall.3,v 1.2 2011/01/20 10:42:19 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -56,7 +56,7 @@ .Nm prop_array_recv_syscall , .Nm prop_dictionary_send_syscall , and -.Nm prop_dictionary_recv_syscall +.Nm prop_dictionary_recv_syscall functions implement the user space side of a protocol for sending property lists to and from the kernel using .Xr syscall 2 .
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Thu Jan 20 10:44:42 UTC 2011 Modified Files: src/common/lib/libprop: prop_number.3 prop_object.3 prop_send_ioctl.3 Log Message: New sentence, new line. Use Dq. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/common/lib/libprop/prop_number.3 cvs rdiff -u -r1.7 -r1.8 src/common/lib/libprop/prop_object.3 cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_send_ioctl.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_number.3 diff -u src/common/lib/libprop/prop_number.3:1.9 src/common/lib/libprop/prop_number.3:1.10 --- src/common/lib/libprop/prop_number.3:1.9 Wed Apr 30 13:10:46 2008 +++ src/common/lib/libprop/prop_number.3 Thu Jan 20 10:44:42 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_number.3,v 1.9 2008/04/30 13:10:46 martin Exp $ +.\ $NetBSD: prop_number.3,v 1.10 2011/01/20 10:44:42 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -150,14 +150,20 @@ if the numeric value object has an unsigned value. .It Fn prop_number_integer_value prop_number_t number Returns the signed integer value of the numeric value object. -If the supplied object isn't a numeric value, zero is returned. Thus, -it is not possible to distinguish between ``not a prop_number_t'' -and ``prop_number_t has a value of 0''. +If the supplied object isn't a numeric value, zero is returned. +Thus, +it is not possible to distinguish between +.Dq not a prop_number_t +and +.Dq prop_number_t has a value of 0 . .It Fn prop_number_unsigned_integer_value prop_number_t number Returns the unsigned integer value of the numeric value object. -If the supplied object isn't a numeric value, zero is returned. Thus, -it is not possible to distinguish between ``not a prop_number_t'' -and ``prop_number_t has a value of 0''. +If the supplied object isn't a numeric value, zero is returned. +Thus, +it is not possible to distinguish between +.Dq not a prop_number_t +and +.Dq prop_number_t has a value of 0 . .It Fn prop_number_equals prop_number_t num1 prop_number_t num2 Returns .Dv true Index: src/common/lib/libprop/prop_object.3 diff -u src/common/lib/libprop/prop_object.3:1.7 src/common/lib/libprop/prop_object.3:1.8 --- src/common/lib/libprop/prop_object.3:1.7 Wed Apr 30 13:10:46 2008 +++ src/common/lib/libprop/prop_object.3 Thu Jan 20 10:44:42 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_object.3,v 1.7 2008/04/30 13:10:46 martin Exp $ +.\ $NetBSD: prop_object.3,v 1.8 2011/01/20 10:44:42 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -72,7 +72,8 @@ Decrement the reference count on an object. If the last reference is dropped, the object is freed. .It Fn prop_object_type prop_object_t obj -Determine the type of the object. Objects are one of the following types: +Determine the type of the object. +Objects are one of the following types: .Pp .Bl -tag -width PROP_TYPE_DICT_KEYSYM -compact .It Dv PROP_TYPE_BOOL Index: src/common/lib/libprop/prop_send_ioctl.3 diff -u src/common/lib/libprop/prop_send_ioctl.3:1.5 src/common/lib/libprop/prop_send_ioctl.3:1.6 --- src/common/lib/libprop/prop_send_ioctl.3:1.5 Wed Apr 30 13:10:46 2008 +++ src/common/lib/libprop/prop_send_ioctl.3 Thu Jan 20 10:44:42 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_send_ioctl.3,v 1.5 2008/04/30 13:10:46 martin Exp $ +.\ $NetBSD: prop_send_ioctl.3,v 1.6 2011/01/20 10:44:42 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -63,7 +63,8 @@ lists to and from the kernel using .Xr ioctl 2 . .Sh RETURN VALUES -If successful, functions return zero. Otherwise, an error number is returned to indicate the error. +If successful, functions return zero. +Otherwise, an error number is returned to indicate the error. .Sh ERRORS .Fn prop_array_send_ioctl and
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Thu Jan 20 10:45:11 UTC 2011 Modified Files: src/common/lib/libprop: prop_send_ioctl.3 Log Message: Sort sections. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_send_ioctl.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_send_ioctl.3 diff -u src/common/lib/libprop/prop_send_ioctl.3:1.6 src/common/lib/libprop/prop_send_ioctl.3:1.7 --- src/common/lib/libprop/prop_send_ioctl.3:1.6 Thu Jan 20 10:44:42 2011 +++ src/common/lib/libprop/prop_send_ioctl.3 Thu Jan 20 10:45:10 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_send_ioctl.3,v 1.6 2011/01/20 10:44:42 wiz Exp $ +.\ $NetBSD: prop_send_ioctl.3,v 1.7 2011/01/20 10:45:10 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -65,32 +65,6 @@ .Sh RETURN VALUES If successful, functions return zero. Otherwise, an error number is returned to indicate the error. -.Sh ERRORS -.Fn prop_array_send_ioctl -and -.Fn prop_dictionary_send_ioctl -will fail if: -.Bl -tag -width Er -.It Bq Er ENOMEM -Cannot allocate memory -.It Bq Er ENOTSUP -Not supported -.El -.Pp -.Fn prop_array_recv_ioctl -and -.Fn prop_dictionary_recv_ioctl -will fail if: -.Bl -tag -width Er -.It Bq Er EIO -Input/output error -.It Bq Er ENOTSUP -Not supported -.El -.Pp -In addition to these, -.Xr ioctl 2 -errors may be returned. .Sh EXAMPLES The following .Pq simplified @@ -138,6 +112,32 @@ function combines the send and receive functionality, allowing for ioctls that require two-way communication .Pq for example to specify arguments for the ioctl operation . +.Sh ERRORS +.Fn prop_array_send_ioctl +and +.Fn prop_dictionary_send_ioctl +will fail if: +.Bl -tag -width Er +.It Bq Er ENOMEM +Cannot allocate memory +.It Bq Er ENOTSUP +Not supported +.El +.Pp +.Fn prop_array_recv_ioctl +and +.Fn prop_dictionary_recv_ioctl +will fail if: +.Bl -tag -width Er +.It Bq Er EIO +Input/output error +.It Bq Er ENOTSUP +Not supported +.El +.Pp +In addition to these, +.Xr ioctl 2 +errors may be returned. .Sh SEE ALSO .Xr prop_array 3 , .Xr prop_dictionary 3 ,
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Thu Jan 20 10:47:34 UTC 2011 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Add commas in enumerations. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.8 src/common/lib/libprop/prop_copyin_ioctl.9:1.9 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.8 Wed Jan 19 20:34:23 2011 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Thu Jan 20 10:47:33 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_copyin_ioctl.9,v 1.8 2011/01/19 20:34:23 bouyer Exp $ +.\ $NetBSD: prop_copyin_ioctl.9,v 1.9 2011/01/20 10:47:33 wiz Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -37,7 +37,7 @@ .Nm prop_array_copyout , .Nm prop_dictionary_copyin_ioctl , .Nm prop_dictionary_copyout_ioctl , -.Nm prop_dictionary_copyin +.Nm prop_dictionary_copyin , .Nm prop_dictionary_copyout .Nd Copy property lists to and from kernel space .Sh SYNOPSIS @@ -79,7 +79,7 @@ The functions .Nm prop_array_copyin , .Nm prop_array_copyout , -.Nm prop_dictionary_copyin +.Nm prop_dictionary_copyin , and .Nm prop_dictionary_copyout implement the kernel side of a protocol for copying property lists to the
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Thu Jan 20 10:48:37 UTC 2011 Modified Files: src/common/lib/libprop: prop_send_syscall.3 Log Message: Typos, wording. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/common/lib/libprop/prop_send_syscall.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_send_syscall.3 diff -u src/common/lib/libprop/prop_send_syscall.3:1.2 src/common/lib/libprop/prop_send_syscall.3:1.3 --- src/common/lib/libprop/prop_send_syscall.3:1.2 Thu Jan 20 10:42:19 2011 +++ src/common/lib/libprop/prop_send_syscall.3 Thu Jan 20 10:48:37 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_send_syscall.3,v 1.2 2011/01/20 10:42:19 wiz Exp $ +.\ $NetBSD: prop_send_syscall.3,v 1.3 2011/01/20 10:48:37 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -34,9 +34,8 @@ .Nm prop_array_send_syscall , .Nm prop_array_recv_syscall , .Nm prop_dictionary_send_syscall , -.Nm prop_dictionary_recv_syscall , -.Nd Helper to send and receive propertly lists to and from the kernel using -syscall +.Nm prop_dictionary_recv_syscall +.Nd send and receive property lists to and from the kernel using syscalls .Sh SYNOPSIS .In prop/proplib.h .Ft bool @@ -61,7 +60,7 @@ lists to and from the kernel using .Xr syscall 2 . .Sh RETURN VALUES -If successful, functions return true, false otherwise. +If successful, the functions return true, false otherwise. .Sh EXAMPLES The following .Pq simplified
CVS commit: src/common/lib/libprop
Module Name:src Committed By: dholland Date: Mon Dec 14 05:47:30 UTC 2009 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Minor wording fix/clarification (sending - copying) from Silas Silva in PR 42415. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.6 src/common/lib/libprop/prop_copyin_ioctl.9:1.7 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.6 Sun Oct 11 01:55:28 2009 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Mon Dec 14 05:47:30 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_copyin_ioctl.9,v 1.6 2009/10/11 01:55:28 wiz Exp $ +.\ $NetBSD: prop_copyin_ioctl.9,v 1.7 2009/12/14 05:47:30 dholland Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -65,14 +65,14 @@ .Nm prop_dictionary_copyin_ioctl , and .Nm prop_dictionary_copyout_ioctl -functions implement the kernel side of a protocol for sending property lists +functions implement the kernel side of a protocol for copying property lists to and from the kernel using .Xr ioctl 2 . The functions .Nm prop_array_copyin and .Nm prop_dictionary_copyin -implement the kernel side of a protocol for sending property lists to the +implement the kernel side of a protocol for copying property lists to the kernel as arguments of normal system calls. .Pp A kernel routine receiving or returning a property list will be passed a
CVS commit: src/common/lib/libprop
Module Name:src Committed By: dholland Date: Mon Dec 14 06:03:23 UTC 2009 Modified Files: src/common/lib/libprop: prop_array.3 prop_data.3 Log Message: Fix some ordering inconsistencies, noted by Silas Silva in PR 42415. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/common/lib/libprop/prop_array.3 cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_data.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_array.3 diff -u src/common/lib/libprop/prop_array.3:1.10 src/common/lib/libprop/prop_array.3:1.11 --- src/common/lib/libprop/prop_array.3:1.10 Sat Oct 10 18:06:54 2009 +++ src/common/lib/libprop/prop_array.3 Mon Dec 14 06:03:23 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_array.3,v 1.10 2009/10/10 18:06:54 bad Exp $ +.\ $NetBSD: prop_array.3,v 1.11 2009/12/14 06:03:23 dholland Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -225,14 +225,6 @@ .Fa index . The object will be released and the array compacted following the removal. -.It Fn prop_array_equals prop_array_t array1 prop_array_t array2 -Returns -.Dv true -if the two arrays are equivalent. -If at least one of the supplied objects isn't an array, -.Dv false -is returned. -Note: Objects contained in the array are compared by value, not by reference. .It Fn prop_array_externalize prop_array_t array Externalizes an array, returning a NUL-terminated buffer containing the XML representation of the array. @@ -280,6 +272,14 @@ Returns .Dv false if externalizing the array fails for any reason. +.It Fn prop_array_equals prop_array_t array1 prop_array_t array2 +Returns +.Dv true +if the two arrays are equivalent. +If at least one of the supplied objects isn't an array, +.Dv false +is returned. +Note: Objects contained in the array are compared by value, not by reference. .El .Sh SEE ALSO .Xr prop_bool 3 , Index: src/common/lib/libprop/prop_data.3 diff -u src/common/lib/libprop/prop_data.3:1.6 src/common/lib/libprop/prop_data.3:1.7 --- src/common/lib/libprop/prop_data.3:1.6 Wed Apr 30 13:10:46 2008 +++ src/common/lib/libprop/prop_data.3 Mon Dec 14 06:03:23 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_data.3,v 1.6 2008/04/30 13:10:46 martin Exp $ +.\ $NetBSD: prop_data.3,v 1.7 2009/12/14 06:03:23 dholland Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -54,10 +54,10 @@ .Ft prop_data_t .Fn prop_data_copy prop_data_t data .\ -.Ft void * -.Fn prop_data_data prop_data_t data .Ft size_t .Fn prop_data_size prop_data_t data +.Ft void * +.Fn prop_data_data prop_data_t data .Ft const void * .Fn prop_data_data_nocopy prop_data_t data .\
CVS commit: src/common/lib/libprop
Module Name:src Committed By: dholland Date: Mon Dec 14 06:06:22 UTC 2009 Modified Files: src/common/lib/libprop: prop_string.3 Log Message: Add two missing functions to the SYNOPSIS. From Silas Silva in PR 42415. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/lib/libprop/prop_string.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_string.3 diff -u src/common/lib/libprop/prop_string.3:1.6 src/common/lib/libprop/prop_string.3:1.7 --- src/common/lib/libprop/prop_string.3:1.6 Wed Apr 30 13:10:46 2008 +++ src/common/lib/libprop/prop_string.3 Mon Dec 14 06:06:22 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_string.3,v 1.6 2008/04/30 13:10:46 martin Exp $ +.\ $NetBSD: prop_string.3,v 1.7 2009/12/14 06:06:22 dholland Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -63,6 +63,11 @@ .Ft prop_string_t .Fn prop_string_copy_mutable prop_string_t string .\ +.Ft size_t +.Fn prop_string_size prop_string_t string +.Ft bool +.Fn prop_string_mutable prop_string_t string +.\ .Ft char * .Fn prop_string_cstring prop_string_t string .Ft const char *
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Sat Dec 5 10:17:17 UTC 2009 Modified Files: src/common/lib/libprop: prop_dictionary.3 Log Message: Fix prop_dictionary_ensure_capacity signature, bump date. From Silas Silva in PR 42413. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/common/lib/libprop/prop_dictionary.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary.3 diff -u src/common/lib/libprop/prop_dictionary.3:1.14 src/common/lib/libprop/prop_dictionary.3:1.15 --- src/common/lib/libprop/prop_dictionary.3:1.14 Sat Oct 10 18:06:54 2009 +++ src/common/lib/libprop/prop_dictionary.3 Sat Dec 5 10:17:17 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_dictionary.3,v 1.14 2009/10/10 18:06:54 bad Exp $ +.\ $NetBSD: prop_dictionary.3,v 1.15 2009/12/05 10:17:17 wiz Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -27,7 +27,7 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd October 10, 2009 +.Dd December 5, 2009 .Dt PROP_DICTIONARY 3 .Os .Sh NAME @@ -165,7 +165,8 @@ except the resulting dictionary is always mutable. .It Fn prop_dictionary_count prop_dictionary_t dict Returns the number of objects stored in the dictionary. -.It Fn prop_dictionary_ensure_capacity prop_dictionary_t dict +.It Fn prop_dictionary_ensure_capacity prop_dictionary_t dict \ +unsigned int capacity Ensure that the dictionary has a total capacity of .Fa capacity , including objects already stored in the dictionary.
CVS commit: src/common/lib/libprop
Module Name:src Committed By: bad Date: Sun Oct 11 12:13:45 UTC 2009 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: Back out previous. Builds for me and on autobuild cluster. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.12 src/common/lib/libprop/prop_kern.c:1.13 --- src/common/lib/libprop/prop_kern.c:1.12 Sat Oct 10 21:27:46 2009 +++ src/common/lib/libprop/prop_kern.c Sun Oct 11 12:13:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.12 2009/10/10 21:27:46 christos Exp $ */ +/* $NetBSD: prop_kern.c,v 1.13 2009/10/11 12:13:45 bad Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -332,7 +332,6 @@ return _prop_object_copyin(pref, type, objp); } -#ifdef notyet /* * prop_array_copyin -- * Copy in an array passed as a syscall arg. @@ -354,7 +353,6 @@ return (_prop_object_copyin(pref, PROP_TYPE_DICTIONARY, (prop_object_t *)dictp)); } -#endif /*
CVS commit: src/common/lib/libprop
Module Name:src Committed By: christos Date: Sat Oct 10 21:27:46 UTC 2009 Modified Files: src/common/lib/libprop: prop_kern.c Log Message: make this compile again. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/common/lib/libprop/prop_kern.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.11 src/common/lib/libprop/prop_kern.c:1.12 --- src/common/lib/libprop/prop_kern.c:1.11 Sat Oct 10 14:06:54 2009 +++ src/common/lib/libprop/prop_kern.c Sat Oct 10 17:27:46 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.11 2009/10/10 18:06:54 bad Exp $ */ +/* $NetBSD: prop_kern.c,v 1.12 2009/10/10 21:27:46 christos Exp $ */ /*- * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. @@ -332,6 +332,7 @@ return _prop_object_copyin(pref, type, objp); } +#ifdef notyet /* * prop_array_copyin -- * Copy in an array passed as a syscall arg. @@ -353,6 +354,7 @@ return (_prop_object_copyin(pref, PROP_TYPE_DICTIONARY, (prop_object_t *)dictp)); } +#endif /*
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Sun Oct 11 01:55:28 UTC 2009 Modified Files: src/common/lib/libprop: prop_copyin_ioctl.9 Log Message: Sort sections. New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_copyin_ioctl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_copyin_ioctl.9 diff -u src/common/lib/libprop/prop_copyin_ioctl.9:1.5 src/common/lib/libprop/prop_copyin_ioctl.9:1.6 --- src/common/lib/libprop/prop_copyin_ioctl.9:1.5 Sat Oct 10 18:06:54 2009 +++ src/common/lib/libprop/prop_copyin_ioctl.9 Sun Oct 11 01:55:28 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: prop_copyin_ioctl.9,v 1.5 2009/10/10 18:06:54 bad Exp $ +.\ $NetBSD: prop_copyin_ioctl.9,v 1.6 2009/10/11 01:55:28 wiz Exp $ .\ .\ Copyright (c) 2006, 2009 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -81,35 +81,8 @@ This structure encapsulates the reference to the property list in externalized form. .Sh RETURN VALUES -If successful, functions return zero. Otherwise, an error number will be returned to indicate the error. -.Sh ERRORS -.Fn prop_array_copyin_ioctl -and -.Fn prop_dictionary_copyin_ioctl -will fail if: -.Bl -tag -width Er -.It Bq Er EFAULT -Bad address -.It Bq Er EIO -Input/output error -.It Bq Er ENOMEM -Cannot allocate memory -.It Bq Er ENOTSUP -Not supported -.El -.Pp -.Fn prop_array_copyout_ioctl -and -.Fn prop_dictionary_copyout_ioctl -will fail if: -.Bl -tag -width Er -.It Bq Er EFAULT -Bad address -.It Bq Er ENOMEM -Cannot allocate memory -.It Bq Er ENOTSUP -Not supported -.El +If successful, functions return zero. +Otherwise, an error number will be returned to indicate the error. .Sh EXAMPLES The following .Pq simplified @@ -170,6 +143,34 @@ ... } .Ed +.Sh ERRORS +.Fn prop_array_copyin_ioctl +and +.Fn prop_dictionary_copyin_ioctl +will fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +Bad address +.It Bq Er EIO +Input/output error +.It Bq Er ENOMEM +Cannot allocate memory +.It Bq Er ENOTSUP +Not supported +.El +.Pp +.Fn prop_array_copyout_ioctl +and +.Fn prop_dictionary_copyout_ioctl +will fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +Bad address +.It Bq Er ENOMEM +Cannot allocate memory +.It Bq Er ENOTSUP +Not supported +.El .Sh SEE ALSO .Xr prop_array 3 , .Xr prop_dictionary 3 ,
CVS commit: src/common/lib/libprop
Module Name:src Committed By: wiz Date: Wed May 13 22:31:59 UTC 2009 Modified Files: src/common/lib/libprop: proplib.3 Log Message: New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/proplib.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/proplib.3 diff -u src/common/lib/libprop/proplib.3:1.5 src/common/lib/libprop/proplib.3:1.6 --- src/common/lib/libprop/proplib.3:1.5 Wed Apr 30 13:10:46 2008 +++ src/common/lib/libprop/proplib.3 Wed May 13 22:31:59 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: proplib.3,v 1.5 2008/04/30 13:10:46 martin Exp $ +.\ $NetBSD: proplib.3,v 1.6 2009/05/13 22:31:59 wiz Exp $ .\ .\ Copyright (c) 2006 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -75,7 +75,8 @@ you must release it. .It If you get a reference to an object from other code and wish to maintain -a reference to it, you must retain the object. You are responsible for +a reference to it, you must retain the object. +You are responsible for releasing the object once you drop that reference. .It You must never release an object unless you create it or retain it.
CVS commit: src/common/lib/libprop
Module Name:src Committed By: haad Date: Tue Apr 14 02:53:41 UTC 2009 Modified Files: src/common/lib/libprop: prop_dictionary.c Log Message: Check if pd is not NULL before we try to lock rw lock associated with it. This fixes proplib crash when NULL is passed to prop_dictionary_get as a dictionary. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/common/lib/libprop/prop_dictionary.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libprop/prop_dictionary.c diff -u src/common/lib/libprop/prop_dictionary.c:1.34 src/common/lib/libprop/prop_dictionary.c:1.35 --- src/common/lib/libprop/prop_dictionary.c:1.34 Sat Jan 3 18:31:33 2009 +++ src/common/lib/libprop/prop_dictionary.c Tue Apr 14 02:53:41 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_dictionary.c,v 1.34 2009/01/03 18:31:33 pooka Exp $ */ +/* $NetBSD: prop_dictionary.c,v 1.35 2009/04/14 02:53:41 haad Exp $ */ /*- * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc. @@ -936,7 +936,10 @@ prop_object_t prop_dictionary_get(prop_dictionary_t pd, const char *key) { - prop_object_t po; + prop_object_t po = NULL; + + if (! prop_object_is_dictionary(pd)) + return (NULL); _PROP_RWLOCK_RDLOCK(pd-pd_rwlock); po = _prop_dictionary_get(pd, key, true);