Skip to content

Commit

Permalink
same here?
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliesSurviving authored May 7, 2024
1 parent 3154781 commit 9af2eac
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Application/Dopamine/Jailbreak/DOJailbreaker.m
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ - (void)runWithError:(NSError **)errOut didRemoveJailbreak:(BOOL*)didRemove show
// We also do it now though in case there is a failure between the now step and the userspace reboot
//[[DOUIManager sharedInstance] sendLog:DOLocalizedString(@"Initializing Protection") debug:NO];
//*errOut = [self applyProtection];
// if (*errOut) return;
//if (*errOut) return;

[[DOUIManager sharedInstance] sendLog:DOLocalizedString(@"Applying Bind Mount") debug:NO];
*errOut = [self createFakeLib];
Expand Down
56 changes: 28 additions & 28 deletions BaseBin/jbctl/src/internal.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@

SInt32 CFUserNotificationDisplayAlert(CFTimeInterval timeout, CFOptionFlags flags, CFURLRef iconURL, CFURLRef soundURL, CFURLRef localizationURL, CFStringRef alertHeader, CFStringRef alertMessage, CFStringRef defaultButtonTitle, CFStringRef alternateButtonTitle, CFStringRef otherButtonTitle, CFOptionFlags *responseFlags) API_AVAILABLE(ios(3.0));

//void execute_unsandboxed(void (^block)(void))
//{
// uint64_t credBackup = 0;
// jbclient_root_steal_ucred(0, &credBackup);
// block();
// jbclient_root_steal_ucred(credBackup, NULL);
//}
void execute_unsandboxed(void (^block)(void))
{
uint64_t credBackup = 0;
jbclient_root_steal_ucred(0, &credBackup);
block();
jbclient_root_steal_ucred(credBackup, NULL);
}

//int mount_unsandboxed(const char *type, const char *dir, int flags, void *data)
//{
// __block int r = 0;
// execute_unsandboxed(^{
// r = mount(type, dir, flags, data);
// });
// return r;
//}
int mount_unsandboxed(const char *type, const char *dir, int flags, void *data)
{
__block int r = 0;
execute_unsandboxed(^{
r = mount(type, dir, flags, data);
});
return r;
}

//void ensureProtected(const char *path)
//{
// struct statfs sb;
// statfs(path, &sb);
// if (strcmp(path, sb.f_mntonname) != 0) {
// mount_unsandboxed("bindfs", path, 0, (void *)path);
// }
//}
void ensureProtected(const char *path)
{
struct statfs sb;
statfs(path, &sb);
if (strcmp(path, sb.f_mntonname) != 0) {
mount_unsandboxed("bindfs", path, 0, (void *)path);
}
}

//void ensureProtectionActive(void)
//{
void ensureProtectionActive(void)
{
// Protect /private/preboot/UUID/<System, usr> from being modified by bind mounting them on top of themselves
// This protects dumb users from accidentally deleting these, which would induce a recovery loop after rebooting
// ensureProtected(prebootUUIDPath("/System"));
// ensureProtected(prebootUUIDPath("/usr"));
//}
ensureProtected(prebootUUIDPath("/System"));
ensureProtected(prebootUUIDPath("/usr"));
}

int jbctl_handle_internal(const char *command, int argc, char* argv[])
{
Expand Down

0 comments on commit 9af2eac

Please sign in to comment.