+ "# Changing user database information for %s.\n"
+ "#\n"
+ "# (use \"passwd\" to change the password)\n"
+ "##\n",
+ pw->pw_name);
+
+#ifdef DIRECTORY_SERVICE
+ switch (dswhere) {
+ case WHERE_FILES:
+ (void)fprintf(fp,
+ "# Flat file: /etc/master.passwd\n"
+ "##\n");
+ break;
+ case WHERE_LOCALNI:
+ (void)fprintf(fp,
+ "# Local NetInfo Database\n"
+ "##\n");
+ break;
+ }
+ d.pw = pw;
+ bp = pw->pw_gecos;
+ p = strsep(&bp, ",");
+ d.fullname = (p ? p : "");
+ p = strsep(&bp, ",");
+ d.location = (p ? p : "");
+ p = strsep(&bp, ",");
+ d.officephone = (p ? p : "");
+ p = strsep(&bp, ",");
+ d.homephone = ( p ? p : "");
+
+ for (ep = list; ep->prompt; ep++)
+ if (!ep->restricted) {
+ ep->display(&d, fp);
+ ndisplayed++;
+ }
+ if(!ndisplayed) {
+ (void)fprintf(fp, "###################################\n");
+ (void)fprintf(fp, "# No fields are available to change\n");
+ (void)fprintf(fp, "###################################\n");
+ }
+#else /* DIRECTORY_SERVICE */
+ (void)fprintf(fp,
+ "##\n"
+ "# User Database\n"
+ "# \n"
+ "# Note: This program edits the /etc/master.passwd file which is only \n"
+ "# consulted when the system is running in single-user mode. At other times \n"
+ "# this information is handled by lookupd. By default, lookupd gets \n"
+ "# information from NetInfo, so this file will not be consulted unless you \n"
+ "# have changed lookupd's configuration.\n"
+ "##\n");
+