X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Futils%2Fsetup.c;h=9083fb8d48d77ed85d7808f161f2192c2ae2c69b;hb=d72427333e5ff60bab91622d393cc09882e36389;hp=09ae02b3d0ae0998b19ea70fa6c021f06e3fc9f4;hpb=638df7bdf8a26f581e746e00ae2dd3e8adca8c78;p=citadel.git diff --git a/citadel/utils/setup.c b/citadel/utils/setup.c index 09ae02b3d..9083fb8d4 100644 --- a/citadel/utils/setup.c +++ b/citadel/utils/setup.c @@ -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.