Check-in [9164d12258]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:BackupPCd 0.1.3 Added "--with-notifyserv" and "--with-updateurl" configuration options to hard-code their respective parameters as defaults into the resulting executable.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9164d12258af18e5af68728f19510f1693ca3c0f
User & Date: rkeene 2006-03-13 10:19:39
Context
2006-03-14
10:23
Added protocol definitions for a "HOSTNAME" command and reply. Updated backuppcd to attempt to be smarter about finding itself. check-in: f9114a0f4a user: rkeene tags: trunk
2006-03-13
10:19
BackupPCd 0.1.3 Added "--with-notifyserv" and "--with-updateurl" configuration options to hard-code their respective parameters as defaults into the resulting executable. check-in: 9164d12258 user: rkeene tags: trunk
2006-03-12
09:21
Updated the "notify-server" to run in the foreground if Tclx is not available. check-in: 5a2587b0a6 user: rkeene tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to backuppcd-common.h.

123
124
125
126
127
128
129








130
131
132
133
#ifndef BPC_TCP_PORT
#define BPC_TCP_PORT 874
#endif

#ifndef BPC_TCP_NOTIFYPORT
#define BPC_TCP_NOTIFYPORT 899
#endif









int backuppc_mkdir(const char *dir);

#endif







>
>
>
>
>
>
>
>




123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#ifndef BPC_TCP_PORT
#define BPC_TCP_PORT 874
#endif

#ifndef BPC_TCP_NOTIFYPORT
#define BPC_TCP_NOTIFYPORT 899
#endif

#ifndef BPC_CONF_UPDATEURL
#define BPC_CONF_UPDATEURL NULL
#endif

#ifndef BPC_CONF_NOTIFYSERV
#define BPC_CONF_NOTIFYSERV NULL
#endif

int backuppc_mkdir(const char *dir);

#endif

Changes to backuppcd.c.

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#define BPC_UPDATE_INTERVAL 300
#endif

/*
 * Default master password:  This value will never match any SHA1 hash.
 *
 */
#ifndef MASTER_PASSWORD
#define MASTER_PASSWORD "7505d64a54e061b7acd54ccd58b49dc43500b63x"
#endif

/*
 * This global variable is used to coordinate the shutdown of the main work
 * loop (backuppc_loop()).
 */
static int WorkLoopStatus = LOOP_RUN;

/*
 * These variables are global because the configuration is done by a seperate
 * function.
 */
static int backuppc_port = BPC_TCP_PORT;
static uint32_t backuppc_writeblock_size = 32000;
static char *backuppc_updateurl = NULL;
static char *backuppc_binfile = NULL;
static char *backuppc_notifyserv = NULL;
static int backuppc_notifyport = BPC_TCP_NOTIFYPORT;

#ifdef _USE_WIN32_
/*
 * Win32 service stuff.
 */
static SC_HANDLE manager = NULL;







|
|














|

|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#define BPC_UPDATE_INTERVAL 300
#endif

/*
 * Default master password:  This value will never match any SHA1 hash.
 *
 */
#ifndef BPC_CONF_MASTER_PASSWORD
#define BPC_CONF_MASTER_PASSWORD "7505d64a54e061b7acd54ccd58b49dc43500b63x"
#endif

/*
 * This global variable is used to coordinate the shutdown of the main work
 * loop (backuppc_loop()).
 */
static int WorkLoopStatus = LOOP_RUN;

/*
 * These variables are global because the configuration is done by a seperate
 * function.
 */
static int backuppc_port = BPC_TCP_PORT;
static uint32_t backuppc_writeblock_size = 32000;
static char *backuppc_updateurl = BPC_CONF_UPDATEURL;
static char *backuppc_binfile = NULL;
static char *backuppc_notifyserv = BPC_CONF_NOTIFYSERV;
static int backuppc_notifyport = BPC_TCP_NOTIFYPORT;

#ifdef _USE_WIN32_
/*
 * Win32 service stuff.
 */
static SC_HANDLE manager = NULL;
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
		return(-1);
	}

	/* Do authentication ... */

	/* Attempt to authenticate with the master password. */
	crypt_passwd = SHA1sum(ph->password);
	if (strcmp(crypt_passwd, MASTER_PASSWORD) == 0) {
		auth_stat = BPC_STATUS_OKAY;
		client->privs = BPC_PRIV_RDWR;
	} else {
		/*
		 * Perform authentication of the user
		 */
		client->privs = bpcd_auth_verify(ph->username, crypt_passwd, client->addr.s_addr);







|







2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
		return(-1);
	}

	/* Do authentication ... */

	/* Attempt to authenticate with the master password. */
	crypt_passwd = SHA1sum(ph->password);
	if (strcmp(crypt_passwd, BPC_CONF_MASTER_PASSWORD) == 0) {
		auth_stat = BPC_STATUS_OKAY;
		client->privs = BPC_PRIV_RDWR;
	} else {
		/*
		 * Perform authentication of the user
		 */
		client->privs = bpcd_auth_verify(ph->username, crypt_passwd, client->addr.s_addr);

Changes to configure.ac.

1
2
3
4
5
6
7
8
9
AC_REVISION($Revision $)
AC_INIT(backuppcd, 0.1.2)
AC_CONFIG_HEADER(config.h)

dnl Check OS info
DC_CHK_OS_INFO

dnl Checks for programs.
AC_PROG_CC

|







1
2
3
4
5
6
7
8
9
AC_REVISION($Revision $)
AC_INIT(backuppcd, 0.1.3)
AC_CONFIG_HEADER(config.h)

dnl Check OS info
DC_CHK_OS_INFO

dnl Checks for programs.
AC_PROG_CC
54
55
56
57
58
59
60
61
















62
63
64
65
66
67
68
fi

AC_ARG_WITH(masterpw, AC_HELP_STRING([--with-masterpw], [Enable support for a hard-coded master password]), [ masterpw=$withval ], [ masterpw=no ])
if test "$masterpw" != "no"; then
	if test "$masterpw" = "yes"; then
		AC_MSG_ERROR([Master password must be specified on the command line.])
	fi
	AC_DEFINE_UNQUOTED(MASTER_PASSWORD, "$masterpw", [Define to the master password])
















fi

AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support.]), [ debugenabled=$enableval ], [ debugenabled=no ])
if test "$debugenabled" = "no"; then
	AC_DEFINE(NDEBUG, [1], [Define if you wish to disable debugging support])
else
	AC_DEFINE(DEBUG, [1], [Define if you wish to enable debugging support])







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
fi

AC_ARG_WITH(masterpw, AC_HELP_STRING([--with-masterpw], [Enable support for a hard-coded master password]), [ masterpw=$withval ], [ masterpw=no ])
if test "$masterpw" != "no"; then
	if test "$masterpw" = "yes"; then
		AC_MSG_ERROR([Master password must be specified on the command line.])
	fi
	AC_DEFINE_UNQUOTED(BPC_CONF_MASTER_PASSWORD, "$masterpw", [Define to the master password])
fi

AC_ARG_WITH(updateurl, AC_HELP_STRING([--with-updateurl], [Enable support for a hard-coded update URL]), [ updateurl="$withval" ], [ updateurl=no ])
if test "$updateurl" != "no"; then
	if test "$updateurl" = "yes"; then
		AC_MSG_ERROR([URL must be specified on the command line.])
	fi
	AC_DEFINE_UNQUOTED(BPC_CONF_UPDATEURL, "$updateurl", [Define to the URL to update against])
fi

AC_ARG_WITH(notifyserv, AC_HELP_STRING([--with-notifyserv], [Enable support for a hard-coded notification server]), [ notifyserv="$withval" ], [ notifyserv=no ])
if test "$notifyserv" != "no"; then
	if test "$notifyserv" = "yes"; then
		AC_MSG_ERROR([Notification server must be specified on the command line.])
	fi
	AC_DEFINE_UNQUOTED(BPC_CONF_NOTIFYSERV, "$notifyserv", [Define to the server to send host notifications to])
fi

AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support.]), [ debugenabled=$enableval ], [ debugenabled=no ])
if test "$debugenabled" = "no"; then
	AC_DEFINE(NDEBUG, [1], [Define if you wish to disable debugging support])
else
	AC_DEFINE(DEBUG, [1], [Define if you wish to enable debugging support])