From 358ed61b023006bff29d09611bda9a57f26ca5ab Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 11 May 2023 07:54:37 -0700 Subject: sysif: define passwd symbol for group stuff. * sysif.c (sysif_init): The passwd symbol is used by both the passwd and group structure, so we need to initialize it if either HAVE_PWUID or HAVE_GRGID is set. Certain Android SDK levels have getgrgid but not getpwuid, so it's possible to end up with HAVE_GRGID but not HAVE_PWUID, in which case passwd_s ends up nil, blowing up the make_struct_type call. --- sysif.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysif.c b/sysif.c index 8bf81867..2f10720e 100644 --- a/sysif.c +++ b/sysif.c @@ -2539,8 +2539,10 @@ void sysif_init(void) path_s = intern(lit("path"), user_package); dir_s = intern(lit("dir"), user_package); dirent_s = intern(lit("dirent"), user_package); -#if HAVE_PWUID +#if HAVE_PWUID || HAVE_GRGID passwd_s = intern(lit("passwd"), user_package); +#endif +#if HAVE_PWUID gecos_s = intern(lit("gecos"), user_package); shell_s = intern(lit("shell"), user_package); #endif -- cgit v1.2.3