@@ -24,6 +24,12 @@ I believe these constraints can be demonstrated with only two groups:
24
24
the admins (us), and customer's developers. If I've made a mistake, it
25
25
will have to be amended with an additional customer (and group).
26
26
27
+ # The Goal
28
+
29
+ We should be able to run the scripts in pg-test and have them work,
30
+ considering the previous few paragraphs. Can you modify
31
+ pg-test/02-create-permissions so that the rest of the tests pass?
32
+
27
33
# Running the Tests
28
34
29
35
These two tests will create system and postgres users on your
@@ -38,7 +44,7 @@ To run the tests, simply 'cd' into the directory, and run the scripts
38
44
in order. On my machine, this is how the filesystem tests (POSIX ACL
39
45
support required) are run:
40
46
41
- ``` Bash
47
+ ```
42
48
sudo ./01-create-actors.sh
43
49
sudo ./02-create-acls.sh
44
50
sudo ./03-run-tests.sh
@@ -49,7 +55,7 @@ sudo ./05-destroy-actors.sh
49
55
There's no output, which means that the test succeeded. The postgres
50
56
test, on the other hand, fails at step #4 :
51
57
52
- ``` Bash
58
+ ```
53
59
sudo ./01-create-actors.sh
54
60
sudo ./02-create-permissions.sh
55
61
sudo ./03-run-tests.sh
@@ -125,21 +131,22 @@ thing. When you create a new directory for the customer,
125
131
126
132
1 . Grant read/write permissions to the customer-devs group:
127
133
128
- setfacl -m group:customer-devs: rwx <dir >
134
+ ` setfacl -m group:customer-devs:rwx <dir> `
129
135
130
136
2 . Grant read-only permissions to the anonymous user:
131
137
132
- setfacl -m user:anonymous: rx <dir >
138
+ ` setfacl -m user:anonymous:rx <dir> `
133
139
134
140
3 . Set customer-devs defaults for newly-created files:
135
141
136
- setfacl -d -m group:customer-devs: rwx <dir >
142
+ ` setfacl -d -m group:customer-devs:rwx <dir> `
137
143
138
144
4 . Set anonymous defaults for newly-created-files:
139
145
140
- setfacl -d -m user:anonymous: rx <dir >
146
+ ` setfacl -d -m user:anonymous:rx <dir> `
141
147
142
- If the directory is non-empty here, find/xargs can be used.
148
+ If the directory is non-empty here, find/xargs can be used. This is
149
+ what the filesystem test does, and it works.
143
150
144
151
# Database Examples
145
152
@@ -161,10 +168,13 @@ permissions to the (server-level) role.
161
168
## Postgres
162
169
163
170
Postgres has no (obvious?) way to achieve this. The closest I was able
164
- to come can be found in the pg-tests /02-create-permissions.sh file. It
171
+ to come can be found in the pg-test /02-create-permissions.sh file. It
165
172
is not pretty; and doesn't fully work besides. When a new user is
166
173
created in 04-add-new-user-and-retest.sh, some manual work is required
167
174
to grant him the correct permissions.
168
175
169
176
If there are 100 databases on the server already, that could be a lot
170
177
of error-prone work.
178
+
179
+ Is there a way to modify 02-create-permissions.sh so that
180
+ 04-add-new-user-and-retest.sh will work?
0 commit comments