Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit11523e8

Browse files
committed
Support new default roles with adminpack
This provides a newer version of adminpack which works with the newlyadded default roles to support GRANT'ing to non-superusers access toread and write files, along with related functions (unlinking files,getting file length, renaming/removing files, scanning the log filedirectory) which are supported through adminpack.Note that new versions of the functions are required because anenvironment might have an updated version of the library but still havethe old adminpack 1.0 catalog definitions (where EXECUTE is GRANT'd toPUBLIC for the functions).This patch also removes the long-deprecated alternative names forfunctions that adminpack used to include and which are now included inthe backend, in adminpack v1.1. Applications using the deprecated namesshould be updated to use the backend functions instead. Existinginstallations which continue to use adminpack v1.0 should continue tofunction until/unless adminpack is upgraded.Reviewed-By: Michael PaquierDiscussion:https://postgr.es/m/20171231191939.GR2416%40tamriel.snowman.net
1 parent0fdc849 commit11523e8

File tree

10 files changed

+388
-88
lines changed

10 files changed

+388
-88
lines changed

‎contrib/adminpack/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ OBJS = adminpack.o $(WIN32RES)
55
PG_CPPFLAGS = -I$(libpq_srcdir)
66

77
EXTENSION = adminpack
8-
DATA = adminpack--1.0.sql
8+
DATA = adminpack--1.0.sql adminpack--1.0--1.1.sql
99
PGFILEDESC = "adminpack - support functions for pgAdmin"
1010

1111
REGRESS = adminpack
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* contrib/adminpack/adminpack--1.0--1.1.sql*/
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use"ALTER EXTENSION adminpack UPDATE TO '1.1'" to load this file. \quit
5+
6+
/* ***********************************************
7+
* Administrative functions for PostgreSQL
8+
* ************************************************/
9+
10+
/* generic file access functions*/
11+
12+
CREATE OR REPLACEFUNCTIONpg_catalog.pg_file_write(text,text, bool)
13+
RETURNSbigint
14+
AS'MODULE_PATHNAME','pg_file_write_v1_1'
15+
LANGUAGE C VOLATILE STRICT;
16+
17+
REVOKE EXECUTEON FUNCTIONpg_catalog.pg_file_write(text,text, bool)FROM PUBLIC;
18+
19+
CREATE OR REPLACEFUNCTIONpg_catalog.pg_file_rename(text,text,text)
20+
RETURNS bool
21+
AS'MODULE_PATHNAME','pg_file_rename_v1_1'
22+
LANGUAGE C VOLATILE;
23+
24+
REVOKE EXECUTEON FUNCTIONpg_catalog.pg_file_rename(text,text,text)FROM PUBLIC;
25+
26+
CREATE OR REPLACEFUNCTIONpg_catalog.pg_file_rename(text,text)
27+
RETURNS bool
28+
AS'SELECT pg_catalog.pg_file_rename($1, $2, NULL::pg_catalog.text);'
29+
LANGUAGE SQL VOLATILE STRICT;
30+
31+
CREATE OR REPLACEFUNCTIONpg_catalog.pg_file_unlink(text)
32+
RETURNS bool
33+
AS'MODULE_PATHNAME','pg_file_unlink_v1_1'
34+
LANGUAGE C VOLATILE STRICT;
35+
36+
REVOKE EXECUTEON FUNCTIONpg_catalog.pg_file_unlink(text)FROM PUBLIC;
37+
38+
CREATE OR REPLACEFUNCTIONpg_catalog.pg_logdir_ls()
39+
RETURNS setof record
40+
AS'MODULE_PATHNAME','pg_logdir_ls_v1_1'
41+
LANGUAGE C VOLATILE STRICT;
42+
43+
REVOKE EXECUTEON FUNCTIONpg_catalog.pg_logdir_ls()FROM PUBLIC;
44+
45+
/* These functions are now in the backend and callers should update to use those*/
46+
47+
DROPFUNCTION pg_file_read(text,bigint,bigint);
48+
49+
DROPFUNCTION pg_file_length(text);
50+
51+
DROPFUNCTION pg_logfile_rotate();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp