Repository navigation
收紧 iCloud 会话目录和令牌文件的权限 - #1
Merged
Merged
Conversation
umask 022 时会话目录会落成 0755,会话 JSON(session token 与 trust token)和 cookies 会落成 0644,本机其他账户在父目录可穿越时就能读到这些认证密钥。Rust 与 Python 都改为目录 0700、文件 0600,已有更宽的权限也会收紧,且不依赖调用方的 umask。 Co-authored-by: hljghost <hljghost@users.noreply.github.com>
Windows 作业在 clippy 之前就退出:清单路径仍是 icopia\Cargo.toml。 Co-authored-by: hljghost <hljghost@users.noreply.github.com>
5 tasks done
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.
问题
Omarchy marketplace 维护者在 omacom/omarchy-plugin-marketplace#14569 对 icdown
b1e179bfffb68b2c64bfaa6aa2ab965f7dee2f32的审查结论:当前 HEAD 上位置仍对应:Rust 在
Puente::iniciar_con里用create_dir_all建会话目录;Python 在原子写入(puente/puente_icloud.py的_escribir_atomico)里用默认的open()写会话 JSON。pyicloud v1.33.0 把 session token 和 trust token 放在同一个.sessionJSON 里,并用makedirs(cookie_directory, 0o700, exist_ok=True),不会改已经存在的目录。修复
权限不再依赖调用方的 umask(umask 只会去掉权限位,不能把
0666/0777收成私有):0700创建。若已经存在且比0700更开放(例如0755),则chmod为0700。已经更严的目录保持原样。0600写入。同目录里的 cookie 文件也是认证密钥,同样写成0600。已有更开放的普通文件会收紧到0600;已经更严的(例如0400)不放宽。不跟随符号链接,因此不会改到目录外的目标。Puente::iniciar_con,启动桥之前)和 Python(asegurar_directorio_sesion,在main和真正构造PyiCloudService之前,以及原子写入和 cookie jar 保存时)两条路径都做同样的收紧。测试
0700;已有的0755目录和0644的.session/ cookie 被收紧且内容不变;符号链接指向的文件保持0644;0400不被放宽;iniciar_con会收紧已有目录和 JSON。022与000下,目录为0700,会话 JSON 与 cookie 为0600。已有内容不被改写,更严的0400保持不变。Windows 上该用例跳过(无 Unix 权限位)。CI
Windows 作业原先在
cargo clippy处失败,因为清单路径仍是已不存在的icopia\Cargo.toml。现改为icdown\Cargo.toml。Python 测试在这次失败的作业里已经通过(48 passed,1 skipped)。