Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
44d46f4d
Commit
44d46f4d
authored
Sep 03, 2000
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved setuid code to beginning to get all files created as effective user
parent
05a6ce7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
src/ZEO/start.py
src/ZEO/start.py
+32
-32
No files found.
src/ZEO/start.py
View file @
44d46f4d
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
"""Start the server storage.
"""Start the server storage.
"""
"""
__version__
=
"$Revision: 1.1
1
$"
[
11
:
-
2
]
__version__
=
"$Revision: 1.1
2
$"
[
11
:
-
2
]
import
sys
,
os
,
getopt
,
string
import
sys
,
os
,
getopt
,
string
...
@@ -216,6 +216,37 @@ def main(argv):
...
@@ -216,6 +216,37 @@ def main(argv):
__builtins__
.
__debug__
=
debug
__builtins__
.
__debug__
=
debug
if
debug
:
os
.
environ
[
'Z_DEBUG_MODE'
]
=
'1'
if
debug
:
os
.
environ
[
'Z_DEBUG_MODE'
]
=
'1'
# Try to set uid to "-u" -provided uid.
# Try to set gid to "-u" user's primary group.
# This will only work if this script is run by root.
try
:
import
pwd
try
:
try
:
UID
=
string
.
atoi
(
UID
)
except
:
pass
gid
=
None
if
type
(
UID
)
==
type
(
""
):
uid
=
pwd
.
getpwnam
(
UID
)[
2
]
gid
=
pwd
.
getpwnam
(
UID
)[
3
]
elif
type
(
UID
)
==
type
(
1
):
uid
=
pwd
.
getpwuid
(
UID
)[
2
]
gid
=
pwd
.
getpwuid
(
UID
)[
3
]
else
:
raise
KeyError
try
:
if
gid
is
not
None
:
try
:
os
.
setgid
(
gid
)
except
OSError
:
pass
os
.
setuid
(
uid
)
except
OSError
:
pass
except
KeyError
:
zLOG
.
LOG
(
"z2"
,
zLOG
.
ERROR
,
(
"can't find UID %s"
%
UID
))
except
:
pass
if
Z
:
if
Z
:
try
:
import
posix
try
:
import
posix
except
:
pass
except
:
pass
...
@@ -265,37 +296,6 @@ def main(argv):
...
@@ -265,37 +296,6 @@ def main(argv):
ZEO
.
StorageServer
.
StorageServer
(
unix
,
storages
)
ZEO
.
StorageServer
.
StorageServer
(
unix
,
storages
)
# Try to set uid to "-u" -provided uid.
# Try to set gid to "-u" user's primary group.
# This will only work if this script is run by root.
try
:
import
pwd
try
:
try
:
UID
=
string
.
atoi
(
UID
)
except
:
pass
gid
=
None
if
type
(
UID
)
==
type
(
""
):
uid
=
pwd
.
getpwnam
(
UID
)[
2
]
gid
=
pwd
.
getpwnam
(
UID
)[
3
]
elif
type
(
UID
)
==
type
(
1
):
uid
=
pwd
.
getpwuid
(
UID
)[
2
]
gid
=
pwd
.
getpwuid
(
UID
)[
3
]
else
:
raise
KeyError
try
:
if
gid
is
not
None
:
try
:
os
.
setgid
(
gid
)
except
OSError
:
pass
os
.
setuid
(
uid
)
except
OSError
:
pass
except
KeyError
:
zLOG
.
LOG
(
"z2"
,
zLOG
.
ERROR
,
(
"can't find UID %s"
%
UID
))
except
:
pass
open
(
zeo_pid
,
'w'
).
write
(
"%s %s"
%
(
os
.
getppid
(),
os
.
getpid
()))
open
(
zeo_pid
,
'w'
).
write
(
"%s %s"
%
(
os
.
getppid
(),
os
.
getpid
()))
asyncore
.
loop
()
asyncore
.
loop
()
...
...
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