Guest User

Untitled

a guest
Oct 2nd, 2013
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. From e9d7c4dad3de1c72db8bce7ecec906f235179755 Mon Sep 17 00:00:00 2001
  2. From: Christien Rioux <crioux@blink.veracode.local>
  3. Date: Wed, 2 Oct 2013 13:16:24 -0400
  4. Subject: [PATCH] add symlinks
  5.  
  6. ---
  7. src/ideviceinstaller.c | 11 +++++++++--
  8. 1 file changed, 9 insertions(+), 2 deletions(-)
  9.  
  10. diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
  11. index 3aac8ae..ce66cc7 100644
  12. --- a/src/ideviceinstaller.c
  13. +++ b/src/ideviceinstaller.c
  14. @@ -36,6 +36,7 @@
  15. #include <limits.h>
  16. #include <sys/stat.h>
  17. #include <dirent.h>
  18. +#include <unistd.h>
  19.  
  20. #include <libimobiledevice/libimobiledevice.h>
  21. #include <libimobiledevice/lockdown.h>
  22. @@ -452,8 +453,14 @@ static void afc_upload_dir(afc_client_t afc, const char* path, const char* afcpa
  23. strcpy(apath, afcpath);
  24. strcat(apath, "/");
  25. strcat(apath, ep->d_name);
  26. -
  27. - if ((stat(fpath, &st) == 0) && S_ISDIR(st.st_mode)) {
  28. +
  29. + if ((lstat(fpath, &st)==0) && S_ISLNK(st.st_mode)) {
  30. + char *target=(char *)malloc(st.st_size);
  31. + readlink(fpath,target,st.st_size);
  32. + afc_make_link(afc,AFC_SYMLINK,target,fpath);
  33. + free(target);
  34. + }
  35. + else if ((stat(fpath, &st) == 0) && S_ISDIR(st.st_mode)) {
  36. afc_upload_dir(afc, fpath, apath);
  37. } else {
  38. afc_upload_file(afc, fpath, apath);
  39. --
  40. 1.8.3.4 (Apple Git-47)
RAW Paste Data