Index: usr.sbin/pw/pw.h =================================================================== --- usr.sbin/pw/pw.h +++ usr.sbin/pw/pw.h @@ -64,7 +64,8 @@ }; #define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) -#define _PATH_PW_CONF "/etc/pw.conf" +#define _PW_CONF "pw.conf" +#define _PATH_PW_CONF "/etc/" _PW_CONF #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 Index: usr.sbin/pw/pw_conf.c =================================================================== --- usr.sbin/pw/pw_conf.c +++ usr.sbin/pw/pw_conf.c @@ -417,9 +417,13 @@ int i, j; struct sbuf *buf; FILE *fp; + char cfgfile[MAXPATHLEN]; - if (file == NULL) - file = _PATH_PW_CONF; + if (file == NULL) { + snprintf(cfgfile, sizeof(cfgfile), "%s/" _PW_CONF, + conf.etcpath); + file = cfgfile; + } if ((fd = open(file, O_CREAT|O_RDWR|O_TRUNC|O_EXLOCK, 0644)) == -1) return (0); Index: usr.sbin/pw/pw_utils.c =================================================================== --- usr.sbin/pw/pw_utils.c +++ usr.sbin/pw/pw_utils.c @@ -71,7 +71,7 @@ if (config != NULL) return (read_userconfig(config)); - snprintf(defaultcfg, sizeof(defaultcfg), "%s/pw.conf", conf.etcpath); + snprintf(defaultcfg, sizeof(defaultcfg), "%s/" _PW_CONF, conf.etcpath); return (read_userconfig(defaultcfg)); }