summaryrefslogtreecommitdiffstats
path: root/lib/libgeom/geom_xml2tree.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r287247: Plug memory leaks when running out of memory.delphij2015-09-141-1/+3
| | | | Reported by: clang scan-build
* MFC r286719: Revert part of r280687, reporting "1" (true) for empty value.mav2015-08-161-1/+1
| | | | For example, it made gpart partitions without label report "1" as label.
* MFC r281875:pfg2015-04-291-0/+1
| | | | | | | libgeom: plug memory leak in EndElement. CID: 1016696 Found by: Clang static checker
* MFC r280687: Make GEOM_PART work in presence of previous withered self.mav2015-04-091-3/+12
|
* Since there's no defined schema for the XML that's generated by thescottl2013-07-191-0/+2
| | | | | | | | | kern.geom.confxml sysctl, it's silly to warn about tags in libgeom, especially since libgeom exists simply to build a tree out of the conf information. Obtained from: Netflix MFC after: 3 days
* Revert r253247. This change should be improved based on a lesson learnthrs2013-07-121-2/+2
| | | | | | from r233646 first. Pointed out by: jmallett
* Use strtoumax() instead of strtoul() for id/ref attr in XML elements.hrs2013-07-121-2/+2
| | | | | | This improves compatibility when running an ILP32 binary on LP64 kernel. Spotted by: gjb
* Improve libgeom XML parsing error handling.jh2012-10-261-8/+33
| | | | | | | - Abort parsing and return an error if we run out of memory. - Return EILSEQ from geom_xml2tree() for XML syntax errors. Silence on: freebsd-geom
* Back out r233646. Although it fixed most libgeom consumers under 32-bitjmallett2012-04-101-80/+28
| | | | | | | | | | | | | | | | | | | compatibility, it broke programs using devstat, under 32-bit compatibility and not. It's very difficult to fix the identifiers used by devstat, so this change is simply being backed out. Since changes to 3rd-party code seem likely, and may be necessary to properly fix 32-bit binaries on 64-bit kernel, it would seem better to make more invasive changes to fix GEOM's problems with 32-bit compatibility in general. The right thing to do is to replace all of the use of pointers as opaque identifiers with a fixed-size (64-bit or even 32-bit should be enough for tracking unique GEOM elments) field. That probably maintains source compatibility with most GEOM consumers, and allows xml2tree to make better assumptions about how to decode the identifiers. Submitted by: Anton Yuzhaninov
* Fix 32-bit libgeom consumers run on 64-bit kernels with COMPAT_FREEBSD32.jmallett2012-03-291-28/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel pointer values are used as opaque unique identifiers, which are then used to reconstruct references between various providers, classes, etc., inside libgeom from the source XML. Unfortunately, they're converted to pointer-width integers (in the form of pointers) to do this, and 32-bit userland pointers cannot hold sensible representations (however opaque) of 64-bit kernel pointers on all systems. In the case where the leading bits are zero and 32 distinct bits of pointer can be identified, this will happen to work. On systems where the upper 32-bits of kernel pointers are non-zero and the same for all kernel pointers, this will result in double frees and all kinds of bizarre crashes and linkage between objects inside libgeom. To mitigate this problem, treat the opaque identifiers in the XML as C strings instead, and internalize them to give unique and consistent per-object pointer values in userland for each identifier in the XML. This allows us to keep the libgeom logic the same with only minor changes to initial setup and parsing. It might be more sensible for speed reasons to treat the identifiers as numbers of a large size (uintmax_t, say) rather than strings, but strings seem fine for now. (As an added side-effect, this makes it slightly easier to identify unresolved references, but nothing has been added to inform the user of those.)
* Handle null return from XML_ParserCreate and fix a few memory leaks onemaste2010-10-051-4/+10
| | | | | | | error conditions. Submitted by: Mark Johnston <mjohnston at sandvine dot com> MFC after: 2 weeks
* Expose stripe offset and stripe size through libgeom and geom(8) userlanddelphij2010-01-171-0/+10
| | | | | | utilities. Reviewed by: pjd, mav (earlier version)
* Add sbuf_new_auto as a shortcut for the very common case of creating ades2008-08-091-1/+1
| | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks
* - Simplify the procedure of retrieving XML-data from the kernel.lulf2008-07-081-1/+36
| | | | | | | | | | | | | - Fix a number of potential memory leaks in libgeom related to doing realloc without freeing old pointer if things go wrong. - Fix a number of places in libgeom where malloc and calloc return values were not checked. - Check malloc return value and provide sufficient warning messages when XML parsing fails. PR: kern/83464 Submitted by: Dan Lukes <dan - at - obluda.cz> Approved by: kib (mentor)
* Check for NULL pointer return.phk2005-05-241-0/+2
| | | | Spotted by: marcus
* Make libgeom usable by C++ programs:jhb2004-03-091-90/+97
| | | | | | | | | | - Add DECL wrappers to libgeom.h. - Rename structure members in libgeom.h to use a lg_ prefix for member names. This is required because a few structures had members named 'class' which made g++ very unhappy. - Catch gstat(8) and gconcat(8) up to these API changes. Reviewed by: phk
* String the consumers into the list of the provider they are attached to.phk2004-03-081-1/+5
| | | | Noticed by: jhb
* Constify arg to geom_lookupid().phk2003-03-171-2/+2
| | | | Improve a diagnostic printf.
* Leak more stuff into libgeom.phk2003-02-101-0/+428
OpenPOWER on IntegriCloud