MCPcopy Create free account
hub / github.com/ioi/isolate / cf_find_ids

Function cf_find_ids

config.c:161–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static void
162cf_find_ids(void)
163{
164 if (cf_subid_user)
165 {
166 if (cf_first_uid || cf_first_gid)
167 die("Configuration must not specify both subid_user and first_uid/first_gid");
168
169 int num_uids, num_gids;
170 cf_first_uid = find_subid("/etc/subuid", cf_subid_user, &num_uids);
171 cf_first_gid = find_subid("/etc/subgid", cf_subid_user, &num_gids);
172
173 if (!cf_num_boxes)
174 cf_num_boxes = (num_uids < num_gids) ? num_uids : num_gids;
175 else
176 {
177 if (num_uids < cf_num_boxes)
178 die("Configured num_boxes=%d, but only %d subuids are available", cf_num_boxes, num_uids);
179 if (num_gids < cf_num_boxes)
180 die("Configured num_boxes=%d, but only %d subgids are available", cf_num_boxes, num_gids);
181 }
182 }
183 else
184 {
185 if (!cf_num_boxes || !cf_first_uid || !cf_first_gid)
186 die("Configuration must specify either subuid_user, or first_uid/first_gid/num_boxes");
187 }
188}
189
190static void
191cf_check(void)

Callers 1

cf_parseFunction · 0.85

Calls 1

find_subidFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…