This basically implements fc58c0c7bf for gshadow. gpasswd may not have a lock/unlock that behaves the same as passwd, but according to gshadow(5) the logic of the password field is the same.
fc58c0c7bf