setup now uses the new directory semantics
[citadel.git] / citadel / utils / setup.c
index 09ae02b3d0ae0998b19ea70fa6c021f06e3fc9f4..9083fb8d48d77ed85d7808f161f2192c2ae2c69b 100644 (file)
@@ -507,7 +507,7 @@ void check_xinetd_entry(void)
        );
        fclose(fp);
 
-       /* Now try to restart the service.  This will not have the intended effect on Solaris, but who the hell uses Solaris anymore? */
+       /* Now try to restart the service.  This will not have the intended effect on Solaris, but who uses Solaris anymore? */
        rv = system("systemctl restart xinetd >/dev/null 2>&1");
        if (rv != 0) {
                rv = system("service xinetd restart >/dev/null 2>&1");
@@ -694,9 +694,6 @@ int main(int argc, char *argv[])
        int curr;
        char buf[1024]; 
        char aaa[128];
-       int relh = 0;
-       int home = 0;
-       char relhome[PATH_MAX]="";
        char ctdldir[PATH_MAX]=CTDLDIR;
        struct passwd *pw;
        gid_t gid;
@@ -716,20 +713,16 @@ int main(int argc, char *argv[])
                        setup_type = atoi(aaa);
                }
                else if (!strncmp(argv[a], "-h", 2)) {
-                       relh=argv[a][2]!='/';
-                       if (!relh) {
-                               safestrncpy(ctdl_home_directory, &argv[a][2], sizeof ctdl_home_directory);
-                       } else {
-                               safestrncpy(relhome, &argv[a][2], sizeof relhome);
-                       }
-                       home = 1;
+                       safestrncpy(ctdldir, &argv[a][2], sizeof ctdldir);
                }
        }
 
-       calc_dirs_n_files(relh, home, relhome, ctdldir, 0);
-       SetTitles();
+       if (chdir(ctdldir) != 0) {
+               fprintf(stderr, "sendcommand: %s: %s\n", ctdldir, strerror(errno));
+               exit(errno);
+       }
 
-       enable_home = ( relh | home );
+       SetTitles();
 
        /*
         * Connect to the running Citadel server.