Files and Storage

RSS for tag

Ask questions about file systems and block storage.

Posts under Files and Storage tag

200 Posts

Post

Replies

Boosts

Views

Activity

On File System Permissions
Modern versions of macOS use a file system permission model that’s far more complex than the traditional BSD rwx model, and this post is my attempt at explaining that model. If you have a question about this, post it here on DevForums. Put your thread in the App & System Services > Core OS topic area and tag it with Files and Storage. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" On File System Permissions Modern versions of macOS have five different file system permission mechanisms: Traditional BSD permissions Access control lists (ACLs) App Sandbox Mandatory access control (MAC) Endpoint Security (ES) The first two were introduced a long time ago and rarely trip folks up. The second two are newer, more complex, and specific to macOS, and thus are the source of some confusion. Finally, Endpoint Security allows third-party developers to deny file system operations based on their own criteria. This post offers explanations and advice about all of these mechanisms. Error Codes App Sandbox and the mandatory access control system are both implemented using macOS’s sandboxing infrastructure. When a file system operation fails, check the error to see whether it was blocked by this sandboxing infrastructure. If an operation was blocked by BSD permissions or ACLs, it fails with EACCES (Permission denied, 13). If it was blocked by something else, it’ll fail with EPERM (Operation not permitted, 1). If you’re using Foundation’s FileManager, these error are both reported as Foundation errors, for example, the NSFileReadNoPermissionError error. To recover the underlying error, get the NSUnderlyingErrorKey property from the info dictionary. App Sandbox File system access within the App Sandbox is controlled by two factors. The first is the entitlements on the main executable. There are three relevant groups of entitlements: The com.apple.security.app-sandbox entitlement enables the App Sandbox. This denies access to all file system locations except those on a built-in allowlist (things like /System) or within the app’s containers. The various “standard location” entitlements extend the sandbox to include their corresponding locations. The various “file access temporary exceptions” entitlements extend the sandbox to include the items listed in the entitlement. Collectively this is known as your static sandbox. The second factor is dynamic sandbox extensions. The system issues these extensions to your sandbox based on user behaviour. For example, if the user selects a file in the open panel, the system issues a sandbox extension to your process so that it can access that file. The type of extension is determined by the main executable’s entitlements: com.apple.security.files.user-selected.read-only results in an extension that grants read-only access. com.apple.security.files.user-selected.read-write results in an extension that grants read/write access. Note There’s currently no way to get a dynamic sandbox extension that grants executable access. For all the gory details, see this post. These dynamic sandbox extensions are tied to your process; they go away when your process terminates. To maintain persistent access to an item, use a security-scoped bookmark. See Accessing files from the macOS App Sandbox. To pass access between processes, use an implicit security scoped bookmark, that is, a bookmark that was created without an explicit security scope (no .withSecurityScope flag) and without disabling the implicit security scope (no .withoutImplicitSecurityScope flag)). If you have access to a directory — regardless of whether that’s via an entitlement or a dynamic sandbox extension — then, in general, you have access to all items in the hierarchy rooted at that directory. This does not overrule the MAC protection discussed below. For example, if the user grants you access to ~/Library, that does not give you access to ~/Library/Mail because the latter is protected by MAC. Finally, the discussion above is focused on a new sandbox, the thing you get when you launch a sandboxed app from the Finder. If a sandboxed process starts a child process, that child process inherits its sandbox from its parent. For information on what happens in that case, see the Note box in Enabling App Sandbox Inheritance. IMPORTANT The child process inherits its parent process’s sandbox regardless of whether it has the com.apple.security.inherit entitlement. That entitlement exists primarily to act as a marker for App Review. App Review requires that all main executables have the com.apple.security.app-sandbox entitlement, and that entitlements starts a new sandbox by default. Thus, any helper tool inside your app needs the com.apple.security.inherit entitlement to trigger inheritance. However, if you’re not shipping on the Mac App Store you can leave off both of these entitlement and the helper process will inherit its parent’s sandbox just fine. The same applies if you run a built-in executable, like /bin/sh, as a child process. When the App Sandbox blocks something, it might generates a sandbox violation report. For information on how to view these reports, see Discovering and diagnosing App Sandbox violations. To learn more about the App Sandbox, see the various links in App Sandbox Resources. For information about how to embed a helper tool in a sandboxed app, see Embedding a Command-Line Tool in a Sandboxed App. Mandatory Access Control Mandatory access control (MAC) has been a feature of macOS for many releases, but it’s become a lot more prominent since macOS 10.14. There are many flavours of MAC but the ones you’re most likely to encounter are: Full Disk Access (macOS 10.14 and later) Files and Folders (macOS 10.15 and later) App bundle protection (macOS 13 and later) App container protection (macOS 14 and later) App group container protection (macOS 15 and later) Data Vaults (see below) and other internal techniques used by various macOS subsystems The exact list of file system locations protected by MAC is not documented and, as illustrated by the list above, can change over time. If your process runs into a MAC check the system might prompt the user to grant the process access, or it might just fail the access. If the user grants the process access, the system might only grant that access for this specific process, or it might persist that access for the program that this process is running. The exact behaviour varies based on the specific location in the file system and can also vary between different versions of macOS. Mandatory access control, as the name suggests, is mandatory; it’s not an opt-in like the App Sandbox. Rather, all processes on the system, including those running as root, as subject to MAC. Data Vaults are not a third-party developer opportunity. See this post if you’re curious. In the Full Disk Access and Files and Folders cases, users grant a program a MAC privilege using System Settings > Privacy & Security. Some MAC privileges are per user (Files and Folders) and some are system wide (Full Disk Access). If you’re not sure, run this simple test: On a Mac with two users, log in as user A and enable the MAC privilege for a program. Now log in as user B. Does the program have the privilege? If a process tries to access an item restricted by MAC, the system may prompt the user to grant it access there and then. For example, if an app tries to access the desktop, you’ll see an alert like this: “AAA” would like to access files in your Desktop folder. [Don’t Allow] [OK] To customise this message, set Files and Folders properties in your Info.plist. This system only displays this alert once. It remembers the user’s initial choice and returns the same result thereafter. This relies on your code having a stable code signing identity. If your code is unsigned, or signed ad hoc (Signed to Run Locally in Xcode parlance), the system can’t tell that version N+1 of your code is the same as version N, and thus you’ll encounter excessive prompts. Note For information about how that works, see TN3127 Inside Code Signing: Requirements. The Files and Folders prompts only show up if the process is running in a GUI login session. If not, the operation is allowed or denied based on existing information. If there’s no existing information, the operation is denied by default. For more information about app and app group container protection, see the links in Trusted Execution Resources. For more information about app groups in general, see App Groups: macOS vs iOS: Working Towards Harmony On managed systems the site admin can use the com.apple.TCC.configuration-profile-policy payload to assign MAC privileges. For testing purposes you can reset parts of TCC using the tccutil command-line tool. For general information about that tool, see its man page. For a list of TCC service names, see the posts on this thread. Note TCC stands for transparency, consent, and control. It’s the subsystem within macOS that manages most of the privileges visible in System Settings > Privacy & Security. TCC has no API surface, but you see its name in various places, including the above-mentioned configuration profile payload and command-line tool, and the name of its accompanying daemon, tccd. While tccutil is an easy way to do basic TCC testing, the most reliable way to test TCC is in a VM, restoring to a fresh snapshot between each test. If you want to try this out, crib ideas from Testing a Notarised Product. The MAC privilege mechanism is heavily dependent on the concept of responsible code. For example, if an app contains a helper tool and the helper tool triggers a MAC prompt, we want: The app’s name and usage description to appear in the alert. The user’s decision to be recorded for the whole app, not that specific helper tool. That decision to show up in System Settings under the app’s name. For this to work the system must be able to tell that the app is the responsible code for the helper tool. The system has various heuristics to determine this and it works reasonably well in most cases. However, it’s possible to break this link. I haven’t fully research this but my experience is that this most often breaks when the child process does something ‘odd’ to break the link, such as trying to daemonise itself. If you’re building a launchd daemon or agent and you find that it’s not correctly attributed to your app, add the AssociatedBundleIdentifiers property to your launchd property list. See the launchd.plist man page for the details. Scripting MAC presents some serious challenges for scripting because scripts are run by interpreters and the system can’t distinguish file system operations done by the interpreter from those done by the script. For example, if you have a script that needs to manipulate files on your desktop, you wouldn’t want to give the interpreter that privilege because then any script could do that. The easiest solution to this problem is to package your script as a standalone program that MAC can use for its tracking. This may be easy or hard depending on the specific scripting environment. For example, AppleScript makes it easy to export a script as a signed app, but that’s not true for shell scripts. TCC and Main Executables TCC expects its bundled clients — apps, app extensions, and so on — to use a native main executable. That is, it expects the CFBundleExecutable property to be the name of a Mach-O executable. If your product uses a script as its main executable, you’re likely to encounter TCC problems. To resolve these, switch to using a Mach-O executable. For an example of how you might do that, see this post. Endpoint Security Endpoint Security (ES) is a general mechanism for third-party products to enforce custom security policies on the Mac. An ES client asks ES to send it events when specific security-relevant operations occur. These events can be notifications or authorisations. In the case of authorisation events, the ES client must either allow or deny the operation. As you might imagine, the set of security-relevant operations includes file system operations. For example, when you open a file using the open system call, ES delivers the ES_EVENT_TYPE_AUTH_OPEN event to any interested ES clients. If one of those ES client denies the operation, the open system call fails with EPERM. For more information about ES, see the Endpoint Security framework documentation. Originally ES clients operated system wide. macOS 27 introduced a new mechanism, es_new_descendants_client, that allows an ES client to operate on the process hierarchy rooted at the client itself. Revision History 2026-09-18 Extended the Endpoint Security section to discuss es_new_descendants_client. Clarified the scope of MAC. 2025-11-04 Added a discussion of Endpoint Security. Made numerous minor editorial changes. 2024-11-08 Added info about app group container protection. Clarified that Data Vaults are just one example of the techniques used internally by macOS. Made other editorial changes. 2023-06-13 Replaced two obsolete links with links to shiny new official documentation: Accessing files from the macOS App Sandbox and Discovering and diagnosing App Sandbox violations. Added a short discussion of app container protection and a link to WWDC 2023 Session 10053 What’s new in privacy. 2023-04-07 Added a link to my post about executable permissions. Fixed a broken link. 2023-02-10 In TCC and Main Executables, added a link to my native trampoline code. Introduced the concept of an implicit security scoped bookmark. Introduced AssociatedBundleIdentifiers. Made other minor editorial changes. 2022-04-26 Added an explanation of the TCC initialism. Added a link to Viewing Sandbox Violation Reports.  Added the TCC and Main Executables section. Made significant editorial changes. 2022-01-10 Added a discussion of the file system hierarchy. 2021-04-26 First posted.
0
0
15k
Sep ’26
Files and Storage Resources
General: Forums subtopic: App & System Services > Core OS Forums tags: Files and Storage, Foundation, FSKit, File Provider, Finder Sync, Disk Arbitration, APFS Foundation > Files and Data Persistence documentation Low-level file system APIs are documented in UNIX manual pages File System Programming Guide archived documentation About Apple File System documentation Apple File System Guide archived documentation File system changes introduced in iOS 17 forums post On File System Permissions forums post Extended Attributes and Zip Archives forums post Unpacking Apple Archives forums post Creating new file systems: FSKit framework documentation Building a passthrough file system sample code File Provider framework documentation Finder Sync framework documentation App Extension Programming Guide > App Extension Types > Finder Sync archived documentation Managing storage: Disk Arbitration framework documentation Disk Arbitration Programming Guide archived documentation Mass Storage Device Driver Programming Guide archived documentation Device File Access Guide for Storage Devices archived documentation BlockStorageDeviceDriverKit framework documentation Volume format references: Apple File System Reference TN1150 HFS Plus Volume Format Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
3.2k
Feb ’26
Can an iOS Custom Keyboard Legally Launch Its Containing App for a User-Initiated Speech Recording?
I’m developing an iOS application with a custom keyboard extension and a companion app. Our intended user experience: The user is typing in an app such as WhatsApp using our custom keyboard. They tap the Speech button. Our companion app opens automatically. The companion app establishes a microphone session. iOS returns the user to the original host app. The user continues dictating through the keyboard. What we have already implemented: A Swift-based custom keyboard and companion app. App Groups and Darwin notifications for communication between the two targets. Microphone recording through the companion app. Apple Speech Recognition with on-device recognition. A warm background audio session. Subsequent recordings and text insertion work on a physical iPhone once the warm session is established. Our current blocker: The keyboard extension cannot successfully open its companion app when the warm session is inactive. We previously tried NSExtensionContext.open(), but it did not work. We want to avoid private APIs, responder-chain workarounds, and anything that could violate App Store Review Guidelines. My questions: Does Apple provide any officially supported public API that allows a custom keyboard extension to launch its containing app in response to an explicit user tap? Can App Intents or ForegroundContinuableIntent legitimately achieve this from a keyboard extension? Does App Review Guideline 4.4.1 prohibit this particular user-initiated handoff? If direct launching is prohibited, what Apple-supported architecture or interaction pattern would you recommend for this use case? Is there a supported way for the companion app to return the user to the original host app after establishing the microphone session? We are looking for guidance based on actual iOS platform restrictions and supported APIs, preferably from developers who have shipped custom keyboard applications. Thank you.
1
0
45
2d
Can a restore replace a file in an App Group container while the app's process is alive?
For an iOS app that stores a SQLite database in its App Group container and has no extension targets, can iCloud restore, Finder or Apple Devices restore, or Quick Start replace a file in that container while the app's normal process remains alive, including while suspended? If iOS terminates the process first, can the app relaunch before all App Group files have finished restoring? Please identify any differences between these restore paths and any documented guarantee. Related: thread 845479 gave the general rule for the app's own container.
3
0
127
2d
Full Disk Access on macOS 27.3
I'm looking into the changes being implemented and I find this way of handling by Apple on short notice problematic. Now our customers (those that don't have MDM) will have to jump through hoops to enable FDA for our product, a security product that also uses Endpoint Security. We already have the entitlement for endpoint security, which requires FDA in order to work, so why make it so difficult instead of just allowing FDA for apps that have this entitlement? Why only backup applications are exempted?
2
0
130
3d
Access to related files outside Sandbox with NSFileCoordinator and NSFilePresenter does not work anymore in macOS 27.3 beta 2
In macOS 27.3 beta 2, it is no longer possible to use NSFileCoordinator with NSFilePresenter instances to open a SQLite file with related WAL and SHM files when a sandboxed app has access to the primary SQLite file. In macOS 27.3 beta 1 and previous macOS releases, the Related File Access API works as expected. This happens regardless where the files are located, so it seems to be unrelated to recent changes in Privacy & Security, although it could be an unexpected side effect of these changes. Instead of correctly registering NSFilePresenter instances, errors like the following are logged in the XCode console: NSFileSandboxingRequestRelatedItemExtension: Failed to issue extension for /Users/testuser/Desktop/Sample/Example.sqlite-wal because: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (The related item is protected by a different storage class than the primary item) UserInfo={NSDebugDescription=The related item is protected by a different storage class than the primary item} +[NSFileCoordinator addFilePresenter:] could not get a sandbox extension. primaryPresentedItemURL: file:///Users/testuser/Desktop/Sample/Example.sqlite, presentedItemURL: file:///Users/testuser/Desktop/Sample/Example.sqlite-walThe mentioned Related File Access API is documented here. I have filed a Feedback, which includes a sample project: FB25625743 My question is: Is this a bug, or new intended behavior, or is there something else changed that should be dealed with when using this API in macOS 27.3 beta 2?
1
0
70
3d
Subject: Critical APFS Data Loss Bug & Error 1110 Loop during official Finder Update on iPhone 14 (A15)
Hello, I am requesting an engineering escalation regarding a critical bug in Apple's APFS update pipeline that trapped an iPhone 14 (A15, 128 GB) in recovery mode during an official Finder update from iOS 16.6 to iOS 18 (27.2.1, 24B156) on macOS 14.5. The device hardware is 100% healthy (Apple MRI diagnostics all green), the passcode is known, and 101,175 MB (341,967 files) of user data remain intact on the flash storage. However, the device cannot boot or complete an update due to a corruption caused by Apple's own restore tools. --- ### What Happened (Verified in Logs): 1. **Initial Full Storage State:** The device had ~105 GB utilized and was updated via Finder using "Update" (not Restore). 2. **Destructive fsck Behavior:** In pass 3, the restore ramdisk ran `/sbin/fsck_apfs -dy /dev/disk2`. On the nearly full container, fsck erroneously flagged 8,182 live omap mappings as "orphans" and deallocated them, causing extent-ref b-tree node `0x10bb3` to be zeroed out (TRIMmed by the flash controller). 3. **Split Failure:** In pass 4, the iOS 18 System volume installed and sealed, but `split_data_volume` failed in 4 seconds when `apfs_migrator` encountered block `0x10bb3` (`obj_read` checksum failure returning EILSEQ / error 92). 4. **False Error 1110 Loop:** Every subsequent attempt now halts immediately at `space_checks` with Error 1110. --- ### Reverse Engineering Proof: Disassembly of `restored_update` (arm64e, VA 0x10001afcc / 0x10001b0e8) confirms a major error-handling bug: When `splitter_dump` encounters the unreadable block `0x10bb3`, it fails with `EILSEQ` (92). Instead of handling this error, `restored_update` executes: `mov x19, #-1; mov x0, x19; ret` The caller receives `-1 bytes of free space`, logs: "Data volume requires splitting. Splitter will leave -1 bytes of free space after completion. Current free space on device: 6620069888 bytes. Insufficient space on device to run splitter" and aborts with **CHECKPOINT FAILURE:(FAILURE:1110)**. The device is NOT out of space (it has 6.3 GB free); it is blocked solely because `restored_update` misinterprets an EILSEQ filesystem error as negative free space. --- ### Current State & Request: - The encryption keys and SEP/gigalocker are intact (`gigalocker: ONLINE`). - In the restore ramdisk, `/dev/disk2s2` mounts cleanly as read-write on `/mnt2`. - Zero APFS snapshots remain on the volume, meaning the extent-ref tree is theoretically fully reconstructible from the valid fsroot inode tree. I am requesting assistance from CoreOS / APFS engineering: 1. Is there an engineering update ramdisk or build that can bypass the `splitter_dump` EILSEQ check, or rebuild the extent-ref tree, so the update can finalize? 2. Alternatively, can an engineering liaison facilitate a non-destructive extraction given that the volume mounts read-write and the user passcode is known? I can immediately provide full terminal transcripts, Finder updater logs (`iPhoneUpdater-*.log`), and disassembly details. Thank you, Samuel Journo
1
0
106
3d
macOS APFS: com.apple.macl and UF_TRACKED appear after creating a hard link — safe file replacement and rollback?
I'm investigating an unexpected metadata change during a controlled file deployment on macOS. Environment and observed state Two regular configuration files are used by a local service. Before replacement, the first file had: SHA-256: verified. File flags: 0. Extended attributes: none. Hard-link count: 1. Owner/group: 501/20. Permissions: 0644. ACL: empty. A backup procedure created a hard link to preserve the original inode before replacing the active pathname with an independently created file. Immediately after creating and verifying the hard link, the original file was observed with: The same SHA-256 and inode. Flags: 64 (UF_TRACKED). Extended attribute: com.apple.macl. Hard-link count: 2. No file content was replaced. The procedure stopped because the metadata no longer matched the original baseline. Additional observations Other backup methods also encountered unexpected metadata changes during destination creation. Tests using renamex_np with RENAME_SWAP successfully exchanged and restored artificial files with flags 0 and empty extended attributes. A test with artificial files already containing com.apple.provenance also succeeded. We could not reproduce the specific UF_TRACKED + com.apple.macl + two-hard-link state in an isolated fixture using ordinary documented operations. The operational original and its second hard link currently share the same inode. No attempt has been made to remove the protected attribute or change its flags. Questions for Apple filesystem/security specialists Under what documented circumstances can creating a hard link or related Finder/TCC document-tracking behavior cause UF_TRACKED and com.apple.macl to appear on an existing file? Are these metadata changes expected for a file accessed through a user-authorized Documents location? What supported mechanism can preserve the current original inode and provide a verifiable rollback when replacing its active pathname? Is renamex_np(..., RENAME_SWAP) appropriate for this situation, and what special considerations apply to the existing second hard link and protected extended attributes? What verification criteria would you recommend before permitting a production replacement? I am looking for a documented, reversible procedure that preserves macOS security protections. I do not want to disable SIP, forcibly remove com.apple.macl, or bypass TCC. I can provide sanitized metadata comparisons and a minimal reproduction if needed.
1
0
153
3d
macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Subject: Supported fail-closed ACL absence verification on macOS 27.0.1 / APFS Environment: macOS 27.0.1, build 26A434; APFS; installed macOS 27.0 SDK. We need a supported, documented way to determine whether an existing filesystem object has no effective ACL entries, while rejecting genuine retrieval failures and unsupported or unavailable ACL evidence. We are seeking clarification of the public interface contract, not alleging an Apple defect. For existing directory and regular-file fixtures, pathname metadata and descriptor metadata identify the same object. Errno is cleared immediately before each native call and captured immediately afterward. ACL retrieval uses ACL_TYPE_EXTENDED: acl_get_file(path, ACL_TYPE_EXTENDED) acl_get_fd_np(fd, ACL_TYPE_EXTENDED) On fresh objects, both return NULL with ENOENT. Explicit one-entry fixture ACLs are retrieved successfully. Explicit zero-entry fixture ACLs can also yield NULL/ENOENT, while attribute queries return a serialized zero-entry ACL. The attribute queries use getattrlist() and descriptor-bound fgetattrlist(), requesting ATTR_CMN_RETURNED_ATTRS | ATTR_CMN_EXTENDED_SECURITY, with FSOPT_NOFOLLOW | FSOPT_REPORT_FULLSIZE and WITHOUT FSOPT_PACK_INVAL_ATTRS. Buffer lengths, variable-reference bounds and returned-attribute validity are checked. For the existing directories of interest, both calls succeed but omit the ATTR_CMN_EXTENDED_SECURITY returned bit. Explicit populated and zero-entry fixture records do set the bit. APFS reports valid VOL_CAP_INT_EXTENDED_SECURITY support; we do not assume that volume capability proves per-object ACL availability. On macOS 27.0.1, build 26A434, using APFS, which supported interface and documented conditions allow software to distinguish an absent ACL from unavailable or unsupported ACL evidence when descriptor-bound attribute queries succeed but omit ATTR_CMN_EXTENDED_SECURITY and native ACL getters return ENOENT for an existing object? Please clarify: Whether ENOENT has a supported ACL-absence interpretation, and under exactly which checked conditions. Whether an omitted extended-security attribute can establish ACL absence, rather than unavailable or unsupported evidence. How explicit zero-entry ACLs differ from absent ACL records through supported interfaces. How KAUTH_FILESEC_NOACL should be interpreted through supported APIs. How genuine retrieval failures, including permission, I/O, allocation and unsupported-operation errors, must remain distinguishable. Whether a supported descriptor-bound verification method exists that preserves fail-closed security checks and object identity binding; please identify its guarantees and limitations regarding pathname/ancestor changes and later operations. Whether relevant behavior is specific to this macOS/APFS version. Please identify the applicable public documentation or supported verification sequence. We do not want to modify permissions, synthesize ACLs on target objects, treat invalid-attribute defaults as real evidence, or accept ambiguous omission/ENOENT as success. Existing ownership, mode and confinement checks must remain separate mandatory checks. If no public API can make this distinction reliably, please state that limitation.
15
0
582
3d
Supported quarantine preservation when copying files from an App Sandbox process
What supported public API and verification contract should a sandboxed macOS file manager use to preserve a copied file's quarantine/provenance metadata? We observe different results in App Sandbox versus Finder and an otherwise-matched non-sandbox diagnostic. We want to keep App Sandbox and all security protections enabled, not remove quarantine or invent undocumented flag masks. Environment: macOS 26.6.2 (25G83), Apple Silicon, local APFS. Optimized Foundation-only diagnostic, Apple Development signing, Hardened Runtime, launched directly as an executable. The sandbox variant has app-sandbox, user-selected read/write and app-scope bookmark entitlements. This is not a notarized distribution-build comparison. Reproduction: Use an existing regular JPEG with naturally present com.apple.quarantine metadata identifying Chrome, raw flags 0283 and a nonempty event field. Keep the original read-only. Record SHA-256, length, full raw extended attributes and fresh NSURL quarantinePropertiesKey observations. Keep access to a user-granted local test directory active. Copy to a new, absent destination in a fresh directory using each of these three arms: fclonefileat with CLONE_ACL | CLONE_NOFOLLOW_ANY | CLONE_RESOLVE_BENEATH (28). copyfile with COPYFILE_CLONE | COPYFILE_ACL; record COPYFILE_STATE_WAS_CLONED. FileManager.copyItem(at:to:). Observe source and destination without setting, removing or repairing metadata. Each arm waits at least 1.1 seconds before copying; the source quarantine timestamp is much older than call time. Repeat with fresh destinations. Also copy the same source through actual Finder Copy/Paste twice. Compare two signed variants made from the same compiled payload, with identical executable name, bundle ID, Development identity and Hardened Runtime. The only signed entitlement difference is app-sandbox=true versus its omission. The sandbox variant resolves the existing exact folder grant; the non-sandbox diagnostic uses that same fixed test directory directly. Results: Sandbox diagnostic: all six calls succeed and data hashes/lengths match. All six outputs change raw flags 0283 to 0082, agent Chrome to the diagnostic app, event field nonempty to empty, and timestamp. Public output lacks the source event identifier and adds LSQuarantineTypeSandboxed. Matched non-sandbox diagnostic: all six copies preserve the full observed raw quarantine record and public quarantine dictionary. copyfile reports WAS_CLONED=true in both contexts. Finder: both copies preserve the full observed raw quarantine record and public dictionary. Source bytes and declared preserved metadata remain unchanged. Other compared raw attributes, mode, flags, birth/modification times, owner/group and ACL match in these cases. We also reproduced timestamp-only differences with files naturally quarantined by the diagnostic itself. The foreign-agent control above shows that the difference is not limited to timestamp. The chosen source exposes no public origin/data URL, so their preservation is untested. We have not traced the responsible internal component, tested Gatekeeper effects, or established whether the transformation is security-equivalent. We do not claim the three APIs use independent implementations or that all possible public API combinations have been tested. Could you clarify: Is this transformation expected for copying from an App Sandbox process, or should we file it as a bug? What documented preservation behavior should a sandboxed file manager rely on? Is there a supported API or operation that preserves the source's quarantine/provenance metadata in this context without disabling App Sandbox or weakening security protections? If exact raw equality is intentionally not guaranteed, which supported public properties or behaviors should verification check? Is a quarantine-properties dictionary round-trip supported, and what information does it preserve or omit? We have not attempted a metadata repair. Separately, a pathname-based repair after cloning would require its own destination-identity/race safety review because the clone call does not return a creation-bound destination descriptor. We are asking for supported API semantics, not private implementation details or a security bypass. We can prepare a minimal sanitized standalone reproducer if needed. No user files, sandbox grants, private logs or diagnostic binaries are attached to this initial question.
5
0
634
4d
Removing File Provider domains when a Mac App Store app is deleted
My Mac App Store apps use NSFileProviderReplicatedExtension, and users keep asking how to remove the folder in ~/Library/CloudStorage after deleting the app. Deleting the app leaves the domain registered and the folder in place. fileproviderctl dump shows the domain as "extension not found", and on my own Mac one such domain had survived for five months. As far as I can tell there is no supported way for the developer to clean this up: A sandboxed Mac App Store app cannot run code when it is deleted. NSFileProviderManager.remove(_:mode:) and removeAllDomains only work while the app is installed. fileproviderctl has no command to remove a domain. invalidate() is called when the extension is turned off in System Settings, but also on routine teardown, so it cannot drive cleanup. The one way out I have found is manual. Open the leftover folder in Finder, which says "The application "X" could not be found", and click Delete "X"… in the upper right corner. That removes both the domain and the folder, but users rarely find it on their own. Is there a mechanism I have missed, such as an Info.plist key or a system behavior, that removes a deleted app's domains automatically? If not, the best I can do seems to be an in-app "Remove from Finder" command that users have to run before deleting the app. I have filed FB25610224 asking for the system to remove a deleted app's domains, keeping unsynced changes the way .preserveDirtyUserData does.
1
0
75
4d
BlockStorageDeviceDriverKit grant confirmed by support but shows "No Requests" in the portal. How to resolve?
Hello! I am hoping a DTS engineer or someone who knows the Capability Requests portal can help, because I am stuck between a written support confirmation and what the portal actually shows. Background. We are building a native macOS iSCSI initiator for SOHO and home NAS use, developed over close to two years. A userspace daemon runs the iSCSI protocol and a DriverKit system extension presents the remote LUN as a block device. The code is essentially complete. Only the DriverKit extension cannot be signed, loaded and validated without the entitlement. We submitted request 32PC8MGU57 for two entitlements: com.apple.developer.driverkit.family.block-storage-device for the extension com.aviontex.iscsi.AviontexISCSI.AviontexInitiator com.apple.developer.driverkit.userclient-access for the app com.aviontex.iscsi.AviontexISCSI, scoped to the extension bundle id The problem. On June 25 Developer Support confirmed in writing that both entitlements were granted. The portal does not match that: Block Storage Device: No Requests: on both App IDs UserClient Access: Assigned: on the app SCSI Controller: Submitted: on the app So the one entitlement we actually need, Block Storage Device, shows as never requested, even though request 32PC8MGU57 covered it and support confirmed the grant. The case was escalated to the senior team on July 2 (case 102922935570). Follow-up emails since then have not received a response. Why Block Storage Device specifically Our initiator has no PCI or Thunderbolt bus and no DMA path, so SCSIControllerDriverKit does not fit. This is confirmed by DTS in thread 776020, where Kevin Elliott explains that SCSIControllerDriverKit passes data through fBufferIOVMAddr as a physical address with no mechanism to convert it into a VM address the dext can access. He also notes it cannot be used with any bus other than PCI or Thunderbolt. Block Storage Device is therefore the family we need. My questions: Am I reading the portal correctly: Block Storage Device not requested, UserClient Access assigned, SCSI Controller submitted? From here, what is the correct way to get Block Storage Device onto these two App IDs, with both the Development and the Distribution grant, since our public beta depends on Distribution? Should I submit a new request through the Capability Requests tab or does the escalated case handle it? Is there any way to get visibility on the escalated case, since email follow-ups are not being answered? A full technical justification is prepared and we are happy to share the source code. Any guidance would be appreciated. Thank you.
74
4
18k
5d
Foundation reports false for encryption on two encrypted external APFS volumes
We request clarification of a Foundation API discrepancy from existing read-only diagnostics. Environment: the user has personally run sw_vers on the currently running Mac and confirmed ProductName: macOS; ProductVersion: 27.0.1; BuildVersion: 26A434. This is the currently confirmed system version. The reviewed records do not establish an unambiguous temporal link between that confirmation and the APFS/Foundation measurements on 15 November 2026; we therefore do not assert that it proves the OS version used for those measurements. Earlier macOS 26.6.2 (25G83) records are historical and are not presented as the current system. Observed volumes: External APFS Volume A and External APFS Volume B, both external APFS volumes connected over USB. For BOTH volumes, the recorded diskutil results are: Encryption=true; EncryptionThisVolumeProper=true; CryptoMigrationOn=false; GlobalPermissionsEnabled=true. Both were mounted and unlocked after completed in-place APFS encryption. For BOTH volumes, direct Foundation queries at the volume root return: NSURLVolumeUUIDStringKey: the correct UUID for the respective volume (omitted here for privacy); NSURLVolumeURLKey: the same volume-root URL as queried; NSURLVolumeIsEncryptedKey: present, explicit false (__NSCFBoolean, description 0). The canonical mount path and diskutil volume identity match. This is not an inquiry against a parent volume, a missing key converted to false, or an inferred mapping based only on a display name. Minimal read-only observation procedure, describing the existing successful queries (not rerun for this request): Select the already mounted APFS volume root and verify its UUID against diskutil. Construct a fresh NSURL using fileURLWithPath for that root. Query resourceValuesForKeys:error: for NSURLVolumeUUIDStringKey, NSURLVolumeURLKey and NSURLVolumeIsEncryptedKey. Compare the returned UUID/root URL and explicit encryption Boolean with the recorded diskutil fields. The successful queries used Foundation through JavaScript for Automation's Objective-C bridge, in separate helper processes. An equivalent full Swift application runtime result has not been established. A separate failed JXA enumeration attempt is excluded from the evidence. We understand URL resource values may be cached; caching has not been established as the cause. Expected: an encryption indication consistent with the completed APFS encryption, or documented semantics explaining why these indicators differ. Actual: explicit false on both volumes. Questions: Are there documented limitations or known issues for this property on external, mounted and unlocked APFS volumes encrypted in place? What does false mean when the recorded diskutil encryption fields are positive? Is any additional read-only evidence necessary to interpret it? Which supported public read-only API and validation procedure should an application use to establish completed APFS volume encryption without weakening its policy? Could the observed behavior be affected by accessing NSURL resource values through the JavaScript for Automation Objective-C bridge rather than directly from a native Swift application? We are requesting interpretation of existing evidence. No further encryption, lock/unlock experiment, drive modification or application build was performed for this inquiry. No credentials, private paths or customer data are included. Thank you.
1
0
141
6d
Supported App Sandbox metadata access through an inherited file descriptor, without reopening the object
We are evaluating a macOS design before implementation. This is a platform-support question, not a report of an observed runtime failure. No actual controller executable, helper executable or deployment configuration has been selected or qualified. Our objective is to let a small, fixed-purpose helper examine an already-open object’s identity and access control list (ACL) metadata while preserving the original object reference and ownership. Proposed configuration A trusted controller would launch one native C helper using an explicit executable target and posix_spawn. The controller would need to qualify for the documented nonsandboxed-parent case, without a conflicting inherited sandbox. We do not assume that an absent entitlement alone establishes this. The helper would be the main executable of its own signed application bundle, using its own ordinary App Sandbox rather than inheriting the controller’s sandbox. Its proposed additional filesystem permission would be com.apple.security.temporary-exception.files.absolute-path.read-only, containing exactly two fixed directory entries beneath a user’s development workspace, outside the helper’s container. The literal private paths are omitted. The controller would already own a read-only file descriptor for one regular file or directory within those trees. It would retain its original reference and pass a known duplicate referring to the same open object to the helper. The helper would perform one metadata observation. The proposed operations are fstat for object identity and fgetattrlist requesting ATTR_CMN_RETURNED_ATTRS and ATTR_CMN_EXTENDED_SECURITY, with FSOPT_REPORT_FULLSIZE and without FSOPT_PACK_INVAL_ATTRS. Required boundaries The helper must use only the inherited descriptor for the subject observation. The design does not permit: Reopening or resolving the subject through a pathname, bookmark or URL. Substituting a copied file or another object reference. Reading file contents, enumerating directories, changing permissions, or modifying shared descriptor flags or file offsets. Expanding the exception to an ancestor, home directory or broader workspace. Disabling an existing sandbox or using private interfaces to bypass restrictions. Parent-side traversal and identity checks remain separate responsibilities. Strict ancestor directories are not additional helper ACL subjects. We understand that a read-only directory exception and ordinary sandbox/container capabilities may permit more than the helper’s intended metadata operations. Metadata-only behaviour would be a reviewed-code obligation; we are not asking App Sandbox to enforce an exact metadata-only operation filter. Questions Supported launch and activation: Under what documented parent-context, signing, bundle, container and launch conditions can this helper establish its own ordinary App Sandbox? What supported mechanism or guarantee establishes that the sandbox is effective before the subject metadata operation? Required metadata permissions: Does the proposed read-only exception support fstat and the specified extended-security fgetattrlist request through an inherited read-only descriptor, for both regular files and directories? Please distinguish descriptor survival from permission to perform these operations, including any additional access-control conditions. Scope, identity and lifetime: What documented behaviour applies to descendant coverage, aliases, hard links, renames or namespace changes after the descriptor was opened? Please distinguish the lifetime of the inherited object reference from the lifetime of the static directory permission. Our design would refuse uncertainty rather than reopen, rebind or widen access. Evidence and support boundary: Which public documentation, interfaces or authoritative guarantees support this exact composition, and which parts require separate empirical qualification? Please identify applicable macOS versions and restrictions. Distinguish platform support from any distribution or App Store review requirements. If these requirements cannot be combined through supported interfaces, please identify the incompatible requirement. An approach requiring broader access, pathname reopening, a replacement object or a different handoff architecture would be a design change requiring separate review, not a solution within the stated constraints. Permission failures, unsupported requests and incomplete metadata would remain unavailable results. They would not be interpreted as proof that an ACL is absent. Complete ACL-absence interpretation and native resource bounds remain separate qualification questions. Apple material already reviewed Resolving App Sandbox Inheritance Problems App Sandbox Temporary Exception Entitlements Accessing files from the macOS App Sandbox
1
0
246
6d
macOS 26.x App Sandbox: supported disk-image attachment and descriptor-based unmount
On macOS 26.x, is there a public, supported way for an App Sandbox application with com.apple.security.virtualization to attach a new disk-image file held in its own container and mount its APFS filesystem within that container, without root, privileged or unsandboxed helpers, private/temporary exception entitlements, Full Disk Access, or weakening App Sandbox? We distinguish attaching the image from mounting an already attached virtual device. DTS threads 655767, 780965 and 775835 discuss these separately. Which supported API or tool and entitlements apply on 26.x, if such a path exists? If attachment is supported, what ownership and sandbox checks apply to a later normal funmount(fd, 0) using an O_EVTONLY descriptor for that exact mount's root? Is this combination supported, including when another actor has already unmounted it? If not, what supported alternative preserves the same restricted profile and avoids force or whole-disk unmount?
0
0
95
6d
Supported vnode metadata access after same-UID libproc queries return EPERM
We need a documented interface/access contract for a test supervisor that requires a bounded, process-birth-bound census of every process with its effective UID and every current vnode descriptor of those processes. Coverage includes ambient same-UID processes and descriptors opened before observation starts. The census needs vnode identity, type, ownership, mode, link count and open flags. Unavailable metadata is a refusal; we cannot treat EPERM as absence or exempt a process or descriptor. This is a cooperative same-user lifetime-containment check. We do not require file contents or an atomic global snapshot. Environment of the retained observation: Apple Silicon, macOS 27.3 (26C5035r), Darwin 27.3.0; Xcode 27.0 (27A5194q), macOS 27.0 SDK. The subject was the system LaunchServices process /usr/libexec/lsd. Caller real/effective UID matched the subject's UID/RUID/SVUID. Before/after process identity, version, start time, credentials and executable-path samples matched. PROC_PIDLISTFDS returned 32 bytes and listed FD 3 as PROX_FDTYPE_VNODE. The following call shape returned 0 bytes with errno == EPERM (1), with 176 bytes expected in that environment: struct vnode_fdinfo info = {0}; errno = 0; int count = proc_pidfdinfo(pid, fd, PROC_PIDFDVNODEINFO, &info, sizeof(info)); int saved_errno = errno;Errno was cleared before and saved immediately after the call. Credentials were not modified. The matching process bracket does not establish an FD-to-path association or a specific protection category. In particular, we have not established a Data Vault subtype. Questions: Is there a supported public interface or provisionable entitlement that supplies the required metadata for every current same-UID vnode descriptor, including descriptors whose metadata is protected internally by macOS? If Endpoint Security is the supported route, which documented API supplies a complete current FD inventory and vnode mapping, including already-open descriptors and ambient same-UID processes? A solution limited to descendants of the client does not cover this requirement. If supported interfaces cannot guarantee that coverage, could you clarify the limitation? Is there a supported diagnostic that identifies the protection category responsible for this metadata denial without inspecting private policy state? I have considered the "On File System Permissions" guidance, including its mandatory-access-control and Endpoint Security discussion: https://developer.apple.com/forums/thread/678819 This post describes a retained observation, not a new reproduction or qualification result. All retained results remain UNPROVED. A focused SDK/libproc Xcode example was previously built for arm64 and x86_64 but was not run; it illustrates the call sequence and a BSD start/credential bracket, not complete kernel birth binding or the required census. It does not guarantee reproduction on another system. The sanitized supporting record and example are already attached to the private DTS request that directed me to the forums. Please advise the supported interface/access contract, or its limitation, and any further diagnostic scope needed.
1
0
109
1w
Sandboxed app can't delete AppleDouble (._) files of quarantined files on exFAT, even with user-selected access.
My Mac App Store utility removes Mac metadata files (._* AppleDouble files and .DS_Store) from external drives formatted exFAT or FAT32. The app is sandboxed with com.apple.security.files.user-selected.read-write and com.apple.security.files.bookmarks.app-scope. The user grants access to the volume through NSOpenPanel. Deleting a ._ file works, except when its companion file carries com.apple.quarantine (for example, a file downloaded with Safari and copied to the drive with Finder). Then: let partner = volume + "/Nirvana.zip" // has com.apple.quarantine let appleDouble = volume + "/._Nirvana.zip" removexattr(partner, "com.apple.quarantine", XATTR_NOFOLLOW) // -1, errno 1 (EPERM) unlink(appleDouble) // -1, errno 1 (EPERM)The same unlink succeeds from Terminal (not sandboxed, without Full Disk Access). On exFAT the extended attributes live in the ._ file, so I assume the sandbox refuses because deleting it would remove the quarantine attribute. Tried, with no change: Full Disk Access granted to the app. Adding com.apple.security.files.user-selected.executable (verified in the built app with codesign -d --entitlements -). On a real drive (a music library), about 71% of the ._ files belong to quarantined files, so this is most of what users want removed. Is there a supported way for a sandboxed app to remove these files: an entitlement, an API, or an explicit user action? If not, can you confirm it's intended behavior, so I can explain it accurately to users? macOS 27.2, Xcode 27.2, Apple silicon. Focused sample project available (one source file). DTS case 23240704.
5
0
174
1w
Supported read/write handoff of a sandbox-container PNG to Preview using NSWorkspace
Hello, I am preparing an existing macOS screenshot utility for distribution through the Mac App Store. The app stores captured PNG files under its temporary directory: FileManager.default.temporaryDirectory .appendingPathComponent("ShelfDragPoC/Captures", isDirectory: true) A context-menu "Edit" action passes the original PNG URL to Preview using NSWorkspace. The app does not create an editing copy. Relevant code: import AppKit @MainActor func openInPreview(_ url: URL) { guard let previewURL = NSWorkspace.shared.urlForApplication( withBundleIdentifier: "com.apple.Preview" ) else { return } let configuration = NSWorkspace.OpenConfiguration() configuration.activates = true NSWorkspace.shared.open( [url], withApplicationAt: previewURL, configuration: configuration ) { _, _ in } } The app monitors the original PNG URL for file changes and refreshes its thumbnail when changes are detected. Observed behavior: In the existing non-sandboxed app, rotating an image in Preview updates the original PNG and the thumbnail without requiring Command-S. In the sandboxed validation app, Preview opens the image, but editing results in a separate copy. When closing the edited document, Preview displays a message indicating that the original document will not be changed. The original PNG and the app's thumbnail are not updated. The Preview launch code and file watcher are unchanged between the non-sandboxed and sandboxed versions. The sandboxed app has these entitlements: com.apple.security.app-sandbox com.apple.security.files.user-selected.read-write com.apple.security.files.bookmarks.app-scope The app-scoped bookmark is used for a separate Desktop export feature. The PNG opened in Preview remains in the app's sandbox container. My question: Is there a supported public API that allows a sandboxed Mac App Store app to open its own container-resident PNG in Preview with the permissions required for in-place editing and normal automatic saving? Ideally, the user would only need to select "Edit" once, without an additional file-selection dialog or an explicit Save command. We want to preserve the original PNG URL, keep App Sandbox enabled, and avoid automatically exporting temporary images to the Desktop. If this workflow is not supported, what is Apple's recommended approach? Thank you.
13
0
530
1w
synchronize a file's state with that on disk
Hello Dev, The App, which I am working on, uses fcopyfile() to copy file from external storage (USB, thunderbolt) to internal disk. Looks like this call provides the best performance. fcopyfile(from, to, nullptr, COPYFILE_DATA); I need to be sure the data is copied after the call. Are there any necessity to synchronize a file's state with that on disk the data? (e.g. call fsync()) Thank you in advance! Pavel
2
0
507
1w
Critical Regression: smbfs 7.0 introduces a crtitical bug regarding symlinks
Apple feedback FB25355124 The SMB client no longer accepts reads to symlinks that are an absolute path to a network volume or a symlink that contains a (..) in the relative path. Reproduction steps on an SMB mount with this file structure: dir a.txt Run this command from inside of "dir": ln -s my-link ../dir/a.txt Attempt to read that symlink: cat ./my-link Which results in this error: cat: link: Invalid argument which is translating to an EINVAL getting returned from the SMB client. Same behavior was observed when making a symlink with an absolute path: ln -s my-link /Volumes/Example/dir/a.txt The server is responding successfully to the IOCTL command but the client is still rejecting the request with that error. This behavior was not observed in macOS 26.6.2 (smbfs 6.0.1) as well as previous versions of macOS.
4
5
367
1w
On File System Permissions
Modern versions of macOS use a file system permission model that’s far more complex than the traditional BSD rwx model, and this post is my attempt at explaining that model. If you have a question about this, post it here on DevForums. Put your thread in the App & System Services > Core OS topic area and tag it with Files and Storage. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" On File System Permissions Modern versions of macOS have five different file system permission mechanisms: Traditional BSD permissions Access control lists (ACLs) App Sandbox Mandatory access control (MAC) Endpoint Security (ES) The first two were introduced a long time ago and rarely trip folks up. The second two are newer, more complex, and specific to macOS, and thus are the source of some confusion. Finally, Endpoint Security allows third-party developers to deny file system operations based on their own criteria. This post offers explanations and advice about all of these mechanisms. Error Codes App Sandbox and the mandatory access control system are both implemented using macOS’s sandboxing infrastructure. When a file system operation fails, check the error to see whether it was blocked by this sandboxing infrastructure. If an operation was blocked by BSD permissions or ACLs, it fails with EACCES (Permission denied, 13). If it was blocked by something else, it’ll fail with EPERM (Operation not permitted, 1). If you’re using Foundation’s FileManager, these error are both reported as Foundation errors, for example, the NSFileReadNoPermissionError error. To recover the underlying error, get the NSUnderlyingErrorKey property from the info dictionary. App Sandbox File system access within the App Sandbox is controlled by two factors. The first is the entitlements on the main executable. There are three relevant groups of entitlements: The com.apple.security.app-sandbox entitlement enables the App Sandbox. This denies access to all file system locations except those on a built-in allowlist (things like /System) or within the app’s containers. The various “standard location” entitlements extend the sandbox to include their corresponding locations. The various “file access temporary exceptions” entitlements extend the sandbox to include the items listed in the entitlement. Collectively this is known as your static sandbox. The second factor is dynamic sandbox extensions. The system issues these extensions to your sandbox based on user behaviour. For example, if the user selects a file in the open panel, the system issues a sandbox extension to your process so that it can access that file. The type of extension is determined by the main executable’s entitlements: com.apple.security.files.user-selected.read-only results in an extension that grants read-only access. com.apple.security.files.user-selected.read-write results in an extension that grants read/write access. Note There’s currently no way to get a dynamic sandbox extension that grants executable access. For all the gory details, see this post. These dynamic sandbox extensions are tied to your process; they go away when your process terminates. To maintain persistent access to an item, use a security-scoped bookmark. See Accessing files from the macOS App Sandbox. To pass access between processes, use an implicit security scoped bookmark, that is, a bookmark that was created without an explicit security scope (no .withSecurityScope flag) and without disabling the implicit security scope (no .withoutImplicitSecurityScope flag)). If you have access to a directory — regardless of whether that’s via an entitlement or a dynamic sandbox extension — then, in general, you have access to all items in the hierarchy rooted at that directory. This does not overrule the MAC protection discussed below. For example, if the user grants you access to ~/Library, that does not give you access to ~/Library/Mail because the latter is protected by MAC. Finally, the discussion above is focused on a new sandbox, the thing you get when you launch a sandboxed app from the Finder. If a sandboxed process starts a child process, that child process inherits its sandbox from its parent. For information on what happens in that case, see the Note box in Enabling App Sandbox Inheritance. IMPORTANT The child process inherits its parent process’s sandbox regardless of whether it has the com.apple.security.inherit entitlement. That entitlement exists primarily to act as a marker for App Review. App Review requires that all main executables have the com.apple.security.app-sandbox entitlement, and that entitlements starts a new sandbox by default. Thus, any helper tool inside your app needs the com.apple.security.inherit entitlement to trigger inheritance. However, if you’re not shipping on the Mac App Store you can leave off both of these entitlement and the helper process will inherit its parent’s sandbox just fine. The same applies if you run a built-in executable, like /bin/sh, as a child process. When the App Sandbox blocks something, it might generates a sandbox violation report. For information on how to view these reports, see Discovering and diagnosing App Sandbox violations. To learn more about the App Sandbox, see the various links in App Sandbox Resources. For information about how to embed a helper tool in a sandboxed app, see Embedding a Command-Line Tool in a Sandboxed App. Mandatory Access Control Mandatory access control (MAC) has been a feature of macOS for many releases, but it’s become a lot more prominent since macOS 10.14. There are many flavours of MAC but the ones you’re most likely to encounter are: Full Disk Access (macOS 10.14 and later) Files and Folders (macOS 10.15 and later) App bundle protection (macOS 13 and later) App container protection (macOS 14 and later) App group container protection (macOS 15 and later) Data Vaults (see below) and other internal techniques used by various macOS subsystems The exact list of file system locations protected by MAC is not documented and, as illustrated by the list above, can change over time. If your process runs into a MAC check the system might prompt the user to grant the process access, or it might just fail the access. If the user grants the process access, the system might only grant that access for this specific process, or it might persist that access for the program that this process is running. The exact behaviour varies based on the specific location in the file system and can also vary between different versions of macOS. Mandatory access control, as the name suggests, is mandatory; it’s not an opt-in like the App Sandbox. Rather, all processes on the system, including those running as root, as subject to MAC. Data Vaults are not a third-party developer opportunity. See this post if you’re curious. In the Full Disk Access and Files and Folders cases, users grant a program a MAC privilege using System Settings > Privacy & Security. Some MAC privileges are per user (Files and Folders) and some are system wide (Full Disk Access). If you’re not sure, run this simple test: On a Mac with two users, log in as user A and enable the MAC privilege for a program. Now log in as user B. Does the program have the privilege? If a process tries to access an item restricted by MAC, the system may prompt the user to grant it access there and then. For example, if an app tries to access the desktop, you’ll see an alert like this: “AAA” would like to access files in your Desktop folder. [Don’t Allow] [OK] To customise this message, set Files and Folders properties in your Info.plist. This system only displays this alert once. It remembers the user’s initial choice and returns the same result thereafter. This relies on your code having a stable code signing identity. If your code is unsigned, or signed ad hoc (Signed to Run Locally in Xcode parlance), the system can’t tell that version N+1 of your code is the same as version N, and thus you’ll encounter excessive prompts. Note For information about how that works, see TN3127 Inside Code Signing: Requirements. The Files and Folders prompts only show up if the process is running in a GUI login session. If not, the operation is allowed or denied based on existing information. If there’s no existing information, the operation is denied by default. For more information about app and app group container protection, see the links in Trusted Execution Resources. For more information about app groups in general, see App Groups: macOS vs iOS: Working Towards Harmony On managed systems the site admin can use the com.apple.TCC.configuration-profile-policy payload to assign MAC privileges. For testing purposes you can reset parts of TCC using the tccutil command-line tool. For general information about that tool, see its man page. For a list of TCC service names, see the posts on this thread. Note TCC stands for transparency, consent, and control. It’s the subsystem within macOS that manages most of the privileges visible in System Settings > Privacy & Security. TCC has no API surface, but you see its name in various places, including the above-mentioned configuration profile payload and command-line tool, and the name of its accompanying daemon, tccd. While tccutil is an easy way to do basic TCC testing, the most reliable way to test TCC is in a VM, restoring to a fresh snapshot between each test. If you want to try this out, crib ideas from Testing a Notarised Product. The MAC privilege mechanism is heavily dependent on the concept of responsible code. For example, if an app contains a helper tool and the helper tool triggers a MAC prompt, we want: The app’s name and usage description to appear in the alert. The user’s decision to be recorded for the whole app, not that specific helper tool. That decision to show up in System Settings under the app’s name. For this to work the system must be able to tell that the app is the responsible code for the helper tool. The system has various heuristics to determine this and it works reasonably well in most cases. However, it’s possible to break this link. I haven’t fully research this but my experience is that this most often breaks when the child process does something ‘odd’ to break the link, such as trying to daemonise itself. If you’re building a launchd daemon or agent and you find that it’s not correctly attributed to your app, add the AssociatedBundleIdentifiers property to your launchd property list. See the launchd.plist man page for the details. Scripting MAC presents some serious challenges for scripting because scripts are run by interpreters and the system can’t distinguish file system operations done by the interpreter from those done by the script. For example, if you have a script that needs to manipulate files on your desktop, you wouldn’t want to give the interpreter that privilege because then any script could do that. The easiest solution to this problem is to package your script as a standalone program that MAC can use for its tracking. This may be easy or hard depending on the specific scripting environment. For example, AppleScript makes it easy to export a script as a signed app, but that’s not true for shell scripts. TCC and Main Executables TCC expects its bundled clients — apps, app extensions, and so on — to use a native main executable. That is, it expects the CFBundleExecutable property to be the name of a Mach-O executable. If your product uses a script as its main executable, you’re likely to encounter TCC problems. To resolve these, switch to using a Mach-O executable. For an example of how you might do that, see this post. Endpoint Security Endpoint Security (ES) is a general mechanism for third-party products to enforce custom security policies on the Mac. An ES client asks ES to send it events when specific security-relevant operations occur. These events can be notifications or authorisations. In the case of authorisation events, the ES client must either allow or deny the operation. As you might imagine, the set of security-relevant operations includes file system operations. For example, when you open a file using the open system call, ES delivers the ES_EVENT_TYPE_AUTH_OPEN event to any interested ES clients. If one of those ES client denies the operation, the open system call fails with EPERM. For more information about ES, see the Endpoint Security framework documentation. Originally ES clients operated system wide. macOS 27 introduced a new mechanism, es_new_descendants_client, that allows an ES client to operate on the process hierarchy rooted at the client itself. Revision History 2026-09-18 Extended the Endpoint Security section to discuss es_new_descendants_client. Clarified the scope of MAC. 2025-11-04 Added a discussion of Endpoint Security. Made numerous minor editorial changes. 2024-11-08 Added info about app group container protection. Clarified that Data Vaults are just one example of the techniques used internally by macOS. Made other editorial changes. 2023-06-13 Replaced two obsolete links with links to shiny new official documentation: Accessing files from the macOS App Sandbox and Discovering and diagnosing App Sandbox violations. Added a short discussion of app container protection and a link to WWDC 2023 Session 10053 What’s new in privacy. 2023-04-07 Added a link to my post about executable permissions. Fixed a broken link. 2023-02-10 In TCC and Main Executables, added a link to my native trampoline code. Introduced the concept of an implicit security scoped bookmark. Introduced AssociatedBundleIdentifiers. Made other minor editorial changes. 2022-04-26 Added an explanation of the TCC initialism. Added a link to Viewing Sandbox Violation Reports.  Added the TCC and Main Executables section. Made significant editorial changes. 2022-01-10 Added a discussion of the file system hierarchy. 2021-04-26 First posted.
Replies
0
Boosts
0
Views
15k
Activity
Sep ’26
Files and Storage Resources
General: Forums subtopic: App & System Services > Core OS Forums tags: Files and Storage, Foundation, FSKit, File Provider, Finder Sync, Disk Arbitration, APFS Foundation > Files and Data Persistence documentation Low-level file system APIs are documented in UNIX manual pages File System Programming Guide archived documentation About Apple File System documentation Apple File System Guide archived documentation File system changes introduced in iOS 17 forums post On File System Permissions forums post Extended Attributes and Zip Archives forums post Unpacking Apple Archives forums post Creating new file systems: FSKit framework documentation Building a passthrough file system sample code File Provider framework documentation Finder Sync framework documentation App Extension Programming Guide > App Extension Types > Finder Sync archived documentation Managing storage: Disk Arbitration framework documentation Disk Arbitration Programming Guide archived documentation Mass Storage Device Driver Programming Guide archived documentation Device File Access Guide for Storage Devices archived documentation BlockStorageDeviceDriverKit framework documentation Volume format references: Apple File System Reference TN1150 HFS Plus Volume Format Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
Replies
0
Boosts
0
Views
3.2k
Activity
Feb ’26
Can an iOS Custom Keyboard Legally Launch Its Containing App for a User-Initiated Speech Recording?
I’m developing an iOS application with a custom keyboard extension and a companion app. Our intended user experience: The user is typing in an app such as WhatsApp using our custom keyboard. They tap the Speech button. Our companion app opens automatically. The companion app establishes a microphone session. iOS returns the user to the original host app. The user continues dictating through the keyboard. What we have already implemented: A Swift-based custom keyboard and companion app. App Groups and Darwin notifications for communication between the two targets. Microphone recording through the companion app. Apple Speech Recognition with on-device recognition. A warm background audio session. Subsequent recordings and text insertion work on a physical iPhone once the warm session is established. Our current blocker: The keyboard extension cannot successfully open its companion app when the warm session is inactive. We previously tried NSExtensionContext.open(), but it did not work. We want to avoid private APIs, responder-chain workarounds, and anything that could violate App Store Review Guidelines. My questions: Does Apple provide any officially supported public API that allows a custom keyboard extension to launch its containing app in response to an explicit user tap? Can App Intents or ForegroundContinuableIntent legitimately achieve this from a keyboard extension? Does App Review Guideline 4.4.1 prohibit this particular user-initiated handoff? If direct launching is prohibited, what Apple-supported architecture or interaction pattern would you recommend for this use case? Is there a supported way for the companion app to return the user to the original host app after establishing the microphone session? We are looking for guidance based on actual iOS platform restrictions and supported APIs, preferably from developers who have shipped custom keyboard applications. Thank you.
Replies
1
Boosts
0
Views
45
Activity
2d
Can a restore replace a file in an App Group container while the app's process is alive?
For an iOS app that stores a SQLite database in its App Group container and has no extension targets, can iCloud restore, Finder or Apple Devices restore, or Quick Start replace a file in that container while the app's normal process remains alive, including while suspended? If iOS terminates the process first, can the app relaunch before all App Group files have finished restoring? Please identify any differences between these restore paths and any documented guarantee. Related: thread 845479 gave the general rule for the app's own container.
Replies
3
Boosts
0
Views
127
Activity
2d
Full Disk Access on macOS 27.3
I'm looking into the changes being implemented and I find this way of handling by Apple on short notice problematic. Now our customers (those that don't have MDM) will have to jump through hoops to enable FDA for our product, a security product that also uses Endpoint Security. We already have the entitlement for endpoint security, which requires FDA in order to work, so why make it so difficult instead of just allowing FDA for apps that have this entitlement? Why only backup applications are exempted?
Replies
2
Boosts
0
Views
130
Activity
3d
Access to related files outside Sandbox with NSFileCoordinator and NSFilePresenter does not work anymore in macOS 27.3 beta 2
In macOS 27.3 beta 2, it is no longer possible to use NSFileCoordinator with NSFilePresenter instances to open a SQLite file with related WAL and SHM files when a sandboxed app has access to the primary SQLite file. In macOS 27.3 beta 1 and previous macOS releases, the Related File Access API works as expected. This happens regardless where the files are located, so it seems to be unrelated to recent changes in Privacy & Security, although it could be an unexpected side effect of these changes. Instead of correctly registering NSFilePresenter instances, errors like the following are logged in the XCode console: NSFileSandboxingRequestRelatedItemExtension: Failed to issue extension for /Users/testuser/Desktop/Sample/Example.sqlite-wal because: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (The related item is protected by a different storage class than the primary item) UserInfo={NSDebugDescription=The related item is protected by a different storage class than the primary item} +[NSFileCoordinator addFilePresenter:] could not get a sandbox extension. primaryPresentedItemURL: file:///Users/testuser/Desktop/Sample/Example.sqlite, presentedItemURL: file:///Users/testuser/Desktop/Sample/Example.sqlite-walThe mentioned Related File Access API is documented here. I have filed a Feedback, which includes a sample project: FB25625743 My question is: Is this a bug, or new intended behavior, or is there something else changed that should be dealed with when using this API in macOS 27.3 beta 2?
Replies
1
Boosts
0
Views
70
Activity
3d
Subject: Critical APFS Data Loss Bug & Error 1110 Loop during official Finder Update on iPhone 14 (A15)
Hello, I am requesting an engineering escalation regarding a critical bug in Apple's APFS update pipeline that trapped an iPhone 14 (A15, 128 GB) in recovery mode during an official Finder update from iOS 16.6 to iOS 18 (27.2.1, 24B156) on macOS 14.5. The device hardware is 100% healthy (Apple MRI diagnostics all green), the passcode is known, and 101,175 MB (341,967 files) of user data remain intact on the flash storage. However, the device cannot boot or complete an update due to a corruption caused by Apple's own restore tools. --- ### What Happened (Verified in Logs): 1. **Initial Full Storage State:** The device had ~105 GB utilized and was updated via Finder using "Update" (not Restore). 2. **Destructive fsck Behavior:** In pass 3, the restore ramdisk ran `/sbin/fsck_apfs -dy /dev/disk2`. On the nearly full container, fsck erroneously flagged 8,182 live omap mappings as "orphans" and deallocated them, causing extent-ref b-tree node `0x10bb3` to be zeroed out (TRIMmed by the flash controller). 3. **Split Failure:** In pass 4, the iOS 18 System volume installed and sealed, but `split_data_volume` failed in 4 seconds when `apfs_migrator` encountered block `0x10bb3` (`obj_read` checksum failure returning EILSEQ / error 92). 4. **False Error 1110 Loop:** Every subsequent attempt now halts immediately at `space_checks` with Error 1110. --- ### Reverse Engineering Proof: Disassembly of `restored_update` (arm64e, VA 0x10001afcc / 0x10001b0e8) confirms a major error-handling bug: When `splitter_dump` encounters the unreadable block `0x10bb3`, it fails with `EILSEQ` (92). Instead of handling this error, `restored_update` executes: `mov x19, #-1; mov x0, x19; ret` The caller receives `-1 bytes of free space`, logs: "Data volume requires splitting. Splitter will leave -1 bytes of free space after completion. Current free space on device: 6620069888 bytes. Insufficient space on device to run splitter" and aborts with **CHECKPOINT FAILURE:(FAILURE:1110)**. The device is NOT out of space (it has 6.3 GB free); it is blocked solely because `restored_update` misinterprets an EILSEQ filesystem error as negative free space. --- ### Current State & Request: - The encryption keys and SEP/gigalocker are intact (`gigalocker: ONLINE`). - In the restore ramdisk, `/dev/disk2s2` mounts cleanly as read-write on `/mnt2`. - Zero APFS snapshots remain on the volume, meaning the extent-ref tree is theoretically fully reconstructible from the valid fsroot inode tree. I am requesting assistance from CoreOS / APFS engineering: 1. Is there an engineering update ramdisk or build that can bypass the `splitter_dump` EILSEQ check, or rebuild the extent-ref tree, so the update can finalize? 2. Alternatively, can an engineering liaison facilitate a non-destructive extraction given that the volume mounts read-write and the user passcode is known? I can immediately provide full terminal transcripts, Finder updater logs (`iPhoneUpdater-*.log`), and disassembly details. Thank you, Samuel Journo
Replies
1
Boosts
0
Views
106
Activity
3d
macOS APFS: com.apple.macl and UF_TRACKED appear after creating a hard link — safe file replacement and rollback?
I'm investigating an unexpected metadata change during a controlled file deployment on macOS. Environment and observed state Two regular configuration files are used by a local service. Before replacement, the first file had: SHA-256: verified. File flags: 0. Extended attributes: none. Hard-link count: 1. Owner/group: 501/20. Permissions: 0644. ACL: empty. A backup procedure created a hard link to preserve the original inode before replacing the active pathname with an independently created file. Immediately after creating and verifying the hard link, the original file was observed with: The same SHA-256 and inode. Flags: 64 (UF_TRACKED). Extended attribute: com.apple.macl. Hard-link count: 2. No file content was replaced. The procedure stopped because the metadata no longer matched the original baseline. Additional observations Other backup methods also encountered unexpected metadata changes during destination creation. Tests using renamex_np with RENAME_SWAP successfully exchanged and restored artificial files with flags 0 and empty extended attributes. A test with artificial files already containing com.apple.provenance also succeeded. We could not reproduce the specific UF_TRACKED + com.apple.macl + two-hard-link state in an isolated fixture using ordinary documented operations. The operational original and its second hard link currently share the same inode. No attempt has been made to remove the protected attribute or change its flags. Questions for Apple filesystem/security specialists Under what documented circumstances can creating a hard link or related Finder/TCC document-tracking behavior cause UF_TRACKED and com.apple.macl to appear on an existing file? Are these metadata changes expected for a file accessed through a user-authorized Documents location? What supported mechanism can preserve the current original inode and provide a verifiable rollback when replacing its active pathname? Is renamex_np(..., RENAME_SWAP) appropriate for this situation, and what special considerations apply to the existing second hard link and protected extended attributes? What verification criteria would you recommend before permitting a production replacement? I am looking for a documented, reversible procedure that preserves macOS security protections. I do not want to disable SIP, forcibly remove com.apple.macl, or bypass TCC. I can provide sanitized metadata comparisons and a minimal reproduction if needed.
Replies
1
Boosts
0
Views
153
Activity
3d
macOS 27/APFS: Supported ACL Absence Verification When acl_get_fd_np Returns ENOENT
Subject: Supported fail-closed ACL absence verification on macOS 27.0.1 / APFS Environment: macOS 27.0.1, build 26A434; APFS; installed macOS 27.0 SDK. We need a supported, documented way to determine whether an existing filesystem object has no effective ACL entries, while rejecting genuine retrieval failures and unsupported or unavailable ACL evidence. We are seeking clarification of the public interface contract, not alleging an Apple defect. For existing directory and regular-file fixtures, pathname metadata and descriptor metadata identify the same object. Errno is cleared immediately before each native call and captured immediately afterward. ACL retrieval uses ACL_TYPE_EXTENDED: acl_get_file(path, ACL_TYPE_EXTENDED) acl_get_fd_np(fd, ACL_TYPE_EXTENDED) On fresh objects, both return NULL with ENOENT. Explicit one-entry fixture ACLs are retrieved successfully. Explicit zero-entry fixture ACLs can also yield NULL/ENOENT, while attribute queries return a serialized zero-entry ACL. The attribute queries use getattrlist() and descriptor-bound fgetattrlist(), requesting ATTR_CMN_RETURNED_ATTRS | ATTR_CMN_EXTENDED_SECURITY, with FSOPT_NOFOLLOW | FSOPT_REPORT_FULLSIZE and WITHOUT FSOPT_PACK_INVAL_ATTRS. Buffer lengths, variable-reference bounds and returned-attribute validity are checked. For the existing directories of interest, both calls succeed but omit the ATTR_CMN_EXTENDED_SECURITY returned bit. Explicit populated and zero-entry fixture records do set the bit. APFS reports valid VOL_CAP_INT_EXTENDED_SECURITY support; we do not assume that volume capability proves per-object ACL availability. On macOS 27.0.1, build 26A434, using APFS, which supported interface and documented conditions allow software to distinguish an absent ACL from unavailable or unsupported ACL evidence when descriptor-bound attribute queries succeed but omit ATTR_CMN_EXTENDED_SECURITY and native ACL getters return ENOENT for an existing object? Please clarify: Whether ENOENT has a supported ACL-absence interpretation, and under exactly which checked conditions. Whether an omitted extended-security attribute can establish ACL absence, rather than unavailable or unsupported evidence. How explicit zero-entry ACLs differ from absent ACL records through supported interfaces. How KAUTH_FILESEC_NOACL should be interpreted through supported APIs. How genuine retrieval failures, including permission, I/O, allocation and unsupported-operation errors, must remain distinguishable. Whether a supported descriptor-bound verification method exists that preserves fail-closed security checks and object identity binding; please identify its guarantees and limitations regarding pathname/ancestor changes and later operations. Whether relevant behavior is specific to this macOS/APFS version. Please identify the applicable public documentation or supported verification sequence. We do not want to modify permissions, synthesize ACLs on target objects, treat invalid-attribute defaults as real evidence, or accept ambiguous omission/ENOENT as success. Existing ownership, mode and confinement checks must remain separate mandatory checks. If no public API can make this distinction reliably, please state that limitation.
Replies
15
Boosts
0
Views
582
Activity
3d
Supported quarantine preservation when copying files from an App Sandbox process
What supported public API and verification contract should a sandboxed macOS file manager use to preserve a copied file's quarantine/provenance metadata? We observe different results in App Sandbox versus Finder and an otherwise-matched non-sandbox diagnostic. We want to keep App Sandbox and all security protections enabled, not remove quarantine or invent undocumented flag masks. Environment: macOS 26.6.2 (25G83), Apple Silicon, local APFS. Optimized Foundation-only diagnostic, Apple Development signing, Hardened Runtime, launched directly as an executable. The sandbox variant has app-sandbox, user-selected read/write and app-scope bookmark entitlements. This is not a notarized distribution-build comparison. Reproduction: Use an existing regular JPEG with naturally present com.apple.quarantine metadata identifying Chrome, raw flags 0283 and a nonempty event field. Keep the original read-only. Record SHA-256, length, full raw extended attributes and fresh NSURL quarantinePropertiesKey observations. Keep access to a user-granted local test directory active. Copy to a new, absent destination in a fresh directory using each of these three arms: fclonefileat with CLONE_ACL | CLONE_NOFOLLOW_ANY | CLONE_RESOLVE_BENEATH (28). copyfile with COPYFILE_CLONE | COPYFILE_ACL; record COPYFILE_STATE_WAS_CLONED. FileManager.copyItem(at:to:). Observe source and destination without setting, removing or repairing metadata. Each arm waits at least 1.1 seconds before copying; the source quarantine timestamp is much older than call time. Repeat with fresh destinations. Also copy the same source through actual Finder Copy/Paste twice. Compare two signed variants made from the same compiled payload, with identical executable name, bundle ID, Development identity and Hardened Runtime. The only signed entitlement difference is app-sandbox=true versus its omission. The sandbox variant resolves the existing exact folder grant; the non-sandbox diagnostic uses that same fixed test directory directly. Results: Sandbox diagnostic: all six calls succeed and data hashes/lengths match. All six outputs change raw flags 0283 to 0082, agent Chrome to the diagnostic app, event field nonempty to empty, and timestamp. Public output lacks the source event identifier and adds LSQuarantineTypeSandboxed. Matched non-sandbox diagnostic: all six copies preserve the full observed raw quarantine record and public quarantine dictionary. copyfile reports WAS_CLONED=true in both contexts. Finder: both copies preserve the full observed raw quarantine record and public dictionary. Source bytes and declared preserved metadata remain unchanged. Other compared raw attributes, mode, flags, birth/modification times, owner/group and ACL match in these cases. We also reproduced timestamp-only differences with files naturally quarantined by the diagnostic itself. The foreign-agent control above shows that the difference is not limited to timestamp. The chosen source exposes no public origin/data URL, so their preservation is untested. We have not traced the responsible internal component, tested Gatekeeper effects, or established whether the transformation is security-equivalent. We do not claim the three APIs use independent implementations or that all possible public API combinations have been tested. Could you clarify: Is this transformation expected for copying from an App Sandbox process, or should we file it as a bug? What documented preservation behavior should a sandboxed file manager rely on? Is there a supported API or operation that preserves the source's quarantine/provenance metadata in this context without disabling App Sandbox or weakening security protections? If exact raw equality is intentionally not guaranteed, which supported public properties or behaviors should verification check? Is a quarantine-properties dictionary round-trip supported, and what information does it preserve or omit? We have not attempted a metadata repair. Separately, a pathname-based repair after cloning would require its own destination-identity/race safety review because the clone call does not return a creation-bound destination descriptor. We are asking for supported API semantics, not private implementation details or a security bypass. We can prepare a minimal sanitized standalone reproducer if needed. No user files, sandbox grants, private logs or diagnostic binaries are attached to this initial question.
Replies
5
Boosts
0
Views
634
Activity
4d
Removing File Provider domains when a Mac App Store app is deleted
My Mac App Store apps use NSFileProviderReplicatedExtension, and users keep asking how to remove the folder in ~/Library/CloudStorage after deleting the app. Deleting the app leaves the domain registered and the folder in place. fileproviderctl dump shows the domain as "extension not found", and on my own Mac one such domain had survived for five months. As far as I can tell there is no supported way for the developer to clean this up: A sandboxed Mac App Store app cannot run code when it is deleted. NSFileProviderManager.remove(_:mode:) and removeAllDomains only work while the app is installed. fileproviderctl has no command to remove a domain. invalidate() is called when the extension is turned off in System Settings, but also on routine teardown, so it cannot drive cleanup. The one way out I have found is manual. Open the leftover folder in Finder, which says "The application "X" could not be found", and click Delete "X"… in the upper right corner. That removes both the domain and the folder, but users rarely find it on their own. Is there a mechanism I have missed, such as an Info.plist key or a system behavior, that removes a deleted app's domains automatically? If not, the best I can do seems to be an in-app "Remove from Finder" command that users have to run before deleting the app. I have filed FB25610224 asking for the system to remove a deleted app's domains, keeping unsynced changes the way .preserveDirtyUserData does.
Replies
1
Boosts
0
Views
75
Activity
4d
BlockStorageDeviceDriverKit grant confirmed by support but shows "No Requests" in the portal. How to resolve?
Hello! I am hoping a DTS engineer or someone who knows the Capability Requests portal can help, because I am stuck between a written support confirmation and what the portal actually shows. Background. We are building a native macOS iSCSI initiator for SOHO and home NAS use, developed over close to two years. A userspace daemon runs the iSCSI protocol and a DriverKit system extension presents the remote LUN as a block device. The code is essentially complete. Only the DriverKit extension cannot be signed, loaded and validated without the entitlement. We submitted request 32PC8MGU57 for two entitlements: com.apple.developer.driverkit.family.block-storage-device for the extension com.aviontex.iscsi.AviontexISCSI.AviontexInitiator com.apple.developer.driverkit.userclient-access for the app com.aviontex.iscsi.AviontexISCSI, scoped to the extension bundle id The problem. On June 25 Developer Support confirmed in writing that both entitlements were granted. The portal does not match that: Block Storage Device: No Requests: on both App IDs UserClient Access: Assigned: on the app SCSI Controller: Submitted: on the app So the one entitlement we actually need, Block Storage Device, shows as never requested, even though request 32PC8MGU57 covered it and support confirmed the grant. The case was escalated to the senior team on July 2 (case 102922935570). Follow-up emails since then have not received a response. Why Block Storage Device specifically Our initiator has no PCI or Thunderbolt bus and no DMA path, so SCSIControllerDriverKit does not fit. This is confirmed by DTS in thread 776020, where Kevin Elliott explains that SCSIControllerDriverKit passes data through fBufferIOVMAddr as a physical address with no mechanism to convert it into a VM address the dext can access. He also notes it cannot be used with any bus other than PCI or Thunderbolt. Block Storage Device is therefore the family we need. My questions: Am I reading the portal correctly: Block Storage Device not requested, UserClient Access assigned, SCSI Controller submitted? From here, what is the correct way to get Block Storage Device onto these two App IDs, with both the Development and the Distribution grant, since our public beta depends on Distribution? Should I submit a new request through the Capability Requests tab or does the escalated case handle it? Is there any way to get visibility on the escalated case, since email follow-ups are not being answered? A full technical justification is prepared and we are happy to share the source code. Any guidance would be appreciated. Thank you.
Replies
74
Boosts
4
Views
18k
Activity
5d
Foundation reports false for encryption on two encrypted external APFS volumes
We request clarification of a Foundation API discrepancy from existing read-only diagnostics. Environment: the user has personally run sw_vers on the currently running Mac and confirmed ProductName: macOS; ProductVersion: 27.0.1; BuildVersion: 26A434. This is the currently confirmed system version. The reviewed records do not establish an unambiguous temporal link between that confirmation and the APFS/Foundation measurements on 15 November 2026; we therefore do not assert that it proves the OS version used for those measurements. Earlier macOS 26.6.2 (25G83) records are historical and are not presented as the current system. Observed volumes: External APFS Volume A and External APFS Volume B, both external APFS volumes connected over USB. For BOTH volumes, the recorded diskutil results are: Encryption=true; EncryptionThisVolumeProper=true; CryptoMigrationOn=false; GlobalPermissionsEnabled=true. Both were mounted and unlocked after completed in-place APFS encryption. For BOTH volumes, direct Foundation queries at the volume root return: NSURLVolumeUUIDStringKey: the correct UUID for the respective volume (omitted here for privacy); NSURLVolumeURLKey: the same volume-root URL as queried; NSURLVolumeIsEncryptedKey: present, explicit false (__NSCFBoolean, description 0). The canonical mount path and diskutil volume identity match. This is not an inquiry against a parent volume, a missing key converted to false, or an inferred mapping based only on a display name. Minimal read-only observation procedure, describing the existing successful queries (not rerun for this request): Select the already mounted APFS volume root and verify its UUID against diskutil. Construct a fresh NSURL using fileURLWithPath for that root. Query resourceValuesForKeys:error: for NSURLVolumeUUIDStringKey, NSURLVolumeURLKey and NSURLVolumeIsEncryptedKey. Compare the returned UUID/root URL and explicit encryption Boolean with the recorded diskutil fields. The successful queries used Foundation through JavaScript for Automation's Objective-C bridge, in separate helper processes. An equivalent full Swift application runtime result has not been established. A separate failed JXA enumeration attempt is excluded from the evidence. We understand URL resource values may be cached; caching has not been established as the cause. Expected: an encryption indication consistent with the completed APFS encryption, or documented semantics explaining why these indicators differ. Actual: explicit false on both volumes. Questions: Are there documented limitations or known issues for this property on external, mounted and unlocked APFS volumes encrypted in place? What does false mean when the recorded diskutil encryption fields are positive? Is any additional read-only evidence necessary to interpret it? Which supported public read-only API and validation procedure should an application use to establish completed APFS volume encryption without weakening its policy? Could the observed behavior be affected by accessing NSURL resource values through the JavaScript for Automation Objective-C bridge rather than directly from a native Swift application? We are requesting interpretation of existing evidence. No further encryption, lock/unlock experiment, drive modification or application build was performed for this inquiry. No credentials, private paths or customer data are included. Thank you.
Replies
1
Boosts
0
Views
141
Activity
6d
Supported App Sandbox metadata access through an inherited file descriptor, without reopening the object
We are evaluating a macOS design before implementation. This is a platform-support question, not a report of an observed runtime failure. No actual controller executable, helper executable or deployment configuration has been selected or qualified. Our objective is to let a small, fixed-purpose helper examine an already-open object’s identity and access control list (ACL) metadata while preserving the original object reference and ownership. Proposed configuration A trusted controller would launch one native C helper using an explicit executable target and posix_spawn. The controller would need to qualify for the documented nonsandboxed-parent case, without a conflicting inherited sandbox. We do not assume that an absent entitlement alone establishes this. The helper would be the main executable of its own signed application bundle, using its own ordinary App Sandbox rather than inheriting the controller’s sandbox. Its proposed additional filesystem permission would be com.apple.security.temporary-exception.files.absolute-path.read-only, containing exactly two fixed directory entries beneath a user’s development workspace, outside the helper’s container. The literal private paths are omitted. The controller would already own a read-only file descriptor for one regular file or directory within those trees. It would retain its original reference and pass a known duplicate referring to the same open object to the helper. The helper would perform one metadata observation. The proposed operations are fstat for object identity and fgetattrlist requesting ATTR_CMN_RETURNED_ATTRS and ATTR_CMN_EXTENDED_SECURITY, with FSOPT_REPORT_FULLSIZE and without FSOPT_PACK_INVAL_ATTRS. Required boundaries The helper must use only the inherited descriptor for the subject observation. The design does not permit: Reopening or resolving the subject through a pathname, bookmark or URL. Substituting a copied file or another object reference. Reading file contents, enumerating directories, changing permissions, or modifying shared descriptor flags or file offsets. Expanding the exception to an ancestor, home directory or broader workspace. Disabling an existing sandbox or using private interfaces to bypass restrictions. Parent-side traversal and identity checks remain separate responsibilities. Strict ancestor directories are not additional helper ACL subjects. We understand that a read-only directory exception and ordinary sandbox/container capabilities may permit more than the helper’s intended metadata operations. Metadata-only behaviour would be a reviewed-code obligation; we are not asking App Sandbox to enforce an exact metadata-only operation filter. Questions Supported launch and activation: Under what documented parent-context, signing, bundle, container and launch conditions can this helper establish its own ordinary App Sandbox? What supported mechanism or guarantee establishes that the sandbox is effective before the subject metadata operation? Required metadata permissions: Does the proposed read-only exception support fstat and the specified extended-security fgetattrlist request through an inherited read-only descriptor, for both regular files and directories? Please distinguish descriptor survival from permission to perform these operations, including any additional access-control conditions. Scope, identity and lifetime: What documented behaviour applies to descendant coverage, aliases, hard links, renames or namespace changes after the descriptor was opened? Please distinguish the lifetime of the inherited object reference from the lifetime of the static directory permission. Our design would refuse uncertainty rather than reopen, rebind or widen access. Evidence and support boundary: Which public documentation, interfaces or authoritative guarantees support this exact composition, and which parts require separate empirical qualification? Please identify applicable macOS versions and restrictions. Distinguish platform support from any distribution or App Store review requirements. If these requirements cannot be combined through supported interfaces, please identify the incompatible requirement. An approach requiring broader access, pathname reopening, a replacement object or a different handoff architecture would be a design change requiring separate review, not a solution within the stated constraints. Permission failures, unsupported requests and incomplete metadata would remain unavailable results. They would not be interpreted as proof that an ACL is absent. Complete ACL-absence interpretation and native resource bounds remain separate qualification questions. Apple material already reviewed Resolving App Sandbox Inheritance Problems App Sandbox Temporary Exception Entitlements Accessing files from the macOS App Sandbox
Replies
1
Boosts
0
Views
246
Activity
6d
macOS 26.x App Sandbox: supported disk-image attachment and descriptor-based unmount
On macOS 26.x, is there a public, supported way for an App Sandbox application with com.apple.security.virtualization to attach a new disk-image file held in its own container and mount its APFS filesystem within that container, without root, privileged or unsandboxed helpers, private/temporary exception entitlements, Full Disk Access, or weakening App Sandbox? We distinguish attaching the image from mounting an already attached virtual device. DTS threads 655767, 780965 and 775835 discuss these separately. Which supported API or tool and entitlements apply on 26.x, if such a path exists? If attachment is supported, what ownership and sandbox checks apply to a later normal funmount(fd, 0) using an O_EVTONLY descriptor for that exact mount's root? Is this combination supported, including when another actor has already unmounted it? If not, what supported alternative preserves the same restricted profile and avoids force or whole-disk unmount?
Replies
0
Boosts
0
Views
95
Activity
6d
Supported vnode metadata access after same-UID libproc queries return EPERM
We need a documented interface/access contract for a test supervisor that requires a bounded, process-birth-bound census of every process with its effective UID and every current vnode descriptor of those processes. Coverage includes ambient same-UID processes and descriptors opened before observation starts. The census needs vnode identity, type, ownership, mode, link count and open flags. Unavailable metadata is a refusal; we cannot treat EPERM as absence or exempt a process or descriptor. This is a cooperative same-user lifetime-containment check. We do not require file contents or an atomic global snapshot. Environment of the retained observation: Apple Silicon, macOS 27.3 (26C5035r), Darwin 27.3.0; Xcode 27.0 (27A5194q), macOS 27.0 SDK. The subject was the system LaunchServices process /usr/libexec/lsd. Caller real/effective UID matched the subject's UID/RUID/SVUID. Before/after process identity, version, start time, credentials and executable-path samples matched. PROC_PIDLISTFDS returned 32 bytes and listed FD 3 as PROX_FDTYPE_VNODE. The following call shape returned 0 bytes with errno == EPERM (1), with 176 bytes expected in that environment: struct vnode_fdinfo info = {0}; errno = 0; int count = proc_pidfdinfo(pid, fd, PROC_PIDFDVNODEINFO, &info, sizeof(info)); int saved_errno = errno;Errno was cleared before and saved immediately after the call. Credentials were not modified. The matching process bracket does not establish an FD-to-path association or a specific protection category. In particular, we have not established a Data Vault subtype. Questions: Is there a supported public interface or provisionable entitlement that supplies the required metadata for every current same-UID vnode descriptor, including descriptors whose metadata is protected internally by macOS? If Endpoint Security is the supported route, which documented API supplies a complete current FD inventory and vnode mapping, including already-open descriptors and ambient same-UID processes? A solution limited to descendants of the client does not cover this requirement. If supported interfaces cannot guarantee that coverage, could you clarify the limitation? Is there a supported diagnostic that identifies the protection category responsible for this metadata denial without inspecting private policy state? I have considered the "On File System Permissions" guidance, including its mandatory-access-control and Endpoint Security discussion: https://developer.apple.com/forums/thread/678819 This post describes a retained observation, not a new reproduction or qualification result. All retained results remain UNPROVED. A focused SDK/libproc Xcode example was previously built for arm64 and x86_64 but was not run; it illustrates the call sequence and a BSD start/credential bracket, not complete kernel birth binding or the required census. It does not guarantee reproduction on another system. The sanitized supporting record and example are already attached to the private DTS request that directed me to the forums. Please advise the supported interface/access contract, or its limitation, and any further diagnostic scope needed.
Replies
1
Boosts
0
Views
109
Activity
1w
Sandboxed app can't delete AppleDouble (._) files of quarantined files on exFAT, even with user-selected access.
My Mac App Store utility removes Mac metadata files (._* AppleDouble files and .DS_Store) from external drives formatted exFAT or FAT32. The app is sandboxed with com.apple.security.files.user-selected.read-write and com.apple.security.files.bookmarks.app-scope. The user grants access to the volume through NSOpenPanel. Deleting a ._ file works, except when its companion file carries com.apple.quarantine (for example, a file downloaded with Safari and copied to the drive with Finder). Then: let partner = volume + "/Nirvana.zip" // has com.apple.quarantine let appleDouble = volume + "/._Nirvana.zip" removexattr(partner, "com.apple.quarantine", XATTR_NOFOLLOW) // -1, errno 1 (EPERM) unlink(appleDouble) // -1, errno 1 (EPERM)The same unlink succeeds from Terminal (not sandboxed, without Full Disk Access). On exFAT the extended attributes live in the ._ file, so I assume the sandbox refuses because deleting it would remove the quarantine attribute. Tried, with no change: Full Disk Access granted to the app. Adding com.apple.security.files.user-selected.executable (verified in the built app with codesign -d --entitlements -). On a real drive (a music library), about 71% of the ._ files belong to quarantined files, so this is most of what users want removed. Is there a supported way for a sandboxed app to remove these files: an entitlement, an API, or an explicit user action? If not, can you confirm it's intended behavior, so I can explain it accurately to users? macOS 27.2, Xcode 27.2, Apple silicon. Focused sample project available (one source file). DTS case 23240704.
Replies
5
Boosts
0
Views
174
Activity
1w
Supported read/write handoff of a sandbox-container PNG to Preview using NSWorkspace
Hello, I am preparing an existing macOS screenshot utility for distribution through the Mac App Store. The app stores captured PNG files under its temporary directory: FileManager.default.temporaryDirectory .appendingPathComponent("ShelfDragPoC/Captures", isDirectory: true) A context-menu "Edit" action passes the original PNG URL to Preview using NSWorkspace. The app does not create an editing copy. Relevant code: import AppKit @MainActor func openInPreview(_ url: URL) { guard let previewURL = NSWorkspace.shared.urlForApplication( withBundleIdentifier: "com.apple.Preview" ) else { return } let configuration = NSWorkspace.OpenConfiguration() configuration.activates = true NSWorkspace.shared.open( [url], withApplicationAt: previewURL, configuration: configuration ) { _, _ in } } The app monitors the original PNG URL for file changes and refreshes its thumbnail when changes are detected. Observed behavior: In the existing non-sandboxed app, rotating an image in Preview updates the original PNG and the thumbnail without requiring Command-S. In the sandboxed validation app, Preview opens the image, but editing results in a separate copy. When closing the edited document, Preview displays a message indicating that the original document will not be changed. The original PNG and the app's thumbnail are not updated. The Preview launch code and file watcher are unchanged between the non-sandboxed and sandboxed versions. The sandboxed app has these entitlements: com.apple.security.app-sandbox com.apple.security.files.user-selected.read-write com.apple.security.files.bookmarks.app-scope The app-scoped bookmark is used for a separate Desktop export feature. The PNG opened in Preview remains in the app's sandbox container. My question: Is there a supported public API that allows a sandboxed Mac App Store app to open its own container-resident PNG in Preview with the permissions required for in-place editing and normal automatic saving? Ideally, the user would only need to select "Edit" once, without an additional file-selection dialog or an explicit Save command. We want to preserve the original PNG URL, keep App Sandbox enabled, and avoid automatically exporting temporary images to the Desktop. If this workflow is not supported, what is Apple's recommended approach? Thank you.
Replies
13
Boosts
0
Views
530
Activity
1w
synchronize a file's state with that on disk
Hello Dev, The App, which I am working on, uses fcopyfile() to copy file from external storage (USB, thunderbolt) to internal disk. Looks like this call provides the best performance. fcopyfile(from, to, nullptr, COPYFILE_DATA); I need to be sure the data is copied after the call. Are there any necessity to synchronize a file's state with that on disk the data? (e.g. call fsync()) Thank you in advance! Pavel
Replies
2
Boosts
0
Views
507
Activity
1w
Critical Regression: smbfs 7.0 introduces a crtitical bug regarding symlinks
Apple feedback FB25355124 The SMB client no longer accepts reads to symlinks that are an absolute path to a network volume or a symlink that contains a (..) in the relative path. Reproduction steps on an SMB mount with this file structure: dir a.txt Run this command from inside of "dir": ln -s my-link ../dir/a.txt Attempt to read that symlink: cat ./my-link Which results in this error: cat: link: Invalid argument which is translating to an EINVAL getting returned from the SMB client. Same behavior was observed when making a symlink with an absolute path: ln -s my-link /Volumes/Example/dir/a.txt The server is responding successfully to the IOCTL command but the client is still rejecting the request with that error. This behavior was not observed in macOS 26.6.2 (smbfs 6.0.1) as well as previous versions of macOS.
Replies
4
Boosts
5
Views
367
Activity
1w