Skip to content

Commit

Permalink
Allow install service files to query configd (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawalexe authored Nov 8, 2024
1 parent 2ea3d01 commit 2115b14
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ggipc-auth/src/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,27 @@ GglError ggl_ipc_auth_lookup_name(

name = ggl_buffer_substr(name, 0, name.len - ext.len);

// TODO:: Make this generic and support .run/.bootstrap or anything
GglBuffer install_ext = GGL_STR(".install");
if ((name.len <= install_ext.len)
|| !ggl_buffer_eq(
ggl_buffer_substr(name, name.len - install_ext.len, SIZE_MAX),
install_ext
)) {
GGL_LOGT(
"Service for pid %d (%s) is not a install service extension.",
pid,
unit_name
);
} else {
name = ggl_buffer_substr(name, 0, name.len - install_ext.len);
GGL_LOGT(
"Service for pid %d (%s) is a install service extension.",
pid,
unit_name
);
}

GglBuffer prefix = GGL_STR("ggl.");
if (!ggl_buffer_eq(ggl_buffer_substr(name, 0, prefix.len), prefix)) {
GGL_LOGE(
Expand Down

0 comments on commit 2115b14

Please sign in to comment.