git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix 'unknown filesystem' warnings in old inspection code (RHBZ#678231 RHBZ#666578).
[libguestfs.git]
/
daemon
/
base64.c
diff --git
a/daemon/base64.c
b/daemon/base64.c
index
89bf437
..
8aca5b7
100644
(file)
--- a/
daemon/base64.c
+++ b/
daemon/base64.c
@@
-23,7
+23,7
@@
#include <string.h>
#include <fcntl.h>
#include <string.h>
#include <fcntl.h>
-#include "
../src/
guestfs_protocol.h"
+#include "guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
#include "daemon.h"
#include "actions.h"
@@
-42,7
+42,7
@@
do_base64_in (const char *file)
FILE *fp;
char *cmd;
FILE *fp;
char *cmd;
- if (asprintf_nowarn (&cmd, "base64 -d > %R", file) == -1) {
+ if (asprintf_nowarn (&cmd, "base64 -d
-i
> %R", file) == -1) {
err = errno;
cancel_receive ();
errno = err;
err = errno;
cancel_receive ();
errno = err;
@@
-77,14
+77,15
@@
do_base64_in (const char *file)
return -1;
}
if (r == -2) { /* cancellation from library */
return -1;
}
if (r == -2) { /* cancellation from library */
+ /* This error is ignored by the library since it initiated the
+ * cancel. Nevertheless we must send an error reply here.
+ */
+ reply_with_error ("file upload cancelled");
pclose (fp);
pclose (fp);
- /* Do NOT send any error. */
return -1;
}
if (pclose (fp) != 0) {
return -1;
}
if (pclose (fp) != 0) {
- if (r == -1) /* if r == 0, file transfer ended already */
- cancel_receive ();
reply_with_error ("base64 subcommand failed on file: %s", file);
return -1;
}
reply_with_error ("base64 subcommand failed on file: %s", file);
return -1;
}