Hardcoded the base directory /usr/local/petidomo for the moment.
This commit is contained in:
parent
a0ef75b0b2
commit
c13dfcf2ff
14
config.c
14
config.c
@ -20,7 +20,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pwd.h>
|
|
||||||
|
|
||||||
#include "liblists/lists.h"
|
#include "liblists/lists.h"
|
||||||
#include "libconfigfile/configfile.h"
|
#include "libconfigfile/configfile.h"
|
||||||
@ -40,7 +39,6 @@ static char * mta_options = "-i -f%s";
|
|||||||
int
|
int
|
||||||
InitPetidomo(void)
|
InitPetidomo(void)
|
||||||
{
|
{
|
||||||
struct passwd * pwd;
|
|
||||||
char * basedir = "/usr/local/petidomo";
|
char * basedir = "/usr/local/petidomo";
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -66,18 +64,6 @@ InitPetidomo(void)
|
|||||||
|
|
||||||
ListConfigs = InitList(NULL);
|
ListConfigs = InitList(NULL);
|
||||||
|
|
||||||
/* First of all, determine the home directory of the "petidomo"
|
|
||||||
user. This will be our base directory for all operations. */
|
|
||||||
|
|
||||||
pwd = getpwnam("petidomo");
|
|
||||||
if (pwd != NULL) {
|
|
||||||
if (strcmp(basedir, pwd->pw_dir) != 0)
|
|
||||||
basedir = xstrdup(pwd->pw_dir); /* Replace the default above. */
|
|
||||||
endpwent();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
syslog(LOG_WARNING, "User \"petidomo\" not found.");
|
|
||||||
|
|
||||||
/* chdir() into the base directory. */
|
/* chdir() into the base directory. */
|
||||||
|
|
||||||
rc = chdir(basedir);
|
rc = chdir(basedir);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user