@@ -43,9 +43,6 @@ int main(int argc, char *argv[])
4343 int argsCount = 0 ;
4444 int argvCount;
4545 char buf [2048 ];
46- char Podman_Path[1024 ];
47- FILE *f;
48- struct stat sbuf;
4946 int status = 0 ;
5047
5148 if (geteuid () != 0 ) {
@@ -78,65 +75,6 @@ int main(int argc, char *argv[])
7875 fflush (stdout);
7976#endif
8077
81- // While the official Podman installer puts the Podman executable at
82- // "/opt/podman/bin/podman", other installation methods (e.g. brew) might not
83-
84- // The Mac installer wrote path to podman executable in Path_to_podman.txt
85- Podman_Path[0 ] = 0 ;
86- f = fopen (" /Library/Application Support/BOINC Data/Path_to_podman.txt" , " r" );
87- if (f) {
88- fgets (Podman_Path, sizeof (Podman_Path), f);
89- fclose (f);
90- char * p=strstr (Podman_Path, " \n " );
91- if (p) *p = ' \0 ' ; // Remove the newline character
92- }
93- if (stat ((const char *)Podman_Path, &sbuf)!= 0 ) {
94- Podman_Path[0 ] = 0 ;
95- }
96-
97- if (Podman_Path[0 ] == 0 ) {
98- // If we couldn't get it from that file, use default if installed using Podman installer
99- strlcpy (Podman_Path, " /opt/podman/bin/podman" , sizeof (Podman_Path));
100- if (stat ((const char *)Podman_Path, &sbuf) != 0 ) {
101- Podman_Path[0 ] = 0 ;
102- }
103- }
104-
105- if (Podman_Path[0 ] == 0 ) {
106- // If we couldn't get it from that file, use default if installed by Homebrew
107- #ifdef __arm64__
108- strlcpy (Podman_Path, " /opt/homebrew/bin/podman" , sizeof (Podman_Path));
109- #else
110- strlcpy (Podman_Path, " /usr/local/bin/podman" , sizeof (Podman_Path));
111- #endif
112- if (stat (Podman_Path, &sbuf) != 0 ) {
113- Podman_Path[0 ] = 0 ;
114- }
115- }
116-
117- if (Podman_Path[0 ] == 0 ) {
118- // Get the path to the podman executable dynamically
119- // Mac executables get a very limited PATH environment variable, so we must get the
120- // PATH variable used by Terminal and search there for the path to podman
121- f = popen (" a=`/usr/libexec/path_helper`;b=${a%\\\" *}\\\" ;env ${b} which podman" , " r" );
122- if (f) {
123- fgets (Podman_Path, sizeof (Podman_Path), f);
124- pclose (f);
125- char * p=strstr (Podman_Path, " \n " );
126- if (p) *p = ' \0 ' ; // Remove the newline character
127- #if VERBOSE
128- fprintf (debug_file, " popen returned podman path = \" %s\"\n " , Podman_Path);
129- #endif
130- }
131- }
132- if (Podman_Path[0 ] == 0 ) {
133- #if VERBOSE
134- fprintf (debug_file, " Can't get path to Podman\n " );
135- fflush (debug_file);
136- fclose (debug_file);
137- #endif
138- exit (1 );
139- }
14078
14179#if VERBOSE
14280 dup2 (saved_stdout_fd, fileno (stdout));
@@ -149,7 +87,7 @@ int main(int argc, char *argv[])
14987 // mostly in that user's home directory. To get around this, we
15088 // simulate a login by user boinc_project and set environment
15189 // variables for Podman to use our BOINC podman" directory instead
152- snprintf (buf, sizeof (buf), " env XDG_CONFIG_HOME=\" /Library/Application Support/BOINC podman\" XDG_DATA_HOME=\" /Library/Application Support/BOINC podman\" HOME=\" /Library/Application Support/BOINC podman\" %s " , Podman_Path );
90+ strlcpy (buf, " env XDG_CONFIG_HOME=\" /Library/Application Support/BOINC podman\" XDG_DATA_HOME=\" /Library/Application Support/BOINC podman\" HOME=\" /Library/Application Support/BOINC podman\" " , sizeof (buf) );
15391
15492 argvCount = 1 ; // arguments to be passed to Podman
15593 while (argv[argvCount]) {
0 commit comments