Skip to content

Commit

Permalink
move mountPath to /mnt
Browse files Browse the repository at this point in the history
  • Loading branch information
w2599 committed Aug 11, 2024
1 parent 5f59bbc commit f49bec6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BaseBin/jbctl/src/internal.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void initMountPath(NSString *mountPath)
bool new = NO;

if([fileManager fileExistsAtPath:mountPath]){
NSString *newPath = JBROOT_PATH(mountPath);
NSString *newPath = [NSString stringWithFormat:@"%@%@", JBROOT_PATH(@"/mnt"), mountPath];

if (![fileManager fileExistsAtPath:newPath]) {
[fileManager createDirectoryAtPath:newPath withIntermediateDirectories:YES attributes:nil error:nil];
Expand Down Expand Up @@ -173,7 +173,8 @@ int jbctl_handle_internal(const char *command, int argc, char* argv[])
// This allows us to mount to paths that would otherwise be restricted by sandbox
printf("Applying mount %s...\n",argv[1]);
initMountPath([NSString stringWithUTF8String:argv[1]]);
ret = mount("bindfs", argv[1], MNT_RDONLY, (void *)JBROOT_PATH(argv[1]));
NSString *newMountPath = [NSString stringWithFormat:@"%@%s", JBROOT_PATH(@"/mnt"), argv[1]];
ret = mount("bindfs", argv[1], MNT_RDONLY, (void *)newMountPath.UTF8String);
printf("ret = %d\n",ret);
// revert
printf("Dropping kernel ucred...\n");
Expand Down

0 comments on commit f49bec6

Please sign in to comment.