citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Loading...
Searching...
No Matches
setup.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <signal.h>
#include <netdb.h>
#include <errno.h>
#include <limits.h>
#include <pwd.h>
#include <time.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <assert.h>
#include <libcitadel.h>
#include "../server/citadel.h"
#include "axdefs.h"
#include "../server/sysdep.h"
#include "../server/citadel_dirs.h"
Include dependency graph for setup.c:

Go to the source code of this file.

Macros

#define SHOW_ME_VAPPEND_PRINTF
 
#define _(string)   (string)
 
#define SERVICE_NAME   "citadel"
 
#define PROTO_NAME   "tcp"
 
#define NSSCONF   "/etc/nsswitch.conf"
 

Typedefs

typedef enum _SetupStep eSetupStep
 

Enumerations

enum  _SetupStep {
  eCitadelHomeDir = 0 , eSysAdminName = 1 , eSysAdminPW = 2 , eUID = 3 ,
  eIP_ADDR = 4 , eCTDL_Port = 5 , eAuthType = 6 , eLDAP_Host = 7 ,
  eLDAP_Port = 8 , eLDAP_Base_DN = 9 , eLDAP_Bind_DN = 10 , eLDAP_Bind_PW = 11 ,
  eMaxQuestions = 12
}
 

Functions

void SetTitles (void)
 
void cls (void)
 
void title (const char *text)
 
int yesno (const char *question, int default_value)
 
void important_message (const char *title, const char *msgtext)
 
void important_msgnum (int msgnum)
 
void display_error (char *error_message_format,...)
 
void progress (char *text, long int curr, long int cmax)
 
int uds_connectsock (char *sockpath)
 
void serv_read (char *buf, int bytes)
 
void serv_write (char *buf, int nbytes)
 
void serv_gets (char *buf)
 
void serv_puts (char *buf)
 
void getconf_str (char *buf, char *key)
 
int getconf_int (char *key)
 
void setconf_str (char *key, char *val)
 
void setconf_int (char *key, int val)
 
void check_xinetd_entry (void)
 
void strprompt (const char *prompt_title, const char *prompt_text, char *Target, char *DefValue)
 
void set_bool_val (int msgpos, int *ip, char *DefValue)
 
void set_str_val (int msgpos, char *Target, char *DefValue)
 
void set_int_val (int msgpos, int *target, char *default_value)
 
void edit_value (int curr)
 
void unused_messages (void)
 
int main (int argc, char *argv[])
 

Variables

const char * EnvNames [eMaxQuestions]
 "CREATE_XINETD_ENTRY";
 
int setup_type = (-1)
 
int enable_home = 1
 
char admin_name [SIZ]
 
char admin_pass [SIZ]
 
char admin_cmd [SIZ]
 
int serv_sock = (-1)
 
const char * setup_titles [eMaxQuestions]
 
const char * setup_text [eMaxQuestions]
 
char * program_title
 

Macro Definition Documentation

◆ _

#define _ (   string)    (string)

Definition at line 41 of file setup.c.

◆ NSSCONF

#define NSSCONF   "/etc/nsswitch.conf"

Definition at line 46 of file setup.c.

◆ PROTO_NAME

#define PROTO_NAME   "tcp"

Definition at line 45 of file setup.c.

◆ SERVICE_NAME

#define SERVICE_NAME   "citadel"

Definition at line 44 of file setup.c.

◆ SHOW_ME_VAPPEND_PRINTF

#define SHOW_ME_VAPPEND_PRINTF

Definition at line 8 of file setup.c.

Typedef Documentation

◆ eSetupStep

typedef enum _SetupStep eSetupStep

Enumeration Type Documentation

◆ _SetupStep

enum _SetupStep
Enumerator
eCitadelHomeDir 
eSysAdminName 
eSysAdminPW 
eUID 
eIP_ADDR 
eCTDL_Port 
eAuthType 
eLDAP_Host 
eLDAP_Port 
eLDAP_Base_DN 
eLDAP_Bind_DN 
eLDAP_Bind_PW 
eMaxQuestions 

Definition at line 48 of file setup.c.

Function Documentation

◆ check_xinetd_entry()

void check_xinetd_entry ( void  )

Definition at line 430 of file setup.c.

References _, ctdl_bin_dir, display_error(), SIZ, and yesno().

Referenced by main().

◆ cls()

void cls ( void  )

Definition at line 211 of file setup.c.

References program_title.

Referenced by important_message(), progress(), and title().

◆ display_error()

void display_error ( char *  error_message_format,
  ... 
)

Definition at line 265 of file setup.c.

References _, and important_message().

Referenced by check_xinetd_entry(), and main().

◆ edit_value()

◆ getconf_int()

int getconf_int ( char *  key)

Definition at line 403 of file setup.c.

References getconf_str(), and SIZ.

Referenced by edit_value(), and main().

◆ getconf_str()

void getconf_str ( char *  buf,
char *  key 
)

Definition at line 387 of file setup.c.

References serv_gets(), serv_puts(), and SIZ.

Referenced by edit_value(), and getconf_int().

◆ important_message()

