diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-08-17 14:11:21 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-08-17 16:08:13 +0100 |
commit | a69f44f56f20beab7793be428df22104f79500e7 (patch) | |
tree | 76d6d082290fbc7b429b7be8c7781881249f51f0 /daemon | |
parent | 1b4d8e2cca7819b4c6e14bb052f40a9fc40205d3 (diff) | |
download | libguestfs-a69f44f56f20beab7793be428df22104f79500e7.tar.gz libguestfs-a69f44f56f20beab7793be428df22104f79500e7.tar.xz libguestfs-a69f44f56f20beab7793be428df22104f79500e7.zip |
guestfs_ls: Reimplement to avoid protocol limits.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/ls.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/daemon/ls.c b/daemon/ls.c index 0f60a4ea..5adf5ef3 100644 --- a/daemon/ls.c +++ b/daemon/ls.c @@ -93,49 +93,6 @@ do_ls0 (const char *path) return 0; } -char ** -do_ls (const char *path) -{ - DECLARE_STRINGSBUF (ret); - DIR *dir; - struct dirent *d; - - CHROOT_IN; - dir = opendir (path); - CHROOT_OUT; - - if (!dir) { - reply_with_perror ("opendir: %s", path); - return NULL; - } - - while ((d = readdir (dir)) != NULL) { - if (STREQ (d->d_name, ".") || STREQ (d->d_name, "..")) - continue; - - if (add_string (&ret, d->d_name) == -1) { - closedir (dir); - return NULL; - } - } - - if (ret.size > 0) - sort_strings (ret.argv, ret.size); - - if (end_stringsbuf (&ret) == -1) { - closedir (dir); - return NULL; - } - - if (closedir (dir) == -1) { - reply_with_perror ("closedir: %s", path); - free_stringslen (ret.argv, ret.size); - return NULL; - } - - return ret.argv; -} - /* Because we can't chroot and run the ls command (since 'ls' won't * necessarily exist in the chroot), this command can be used to escape * from the sysroot (eg. 'll /..'). This command is not meant for |