"specify a directory other than the default, you will need to\n"
"specify the -h flag to the server when you start it up.\n",
#else
-"Enter the subdirectoryname for an alternating installation of "
+"Enter the subdirectory name for an alternate installation of "
"Citadel. To do a default installation just leave it blank."
"If you specify a directory other than the default, you will need to\n"
"specify the -h flag to the server when you start it up.\n"
FILE *fp;
int fd;
- if ((fd = creat(
-#ifndef HAVE_ETC_DIR
- "."
-#else
- ETC_DIR
-#endif
- "/citadel.config", S_IRUSR | S_IWUSR)) == -1) {
+ if ((fd = creat(file_citadel_config, S_IRUSR | S_IWUSR)) == -1) {
display_error("setup: cannot open citadel.config");
cleanup(1);
}
fclose(fp);
}
- /* Check to see if we're running the web installer */
+ /* Check to see if we're running the web installer */
if (getenv("CITADEL_INSTALLER") != NULL) {
using_web_installer = 1;
}
home=(setup_directory[1]!='\0');
relh=home&(setup_directory[1]!='/');
- if (!relh) safestrncpy(ctdl_home_directory, setup_directory,
- sizeof ctdl_home_directory);
- else
- safestrncpy(relhome, ctdl_home_directory,
- sizeof relhome);
+ if (!relh) {
+ safestrncpy(ctdl_home_directory, setup_directory, sizeof ctdl_home_directory);
+ }
+ else {
+ safestrncpy(relhome, ctdl_home_directory, sizeof relhome);
+ }
calc_dirs_n_files(relh, home, relhome, ctdldir);
enable_home=(relh|home);
- if ((home) && (chdir(setup_directory) != 0)) {
- important_message("Citadel Setup",
- "The directory you specified does not exist.");
- cleanup(errno);
+ if (home) {
+ if (chdir(setup_directory) == 0) {
+ strcpy(file_citadel_config, "./citadel.config");
+ }
+ else {
+ important_message("Citadel Setup",
+ "The directory you specified does not exist.");
+ cleanup(errno);
+ }
}
/* Determine our host name, in case we need to use it as a default */
case UI_TEXT:
printf("\n\n\n"
- " *** Citadel setup program ***\n\n");
+ " *** Citadel setup program ***\n\n");
break;
}
if (config.c_smtps_port == 0) config.c_smtps_port = 465;
if (config.c_pop3s_port == 0) config.c_pop3s_port = 995;
if (config.c_imaps_port == 0) config.c_imaps_port = 993;
+ if (config.c_pftcpdict_port == 0) config.c_pftcpdict_port = -1;
+ if (config.c_managesieve_port == 0) config.c_managesieve_port = -1;
/* Go through a series of dialogs prompting for config info */
if (setup_type != UI_SILENT) {
chmod(ctdl_image_dir, 0700);
chown(ctdl_image_dir, config.c_ctdluid, -1);
+ mkdir(ctdl_bb_dir, 0700);
+ chmod(ctdl_bb_dir, 0700);
+ chown(ctdl_bb_dir, config.c_ctdluid, -1);
+
+ mkdir(ctdl_file_dir, 0700);
+ chmod(ctdl_file_dir, 0700);
+ chown(ctdl_file_dir, config.c_ctdluid, -1);
+
+ mkdir(ctdl_netcfg_dir, 0700);
+ chmod(ctdl_netcfg_dir, 0700);
+ chown(ctdl_netcfg_dir, config.c_ctdluid, -1);
+
/* TODO: where to put this? */
mkdir("netconfigs", 0700);
chmod("netconfigs", 0700);
disable_other_mta("zimbra");
#endif
+ /* Check for the 'db' nss and offer to disable it */
+ fixnss();
+
if ((pw = getpwuid(config.c_ctdluid)) == NULL)
gid = getgid();
else
sleep(1);
progress("Setting file permissions", 4, 4);
- fixnss();
-
#ifdef HAVE_LDAP
/* Contemplate the possibility of auto-configuring OpenLDAP */
contemplate_ldap();