Bug 169356 - pw(8): "pw groupmod GROUP -h FD" ignores "passwd_format" from login.conf(5)
Summary: pw(8): "pw groupmod GROUP -h FD" ignores "passwd_format" from login.conf(5)
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-23 17:50 UTC by Devin Teske
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Teske freebsd_committer freebsd_triage 2012-06-23 17:50:08 UTC
When attempting to set the password field for a group in group(5) using pw(8), only old-style DES hash is used. The passwd_format setting in login.conf(5) is ignored.

Fix: 

I see two ways forward:

1. Update pw(8) to adhere to passwd_format when "groupmod GROUP -h FD" is used (making it act similar to "usermod USER -h FD")

2. Add a new "group_passwd_format" to login.conf(5) and make pw(8) adhere to that.
How-To-Repeat: First, witness that pw(8) adheres to the desired "passwd_format" setting in login.conf(5) when changing the password for a user (versus group):

echo newpass | sudo pw usermod SOMEUSER -h 0
sudo grep '^SOMEUSER:' /etc/master.passwd

NOTE: The password field (second field delimited by ":") contains a hash in the desired format (based on "passwd_format" setting in login.conf -- MD5 is the default, producing "$1$salt$data" in the password field).

Now, witness that when doing the same thing but for a group, login.conf(5) is now ignored and only a DES hash can be generated:

echo newpass | sudo pw groupmod SOMEGROUP -h 0
grep '^SOMEGROUP:' /etc/group
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:53 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped