git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1c8f9c2
)
CHROOT_OUT must preserve errno.
author
Richard Jones
<rjones@redhat.com>
Fri, 10 Apr 2009 11:47:34 +0000
(12:47 +0100)
committer
Richard Jones
<rjones@redhat.com>
Fri, 10 Apr 2009 11:54:56 +0000
(12:54 +0100)
daemon/daemon.h
patch
|
blob
|
history
diff --git
a/daemon/daemon.h
b/daemon/daemon.h
index
e2b6a2a
..
b2396a1
100644
(file)
--- a/
daemon/daemon.h
+++ b/
daemon/daemon.h
@@
-19,12
+19,14
@@
#ifndef GUESTFSD_DAEMON_H
#define GUESTFSD_DAEMON_H
#ifndef GUESTFSD_DAEMON_H
#define GUESTFSD_DAEMON_H
-#include "../src/guestfs_protocol.h"
-
#include <stdarg.h>
#include <stdarg.h>
+#include <errno.h>
+
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
+#include "../src/guestfs_protocol.h"
+
/* in guestfsd.c */
extern void xwrite (int sock, const void *buf, size_t len);
extern void xread (int sock, void *buf, size_t len);
/* in guestfsd.c */
extern void xwrite (int sock, const void *buf, size_t len);
extern void xread (int sock, void *buf, size_t len);
@@
-78,8
+80,10
@@
extern void reply (xdrproc_t xdrp, char *ret);
* (2) You must not change directory! cwd must always be "/", otherwise
* we can't escape our own chroot.
* (3) All paths specified must be absolute.
* (2) You must not change directory! cwd must always be "/", otherwise
* we can't escape our own chroot.
* (3) All paths specified must be absolute.
+ * (4) CHROOT_OUT does not affect errno.
*/
#define CHROOT_IN chroot ("/sysroot");
*/
#define CHROOT_IN chroot ("/sysroot");
-#define CHROOT_OUT chroot (".");
+#define CHROOT_OUT \
+ do { int old_errno = errno; chroot ("."); errno = old_errno; } while (0)
#endif /* GUESTFSD_DAEMON_H */
#endif /* GUESTFSD_DAEMON_H */