Commit 47364b6
authored
feat: implement stat shadowing for container filesystem extraction (#303)
* fix: remove groups table references from database schema
Remove all references to the non-existent groups table that was causing
"no such table: main.groups" errors. This includes:
- Removed group_id and group_ip columns from sandboxes table
- Removed foreign key constraint to groups table
- Updated database functions to remove group parameters
- Updated Sandbox model to remove group fields
BREAKING CHANGE: Existing databases will need to be recreated or manually
updated to remove group columns from the sandboxes table.
* fix: preserve file type bits in stat xattr during tar extraction
Add get_full_mode() helper to combine file type bits (S_IFREG, S_IFDIR, etc.)
with permission bits when storing stat information in xattrs. This ensures
the full mode value is preserved for accurate file type identification.
* feat: add debug script to compare actual vs override stats
Add compare_stat_overrides.sh script that displays actual file stats
(uid:gid:mode) alongside user.containers.override_stat xattr values.
Supports depth limiting (-L) and hidden files (-a) options.
* fix: add cross-platform compatibility for macOS and Linux
- Cast libc file type constants (S_IFREG, S_IFDIR, etc.) to u32 to handle
platform differences (u16 on macOS, u32 on Linux)
- Add platform-specific setxattr implementations using cfg attributes
- macOS requires 6 arguments (includes position parameter)
- Linux requires 5 arguments1 parent d110bf1 commit 47364b6
File tree
8 files changed
+497
-51
lines changed- microsandbox-core/lib
- management
- migrations/sandbox
- runtime
- scripts
- debug
8 files changed
+497
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
130 | | - | |
131 | | - | |
132 | 128 | | |
133 | 129 | | |
134 | 130 | | |
| |||
142 | 138 | | |
143 | 139 | | |
144 | 140 | | |
145 | | - | |
146 | | - | |
147 | 141 | | |
148 | 142 | | |
149 | 143 | | |
| |||
154 | 148 | | |
155 | 149 | | |
156 | 150 | | |
157 | | - | |
158 | | - | |
159 | 151 | | |
160 | 152 | | |
161 | 153 | | |
| |||
171 | 163 | | |
172 | 164 | | |
173 | 165 | | |
174 | | - | |
175 | | - | |
| 166 | + | |
176 | 167 | | |
177 | | - | |
| 168 | + | |
178 | 169 | | |
179 | 170 | | |
180 | 171 | | |
| |||
185 | 176 | | |
186 | 177 | | |
187 | 178 | | |
188 | | - | |
189 | | - | |
190 | 179 | | |
191 | 180 | | |
192 | 181 | | |
| |||
203 | 192 | | |
204 | 193 | | |
205 | 194 | | |
206 | | - | |
| 195 | + | |
207 | 196 | | |
208 | 197 | | |
209 | 198 | | |
| |||
225 | 214 | | |
226 | 215 | | |
227 | 216 | | |
228 | | - | |
229 | | - | |
230 | 217 | | |
231 | 218 | | |
232 | 219 | | |
| |||
265 | 252 | | |
266 | 253 | | |
267 | 254 | | |
268 | | - | |
| 255 | + | |
269 | 256 | | |
270 | 257 | | |
271 | 258 | | |
| |||
290 | 277 | | |
291 | 278 | | |
292 | 279 | | |
293 | | - | |
294 | | - | |
295 | 280 | | |
296 | 281 | | |
297 | 282 | | |
| |||
0 commit comments