summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendafc.c
Commit message (Collapse)AuthorAgeFilesLines
* afc: Set G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYSAntónio Fernandes2021-01-221-0/+1
| | | | | | | | | | | | | filesystem::preview-type used to be IF_LOCAL for this backedn but it has been unset by commit a71469c79fd31adfc594a55afd29a7ce2202b270 The commit message says it should be treated as remote filesystems. However, filesystem::remote is set to FALSE, so application would still interpret this as local for previewing purposes. Set filesystem::preview-type to get the result expected by that commit. https://gitlab.gnome.org/GNOME/gvfs/-/issues/497
* Use shorter strings for prompt dialog titlesJonas Dreßler2021-01-151-2/+2
| | | | | | | | | | | | | The layout of the modal dialogs in gnome-shell changed [1] and the title now is larger and uses the style of a headline. Make sure all titles remain fully visible and use shorter strings for those. Also unify the generic "Enter password" strings a bit to make work easier for translators and use this string for most cases: "Authentication Required\nEnter password for “%s”:" [1] https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343
* afc: Handle permission denied errorBastien Nocera2020-02-111-0/+4
| | | | | | | The new string is not a string freeze breakage, it's already used in a number of other backends. Closes: #453
* afc: Remove unused error code conversionBastien Nocera2020-02-111-64/+0
| | | | We're doing it manually now.
* afc: Simplify setting error codesBastien Nocera2020-02-111-10/+7
| | | | | | | | | We don't need to go to another function to get an error code when our switch function does that already. The "unhandled" AFC errors are now slightly less precise, but it's still possible to get the meaning of that code from the AFC headers directly (for developers), and not visible for end-users anyway.
* afc: Don't set a content-type that isn't certainBastien Nocera2019-10-111-2/+4
| | | | | | Don't ignore the result_uncertain flag from g_content_type_guess() as it might cause nautilus to incorrectly think that a particular file is of a certain type, and never check its magic.
* daemon: Handle lockdown option to disable writingOndrej Holy2019-07-111-0/+2
| | | | | | Handle the new mount-removable-storage-devices-as-read-only option of org.gnome.desktop.lockdown schema and present AFC, MTP, GPhoto2 devices as read-only if enabled.
* afc: Remove assumptions about length of device UUIDPhilip Langdale2019-04-291-11/+5
| | | | | | | | | | | Modern Apple devices have UUIDs that are not 40 digits long, as used to be the case. Accordingly, a recent change in libimobiledevice removed any assumptions around the UUID length, and we should do the same in the afc backend. Without this change, we see a symptom where the volume monitor and backend disagree on the expected mount root. I have tested this on a 2018 iPad pro (iPad8,3) which has a 24 digit UUID.
* daemon: Use "Backups not supported" consistentlyMayank Sharma2019-03-211-1/+1
| | | | | | | | | GVfs uses different forms of "Backups not supported" string, e.g. "Backups are not yet supported.", "backups not supported" and "backups not supported yet". Let's use "Backups not supported" consistently. https://gitlab.gnome.org/GNOME/gvfs/issues/170
* daemon: Use "Operation not supported" consistentlyMayank Sharma2019-03-211-1/+1
| | | | | | | | | GVfs uses different forms of "Operation not supported" string, e.g. "Operation unsupported", "Operation not supported by backend". Let's use "Operation not supported" consistently as this is also used in GLib. https://gitlab.gnome.org/GNOME/gvfs/issues/170
* Remove workaround for directory / folder iconswip/rishi/issue-2Debarshi Ray2018-08-141-6/+7
| | | | https://gitlab.gnome.org/GNOME/gvfs/issues/2
* afc: More debug, for a changeBastien Nocera2017-09-191-1/+12
|
* afc: Leak mutex when force unmountingOndrej Holy2017-08-151-1/+2
| | | | | | | | The afc daemon sometimes aborts on g_mutex_clear when force unmounting. Leak the mutex in order to avoid the aborts. The daemon will hopefully finish successfully then... https://bugzilla.gnome.org/show_bug.cgi?id=775514
* afc: Use constants instead of magic numbersBastien Nocera2017-01-031-8/+15
| | | | | We use "ports" to offer filesystem access to different functions on iDevices. Use constants to make the code more readable.
* Use Unicode in translatable stringsPiotr Drąg2016-10-031-3/+3
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772219
* afc: Extend translator commentOndrej Holy2016-08-111-1/+2
| | | | | | | It is not obvious that "Trust" is the caption of the button in the device and not in the GVfs. https://bugzilla.gnome.org/show_bug.cgi?id=769712
* daemon: Set G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE attributeOndrej Holy2016-06-281-0/+1
| | | | | | | Mark all network-based backends as remote. This is useful to remove some hardcoded lists of filesystem types in GTK+. Bump required GLib version accordingly.
* afc: Fix several memory leaksOndrej Holy2016-06-101-0/+9
| | | | | Memory is not released on several places, when handling errors mostly. Add missing g_free calls to avoid those memory leaks.
* afc: Add missing trailing newline charOndrej Holy2016-06-101-1/+1
| | | | GVfs uses custom log handler, which requires trailing newline char.
* afc: Fix error when renaming files in DocumentsBastien Nocera2016-06-091-1/+7
| | | | | | | When renaming a file in Documents, the callers expect the new path in the global scheme, not the path inside the HouseArrest AFC itself. This fixes a warning in nautilus when renaming files.
* afc: Tweak HouseArrest warning outputBastien Nocera2016-06-091-5/+10
| | | | | | Only throw a warning when the second attempt at setting up HouseArrest fails, not when we're going to retry. This makes it easier to see real warnings compared to normal run-time behaviour.
* afc: Fix GStreamer playback of native filesBastien Nocera2016-06-091-10/+17
| | | | | | | | | | | | | | GStreamer gets very confused when the offset after a seek isn't what it expected, and told us that the "Stream contains no data." when trying to play back using giosrc. But we could play the video just fine going through fuse. FUSE hides bugs with relative seeks, such as our absolute offset being wrong when doing absolute seeks. To make sure that the offset we return is correct, call tell() and use that as the new offset. https://bugzilla.gnome.org/show_bug.cgi?id=767405
* afc: Fix mount failing after trusting deviceBastien Nocera2016-06-091-0/+8
| | | | | | | | After having trusted the device, if we are too quick at clicking the "Try Again" button, the creation will fail with an unknown error. Try again silently up to the maximum number of retries after a short sleep. https://bugzilla.gnome.org/show_bug.cgi?id=767399
* afc: Better lockdown client creation debugBastien Nocera2016-06-091-7/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=767399
* afc: Add specific errors for trust dialogue errorsBastien Nocera2016-06-091-1/+9
| | | | | | | | Add specific errors for when the user refuses trust on the device, or repeatedly tries to connect to it but the device is locked, or the dialogue still showing on the device. https://bugzilla.gnome.org/show_bug.cgi?id=763605
* afc: Add pairing dialogue specific messageBastien Nocera2016-06-091-7/+20
| | | | | | | When a pairing dialogue is shown on the device, don't tell the user that the device is locked, rather that they need to click "Trust". https://bugzilla.gnome.org/show_bug.cgi?id=763605
* afc: Fix iOS 7 trust dialogue handlingBastien Nocera2016-06-091-1/+8
| | | | | | | There are new iOS 7 related error codes that we need to handle to catch cases where a user action is required on the device. https://bugzilla.gnome.org/show_bug.cgi?id=767297
* afc: Limit the number of HouseArrest services we startBastien Nocera2016-06-091-21/+131
| | | | | | | | | | | | | To avoid being unable to navigate within applications because we ran out of HouseArrest services, keep track of file operations within each application, and disconnect from unused ones when trying to access an unconnected one. The tracking only covers file operations, and not enumerations, and the garbage collection algorithm is quite naive, but could easily be extended. https://bugzilla.gnome.org/show_bug.cgi?id=676188
* afc: Indicate whether to retry to setup HouseArrest for an appBastien Nocera2016-06-091-1/+5
| | | | | | | | If setting up the HouseArrest service for an app fails, we should clean up unused services, and try again. This tells us whether we should try again in the first place. https://bugzilla.gnome.org/show_bug.cgi?id=676188
* afc: Lock apps mutex when setting up HouseArrestBastien Nocera2016-06-081-8/+12
| | | | | | So that we don't have cases where the AppInfo disappears from under us. https://bugzilla.gnome.org/show_bug.cgi?id=676188
* afc: Better debug error message againBastien Nocera2016-06-081-1/+1
| | | | | | For starting the HouseArrest lockdownd service this time. https://bugzilla.gnome.org/show_bug.cgi?id=676188
* afc: Add guards against the operation mode not being setBastien Nocera2016-06-081-3/+15
| | | | | | | | | | | We usually did: if mode == AFC; <foo> else <bar> To guard against the mode not actually being HouseArrest in the else branch, change this to: if mode == AFC; <foo> else if mode == HOUSE_ARREST ; <bar> ; else ; <baz> https://bugzilla.gnome.org/show_bug.cgi?id=764099
* afc: Fix handling of new HouseArrest pathsBastien Nocera2016-06-081-36/+34
| | | | | | | | | | | | | | In b8ad223, we re-rooted the HouseArrest paths to always include Documents/ as anything closed to the root isn't accessible. This caused 2 problems: - first, it meant that checking for the new path being "/" wasn't correct, as the path would always include at least a "Documents" path component - secondly, it meant that the display name for the root directory for an application was incorrect as it was always "Documents" instead of the app name. https://bugzilla.gnome.org/show_bug.cgi?id=764099
* afc: Do not use G_FILESYSTEM_PREVIEW_TYPE_IF_LOCALOndrej Holy2016-05-041-3/+0
| | | | | | | | Commit fe83e09 removed thumbnailing support, so we should not using G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL anymore. Let's remove it to be treated as other remote filesystems. https://bugzilla.gnome.org/show_bug.cgi?id=749639
* afc: Don't list inaccessible applicationsBastien Nocera2016-03-191-15/+1
| | | | | | | | | | As we can only start HouseArrest for applications that have UIFileSharingEnabled turned on, there's absolutely no need to list the other applications. See https://github.com/libimobiledevice/libimobiledevice/issues/193 https://bugzilla.gnome.org/show_bug.cgi?id=763606
* afc: Fix accessing applications with HouseArrestBastien Nocera2016-03-191-20/+8
| | | | | | | | | | | | | | Only sideloaded applications (development versions for example) can use the VendContainer method of accessing application documents. Always use the VendDocuments method instead. Note that we'll also re-root the Documents folder as the root of the app container is inaccessible ("EPERM") to avoid users fiddling with it. See https://github.com/libimobiledevice/libimobiledevice/issues/193#issuecomment-95280639 https://bugzilla.gnome.org/show_bug.cgi?id=763606
* afc: Better error message when house arrest fails to startBastien Nocera2016-03-191-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=749639
* afc: Remove attempts at thumbnailing photosBastien Nocera2016-03-191-190/+0
| | | | | | | | | | | | | | iDevices had a list of thumbnails available through afc:/// for photos stored in the DCIM/ sub-directory, but the code to handle this was always pretty fragile, relying on the iOS version to know which of a number of different ways the thumbnails could be called or where they would be stored. It's easier to create the thumbnails ourselves from the JPG files, or even access photos through PTP so that thumbnails are readily accessible and in a way that doesn't change with each iOS release. https://bugzilla.gnome.org/show_bug.cgi?id=749639
* Mark files as untrashable for main backendsOndrej Holy2015-09-231-0/+2
| | | | | | Otherwise nautilus will offer the wrong action in its UI. https://bugzilla.gnome.org/show_bug.cgi?id=753934
* Unify strings to ease translationFelix Möller2015-08-051-3/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=657906
* afc: Cleanup force-unmount idle on finalizeChristophe Fergeau2015-07-031-2/+30
| | | | | | | | | | When GvfsBackendAfc is finalized, if we have a pending idle for a force unmount, we need to remove it as by the time it runs, the GvfsBackendAfc it's acting on will no longer be valid. This fixes https://bugzilla.gnome.org/show_bug.cgi?id=751537 which can be reproduced by plugging an iDevice, unmounting it in Nautilus, and quickly unplugging it right after clicking on the eject icon.
* afc: Fix force unmount of devicesChristophe Fergeau2015-03-091-7/+17
| | | | | | | | | | | | | | | | | | | | | When unplugging an afc device without unmounting it first, the corresponding gvfsd-afc process does not go away in spite of the exit(1) workaround added for bgo#708288. This happens because idevice_event_unsubscribe() in called from the thread where the _idevice_event_cb() runs in. libimobiledevice (through libusbmuxd) creates a thread to watch for device events, and calls the idevice_event_cb_t from that thread. idevice_event_unsubscribe() then forcfully kills that thread (see usbmuxd_unsubscribe() in libusbmuxd), so exit(1) code after the call to idevice_event_unsubscribe() never gets a chance to run. Moving the call to idevice_event_unsubscribe() and the g_vfs_backend_force_unmount() call to run in the main loop through g_idle_add() avoids this issue, and allows the code handling force unmounts to run as expected. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=708288
* daemon: Move seek type conversion to shared libraryRoss Lagerwall2015-02-091-11/+1
| | | | | | | Since converting a GSeekType into an lseek type is repeated in a few places, move it into shared code. https://bugzilla.gnome.org/show_bug.cgi?id=738967
* afc: fix wrong enum valueOndrej Holy2014-11-201-1/+1
| | | | | | | | | | Value of sbservices_error_t type is compared with INSTPROXY_E_SUCCESS from instproxy_error_t, SBSERVICES_E_SUCCESS should be used instead. However it isn't serious, because both constants have same value... It fixes following warning: gvfsbackendafc.c:262:21: warning: comparison between ‘sbservices_error_t’ and ‘enum <anonymous>’ [-Wenum-compare] if (G_LIKELY(cond == INSTPROXY_E_SUCCESS))
* afc: try copy and delete fallback if backup couldn't be createdOndrej Holy2014-11-191-4/+18
| | | | | | | | | | Move operation fails immediately with G_IO_ERROR_CANT_CREATE_BACKUP if G_FILE_COPY_BACKUP is specified. Consequently copy and delete fallback isn't executed. Return NOT_SUPPORTED instead of CANT_CREATE_BACKUP to proceed with the fallback if G_FILE_COPY_NO_FALLBACK_FOR_MOVE isn't specified. https://bugzilla.gnome.org/show_bug.cgi?id=740057
* afc: Support st_birthtimeRoss Lagerwall2014-07-121-0/+4
| | | | | | | Allow setting the created timestamp using st_birthtime, supported on iOS 7+. https://bugzilla.gnome.org/show_bug.cgi?id=732752
* afc: Implement standard::allocated-sizeRoss Lagerwall2014-06-051-1/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=505042
* afc: Work-around mounts not disappearing when disconnecting deviceBastien Nocera2014-06-031-1/+3
| | | | See https://bugzilla.gnome.org/show_bug.cgi?id=708288
* afc: Add version detection for iOS 6, 7 and 8Bastien Nocera2014-06-031-2/+14
|
* afc: Implement truncate support for output streamsRoss Lagerwall2013-12-051-0/+25
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=573837