char *dump_datestamp = NULL; /* date we are restoring */
char *dump_hostname; /* which machine we are restoring */
char *disk_name = NULL; /* disk we are restoring */
+dle_t *dump_dle = NULL;
char *mount_point = NULL; /* where disk was mounted */
char *disk_path = NULL; /* path relative to mount point */
char dump_date[STR_SIZE]; /* date on which we are restoring */
server_line = newstralloc(server_line, mesg_buffer);
amfree(mesg_buffer);
mesg_buffer = newbuf;
+ amrecover_debug(1, "get: %s\n", mesg_buffer);
return 0;
}
dbopen(DBG_SUBDIR_CLIENT);
-#ifndef IGNORE_UID_CHECK
- if (geteuid() != 0) {
- erroutput_type |= ERR_SYSLOG;
- error("amrecover must be run by root");
- /*NOTREACHED*/
- }
-#endif
-
localhost = alloc(MAX_HOSTNAME_LENGTH+1);
if (gethostname(localhost, MAX_HOSTNAME_LENGTH) != 0) {
error(_("cannot determine local host name\n"));
/* load the base client configuration */
config_init(CONFIG_INIT_CLIENT, NULL);
+ if (config_errors(NULL) >= CFGERR_WARNINGS) {
+ config_print_errors();
+ if (config_errors(NULL) >= CFGERR_ERRORS) {
+ g_critical(_("errors processing config file"));
+ }
+ }
+
/* treat amrecover-specific command line options as the equivalent
* -o command-line options to set configuration values */
cfg_ovr = new_config_overwrites(argc/2);
check_running_as(RUNNING_AS_ROOT);
- dbrename(config_name, DBG_SUBDIR_CLIENT);
+ dbrename(get_config_name(), DBG_SUBDIR_CLIENT);
our_features = am_init_feature_set();
our_features_string = am_feature_to_string(our_features);
exit(1);
}
-#if 0
- /*
- * We may need root privilege again later for a reserved port to
- * the tape server, so we will drop down now but might have to
- * come back later.
- */
- setegid(getgid());
- seteuid(getuid());
-#endif
-
/* get server's banner */
if (grab_reply(1) == -1) {
aclose(server_socket);
{
char *their_feature_string = NULL;
+ indexsrv_features = NULL;
+
line = vstrallocf("FEATURES %s", our_features_string);
if(exchange(line) == 0) {
their_feature_string = stralloc(server_line+13);
indexsrv_features = am_string_to_feature(their_feature_string);
+ if (!indexsrv_features)
+ g_printf(_("Bad feature string from server: %s"), their_feature_string);
}
- else {
+ if (!indexsrv_features)
indexsrv_features = am_set_default_feature_set();
- }
+
amfree(their_feature_string);
amfree(line);
}
}
amfree(line);
- line = vstrallocf("SCNF %s", config_name);
+ line = vstrallocf("SCNF %s", get_config_name());
if (converse(line) == -1) {
aclose(server_socket);
exit(1);