$NetBSD: patch-bo,v 1.2 2000/06/16 23:40:18 wiz Exp $ --- progs/glupart/glupart.c.orig Thu Sep 18 17:01:35 1997 +++ progs/glupart/glupart.c Tue Jun 13 14:44:12 2000 @@ -1,18 +1,40 @@ #include #include #include +#include #include #include #include #include +#if (defined(BSD) && BSD >= 199306) +#include +#include + +#define userId pwp->pw_uid +#define groupId grp->gr_gid +#else #define userId GLUNIX_ACCOUNT /* This is the glunix account */ #define groupId GLUNIX_GROUP /* The glunix group */ +#endif -#define progPath "/usr/now/bin/glupart_script" +#define progPath "%%%NOW_ROOT%%%/bin/glupart_script" int main(int argc, char **argv) { +#if (defined(BSD) && BSD >= 199306) + struct passwd *pwp; + struct group *grp; + + if ((pwp = getpwnam("glunix")) == (struct passwd *) NULL) { + (void) fprintf(stderr, "Error: can't get uid for `%s'\n", "glunix"); + exit(1); + } + if ((grp = getgrnam("glunix")) == (struct group *) NULL) { + (void) fprintf(stderr, "Error: can't get gid for `%s'\n", "glunix"); + exit(1); + } +#endif setegid(groupId); /* setgid(groupId); */ seteuid(userId);