Olaf Hering
2012-Sep-03 16:01 UTC
[Libguestfs] [PATCH] daemon: provide list of checksum commands
While adding the list of external commands I missed the various checksum tools. Signed-off-by: Olaf Hering <olaf at aepfle.de> --- WARNING: not compile tested ... diff --git a/daemon/checksum.c b/daemon/checksum.c index f2e040d..f16a7c0 100644 --- a/daemon/checksum.c +++ b/daemon/checksum.c @@ -31,24 +31,31 @@ GUESTFSD_EXT_CMD(str_find, find); GUESTFSD_EXT_CMD(str_xargs, xargs); +GUESTFSD_EXT_CMD(str_cksum, cksum); +GUESTFSD_EXT_CMD(str_md5sum, md5sum); +GUESTFSD_EXT_CMD(str_sha1sum, sha1sum); +GUESTFSD_EXT_CMD(str_sha224sum, sha224sum); +GUESTFSD_EXT_CMD(str_sha256sum, sha256sum); +GUESTFSD_EXT_CMD(str_sha384sum, sha384sum); +GUESTFSD_EXT_CMD(str_sha512sum, sha512sum); static const char * program_of_csum (const char *csumtype) { if (STRCASEEQ (csumtype, "crc")) - return "cksum"; + return str_cksum; else if (STRCASEEQ (csumtype, "md5")) - return "md5sum"; + return str_md5sum; else if (STRCASEEQ (csumtype, "sha1")) - return "sha1sum"; + return str_sha1sum; else if (STRCASEEQ (csumtype, "sha224")) - return "sha224sum"; + return str_sha224sum; else if (STRCASEEQ (csumtype, "sha256")) - return "sha256sum"; + return str_sha256sum; else if (STRCASEEQ (csumtype, "sha384")) - return "sha384sum"; + return str_sha384sum; else if (STRCASEEQ (csumtype, "sha512")) - return "sha512sum"; + return str_sha512sum; else { reply_with_error ("unknown checksum type, expecting crc|md5|sha1|sha224|sha256|sha384|sha512"); return NULL; -- 1.7.11.5
Richard W.M. Jones
2012-Sep-03 16:31 UTC
[Libguestfs] [PATCH] daemon: provide list of checksum commands
On Mon, Sep 03, 2012 at 06:01:37PM +0200, Olaf Hering wrote:> While adding the list of external commands I missed the > various checksum tools. > > Signed-off-by: Olaf Hering <olaf at aepfle.de> > --- > WARNING: not compile tested ...Seems OK over here. I've applied it and will push later. Thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
Possibly Parallel Threads
- [PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
- [PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
- use STREQ(a,b), not strcmp(a,b) == 0
- [PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
- [PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.