cosmetics
This commit is contained in:
+14
-16
@@ -155,28 +155,26 @@ static void generate_selfcert()
|
|||||||
gid_t gid = 0;
|
gid_t gid = 0;
|
||||||
|
|
||||||
#ifdef IPSEC_GROUP
|
#ifdef IPSEC_GROUP
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
struct group group, *grp;
|
struct group group, *grp;
|
||||||
|
|
||||||
if (getgrnam_r(IPSEC_GROUP, &group, buf, sizeof(buf), &grp) == 0 &&
|
if (getgrnam_r(IPSEC_GROUP, &group, buf, sizeof(buf), &grp) == 0 && grp)
|
||||||
grp)
|
{
|
||||||
{
|
gid = grp->gr_gid;
|
||||||
gid = grp->gr_gid;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef IPSEC_USER
|
#ifdef IPSEC_USER
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
struct passwd passwd, *pwp;
|
struct passwd passwd, *pwp;
|
||||||
|
|
||||||
if (getpwnam_r(IPSEC_USER, &passwd, buf, sizeof(buf), &pwp) == 0 &&
|
if (getpwnam_r(IPSEC_USER, &passwd, buf, sizeof(buf), &pwp) == 0 && pwp)
|
||||||
pwp)
|
{
|
||||||
{
|
uid = pwp->pw_uid;
|
||||||
uid = pwp->pw_uid;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
setegid(gid);
|
setegid(gid);
|
||||||
seteuid(uid);
|
seteuid(uid);
|
||||||
|
|||||||
Reference in New Issue
Block a user