diff --git a/qubes-rpc/qfile-agent.c b/qubes-rpc/qfile-agent.c index 51a7337..c3c8178 100644 --- a/qubes-rpc/qfile-agent.c +++ b/qubes-rpc/qfile-agent.c @@ -18,6 +18,8 @@ enum { PROGRESS_FLAG_DONE }; +int ignore_symlinks = 0; + unsigned long crc32_sum; int write_all_with_crc(int fd, void *buf, int size) { @@ -143,7 +145,7 @@ int single_file_processor(char *filename, struct stat *st) hdr.filelen = 0; write_headers(&hdr, filename); } - if (S_ISLNK(mode)) { + if (S_ISLNK(mode) && !ignore_symlinks) { char name[st->st_size + 1]; if (readlink(filename, name, sizeof(name)) != st->st_size) gui_fatal("readlink %s", filename); @@ -227,6 +229,11 @@ int main(int argc, char **argv) crc32_sum = 0; cwd = getcwd(NULL, 0); for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--ignore-symlinks")==0) { + ignore_symlinks = 1; + continue; + } + entry = get_abs_path(cwd, argv[i]); do { diff --git a/qubes-rpc/qvm-copy-to-vm b/qubes-rpc/qvm-copy-to-vm index be0804a..3d1716c 100755 --- a/qubes-rpc/qvm-copy-to-vm +++ b/qubes-rpc/qvm-copy-to-vm @@ -37,7 +37,7 @@ VM="$1" shift if [ $PROGRESS_TYPE = console ] ; then - export FILECOPY_TOTAL_SIZE=$(du --apparent-size -c "$@" | tail -1 | cut -f 1) + export FILECOPY_TOTAL_SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1) fi exec /usr/lib/qubes/qrexec-client-vm $VM qubes.Filecopy /usr/lib/qubes/qfile-agent "$@" diff --git a/qubes-rpc/qvm-copy-to-vm.gnome b/qubes-rpc/qvm-copy-to-vm.gnome index 4199476..4b69c06 100755 --- a/qubes-rpc/qvm-copy-to-vm.gnome +++ b/qubes-rpc/qvm-copy-to-vm.gnome @@ -23,7 +23,7 @@ VM=$(qvm-mru-entry --title="File Copy" --text="Enter the destination domain name:" --mrufile "qvm-mru-filecopy") if [ X$VM = X ] ; then exit 0 ; fi -SIZE=$(du --apparent-size -c "$@" | tail -1 | cut -f 1) +SIZE=$(du --apparent-size -c -- "$@" 2>/dev/null | tail -1 | cut -f 1) export PROGRESS_TYPE=gui diff --git a/qubes-rpc/qvm-copy-to-vm.kde b/qubes-rpc/qvm-copy-to-vm.kde index 74ebf7b..740cf8a 100755 --- a/qubes-rpc/qvm-copy-to-vm.kde +++ b/qubes-rpc/qvm-copy-to-vm.kde @@ -23,7 +23,7 @@ VM=$(kdialog -inputbox "Enter the VM name to send files to:") if [ X$VM = X ] ; then exit 0 ; fi -SIZE=$(du --apparent-size -c "$@" | tail -1 | cut -f 1) +SIZE=$(du --apparent-size -c -- "$@" 2> /dev/null | tail -1 | cut -f 1) REF=$(kdialog --progressbar "Copy progress") qdbus $REF org.freedesktop.DBus.Properties.Set "" maximum $SIZE