Skip to content

Commit 0afa288

Browse files
committed
Remove unnecessary code from be_lo_put()
A permission check is performed in be_lo_put() just after returning from inv_open(), but the permission is already checked in inv_open(), so we can remove the second check. This check was added in 8d98819, but then the refactoring in ae20b23 should have removed it. Author: Yugo NAGATA <nagata@sraoss.co.jp> Discussion: https://www.postgresql.org/message-id/flat/20240424185932.9789628b99a49ec81b020425%40sraoss.co.jp
1 parent aa79bde commit 0afa288

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/backend/libpq/be-fsstubs.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -859,18 +859,6 @@ be_lo_put(PG_FUNCTION_ARGS)
859859

860860
lo_cleanup_needed = true;
861861
loDesc = inv_open(loOid, INV_WRITE, CurrentMemoryContext);
862-
863-
/* Permission check */
864-
if (!lo_compat_privileges &&
865-
pg_largeobject_aclcheck_snapshot(loDesc->id,
866-
GetUserId(),
867-
ACL_UPDATE,
868-
loDesc->snapshot) != ACLCHECK_OK)
869-
ereport(ERROR,
870-
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
871-
errmsg("permission denied for large object %u",
872-
loDesc->id)));
873-
874862
inv_seek(loDesc, offset, SEEK_SET);
875863
written = inv_write(loDesc, VARDATA_ANY(str), VARSIZE_ANY_EXHDR(str));
876864
Assert(written == VARSIZE_ANY_EXHDR(str));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy