Subversion Repositories RepoView

Rev

Rev 3 | Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 8
Line 1... Line 1...
1
/* $Id: check.c 3 2024-08-20 21:05:24Z nishi $ */
1
/* $Id: check.c 8 2024-08-21 01:18:45Z nishi $ */
2
 
2
 
3
#include "config.h"
3
#include "config.h"
4
 
4
 
5
#include <stdio.h>
5
#include <stdio.h>
6
 
6
 
Line 71... Line 71...
71
		printf("Authentication method is %s\n", method);
71
		printf("Authentication method is %s\n", method);
72
	}
72
	}
73
	return 0;
73
	return 0;
74
}
74
}
75
 
75
 
-
 
76
int check_files(void) {
-
 
77
	int st = 0;
-
 
78
#ifndef APACHE_PASSWD
-
 
79
	fprintf(stderr, "Apache htpasswd file is not set.\n");
-
 
80
	st = 1;
-
 
81
#endif
-
 
82
#ifndef APACHE_AUTHZ
-
 
83
	fprintf(stderr, "Apache authz file is not set.\n");
-
 
84
	st = 1;
-
 
85
#endif
-
 
86
	return st;
-
 
87
}
-
 
88
 
76
int main() {
89
int main() {
77
	int st;
90
	int st;
78
	st = check_db();
91
	st = check_db();
79
	if(st != 0) goto fail;
92
	if(st != 0) goto fail;
80
	st = check_auth();
93
	st = check_auth();
81
	if(st != 0) goto fail;
94
	if(st != 0) goto fail;
82
	st = check_theme();
95
	st = check_theme();
83
	if(st != 0) goto fail;
96
	if(st != 0) goto fail;
-
 
97
	st = check_files();
-
 
98
	if(st != 0) goto fail;
84
	printf("Config validation successful.\n");
99
	printf("Config validation successful.\n");
85
	return 0;
100
	return 0;
86
fail:
101
fail:
87
	fprintf(stderr, "Config validation failure.\n");
102
	fprintf(stderr, "Config validation failure.\n");
88
	return st;
103
	return st;