summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml61
-rw-r--r--NEWS7
-rw-r--r--README.md209
-rwxr-xr-xautogen.sh6
-rw-r--r--configure.ac24
-rwxr-xr-xgit-version-gen20
-rw-r--r--src/ifuse.c155
7 files changed, 345 insertions, 137 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..9829d7a
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,61 @@
+name: build
+
+on: [push]
+
+jobs:
+ build-linux-ubuntu:
+ runs-on: ubuntu-latest
+ steps:
+ - name: install dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install libfuse3-dev
+ - name: prepare environment
+ run: |
+ echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV
+ - name: fetch libplist
+ uses: dawidd6/action-download-artifact@v6
+ with:
+ github_token: ${{secrets.GITHUB_TOKEN}}
+ workflow: build.yml
+ name: libplist-latest_${{env.target_triplet}}
+ repo: libimobiledevice/libplist
+ - name: fetch libusbmuxd
+ uses: dawidd6/action-download-artifact@v6
+ with:
+ github_token: ${{secrets.GITHUB_TOKEN}}
+ workflow: build.yml
+ name: libusbmuxd-latest_${{env.target_triplet}}
+ repo: libimobiledevice/libusbmuxd
+ - name: fetch libimobiledevice-glue
+ uses: dawidd6/action-download-artifact@v6
+ with:
+ github_token: ${{secrets.GITHUB_TOKEN}}
+ workflow: build.yml
+ name: libimobiledevice-glue-latest_${{env.target_triplet}}
+ repo: libimobiledevice/libimobiledevice-glue
+ - name: fetch libimobiledevice
+ uses: dawidd6/action-download-artifact@v6
+ with:
+ github_token: ${{secrets.GITHUB_TOKEN}}
+ workflow: build.yml
+ name: libimobiledevice-latest_${{env.target_triplet}}
+ repo: libimobiledevice/libimobiledevice
+ - name: install external dependencies
+ run: |
+ mkdir extract
+ for I in *.tar; do
+ tar -C extract -xvf $I
+ done
+ rm -rf extract/lib
+ sudo cp -r extract/* /
+ sudo ldconfig
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: autogen
+ run: ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+ - name: make
+ run: make
+ - name: make install
+ run: sudo make install
diff --git a/NEWS b/NEWS
index 6bde7a8..2e05a9e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+Version 1.2.0
+~~~~~~~~~~~~~
+
+* Changes:
+ - Switch to libfuse 3
+ - Require libimobiledevice 1.4.0
+
Version 1.1.4
~~~~~~~~~~~~~
diff --git a/README.md b/README.md
index c806de4..efae31a 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,22 @@
*A fuse filesystem implementation to access the contents of iOS devices.*
+![](https://github.com/libimobiledevice/ifuse/actions/workflows/build.yml/badge.svg)
+
+## Table of Contents
+- [Features](#features)
+- [Building](#building)
+ - [Prerequisites](#prerequisites)
+ - [Linux (Debian/Ubuntu based)](#linux-debianubuntu-based)
+ - [macOS](#macos)
+ - [Configuring the source tree](#configuring-the-source-tree)
+ - [Building and installation](#building-and-installation)
+- [Usage](#usage)
+- [Contributing](#contributing)
+- [Links](#links)
+- [License](#license)
+- [Credits](#credits)
+
## Features
This project allows mounting various directories of an iOS device locally using
@@ -15,57 +31,167 @@ Some key features are:
- **Browse**: Allows to retrieve a list of installed file-sharing enabled apps
- **Implementation**: Uses [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice) for communication with the device
-## Installation / Getting started
+## Building
+
+### Prerequisites
+
+You need to have a working compiler (gcc/clang) and development environent
+available. This project uses autotools for the build process, allowing to
+have common build steps across different platforms.
+Only the prerequisites differ and they are described in this section.
+
+#### Linux (Debian/Ubuntu based)
+
+* Install all required dependencies and build tools:
+ ```shell
+ sudo apt-get install \
+ build-essential \
+ pkg-config \
+ checkinstall \
+ git \
+ autoconf \
+ automake \
+ libtool-bin \
+ libplist-dev \
+ libimobiledevice-dev \
+ libfuse3-dev \
+ usbmuxd
+ ```
+
+* [usbmuxd](https://github.com/libimobiledevice/usbmuxd) must be properly installed for `ifuse` to be able to
+communicate with devices.
+
+* Note: On some systems, you may have to load the `fuse` kernel
+module first and to ensure that you are a member of the `fuse` group:
+
+ ```shell
+ sudo modprobe fuse
+ sudo adduser $USER fuse
+ ```
+
+ You can check your membership of the `fuse` group with:
+
+ ```shell
+ id | grep fuse && echo yes! || echo not yet...
+ ```
+
+ If you have just added yourself, you will need to logout and log back
+ in for the group change to become visible.
+
+
+#### macOS
+
+* Make sure the Xcode command line tools are installed.
+
+ Use either [MacPorts](https://www.macports.org/)
+ or [Homebrew](https://brew.sh/) to install `automake`, `autoconf`, and `libtool`.
+
+ Using MacPorts:
+ ```shell
+ sudo port install libtool autoconf automake
+ ```
+
+ Using Homebrew:
+ ```shell
+ brew install libtool autoconf automake
+ ```
+
+ `ifuse` has a few dependencies from the libimobiledevice project.
+ You will have to build and install the following:
+ * [libplist](https://github.com/libimobiledevice/libplist)
+ * [libimobiledevice-glue](https://github.com/libimobiledevice/libimobiledevice-glue)
+ * [libusbmuxd](https://github.com/libimobiledevice/libusbmuxd)
+ * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice)
+
+ Check their `README.md` for building and installation instructions.
+
+* Download [macFUSE](https://github.com/macfuse/macfuse/releases/) dmg, mount it, and double click the `Install macFUSE` installer.
+ This will also install the libfuse library and development files.
+
+ Note: For macFUSE to work, you need to allow the macFUSE system extension in *Settings* -> *Privacy & Security* -> *Security*. Note that changes will require a system restart.
+
+
+### Configuring the source tree
+
+You can build the source code from a git checkout, or from a `.tar.bz2` release tarball from [Releases](https://github.com/libimobiledevice/ifuse/releases).
+Before we can build it, the source tree has to be configured for building. The steps depend on where you got the source from.
+
+* **From git**
-### Debian / Ubuntu Linux
+ If you haven't done already, clone the actual project repository and change into the directory.
+ ```shell
+ git clone https://github.com/libimobiledevice/ifuse.git
+ cd ifuse
+ ```
+
+ Configure the source tree for building:
+ ```shell
+ ./autogen.sh
+ ```
+
+* **From release tarball (.tar.bz2)**
+
+ When using an official [release tarball](https://github.com/libimobiledevice/ifuse/releases) (`ifuse-x.y.z.tar.bz2`)
+ the procedure is slightly different.
+
+ Extract the tarball:
+ ```shell
+ tar xjf ifuse-x.y.z.tar.bz2
+ cd ifuse-x.y.z
+ ```
+
+ Configure the source tree for building:
+ ```shell
+ ./configure
+ ```
+
+Both `./configure` and `./autogen.sh` (which generates and calls `configure`) accept a few options, for example `--prefix` to allow
+building for a different target folder. You can simply pass them like this:
-First install all required dependencies and build tools:
```shell
-sudo apt-get install \
- build-essential \
- pkg-config \
- checkinstall \
- git \
- autoconf \
- automake \
- libtool-bin \
- libplist-dev \
- libimobiledevice-dev \
- libfuse-dev \
- usbmuxd
+./autogen.sh --prefix=/usr/local
```
-
-Then clone the actual project repository:
+or
```shell
-git clone https://github.com/libimobiledevice/ifuse.git
-cd ifuse
+./configure --prefix=/usr/local
```
-Now you can build and install it:
-```shell
-./autogen.sh
-make
-sudo make install
+Once the command is successful, the last few lines of output will look like this:
```
+[...]
+config.status: creating config.h
+config.status: config.h is unchanged
+config.status: executing depfiles commands
+config.status: executing libtool commands
-### Setting up FUSE
+Configuration for ifuse 1.2.0:
+-------------------------------------------
-Note that on some systems, you may have to load the `fuse` kernel
-module first and to ensure that you are a member of the `fuse` group:
+ Install prefix: .........: /usr/local
-```shell
-sudo modprobe fuse
-sudo adduser $USER fuse
+ Now type 'make' to build ifuse 1.2.0,
+ and then 'make install' for installation.
```
-You can check your membership of the `fuse` group with:
+### Building and installation
+
+If you followed all the steps successfully, and `autogen.sh` or `configure` did not print any errors,
+you are ready to build the project. This is simply done with
```shell
-id | grep fuse && echo yes! || echo not yet...
+make
```
-If you have just added yourself, you will need to logout and log back
-in for the group change to become visible.
+If no errors are emitted you are ready for installation. Depending on whether
+the current user has permissions to write to the destination directory or not,
+you would either run
+```shell
+make install
+```
+_OR_
+```shell
+sudo make install
+```
## Usage
@@ -83,7 +209,7 @@ To unmount as a regular user you must run:
fusermount -u <mountpoint>
```
-By default, ifuse (via the AFC protocol) gives access to the `/var/root/Media/`
+By default, ifuse (via the AFC protocol) gives access to the `/var/mobile/Media/`
chroot on the device (containing music/pictures). This is the right and safe
way to access the device. However, if the device has been jailbroken, a full
view of the device's filesystem might be available using the following command
@@ -97,10 +223,9 @@ the device to enable root filesystem usage. For instance blackra1n does not
install it and thus does not enable root filesystem access by default!
Use with care as the AFC protocol was not made to access the root filesystem.
-If using libimobiledevice >= 1.1.0, ifuse can also be used with the iTunes
-file/document sharing feature. It allows you to exchange files with an
-application on the device directly through it's documents folder by specifing
-the application identifier like this:
+**ifuse** can also be used with the iTunes file/document sharing feature.
+It allows you to exchange files with an application on the device directly
+through it's documents folder by specifing the application identifier like this:
```shell
ifuse --documents <appid> <mountpoint>
```
@@ -150,8 +275,8 @@ We are still working on the guidelines so bear with us!
## Links
* Homepage: https://libimobiledevice.org/
-* Repository: https://git.libimobiledevice.org/ifuse.git
-* Repository (Mirror): https://github.com/libimobiledevice/ifuse.git
+* Repository: https://github.com/libimobiledevice/ifuse.git
+* Repository (Mirror): https://git.libimobiledevice.org/ifuse.git
* Issue Tracker: https://github.com/libimobiledevice/ifuse/issues
* Mailing List: https://lists.libimobiledevice.org/mailman/listinfo/libimobiledevice-devel
* Twitter: https://twitter.com/libimobiledev
@@ -169,4 +294,4 @@ iPadOS, tvOS, watchOS, and macOS are trademarks of Apple Inc.
This project is an independent software application and has not been authorized,
sponsored, or otherwise approved by Apple Inc.
-README Updated on: 2022-04-04
+README Updated on: 2025-10-14
diff --git a/autogen.sh b/autogen.sh
index 1247057..da46cbc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,6 +7,12 @@ test -z "$srcdir" && srcdir=.
(
cd "$srcdir"
+ gprefix=`which glibtoolize 2>&1 >/dev/null`
+ if [ $? -eq 0 ]; then
+ glibtoolize --force
+ else
+ libtoolize --force
+ fi
aclocal
autoheader
automake --add-missing
diff --git a/configure.ac b/configure.ac
index 506f1be..6ac1ad8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,25 +1,30 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.64)
-AC_INIT([ifuse], [1.1.5], [https://github.com/libimobiledevice/ifuse/issues],, [https://libimobiledevice.org])
+AC_PREREQ(2.68)
+AC_INIT([ifuse], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/ifuse/issues],, [https://libimobiledevice.org])
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
+# Check if we have a version defined
+if test -z $PACKAGE_VERSION; then
+ AC_MSG_ERROR([PACKAGE_VERSION is not defined. Make sure to configure a source tree checked out from git or that .tarball-version is present.])
+fi
+
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
+LT_INIT
# Checks for libraries.
-PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0)
-PKG_CHECK_MODULES(libfuse, fuse >= 2.7.0)
-PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
+PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.4.0)
+PKG_CHECK_MODULES(libfuse, fuse3 >= 3.0.0)
+PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.3.0)
# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h stdint.h stdlib.h string.h])
+AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -36,17 +41,18 @@ AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-AC_OUTPUT([
+AC_CONFIG_FILES([
Makefile
src/Makefile
docs/Makefile
])
+AC_OUTPUT
echo "
Configuration for $PACKAGE $VERSION:
-------------------------------------------
- Install prefix ..........: $prefix
+ Install prefix: .........: $prefix
Now type 'make' to build $PACKAGE $VERSION,
and then 'make install' for installation.
diff --git a/git-version-gen b/git-version-gen
new file mode 100755
index 0000000..d868952
--- /dev/null
+++ b/git-version-gen
@@ -0,0 +1,20 @@
+#!/bin/sh
+SRCDIR=`dirname $0`
+if test -n "$1"; then
+ VER=$1
+else
+ if test -r "${SRCDIR}/.git" && test -x "`which git`" ; then
+ git update-index -q --refresh
+ if ! VER=`git describe --tags --dirty 2>/dev/null`; then
+ COMMIT=`git rev-parse --short HEAD`
+ DIRTY=`git diff --quiet HEAD || echo "-dirty"`
+ VER=`sed -n '1,/RE/s/Version \(.*\)/\1/p' ${SRCDIR}/NEWS`-git-${COMMIT}${DIRTY}
+ fi
+ else
+ if test -f "${SRCDIR}/.tarball-version"; then
+ VER=`cat "${SRCDIR}/.tarball-version"`
+ fi
+ fi
+fi
+VER=`printf %s "$VER" | head -n1`
+printf %s "$VER"
diff --git a/src/ifuse.c b/src/ifuse.c
index 9b813f5..f5f7640 100644
--- a/src/ifuse.c
+++ b/src/ifuse.c
@@ -19,7 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define FUSE_USE_VERSION 26
+#define FUSE_USE_VERSION 30
+#define FUSE_DARWIN_ENABLE_EXTENSIONS 0
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -205,77 +206,69 @@ static int get_afc_file_mode(afc_file_mode_t *afc_mode, int flags)
return 0;
}
-static int ifuse_getattr(const char *path, struct stat *stbuf)
+static int ifuse_getattr(const char *path, struct stat *stbuf, struct fuse_file_info *fi)
{
- int i;
int res = 0;
- char **info = NULL;
+ plist_t info = NULL;
afc_client_t afc = fuse_get_context()->private_data;
- afc_error_t ret = afc_get_file_info(afc, path, &info);
+ afc_error_t ret = afc_get_file_info_plist(afc, path, &info);
memset(stbuf, 0, sizeof(struct stat));
if (ret != AFC_E_SUCCESS) {
int e = get_afc_error_as_errno(ret);
- res = -e;
+ return -e;
} else if (!info) {
- res = -1;
- } else {
- // get file attributes from info list
- for (i = 0; info[i]; i += 2) {
- if (!strcmp(info[i], "st_size")) {
- stbuf->st_size = atoll(info[i+1]);
- } else if (!strcmp(info[i], "st_blocks")) {
- stbuf->st_blocks = atoi(info[i+1]);
- } else if (!strcmp(info[i], "st_ifmt")) {
- if (!strcmp(info[i+1], "S_IFREG")) {
- stbuf->st_mode = S_IFREG;
- } else if (!strcmp(info[i+1], "S_IFDIR")) {
- stbuf->st_mode = S_IFDIR;
- } else if (!strcmp(info[i+1], "S_IFLNK")) {
- stbuf->st_mode = S_IFLNK;
- } else if (!strcmp(info[i+1], "S_IFBLK")) {
- stbuf->st_mode = S_IFBLK;
- } else if (!strcmp(info[i+1], "S_IFCHR")) {
- stbuf->st_mode = S_IFCHR;
- } else if (!strcmp(info[i+1], "S_IFIFO")) {
- stbuf->st_mode = S_IFIFO;
- } else if (!strcmp(info[i+1], "S_IFSOCK")) {
- stbuf->st_mode = S_IFSOCK;
- }
- } else if (!strcmp(info[i], "st_nlink")) {
- stbuf->st_nlink = atoi(info[i+1]);
- } else if (!strcmp(info[i], "st_mtime")) {
- stbuf->st_mtime = (time_t)(atoll(info[i+1]) / 1000000000);
- }
+ return -1;
+ }
+
+ stbuf->st_size = plist_dict_get_uint(info, "st_size");
+ stbuf->st_blocks = plist_dict_get_uint(info, "st_blocks");
+ const char* s_ifmt = plist_get_string_ptr(plist_dict_get_item(info, "st_ifmt"), NULL);
+ if (s_ifmt) {
+ if (!strcmp(s_ifmt, "S_IFREG")) {
+ stbuf->st_mode = S_IFREG;
+ } else if (!strcmp(s_ifmt, "S_IFDIR")) {
+ stbuf->st_mode = S_IFDIR;
+ } else if (!strcmp(s_ifmt, "S_IFLNK")) {
+ stbuf->st_mode = S_IFLNK;
+ } else if (!strcmp(s_ifmt, "S_IFBLK")) {
+ stbuf->st_mode = S_IFBLK;
+ } else if (!strcmp(s_ifmt, "S_IFCHR")) {
+ stbuf->st_mode = S_IFCHR;
+ } else if (!strcmp(s_ifmt, "S_IFIFO")) {
+ stbuf->st_mode = S_IFIFO;
+ } else if (!strcmp(s_ifmt, "S_IFSOCK")) {
+ stbuf->st_mode = S_IFSOCK;
+ }
+ }
+ stbuf->st_nlink = plist_dict_get_uint(info, "st_nlink");
+ stbuf->st_mtime = (time_t)(plist_dict_get_uint(info, "st_mtime") / 1000000000);
#ifdef _DARWIN_FEATURE_64_BIT_INODE
- else if (!strcmp(info[i], "st_birthtime")) { /* available on iOS 7+ */
- stbuf->st_birthtime = (time_t)(atoll(info[i+1]) / 1000000000);
- }
+ /* available on iOS 7+ */
+ stbuf->st_birthtime = (time_t)(plist_dict_get_uint(info, "st_birthtime") / 1000000000);
#endif
- }
- free_dictionary(info);
+ plist_free(info);
- // set permission bits according to the file type
- if (S_ISDIR(stbuf->st_mode)) {
- stbuf->st_mode |= 0755;
- } else if (S_ISLNK(stbuf->st_mode)) {
- stbuf->st_mode |= 0777;
- } else {
- stbuf->st_mode |= 0644;
- }
+ // set permission bits according to the file type
+ if (S_ISDIR(stbuf->st_mode)) {
+ stbuf->st_mode |= 0755;
+ } else if (S_ISLNK(stbuf->st_mode)) {
+ stbuf->st_mode |= 0777;
+ } else {
+ stbuf->st_mode |= 0644;
+ }
- // and set some additional info
- stbuf->st_uid = getuid();
- stbuf->st_gid = getgid();
+ // and set some additional info
+ stbuf->st_uid = getuid();
+ stbuf->st_gid = getgid();
- stbuf->st_blksize = g_blocksize;
- }
+ stbuf->st_blksize = g_blocksize;
return res;
}
-static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi)
+static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi, enum fuse_readdir_flags flags)
{
int i;
char **dirs = NULL;
@@ -287,7 +280,7 @@ static int ifuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, of
return -ENOENT;
for (i = 0; dirs[i]; i++) {
- filler(buf, dirs[i], NULL, 0);
+ filler(buf, dirs[i], NULL, 0, 0);
}
free_dictionary(dirs);
@@ -366,7 +359,7 @@ static int ifuse_write(const char *path, const char *buf, size_t size, off_t off
return bytes;
}
-static int ifuse_utimens(const char *path, const struct timespec tv[2])
+static int ifuse_utimens(const char *path, const struct timespec tv[2], struct fuse_file_info *fi)
{
afc_client_t afc = fuse_get_context()->private_data;
uint64_t mtime = (uint64_t)tv[1].tv_sec * (uint64_t)1000000000 + (uint64_t)tv[1].tv_nsec;
@@ -398,11 +391,11 @@ static int ifuse_release(const char *path, struct fuse_file_info *fi)
return 0;
}
-void *ifuse_init(struct fuse_conn_info *conn)
+void *ifuse_init(struct fuse_conn_info *conn, struct fuse_config *cfg)
{
afc_client_t afc = NULL;
- conn->async_read = 0;
+ conn->want &= FUSE_CAP_ASYNC_READ;
if (house_arrest) {
afc_client_new_from_house_arrest_client(house_arrest, &afc);
@@ -415,16 +408,9 @@ void *ifuse_init(struct fuse_conn_info *conn)
if (afc) {
// get file system block size
- int i;
- char **info_raw = NULL;
- if ((AFC_E_SUCCESS == afc_get_device_info(afc, &info_raw)) && info_raw) {
- for (i = 0; info_raw[i]; i+=2) {
- if (!strcmp(info_raw[i], "FSBlockSize")) {
- g_blocksize = atoi(info_raw[i + 1]);
- break;
- }
- }
- free_dictionary(info_raw);
+ plist_t info = NULL;
+ if ((AFC_E_SUCCESS == afc_get_device_info_plist(afc, &info)) && info) {
+ g_blocksize = plist_dict_get_uint(info, "FSBlockSize");
}
}
@@ -447,6 +433,16 @@ int ifuse_flush(const char *path, struct fuse_file_info *fi)
return 0;
}
+int ifuse_chmod(const char *path, mode_t mode, struct fuse_file_info *fi)
+{
+ return 0;
+}
+
+int ifuse_chown(const char *file, uid_t user, gid_t group, struct fuse_file_info *fi)
+{
+ return 0;
+}
+
int ifuse_statfs(const char *path, struct statvfs *stats)
{
afc_client_t afc = fuse_get_context()->private_data;
@@ -482,7 +478,7 @@ int ifuse_statfs(const char *path, struct statvfs *stats)
return 0;
}
-int ifuse_truncate(const char *path, off_t size)
+int ifuse_truncate(const char *path, off_t size, struct fuse_file_info *fi)
{
afc_client_t afc = fuse_get_context()->private_data;
afc_error_t err = afc_truncate(afc, path, size);
@@ -493,18 +489,6 @@ int ifuse_truncate(const char *path, off_t size)
return 0;
}
-int ifuse_ftruncate(const char *path, off_t size, struct fuse_file_info *fi)
-{
- afc_client_t afc = fuse_get_context()->private_data;
-
- afc_error_t err = afc_file_truncate(afc, fi->fh, size);
- if (err != AFC_E_SUCCESS) {
- int res = get_afc_error_as_errno(err);
- return -res;
- }
- return 0;
-}
-
int ifuse_readlink(const char *path, char *linktarget, size_t buflen)
{
int i, ret;
@@ -566,7 +550,7 @@ int ifuse_unlink(const char *path)
return -get_afc_error_as_errno(err);
}
-int ifuse_rename(const char *from, const char *to)
+int ifuse_rename(const char *from, const char *to, unsigned int flags)
{
afc_client_t afc = fuse_get_context()->private_data;
@@ -599,7 +583,6 @@ static struct fuse_operations ifuse_oper = {
.read = ifuse_read,
.write = ifuse_write,
.truncate = ifuse_truncate,
- .ftruncate = ifuse_ftruncate,
.readlink = ifuse_readlink,
.symlink = ifuse_symlink,
.link = ifuse_link,
@@ -607,6 +590,8 @@ static struct fuse_operations ifuse_oper = {
.rename = ifuse_rename,
.utimens = ifuse_utimens,
.fsync = ifuse_fsync,
+ .chmod = ifuse_chmod,
+ .chown = ifuse_chown,
.release = ifuse_release,
.init = ifuse_init,
.destroy = ifuse_cleanup
@@ -820,9 +805,7 @@ int main(int argc, char *argv[])
} else {
printf("ERROR: No device found!\n");
}
- fprintf(stderr, "Is the device properly connected?\n");
- fprintf(stderr, "If it is make sure that your user has permissions to access the raw USB device.\n");
- fprintf(stderr, "If you're still having issues try unplugging the device and reconnecting it.\n");
+ fprintf(stderr, "Ensure that the device is connected and usbmuxd is properly installed.\n");
return EXIT_FAILURE;
}