Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lyz
backupninja
Commits
5eef842c
Commit
5eef842c
authored
18 years ago
by
intrigeri
Browse files
Options
Downloads
Patches
Plain Diff
fixed configuration files permission check
parent
2276e5df
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+4
-0
4 additions, 0 deletions
ChangeLog
src/backupninja.in
+18
-10
18 additions, 10 deletions
src/backupninja.in
with
22 additions
and
10 deletions
ChangeLog
+
4
−
0
View file @
5eef842c
version 0.9.5 -- unreleased
version 0.9.5 -- unreleased
backupninja changes
. Fixed checks on configuration files permissions, since the patch
applied to fix #370396 broke this, especially for configuration files
created with permissions 000 by an older ninjahelper version.
handler changes
handler changes
sys:
sys:
. Fixed typo breaking things for VServers.
. Fixed typo breaking things for VServers.
...
...
This diff is collapsed.
Click to expand it.
src/backupninja.in
+
18
−
10
View file @
5eef842c
...
@@ -131,32 +131,40 @@ function msg {
...
@@ -131,32 +131,40 @@ function msg {
function
check_perms
()
{
function
check_perms
()
{
local
file
=
$1
local
file
=
$1
debug
"check_perms
$file
"
local
perms
local
perms
perms
=(
$(
stat
-L
--format
=
'%a %g %G %u %U'
$file
)
)
local
owners
local
gperm
=
${
perms
[0]
:1:1
}
local
wperm
=
${
perms
[0]
:2:1
}
perms
=(
$(
stat
-L
--format
=
'%A'
$file
)
)
local
gid
=
${
perms
[1]
}
debug
"perms:
$perms
"
local
group
=
${
perms
[2]
}
local
gperm
=
${
perms
:4:3
}
local
owner
=
${
perms
[3]
}
debug
"gperm:
$gperm
"
local
wperm
=
${
perms
:7:3
}
debug
"wperm:
$wperm
"
owners
=(
$(
stat
-L
--format
=
'%g %G %u %U'
$file
)
)
local
gid
=
${
owners
[0]
}
local
group
=
${
owners
[1]
}
local
owner
=
${
owners
[2]
}
if
[
"
$owner
"
!=
0
]
;
then
if
[
"
$owner
"
!=
0
]
;
then
echo
"Configuration files must be owned by root! Dying on file
$file
"
echo
"Configuration files must be owned by root! Dying on file
$file
"
fatal
"Configuration files must be owned by root! Dying on file
$file
"
fatal
"Configuration files must be owned by root! Dying on file
$file
"
fi
fi
if
[
$wperm
-gt
0
]
;
then
if
[
"
$wperm
"
!=
'---'
]
;
then
echo
"Configuration files must not be world writable/readable! Dying on file
$file
"
echo
"Configuration files must not be world writable/readable! Dying on file
$file
"
fatal
"Configuration files must not be world writable/readable! Dying on file
$file
"
fatal
"Configuration files must not be world writable/readable! Dying on file
$file
"
fi
fi
if
[
$gperm
-gt
0
]
;
then
if
[
"
$gperm
"
!=
'---'
]
;
then
case
"
$admingroup
"
in
case
"
$admingroup
"
in
$gid
|
$group
)
:
;;
$gid
|
$group
)
:
;;
*
)
*
)
if
[
"
$gid
"
!=
0
]
;
then
if
[
"
$gid
"
!=
0
]
;
then
echo
"Configuration files must not be writable/readable by group
$
{
perms
[2]
}
!
Dying on file
$file
"
echo
"Configuration files must not be writable/readable by group
$
group
! Use the admingroup option in backupninja.conf.
Dying on file
$file
"
fatal
"Configuration files must not be writable/readable by group
$
{
perms
[2]
}
!
Dying on file
$file
"
fatal
"Configuration files must not be writable/readable by group
$
group
! Use the admingroup option in backupninja.conf.
Dying on file
$file
"
fi
fi
;;
;;
esac
esac
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment