From 4fcc208fa41e035dcfb42cd5005d34f52b1a473b Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 4 Jul 2006 12:46:14 +0000 Subject: [PATCH] * libvirt.spec.in proxy/Makefile.am: do the chown at the rpm packaging level, to allow build as non-root * src/xml.c: fix bug #197583 raised by markmc Daniel --- ChangeLog | 6 ++++++ libvirt.spec.in | 4 ++-- proxy/Makefile.am | 1 - src/xml.c | 15 ++++++++++----- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index dea5e32c3a..1c7e223075 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 4 13:50:55 CEST 2006 Daniel Veillard + + * libvirt.spec.in proxy/Makefile.am: do the chown at the rpm packaging + level, to allow build as non-root + * src/xml.c: fix bug #197583 raised by markmc + Mon Jul 3 15:41:58 EDT 2006 Daniel Veillard * NEWS docs/* configure.in libvirt.spec.in include/libvirt/libvirt.h: diff --git a/libvirt.spec.in b/libvirt.spec.in index 3ccadc7bc8..8fcf3aba0c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -14,7 +14,7 @@ Requires: readline BuildRequires: libxml2-devel BuildRequires: readline-devel Obsoletes: libvir -ExclusiveArch: i386 x86_64 ia64 +ExclusiveArch: i386 x86_64 %description This C library provides an API to use the Xen virtualization framework, @@ -75,7 +75,7 @@ rm -fr %{buildroot} %doc %{_mandir}/man1/virsh.1* %{_bindir}/virsh %{_libdir}/lib*.so.* -%{_libexecdir}/libvirt_proxy +%attr(4755, root, root) %{_libexecdir}/libvirt_proxy %files devel %defattr(-, root, root) diff --git a/proxy/Makefile.am b/proxy/Makefile.am index 87cdb2fb19..c1a841d971 100644 --- a/proxy/Makefile.am +++ b/proxy/Makefile.am @@ -16,5 +16,4 @@ libvirt_proxy_DEPENDENCIES = libvirt_proxy_LDADD = install-exec-hook: - chown root:root $(DESTDIR)$(libexecdir)/libvirt_proxy chmod u+s $(DESTDIR)$(libexecdir)/libvirt_proxy diff --git a/src/xml.c b/src/xml.c index 01619b8504..e269a240cc 100644 --- a/src/xml.c +++ b/src/xml.c @@ -591,27 +591,32 @@ virDomainParseXMLOSDesc(xmlNodePtr node, virBufferPtr buf, int bootloader) if ((type == NULL) && (xmlStrEqual(cur->name, BAD_CAST "type"))) { txt = cur->children; - if ((txt->type == XML_TEXT_NODE) && (txt->next == NULL)) + if ((txt != NULL) && (txt->type == XML_TEXT_NODE) && + (txt->next == NULL)) type = txt->content; } else if ((kernel == NULL) && (xmlStrEqual(cur->name, BAD_CAST "kernel"))) { txt = cur->children; - if ((txt->type == XML_TEXT_NODE) && (txt->next == NULL)) + if ((txt != NULL) && (txt->type == XML_TEXT_NODE) && + (txt->next == NULL)) kernel = txt->content; } else if ((root == NULL) && (xmlStrEqual(cur->name, BAD_CAST "root"))) { txt = cur->children; - if ((txt->type == XML_TEXT_NODE) && (txt->next == NULL)) + if ((txt != NULL) && (txt->type == XML_TEXT_NODE) && + (txt->next == NULL)) root = txt->content; } else if ((initrd == NULL) && (xmlStrEqual(cur->name, BAD_CAST "initrd"))) { txt = cur->children; - if ((txt->type == XML_TEXT_NODE) && (txt->next == NULL)) + if ((txt != NULL) && (txt->type == XML_TEXT_NODE) && + (txt->next == NULL)) initrd = txt->content; } else if ((cmdline == NULL) && (xmlStrEqual(cur->name, BAD_CAST "cmdline"))) { txt = cur->children; - if ((txt->type == XML_TEXT_NODE) && (txt->next == NULL)) + if ((txt != NULL) && (txt->type == XML_TEXT_NODE) && + (txt->next == NULL)) cmdline = txt->content; } } -- GitLab