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
2318a71d
Commit
2318a71d
authored
Feb 27, 2006
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a method to log if the base directory is not secure.
parent
028e4185
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+2
-3
src/ZODB/Blobs/Blob.py
src/ZODB/Blobs/Blob.py
+5
-0
src/ZODB/Blobs/BlobStorage.py
src/ZODB/Blobs/BlobStorage.py
+2
-4
No files found.
src/ZEO/ClientStorage.py
View file @
2318a71d
...
...
@@ -318,11 +318,10 @@ class ClientStorage(object):
if
blob_dir
is
not
None
:
self
.
fshelper
=
FilesystemHelper
(
blob_dir
)
self
.
fshelper
.
create
()
if
not
self
.
fshelper
.
isSecure
(
blob_dir
):
log2
(
'Blob dir %s has insecure mode setting'
%
blob_dir
,
level
=
logging
.
WARNING
)
self
.
fshelper
.
checkSecure
()
else
:
self
.
fshelper
=
None
# Initialize locks
self
.
blob_status_lock
=
threading
.
Lock
()
self
.
blob_status
=
{}
...
...
src/ZODB/Blobs/Blob.py
View file @
2318a71d
...
...
@@ -298,6 +298,11 @@ class FilesystemHelper:
""" Ensure that (POSIX) path mode bits are 0700 """
return
(
os
.
stat
(
path
).
st_mode
&
077
)
!=
0
def
checkSecure
(
self
):
if
not
self
.
isSecure
(
self
.
base_dir
):
log
(
'Blob dir %s has insecure mode setting'
%
path
,
level
=
logging
.
WARNING
)
def
getPathForOID
(
self
,
oid
):
""" Given an OID, return the path on the filesystem where
the blob data relating to that OID is stored """
...
...
src/ZODB/Blobs/BlobStorage.py
View file @
2318a71d
...
...
@@ -44,10 +44,8 @@ class BlobStorage(ProxyBase):
# TODO Complain if storage is ClientStorage
ProxyBase
.
__init__
(
self
,
storage
)
self
.
fshelper
=
FilesystemHelper
(
base_directory
)
if
not
os
.
path
.
exists
(
self
.
base_directory
):
os
.
makedirs
(
self
.
base_directory
,
0700
)
logger
.
info
(
"Blob directory '%s' does not exist. "
"Created new directory."
%
self
.
base_directory
)
self
.
fshelper
.
create
()
self
.
fshelper
.
checkSecure
()
self
.
dirty_oids
=
[]
def
__repr__
(
self
):
...
...
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