]> git.saurik.com Git - cydia.git/commitdiff
The mobile extended_states could be marked setuid.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 12 Oct 2015 12:07:55 +0000 (05:07 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 12 Oct 2015 12:07:55 +0000 (05:07 -0700)
MobileCydia.mm

index 20d686a6a76929ed9a5c4b6a9719d82de4ce91f7..eacb25d9bd88088d7bee5f753bd890940f9e6cc5 100644 (file)
@@ -4132,10 +4132,8 @@ class CydiaLogCleaner :
     NSString *nextended(Cache("extended_states"));
 
     struct stat info;
-    if (stat([nextended UTF8String], &info) != -1 && (info.st_mode & S_IFMT) == S_IFREG) {
-        system([[NSString stringWithFormat:@"/usr/libexec/cydia/cydo /bin/mv -f %@ %@", ShellEscape(nextended), ShellEscape(oextended)] UTF8String]);
-        system([[NSString stringWithFormat:@"/usr/libexec/cydia/cydo /bin/chown 0:0 %@", ShellEscape(oextended)] UTF8String]);
-    }
+    if (stat([nextended UTF8String], &info) != -1 && (info.st_mode & S_IFMT) == S_IFREG)
+        system([[NSString stringWithFormat:@"/usr/libexec/cydia/cydo /bin/cp --remove-destination %@ %@", ShellEscape(nextended), ShellEscape(oextended)] UTF8String]);
 
     unlink([nextended UTF8String]);
     symlink([oextended UTF8String], [nextended UTF8String]);