terracatta
05/19/2020, 6:13 PMStefano Bonicatti
05/19/2020, 6:28 PMterracatta
05/19/2020, 6:34 PMtheopolis
05/19/2020, 6:41 PMterracatta
05/19/2020, 6:44 PMgroob
05/19/2020, 7:54 PMterracatta
05/19/2020, 7:54 PMgroob
05/19/2020, 7:54 PMterracatta
05/19/2020, 8:00 PMasuser 0
pthread_setugid_np
does notgroob
05/19/2020, 8:39 PMterracatta
05/19/2020, 8:39 PMgroob
05/19/2020, 8:44 PMterracatta
05/19/2020, 8:44 PMgroob
05/19/2020, 8:44 PMterracatta
05/19/2020, 8:45 PMgroob
05/19/2020, 8:46 PMterracatta
05/19/2020, 8:47 PMgroob
05/19/2020, 8:48 PMterracatta
05/19/2020, 8:52 PMtheopolis
05/20/2020, 1:33 PMterracatta
05/20/2020, 1:52 PM#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
pthread_setugid_np(501, 20)
NSUserDefaults * userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"com.apple.sharingd"];
NSDictionary * dict = [userDefaults dictionaryRepresentation];
NSLog(@"%@", dict);
return 0;
}
gcc -framework Foundation test.m -o test
and run it with sudo launchctl asuser 0 ./test
I get the settings for UID 0 not 501. If instead of pthread_setugid_np(501, 20)
I use seteuid(501); setegid(20)
and run it with the same arguments, it logs the correct settings.theopolis
05/20/2020, 3:47 PMterracatta
05/20/2020, 5:26 PM