Page MenuHomeFreeBSD

D17566.id49190.diff
No OneTemporary

D17566.id49190.diff

Index: head/usr.sbin/pw/pw.h
===================================================================
--- head/usr.sbin/pw/pw.h
+++ head/usr.sbin/pw/pw.h
@@ -64,6 +64,7 @@
};
#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO)
+#define _PW_CONF "pw.conf"
#define _PATH_PW_CONF "/etc/pw.conf"
#define _UC_MAXLINE 1024
#define _UC_MAXSHELLS 32
Index: head/usr.sbin/pw/pw_conf.c
===================================================================
--- head/usr.sbin/pw/pw_conf.c
+++ head/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: head/usr.sbin/pw/pw_utils.c
===================================================================
--- head/usr.sbin/pw/pw_utils.c
+++ head/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));
}

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 7, 12:50 AM (8 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38367598
Default Alt Text
D17566.id49190.diff (1 KB)

Event Timeline