Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
08985285
Commit
08985285
authored
Nov 28, 2008
by
anarcat
Committed by
anarcat
Nov 28, 2008
Browse files
fix octal modes display
backport from d5 (forgotten back then)
parent
87095dd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
provision.path.inc
View file @
08985285
...
...
@@ -79,6 +79,9 @@ function provision_path($op, $path, $confirm = TRUE, $succeed_message = NULL, $f
$value
=
$func
(
$path
,
$confirm
,
$reason
);
if
(
$op
==
'chmod'
)
{
$confirm
=
sprintf
(
'%o'
,
$confirm
);
# convert octal to string representation
}
clearstatcache
();
// this needs to be called, otherwise we get the old info
$tokens
=
array
(
"@path"
=>
$path
,
"@op"
=>
$op
,
"@confirm"
=>
$confirm
);
if
(
$reason
)
{
...
...
@@ -158,11 +161,10 @@ function provision_path_unlink($path) {
function
provision_path_chmod
(
$path
,
&
$perms
,
&
$reason
)
{
if
(
!
chmod
(
$path
,
$perms
))
{
$reason
=
t
(
'chmod to @perm failed on @path'
,
array
(
'@perm'
=>
$perms
,
'@path'
=>
$path
));
$reason
=
t
(
'chmod to @perm failed on @path'
,
array
(
'@perm'
=>
sprintf
(
'%o'
,
$perms
)
,
'@path'
=>
$path
));
return
false
;
}
clearstatcache
();
// this needs to be called, otherwise we get the old info
$perms
=
sprintf
(
'%o'
,
$perms
);
# needs to be reset to oct
$value
=
substr
(
sprintf
(
'%o'
,
fileperms
(
$path
)),
-
4
);
return
$value
;
}
...
...
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