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
0722a276
Commit
0722a276
authored
Nov 19, 2002
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of the -u/--user USER option.
You can now do this with the -u USER zdaemon/zdaemon.py.
parent
03bb2e62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
35 deletions
+2
-35
src/ZEO/runsvr.py
src/ZEO/runsvr.py
+2
-35
No files found.
src/ZEO/runsvr.py
View file @
0722a276
...
...
@@ -14,8 +14,7 @@
##############################################################################
"""Start the ZEO storage server.
Usage: %s [-a ADDRESS] [-d DIRECTORY]
[-f FILENAME] [-s STORAGE] [-u USER]
Usage: %s [-a ADDRESS] [-d DIRECTORY] [-f FILENAME] [-s STORAGE]
Options:
-a/--address ADDRESS -- server address of the form PORT, HOST:PORT, or PATH
...
...
@@ -25,7 +24,6 @@ Options:
-s/--storage STORAGE -- storage specification of the form
NAME=MODULE[:ATTRIBUTE]
(multiple -s options are supported)
-u/--user USER -- username or uid of user to setuid()
-a is required; either -f must be used or -s must be used.
"""
...
...
@@ -140,19 +138,17 @@ class ZEOOptions(Options):
family
=
None
address
=
None
user
=
None
storages
=
None
filename
=
None
directory
=
None
_short_options
=
"a:d:f:hs:
u:
"
_short_options
=
"a:d:f:hs:"
_long_options
=
[
"--address="
,
"--directory="
,
"--filename="
,
"--help"
,
"--storage="
,
"--user="
,
]
def
handle_option
(
self
,
opt
,
arg
):
...
...
@@ -189,8 +185,6 @@ class ZEOOptions(Options):
module
=
rest
attr
=
name
self
.
storages
[
name
]
=
module
,
attr
elif
opt
in
(
"-u"
,
"--user"
):
self
.
user
=
arg
else
:
# Pass it to the base class, for --help/-h
Options
.
handle_option
(
self
,
opt
,
arg
)
...
...
@@ -218,7 +212,6 @@ class Server:
def
main
(
self
):
self
.
check_socket
()
self
.
clear_socket
()
self
.
set_uid
()
self
.
change_dir
()
self
.
open_storages
()
self
.
setup_signals
()
...
...
@@ -248,32 +241,6 @@ class Server:
except
os
.
error
:
pass
def
set_uid
(
self
):
if
self
.
opts
.
user
is
None
:
return
if
os
.
name
!=
"posix"
:
self
.
opts
.
usage
(
"-u/-user only supported on Unix"
)
if
os
.
geteuid
()
!=
0
:
self
.
opts
.
usage
(
"only root can use -u/--user"
)
# XXX Is it important not to die if the following fails?
import
pwd
try
:
uid
=
int
(
self
.
opts
.
user
)
except
:
# int() can raise all sorts of errors
try
:
pwrec
=
pwd
.
getpwnam
(
self
.
opts
.
user
)
except
KeyError
:
self
.
opts
.
usage
(
"username %r not found"
%
self
.
opts
.
user
)
uid
=
pwrec
[
2
]
else
:
try
:
pwrec
=
pwd
.
getpwuid
(
uid
)
except
KeyError
:
self
.
opts
.
usage
(
"uid %r not found"
%
self
.
opts
.
user
)
gid
=
pwrec
[
3
]
os
.
setgid
(
gid
)
os
.
setuid
(
uid
)
def
change_dir
(
self
):
if
self
.
opts
.
directory
:
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