search for: asprintf_nowarn

Displaying 20 results from an estimated 48 matches for "asprintf_nowarn".

2010 May 13
1
[PATCH] Improve errors from tar-in/tgz-in commands (RHBZ#591155 RHBZ#591250).
...0'; + + return str; /* caller frees */ +} + static int write_cb (void *fd_ptr, const void *buf, size_t len) { @@ -43,8 +73,8 @@ do_tXz_in (const char *dir, const char *filter) char *cmd; /* "tar -C /sysroot%s -xf -" but we have to quote the dir. */ - if (asprintf_nowarn (&cmd, "tar -C %R -%sxf -", - dir, filter) == -1) { + if (asprintf_nowarn (&cmd, "tar -C %R -xf - 2> %s", + dir, filter, error_file) == -1) { err = errno; r = cancel_receive (); errno = err; @@ -73,8 +103,11...
2015 Jul 15
1
[PATCH 1/2] actions: tar_out: add xattrs and selinux optargs
.../* Check the filename exists and is a directory (RHBZ#908322). */ buf = sysroot_path (dir); if (buf == NULL) { @@ -367,12 +373,14 @@ do_tar_out (const char *dir, const char *compress, int numericowner, } /* "tar -C /sysroot%s -cf - ." but we have to quote the dir. */ - if (asprintf_nowarn (&cmd, "%s -C %Q%s%s%s%s -cf - .", + if (asprintf_nowarn (&cmd, "%s -C %Q%s%s%s%s%s%s -cf - .", str_tar, buf, filter, numericowner ? " --numeric-owner" : "",...
2015 Nov 18
2
Re: [PATCH 5/5] build: Enable some more warnings.
On Monday 09 November 2015 23:02:15 Richard W.M. Jones wrote: > After fixing some warnings (see prior commits), we can now enable > them in configure.ac. > --- > [...] > -nw="$nw -Winline" # daemon.h's asprintf_nowarn Disabling -Winline causes the Python binding code to fail with build with GCC < 4.9, because of the static inline functions in python/guestfs-py.h. See for example on CentOS 7.1 and openSUSE 13.1: https://ci.centos.org/view/libguestfs/job/libguestfs/label=libguestfs-ci-CentOS-7-slave01/108/cons...
2015 Nov 09
6
[PATCH 0/5] build: Enable some more warnings.
Add some warnings. Well, the first patch is a miscellaneous change, but patches 2-5 add some warnings. Rich.
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...++ b/daemon/base64.c @@ -27,6 +27,8 @@ #include "daemon.h" #include "actions.h" +GUESTFSD_EXT_CMD(str_base64, base64); + static int write_cb (void *fd_ptr, const void *buf, size_t len) { @@ -42,7 +44,7 @@ do_base64_in (const char *file) FILE *fp; char *cmd; - if (asprintf_nowarn (&cmd, "base64 -d -i > %R", file) == -1) { + if (asprintf_nowarn (&cmd, "%s -d -i > %R", str_base64, file) == -1) { err = errno; cancel_receive (); errno = err; @@ -102,7 +104,7 @@ do_base64_out (const char *file) char *cmd; char buf[GUESTFS_M...
2015 Nov 09
0
[PATCH 5/5] build: Enable some more warnings.
...on" # Don't care about pre-ANSI compilers nw="$nw -Wpadded" # Our structs are not padded -nw="$nw -Wvla" # two warnings in mount.c -dnl things I might fix soon: -nw="$nw -Wmissing-format-attribute" # daemon.h's asprintf_nowarn -nw="$nw -Winline" # daemon.h's asprintf_nowarn -nw="$nw -Wshadow" # numerous, plus we're not unanimous +nw="$nw -Wvla" # Allow variable length arrays. +nw="$nw -Wshadow" #...
2016 Mar 02
0
[PATCH] daemon: ntfs: fix format strings
Use PRIi64 as format string for int64_t, so it builds and works fine also on 32bit. Also switch from asprintf_nowarn to asprintf, since no custom formats (eg %Q, %R) are used. --- daemon/ntfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/ntfs.c b/daemon/ntfs.c index 92088f7..e555c63 100644 --- a/daemon/ntfs.c +++ b/daemon/ntfs.c @@ -282,8 +282,8 @@ do_ntfscat_i (const mount...
2016 Apr 04
2
Re: [PATCH v2 3/5] daemon: Added internal_filesystem_walk command
...> > + > > > + /* Ignore ./ and ../ */ > > > + ret = TSK_FS_ISDOT (fsfile->name->name); > > > + if (ret != 0) > > > + return TSK_WALK_CONT; > > > + > > > + /* Build the full relative path of the entry */ > > > + ret = asprintf_nowarn (&fname, "%Q%Q", path, fsfile->name->name); > > > > Why the quoting? We don't quote results in similar APIs (e.g. readdir). > > > I didn't understand this one. I checked daemon/readdir.c and I found no > asprintf examples there. $ ./run guestfis...
2012 Aug 30
1
[PATCH] collect list of called external commands
...+++ b/daemon/base64.c @@ -27,6 +27,8 @@ #include "daemon.h" #include "actions.h" +GUESTFS_EXT_CMD(str_base64, base64); + static int write_cb (void *fd_ptr, const void *buf, size_t len) { @@ -42,7 +44,7 @@ do_base64_in (const char *file) FILE *fp; char *cmd; - if (asprintf_nowarn (&cmd, "base64 -d -i > %R", file) == -1) { + if (asprintf_nowarn (&cmd, "%s -d -i > %R", str_base64, file) == -1) { err = errno; cancel_receive (); errno = err; @@ -102,7 +104,7 @@ do_base64_out (const char *file) char *cmd; char buf[GUESTFS_M...
2015 Sep 15
1
[PATCH] daemon: initrd: print return value from failing process
...9fc2dd 100644 --- a/daemon/initrd.c +++ b/daemon/initrd.c @@ -43,6 +43,7 @@ do_initrd_list (const char *path) CLEANUP_FREE char *filename = NULL; size_t allocsize; ssize_t len; + int ret; /* "zcat /sysroot/<path> | cpio --quiet -it", but path must be quoted. */ if (asprintf_nowarn (&cmd, "%s %R | %s --quiet -it", str_zcat, path, str_cpio) == -1) { @@ -74,8 +75,15 @@ do_initrd_list (const char *path) return NULL; } - if (pclose (fp) != 0) { - reply_with_perror ("pclose"); + ret = pclose (fp); + if (ret != 0) { + if (ret == -1) +...
2016 Feb 21
2
[PATCH] added ntfscat_i api
..._t inode) +{ + int r; + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + char buffer[GUESTFS_MAX_CHUNK_SIZE]; + + /* Inode must be greater than 0 */ + if (inode < 0) { + reply_with_error("Inode must be greater than 0"); + return -1; + } + + /* Construct the command. */ + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", + inode, mountable->device) == -1) { + reply_with_perror ("asprintf"); + return -1; + } + + if (verbose) + fprintf (stderr, "%s\n", cmd); + + fp = popen (cmd, "r"); + if (fp == NULL) { +...
2014 Aug 08
3
[PATCH] daemon: add CLEANUP_CLOSE
Just call close on the specified fd, if valid. --- daemon/daemon.h | 3 +++ daemon/guestfsd.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/daemon/daemon.h b/daemon/daemon.h index fb74e91..0caad45 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -173,6 +173,7 @@ asprintf_nowarn (char **strp, const char *fmt, ...) extern void cleanup_free (void *ptr); extern void cleanup_free_string_list (void *ptr); extern void cleanup_unlink_free (void *ptr); +extern void cleanup_close (void *ptr); /*-- in names.c (auto-generated) --*/ extern const char *function_names[]; @@ -405,...
2012 Aug 14
7
[PATCH 0/7] Add tar compress, numericowner, excludes flags.
https://bugzilla.redhat.com/show_bug.cgi?id=847880 https://bugzilla.redhat.com/show_bug.cgi?id=847881 This patch series adds various optional arguments to the tar-in and tar-out commands. Firstly (1/7) an optional "compress" flag is added to select compression. This makes the calls tgz-in/tgz-out/txz-in/txz-out deprecated, and expands the range of compression types available.
2016 Feb 22
2
Re: [PATCH] added ntfscat_i api
...fer[GUESTFS_MAX_CHUNK_SIZE]; >> + >> + /* Inode must be greater than 0 */ >> + if (inode < 0) { >> + reply_with_error("Inode must be greater than 0"); >> + return -1; >> + } >> + >> + /* Construct the command. */ >> + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", >> + inode, mountable->device) == -1) { >> + reply_with_perror ("asprintf"); >> + return -1; >> + } >> + >> + if (verbose) >> + fprintf (stderr, "%s\n", cmd);...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
..." #include "actions.h" -GUESTFSD_EXT_CMD(str_base64, base64); +DECLARE_EXTERNAL_COMMANDS ("base64") static int write_cb (void *fd_ptr, const void *buf, size_t len) @@ -48,7 +48,7 @@ do_base64_in (const char *file) CLEANUP_FREE char *cmd = NULL; int fd; - if (asprintf_nowarn (&cmd, "%s -d -i > %R", str_base64, file) == -1) { + if (asprintf_nowarn (&cmd, "%s -d -i > %R", "base64", file) == -1) { err = errno; cancel_receive (); errno = err; @@ -132,7 +132,7 @@ do_base64_out (const char *file) } /* Constr...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
....c @@ -30,8 +30,6 @@ #include "daemon.h" #include "actions.h" -GUESTFSD_EXT_CMD(str_base64, base64); - static int write_cb (void *fd_ptr, const void *buf, size_t len) { @@ -48,7 +46,7 @@ do_base64_in (const char *file) CLEANUP_FREE char *cmd = NULL; int fd; - if (asprintf_nowarn (&cmd, "%s -d -i > %R", str_base64, file) == -1) { + if (asprintf_nowarn (&cmd, "%s -d -i > %R", "base64", file) == -1) { err = errno; cancel_receive (); errno = err; @@ -132,7 +130,7 @@ do_base64_out (const char *file) } /* Constr...
2015 Nov 18
0
Re: [PATCH 5/5] build: Enable some more warnings.
...Pino Toscano wrote: > On Monday 09 November 2015 23:02:15 Richard W.M. Jones wrote: > > After fixing some warnings (see prior commits), we can now enable > > them in configure.ac. > > --- > > [...] > > -nw="$nw -Winline" # daemon.h's asprintf_nowarn > > Disabling -Winline causes the Python binding code to fail with build > with GCC < 4.9, because of the static inline functions in > python/guestfs-py.h. See for example on CentOS 7.1 and openSUSE 13.1: > https://ci.centos.org/view/libguestfs/job/libguestfs/label=libguestfs-ci-...
2009 Sep 17
1
[PATCH] Disable -Wunsafe-loop-optimizations
...2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index b28f316..95ab51e 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,8 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Winline" # daemon.h's asprintf_nowarn nw="$nw -Wshadow" # numerous, plus we're not unanimous # ?? -Wstrict-overflow + nw="$nw -Wunsafe-loop-optimizations" # just a warning that an optimization + # was not possible, safe to ignore gl_MANYWARN_ALL_GCC(...
2016 Feb 22
0
Re: [PATCH] added ntfscat_i api
...E char *cmd = NULL; > + char buffer[GUESTFS_MAX_CHUNK_SIZE]; > + > + /* Inode must be greater than 0 */ > + if (inode < 0) { > + reply_with_error("Inode must be greater than 0"); > + return -1; > + } > + > + /* Construct the command. */ > + if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s", > + inode, mountable->device) == -1) { > + reply_with_perror ("asprintf"); > + return -1; > + } > + > + if (verbose) > + fprintf (stderr, "%s\n", cmd); > + > + fp = popen (c...
2016 Apr 04
2
Re: [PATCH v2 3/5] daemon: Added internal_filesystem_walk command
...NUP_FREE char *fname = NULL; > + struct guestfs_int_tsk_dirent dirent; > + > + /* Ignore ./ and ../ */ > + ret = TSK_FS_ISDOT (fsfile->name->name); > + if (ret != 0) > + return TSK_WALK_CONT; > + > + /* Build the full relative path of the entry */ > + ret = asprintf_nowarn (&fname, "%Q%Q", path, fsfile->name->name); Why the quoting? We don't quote results in similar APIs (e.g. readdir). > + if (ret < 0) { > + fprintf (stderr, "asprintf: %m"); > + return TSK_WALK_ERROR; > + } > + > + dirent.tsk_inode =...