PR: 231649
boolean_str() has weird ideas about the possible values of val, make them match reality.
Differential D17299
PR231649: pw: make checks in boolean_str() match reality yuripv on Sep 24 2018, 3:49 AM. Authored by Tags None Referenced Files
Details PR: 231649 boolean_str() has weird ideas about the possible values of val, make them match reality. # /usr/obj/home/yuri/ws/pw/amd64.amd64/usr.sbin/pw/pw useradd -D -w no; grep defaultpasswd /etc/pw.conf defaultpasswd = "no" # /usr/obj/home/yuri/ws/pw/amd64.amd64/usr.sbin/pw/pw useradd -D -w none; grep defaultpasswd /etc/pw.conf defaultpasswd = "none" # /usr/obj/home/yuri/ws/pw/amd64.amd64/usr.sbin/pw/pw useradd -D -w random; grep defaultpasswd /etc/pw.conf defaultpasswd = "random" # /usr/obj/home/yuri/ws/pw/amd64.amd64/usr.sbin/pw/pw useradd -D -w yes; grep defaultpasswd /etc/pw.conf defaultpasswd = "yes" # /usr/obj/home/yuri/ws/pw/amd64.amd64/usr.sbin/pw/pw useradd -D -w whoa; grep defaultpasswd /etc/pw.conf pw: Invalid value for default password defaultpasswd = "yes" Also, newly added test cases: ... usr.sbin/pw/pw_useradd_test:user_add_conf_defaultpasswd -> passed [0.089s] ...
Diff Detail
Event TimelineComment Actions Just as a comment: boolean_str() problem seems to be a left-over after my change r326848 that changed magic values -2 .. 1 to symbols P_NONE etc. but missed a change for boolean_str(). |