Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
3378c28d
Commit
3378c28d
authored
Jul 25, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix use of uid/UID with set_uid() func.
parent
fd0dbff7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/ZEO/start.py
src/ZEO/start.py
+9
-9
No files found.
src/ZEO/start.py
View file @
3378c28d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
##############################################################################
##############################################################################
"""Start the server storage.
"""Start the server storage.
$Id: start.py,v 1.3
6 2002/07/25 16:47:02
jeremy Exp $
$Id: start.py,v 1.3
7 2002/07/25 23:08:33
jeremy Exp $
"""
"""
from
__future__
import
nested_scopes
from
__future__
import
nested_scopes
...
@@ -44,7 +44,7 @@ def get_storage(m, n, cache={}):
...
@@ -44,7 +44,7 @@ def get_storage(m, n, cache={}):
cache
[(
d
,
m
)]
=
im
cache
[(
d
,
m
)]
=
im
return
getattr
(
im
,
n
)
return
getattr
(
im
,
n
)
def
set_uid
(
uid
):
def
set_uid
(
arg
):
"""Try to set uid and gid based on -u argument.
"""Try to set uid and gid based on -u argument.
This will only work if this script is run by root.
This will only work if this script is run by root.
...
@@ -58,13 +58,13 @@ def set_uid(uid):
...
@@ -58,13 +58,13 @@ def set_uid(uid):
try
:
try
:
gid
=
None
gid
=
None
try
:
try
:
UID
=
int
(
UID
)
arg
=
int
(
arg
)
except
:
# conversion could raise all sorts of errors
except
:
# conversion could raise all sorts of errors
uid
=
pwd
.
getpwnam
(
UID
)[
2
]
uid
=
pwd
.
getpwnam
(
arg
)[
2
]
gid
=
pwd
.
getpwnam
(
UID
)[
3
]
gid
=
pwd
.
getpwnam
(
arg
)[
3
]
else
:
else
:
uid
=
pwd
.
getpwuid
(
UID
)[
2
]
uid
=
pwd
.
getpwuid
(
arg
)[
2
]
gid
=
pwd
.
getpwuid
(
UID
)[
3
]
gid
=
pwd
.
getpwuid
(
arg
)[
3
]
if
gid
is
not
None
:
if
gid
is
not
None
:
try
:
try
:
os
.
setgid
(
gid
)
os
.
setgid
(
gid
)
...
@@ -75,7 +75,7 @@ def set_uid(uid):
...
@@ -75,7 +75,7 @@ def set_uid(uid):
except
OSError
:
except
OSError
:
pass
pass
except
KeyError
:
except
KeyError
:
LOG
(
'ZEO Server'
,
ERROR
,
(
"can't find
UID %s"
%
UID
))
LOG
(
'ZEO Server'
,
ERROR
,
(
"can't find
uid %s"
%
arg
))
def
setup_signals
(
storages
):
def
setup_signals
(
storages
):
try
:
try
:
...
@@ -231,7 +231,7 @@ def main(argv):
...
@@ -231,7 +231,7 @@ def main(argv):
if
detailed
:
if
detailed
:
os
.
environ
[
'STUPID_LOG_SEVERITY'
]
=
'-300'
os
.
environ
[
'STUPID_LOG_SEVERITY'
]
=
'-300'
set_uid
(
uid
)
set_uid
(
UID
)
if
Z
:
if
Z
:
try
:
try
:
...
...
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