Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
5cc94622
Commit
5cc94622
authored
Oct 12, 2011
by
Poul-Henning Kamp
Committed by
Tollef Fog Heen
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solaris sandbox changes.
Submitted by: Nils Goroll Conflicts: bin/varnishd/mgt_sandbox_solaris.c
parent
66ba62ef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
mgt.h
bin/varnishd/mgt.h
+1
-0
mgt_sandbox.c
bin/varnishd/mgt_sandbox.c
+3
-3
mgt_sandbox_solaris.c
bin/varnishd/mgt_sandbox_solaris.c
+18
-0
No files found.
bin/varnishd/mgt.h
View file @
5cc94622
...
@@ -75,6 +75,7 @@ void mgt_sandbox(void);
...
@@ -75,6 +75,7 @@ void mgt_sandbox(void);
#ifdef HAVE_SETPPRIV
#ifdef HAVE_SETPPRIV
void
mgt_sandbox_solaris_init
(
void
);
void
mgt_sandbox_solaris_init
(
void
);
void
mgt_sandbox_solaris_fini
(
void
);
void
mgt_sandbox_solaris_fini
(
void
);
void
mgt_sandbox_solaris_privsep
(
void
);
#endif
#endif
/* mgt_shmem.c */
/* mgt_shmem.c */
...
...
bin/varnishd/mgt_sandbox.c
View file @
5cc94622
...
@@ -62,17 +62,17 @@
...
@@ -62,17 +62,17 @@
void
void
mgt_sandbox
(
void
)
mgt_sandbox
(
void
)
{
{
#ifdef HAVE_SETPPRIV
#ifdef HAVE_SETPPRIV
mgt_sandbox_solaris_init
();
mgt_sandbox_solaris_init
();
#endif
mgt_sandbox_solaris_privsep
();
#else
if
(
geteuid
()
==
0
)
{
if
(
geteuid
()
==
0
)
{
XXXAZ
(
setgid
(
params
->
gid
));
XXXAZ
(
setgid
(
params
->
gid
));
XXXAZ
(
setuid
(
params
->
uid
));
XXXAZ
(
setuid
(
params
->
uid
));
}
else
{
}
else
{
REPORT0
(
LOG_INFO
,
"Not running as root, no priv-sep"
);
REPORT0
(
LOG_INFO
,
"Not running as root, no priv-sep"
);
}
}
#endif
/* On Linux >= 2.4, you need to set the dumpable flag
/* On Linux >= 2.4, you need to set the dumpable flag
to get core dumps after you have done a setuid. */
to get core dumps after you have done a setuid. */
...
...
bin/varnishd/mgt_sandbox_solaris.c
View file @
5cc94622
...
@@ -42,6 +42,10 @@
...
@@ -42,6 +42,10 @@
#ifdef HAVE_PRIV_H
#ifdef HAVE_PRIV_H
#include <priv.h>
#include <priv.h>
#endif
#endif
#include <stdio.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include "mgt.h"
#include "mgt.h"
#include "heritage.h"
#include "heritage.h"
...
@@ -154,6 +158,20 @@ mgt_sandbox_solaris_init(void)
...
@@ -154,6 +158,20 @@ mgt_sandbox_solaris_init(void)
priv_freeset
(
priv_all
);
priv_freeset
(
priv_all
);
}
}
void
mgt_sandbox_solaris_privsep
(
void
)
{
if
(
priv_ineffect
(
PRIV_PROC_SETID
))
{
if
(
getgid
()
!=
params
->
gid
)
XXXAZ
(
setgid
(
params
->
gid
));
if
(
getuid
()
!=
params
->
uid
)
XXXAZ
(
setuid
(
params
->
uid
));
}
else
{
REPORT
(
LOG_INFO
,
"Privilege %s missing, will not change uid/gid"
,
PRIV_PROC_SETID
);
}
}
/*
/*
* Waive most privileges in the child
* Waive most privileges in the child
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment