@@ -1638,10 +1638,36 @@ appfs_simulate_user_fs_leave(); return(chmod_ret); } + +static int appfs_fuse_symlink(const char *oldpath, const char *newpath) { + char *real_path; + int symlink_ret; + + APPFS_DEBUG("Enter (path = %s, %s)", oldpath, newpath); + + real_path = appfs_prepare_to_create(newpath); + if (real_path == NULL) { + return(-EIO); + } + + appfs_simulate_user_fs_enter(); + + symlink_ret = symlink(oldpath, real_path); + + appfs_simulate_user_fs_leave(); + + free(real_path); + + if (symlink_ret != 0) { + return(errno * -1); + } + + return(0); +} /* * SQLite3 mode: Execute raw SQL and return success or failure */ static int appfs_sqlite3(const char *sql) { @@ -1906,10 +1932,11 @@ .truncate = appfs_fuse_truncate, .unlink = appfs_fuse_unlink_rmdir, .rmdir = appfs_fuse_unlink_rmdir, .mkdir = appfs_fuse_mkdir, .chmod = appfs_fuse_chmod, + .symlink = appfs_fuse_symlink, }; /* * FUSE option parsing callback */