summaryrefslogtreecommitdiffstats
path: root/daemon/ext2.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-06-10 11:11:14 +0100
committerRichard Jones <rjones@redhat.com>2009-06-10 11:11:14 +0100
commit2df2f2854ed2d1f9857ef3c5aaca29810cf3c506 (patch)
tree9da6966c5e069fe880640d266a06da36bda589ec /daemon/ext2.c
parent4aea83962337ac5e5847398e2128a9dbb8779247 (diff)
downloadlibguestfs-2df2f2854ed2d1f9857ef3c5aaca29810cf3c506.tar.gz
libguestfs-2df2f2854ed2d1f9857ef3c5aaca29810cf3c506.tar.xz
libguestfs-2df2f2854ed2d1f9857ef3c5aaca29810cf3c506.zip
Add IS_DEVICE checks for all calls which take a device parameter.
Diffstat (limited to 'daemon/ext2.c')
-rw-r--r--daemon/ext2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c
index ab03528f..4e1b398b 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -122,6 +122,8 @@ do_set_e2label (const char *device, const char *label)
int r;
char *err;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err, "/sbin/e2label", device, label, NULL);
if (r == -1) {
reply_with_error ("e2label: %s", err);
@@ -139,6 +141,8 @@ do_get_e2label (const char *device)
int r, len;
char *out, *err;
+ IS_DEVICE (device, NULL);
+
r = command (&out, &err, "/sbin/e2label", device, NULL);
if (r == -1) {
reply_with_error ("e2label: %s", err);
@@ -163,6 +167,8 @@ do_set_e2uuid (const char *device, const char *uuid)
int r;
char *err;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err, "/sbin/tune2fs", "-U", uuid, device, NULL);
if (r == -1) {
reply_with_error ("tune2fs -U: %s", err);
@@ -180,6 +186,8 @@ do_get_e2uuid (const char *device)
int r;
char *out, *err, *p, *q;
+ IS_DEVICE (device, NULL);
+
/* It's not so straightforward to get the volume UUID. We have
* to use tune2fs -l and then look for a particular string in
* the output.