    # File lib/chef/provider/user/useradd.rb, line 47
            def check_lock
              status = popen4("passwd -S #{@new_resource.username}") do |pid, stdin, stdout, stderr|
                status_line = stdout.gets.split(' ')
                case status_line[1]
                when /^P/
                  @locked = false
                when /^N/
                  @locked = false
                when /^L/
                  @locked = true
                end
              end

              unless status.exitstatus == 0
                raise_lock_error = false
                # we can get an exit code of 1 even when it's successful on rhel/centos (redhat bug 578534)
                if status.exitstatus == 1 && ['redhat', 'centos'].include?(node[:platform])
                  passwd_version_status = popen4('rpm -q passwd') do |pid, stdin, stdout, stderr|
                    passwd_version = stdout.gets.chomp

                    unless passwd_version == 'passwd-0.73-1'
                      raise_lock_error = true
                    end
                  end
                else
                  raise_lock_error = true
                end

                raise Chef::Exceptions::User, "Cannot determine if #{@new_resource} is locked!" if raise_lock_error
              end

              @locked
            end