Bug 231653 - pw doesn't respect -V when writing pw.conf
Summary: pw doesn't respect -V when writing pw.conf
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Pankov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-24 06:58 UTC by Yuri Pankov
Modified: 2018-10-15 20:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Pankov 2018-09-24 06:58:05 UTC
pw -V /newetc adduser -D -w random:

...
open("/newetc/pw.conf",O_RDONLY,0666)            ERR#2 'No such file or directory'
openat(AT_FDCWD,"/etc/pw.conf",O_RDWR|O_EXLOCK|O_CREAT|O_TRUNC,0644) = 4 (0x4)
...
write(4,"#\n# pw.conf - user/group config"...,1367) = 1367 (0x557)
close(4)                                         = 0 (0x0)
...
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-10-15 20:12:20 UTC
A commit references this bug:

Author: yuripv
Date: Mon Oct 15 20:11:54 UTC 2018
New revision: 339369
URL: https://svnweb.freebsd.org/changeset/base/339369

Log:
  pw: respect path specified using -V when writing pw.conf, and -C is not
  explicitly specified.  -V path is already used to determine which file
  to read default values from, so it's only logical to write them to the
  same file.

  PR:		231653
  Reviewed by:	eugen, bapt
  Approved by:	re (gjb), kib (mentor)
  Differential Revision:	https://reviews.freebsd.org/D17566

Changes:
  head/usr.sbin/pw/pw.h
  head/usr.sbin/pw/pw_conf.c
  head/usr.sbin/pw/pw_utils.c