this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Create more directories upon prefix creation

+30 -23
+30 -23
src/startup/darling.c
··· 82 82 prefix = defaultPrefixPath(); 83 83 if (!prefix) 84 84 return 1; 85 + if (strlen(prefix) > 255) 86 + { 87 + fprintf(stderr, "Prefix path too long\n"); 88 + return 1; 89 + } 85 90 unsetenv("DPREFIX"); 86 91 87 92 if (!checkPrefixDir()) ··· 714 719 void setupPrefix() 715 720 { 716 721 char path[4096]; 722 + size_t plen; 723 + 724 + const char* dirs[] = { 725 + "/Volumes", 726 + "/Applications", 727 + "/usr", 728 + "/usr/local", 729 + "/usr/local/share", 730 + "/private", 731 + "/private/var", 732 + "/private/var/db", 733 + "/var", 734 + "/var/run", 735 + "/var/tmp" 736 + }; 717 737 718 738 fprintf(stderr, "Setting up a new Darling prefix at %s\n", prefix); 719 739 ··· 721 741 setegid(g_originalGid); 722 742 723 743 createDir(prefix); 724 - 725 - // The user needs to be able to create mountpoints, 726 - snprintf(path, sizeof(path), "%s/Volumes", prefix); 727 - createDir(path); 728 - // ... to install applications, 729 - snprintf(path, sizeof(path), "%s/Applications", prefix); 730 - createDir(path); 731 - 732 - // ... to put stuff in /usr/local, 733 - snprintf(path, sizeof(path), "%s/usr", prefix); 734 - createDir(path); 735 - snprintf(path, sizeof(path), "%s/usr/local", prefix); 736 - createDir(path); 737 - snprintf(path, sizeof(path), "%s/usr/local/share", prefix); 738 - createDir(path); 739 - 740 - // ... and to install plists to /var/db 741 - snprintf(path, sizeof(path), "%s/private", prefix); 742 - createDir(path); 743 - snprintf(path, sizeof(path), "%s/private/var", prefix); 744 - createDir(path); 745 - snprintf(path, sizeof(path), "%s/private/var/db", prefix); 746 - createDir(path); 744 + strcpy(path, prefix); 745 + strcat(path, "/"); 746 + plen = strlen(path); 747 747 748 + for (size_t i = 0; i < sizeof(dirs)/sizeof(dirs[0]); i++) 749 + { 750 + path[plen] = '\0'; 751 + strcat(path, dirs[i]); 752 + createDir(path); 753 + } 754 + 748 755 seteuid(0); 749 756 setegid(0); 750 757 }