[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] libvirt 0.8.7 LOCALSTATEDIR ubuntu patch



On 01/31/2011 04:57 PM, Philipp Schmid wrote:
> -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare -Wlogical-op -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -DIN_LIBVIRT -I../src/conf -g -O2 -g -O2 -c nwfilter/nwfilter_ebiptables_driver.c  -fPIC -DPIC -o .libs/libvirt_driver_nwfilter_la-nwfilter_ebiptables_driver.o
> nwfilter/nwfilter_ebiptables_driver.c: In function 'ebiptablesWriteToTempFile':
> nwfilter/nwfilter_ebiptables_driver.c:2444:23: error: 'LOCALSTATEDIR' undeclared (first use in this function)

Add this line to the problematic file:

#include "configmake.h"

(see nwfilter/nwfilter_driver.c for an example).

> Author: Jamie Strandboge <jamie canonical com>
> Description: move ebiptables script from /tmp to /var/lib/libvirt
> Forwarded: yes
> 
> Index: libvirt-0.8.7/src/nwfilter/nwfilter_ebiptables_driver.c
> ===================================================================
> --- libvirt-0.8.7.orig/src/nwfilter/nwfilter_ebiptables_driver.c        2011-01-30 20:57:49.132301999 +0000
> +++ libvirt-0.8.7/src/nwfilter/nwfilter_ebiptables_driver.c     2011-01-30 20:58:35.762302000 +0000
> @@ -2441,7 +2441,7 @@
>   */
>  static char *
>  ebiptablesWriteToTempFile(const char *string) {
> -    char filename[] = "/tmp/virtdXXXXXX";
> +    char filename[] = LOCAL_STATE_DIR "/lib/libvirt/virtdXXXXXX";

Better yet, we should probably have some utility function that makes it
easy to create a temporary file, while honoring $TMPDIR (if indeed it
belongs in $TMPDIR rather than /var/lib), instead of just hard-coding /tmp.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]