Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
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
Abuhujair Javed
Postgres FD Implementation
Commits
b62aa83f
Commit
b62aa83f
authored
Oct 01, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmgr_security_definer had better do a PG_TRY to ensure the outer userid
is restored on error exit.
parent
c8196c87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
src/backend/utils/fmgr/fmgr.c
src/backend/utils/fmgr/fmgr.c
+18
-7
No files found.
src/backend/utils/fmgr/fmgr.c
View file @
b62aa83f
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.8
4 2004/09/13 01:44:46 neilc
Exp $
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.8
5 2004/10/01 20:39:54 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -794,7 +794,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
...
@@ -794,7 +794,7 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
{
{
Datum
result
;
Datum
result
;
FmgrInfo
*
save_flinfo
;
FmgrInfo
*
save_flinfo
;
struct
fmgr_security_definer_cache
*
fcache
;
struct
fmgr_security_definer_cache
*
volatile
fcache
;
AclId
save_userid
;
AclId
save_userid
;
HeapTuple
tuple
;
HeapTuple
tuple
;
...
@@ -821,14 +821,25 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
...
@@ -821,14 +821,25 @@ fmgr_security_definer(PG_FUNCTION_ARGS)
fcache
=
fcinfo
->
flinfo
->
fn_extra
;
fcache
=
fcinfo
->
flinfo
->
fn_extra
;
save_flinfo
=
fcinfo
->
flinfo
;
save_flinfo
=
fcinfo
->
flinfo
;
fcinfo
->
flinfo
=
&
fcache
->
flinfo
;
save_userid
=
GetUserId
();
save_userid
=
GetUserId
();
PG_TRY
();
{
fcinfo
->
flinfo
=
&
fcache
->
flinfo
;
SetUserId
(
fcache
->
userid
);
SetUserId
(
fcache
->
userid
);
result
=
FunctionCallInvoke
(
fcinfo
);
result
=
FunctionCallInvoke
(
fcinfo
);
}
PG_CATCH
();
{
fcinfo
->
flinfo
=
save_flinfo
;
SetUserId
(
save_userid
);
SetUserId
(
save_userid
);
PG_RE_THROW
();
}
PG_END_TRY
();
fcinfo
->
flinfo
=
save_flinfo
;
fcinfo
->
flinfo
=
save_flinfo
;
SetUserId
(
save_userid
);
return
result
;
return
result
;
}
}
...
...
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