+ if (name__sanitise(gr->gr_name, buf, sizeof(buf)) &&
+ (n = name__get(buf, clType_user)) != 0) {
+
+ /* --- Now add all of the members --- */
+
+ for (p = gr->gr_mem; *p; p++) {
+ if ((pw = userdb_userByName(*p)) != 0)
+ n->c = class_addUser(n->c, pw->pw_uid);
+ }
+ if (!n->c)
+ n->c = class_none;
+ }
+ }
+}
+
+/* --- @name__scan@ --- *
+ *
+ * Arguments: @netg *n@ = the netgroup handle we're scanning
+ * @const char *host@ = the host name
+ * @const char *user@ = the user name
+ * @const char *domain@ = the (NIS?) domain name
+ * @void *ctx@ = some context pointer
+ *
+ * Returns: Zero to continue scanning.
+ *
+ * Use: Scans a netgroup, adding items to the name table.
+ */
+
+/* --- A data type --- */
+
+typedef struct name__scanctx {
+ char *name; /* Netgroup name prefixed with `?_'*/
+ unsigned f; /* Various interesting flags */
+ name *h; /* Name entry for hosts */
+ name *u; /* Name entry for users */
+} name__scanctx;
+
+enum { f_host = 1, f_user = 2 };
+
+/* --- And now for the real code --- */
+
+static int name__scan(netg *n, const char *host, const char *user,
+ const char *domain, void *ctx)
+{
+ name__scanctx *sc = ctx;
+
+ /* --- Add the host to the hosts class --- */