Changed data directory to /var/lib/maxscale.
This commit is contained in:
@ -120,7 +120,7 @@ char fname[1024], *home;
|
||||
char uname[80], passwd[80];
|
||||
|
||||
initialise();
|
||||
sprintf(fname, "%s/passwd", get_cachedir());
|
||||
sprintf(fname, "%s/passwd", get_datadir());
|
||||
if ((fp = fopen(fname, "r")) == NULL)
|
||||
return NULL;
|
||||
if ((rval = users_alloc()) == NULL)
|
||||
@ -151,7 +151,7 @@ FILE *fp;
|
||||
char fname[1024], *home, *cpasswd;
|
||||
|
||||
initialise();
|
||||
sprintf(fname, "%s/passwd", get_cachedir());
|
||||
sprintf(fname, "%s/passwd", get_datadir());
|
||||
|
||||
if (users == NULL)
|
||||
{
|
||||
@ -244,8 +244,8 @@ char* admin_remove_user(
|
||||
/**
|
||||
* Open passwd file and remove user from the file.
|
||||
*/
|
||||
sprintf(fname, "%s/passwd", get_cachedir());
|
||||
sprintf(fname_tmp, "%s/passwd_tmp", get_cachedir());
|
||||
sprintf(fname, "%s/passwd", get_datadir());
|
||||
sprintf(fname_tmp, "%s/passwd_tmp", get_datadir());
|
||||
/**
|
||||
* Rewrite passwd file from memory.
|
||||
*/
|
||||
|
@ -1047,6 +1047,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 'D':
|
||||
sprintf(datadir,"%s",optarg);
|
||||
maxscaledatadir = strdup(optarg);
|
||||
datadir_defined = true;
|
||||
break;
|
||||
case 'C':
|
||||
|
@ -17,3 +17,13 @@ char* get_cachedir()
|
||||
{
|
||||
return cachedir?cachedir:(char*)default_cachedir;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the service cache directory
|
||||
* @return The path to the cache directory
|
||||
*/
|
||||
char* get_datadir()
|
||||
{
|
||||
return maxscaledatadir?maxscaledatadir:(char*)default_datadir;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ int fd;
|
||||
int len;
|
||||
static int reported = 0;
|
||||
|
||||
snprintf(secret_file, PATH_MAX, "%s/.secrets", get_cachedir());
|
||||
snprintf(secret_file, PATH_MAX, "%s/.secrets", get_datadir());
|
||||
|
||||
/* Try to access secrets file */
|
||||
if (access(secret_file, R_OK) == -1)
|
||||
|
Reference in New Issue
Block a user