Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
e374df4b
Commit
e374df4b
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Minor formatting issues.
parent
9c3d26ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/SimpleSAML/Utils/Auth.php
+3
-1
3 additions, 1 deletion
lib/SimpleSAML/Utils/Auth.php
lib/SimpleSAML/Utils/System.php
+22
-12
22 additions, 12 deletions
lib/SimpleSAML/Utils/System.php
lib/SimpleSAML/Utils/XML.php
+2
-2
2 additions, 2 deletions
lib/SimpleSAML/Utils/XML.php
with
27 additions
and
15 deletions
lib/SimpleSAML/Utils/Auth.php
+
3
−
1
View file @
e374df4b
...
...
@@ -68,7 +68,9 @@ class Auth
$as
=
new
\SimpleSAML_Auth_Simple
(
'admin'
);
$as
->
login
();
}
else
{
throw
new
\SimpleSAML_Error_Exception
(
'Cannot find "admin" auth source, and admin privileges are required.'
);
throw
new
\SimpleSAML_Error_Exception
(
'Cannot find "admin" auth source, and admin privileges are required.'
);
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/Utils/System.php
+
22
−
12
View file @
e374df4b
...
...
@@ -71,21 +71,28 @@ class System
{
$globalConfig
=
\SimpleSAML_Configuration
::
getInstance
();
$tempDir
=
rtrim
(
$globalConfig
->
getString
(
'tempdir'
,
sys_get_temp_dir
()
.
DIRECTORY_SEPARATOR
.
'simplesaml'
),
DIRECTORY_SEPARATOR
);
$tempDir
=
rtrim
(
$globalConfig
->
getString
(
'tempdir'
,
sys_get_temp_dir
()
.
DIRECTORY_SEPARATOR
.
'simplesaml'
),
DIRECTORY_SEPARATOR
);
if
(
!
is_dir
(
$tempDir
))
{
if
(
!
mkdir
(
$tempDir
,
0700
,
true
))
{
$error
=
error_get_last
();
throw
new
\SimpleSAML_Error_Exception
(
'Error creating temporary directory "'
.
$tempDir
.
'": '
.
$error
[
'message'
]);
throw
new
\SimpleSAML_Error_Exception
(
'Error creating temporary directory "'
.
$tempDir
.
'": '
.
$error
[
'message'
]
);
}
}
elseif
(
function_exists
(
'posix_getuid'
))
{
// check that the owner of the temp directory is the current user
$stat
=
lstat
(
$tempDir
);
if
(
$stat
[
'uid'
]
!==
posix_getuid
())
{
throw
new
\SimpleSAML_Error_Exception
(
'Temporary directory "'
.
$tempDir
.
'" does not belong to the current user.'
);
throw
new
\SimpleSAML_Error_Exception
(
'Temporary directory "'
.
$tempDir
.
'" does not belong to the current user.'
);
}
}
...
...
@@ -174,24 +181,27 @@ class System
$res
=
@
file_put_contents
(
$tmpFile
,
$data
);
if
(
$res
===
false
)
{
$error
=
error_get_last
();
throw
new
\SimpleSAML_Error_Exception
(
'Error saving file "'
.
$tmpFile
.
'": '
.
$error
[
'message'
]);
throw
new
\SimpleSAML_Error_Exception
(
'Error saving file "'
.
$tmpFile
.
'": '
.
$error
[
'message'
]
);
}
if
(
self
::
getOS
()
!==
self
::
WINDOWS
)
{
if
(
!
chmod
(
$tmpFile
,
$mode
))
{
unlink
(
$tmpFile
);
$error
=
error_get_last
();
throw
new
\SimpleSAML_Error_Exception
(
'Error changing file mode of "'
.
$tmpFile
.
'": '
.
$error
[
'message'
]);
throw
new
\SimpleSAML_Error_Exception
(
'Error changing file mode of "'
.
$tmpFile
.
'": '
.
$error
[
'message'
]
);
}
}
if
(
!
rename
(
$tmpFile
,
$filename
))
{
unlink
(
$tmpFile
);
$error
=
error_get_last
();
throw
new
\SimpleSAML_Error_Exception
(
'Error moving "'
.
$tmpFile
.
'" to "'
.
$filename
.
'": '
.
$error
[
'message'
]);
throw
new
\SimpleSAML_Error_Exception
(
'Error moving "'
.
$tmpFile
.
'" to "'
.
$filename
.
'": '
.
$error
[
'message'
]
);
}
}
}
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/Utils/XML.php
+
2
−
2
View file @
e374df4b
...
...
@@ -230,7 +230,7 @@ class XML
try
{
$doc
=
\SAML2_DOMDocumentFactory
::
fromString
(
$xml
);
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
throw
new
\DOMException
(
'Error parsing XML string.'
);
}
...
...
@@ -405,7 +405,7 @@ class XML
try
{
$dom
=
\SAML2_DOMDocumentFactory
::
fromString
(
$xml
);
$res
=
true
;
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$res
=
false
;
}
}
...
...
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