team-ljyzipelo

공개

파일 충돌 처리에 최신 main 변경을 병합한다

작성자
호시노 히나타
작성 시각
커밋
97cf3f19f9f1435ac4aceb68fe7ed163342470a1
이 시점의 파일 보기

변경된 파일 39개

+1,961-98

변경 내용이 커서 일부 파일의 Diff를 생략했어요. 생략한 파일은 파일 보기나 Raw로 확인할 수 있어요.

수정README.md+4-2
@@ -10,6 +10,8 @@
1010
1111## 이런 걸 할 수 있어요
1212
13추가: 아래 사용 안내는 다운로드로 제공하는 v0.1.0 기준입니다.
14추가:
1315- **압축 풀기:** [열기]로 압축 파일을 고르거나 창에 끌어 놓으세요. [압축해제]를 누르고 저장할 곳을 고르면 됩니다. 원하는 파일과 폴더만 선택해서 풀 수도 있습니다.
1416- **ZIP 만들기:** [압축하기]를 눌러 묶을 폴더를 고른 뒤, ZIP 만들기 창에서 [압축하기]를 누르고 저장할 이름과 위치를 정하세요.
1517- **암호로 보호하기:** ZIP을 만들 때 [암호로 보호하기]를 켜면 암호를 설정할 수 있습니다. 암호가 걸린 ZIP을 풀 때는 암호를 입력합니다.
@@ -30,7 +32,7 @@ Ubuntu에서는 [.deb 설치 파일](https://github.com/Team-LJY/zipelo/releases
3032## 아직 안 되는 것과 사용 전 알아둘 점
3133
3234- RAR 열기, 손상된 압축 파일 복구, 파일 내용 미리보기는 지원하지 않습니다.
33삭제: - 여러 조각으로 나뉜 압축 파일, 7z 만들기, TAR.BZ2와 TAR.XZ는 지원하지 않습니다.
35추가: - 여러 조각으로 나뉜 압축 파일과 7z 만들기는 지원하지 않습니다. TAR.BZ2와 TAR.XZ 풀기는 개발 중인 main에서 해결됐으며([PR119](https://github.com/Team-LJY/zipelo/pull/119)), 게시된 v0.1.0에는 포함되지 않습니다. Wayland 파일 선택 창과 릴리스 설치 패키지 검증은 남아 있습니다.
3436- 한 번에 푸는 파일의 전체 크기와 ZIP으로 묶는 원본의 전체 크기는 각각 16 GiB까지입니다.
3537- Zipelo에서 암호를 걸어 만든 ZIP은 Windows 탐색기의 기본 압축 기능으로 열 수 없습니다. Zipelo나 7-Zip을 사용하세요. 암호를 잊으면 파일을 열 수 없습니다.
3638- 같은 이름의 파일을 덮어쓰지 않습니다. 이름이 겹치면 다른 저장 위치나 이름을 선택하세요.
@@ -41,6 +43,6 @@ Ubuntu에서는 [.deb 설치 파일](https://github.com/Team-LJY/zipelo/releases
4143
4244## 개발자용
4345
44삭제: Rust로 개발하며 압축 처리는 별도 작업자 프로세스에서 수행합니다. 로컬 빌드와 시험은 `python3 tests/ci/run_rust.py local`로 실행합니다.
46추가: Rust로 개발하며 압축 처리는 별도 작업자 프로세스에서 수행합니다. 로컬 빌드와 시험은 `python3 tests/ci/run_rust.py local`로 실행합니다. 프로젝트 이동 뒤 긴 경로 때문에 시험 실행기가 멈추던 문제는 main에서 해결됐습니다([PR118](https://github.com/Team-LJY/zipelo/pull/118)). 새 실제 경로에서 별칭이나 경로 매핑 없이 전체 local 검증을 통과한 기록이 있습니다.
4547
4648[기획서](docs/PLANS.md)와 [UI 설계](docs/ui-design-v0.1.md)를 참고하세요. 소스는 [MIT 라이선스](LICENSE)로 공개합니다.
수정docs/PLANS.md+15-12
@@ -81,7 +81,7 @@ python3 -B tests/rust-memory-gzip-reader/static_check.py \
8181
8282## 8. v0.2 한계 개선 계획
8383
84삭제: 2026-11-13의 사용자 지시에 따라 [README](../README.md)와 [v0.1 릴리스 노트](release-notes-v0.1.md)의 한계를 개선 대상으로 관리한다. 아래 방법과 수용 기준은 계획안이며 구현 완료나 출시 약속이 아니다. v0.1의 제외 항목은 과거 범위로 유지한다. JAR와 앱/문서용 컨테이너 제외는 의도한 제품 범위이므로 이번 개선에 넣지 않는다.
84추가: 2026-11-13의 사용자 지시에 따라 [README](../README.md)와 [v0.1 릴리스 노트](release-notes-v0.1.md)의 한계를 개선 대상으로 관리한다. 아래 방법과 수용 기준은 계획안이며, 해결됨 항목은 main 반영을 뜻하고 릴리스 배포 완료를 뜻하지 않는다. v0.1의 제외 항목은 과거 범위로 유지한다. JAR와 앱/문서용 컨테이너 제외는 의도한 제품 범위이므로 이번 개선에 넣지 않는다.
8585
8686우선순위 P1은 데이터 보존과 일상 사용의 장애 해결, P2는 형식 및 사용성 확장, P3는 범위가 큰 탐색 과제다. 작업 크기는 상대 추정으로 소는 단일 영역, 중은 여러 경로와 시험, 대는 형식 처리 또는 플랫폼 통합, 특대는 신규 처리 계층과 광범위한 검증을 뜻한다. 일정 추정은 아니며 상세 설계 후 조정한다. 배정됨으로 표시한 작업 외의 담당 역할은 제안이며 새 작업 배정을 뜻하지 않는다.
8787
@@ -115,10 +115,11 @@ python3 -B tests/rust-memory-gzip-reader/static_check.py \
115115
116116### 8.5 TAR.BZ2와 TAR.XZ 해제
117117
118삭제: - 상태와 우선순위: 라이브러리 사용 승인, 배정됨, P2. backend가 같은 이름 충돌 작업자를 마친 뒤 `features/tar-bz2-xz`에서 진행한다.
119삭제: - 해결 방법: 순수 Rust이며 허용된 자유 라이선스인 BZip2 및 XZ 해제 라이브러리를 골라 기존 TAR 처리에 연결한다. 지원 범위, 유지보수와 자원 제한을 확인하고 도입 PR에 선택 이유 및 배포 라이선스 고지를 포함한다. 특정 라이브러리의 적합성을 이 계획에서 확정하지 않는다.
120삭제: - 작업 크기와 담당: 라이브러리 통합은 대로 추정한다. backend는 구현, bugfix는 리뷰와 호환 검증을 맡는다. frontend의 형식 및 오류 표시 변경이 필요하면 범위를 합의한다.
121삭제: - 수용 기준: 두 형식의 정상 파일, 빈 파일, 잘린 입력, 손상, 큰 사전 요구, 압축 폭탄, 경로 이탈과 취소를 시험한다. 기준 도구로 푼 결과와 파일 해시가 일치하고 기존 16 GiB 한도, 여유 공간 확인 및 경로 안전 검사를 유지해야 한다. `packaging/licenses.py`가 만드는 고지에 새 라이브러리가 포함되어야 한다.
118추가: - 상태와 우선순위: 해결됨(main 반영), P2. [PR119](https://github.com/Team-LJY/zipelo/pull/119)가 2026-11-13에 병합됐다. 게시된 v0.1.0에는 포함되지 않는다.
119추가: - 해결 내용: 순수 Rust 해제 라이브러리를 기존 TAR 처리에 연결하고 파일 선택 필터, 지원 안내, 복합 확장자의 해제 폴더 이름과 UI 상황을 갱신했다. 기존 16 GiB 한도, 여유 공간 확인 및 경로 안전 검사를 유지하며 새 라이브러리는 배포 라이선스 고지에 포함했다.
120추가: - 담당: backend 구현, frontend 화면 연동, bugfix 리뷰 및 Windows 호환 검증.
121추가: - 검증 근거: PR119 기록상 손상 XZ 인덱스 회귀를 포함한 압축 TAR 시험 17개와 전체 local의 Rust 시험 1,112개가 통과했다. 해당 local 실행은 PR118 반영 전의 짧은 경로 매핑을 사용했다. Windows 11에서 두 형식을 실제 해제해 각 4개 파일의 원본 해시 일치와 기본 파일 선택 창 표시를 확인했다.
122추가: - 남은 검증: Wayland 기본 파일 선택 창과 Windows 릴리스 설치 패키지는 미검증이다. 이 기록은 병합된 main에서 전체 시험을 다시 실행한 결과가 아니다.
122123
123124### 8.6 암호 ZIP의 Windows 탐색기 호환 제외
124125
@@ -155,15 +156,17 @@ python3 -B tests/rust-memory-gzip-reader/static_check.py \
155156- 작업 크기와 담당: 특대. backend는 탐색과 복구, frontend는 결과 및 경고, bugfix는 손상 표본 검증을 맡는 안이다.
156157- 수용 기준: 헤더 손상, 중간 절단, 본문 손상, 복구 불가 표본을 구분하고 원본 해시를 유지한다. 복구 가능한 파일은 기대 해시와 대조하며 불완전한 복구를 정상 완료로 표시하지 않는다. 복구 과정에도 경로 및 자원 제한을 적용한다.
157158
158삭제: ### 8.11 RAR 압축과 해제의 라이선스 연구
159추가: ### 8.11 RAR 압축과 해제 제외
159160
160삭제: - 상태와 우선순위: 연구 배정됨, P3. 사용자는 RAR 지원 방향을 요청했으며 압축과 해제 모두 코드 구현에 앞서 웹 검색과 연구를 하도록 결정했다. 연구가 끝나고 이준영 님이 방향을 정하기 전까지 구현은 보류한다.
161삭제: - 해결 방법: `docs/rar-license-research.md`에 unRAR 조건 원문, libarchive의 RAR 4 및 RAR5 코드 출처와 파일별 라이선스, Rust 후보의 의존성과 조건, 특허 및 독점 주장과 정식 라이선스 경로를 조사한다. libarchive의 Rust 이식, 연결 사용, 형식 자료 기반 신규 구현, 압축 미지원 또는 정식 라이선스 방안을 비교한다. 공식 unRAR 코드는 사용하지 않는다.
162삭제: - 작업 크기와 담당: 연구는 중으로 추정한다. planning이 문서 작성, bugfix가 라이선스 관점 리뷰를 맡는다. 구현 크기와 담당 배정은 연구 후 방향 및 지원 범위를 정할 때 다시 판단한다.
163삭제: - 수용 기준: 압축과 해제를 구분해 각 방안의 라이선스 위험, 작업 크기, 외부 의존성과 권장안을 제시한다. 주장마다 원문 링크를 달고 확인하지 못한 내용은 미확인으로 표시한다. 연구 문서가 자유 라이선스 구현 가능성을 미리 확정하거나 코드 도입 승인을 대신하지 않아야 한다.
161추가: - 상태와 우선순위: v0.2에서 제외. 2026-11-13 이준영 님 결정에 따라 RAR 압축과 해제 모두 도입하지 않는다.
162추가: - 재검토 조건: 라이선스 걱정 없이 쓸 방법이 확인될 때만 다시 검토한다. 공식 unRAR 코드는 사용하지 않는다.
163추가: - 작업 범위와 담당: planning은 [기존 연구](rar-license-research.md)에 결정과 미확인 사항을 남기고 bugfix가 문서를 리뷰한다. 추가 후보 출처 감사와 구현은 진행하지 않으며 RARLAB에 문의하지 않는다.
164추가: - 수용 기준: 계획과 연구 문서에 제외 및 재검토 조건을 명시하고 README의 미지원 안내와 일치시킨다. 기존 연구 결과를 후보 채택이나 법적 적합성 확정으로 표현하지 않는다.
164165
165166### 8.12 나머지 위험과 검증 범위
166167
168추가: - 프로젝트 이동 후 시험 실행기 중단: 해결됨(main 반영). [PR118](https://github.com/Team-LJY/zipelo/pull/118)이 2026-11-13에 병합됐다. 시험 소켓을 상대 경로로 바인딩해 긴 절대 경로의 길이 제한을 피하며 실제 파일 위치와 기존 안전 검사를 유지한다. 작성자는 새 실제 경로에서 별칭이나 경로 매핑 없이 전체 local 63단계(Linux 빌드, 시험, Windows 교차 빌드 각 21단계) 통과를 기록했고, 리뷰어는 실행기 시험 42개와 파일 게시 시험 55개를 직접 확인했다. Windows 실제 실행 검증을 뜻하지 않는다.
169추가:
167170- 부분 출력과 임시 파일: P1, 중. backend와 bugfix가 실패 및 취소 시 남은 출력 목록과 재정리 방법을 검토한다. 디스크 부족, 동기화 실패와 정리 실패를 주입해 성공 오표시가 없고 무관한 파일을 지우지 않는 것을 수용 기준으로 한다. frontend는 필요한 결과 안내를 맡는다.
168171- 플랫폼 검증 공백: P2, 중. bugfix가 Windows 재부팅 후 연결, 지원 대상으로 정한 Windows와 Ubuntu 버전, 잘못된 암호 재시도 및 실제 UI 상황 명령 실행을 확인하는 안이다. 결과에 OS 버전과 실행한 흐름을 남기고 미검증 환경을 지원 완료로 표현하지 않는다. 이미 확인한 Wayland 아이콘과 Windows 다섯 확장자 연결은 관련 변경이 있을 때 회귀 검증한다.
169172- 설치 파일 서명 부재: P2, 중. planning이 서명 방식과 비용을 정리하고 설치 담당과 적용 범위를 합의하는 안이다. 인증서 구매와 서명은 이준영 님 결정 대기이며, 수용 기준은 승인된 방식의 서명 검증과 실제 설치 안내 확인이다. 서명만으로 모든 운영체제 경고가 사라진다고 약속하지 않는다.
@@ -171,8 +174,8 @@ python3 -B tests/rust-memory-gzip-reader/static_check.py \
171174
172175### 8.13 진행과 완료 판단
173176
174삭제: - 우선 배정된 충돌 처리와 Windows 업데이트를 검증하고, TAR.BZ2/XZ는 작업자 충돌 처리 이후 진행한다. RAR은 연구를 먼저 하고 이준영 님의 방향 결정 전까지 구현을 보류한다. 암호 ZIP의 Windows 탐색기 호환은 목표에서 제외한다. 나머지 후보의 우선순위와 크기는 검토안이며 동시 착수를 지시하지 않는다.
175삭제: - 2026-11-13 사용자 결정과 갱신된 팀 규칙에 따라 순수 Rust이고 MIT, Apache, BSD, zlib 같은 자유 라이선스인 외부 라이브러리를 사용할 수 있다. 도입 PR에 선택 이유와 라이선스 고지를 포함하고 packaging/licenses.py의 배포 고지에 반영한다. 이 기준 밖의 의존성은 사전 확인을 받는다. RAR 구현 보류와 공식 unRAR 코드 사용 금지는 별도로 유지한다. 공용 계약은 backend와 frontend 합의가 선행되어야 한다.
177추가: - 우선 배정된 충돌 처리와 Windows 업데이트를 검증하고, TAR.BZ2/XZ와 프로젝트 이동 후 시험 실행기 중단 문제는 main에서 해결됐다(8.5절, 8.12절). RAR 압축과 해제는 v0.2에서 제외하며 라이선스 걱정 없이 쓸 방법이 확인될 때만 다시 검토한다. 암호 ZIP의 Windows 탐색기 호환은 목표에서 제외한다. 나머지 후보의 우선순위와 크기는 검토안이며 동시 착수를 지시하지 않는다.
178추가: - 2026-11-13 사용자 결정과 갱신된 팀 규칙에 따라 순수 Rust이고 MIT, Apache, BSD, zlib 같은 자유 라이선스인 외부 라이브러리를 사용할 수 있다. 도입 PR에 선택 이유와 라이선스 고지를 포함하고 packaging/licenses.py의 배포 고지에 반영한다. 이 기준 밖의 의존성은 사전 확인을 받는다. RAR 압축과 해제 제외 및 공식 unRAR 코드 사용 금지는 별도로 유지한다. 공용 계약은 backend와 frontend 합의가 선행되어야 한다.
176179- 제품 변경 PR은 해당 회귀 시험과 `python3 tests/ci/run_rust.py local` 결과를 기록하고, 설치 변경은 패키지 시험과 플랫폼 실기를 포함한다. 시험 및 시험용 도구는 프로젝트 루트의 `tests/` 아래에만 둔다.
177180- 화면이 바뀌면 같은 PR에서 `--ui-scenario` 상황, 시험 및 [상황별 UI 가이드](ui-scenario-guide.md)를 함께 갱신한다. 화면 변화가 없으면 PR 본문에 "UI 변경 없음"을 적는다. 사용자가 직접 올린 UI PR의 누락은 병합 뒤 frontend가 보완한다.
178181- 각 기능의 실제 병합 및 검증 근거가 확보된 뒤 README와 릴리스 노트의 해당 한계를 갱신한다. 전체 후보를 한 번에 완료해야 한다고 가정하지 않고, 다음 출시 범위와 미해결 항목을 별도로 합의한다. 릴리스 게시는 별도 승인을 따른다.
수정docs/rar-license-research.md+9-3
@@ -1,8 +1,14 @@
11# RAR 압축과 해제 라이선스 연구
22
3삭제: 조사일: 2026-11-13. 대상은 Zipelo의 RAR 압축과 해제 지원 방향이며 제품 구현이나 라이브러리 채택 승인이 아니다. 사용자 지시에 따라 연구 후 방향이 결정되기 전까지 구현을 보류한다. 이 문서는 공개 원문 검토이며 법률 의견이나 특허 비침해 보증이 아니다.
3추가: 조사일: 2026-11-13. 대상은 Zipelo의 RAR 압축과 해제 지원 방향이며 제품 구현이나 라이브러리 채택 승인이 아니다. 이 문서는 공개 원문 검토이며 법률 의견이나 특허 비침해 보증이 아니다.
44
5삭제: ## 1. 판단 요약
5추가: ## 2026-11-13 사용자 결정
6추가:
7추가: RAR 압축과 해제는 v0.2에서도 제외한다. 라이선스 걱정 없이 쓸 방법이 확인되지 않으면 도입하지 않으며, 그 조건이 확인될 때만 다시 검토한다. 추가 후보 출처 감사는 진행하지 않고 RARLAB 문의도 하지 않는다.
8추가:
9추가: 아래 내용은 이 결정 전에 수행한 연구 기록이다. 당시의 대안과 권장 순서는 현재 진행할 작업이나 채택 승인이 아니다. rars와 rar 0.4.0의 추가 점검은 착수하지 않았으며, 커밋 이력과 연구 자료의 전체 출처, 버전별 라이선스 변경, cargo metadata를 통한 전이 의존성 전체, 실제 지원 범위와 호환성은 미확인이다. 기존에 확인한 후보의 공개 표기와 한계는 4절에 남긴다.
10추가:
11추가: ## 1. 판단 요약 (결정 전 연구)
612
713- 해제 구현 후보는 존재하지만 라이선스 이름만으로 선택하면 안 된다. libarchive의 두 RAR 읽기 파일은 BSD-2-Clause 조건을 표시한다. 다만 RAR5 작성자는 libunrar 구조를 참고했다고 설명하므로, 설명서만 사용한 독립 구현이라고 단정할 수 없다. [RAR4 파일](https://github.com/libarchive/libarchive/blob/master/libarchive/archive_read_support_format_rar.c), [RAR5 파일](https://github.com/libarchive/libarchive/blob/master/libarchive/archive_read_support_format_rar5.c), [작성자 설명](https://github.com/libarchive/libarchive/pull/1061#issuecomment-419696568).
814- 공식 UnRAR는 무료 사용을 허용하지만 압축기 개발 및 압축 알고리즘 재현에 제한을 둔다. Zipelo의 자유 라이선스 요구와 공식 unRAR 코드 사용 금지 방침에 따라 채택 후보에서 제외한다. Rust로 감싸거나 이식해도 원래 조건이 없어지는 것은 아니다. [동봉 라이선스](https://github.com/muja/unrar.rs/blob/master/unrar_sys/vendor/unrar/license.txt).
@@ -93,7 +99,7 @@
9399- 외부 의존성: 미지원 유지에는 없음. 계약 경로는 제공되는 엔진/실행 파일과 조건에 따라 달라져 미정이다.
94100- 판단: 당장은 생성 보류가 현실적이다. 비용이나 계약을 약정하지 않으며 자유로운 수정 및 배포가 가능한지 서면 조건부터 확인해야 한다.
95101
96삭제: ## 6. 권장 순서와 결정에 필요한 증거
102추가: ## 6. 당시 권장 순서와 미확인 증거
97103
981041. RAR 생성을 보류한 상태로 해제 후보의 소스 출처와 실제 버전별 라이선스를 우선 감사한다. 순수 Rust 후보가 적합하면 대규모 이식보다 먼저 평가하는 것을 권한다. 4절의 후보 소개는 조사 대상 제안이며 구현 지시가 아니다.
991052. libarchive RAR5를 설명서만으로 만든 구현이라고 안내하지 않는다. 해당 코드와 이를 참고한 후보의 출처를 검토하고, 압축기 구현에 사용할 수 있는지 별도 판단한다.
수정docs/ui-design-v0.1.md+1-1
@@ -269,7 +269,7 @@
269269
270270고정 문구:
271271
272삭제: - 빈 화면: "압축파일을 여기에 끌어 놓으세요", "또는", "ZIP, 7z, TAR, GZ, TAR.GZ 파일을 열 수 있습니다", "놓으면 엽니다"
272추가: - 빈 화면: "압축파일을 여기에 끌어 놓으세요", "또는", "ZIP, 7z, TAR, GZ, TAR.GZ, TAR.BZ2, TAR.XZ 파일을 열 수 있습니다", "놓으면 엽니다"
273273- 닫기 확인 창 "작업 중 닫기": "작업을 취소하고 닫을까요?", 버튼 [계속 작업]과 [취소하고 닫기]
274274- "종료 확인 중" 창: "마무리하는 중입니다. 잠시만 기다려 주세요", 버튼 [닫기 취소]
275275
수정docs/ui-scenario-guide.md+4-0
@@ -42,6 +42,8 @@ cargo +1.99.1 build --locked --manifest-path experiments/rust-ui-memory-app/Carg
4242## 상황과 확인할 점
4343
4444- empty: 빈 첫 화면. 파일 열기 안내와 툴바 배치를 확인한다.
45추가: - tar-bz2: TAR.BZ2 목록. 제목표시줄의 파일 이름과 목록을 확인한다.
46추가: - tar-xz: TAR.XZ 목록. 제목표시줄의 대소문자가 섞인 복합 확장자와 목록을 확인한다.
4547- archive: 파일과 폴더가 있는 압축파일. 이름, 크기, 잠금 아이콘과 상태 줄을 확인한다.
4648- folder: 사진 폴더 내부. 상위 폴더 이동과 경로 줄을 확인한다.
4749- many-items: 기본 5개 외에 500개 파일을 추가한 목록. 스크롤바와 행 배치를 확인한다.
@@ -104,3 +106,5 @@ python3 tests/ci/run_rust.py local
104106- extract-rename-failed: 새 이름을 정한 뒤 실제 생성 보고 없이 I/O 오류가 난 결과입니다. 실패 원인과 "아무 파일도 풀지 않았습니다"를 표시하고 "이름 바꿔 저장" 완료 안내는 표시하지 않아야 합니다. 일부 파일이 저장된 뒤 실패한 경우에도 생성 보고가 있는 이름만 저장 완료로 표시합니다.
105107
106108실제 추출은 revision 3의 StartInteractive를 보내며 ZIP, 7z, TAR 계열과 단일 GZ의 파일 충돌에 같은 선택 창을 사용합니다. 목록 읽기와 ZIP 만들기는 기존 Start를 유지합니다. 위 명령은 실제 파일을 쓰지 않는 개발용 화면 미리보기입니다. 파일 기반 버튼 연동은 tests/rust-app-real-worker/conflict_flows.rs에서 확인하며, 운영체제별 실제 창 확인은 별도입니다.
109추가:
110추가: TAR.BZ2와 TAR.XZ의 자동 해제 폴더 이름은 미리보기에 표시되지 않는다. tests/rust-app-ui/presentation.rs의 이름 시험과 tests/rust-app-real-worker/compressed_tar_flows.rs의 실제 작업자 시험에서 복합 확장자 제거와 해제 결과를 확인한다.
수정experiments/rust-archive-worker/Cargo.lock+101-11
@@ -10,7 +10,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
1010dependencies = [
1111 "cfg-if",
1212 "cipher",
13삭제: "cpufeatures",
13추가: "cpufeatures 0.2.17",
1414 "zeroize",
1515]
1616
@@ -23,6 +23,24 @@ dependencies = [
2323 "generic-array",
2424]
2525
26추가: [[package]]
27추가: name = "block-buffer"
28추가: version = "0.12.1"
29추가: source = "registry+https://github.com/rust-lang/crates.io-index"
30추가: checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
31추가: dependencies = [
32추가: "hybrid-array",
33추가: ]
34추가:
35추가: [[package]]
36추가: name = "bzip2"
37추가: version = "0.6.1"
38추가: source = "registry+https://github.com/rust-lang/crates.io-index"
39추가: checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c"
40추가: dependencies = [
41추가: "libbz2-rs-sys",
42추가: ]
43추가:
2644[[package]]
2745name = "cfg-if"
2846version = "1.0.5"
@@ -35,10 +53,16 @@ version = "0.4.4"
3553source = "registry+https://github.com/rust-lang/crates.io-index"
3654checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
3755dependencies = [
38삭제: "crypto-common",
56추가: "crypto-common 0.1.7",
3957 "inout",
4058]
4159
60추가: [[package]]
61추가: name = "const-oid"
62추가: version = "0.10.3"
63추가: source = "registry+https://github.com/rust-lang/crates.io-index"
64추가: checksum = "be95d4a884358a21a199689323c29e9256b4a1b315e22f183d155422041d3a9a"
65추가:
4266[[package]]
4367name = "cpufeatures"
4468version = "0.2.17"
@@ -48,6 +72,15 @@ dependencies = [
4872 "libc",
4973]
5074
75추가: [[package]]
76추가: name = "cpufeatures"
77추가: version = "0.3.1"
78추가: source = "registry+https://github.com/rust-lang/crates.io-index"
79추가: checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
80추가: dependencies = [
81추가: "libc",
82추가: ]
83추가:
5184[[package]]
5285name = "crypto-common"
5386version = "0.1.7"
@@ -58,17 +91,37 @@ dependencies = [
5891 "typenum",
5992]
6093
94추가: [[package]]
95추가: name = "crypto-common"
96추가: version = "0.2.2"
97추가: source = "registry+https://github.com/rust-lang/crates.io-index"
98추가: checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
99추가: dependencies = [
100추가: "hybrid-array",
101추가: ]
102추가:
61103[[package]]
62104name = "digest"
63105version = "0.10.7"
64106source = "registry+https://github.com/rust-lang/crates.io-index"
65107checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
66108dependencies = [
67삭제: "block-buffer",
68삭제: "crypto-common",
109추가: "block-buffer 0.10.4",
110추가: "crypto-common 0.1.7",
69111 "subtle",
70112]
71113
114추가: [[package]]
115추가: name = "digest"
116추가: version = "0.11.3"
117추가: source = "registry+https://github.com/rust-lang/crates.io-index"
118추가: checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
119추가: dependencies = [
120추가: "block-buffer 0.12.1",
121추가: "const-oid",
122추가: "crypto-common 0.2.2",
123추가: ]
124추가:
72125[[package]]
73126name = "generic-array"
74127version = "0.14.7"
@@ -85,7 +138,16 @@ version = "0.12.1"
85138source = "registry+https://github.com/rust-lang/crates.io-index"
86139checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
87140dependencies = [
88삭제: "digest",
141추가: "digest 0.10.7",
142추가: ]
143추가:
144추가: [[package]]
145추가: name = "hybrid-array"
146추가: version = "0.4.15"
147추가: source = "registry+https://github.com/rust-lang/crates.io-index"
148추가: checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
149추가: dependencies = [
150추가: "typenum",
89151]
90152
91153[[package]]
@@ -97,19 +159,34 @@ dependencies = [
97159 "generic-array",
98160]
99161
162추가: [[package]]
163추가: name = "libbz2-rs-sys"
164추가: version = "0.2.6"
165추가: source = "registry+https://github.com/rust-lang/crates.io-index"
166추가: checksum = "32f454fd6831a29c0e827ed075bca2a15be201bd57f4168f0fd1041124eab17e"
167추가:
100168[[package]]
101169name = "libc"
102170version = "0.2.191"
103171source = "registry+https://github.com/rust-lang/crates.io-index"
104172checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
105173
174추가: [[package]]
175추가: name = "lzma-rust2"
176추가: version = "0.25.0"
177추가: source = "registry+https://github.com/rust-lang/crates.io-index"
178추가: checksum = "ef1d73c59a56771343712b22ea5615092c612c16ba291c0979e3105dfeec4890"
179추가: dependencies = [
180추가: "sha2 0.11.1",
181추가: ]
182추가:
106183[[package]]
107184name = "pbkdf2"
108185version = "0.12.2"
109186source = "registry+https://github.com/rust-lang/crates.io-index"
110187checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
111188dependencies = [
112삭제: "digest",
189추가: "digest 0.10.7",
113190 "hmac",
114191]
115192
@@ -120,8 +197,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
120197checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
121198dependencies = [
122199 "cfg-if",
123삭제: "cpufeatures",
124삭제: "digest",
200추가: "cpufeatures 0.2.17",
201추가: "digest 0.10.7",
125202]
126203
127204[[package]]
@@ -131,8 +208,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
131208checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
132209dependencies = [
133210 "cfg-if",
134삭제: "cpufeatures",
135삭제: "digest",
211추가: "cpufeatures 0.2.17",
212추가: "digest 0.10.7",
213추가: ]
214추가:
215추가: [[package]]
216추가: name = "sha2"
217추가: version = "0.11.1"
218추가: source = "registry+https://github.com/rust-lang/crates.io-index"
219추가: checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"
220추가: dependencies = [
221추가: "cfg-if",
222추가: "cpufeatures 0.3.1",
223추가: "digest 0.11.3",
136224]
137225
138226[[package]]
@@ -164,10 +252,12 @@ name = "zipelo-archive-worker"
164252version = "0.1.0"
165253dependencies = [
166254 "aes",
255추가: "bzip2",
167256 "hmac",
257추가: "lzma-rust2",
168258 "pbkdf2",
169259 "sha1",
170삭제: "sha2",
260추가: "sha2 0.10.9",
171261 "subtle",
172262 "zeroize",
173263 "zlib-rs",
수정experiments/rust-archive-worker/Cargo.toml+8-0
@@ -7,6 +7,8 @@ publish = false
77autotests = false
88
99[dependencies]
10추가: bzip2 = "=0.6.1"
11추가: lzma-rust2 = { version = "=0.25.0", default-features = false, features = ["std", "xz"] }
1012aes = { version = "=0.8.4", features = ["zeroize"] }
1113hmac = "=0.12.1"
1214pbkdf2 = { version = "=0.12.2", default-features = false, features = ["hmac"] }
@@ -25,3 +27,9 @@ path = "../../tests/rust-archive-worker/main.rs"
2527# 대용량 시험의 CRC와 Deflate에도 배포판의 최적화를 적용함.
2628[profile.dev.package.zlib-rs]
2729opt-level = 3
30추가:
31추가: [profile.dev.package.libbz2-rs-sys]
32추가: opt-level = 3
33추가:
34추가: [profile.dev.package.lzma-rust2]
35추가: opt-level = 3
수정experiments/rust-archive-worker/README.md+21-2
@@ -2,7 +2,7 @@
22
33별도 프로세스의 stdin/stdout으로 revision 3 요청을 처리합니다. 제품 앱이 공유 codec으로 연결하며 프로세스 분리는 OS sandbox를 뜻하지 않습니다. 암호 기능은 capability=true이며 ZipCrypto 해제, WinZip AES-256 AE-1/AE-2 해제와 AE-2 생성을 지원합니다.
44
5삭제: - ZIP32/ZIP64 Store/Deflate 목록과 해제, ZIP32/ZIP64 생성, 기본 TAR/USTAR, GZ, TAR.GZ, 비암호화 7z 해제를 지원합니다. GZ 연결 멤버는 하나의 논리 스트림으로 합칩니다. 다중 볼륨, UTF-8로 해석할 수 없는 ZIP 이름, PAX/GNU 확장과 특수 항목 해제는 미지원입니다.
5추가: - ZIP32/ZIP64 Store/Deflate 목록과 해제, ZIP32/ZIP64 생성, 기본 TAR/USTAR, GZ, TAR.GZ, TAR.BZ2, TAR.XZ, 비암호화 7z 해제를 지원합니다. GZ 연결 멤버는 하나의 논리 스트림으로 합칩니다. 다중 볼륨, UTF-8로 해석할 수 없는 ZIP 이름, PAX/GNU 확장과 특수 항목 해제는 미지원입니다.
66- ZIP 이름: UTF-8 플래그(비트 11)가 있으면 이름이 UTF-8이어야 하며 아니면 Integrity입니다. 플래그가 없으면 CRC가 원래 이름과 맞는 Info-ZIP Unicode Path 확장 필드(0x7075, 버전 1)를 우선 쓰고, 다음으로 UTF-8로 유효한 이름 바이트를 그대로 씁니다(Linux/macOS 도구의 기본 동작). CRC가 다르거나 버전이 다른 확장 필드는 무시합니다. 그 밖의 CP437/CP949 등 레거시 이름은 코드 페이지를 추측하지 않고 UnsupportedFeature로 거부합니다. 어느 경로로 얻은 이름이든 같은 경로 안전성 검사와 충돌 검사를 거칩니다.
77- ZIP/TAR/GZ/TAR.GZ/7z 목록과 해제는 입력 기본 한도 u64::MAX, 해제 총량 16 GiB, 항목 10,000개입니다. 요청 limits는 이 값을 낮출 수 있습니다. 64 KiB 버퍼와 임시 파일로 입력과 검증 완료 payload를 처리해 모든 출력의 CRC, 크기와 경로를 게시 전에 검사합니다. checkpoint마다 취소, 부모 프로세스 생존과 300초 한도를 확인합니다. ZIP 생성은 원본을 하나씩 스냅샷으로 읽어 스트리밍으로 압축하며 원본 크기 합계에 16 GiB 한도를 적용합니다. ZIP64 크기와 오프셋은 필요한 항목에만 기록합니다. slice 기반 archive parser는 입력 64 MiB/출력 128 MiB, slice ZIP builder는 원본 및 결과 128 MiB 한도를 유지합니다.
88- 경로 깊이는 64개 구성 요소, 이름/출력 계획 메타데이터 예산은 8 MiB, 출력 계획 노드는 32,768개로 제한합니다. 이름 복제와 인덱스 비용을 보수적으로 계산해 할당 전에 Limit으로 거부합니다.
@@ -17,7 +17,7 @@
1717revision 2의 기존 필드와 오류 tag 0~12 및 입력/출력 기본 한도를 유지하고, 히나타 님과 합의한 공간 부족 오류 DiskFull(tag 13)을 추가합니다. 구버전 앱은 새 tag를 거부하므로 앱 오류 변환과 화면 매핑을 작업자와 함께 갱신해야 합니다. 앱이 공유하는 Limits::default()도 같은 값을 사용합니다. 세부 계약은 contract.json의 streaming_limits에 있습니다.
1818
1919- 압축비는 거부 조건으로 사용하지 않습니다. ZIP 선언 크기와 실제 해제 크기, CRC와 AES 인증을 검사하며, GZ 연결 멤버의 전체 해제량도 16 GiB 총량 한도에 포함합니다. TAR.GZ의 헤더와 padding도 계산합니다. u64 누계와 offset은 checked 연산을 사용합니다.
20삭제: - 입력 캡처 전에 임시 저장소 여유 공간을 확인합니다. ZIP/7z 해제 전에는 전체 임시 해제량과 선택한 출력량을 볼륨별로 합산해 검사하고, 게시 전에도 출력 공간을 재검사합니다. 미리 해제 크기를 알 수 없는 GZ/TAR.GZ는 각 해제 청크를 쓰기 전에 임시 저장소 공간을 확인합니다. Linux 64비트는 열린 핸들의 [fstatvfs](https://man7.org/linux/man-pages/man3/fstatvfs.3.html), Windows는 핸들에서 얻은 디렉터리의 [GetDiskFreeSpaceExW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskfreespaceexw)를 사용합니다. 공간 부족은 DiskFull(13), 조회 실패와 권한 등 다른 I/O 오류는 Io(8)로 반환합니다. 실제 생성/쓰기/동기화의 공간 부족에도 같은 구분을 적용합니다. Windows의 공간 부족 코드 39와 112는 [공식 오류 목록](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)을 따릅니다.
20추가: - 입력 캡처 전에 임시 저장소 여유 공간을 확인합니다. 기존 Start는 ZIP/7z 해제 전에 전체 임시 해제량과 선택한 출력량을 볼륨별로 합산해 검사하고, 게시 전에도 출력 공간을 재검사합니다. StartInteractive는 선택 전에는 무결성 검증에 필요한 임시 해제 공간만 확인하고, 선택 뒤 건너뛰지 않은 파일의 실제 저장 이름으로 게시 직전 공간을 확인합니다. 따라서 목적지 공간이 부족해도 충돌 파일을 전부 건너뛰거나 질문 중 취소할 수 있습니다. 미리 해제 크기를 알 수 없는 GZ/TAR.GZ는 각 해제 청크를 쓰기 전에 임시 저장소 공간을 확인합니다. Linux 64비트는 열린 핸들의 [fstatvfs](https://man7.org/linux/man-pages/man3/fstatvfs.3.html), Windows는 핸들에서 얻은 디렉터리의 [GetDiskFreeSpaceExW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskfreespaceexw)를 사용합니다. 공간 부족은 DiskFull(13), 조회 실패와 권한 등 다른 I/O 오류는 Io(8)로 반환합니다. 실제 생성/쓰기/동기화의 공간 부족에도 같은 구분을 적용합니다. Windows의 공간 부족 코드 39와 112는 [공식 오류 목록](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)을 따릅니다.
2121- 공간 검사는 논리적 파일 크기에 따른 사전 확인이며 예약이나 모든 메타데이터/할당 단위 비용의 보장이 아닙니다. 다른 작업과 경쟁해 나중에 ENOSPC가 발생하면 기존 부분 출력 정리 정책을 적용합니다. 16 GiB 안에서는 압축비가 매우 큰 파일도 디스크에 풀릴 수 있습니다. 오류 문구는 "디스크 여유 공간이 부족합니다. 공간을 확보한 뒤 다시 시도하세요"이며, detail 문자열을 오류 판정에 사용하지 않습니다.
2222- 입력과 검증된 해제 내용은 임시 파일에 저장합니다. Linux는 [O_TMPFILE](https://man7.org/linux/man-pages/man2/open.2.html), 이를 지원하지 않는 Linux 파일시스템에서는 0600 난수 파일을 배타적으로 만든 즉시 unlink하고 링크 수 0을 확인합니다. Windows는 배타적 [DELETE_ON_CLOSE 파일](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew)을 사용합니다. 마지막 핸들이 닫히면 제거되며 임시 파일명에 아카이브 내부 이름을 사용하지 않습니다. 디스크에는 입력 사본, 해제 내용과 현재 출력 임시 파일이 동시에 필요할 수 있습니다. 임시 폴더가 tmpfs이면 해당 파일 내용은 프로세스 RSS 외의 시스템 메모리를 사용합니다.
2323- 64 MiB는 ZIP/TAR/GZ/TAR.GZ/7z 해제와 ZIP 생성 작업자 프로세스의 피크 RSS 시험 목표입니다. OS 메모리 강제 격리나 모든 아카이브의 보장을 뜻하지 않습니다. 입력 크기와 무관한 메타데이터 예산은 유지합니다.
@@ -35,6 +35,25 @@ revision 2의 기존 필드와 오류 tag 0~12 및 입력/출력 기본 한도
3535- 합성 표본은 Python 표준 lzma로 생성합니다. 별도로 시스템 libarchive가 만든 LZMA1/LZMA2 표본을 해제하고, 합성 표본도 libarchive 읽기 API로 검사합니다. libarchive는 Linux 시험의 독립 참조 도구이며 제품 의존성이 아닙니다. 시험 도구와 표본은 tests/rust-archive-worker 아래에 있습니다.
3636- 형식 확장은 히나타 님과 합의한 Format::SevenZip=4입니다. 기존 값 0~3과 필드, 메시지 tag, 프레임 version은 유지합니다. 구버전 앱은 값 4를 거부하므로 앱 Format과 양방향 변환도 갱신해야 합니다. 이 백엔드 변경은 frontend 코드를 수정하지 않습니다.
3737
38추가: ## 압축 TAR 해제
39추가:
40추가: TAR.BZ2와 TAR.XZ는 확장자가 아닌 BZh 및 XZ 매직으로 판별하고 비공개 임시 파일로 먼저 해제합니다. 연결된 BZip2/XZ 스트림은 하나의 TAR로 합치며 XZ의 4바이트 정렬 스트림 패딩도 허용합니다. 빈 TAR, USTAR 이름과 빈 폴더를 지원하지만 독립 BZ2/XZ 데이터 파일은 TAR가 아니면 거부합니다.
41추가:
42추가: 해제 총량은 TAR 헤더와 패딩을 포함해 기존 16 GiB 이하이며 요청으로 낮출 수 있습니다. 64 KiB씩 실제 해제량을 확인하고 기록 전에 임시 저장소의 공간을 검사합니다. XZ는 블록별 LZMA2 디코더 메모리 32 MiB, 인덱스 8 MiB, 스트림 수와 스트림당 블록 수 각각 32,768을 상한으로 둡니다. 이 상한을 넘는 정상 파일도 Limit로 거부합니다. 해제 전체와 TAR 경로, 항목 종류 및 이름 충돌을 검증하기 전에는 목적지에 게시하지 않습니다. 출력 공간 검사, 안전한 충돌 처리, 취소와 300초 시간 제한도 기존 흐름을 사용합니다.
43추가:
44추가: XZ의 헤더, 인덱스, 푸터 CRC와 역방향 크기 및 전체 선언 해제량을 확인하고 실제 해제량과 비교합니다. 각 블록의 헤더와 LZMA2 청크 경계를 따라 압축 길이와 해제량을 인덱스 레코드 및 선택적 헤더 크기와 대조하므로 다른 블록이나 연결 스트림의 크기 변조가 상쇄되어도 Integrity로 거부합니다. 지원하는 BCJ와 Delta 필터는 길이를 보존합니다. 이 사전 검사는 payload를 해제하거나 할당하지 않으며 기존 디코더가 청크 내용과 데이터 블록의 CRC32/CRC64/SHA256 검사를 수행한 뒤에만 게시합니다. [XZ 명세 4.3절](https://tukaani.org/xz/xz-file-format.txt)의 블록별 Unpadded Size와 Uncompressed Size 검사를 적용합니다. XZ의 Check=None도 형식대로 허용하므로 데이터 체크섬이 없는 파일의 내용 무결성을 보장하지 않습니다. TAR의 PAX/GNU 확장, 링크와 특수 항목의 기존 제한도 유지합니다.
45추가:
46추가: 통신에는 기존 Format::Tar=1을 사용합니다. 압축 방식별 새 형식 값이나 메시지 변경은 없으며 목록 식별자는 원본 객체, 길이와 SHA256을 계속 포함합니다. 화면의 파일 선택 필터와 지원 안내, 새 형식의 UI 상황 추가는 frontend 연동 범위입니다.
47추가:
48추가: 의존성 선택 근거는 다음과 같습니다.
49추가:
50추가: - [bzip2 0.6.1](https://docs.rs/crate/bzip2/0.6.1/source/Cargo.toml)은 MIT OR Apache-2.0이며 기본 백엔드가 Rust 구현인 libbz2-rs-sys입니다. 고정 lockfile은 libbz2-rs-sys 0.2.6(bzip2-1.0.6 자유 라이선스)을 선택하고 Rust 할당자를 사용합니다. C 구현인 bzip2-sys 기능과 stdio/C 할당자는 활성화하지 않습니다.
51추가: - [lzma-rust2 0.25.0](https://docs.rs/lzma-rust2/latest/lzma_rust2/struct.XzReader.html)은 Apache-2.0의 Rust 구현입니다. std와 xz만 활성화해 인코더와 다중 스레드 구현을 제외하고 사전 할당 전 메모리 제한을 적용합니다. CRC와 인덱스 레코드 개수를 검증하며 연결 스트림을 끝까지 읽습니다. 레코드별 크기는 작업자가 별도로 대조합니다.
52추가: - 두 라이브러리와 새 전이 의존성의 원문은 Cargo 체크섬을 대조하는 기존 packaging/licenses.py가 고지에 자동 포함합니다. tests/release-packages/test_compressed_tar_licenses.py는 실제 고지에 세 압축 라이브러리의 원문과 해시가 포함되고 C 압축 백엔드가 없는지 확인합니다.
53추가: - 2026-11-13 [RUSTSEC-2023-0004](https://rustsec.org/advisories/RUSTSEC-2023-0004.html)의 bzip2 DoS 권고와 수정 범위(>=0.4.4)를 확인했습니다. 고정 lockfile의 bzip2 0.6.1은 수정 범위에 해당하므로 이 권고의 영향을 받지 않습니다. 새 전이 sha2 0.11.1은 RUSTSEC-2021-0100의 수정 범위(>=0.9.8)에 해당합니다. 전체 최신 DB 자동 감사와 취약점 부재를 보장하는 확인은 수행하지 않았습니다.
54추가:
55추가: Python 표준 bz2, lzma와 tarfile로 독립 생성 및 해제한 결과의 SHA256과 실제 작업자 결과를 비교합니다. tests/rust-archive-worker/compressed_tar.rs는 정상, 빈 TAR, 연결 스트림, XZ 필터와 체크 방식, 잘림과 손상, 푸터/인덱스 크기, 큰 사전, 작은 출력 한도의 압축 폭탄, 한도 경계, 경로 이탈, 링크, 목록 식별자와 선택, 취소 및 디코더 임시 공간 실패를 검증합니다.
56추가:
3857## 암호 ZIP
3958
4059- AES는 [WinZip AE-1/AE-2 명세](https://www.winzip.com/en/support/aes-encryption/)의 method 99, 0x9901 추가 필드, PBKDF2-HMAC-SHA1 1000회, 16바이트 salt, AES-256 CTR와 HMAC-SHA1-80 형식을 사용합니다. 새 파일은 CRC를 노출하지 않는 AE-2입니다. AE-1은 인증과 CRC를 모두 검증합니다. AES-128/192와 PKWARE Strong Encryption은 미지원입니다.
수정experiments/rust-archive-worker/contract.json+3-2
@@ -166,7 +166,7 @@
166166 "staging": "64 KiB buffers; immutable input capture and verified decoded content use private temporary files that are removed on last-handle close. No decoded content is published until the entire catalog and integrity checks succeed. Temporary disk usage can include the archive plus expanded content plus current destination temporary file; disk exhaustion fails with DiskFull and closes/removes unpublished data.",
167167 "legacy": "The slice parser keeps 64 MiB input /128 MiB output caps; the slice ZIP builder keeps 128 MiB source/result caps. Runtime 7z and ZIP creation use streaming file paths.",
168168 "parent_lifetime": "Capture native parent before reading Start. At decode/read/write/password checkpoints, fail Io if parent is gone; close anonymous staging and remove current unpublished destination temp. stdin EOF alone remains valid for one-shot requests. Already published entries and directories are reported and retained. A blocked OS file operation cannot be forcibly interrupted by this cooperative guard.",
169삭제: "disk_space": "Advisory free-space checks use opened Linux x86_64 filesystem handles (fstatvfs) or the Windows handle-derived directory (GetDiskFreeSpaceExW). Before ZIP/7z decoding and before publication, group remaining staging and selected output logical bytes by volume. For GZip with unknown expanded size, check staging space before each decoded chunk, then preflight selected output. Input capture also checks its snapshot space. Insufficient space returns DiskFull tag 13. Query failure and other I/O errors retain Io tag 8. Checks do not reserve space or account for every metadata/block-allocation overhead; later ENOSPC still closes staging and removes current unpublished output.",
169추가: "disk_space": "Advisory free-space checks use opened Linux x86_64 filesystem handles (fstatvfs) or the Windows handle-derived directory (GetDiskFreeSpaceExW). Legacy Start groups remaining staging and selected output logical bytes by volume before ZIP/7z decoding and before publication. StartInteractive checks required staging before choices, then checks only the current non-skipped output at its resolved name immediately before publication; do not charge undecided or skipped files to the destination. For GZip with unknown expanded size, check staging space before each decoded chunk, then preflight selected output. Input capture also checks its snapshot space. Insufficient space returns DiskFull tag 13. Query failure and other I/O errors retain Io tag 8. Checks do not reserve space or account for every metadata/block-allocation overhead; later ENOSPC still closes staging and removes current unpublished output.",
170170 "remaining_risk": "High compression ratios within 16 GiB may expand fully onto disk. Resource duration, cooperative cancellation and measured memory target remain. Free-space checks can race with other disk users; already published outputs are retained on failure.",
171171 "seven_zip": "Copy, LZMA and LZMA2 use file-backed solid output with checked declared/actual output totals. Encoded headers remain limited to 8 MiB. Dictionary size remains at most 64 MiB; only the last 8 MiB is cached in memory and older dictionary bytes are read from the temporary output.",
172172 "create_zip": "The sum of source logical bytes cannot exceed min(input,output) quotas. output defaults to 16 GiB of uncompressed source content; ZIP container/encryption overhead may exceed that logical content quota. Capture one immutable source at a time, stream Store/Deflate and optional AES-256 through 64 KiB buffers, then publish the completed ZIP without replacing existing files. Emit ZIP64 sizes/offsets only when their 32-bit fields would overflow or equal the sentinel. Check staging and destination free space; StorageFull maps to DiskFull tag 13 and other I/O failures retain Io tag 8."
@@ -220,6 +220,7 @@
220220 "overwrite": "Write, verify, sync and close a new owned temporary file in the destination directory before replacing the existing ordinary file. A pre-replacement failure preserves the original. After replacement, report actual publication and durability; do not claim whole-job rollback.",
221221 "counts": "created_count includes published replacement files and newly created files/directories; excludes skipped files. If all files are skipped and no new directory or other output is created, finish Completed/None with created_count=0 and Durability NotApplicable. Newly created directories retain their Output events and actual counts even if all files are skipped.",
222222 "implementation_boundary": "Worker supports StartInteractive extraction. Frontend activation and native Windows/Wayland integration require separate verification. Existing Start remains exclusive and aborts on file conflicts.",
223삭제: "target_revalidation": "Before replacement compare parent and file native identities, size and modification time with the question-time observation. Detected changes fail Conflict. This is not atomic compare-and-replace against concurrent writes by the same account."
223추가: "target_revalidation": "Before replacement compare parent and file native identities, size and modification time with the question-time observation. Detected changes fail Conflict. This is not atomic compare-and-replace against concurrent writes by the same account.",
224추가: "disk_space": "Required input capture and complete integrity staging checks remain before conflict questions. Defer destination space checks until the current choice is resolved. Skip has no destination byte charge; overwrite, rename and non-conflicting files are checked immediately before their publication. Preserve legacy Start aggregate preflight, limits, per-write checks and partial-output reporting."
224225 }
225226}
추가experiments/rust-archive-worker/src/compressed_tar.rs+367-0
@@ -0,0 +1,367 @@
1추가: use crate::{protocol::ErrorCode, space, spool};
2추가: use std::{
3추가: cell::RefCell,
4추가: fs::File,
5추가: io::{self, BufReader, Read, Seek, Write},
6추가: };
7추가: use zeroize::Zeroizing;
8추가:
9추가: type Result<T> = std::result::Result<T, ErrorCode>;
10추가: const CHUNK: usize = 65_536;
11추가: const XZ_MEMORY_KIB: u32 = 32 * 1024;
12추가:
13추가: #[derive(Clone, Copy)]
14추가: pub(crate) enum Compression {
15추가: Bzip2,
16추가: Xz,
17추가: }
18추가:
19추가: #[derive(Debug)]
20추가: struct InputError(ErrorCode);
21추가:
22추가: impl std::fmt::Display for InputError {
23추가: fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24추가: write!(formatter, "{:?}", self.0)
25추가: }
26추가: }
27추가:
28추가: impl std::error::Error for InputError {}
29추가:
30추가: struct CheckedInput<'a, F> {
31추가: file: &'a mut File,
32추가: check: &'a RefCell<&'a mut F>,
33추가: }
34추가:
35추가: impl<F: FnMut() -> Result<()>> Read for CheckedInput<'_, F> {
36추가: fn read(&mut self, buffer: &mut [u8]) -> io::Result<usize> {
37추가: (self.check.borrow_mut())().map_err(|error| io::Error::other(InputError(error)))?;
38추가: let count = buffer.len().min(CHUNK);
39추가: self.file
40추가: .read(&mut buffer[..count])
41추가: .map_err(|_| io::Error::other(InputError(ErrorCode::Io)))
42추가: }
43추가: }
44추가:
45추가: fn decode_error(error: io::Error) -> ErrorCode {
46추가: if let Some(error) = error
47추가: .get_ref()
48추가: .and_then(|error| error.downcast_ref::<InputError>())
49추가: {
50추가: return error.0;
51추가: }
52추가: match error.kind() {
53추가: io::ErrorKind::OutOfMemory => ErrorCode::Limit,
54추가: io::ErrorKind::Unsupported => ErrorCode::UnsupportedFeature,
55추가: _ => ErrorCode::Integrity,
56추가: }
57추가: }
58추가:
59추가: pub(crate) fn decode(
60추가: source: &mut File,
61추가: compression: Compression,
62추가: limit: u64,
63추가: check: &mut impl FnMut() -> Result<()>,
64추가: ) -> Result<(File, u64)> {
65추가: check()?;
66추가: let expected = if matches!(compression, Compression::Xz) {
67추가: Some(xz_layout(source, limit, check)?)
68추가: } else {
69추가: None
70추가: };
71추가: source.rewind().map_err(space::io_error)?;
72추가: let mut output = spool::temporary()?;
73추가: let check = RefCell::new(check);
74추가: let input = CheckedInput {
75추가: file: source,
76추가: check: &check,
77추가: };
78추가: let mut reader: Box<dyn Read + '_> = match compression {
79추가: Compression::Bzip2 => Box::new(bzip2::bufread::MultiBzDecoder::new(
80추가: BufReader::with_capacity(CHUNK, input),
81추가: )),
82추가: Compression::Xz => Box::new(lzma_rust2::XzReader::new_mem_limit(
83추가: input,
84추가: true,
85추가: XZ_MEMORY_KIB,
86추가: )),
87추가: };
88추가: let mut buffer = Zeroizing::new([0; CHUNK]);
89추가: let mut total = 0u64;
90추가: loop {
91추가: (check.borrow_mut())()?;
92추가: let count = reader.read(&mut buffer[..]).map_err(decode_error)?;
93추가: if count == 0 {
94추가: break;
95추가: }
96추가: total = total
97추가: .checked_add(count as u64)
98추가: .filter(|total| *total <= limit)
99추가: .ok_or(ErrorCode::Limit)?;
100추가: // 전체 검증 전에는 비공개 임시 파일에만 기록함.
101추가: space::ensure(&output, count as u64)?;
102추가: output
103추가: .write_all(&buffer[..count])
104추가: .map_err(space::io_error)?;
105추가: }
106추가: (check.borrow_mut())()?;
107추가: if expected.is_some_and(|expected| expected != total) {
108추가: return Err(ErrorCode::Integrity);
109추가: }
110추가: Ok((output, total))
111추가: }
112추가:
113추가: fn read_at(
114추가: source: &mut File,
115추가: offset: u64,
116추가: bytes: &mut [u8],
117추가: check: &mut impl FnMut() -> Result<()>,
118추가: ) -> Result<()> {
119추가: check()?;
120추가: source
121추가: .seek(std::io::SeekFrom::Start(offset))
122추가: .map_err(space::io_error)?;
123추가: source.read_exact(bytes).map_err(|error| {
124추가: if error.kind() == io::ErrorKind::UnexpectedEof {
125추가: ErrorCode::Integrity
126추가: } else {
127추가: ErrorCode::Io
128추가: }
129추가: })
130추가: }
131추가:
132추가: fn vli(bytes: &[u8], cursor: &mut usize) -> Result<u64> {
133추가: let mut value = 0u64;
134추가: for shift in (0..63).step_by(7) {
135추가: let byte = *bytes.get(*cursor).ok_or(ErrorCode::Integrity)?;
136추가: *cursor += 1;
137추가: value |= u64::from(byte & 127) << shift;
138추가: if byte & 128 == 0 {
139추가: if shift != 0 && byte == 0 {
140추가: return Err(ErrorCode::Integrity);
141추가: }
142추가: return Ok(value);
143추가: }
144추가: }
145추가: Err(ErrorCode::Integrity)
146추가: }
147추가:
148추가: fn lzma2_size(
149추가: source: &mut File,
150추가: mut at: u64,
151추가: end: u64,
152추가: expected: u64,
153추가: check: &mut impl FnMut() -> Result<()>,
154추가: ) -> Result<()> {
155추가: let mut size = 0u64;
156추가: while at < end {
157추가: let mut control = [0];
158추가: read_at(source, at, &mut control, check)?;
159추가: at += 1;
160추가: if control[0] == 0 {
161추가: return if at == end && size == expected {
162추가: Ok(())
163추가: } else {
164추가: Err(ErrorCode::Integrity)
165추가: };
166추가: }
167추가: let header_len = match control[0] {
168추가: 1 | 2 => 2,
169추가: 128..=255 => 4 + usize::from(control[0] >= 192),
170추가: _ => return Err(ErrorCode::Integrity),
171추가: };
172추가: if end - at < header_len as u64 {
173추가: return Err(ErrorCode::Integrity);
174추가: }
175추가: let mut header = [0; 5];
176추가: read_at(source, at, &mut header[..header_len], check)?;
177추가: at += header_len as u64;
178추가: let unpacked = u64::from(u16::from_be_bytes(header[..2].try_into().unwrap())) + 1;
179추가: let (packed, unpacked) = if control[0] >= 128 {
180추가: (
181추가: u64::from(u16::from_be_bytes(header[2..4].try_into().unwrap())) + 1,
182추가: (u64::from(control[0] & 31) << 16) + unpacked,
183추가: )
184추가: } else {
185추가: (unpacked, unpacked)
186추가: };
187추가: at = at
188추가: .checked_add(packed)
189추가: .filter(|at| *at <= end)
190추가: .ok_or(ErrorCode::Integrity)?;
191추가: size = size
192추가: .checked_add(unpacked)
193추가: .filter(|size| *size <= expected)
194추가: .ok_or(ErrorCode::Integrity)?;
195추가: }
196추가: Err(ErrorCode::Integrity)
197추가: }
198추가:
199추가: fn xz_block(
200추가: source: &mut File,
201추가: start: u64,
202추가: unpadded: u64,
203추가: size: u64,
204추가: check_size: u64,
205추가: check: &mut impl FnMut() -> Result<()>,
206추가: ) -> Result<()> {
207추가: let mut header = [0; 1024];
208추가: read_at(source, start, &mut header[..1], check)?;
209추가: if header[0] == 0 {
210추가: return Err(ErrorCode::Integrity);
211추가: }
212추가: let header_len = (usize::from(header[0]) + 1) * 4;
213추가: let packed = unpadded
214추가: .checked_sub(header_len as u64 + check_size)
215추가: .filter(|packed| *packed != 0)
216추가: .ok_or(ErrorCode::Integrity)?;
217추가: read_at(source, start, &mut header[..header_len], check)?;
218추가: let data = &header[..header_len - 4];
219추가: if zlib_rs::crc32::crc32(0, data)
220추가: != u32::from_le_bytes(header[header_len - 4..header_len].try_into().unwrap())
221추가: {
222추가: return Err(ErrorCode::Integrity);
223추가: }
224추가: let flags = header[1];
225추가: if flags & 0x3c != 0 {
226추가: return Err(ErrorCode::UnsupportedFeature);
227추가: }
228추가: let mut cursor = 2;
229추가: if flags & 0x40 != 0 && vli(data, &mut cursor)? != packed {
230추가: return Err(ErrorCode::Integrity);
231추가: }
232추가: if flags & 0x80 != 0 && vli(data, &mut cursor)? != size {
233추가: return Err(ErrorCode::Integrity);
234추가: }
235추가: let filters = usize::from(flags & 3) + 1;
236추가: for number in 0..filters {
237추가: let id = vli(data, &mut cursor)?;
238추가: // 지원 필터는 길이를 보존하며 마지막 필터는 LZMA2임.
239추가: let supported = if number + 1 == filters {
240추가: id == 0x21
241추가: } else {
242추가: (0x03..=0x0b).contains(&id)
243추가: };
244추가: if !supported {
245추가: return Err(ErrorCode::UnsupportedFeature);
246추가: }
247추가: let properties = vli(data, &mut cursor)?;
248추가: cursor = cursor
249추가: .checked_add(usize::try_from(properties).map_err(|_| ErrorCode::Integrity)?)
250추가: .filter(|cursor| *cursor <= data.len())
251추가: .ok_or(ErrorCode::Integrity)?;
252추가: }
253추가: if data[cursor..].iter().any(|byte| *byte != 0) {
254추가: return Err(ErrorCode::Integrity);
255추가: }
256추가: let data_start = start
257추가: .checked_add(header_len as u64)
258추가: .ok_or(ErrorCode::Integrity)?;
259추가: let data_end = data_start.checked_add(packed).ok_or(ErrorCode::Integrity)?;
260추가: // 청크 경계와 해제량을 블록별로 대조한 뒤 기존 디코더가 내용과 체크섬을 검증함.
261추가: lzma2_size(source, data_start, data_end, size, check)
262추가: }
263추가:
264추가: // 역방향 인덱스 검사는 디코더의 할당과 실제 해제량 검사보다 먼저 수행함.
265추가: fn xz_layout(source: &mut File, limit: u64, check: &mut impl FnMut() -> Result<()>) -> Result<u64> {
266추가: use zlib_rs::crc32::crc32;
267추가: let mut end = source.metadata().map_err(space::io_error)?.len();
268추가: let mut total = 0u64;
269추가: let mut streams = 0usize;
270추가: while end != 0 {
271추가: let mut tail = [0; 4];
272추가: loop {
273추가: let at = end.checked_sub(4).ok_or(ErrorCode::Integrity)?;
274추가: read_at(source, at, &mut tail, check)?;
275추가: if tail != [0; 4] {
276추가: break;
277추가: }
278추가: end = at;
279추가: }
280추가: streams += 1;
281추가: if streams > crate::archive::MAX_OUTPUT_NODES {
282추가: return Err(ErrorCode::Limit);
283추가: }
284추가: let footer_at = end.checked_sub(12).ok_or(ErrorCode::Integrity)?;
285추가: let mut footer = [0; 12];
286추가: read_at(source, footer_at, &mut footer, check)?;
287추가: if &footer[10..] != b"YZ"
288추가: || crc32(0, &footer[4..10]) != u32::from_le_bytes(footer[..4].try_into().unwrap())
289추가: {
290추가: return Err(ErrorCode::Integrity);
291추가: }
292추가: let index_len = (u64::from(u32::from_le_bytes(footer[4..8].try_into().unwrap())) + 1) * 4;
293추가: if index_len > crate::archive::MAX_METADATA_BYTES as u64 {
294추가: return Err(ErrorCode::Limit);
295추가: }
296추가: if index_len < 8 {
297추가: return Err(ErrorCode::Integrity);
298추가: }
299추가: let index_at = footer_at
300추가: .checked_sub(index_len)
301추가: .ok_or(ErrorCode::Integrity)?;
302추가: let mut index = vec![0; index_len as usize];
303추가: read_at(source, index_at, &mut index, check)?;
304추가: let data_end = index.len() - 4;
305추가: if index[0] != 0
306추가: || crc32(0, &index[..data_end])
307추가: != u32::from_le_bytes(index[data_end..].try_into().unwrap())
308추가: {
309추가: return Err(ErrorCode::Integrity);
310추가: }
311추가: let mut cursor = 1;
312추가: let count = vli(&index[..data_end], &mut cursor)?;
313추가: if count > crate::archive::MAX_OUTPUT_NODES as u64 {
314추가: return Err(ErrorCode::Limit);
315추가: }
316추가: let mut blocks = 0u64;
317추가: let mut records = Vec::new();
318추가: for _ in 0..count {
319추가: check()?;
320추가: let unpadded = vli(&index[..data_end], &mut cursor)?;
321추가: let size = vli(&index[..data_end], &mut cursor)?;
322추가: if unpadded == 0 {
323추가: return Err(ErrorCode::Integrity);
324추가: }
325추가: blocks = blocks
326추가: .checked_add(unpadded.checked_add(3).ok_or(ErrorCode::Integrity)? & !3)
327추가: .ok_or(ErrorCode::Integrity)?;
328추가: total = total
329추가: .checked_add(size)
330추가: .filter(|total| *total <= limit)
331추가: .ok_or(ErrorCode::Limit)?;
332추가: records.push((unpadded, size));
333추가: }
334추가: if data_end - cursor > 3 || index[cursor..data_end].iter().any(|byte| *byte != 0) {
335추가: return Err(ErrorCode::Integrity);
336추가: }
337추가: let start = index_at
338추가: .checked_sub(blocks)
339추가: .and_then(|at| at.checked_sub(12))
340추가: .ok_or(ErrorCode::Integrity)?;
341추가: let mut header = [0; 12];
342추가: read_at(source, start, &mut header, check)?;
343추가: if &header[..6] != b"\xfd7zXZ\0"
344추가: || header[6..8] != footer[8..10]
345추가: || crc32(0, &header[6..8]) != u32::from_le_bytes(header[8..].try_into().unwrap())
346추가: {
347추가: return Err(ErrorCode::Integrity);
348추가: }
349추가: let check_size = match header[7] {
350추가: 0 => 0,
351추가: 1 => 4,
352추가: 4 => 8,
353추가: 10 => 32,
354추가: _ => return Err(ErrorCode::UnsupportedFeature),
355추가: };
356추가: let mut block_at = start + 12;
357추가: for (unpadded, size) in records {
358추가: xz_block(source, block_at, unpadded, size, check_size, check)?;
359추가: block_at += (unpadded + 3) & !3;
360추가: }
361추가: end = start;
362추가: }
363추가: if streams == 0 {
364추가: return Err(ErrorCode::Integrity);
365추가: }
366추가: Ok(total)
367추가: }
수정experiments/rust-archive-worker/src/lib.rs+1-0
@@ -1,4 +1,5 @@
11pub mod archive;
2추가: mod compressed_tar;
23mod create;
34mod create_sources;
45mod crypto;
수정experiments/rust-archive-worker/src/runtime.rs+18-2
@@ -405,7 +405,13 @@ impl<W: Write> Job<W> {
405405 } else {
406406 None
407407 };
408삭제: filesystem::preflight_space(&root, &output_sizes, staged)?;
408추가: // 선택 전에는 검증에 필요한 스테이징 공간만 계산함.
409추가: let initial_outputs = if self.interactive {
410추가: &[][..]
411추가: } else {
412추가: &output_sizes[..]
413추가: };
414추가: filesystem::preflight_space(&root, initial_outputs, staged)?;
409415 let encrypted = catalog.members.iter().any(|m| m.entry.encrypted);
410416 if matches!(catalog.format, Format::Zip | Format::SevenZip) {
411417 for attempt in 1..=3 {
@@ -457,7 +463,9 @@ impl<W: Write> Job<W> {
457463 .map(|m| (m.entry.name.clone(), EntryKind::File)),
458464 );
459465 filesystem::preflight_mode(&root, &names, self.interactive)?;
460삭제: filesystem::preflight_space(&root, &output_sizes, None)?;
466추가: if !self.interactive {
467추가: filesystem::preflight_space(&root, &output_sizes, None)?;
468추가: }
461469 let mut reserved = names
462470 .iter()
463471 .map(|(name, _)| name.to_lowercase())
@@ -509,6 +517,14 @@ impl<W: Write> Job<W> {
509517 continue;
510518 }
511519 }
520추가: if self.interactive {
521추가: // 건너뛴 파일을 제외하고 이번에 게시할 파일의 공간을 확인함.
522추가: filesystem::preflight_space(
523추가: &root,
524추가: &[(name.clone(), m.entry.size)],
525추가: None,
526추가: )?;
527추가: }
512528 self.output_reader(
513529 &root,
514530 &name,
수정experiments/rust-archive-worker/src/streaming.rs+15-0
@@ -66,6 +66,21 @@ impl Catalog {
6666 {
6767 return zip(source, len, limits, decode, password, check);
6868 }
69추가: let compression = if magic.starts_with(b"BZh") {
70추가: Some(crate::compressed_tar::Compression::Bzip2)
71추가: } else if &magic == b"\xfd7zXZ\0" {
72추가: Some(crate::compressed_tar::Compression::Xz)
73추가: } else {
74추가: None
75추가: };
76추가: if let Some(compression) = compression {
77추가: let (data, expanded) =
78추가: crate::compressed_tar::decode(source, compression, limits.output, check)?;
79추가: if expanded < 1024 {
80추가: return Err(ErrorCode::Integrity);
81추가: }
82추가: return tar(data, expanded, limits, Format::Tar, check);
83추가: }
6984 if magic.starts_with(&[31, 139]) {
7085 let mut data = spool::temporary()?;
7186 io(source.rewind())?;
수정experiments/rust-ui-memory-app/Cargo.lock+102-12
@@ -124,7 +124,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
124124dependencies = [
125125 "cfg-if",
126126 "cipher",
127삭제: "cpufeatures",
127추가: "cpufeatures 0.2.17",
128128 "zeroize",
129129]
130130
@@ -462,6 +462,15 @@ dependencies = [
462462 "generic-array",
463463]
464464
465추가: [[package]]
466추가: name = "block-buffer"
467추가: version = "0.12.1"
468추가: source = "registry+https://github.com/rust-lang/crates.io-index"
469추가: checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
470추가: dependencies = [
471추가: "hybrid-array",
472추가: ]
473추가:
465474[[package]]
466475name = "block2"
467476version = "0.5.1"
@@ -531,6 +540,15 @@ version = "1.12.1"
531540source = "registry+https://github.com/rust-lang/crates.io-index"
532541checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
533542
543추가: [[package]]
544추가: name = "bzip2"
545추가: version = "0.6.1"
546추가: source = "registry+https://github.com/rust-lang/crates.io-index"
547추가: checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c"
548추가: dependencies = [
549추가: "libbz2-rs-sys",
550추가: ]
551추가:
534552[[package]]
535553name = "calloop"
536554version = "0.13.0"
@@ -620,7 +638,7 @@ version = "0.4.4"
620638source = "registry+https://github.com/rust-lang/crates.io-index"
621639checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
622640dependencies = [
623삭제: "crypto-common",
641추가: "crypto-common 0.1.7",
624642 "inout",
625643]
626644
@@ -670,6 +688,12 @@ dependencies = [
670688 "crossbeam-utils",
671689]
672690
691추가: [[package]]
692추가: name = "const-oid"
693추가: version = "0.10.3"
694추가: source = "registry+https://github.com/rust-lang/crates.io-index"
695추가: checksum = "be95d4a884358a21a199689323c29e9256b4a1b315e22f183d155422041d3a9a"
696추가:
673697[[package]]
674698name = "constant_time_eq"
675699version = "0.6.1"
@@ -728,6 +752,15 @@ dependencies = [
728752 "libc",
729753]
730754
755추가: [[package]]
756추가: name = "cpufeatures"
757추가: version = "0.3.1"
758추가: source = "registry+https://github.com/rust-lang/crates.io-index"
759추가: checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
760추가: dependencies = [
761추가: "libc",
762추가: ]
763추가:
731764[[package]]
732765name = "crc32fast"
733766version = "1.5.5"
@@ -759,6 +792,15 @@ dependencies = [
759792 "typenum",
760793]
761794
795추가: [[package]]
796추가: name = "crypto-common"
797추가: version = "0.2.2"
798추가: source = "registry+https://github.com/rust-lang/crates.io-index"
799추가: checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
800추가: dependencies = [
801추가: "hybrid-array",
802추가: ]
803추가:
762804[[package]]
763805name = "cursor-icon"
764806version = "1.2.0"
@@ -771,11 +813,22 @@ version = "0.10.7"
771813source = "registry+https://github.com/rust-lang/crates.io-index"
772814checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
773815dependencies = [
774삭제: "block-buffer",
775삭제: "crypto-common",
816추가: "block-buffer 0.10.4",
817추가: "crypto-common 0.1.7",
776818 "subtle",
777819]
778820
821추가: [[package]]
822추가: name = "digest"
823추가: version = "0.11.3"
824추가: source = "registry+https://github.com/rust-lang/crates.io-index"
825추가: checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
826추가: dependencies = [
827추가: "block-buffer 0.12.1",
828추가: "const-oid",
829추가: "crypto-common 0.2.2",
830추가: ]
831추가:
779832[[package]]
780833name = "dispatch"
781834version = "0.2.0"
@@ -1533,7 +1586,16 @@ version = "0.12.1"
15331586source = "registry+https://github.com/rust-lang/crates.io-index"
15341587checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
15351588dependencies = [
1536삭제: "digest",
1589추가: "digest 0.10.7",
1590추가: ]
1591추가:
1592추가: [[package]]
1593추가: name = "hybrid-array"
1594추가: version = "0.4.15"
1595추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1596추가: checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
1597추가: dependencies = [
1598추가: "typenum",
15371599]
15381600
15391601[[package]]
@@ -1779,6 +1841,12 @@ dependencies = [
17791841 "smallvec",
17801842]
17811843
1844추가: [[package]]
1845추가: name = "libbz2-rs-sys"
1846추가: version = "0.2.6"
1847추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1848추가: checksum = "32f454fd6831a29c0e827ed075bca2a15be201bd57f4168f0fd1041124eab17e"
1849추가:
17821850[[package]]
17831851name = "libc"
17841852version = "0.2.191"
@@ -1858,6 +1926,15 @@ version = "0.4.35"
18581926source = "registry+https://github.com/rust-lang/crates.io-index"
18591927checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c"
18601928
1929추가: [[package]]
1930추가: name = "lzma-rust2"
1931추가: version = "0.25.0"
1932추가: source = "registry+https://github.com/rust-lang/crates.io-index"
1933추가: checksum = "ef1d73c59a56771343712b22ea5615092c612c16ba291c0979e3105dfeec4890"
1934추가: dependencies = [
1935추가: "sha2 0.11.1",
1936추가: ]
1937추가:
18611938[[package]]
18621939name = "memchr"
18631940version = "2.8.3"
@@ -2419,7 +2496,7 @@ version = "0.12.2"
24192496source = "registry+https://github.com/rust-lang/crates.io-index"
24202497checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
24212498dependencies = [
2422삭제: "digest",
2499추가: "digest 0.10.7",
24232500 "hmac",
24242501]
24252502
@@ -2966,8 +3043,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
29663043checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
29673044dependencies = [
29683045 "cfg-if",
2969삭제: "cpufeatures",
2970삭제: "digest",
3046추가: "cpufeatures 0.2.17",
3047추가: "digest 0.10.7",
29713048]
29723049
29733050[[package]]
@@ -2977,8 +3054,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
29773054checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
29783055dependencies = [
29793056 "cfg-if",
2980삭제: "cpufeatures",
2981삭제: "digest",
3057추가: "cpufeatures 0.2.17",
3058추가: "digest 0.10.7",
3059추가: ]
3060추가:
3061추가: [[package]]
3062추가: name = "sha2"
3063추가: version = "0.11.1"
3064추가: source = "registry+https://github.com/rust-lang/crates.io-index"
3065추가: checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"
3066추가: dependencies = [
3067추가: "cfg-if",
3068추가: "cpufeatures 0.3.1",
3069추가: "digest 0.11.3",
29823070]
29833071
29843072[[package]]
@@ -4564,10 +4652,12 @@ name = "zipelo-archive-worker"
45644652version = "0.1.0"
45654653dependencies = [
45664654 "aes",
4655추가: "bzip2",
45674656 "hmac",
4657추가: "lzma-rust2",
45684658 "pbkdf2",
45694659 "sha1",
4570삭제: "sha2",
4660추가: "sha2 0.10.9",
45714661 "subtle",
45724662 "zeroize",
45734663 "zlib-rs",
@@ -4584,7 +4674,7 @@ dependencies = [
45844674name = "zipelo-memory-ustar-reader"
45854675version = "0.1.0"
45864676dependencies = [
4587삭제: "sha2",
4677추가: "sha2 0.10.9",
45884678 "subtle",
45894679]
45904680
수정experiments/rust-ui-memory-app/src/archive_dialog.rs+1-1
@@ -37,7 +37,7 @@ pub trait Dialogs {
3737
3838pub fn archive_filters() -> Vec<(&'static str, Vec<String>)> {
3939 let mut extensions = Vec::new();
40삭제: for extension in ["zip", "7z", "tar", "gz", "tgz"] {
40추가: for extension in ["zip", "7z", "tar", "gz", "tgz", "tar.bz2", "tar.xz"] {
4141 let mut variants = vec![String::new()];
4242 for character in extension.chars() {
4343 let mut next = Vec::new();
수정experiments/rust-ui-memory-app/src/archive_present.rs+5-2
@@ -70,8 +70,11 @@ pub fn middle_text(text: &str, max_chars: usize) -> String {
7070pub fn default_destination(archive: &Path) -> PathBuf {
7171 let name = archive.file_name().unwrap_or_default().to_string_lossy();
7272 let lower = name.to_ascii_lowercase();
73삭제: let stem = if lower.ends_with(".tar.gz") {
74삭제: &name[..name.len() - 7]
73추가: let compound = [".tar.bz2", ".tar.gz", ".tar.xz"]
74추가: .into_iter()
75추가: .find(|suffix| lower.ends_with(suffix));
76추가: let stem = if let Some(suffix) = compound {
77추가: &name[..name.len() - suffix.len()]
7578 } else {
7679 name.rsplit_once('.')
7780 .map_or(name.as_ref(), |(stem, _)| stem)
수정experiments/rust-ui-memory-app/src/archive_screen.rs+1-1
@@ -1110,7 +1110,7 @@ impl ArchiveApp {
11101110 ui.add_space(theme::PAD as f32);
11111111 ui.colored_label(
11121112 theme::MUTED,
1113삭제: "ZIP, 7z, TAR, GZ, TAR.GZ 파일을 열 수 있습니다",
1113추가: "ZIP, 7z, TAR, GZ, TAR.GZ, TAR.BZ2, TAR.XZ 파일을 열 수 있습니다",
11141114 );
11151115 });
11161116 }
수정packaging/ubuntu/rust/build.py+1-1
@@ -56,7 +56,7 @@ Architecture: amd64
5656Maintainer: Zipelo contributors <[email protected]>
5757Section: utils
5858Priority: optional
59삭제: Depends: libc6 (>= 2.39), libgcc-s1, libx11-6, libxkbcommon0, libwayland-client0, libegl1, libgl1, libfontconfig1, fonts-noto-cjk, xdg-utils, desktop-file-utils
59추가: Depends: libc6 (>= 2.39), libgcc-s1, libx11-6, libxkbcommon0, libxkbcommon-x11-0, libwayland-client0, libegl1, libgl1, libfontconfig1, fonts-noto-cjk, xdg-utils, desktop-file-utils
6060Description: Lightweight Rust archive application
6161 ZIP, 7z, TAR, GZ and TAR.GZ archive application with a separate worker.
6262""")
수정tests/ci/README.md+2-2
@@ -16,8 +16,8 @@ python3 tests/ci/run_rust.py local
1616- `setup_windows.sh`는 관리자 권한 없이 도구를 `tests/ci/tools`에 풉니다. apt-get, dpkg-deb, rustup 및 GCC 호스트 실행 라이브러리가 필요합니다. 공용 도구 경로를 재사용할 때는 프로젝트 안의 소유 경로를 `ZIPELO_CI_TOOLS`로 지정합니다. 연결된 Git worktree에서는 현재 checkout의 도구를 먼저 찾고 같은 저장소 기본 worktree의 `tests/ci/tools`도 찾습니다. `ZIPELO_CI_TOOLS`를 지정하면 그 경로만 사용하며 별도 PATH 내보내기는 필요하지 않습니다. 기존 Rust target과 MinGW가 있으면 준비 스크립트 없이 PATH와 관련 Cargo/CC/CXX 환경 설정을 사용할 수 있습니다.
1717- Linux GUI 빌드에는 pkg-config, libxkbcommon-dev, libwayland-dev, libgl1-mesa-dev가 필요하며 글꼴 시험에는 fonts-noto-cjk가 필요합니다.
1818- 추적된 fixture를 Git blob과 대조합니다. Windows checkout 시 core.autocrlf=false를 사용해야 하며 기대값의 바이트를 바꾸지 않습니다.
19삭제: - Unix 소켓 시험을 위해 짧은 checkout 경로를 사용합니다. 예: 프로젝트 아래 `tests/ci-k`. 기존 `runs` 디렉터리는 소유권, 0700, 빈 상태를 확인하고 새 디렉터리만 생성합니다. 실패한 fixture는 삭제하거나 권한을 바꾸지 않습니다.
20삭제: - 파일 게시 계층은 ext4/XFS만 지원합니다. tmpfs 등 다른 파일시스템에서는 `rust-file-publication`과 `rust-gzip-file-job`의 Rust 실행 시험만 `not-applicable`로 기록하고 파일시스템 식별값과 사유를 출력합니다. 해당 crate의 Linux 및 Windows 빌드와 snapshot 등 나머지 시험은 계속합니다. 전체 시험 통과가 필요한 검증은 짧은 ext4/XFS checkout에서 수행합니다. 파일시스템 탐색 오류나 기존 시험 디렉터리의 소유권 문제는 실패로 남깁니다.
19추가: - Unix 소켓 시험은 Cargo가 설정한 시험 crate의 현재 디렉터리에서 짧은 상대 경로로 소켓을 생성합니다. 소켓 파일은 기존 `runs` 안에 유지하며 긴 checkout 절대 경로에서도 실행됩니다. 별도 경로 매핑이나 `/tmp` 사용은 필요하지 않습니다. 기존 `runs` 디렉터리는 소유권, 0700, 빈 상태를 확인하고 새 디렉터리만 생성합니다. 실패한 fixture는 삭제하거나 권한을 바꾸지 않습니다.
20추가: - 파일 게시 계층은 ext4/XFS만 지원합니다. tmpfs 등 다른 파일시스템에서는 `rust-file-publication`과 `rust-gzip-file-job`의 Rust 실행 시험만 `not-applicable`로 기록하고 파일시스템 식별값과 사유를 출력합니다. 해당 crate의 Linux 및 Windows 빌드와 snapshot 등 나머지 시험은 계속합니다. 전체 시험 통과가 필요한 검증은 ext4/XFS checkout에서 수행합니다. 파일시스템 탐색 오류나 기존 시험 디렉터리의 소유권 문제는 실패로 남깁니다.
2121- 개별 단계는 `build`, `test`, `cross-build`로 실행할 수 있습니다. 한 crate가 실패해도 다른 crate 결과를 수집합니다.
2222- GUI 앱과 GUI race harness는 컴파일하며 실제 화면 시나리오는 실행하지 않습니다. C# 시험과 역사적 hash 검사는 포함하지 않습니다.
2323
수정tests/ci/run_rust.py+0-4
@@ -75,10 +75,6 @@ def prepare_fixtures(root):
7575 " (tmpfs 포함 다른 파일시스템은 제품 코드에서 지원하지 않음)"
7676 )
7777 continue
78삭제: if name == "rust-file-publication":
79삭제: socket = path / "case-2147483647-99/parent/output"
80삭제: if len(os.fsencode(socket)) >= 108:
81삭제: raise ValueError("Unix 소켓 시험을 위해 더 짧은 checkout 경로가 필요함")
8278 return skipped
8379
8480
수정tests/ci/test_runner.py+15-0
@@ -210,6 +210,21 @@ class RunnerTests(unittest.TestCase):
210210 self.assertTrue(all(row["status"] == "passed" for row in results))
211211 self.assertEqual(cargo.call_count, 4)
212212
213추가: @unittest.skipUnless(sys.platform == "linux", "Linux 소켓 경로 회귀 시험임")
214추가: def test_long_checkout_does_not_block_file_fixtures(self):
215추가: work = run_rust.ROOT / "tests/work"
216추가: work.mkdir(exist_ok=True)
217추가: with tempfile.TemporaryDirectory(dir=work) as directory:
218추가: root = Path(directory) / ("long-checkout-" * 10)
219추가: for name in run_rust.FILE_FIXTURES:
220추가: (root / "tests" / name).mkdir(parents=True)
221추가: socket = root / "tests/rust-file-publication/runs/case-1-1/parent/output"
222추가: self.assertGreaterEqual(len(run_rust.os.fsencode(socket)), 108)
223추가: with patch.object(run_rust.subprocess, "check_output", return_value="ef53\n"):
224추가: self.assertEqual(run_rust.prepare_fixtures(root), {})
225추가: for name in run_rust.FILE_FIXTURES:
226추가: self.assertEqual(list((root / "tests" / name / "runs").iterdir()), [])
227추가:
213228 def test_unknown_filesystem_probe_error_is_failure(self):
214229 with (
215230 patch.object(run_rust, "prepare_fixtures", side_effect=subprocess.CalledProcessError(1, "stat")),
추가tests/release-packages/test_compressed_tar_licenses.py+39-0
@@ -0,0 +1,39 @@
1추가: """압축 TAR 의존성의 원문 고지와 Rust 백엔드를 검증함."""
2추가:
3추가: import importlib.util
4추가: from pathlib import Path
5추가: import unittest
6추가:
7추가:
8추가: ROOT = Path(__file__).resolve().parents[2]
9추가: SPEC = importlib.util.spec_from_file_location("compressed_tar_licenses", ROOT / "packaging/licenses.py")
10추가: LICENSES = importlib.util.module_from_spec(SPEC)
11추가: SPEC.loader.exec_module(LICENSES)
12추가:
13추가:
14추가: class CompressedTarLicenses(unittest.TestCase):
15추가: def test_registry_originals_are_in_generated_worker_notice(self):
16추가: manifest = ROOT / "experiments/rust-archive-worker/Cargo.toml"
17추가: records = LICENSES.inventory([manifest])
18추가: selected = {record["name"]: record for record in records}
19추가: expected = {
20추가: "bzip2": ("0.6.1", "MIT OR Apache-2.0"),
21추가: "libbz2-rs-sys": ("0.2.6", "bzip2-1.0.6"),
22추가: "lzma-rust2": ("0.25.0", "Apache-2.0"),
23추가: }
24추가: notice = LICENSES.render(records)
25추가: for name, (version, license_id) in expected.items():
26추가: with self.subTest(name=name):
27추가: record = selected[name]
28추가: self.assertEqual(record["version"], version)
29추가: self.assertEqual(record["license"], license_id)
30추가: self.assertTrue(record["files"])
31추가: self.assertIn(f"Crate: {name} {version}\n", notice)
32추가: for original in record["files"]:
33추가: self.assertIn(original["text"], notice)
34추가: self.assertIn(original["sha256"], notice)
35추가: self.assertTrue({"bzip2-sys", "lzma-sys", "liblzma-sys", "xz2"}.isdisjoint(selected))
36추가:
37추가:
38추가: if __name__ == "__main__":
39추가: unittest.main()
수정tests/rust-app-real-worker/Cargo.lock+101-11
@@ -10,7 +10,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
1010dependencies = [
1111 "cfg-if",
1212 "cipher",
13삭제: "cpufeatures",
13추가: "cpufeatures 0.2.17",
1414 "zeroize",
1515]
1616
@@ -23,6 +23,24 @@ dependencies = [
2323 "generic-array",
2424]
2525
26추가: [[package]]
27추가: name = "block-buffer"
28추가: version = "0.12.1"
29추가: source = "registry+https://github.com/rust-lang/crates.io-index"
30추가: checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
31추가: dependencies = [
32추가: "hybrid-array",
33추가: ]
34추가:
35추가: [[package]]
36추가: name = "bzip2"
37추가: version = "0.6.1"
38추가: source = "registry+https://github.com/rust-lang/crates.io-index"
39추가: checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c"
40추가: dependencies = [
41추가: "libbz2-rs-sys",
42추가: ]
43추가:
2644[[package]]
2745name = "cfg-if"
2846version = "1.0.5"
@@ -35,10 +53,16 @@ version = "0.4.4"
3553source = "registry+https://github.com/rust-lang/crates.io-index"
3654checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
3755dependencies = [
38삭제: "crypto-common",
56추가: "crypto-common 0.1.7",
3957 "inout",
4058]
4159
60추가: [[package]]
61추가: name = "const-oid"
62추가: version = "0.10.3"
63추가: source = "registry+https://github.com/rust-lang/crates.io-index"
64추가: checksum = "be95d4a884358a21a199689323c29e9256b4a1b315e22f183d155422041d3a9a"
65추가:
4266[[package]]
4367name = "cpufeatures"
4468version = "0.2.17"
@@ -48,6 +72,15 @@ dependencies = [
4872 "libc",
4973]
5074
75추가: [[package]]
76추가: name = "cpufeatures"
77추가: version = "0.3.1"
78추가: source = "registry+https://github.com/rust-lang/crates.io-index"
79추가: checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
80추가: dependencies = [
81추가: "libc",
82추가: ]
83추가:
5184[[package]]
5285name = "crypto-common"
5386version = "0.1.7"
@@ -58,17 +91,37 @@ dependencies = [
5891 "typenum",
5992]
6093
94추가: [[package]]
95추가: name = "crypto-common"
96추가: version = "0.2.2"
97추가: source = "registry+https://github.com/rust-lang/crates.io-index"
98추가: checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
99추가: dependencies = [
100추가: "hybrid-array",
101추가: ]
102추가:
61103[[package]]
62104name = "digest"
63105version = "0.10.7"
64106source = "registry+https://github.com/rust-lang/crates.io-index"
65107checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
66108dependencies = [
67삭제: "block-buffer",
68삭제: "crypto-common",
109추가: "block-buffer 0.10.4",
110추가: "crypto-common 0.1.7",
69111 "subtle",
70112]
71113
114추가: [[package]]
115추가: name = "digest"
116추가: version = "0.11.3"
117추가: source = "registry+https://github.com/rust-lang/crates.io-index"
118추가: checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
119추가: dependencies = [
120추가: "block-buffer 0.12.1",
121추가: "const-oid",
122추가: "crypto-common 0.2.2",
123추가: ]
124추가:
72125[[package]]
73126name = "generic-array"
74127version = "0.14.7"
@@ -85,7 +138,16 @@ version = "0.12.1"
85138source = "registry+https://github.com/rust-lang/crates.io-index"
86139checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
87140dependencies = [
88삭제: "digest",
141추가: "digest 0.10.7",
142추가: ]
143추가:
144추가: [[package]]
145추가: name = "hybrid-array"
146추가: version = "0.4.15"
147추가: source = "registry+https://github.com/rust-lang/crates.io-index"
148추가: checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
149추가: dependencies = [
150추가: "typenum",
89151]
90152
91153[[package]]
@@ -97,19 +159,34 @@ dependencies = [
97159 "generic-array",
98160]
99161
162추가: [[package]]
163추가: name = "libbz2-rs-sys"
164추가: version = "0.2.6"
165추가: source = "registry+https://github.com/rust-lang/crates.io-index"
166추가: checksum = "32f454fd6831a29c0e827ed075bca2a15be201bd57f4168f0fd1041124eab17e"
167추가:
100168[[package]]
101169name = "libc"
102170version = "0.2.191"
103171source = "registry+https://github.com/rust-lang/crates.io-index"
104172checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
105173
174추가: [[package]]
175추가: name = "lzma-rust2"
176추가: version = "0.25.0"
177추가: source = "registry+https://github.com/rust-lang/crates.io-index"
178추가: checksum = "ef1d73c59a56771343712b22ea5615092c612c16ba291c0979e3105dfeec4890"
179추가: dependencies = [
180추가: "sha2 0.11.1",
181추가: ]
182추가:
106183[[package]]
107184name = "pbkdf2"
108185version = "0.12.2"
109186source = "registry+https://github.com/rust-lang/crates.io-index"
110187checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
111188dependencies = [
112삭제: "digest",
189추가: "digest 0.10.7",
113190 "hmac",
114191]
115192
@@ -120,8 +197,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
120197checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
121198dependencies = [
122199 "cfg-if",
123삭제: "cpufeatures",
124삭제: "digest",
200추가: "cpufeatures 0.2.17",
201추가: "digest 0.10.7",
125202]
126203
127204[[package]]
@@ -131,8 +208,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
131208checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
132209dependencies = [
133210 "cfg-if",
134삭제: "cpufeatures",
135삭제: "digest",
211추가: "cpufeatures 0.2.17",
212추가: "digest 0.10.7",
213추가: ]
214추가:
215추가: [[package]]
216추가: name = "sha2"
217추가: version = "0.11.1"
218추가: source = "registry+https://github.com/rust-lang/crates.io-index"
219추가: checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"
220추가: dependencies = [
221추가: "cfg-if",
222추가: "cpufeatures 0.3.1",
223추가: "digest 0.11.3",
136224]
137225
138226[[package]]
@@ -164,10 +252,12 @@ name = "zipelo-archive-worker"
164252version = "0.1.0"
165253dependencies = [
166254 "aes",
255추가: "bzip2",
167256 "hmac",
257추가: "lzma-rust2",
168258 "pbkdf2",
169259 "sha1",
170삭제: "sha2",
260추가: "sha2 0.10.9",
171261 "subtle",
172262 "zeroize",
173263 "zlib-rs",
추가tests/rust-app-real-worker/compressed_tar_flows.rs+71-0
@@ -0,0 +1,71 @@
1추가: #[test]
2추가: fn compressed_tar_opens_with_native_dialog_and_extracts_to_compound_stem() {
3추가: use zipelo_ui_memory_app::archive_dialog::Purpose;
4추가: for (kind, name) in [("bz2", "여행 자료.TaR.Bz2"), ("xz", "여행 자료.tAr.XZ")] {
5추가: let scratch = Scratch::new();
6추가: let generated = std::process::Command::new("python3")
7추가: .arg(
8추가: Path::new(env!("CARGO_MANIFEST_DIR"))
9추가: .join("../../tests/rust-archive-worker/compressed_tar_cases.py"),
10추가: )
11추가: .arg(&scratch.0)
12추가: .arg(kind)
13추가: .arg("normal")
14추가: .output()
15추가: .unwrap();
16추가: assert!(
17추가: generated.status.success(),
18추가: "{}",
19추가: String::from_utf8_lossy(&generated.stderr)
20추가: );
21추가: let archive = scratch.path(name);
22추가: fs::rename(scratch.path("input"), &archive).unwrap();
23추가: let original = fs::read(&archive).unwrap();
24추가: let (factory, observed) = observed_factory();
25추가: let mut screen = Screen::new(factory);
26추가: screen
27추가: .dialogs
28추가: .0
29추가: .borrow_mut()
30추가: .answers
31추가: .push_back(Some(vec![archive.clone()]));
32추가: screen.click("열기");
33추가: screen.settle();
34추가: assert_eq!(screen.dialogs.0.borrow().requests[0].purpose, Purpose::Open);
35추가: assert_eq!(
36추가: screen.app.model.list_id.as_ref().unwrap().format,
37추가: Format::Tar
38추가: );
39추가: assert!(
40추가: screen
41추가: .app
42추가: .model
43추가: .entries
44추가: .iter()
45추가: .any(|e| e.name == "한글.txt")
46추가: );
47추가: assert!(screen.app.begin_extract());
48추가: screen.settle();
49추가: let output = scratch.path("여행 자료");
50추가: assert_eq!(
51추가: fs::read(output.join("folder/payload.bin")).unwrap(),
52추가: fs::read(scratch.path("expected")).unwrap()
53추가: );
54추가: assert_eq!(fs::read(output.join("한글.txt")).unwrap(), b"end");
55추가: assert!(output.join("empty").is_dir());
56추가: assert_eq!(fs::read(&archive).unwrap(), original);
57추가: assert!(
58추가: matches!(observed.borrow().starts.last(), Some(Start::Extract {
59추가: destination, gzip_output_name: None, ..
60추가: }) if destination == &output)
61추가: );
62추가: let labels = screen
63추가: .render(vec![])
64추가: .into_iter()
65추가: .map(|(s, _)| s)
66추가: .collect::<Vec<_>>()
67추가: .join("\n");
68추가: assert!(labels.contains("압축을 풀었습니다"), "{labels}");
69추가: assert_reaped(&observed);
70추가: }
71추가: }
수정tests/rust-app-real-worker/flows.rs+1-0
@@ -316,6 +316,7 @@ mod screen {
316316 include!("selection_flows.rs");
317317 include!("conflict_flows.rs");
318318 include!("native_dialog_flows.rs");
319추가: include!("compressed_tar_flows.rs");
319320
320321 fn archive_flow(name: &str, format: Format) {
321322 let scratch = Scratch::new();
수정tests/rust-app-ui/native_dialogs.rs+15-5
@@ -17,11 +17,21 @@ fn archive_filter_contains_every_case_variant_and_all_files_option() {
1717 .into_iter()
1818 .map(str::to_owned)
1919 .collect::<BTreeSet<_>>();
20삭제: assert_eq!(
21삭제: filters[0].1.iter().cloned().collect::<BTreeSet<_>>(),
22삭제: expected
23삭제: );
24삭제: assert_eq!(filters[0].1.len(), expected.len());
20추가: let actual = filters[0].1.iter().cloned().collect::<BTreeSet<_>>();
21추가: assert!(expected.is_subset(&actual));
22추가: for extension in [
23추가: "tar.bz2", "TAR.BZ2", "TaR.bZ2", "tar.xz", "TAR.XZ", "tAr.Xz",
24추가: ] {
25추가: assert!(actual.contains(extension), "{extension}");
26추가: }
27추가: assert_eq!(actual.len(), expected.len() + 64);
28추가: assert_eq!(filters[0].1.len(), actual.len());
29추가: for extension in actual.difference(&expected) {
30추가: assert!(matches!(
31추가: extension.to_ascii_lowercase().as_str(),
32추가: "tar.bz2" | "tar.xz"
33추가: ));
34추가: }
2535 assert_eq!(filters[1], ("모든 파일", vec!["*".to_owned()]));
2636}
2737
수정tests/rust-app-ui/presentation.rs+12-1
@@ -320,7 +320,18 @@ fn duplicate_names_prevent_file_completion_assumptions() {
320320}
321321#[test]
322322fn default_names_and_middle_truncation_preserve_unicode() {
323삭제: assert_eq!(default_destination(&path("자료.tar.gz")), path("자료"));
323추가: for name in [
324추가: "자료.tar.gz",
325추가: "자료.tar.bz2",
326추가: "자료.TAR.BZ2",
327추가: "자료.TaR.xZ",
328추가: "자료.tar.xz",
329추가: ] {
330추가: assert_eq!(default_destination(&path(name)), path("자료"));
331추가: }
332추가: for name in [".tar.bz2", ".TAR.XZ"] {
333추가: assert_eq!(default_destination(&path(name)), path("압축 해제"));
334추가: }
324335 assert_eq!(default_destination(&path("자료.zip")), path("자료"));
325336 assert_eq!(middle_text("가나다라마바사아자차", 7), "가나다…아자차");
326337 assert_eq!(bytes_text(21), "21 B");
수정tests/rust-app-ui/regressions.rs+1-1
@@ -1,7 +1,7 @@
1추가: mod conflicts;
12#[cfg(feature = "ui")]
23mod dialogs;
34mod fake;
4삭제: mod conflicts;
55#[cfg(feature = "ui")]
66mod native_dialogs;
77use fake::*;
수정tests/rust-app-ui/scenario_tests.rs+9-1
@@ -102,7 +102,8 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
102102 "extract-skipped" => "모든 파일을 건너뛰었습니다",
103103 "extract-rename-failed" => "아무 파일도 풀지 않았습니다",
104104 "extract-renamed" => "이름 바꿔 저장: 읽어주세요 (1).txt",
105삭제: "empty" => "압축파일",
105추가: "empty" => "TAR.BZ2, TAR.XZ",
106추가: "tar-bz2" | "tar-xz" => "읽어주세요.txt",
106107 "folder-empty" => "이 폴더는 비어 있습니다",
107108 "dialog-error" => "파일 선택 창을 열 수 없습니다",
108109 "extract-partial" => "일부 파일만 풀렸습니다",
@@ -129,6 +130,13 @@ fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
129130 assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
130131 assert!(!labels.contains("이름 바꿔 저장:"), "{labels}");
131132 }
133추가: if matches!(scenario.name, "tar-bz2" | "tar-xz") {
134추가: assert!(app.model.entries.iter().all(|entry| !entry.encrypted));
135추가: assert_eq!(
136추가: app.model.list_id.as_ref().unwrap().format,
137추가: zipelo_ui_memory_app::archive_ui::Format::Tar
138추가: );
139추가: }
132140 if scenario.name == "many-items" {
133141 assert_eq!(app.model.entries.len(), 505);
134142 }
수정tests/rust-app-ui/scenarios.rs+17-7
@@ -29,6 +29,8 @@ catalog! {
2929 "extract-rename-failed" => "새 이름을 정한 뒤 저장 전 I/O 실패",
3030 "empty" => "빈 첫 화면",
3131 "archive" => "폴더와 파일이 있는 압축파일",
32추가: "tar-bz2" => "TAR.BZ2 목록과 자동 해제 폴더",
33추가: "tar-xz" => "TAR.XZ 목록과 자동 해제 폴더",
3234 "folder" => "사진 하위 폴더",
3335 "many-items" => "500개 항목과 세로 스크롤",
3436 "selection" => "여러 파일과 폴더 선택",
@@ -168,13 +170,12 @@ impl Scenario {
168170 if self.name == "empty" {
169171 return app;
170172 }
171삭제: let archive = base.join(
172삭제: if matches!(self.name, "gzip-conflict" | "gzip-conflict-choice") {
173삭제: "여행 자료.gz"
174삭제: } else {
175삭제: "여행 자료.zip"
176삭제: },
177삭제: );
173추가: let archive = base.join(match self.name {
174추가: "gzip-conflict" | "gzip-conflict-choice" => "여행 자료.gz",
175추가: "tar-bz2" => "여행 자료.TAR.BZ2",
176추가: "tar-xz" => "여행 자료.TaR.Xz",
177추가: _ => "여행 자료.zip",
178추가: });
178179 app.model.archive = Some(archive.clone());
179180 app.model.entries = entries(self.name == "many-items");
180181 app.model.list_id = Some(ListId {
@@ -189,6 +190,15 @@ impl Scenario {
189190 });
190191 app.model.confirmed = true;
191192 match self.name {
193추가: "tar-bz2" | "tar-xz" => {
194추가: app.model.list_id.as_mut().unwrap().format = Format::Tar;
195추가: for entry in &mut app.model.entries {
196추가: entry.encrypted = false;
197추가: }
198추가: app.destination = present::default_destination(&archive);
199추가: app.automatic_destination = true;
200추가: return app;
201추가: }
192202 "archive" | "many-items" => return app,
193203 "folder-empty" => {
194204 app.browse_folder("빈 폴더");
추가tests/rust-archive-worker/compressed_fault.c+29-0
@@ -0,0 +1,29 @@
1추가: #define _GNU_SOURCE
2추가: #include <dlfcn.h>
3추가: #include <errno.h>
4추가: #include <fcntl.h>
5추가: #include <stdlib.h>
6추가: #include <string.h>
7추가: #include <sys/stat.h>
8추가: #include <sys/statvfs.h>
9추가: #include <unistd.h>
10추가:
11추가: static int regular_calls;
12추가:
13추가: int fstatvfs(int fd, struct statvfs *value) {
14추가: int (*original)(int, struct statvfs *) = dlsym(RTLD_NEXT, "fstatvfs");
15추가: int result = original(fd, value);
16추가: const char *mode = getenv("ZIPELO_COMPRESSED_FAULT");
17추가: struct stat info;
18추가: if (result || !mode || fstat(fd, &info) || !S_ISREG(info.st_mode)) return result;
19추가: if (++regular_calls != 2) return result;
20추가: int marker = open(getenv("ZIPELO_COMPRESSED_MARKER"), O_CREAT | O_EXCL | O_WRONLY, 0600);
21추가: if (marker < 0) { errno = EIO; return -1; }
22추가: close(marker);
23추가: if (!strcmp(mode, "full")) { value->f_bavail = 0; return 0; }
24추가: if (!strcmp(mode, "io")) { errno = EIO; return -1; }
25추가: const char *release = getenv("ZIPELO_COMPRESSED_RELEASE");
26추가: for (int i = 0; i < 1000 && access(release, F_OK); i++) usleep(10000);
27추가: if (access(release, F_OK)) { errno = EIO; return -1; }
28추가: return result;
29추가: }
추가tests/rust-archive-worker/compressed_tar.rs+405-0
@@ -0,0 +1,405 @@
1추가: use super::*;
2추가:
3추가: fn fixture(kind: &str, case: &str) -> Scratch {
4추가: let scratch = Scratch::new();
5추가: let output = Command::new("python3")
6추가: .arg(
7추가: PathBuf::from(env!("CARGO_MANIFEST_DIR"))
8추가: .join("../../tests/rust-archive-worker/compressed_tar_cases.py"),
9추가: )
10추가: .arg(&scratch.0)
11추가: .arg(kind)
12추가: .arg(case)
13추가: .output()
14추가: .unwrap();
15추가: assert!(
16추가: output.status.success(),
17추가: "{kind}/{case}: {}",
18추가: String::from_utf8_lossy(&output.stderr)
19추가: );
20추가: scratch
21추가: }
22추가:
23추가: fn run_case(s: &Scratch, limits: Limits) -> Vec<Message> {
24추가: extract(
25추가: s,
26추가: &fs::read(s.0.join("input")).unwrap(),
27추가: None,
28추가: Selection::All,
29추가: None,
30추가: limits,
31추가: )
32추가: }
33추가:
34추가: fn no_output(s: &Scratch, events: &[Message], error: ErrorCode) {
35추가: let result = terminal(events);
36추가: assert_eq!(result.outcome, Outcome::Failed, "{events:?}");
37추가: assert_eq!(result.error, error, "{events:?}");
38추가: assert_eq!(result.created_count, 0);
39추가: assert_eq!(result.publication, Publication::None);
40추가: assert!(
41추가: !events
42추가: .iter()
43추가: .any(|event| matches!(event, Message::Output { .. }))
44추가: );
45추가: assert_eq!(fs::read_dir(s.0.join("output")).unwrap().count(), 0);
46추가: assert!(!s.0.join("escape").exists());
47추가: }
48추가:
49추가: fn normal(kind: &str, case: &str) {
50추가: let s = fixture(kind, case);
51추가: let events = run_case(&s, Limits::default());
52추가: assert_eq!(terminal(&events).outcome, Outcome::Completed, "{events:?}");
53추가: assert_eq!(
54추가: fs::read(s.0.join("output/folder/payload.bin")).unwrap(),
55추가: fs::read(s.0.join("expected")).unwrap()
56추가: );
57추가: assert_eq!(fs::read(s.0.join("output/한글.txt")).unwrap(), b"end");
58추가: assert!(s.0.join("output/empty").is_dir());
59추가: }
60추가:
61추가: #[test]
62추가: fn bzip2_reference_tar_and_concatenated_streams() {
63추가: for case in ["normal", "multi"] {
64추가: normal("bz2", case);
65추가: }
66추가: }
67추가:
68추가: #[test]
69추가: fn xz_reference_tar_checks_filters_and_concatenated_streams() {
70추가: for case in [
71추가: "normal",
72추가: "multi",
73추가: "multi-block",
74추가: "multi-block-filters",
75추가: "stored-chunks",
76추가: "padding",
77추가: "crc32",
78추가: "sha256",
79추가: "no-check",
80추가: "filters",
81추가: ] {
82추가: normal("xz", case);
83추가: }
84추가: }
85추가:
86추가: #[test]
87추가: fn compressed_empty_tar_is_valid() {
88추가: for kind in ["bz2", "xz"] {
89추가: let s = fixture(kind, "empty");
90추가: let events = run_case(&s, Limits::default());
91추가: assert_eq!(
92추가: terminal(&events).outcome,
93추가: Outcome::Completed,
94추가: "{kind}: {events:?}"
95추가: );
96추가: assert_eq!(terminal(&events).created_count, 0);
97추가: assert_eq!(fs::read_dir(s.0.join("output")).unwrap().count(), 0);
98추가: }
99추가: }
100추가:
101추가: #[test]
102추가: fn bzip2_truncation_corruption_and_trailing_data_never_publish() {
103추가: for case in [
104추가: "truncated",
105추가: "corrupt",
106추가: "trailing",
107추가: "multi-bad",
108추가: "bad-tar",
109추가: "raw",
110추가: "empty-stream",
111추가: ] {
112추가: let s = fixture("bz2", case);
113추가: let events = run_case(&s, Limits::default());
114추가: no_output(&s, &events, ErrorCode::Integrity);
115추가: }
116추가: }
117추가:
118추가: #[test]
119추가: fn xz_truncation_corruption_and_trailing_data_never_publish() {
120추가: for case in [
121추가: "truncated",
122추가: "corrupt",
123추가: "trailing",
124추가: "multi-bad",
125추가: "bad-tar",
126추가: "raw",
127추가: "empty-stream",
128추가: "bad-padding",
129추가: ] {
130추가: let s = fixture("xz", case);
131추가: let events = run_case(&s, Limits::default());
132추가: no_output(&s, &events, ErrorCode::Integrity);
133추가: }
134추가: }
135추가:
136추가: #[test]
137추가: fn xz_index_sizes_cannot_cancel_between_streams() {
138추가: let s = fixture("xz", "index-stream-sizes");
139추가: let events = run_case(&s, Limits::default());
140추가: no_output(&s, &events, ErrorCode::Integrity);
141추가: }
142추가:
143추가: #[test]
144추가: fn xz_index_sizes_cannot_cancel_between_blocks() {
145추가: let s = fixture("xz", "index-block-sizes");
146추가: let events = run_case(&s, Limits::default());
147추가: no_output(&s, &events, ErrorCode::Integrity);
148추가: }
149추가:
150추가: #[test]
151추가: fn xz_index_unpadded_sizes_must_match_each_block() {
152추가: let s = fixture("xz", "index-unpadded-sizes");
153추가: let events = run_case(&s, Limits::default());
154추가: no_output(&s, &events, ErrorCode::Integrity);
155추가: }
156추가:
157추가: #[test]
158추가: fn compressed_tar_bombs_stop_before_publication() {
159추가: for kind in ["bz2", "xz"] {
160추가: let s = fixture(kind, "bomb");
161추가: let events = run_case(
162추가: &s,
163추가: Limits {
164추가: output: 256 * 1024,
165추가: ..Limits::default()
166추가: },
167추가: );
168추가: no_output(&s, &events, ErrorCode::Limit);
169추가: }
170추가: }
171추가:
172추가: #[test]
173추가: fn xz_huge_dictionary_is_rejected_before_allocation() {
174추가: let s = fixture("xz", "dictionary");
175추가: let events = run_case(&s, Limits::default());
176추가: no_output(&s, &events, ErrorCode::Limit);
177추가: }
178추가:
179추가: #[test]
180추가: fn compressed_tar_paths_and_links_keep_existing_guards() {
181추가: for kind in ["bz2", "xz"] {
182추가: for (case, error) in [
183추가: ("unsafe", ErrorCode::UnsafePath),
184추가: ("link", ErrorCode::UnsafePath),
185추가: ] {
186추가: let s = fixture(kind, case);
187추가: let events = run_case(&s, Limits::default());
188추가: no_output(&s, &events, error);
189추가: }
190추가: }
191추가: }
192추가:
193추가: #[test]
194추가: fn compressed_tar_list_identity_and_selection() {
195추가: for kind in ["bz2", "xz"] {
196추가: let s = fixture(kind, "normal");
197추가: let events = execute(Start {
198추가: action: Action::List {
199추가: archive: s.path("input"),
200추가: },
201추가: limits: Limits::default(),
202추가: });
203추가: assert_eq!(terminal(&events).outcome, Outcome::Completed, "{events:?}");
204추가: let token = events
205추가: .iter()
206추가: .find_map(|event| match event {
207추가: Message::ListEnd { list_id, .. } => Some(list_id.clone()),
208추가: _ => None,
209추가: })
210추가: .unwrap();
211추가: assert_eq!(token.format, Format::Tar);
212추가: let bytes = fs::read(s.0.join("input")).unwrap();
213추가: let events = extract(
214추가: &s,
215추가: &bytes,
216추가: None,
217추가: Selection::EntryIds(vec![2]),
218추가: Some(token),
219추가: Limits::default(),
220추가: );
221추가: assert_eq!(terminal(&events).outcome, Outcome::Completed, "{events:?}");
222추가: assert_eq!(fs::read(s.0.join("output/한글.txt")).unwrap(), b"end");
223추가: assert!(!s.0.join("output/folder").exists());
224추가: }
225추가: }
226추가:
227추가: #[test]
228추가: fn compressed_tar_entry_quota_is_preserved() {
229추가: for kind in ["bz2", "xz"] {
230추가: let s = fixture(kind, "normal");
231추가: let events = run_case(
232추가: &s,
233추가: Limits {
234추가: entries: 1,
235추가: ..Limits::default()
236추가: },
237추가: );
238추가: no_output(&s, &events, ErrorCode::Limit);
239추가: }
240추가: }
241추가:
242추가: #[cfg(target_os = "linux")]
243추가: mod linux {
244추가: use super::*;
245추가: use std::{
246추가: io::Read,
247추가: time::{Duration, Instant},
248추가: };
249추가:
250추가: struct Running(std::process::Child);
251추가: impl Drop for Running {
252추가: fn drop(&mut self) {
253추가: let _ = self.0.kill();
254추가: let _ = self.0.wait();
255추가: }
256추가: }
257추가:
258추가: fn inject(s: &Scratch, mode: &str) -> (Running, Writer<std::process::ChildStdin>) {
259추가: let library = s.0.join("compressed_fault.so");
260추가: assert!(
261추가: Command::new("cc")
262추가: .args(["-shared", "-fPIC", "-O2", "-Wall", "-Wextra", "-Werror"])
263추가: .arg(
264추가: PathBuf::from(env!("CARGO_MANIFEST_DIR"))
265추가: .join("../../tests/rust-archive-worker/compressed_fault.c")
266추가: )
267추가: .arg("-ldl")
268추가: .arg("-o")
269추가: .arg(&library)
270추가: .status()
271추가: .unwrap()
272추가: .success()
273추가: );
274추가: let bytes = fs::read(s.0.join("input")).unwrap();
275추가: let preparation = extract(
276추가: s,
277추가: &bytes,
278추가: None,
279추가: Selection::EntryIds(vec![999]),
280추가: None,
281추가: Limits::default(),
282추가: );
283추가: assert_ne!(terminal(&preparation).outcome, Outcome::Completed);
284추가: let mut command = s.worker();
285추가: command
286추가: .env("LD_PRELOAD", library)
287추가: .env("ZIPELO_COMPRESSED_FAULT", mode)
288추가: .env("ZIPELO_COMPRESSED_MARKER", s.0.join("paused"))
289추가: .env("ZIPELO_COMPRESSED_RELEASE", s.0.join("release"))
290추가: .stdin(Stdio::piped())
291추가: .stdout(Stdio::piped())
292추가: .stderr(Stdio::piped());
293추가: let mut child = command.spawn().unwrap();
294추가: let mut writer = Writer::new(child.stdin.take().unwrap(), 17);
295추가: writer
296추가: .send(&Message::Start(Start {
297추가: action: Action::Extract {
298추가: archive: s.path("input"),
299추가: destination: s.path("output"),
300추가: selection: Selection::All,
301추가: list_id: None,
302추가: gzip_output_name: None,
303추가: },
304추가: limits: Limits::default(),
305추가: }))
306추가: .unwrap();
307추가: (Running(child), writer)
308추가: }
309추가:
310추가: fn finish(child: &mut Running) -> Vec<Message> {
311추가: drop(child.0.stdin.take());
312추가: let mut out = child.0.stdout.take().unwrap();
313추가: let mut err = child.0.stderr.take().unwrap();
314추가: let mut bytes = Vec::new();
315추가: out.read_to_end(&mut bytes).unwrap();
316추가: let mut errors = Vec::new();
317추가: err.read_to_end(&mut errors).unwrap();
318추가: assert!(child.0.wait().unwrap().success());
319추가: assert!(errors.is_empty(), "{errors:?}");
320추가: let mut reader = Reader::new(bytes.as_slice());
321추가: let mut events = Vec::new();
322추가: while let Some((_, _, event)) = reader.read().unwrap() {
323추가: events.push(event);
324추가: }
325추가: events
326추가: }
327추가:
328추가: #[test]
329추가: fn compressed_tar_codec_space_failure_never_publishes() {
330추가: for kind in ["bz2", "xz"] {
331추가: for (mode, error) in [("full", ErrorCode::DiskFull), ("io", ErrorCode::Io)] {
332추가: let s = fixture(kind, "normal");
333추가: let (mut child, writer) = inject(&s, mode);
334추가: drop(writer);
335추가: let events = finish(&mut child);
336추가: assert!(s.0.join("paused").exists());
337추가: no_output(&s, &events, error);
338추가: }
339추가: }
340추가: }
341추가:
342추가: #[test]
343추가: fn compressed_tar_cancels_during_decode_and_cleans_staging() {
344추가: for kind in ["bz2", "xz"] {
345추가: let s = fixture(kind, "normal");
346추가: let (mut child, mut writer) = inject(&s, "pause");
347추가: let deadline = Instant::now() + Duration::from_secs(10);
348추가: while !s.0.join("paused").exists() {
349추가: assert!(Instant::now() < deadline, "decoder did not pause");
350추가: std::thread::sleep(Duration::from_millis(5));
351추가: }
352추가: writer.send(&Message::Cancel).unwrap();
353추가: drop(writer);
354추가: std::thread::sleep(Duration::from_millis(25));
355추가: fs::write(s.0.join("release"), b"").unwrap();
356추가: let events = finish(&mut child);
357추가: assert_eq!(terminal(&events).outcome, Outcome::Cancelled, "{events:?}");
358추가: assert_eq!(terminal(&events).created_count, 0);
359추가: assert_eq!(fs::read_dir(s.0.join("output")).unwrap().count(), 0);
360추가: assert!(
361추가: !events
362추가: .iter()
363추가: .any(|event| matches!(event, Message::Output { .. }))
364추가: );
365추가: }
366추가: }
367추가: }
368추가:
369추가: #[test]
370추가: fn xz_index_and_footer_claims_are_checked_before_publication() {
371추가: for (case, error) in [
372추가: ("index-size", ErrorCode::Integrity),
373추가: ("footer-offset", ErrorCode::Integrity),
374추가: ("index-huge", ErrorCode::Limit),
375추가: ] {
376추가: let s = fixture("xz", case);
377추가: let events = run_case(&s, Limits::default());
378추가: no_output(&s, &events, error);
379추가: }
380추가: }
381추가:
382추가: #[test]
383추가: fn compressed_tar_output_quota_boundary() {
384추가: for kind in ["bz2", "xz"] {
385추가: for below in [false, true] {
386추가: let s = fixture(kind, "normal");
387추가: let size: u64 = fs::read_to_string(s.0.join("plain-size"))
388추가: .unwrap()
389추가: .parse()
390추가: .unwrap();
391추가: let events = run_case(
392추가: &s,
393추가: Limits {
394추가: output: size - u64::from(below),
395추가: ..Limits::default()
396추가: },
397추가: );
398추가: if below {
399추가: no_output(&s, &events, ErrorCode::Limit);
400추가: } else {
401추가: assert_eq!(terminal(&events).outcome, Outcome::Completed, "{events:?}");
402추가: }
403추가: }
404추가: }
405추가: }
추가tests/rust-archive-worker/compressed_tar_cases.py+192-0
@@ -0,0 +1,192 @@
1추가: import bz2
2추가: import hashlib
3추가: import io
4추가: import lzma
5추가: from pathlib import Path
6추가: import random
7추가: import sys
8추가: import tarfile
9추가: import zlib
10추가:
11추가:
12추가: root = Path(sys.argv[1])
13추가: kind = sys.argv[2]
14추가: case = sys.argv[3]
15추가: payload = bytes(range(251)) * 1800
16추가: if case == "bomb":
17추가: payload = bytes(8 * 1024 * 1024)
18추가: elif case == "stored-chunks":
19추가: payload = random.Random(42).randbytes(len(payload))
20추가: buffer = io.BytesIO()
21추가: with tarfile.open(fileobj=buffer, mode="w", format=tarfile.USTAR_FORMAT) as archive:
22추가: if case != "empty":
23추가: name = "../escape" if case == "unsafe" else "folder/payload.bin"
24추가: member = tarfile.TarInfo(name)
25추가: member.size = len(payload)
26추가: archive.addfile(member, io.BytesIO(payload))
27추가: if case == "link":
28추가: member = tarfile.TarInfo("link")
29추가: member.type = tarfile.SYMTYPE
30추가: member.linkname = "folder/payload.bin"
31추가: archive.addfile(member)
32추가: member = tarfile.TarInfo("empty/")
33추가: member.type = tarfile.DIRTYPE
34추가: archive.addfile(member)
35추가: member = tarfile.TarInfo("한글.txt")
36추가: member.size = 3
37추가: archive.addfile(member, io.BytesIO(b"end"))
38추가: plain = buffer.getvalue()
39추가: if case == "bad-tar":
40추가: plain = bytes([plain[0] ^ 1]) + plain[1:]
41추가: if case == "raw":
42추가: plain = b"not a tar archive"
43추가: if case == "empty-stream":
44추가: plain = b""
45추가:
46추가: def compress(data):
47추가: if kind == "bz2":
48추가: return bz2.compress(data)
49추가: check = {
50추가: "crc32": lzma.CHECK_CRC32,
51추가: "sha256": lzma.CHECK_SHA256,
52추가: "no-check": lzma.CHECK_NONE,
53추가: }.get(case, lzma.CHECK_CRC64)
54추가: filters = None
55추가: if case in ("filters", "multi-block-filters"):
56추가: filters = [
57추가: {"id": lzma.FILTER_X86},
58추가: {"id": lzma.FILTER_DELTA, "dist": 3},
59추가: {"id": lzma.FILTER_LZMA2, "dict_size": 1 << 20},
60추가: ]
61추가: return lzma.compress(data, check=check, filters=filters)
62추가:
63추가:
64추가: def encode_vli(value):
65추가: result = bytearray()
66추가: while value >= 128:
67추가: result.append((value & 127) | 128)
68추가: value >>= 7
69추가: result.append(value)
70추가: return result
71추가:
72추가:
73추가: def read_vli(data, cursor):
74추가: value = 0
75추가: shift = 0
76추가: while True:
77추가: byte = data[cursor]
78추가: cursor += 1
79추가: value |= (byte & 127) << shift
80추가: if byte < 128:
81추가: return value, cursor
82추가: shift += 7
83추가:
84추가:
85추가: def xz_blocks(parts, deltas=None, shift_unpadded=False):
86추가: streams = [compress(part) for part in parts]
87추가: blocks = bytearray()
88추가: index = bytearray([0]) + encode_vli(len(streams))
89추가: for number, stream in enumerate(streams):
90추가: length = (int.from_bytes(stream[-8:-4], "little") + 1) * 4
91추가: start = len(stream) - 12 - length
92추가: count, cursor = read_vli(stream, start + 1)
93추가: assert count == 1
94추가: unpadded, cursor = read_vli(stream, cursor)
95추가: size, _ = read_vli(stream, cursor)
96추가: blocks.extend(stream[12:start])
97추가: unpadded_delta, size_delta = deltas[number] if deltas else (0, 0)
98추가: if shift_unpadded and number == 0:
99추가: unpadded_delta = 1 if unpadded % 4 else -1
100추가: assert (unpadded + 3) // 4 == (unpadded + unpadded_delta + 3) // 4
101추가: index.extend(encode_vli(unpadded + unpadded_delta))
102추가: index.extend(encode_vli(size + size_delta))
103추가: index.extend(bytes(-len(index) % 4))
104추가: index.extend(zlib.crc32(index).to_bytes(4, "little"))
105추가: footer = (len(index) // 4 - 1).to_bytes(4, "little") + streams[0][6:8]
106추가: footer = zlib.crc32(footer).to_bytes(4, "little") + footer + b"YZ"
107추가: return streams[0][:12] + blocks + index + footer
108추가:
109추가:
110추가: index_cases = {
111추가: "index-stream-sizes", "index-block-sizes", "index-unpadded-sizes",
112추가: }
113추가: if kind == "xz" and case in index_cases | {"multi-block", "multi-block-filters"}:
114추가: half = len(plain) // 2
115추가: parts = [plain[:half], plain[half:]]
116추가: if case == "index-stream-sizes":
117추가: packed = xz_blocks(parts[:1], [(0, 1)]) + xz_blocks(parts[1:], [(0, -1)])
118추가: elif case == "index-block-sizes":
119추가: packed = xz_blocks(parts, [(0, 1), (0, -1)])
120추가: elif case == "index-unpadded-sizes":
121추가: packed = xz_blocks(parts, shift_unpadded=True)
122추가: else:
123추가: packed = xz_blocks(parts)
124추가: if case in index_cases:
125추가: try:
126추가: lzma.decompress(packed)
127추가: except lzma.LZMAError:
128추가: pass
129추가: else:
130추가: raise AssertionError("참조 디코더가 손상 인덱스를 허용함")
131추가: elif case in ("multi", "multi-bad", "padding"):
132추가: half = len(plain) // 2
133추가: padding = bytes(4) if kind == "xz" and case == "padding" else b""
134추가: packed = compress(plain[:half]) + padding + compress(plain[half:]) + padding
135추가: else:
136추가: packed = compress(plain)
137추가: if case == "truncated":
138추가: packed = packed[:-5]
139추가: elif case == "multi-bad":
140추가: packed = packed[:-5]
141추가: elif case == "corrupt":
142추가: at = len(packed) // 2
143추가: packed = packed[:at] + bytes([packed[at] ^ 128]) + packed[at + 1:]
144추가: elif case == "trailing":
145추가: packed += b"garbage"
146추가: elif case == "dictionary":
147추가: packed = bytearray(packed)
148추가: header_end = 12 + (packed[12] + 1) * 4
149추가: assert packed[14:16] == b"\x21\x01"
150추가: packed[16] = 40
151추가: packed[header_end - 4:header_end] = zlib.crc32(packed[12:header_end - 4]).to_bytes(4, "little")
152추가: packed = bytes(packed)
153추가: elif case == "bad-padding":
154추가: packed += b"\0"
155추가: if case in ("index-size", "footer-offset", "index-huge"):
156추가: packed = bytearray(packed)
157추가: if case == "index-size":
158추가: length = (int.from_bytes(packed[-8:-4], "little") + 1) * 4
159추가: index = len(packed) - 12 - length
160추가: cursor = index + 2
161추가: while packed[cursor] & 128:
162추가: cursor += 1
163추가: cursor += 1
164추가: packed[cursor] ^= 1
165추가: packed[-16:-12] = zlib.crc32(packed[index:-16]).to_bytes(4, "little")
166추가: else:
167추가: size = int.from_bytes(packed[-8:-4], "little") + 1
168추가: if case == "index-huge":
169추가: size = (8 * 1024 * 1024) // 4
170추가: packed[-8:-4] = size.to_bytes(4, "little")
171추가: packed[-12:-8] = zlib.crc32(packed[-8:-2]).to_bytes(4, "little")
172추가: packed = bytes(packed)
173추가: (root / "plain-size").write_text(str(len(plain)))
174추가: (root / "input").write_bytes(packed)
175추가: if case in (
176추가: "normal", "multi", "multi-block", "multi-block-filters", "stored-chunks",
177추가: "padding", "crc32", "sha256", "no-check", "filters",
178추가: ):
179추가: decoded = bz2.decompress(packed) if kind == "bz2" else lzma.decompress(packed)
180추가: if case == "padding":
181추가: decoded = b""
182추가: remaining = packed
183추가: while remaining:
184추가: part = lzma.LZMADecompressor()
185추가: decoded += part.decompress(remaining)
186추가: assert part.eof
187추가: remaining = part.unused_data.lstrip(bytes(1))
188추가: assert decoded == plain, case
189추가: with tarfile.open(fileobj=io.BytesIO(decoded), mode="r:") as archive:
190추가: actual = archive.extractfile("folder/payload.bin").read()
191추가: assert hashlib.sha256(actual).digest() == hashlib.sha256(payload).digest()
192추가: (root / "expected").write_bytes(actual)
수정tests/rust-archive-worker/conflicts.rs+228-0
@@ -700,3 +700,231 @@ fn overwrite_does_not_modify_other_hard_links() {
700700 assert_eq!(fs::read(s.0.join("output/a")).unwrap(), PAYLOAD);
701701 assert_eq!(fs::read(s.0.join("outside")).unwrap(), b"original");
702702}
703추가:
704추가: #[cfg(target_os = "linux")]
705추가: #[test]
706추가: fn skip_all_ignores_destination_space_for_zip_tar_and_gzip() {
707추가: for format in ["zip", "tar", "gzip"] {
708추가: for apply in [false, true] {
709추가: let s = Scratch::new();
710추가: let names = match format {
711추가: "zip" => vec!["a", "b"],
712추가: "tar" => vec!["folder/hello.txt"],
713추가: _ => vec!["chosen.txt"],
714추가: };
715추가: fixture(&s, &names);
716추가: let mut start = request(&s);
717추가: if format == "tar" {
718추가: fs::write(s.0.join("input"), include_bytes!("fixtures/sample.tar")).unwrap();
719추가: } else if format == "gzip" {
720추가: fs::write(s.0.join("input"), include_bytes!("fixtures/sample.gz")).unwrap();
721추가: if let Action::Extract {
722추가: gzip_output_name, ..
723추가: } = &mut start.action
724추가: {
725추가: *gzip_output_name = Some("chosen.txt".into());
726추가: }
727추가: }
728추가: let before = names
729추가: .iter()
730추가: .map(|name| hash(&s.0.join("output").join(name)))
731추가: .collect::<Vec<_>>();
732추가: let events = run(
733추가: &s,
734추가: start,
735추가: Some("space-destination"),
736추가: vec![],
737추가: |event| match event {
738추가: Message::ConflictRequired { challenge_id, .. } => {
739추가: Some(vec![reply(*challenge_id, ConflictChoice::Skip, apply)])
740추가: }
741추가: _ => None,
742추가: },
743추가: );
744추가: assert_eq!(
745추가: terminal(&events).outcome,
746추가: Outcome::Completed,
747추가: "{format}/{apply}: {events:?}"
748추가: );
749추가: assert_eq!(terminal(&events).error, ErrorCode::None);
750추가: assert_eq!(terminal(&events).publication, Publication::None);
751추가: assert_eq!(terminal(&events).created_count, 0);
752추가: assert_eq!(terminal(&events).durability, Durability::NotApplicable);
753추가: assert_eq!(terminal(&events).cleanup, Cleanup::Complete);
754추가: assert_eq!(created(&events), 0);
755추가: let conflicts = if format == "zip" { 2 } else { 1 };
756추가: assert_eq!(questions(&events), if apply { 1 } else { conflicts });
757추가: assert_eq!(
758추가: count(&events, |event| matches!(
759추가: event,
760추가: Message::ConflictResolved {
761추가: choice: ConflictChoice::Skip,
762추가: ..
763추가: }
764추가: )),
765추가: conflicts
766추가: );
767추가: for (name, before) in names.iter().zip(before) {
768추가: assert_eq!(hash(&s.0.join("output").join(name)), before);
769추가: }
770추가: if format == "gzip" {
771추가: assert_eq!(
772추가: fs::read(s.0.join("output/chosen.txt")).unwrap(),
773추가: b"original"
774추가: );
775추가: }
776추가: assert!(
777추가: !s.0.join("paused").exists(),
778추가: "skipped files must not charge destination space"
779추가: );
780추가: }
781추가: }
782추가: }
783추가: #[cfg(target_os = "linux")]
784추가: #[test]
785추가: fn destination_space_is_checked_after_overwrite_or_rename_choice() {
786추가: for choice in [ConflictChoice::Overwrite, ConflictChoice::Rename] {
787추가: let s = Scratch::new();
788추가: fixture(&s, &["a", "b"]);
789추가: let before = hash(&s.0.join("output/a"));
790추가: let events = run(
791추가: &s,
792추가: request(&s),
793추가: Some("space-destination"),
794추가: vec![],
795추가: |event| match event {
796추가: Message::ConflictRequired { challenge_id, .. } => {
797추가: Some(vec![reply(*challenge_id, choice, true)])
798추가: }
799추가: _ => None,
800추가: },
801추가: );
802추가: assert_eq!(questions(&events), 1, "{events:?}");
803추가: assert_eq!(
804추가: count(&events, |event| matches!(
805추가: event,
806추가: Message::ConflictResolved { .. }
807추가: )),
808추가: 1
809추가: );
810추가: assert_eq!(terminal(&events).error, ErrorCode::DiskFull, "{events:?}");
811추가: assert_eq!(terminal(&events).publication, Publication::None);
812추가: assert_eq!(terminal(&events).created_count, 0);
813추가: assert_eq!(terminal(&events).cleanup, Cleanup::Complete);
814추가: assert_eq!(hash(&s.0.join("output/a")), before);
815추가: assert_eq!(hash(&s.0.join("output/b")), before);
816추가: assert_eq!(fs::read_dir(s.0.join("output")).unwrap().count(), 2);
817추가: assert!(s.0.join("paused").exists());
818추가: }
819추가: }
820추가: #[cfg(target_os = "linux")]
821추가: #[test]
822추가: fn skipped_files_do_not_charge_space_for_remaining_publication() {
823추가: for choice in [
824추가: Some(ConflictChoice::Overwrite),
825추가: Some(ConflictChoice::Rename),
826추가: None,
827추가: ] {
828추가: let s = Scratch::new();
829추가: fixture(&s, &["a", "b", "c"]);
830추가: assert!(PAYLOAD.len() <= 64 && PAYLOAD.len() * 3 > 64);
831추가: if choice.is_none() {
832추가: fs::remove_file(s.0.join("output/c")).unwrap();
833추가: }
834추가: let events = run(
835추가: &s,
836추가: request(&s),
837추가: Some("space-one-output"),
838추가: vec![],
839추가: |event| match event {
840추가: Message::ConflictRequired {
841추가: challenge_id,
842추가: entry_id,
843추가: ..
844추가: } => {
845추가: let choice = if *entry_id < 2 {
846추가: ConflictChoice::Skip
847추가: } else {
848추가: choice.unwrap()
849추가: };
850추가: Some(vec![reply(*challenge_id, choice, false)])
851추가: }
852추가: _ => None,
853추가: },
854추가: );
855추가: assert_eq!(
856추가: terminal(&events).outcome,
857추가: Outcome::Completed,
858추가: "{choice:?}: {events:?}"
859추가: );
860추가: assert_eq!(terminal(&events).publication, Publication::Complete);
861추가: assert_eq!(terminal(&events).created_count, 1);
862추가: assert_eq!(created(&events), 1);
863추가: assert_eq!(questions(&events), if choice.is_some() { 3 } else { 2 });
864추가: assert_eq!(fs::read(s.0.join("output/a")).unwrap(), b"original");
865추가: assert_eq!(fs::read(s.0.join("output/b")).unwrap(), b"original");
866추가: let output = if choice == Some(ConflictChoice::Rename) {
867추가: "c (1)"
868추가: } else {
869추가: "c"
870추가: };
871추가: assert_eq!(fs::read(s.0.join("output").join(output)).unwrap(), PAYLOAD);
872추가: if choice == Some(ConflictChoice::Rename) {
873추가: assert_eq!(fs::read(s.0.join("output/c")).unwrap(), b"original");
874추가: }
875추가: assert!(s.0.join("paused").exists());
876추가: }
877추가: }
878추가: #[cfg(target_os = "linux")]
879추가: #[test]
880추가: fn insufficient_destination_space_does_not_prevent_cancellation() {
881추가: let s = Scratch::new();
882추가: fixture(&s, &["a"]);
883추가: let events = run(
884추가: &s,
885추가: request(&s),
886추가: Some("space-destination"),
887추가: vec![],
888추가: |event| matches!(event, Message::ConflictRequired { .. }).then(|| vec![Message::Cancel]),
889추가: );
890추가: assert_eq!(questions(&events), 1, "{events:?}");
891추가: assert_eq!(terminal(&events).outcome, Outcome::Cancelled, "{events:?}");
892추가: assert_eq!(terminal(&events).publication, Publication::None);
893추가: assert_eq!(fs::read(s.0.join("output/a")).unwrap(), b"original");
894추가: }
895추가: #[cfg(target_os = "linux")]
896추가: #[test]
897추가: fn interactive_staging_space_and_integrity_checks_remain_before_questions() {
898추가: for corrupt in [false, true] {
899추가: let s = Scratch::new();
900추가: fixture(&s, &["a"]);
901추가: if corrupt {
902추가: let mut bytes = fs::read(s.0.join("input")).unwrap();
903추가: let at = bytes
904추가: .windows(PAYLOAD.len())
905추가: .position(|bytes| bytes == PAYLOAD)
906추가: .unwrap();
907추가: bytes[at] ^= 1;
908추가: fs::write(s.0.join("input"), bytes).unwrap();
909추가: }
910추가: let fault = if corrupt {
911추가: "space-destination"
912추가: } else {
913추가: "space-stage"
914추가: };
915추가: let events = run(&s, request(&s), Some(fault), vec![], |_| None);
916추가: assert_eq!(
917추가: terminal(&events).error,
918추가: if corrupt {
919추가: ErrorCode::Integrity
920추가: } else {
921추가: ErrorCode::DiskFull
922추가: },
923추가: "{events:?}"
924추가: );
925추가: assert_eq!(questions(&events), 0);
926추가: assert_eq!(created(&events), 0);
927추가: assert_eq!(terminal(&events).publication, Publication::None);
928추가: assert_eq!(fs::read(s.0.join("output/a")).unwrap(), b"original");
929추가: }
930추가: }
수정tests/rust-archive-worker/io_fault.c+6-1
@@ -116,11 +116,16 @@ int fstatvfs(int fd, struct statvfs *value) {
116116 if (fstat(fd, &st)) return -1;
117117 int affected = !strcmp(fault, "space-error") || !strcmp(fault, "space-combined")
118118 || (!strcmp(fault, "space-stage") && S_ISREG(st.st_mode))
119삭제: || (!strcmp(fault, "space-destination") && S_ISDIR(st.st_mode));
119추가: || ((!strcmp(fault, "space-destination") || !strcmp(fault, "space-one-output")) && S_ISDIR(st.st_mode));
120120 if (!affected) return result;
121121 int marker = real_openat(AT_FDCWD, getenv("ZIPELO_TEST_MARKER"), O_CREAT | O_WRONLY, 0600);
122122 if (marker >= 0) close(marker);
123123 if (!strcmp(fault, "space-error")) { errno = EIO; return -1; }
124추가: if (!strcmp(fault, "space-one-output")) {
125추가: value->f_frsize = 1;
126추가: value->f_bavail = 64;
127추가: return 0;
128추가: }
124129 value->f_bavail = !strcmp(fault, "space-combined") ? (1536 * 1024) / value->f_frsize : 0;
125130 return 0;
126131}
수정tests/rust-archive-worker/main.rs+2-0
@@ -1613,3 +1613,5 @@ mod zip_names;
16131613mod conflict_wire;
16141614
16151615mod conflicts;
1616추가:
1617추가: mod compressed_tar;
수정tests/rust-file-publication/paths.rs+38-2
@@ -5,7 +5,7 @@ use std::{
55 fs,
66 os::unix::{
77 ffi::{OsStrExt, OsStringExt},
8삭제: fs::{MetadataExt, symlink},
8추가: fs::{FileTypeExt, MetadataExt, symlink},
99 net::UnixListener,
1010 },
1111 path::{Path, PathBuf},
@@ -171,6 +171,42 @@ enum Existing {
171171 Socket,
172172}
173173
174추가: fn bind_socket(output: &Path) -> UnixListener {
175추가: // Cargo 시험의 현재 디렉터리 기준으로 소켓 주소만 짧게 지정함.
176추가: let current = std::env::current_dir().unwrap();
177추가: let relative = output.strip_prefix(&current).unwrap();
178추가: UnixListener::bind(relative).unwrap()
179추가: }
180추가:
181추가: #[test]
182추가: fn socket_conflict_preserves_output_beyond_absolute_address_limit() {
183추가: let sandbox = Sandbox::new();
184추가: let padding = 108usize
185추가: .saturating_sub(sandbox.root.as_os_str().as_bytes().len() + "/output".len())
186추가: .max(1);
187추가: let parent = sandbox.dir("p".repeat(padding));
188추가: let output = parent.join("output");
189추가: assert!(output.as_os_str().as_bytes().len() >= 108);
190추가: let listener = bind_socket(&output);
191추가: let before = fs::symlink_metadata(&output).unwrap();
192추가: assert!(before.file_type().is_socket());
193추가: conflict(
194추가: publish(
195추가: &parent,
196추가: OsStr::new("output"),
197추가: b"replacement",
198추가: Limits::default(),
199추가: ),
200추가: 11,
201추가: );
202추가: let after = fs::symlink_metadata(&output).unwrap();
203추가: assert!(after.file_type().is_socket());
204추가: assert_eq!((before.dev(), before.ino()), (after.dev(), after.ino()));
205추가: assert_eq!(names(&parent), vec![OsString::from("output")]);
206추가: drop(listener);
207추가: sandbox.finish();
208추가: }
209추가:
174210fn existing(kind: Existing) {
175211 let sandbox = Sandbox::new();
176212 let parent = sandbox.parent();
@@ -195,7 +231,7 @@ fn existing(kind: Existing) {
195231 assert_eq!(unsafe { libc::mkfifo(raw.as_ptr(), 0o600) }, 0);
196232 }
197233 Existing::Socket => {
198삭제: listener = Some(UnixListener::bind(&output).unwrap());
234추가: listener = Some(bind_socket(&output));
199235 }
200236 }
201237 let before = fs::symlink_metadata(&output).unwrap();
수정tests/rust-large-archive-fixtures/Cargo.lock+101-11
@@ -10,7 +10,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
1010dependencies = [
1111 "cfg-if",
1212 "cipher",
13삭제: "cpufeatures",
13추가: "cpufeatures 0.2.17",
1414 "zeroize",
1515]
1616
@@ -23,6 +23,24 @@ dependencies = [
2323 "generic-array",
2424]
2525
26추가: [[package]]
27추가: name = "block-buffer"
28추가: version = "0.12.1"
29추가: source = "registry+https://github.com/rust-lang/crates.io-index"
30추가: checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
31추가: dependencies = [
32추가: "hybrid-array",
33추가: ]
34추가:
35추가: [[package]]
36추가: name = "bzip2"
37추가: version = "0.6.1"
38추가: source = "registry+https://github.com/rust-lang/crates.io-index"
39추가: checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c"
40추가: dependencies = [
41추가: "libbz2-rs-sys",
42추가: ]
43추가:
2644[[package]]
2745name = "cfg-if"
2846version = "1.0.5"
@@ -35,10 +53,16 @@ version = "0.4.4"
3553source = "registry+https://github.com/rust-lang/crates.io-index"
3654checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
3755dependencies = [
38삭제: "crypto-common",
56추가: "crypto-common 0.1.7",
3957 "inout",
4058]
4159
60추가: [[package]]
61추가: name = "const-oid"
62추가: version = "0.10.3"
63추가: source = "registry+https://github.com/rust-lang/crates.io-index"
64추가: checksum = "be95d4a884358a21a199689323c29e9256b4a1b315e22f183d155422041d3a9a"
65추가:
4266[[package]]
4367name = "cpufeatures"
4468version = "0.2.17"
@@ -48,6 +72,15 @@ dependencies = [
4872 "libc",
4973]
5074
75추가: [[package]]
76추가: name = "cpufeatures"
77추가: version = "0.3.1"
78추가: source = "registry+https://github.com/rust-lang/crates.io-index"
79추가: checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
80추가: dependencies = [
81추가: "libc",
82추가: ]
83추가:
5184[[package]]
5285name = "crypto-common"
5386version = "0.1.7"
@@ -58,17 +91,37 @@ dependencies = [
5891 "typenum",
5992]
6093
94추가: [[package]]
95추가: name = "crypto-common"
96추가: version = "0.2.2"
97추가: source = "registry+https://github.com/rust-lang/crates.io-index"
98추가: checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
99추가: dependencies = [
100추가: "hybrid-array",
101추가: ]
102추가:
61103[[package]]
62104name = "digest"
63105version = "0.10.7"
64106source = "registry+https://github.com/rust-lang/crates.io-index"
65107checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
66108dependencies = [
67삭제: "block-buffer",
68삭제: "crypto-common",
109추가: "block-buffer 0.10.4",
110추가: "crypto-common 0.1.7",
69111 "subtle",
70112]
71113
114추가: [[package]]
115추가: name = "digest"
116추가: version = "0.11.3"
117추가: source = "registry+https://github.com/rust-lang/crates.io-index"
118추가: checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
119추가: dependencies = [
120추가: "block-buffer 0.12.1",
121추가: "const-oid",
122추가: "crypto-common 0.2.2",
123추가: ]
124추가:
72125[[package]]
73126name = "generic-array"
74127version = "0.14.7"
@@ -85,7 +138,16 @@ version = "0.12.1"
85138source = "registry+https://github.com/rust-lang/crates.io-index"
86139checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
87140dependencies = [
88삭제: "digest",
141추가: "digest 0.10.7",
142추가: ]
143추가:
144추가: [[package]]
145추가: name = "hybrid-array"
146추가: version = "0.4.15"
147추가: source = "registry+https://github.com/rust-lang/crates.io-index"
148추가: checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
149추가: dependencies = [
150추가: "typenum",
89151]
90152
91153[[package]]
@@ -97,19 +159,34 @@ dependencies = [
97159 "generic-array",
98160]
99161
162추가: [[package]]
163추가: name = "libbz2-rs-sys"
164추가: version = "0.2.6"
165추가: source = "registry+https://github.com/rust-lang/crates.io-index"
166추가: checksum = "32f454fd6831a29c0e827ed075bca2a15be201bd57f4168f0fd1041124eab17e"
167추가:
100168[[package]]
101169name = "libc"
102170version = "0.2.191"
103171source = "registry+https://github.com/rust-lang/crates.io-index"
104172checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
105173
174추가: [[package]]
175추가: name = "lzma-rust2"
176추가: version = "0.25.0"
177추가: source = "registry+https://github.com/rust-lang/crates.io-index"
178추가: checksum = "ef1d73c59a56771343712b22ea5615092c612c16ba291c0979e3105dfeec4890"
179추가: dependencies = [
180추가: "sha2 0.11.1",
181추가: ]
182추가:
106183[[package]]
107184name = "pbkdf2"
108185version = "0.12.2"
109186source = "registry+https://github.com/rust-lang/crates.io-index"
110187checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
111188dependencies = [
112삭제: "digest",
189추가: "digest 0.10.7",
113190 "hmac",
114191]
115192
@@ -120,8 +197,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
120197checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
121198dependencies = [
122199 "cfg-if",
123삭제: "cpufeatures",
124삭제: "digest",
200추가: "cpufeatures 0.2.17",
201추가: "digest 0.10.7",
125202]
126203
127204[[package]]
@@ -131,8 +208,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
131208checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
132209dependencies = [
133210 "cfg-if",
134삭제: "cpufeatures",
135삭제: "digest",
211추가: "cpufeatures 0.2.17",
212추가: "digest 0.10.7",
213추가: ]
214추가:
215추가: [[package]]
216추가: name = "sha2"
217추가: version = "0.11.1"
218추가: source = "registry+https://github.com/rust-lang/crates.io-index"
219추가: checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19"
220추가: dependencies = [
221추가: "cfg-if",
222추가: "cpufeatures 0.3.1",
223추가: "digest 0.11.3",
136224]
137225
138226[[package]]
@@ -164,10 +252,12 @@ name = "zipelo-archive-worker"
164252version = "0.1.0"
165253dependencies = [
166254 "aes",
255추가: "bzip2",
167256 "hmac",
257추가: "lzma-rust2",
168258 "pbkdf2",
169259 "sha1",
170삭제: "sha2",
260추가: "sha2 0.10.9",
171261 "subtle",
172262 "zeroize",
173263 "zlib-rs",
수정tests/rust-zip64-compat/Cargo.lock

Diff가 표시 한도를 넘어서 생략했어요.

Raw로 열기