void important_message ( const char *  title,
const char *  msgtext 
)

Definition at line 248 of file setup.c.

References _, cls(), SIZ, and title().

Referenced by display_error(), important_msgnum(), and unused_messages().

◆ important_msgnum()

void important_msgnum ( int  msgnum)

Definition at line 260 of file setup.c.

References _, important_message(), and setup_text.

◆ main()

◆ progress()

void progress ( char *  text,
long int  curr,
long int  cmax 
)

Definition at line 279 of file setup.c.

References cls().

Referenced by main(), and migr_export_messages().

◆ serv_gets()

void serv_gets ( char *  buf)

Definition at line 357 of file setup.c.

References serv_read(), and SIZ.

Referenced by getconf_str(), main(), setconf_int(), and setconf_str().

◆ serv_puts()

void serv_puts ( char *  buf)

Definition at line 380 of file setup.c.

References serv_write().

Referenced by getconf_str(), main(), setconf_int(), and setconf_str().

◆ serv_read()

void serv_read ( char *  buf,
int  bytes 
)

Definition at line 328 of file setup.c.

References serv_sock.

Referenced by serv_gets().

◆ serv_write()

void serv_write ( char *  buf,
int  nbytes 
)

Definition at line 343 of file setup.c.

References serv_sock.

Referenced by serv_puts().

◆ set_bool_val()

void set_bool_val ( int  msgpos,
int *  ip,
char *  DefValue 
)

Definition at line 514 of file setup.c.

References setup_text, setup_titles, title(), and yesno().

◆ set_int_val()

void set_int_val ( int  msgpos,
int *  target,
char *  default_value 
)

Definition at line 530 of file setup.c.

References set_str_val().

Referenced by edit_value().

◆ set_str_val()

void set_str_val ( int  msgpos,
char *  Target,
char *  DefValue 
)

Definition at line 520 of file setup.c.

References setup_text, setup_titles, and strprompt().

Referenced by edit_value(), and set_int_val().

◆ setconf_int()

void setconf_int ( char *  key,
int  val 
)

Definition at line 419 of file setup.c.

References serv_gets(), serv_puts(), and SIZ.

Referenced by edit_value().

◆ setconf_str()

void setconf_str ( char *  key,
char *  val 
)

Definition at line 410 of file setup.c.

References serv_gets(), serv_puts(), and SIZ.

Referenced by edit_value().

◆ SetTitles()

void SetTitles ( void  )

◆ strprompt()

void strprompt ( const char *  prompt_title,
const char *  prompt_text,
char *  Target,
char *  DefValue 
)

Definition at line 495 of file setup.c.

References _, SIZ, and title().

Referenced by set_str_val().

◆ title()

void title ( const char *  text)

Definition at line 219 of file setup.c.

References cls().

Referenced by Ctdl_LDAP_to_vCard(), important_message(), set_bool_val(), and strprompt().

◆ uds_connectsock()

int uds_connectsock ( char *  sockpath)

Definition at line 305 of file setup.c.

Referenced by main().

◆ unused_messages()

void unused_messages ( void  )

Definition at line 645 of file setup.c.

References _, and important_message().

◆ yesno()

int yesno ( const char *  question,
int  default_value 
)

Definition at line 225 of file setup.c.

References _, and SIZ.

Referenced by check_xinetd_entry(), main(), and set_bool_val().

Variable Documentation

◆ admin_cmd

char admin_cmd[SIZ]

Definition at line 85 of file setup.c.

◆ admin_name

char admin_name[SIZ]

Definition at line 83 of file setup.c.

Referenced by edit_value(), and main().

◆ admin_pass

char admin_pass[SIZ]

Definition at line 84 of file setup.c.

Referenced by edit_value(), and main().

◆ enable_home

int enable_home = 1

Definition at line 82 of file setup.c.

◆ EnvNames

const char* EnvNames[eMaxQuestions]
Initial value:
= {
"HOME_DIRECTORY",
"SYSADMIN_NAME",
"SYSADMIN_PW",
"CITADEL_UID",
"IP_ADDR",
"CITADEL_PORT",
"ENABLE_UNIX_AUTH",
"LDAP_HOST",
"LDAP_PORT",
"LDAP_BASE_DN",
"LDAP_BIND_DN",
"LDAP_BIND_PW"
}

"CREATE_XINETD_ENTRY";

Definition at line 66 of file setup.c.

◆ program_title

char* program_title

Definition at line 91 of file setup.c.

Referenced by cls(), and main().

◆ serv_sock

int serv_sock = (-1)

Definition at line 86 of file setup.c.

Referenced by main(), serv_read(), and serv_write().

◆ setup_text

const char* setup_text[eMaxQuestions]

Definition at line 89 of file setup.c.

Referenced by important_msgnum(), set_bool_val(), set_str_val(), and SetTitles().

◆ setup_titles

const char* setup_titles[eMaxQuestions]

Definition at line 88 of file setup.c.

Referenced by set_bool_val(), set_str_val(), and SetTitles().

◆ setup_type

int setup_type = (-1)

Definition at line 81 of file setup.c.

Referenced by main().