Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion storage/pkg/idtools/idtools_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ struct subid_range get_range(struct subid_range *ranges, int i)
return ranges[i];
}

// helper for stderr to avoid referencing C.stderr from Go code,
// which breaks cgo on musl due to stderr being declared as FILE *const
static FILE *subid_stderr(void) {
return stderr;
}

#if !defined(SUBID_ABI_MAJOR) || (SUBID_ABI_MAJOR < 4)
# define subid_init libsubid_init
# define subid_get_uid_ranges get_subuid_ranges
Expand All @@ -44,7 +50,7 @@ func readSubid(username string, isUser bool) (ranges, error) {
}

onceInit.Do(func() {
C.subid_init(C.CString("storage"), C.stderr)
C.subid_init(C.CString("storage"), C.subid_stderr())
})

cUsername := C.CString(username)
Expand Down
Loading