Hi All, I found the following problem with the pw: FreeBSD srv.teste.com.br 10.1-STABLE FreeBSD 10.1-STABLE #14 r276979: Wed Jan 21 11:50:11 BRST 2015 root@srv.teste.com.br:/usr/obj/usr/src/sys/TESTE amd64 # pw useradd foo # pw usermod foo -u 5000 # It's OK But FreeBSD srv.teste.com.br 10.2-RC2 FreeBSD 10.2-RC2 #1 r286291: Wed Aug 5 10:03:45 BRT 2015 root@srv.teste.com.br:/usr/obj/usr/src/sys/TESTE amd64 # pw useradd foo # pw usermod foo -u 5000 Segmentation fault (core dumped) #
This works as expected in 11-CURRENT: root@releng2:/ # pw usermod hast -u 5000 root@releng2:/ # grep hast /etc/passwd hast:*:5000:845:HAST unprivileged user:/var/empty:/usr/sbin/nologin I can reproduce this in 10.2-RC2: root@releng1:/usr/src # pw usermod cups -u 194 Segmentation fault (core dumped) root@releng1:/usr/src # grep cups /etc/passwd cups:*:193:193:Cups Owner:/nonexistent:/usr/sbin/nologin
A commit references this bug: Author: bapt Date: Wed Aug 5 20:32:08 UTC 2015 New revision: 286340 URL: https://svnweb.freebsd.org/changeset/base/286340 Log: Fix segfault were modifying the uid of a user Do a direct commit as the code on head has changed a lot and does not fail in that case PR: 202111 Reported by: gondim@bsdinfo.com.br Changes: stable/10/usr.sbin/pw/pw_user.c
A commit references this bug: Author: gjb Date: Thu Aug 6 01:39:24 UTC 2015 New revision: 286357 URL: https://svnweb.freebsd.org/changeset/base/286357 Log: MFS r286340 (bapt): Fix segfault in pw(8) when modifying the UID of a user. PR: 202111 Approved by: re (delphij) Sponsored by: The FreeBSD Foundation Changes: _U releng/10.2/ releng/10.2/usr.sbin/pw/pw_user.c
Fixed. Thank you for the report.
Assign this to bapt@ who have created the fix for completeness (please ignore: this is already addressed in the affected releng/10.2 branch).