iOS: gate capabilities by permissions and add settings controls#22135
Merged
iOS: gate capabilities by permissions and add settings controls#22135
Conversation
| let parsed = host.withCString { inet_pton(AF_INET, $0, &addr) == 1 } | ||
| guard parsed else { return false } | ||
| let value = ntohl(addr.s_addr) | ||
| let value = UInt32(bigEndian: addr.s_addr) |
Contributor
There was a problem hiding this comment.
UInt32(bigEndian:) expects a value that's already in big-endian format but needs to be interpreted as host-endian. However, addr.s_addr is already in network byte order (big-endian). The original ntohl() call converted from network to host byte order before the bit shift. This change breaks the loopback detection on little-endian systems (like iOS devices).
Suggested change
| let value = UInt32(bigEndian: addr.s_addr) | |
| let value = ntohl(addr.s_addr) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/ios/Sources/Gateway/GatewayConnectionController.swift
Line: 687
Comment:
`UInt32(bigEndian:)` expects a value that's already in big-endian format but needs to be interpreted as host-endian. However, `addr.s_addr` is already in network byte order (big-endian). The original `ntohl()` call converted from network to host byte order before the bit shift. This change breaks the loopback detection on little-endian systems (like iOS devices).
```suggestion
let value = ntohl(addr.s_addr)
```
How can I resolve this? If you propose a fix, please make it concise.23693c7 to
92c2660
Compare
Contributor
Author
MisterGuy420
pushed a commit
to MisterGuy420/openclaw-dev
that referenced
this pull request
Feb 20, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
rodrigogs
pushed a commit
to rodrigogs/openclaw
that referenced
this pull request
Feb 20, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
MisterGuy420
pushed a commit
to MisterGuy420/openclaw-dev
that referenced
this pull request
Feb 20, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
3 tasks
Hansen1018
added a commit
to Hansen1018/openclaw
that referenced
this pull request
Feb 21, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
vincentkoc
pushed a commit
that referenced
this pull request
Feb 21, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
dgarson
pushed a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 21, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
mmyyfirstb
pushed a commit
to mmyyfirstb/openclaw
that referenced
this pull request
Feb 21, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
obviyus
pushed a commit
to guirguispierre/openclaw
that referenced
this pull request
Feb 22, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky (cherry picked from commit 67edc77) # Conflicts: # apps/ios/Sources/Gateway/GatewayConnectionController.swift # apps/ios/Sources/Settings/SettingsTab.swift
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky (cherry picked from commit 67edc77) # Conflicts: # apps/ios/Sources/Gateway/GatewayConnectionController.swift # apps/ios/Sources/Info.plist # apps/ios/Sources/Settings/SettingsTab.swift # apps/ios/project.yml
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…claw#22135) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 92c2660 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
Yes)No)No)Yes)Yes)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
pnpm ios:genxcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination 'generic/platform=iOS Simulator' -configuration Debug build -quietExpected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
SettingsTabis resolved, validated permission-gating code paths compile.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
23693c7aa.apps/ios/Sources/Gateway/GatewayConnectionController.swift,apps/ios/Sources/Info.plist,apps/ios/Sources/Settings/SettingsTab.swift,apps/ios/project.yml, and remove added permission files.Risks and Mitigations
IOSPermissionCenterkeeps updates in one place.SettingsTabcan regress compiler performance.Greptile Summary
Centralized iOS permission management and gated gateway capabilities by permission state.
Major changes:
IOSPermissionCenterto centralize permission checking for photos, contacts, calendar, reminders, and motionCritical issue:
GatewayConnectionController.swift:687has incorrect byte-order conversion that will break loopback IP detection on iOS devices (little-endian systems)Confidence Score: 2/5
apps/ios/Sources/Gateway/GatewayConnectionController.swift- the ntohl replacement breaks loopback detectionLast reviewed commit: 23693c7