# File ../../auditor/lib/kasp_auditor/partial_auditor.rb, line 365
      def scan_unsigned_file(file, temp_file)
        @unsigned_keys = []
        # Only interested in doing this so that we can check the domains of interest
        # Also want to know how many non-DNSSEC RRs there are in unsigned file, so we can check right number is also in signed file.
        # Can we simply track whole lines here? i.e. check what is in and out of comment, keep track of ( and ) and ; to know when new line starts
        continued_line = false
        #        store_this_rr = false
        rr_counter = 0
        need_to_parse = false
        soa = nil
        zone_reader = Dnsruby::ZoneReader.new(@config.name, @config.soa ? @config.soa.minimum : nil,
          @config.soa ? @config.soa.ttl : nil)
        IO.foreach((file.to_s+"").untaint) {|line|
          next if (line[0,1] == ";")
          next if (line.strip.length == 0)
          next if (!line || (line.length == 0))
          if (!continued_line)
            # Now we want to know when the line has ended - need to keep track of brackets, ", ;, etc.
            # If this is a multi-line RR, or even might be, then load the RR up with ZoneReader.
            need_to_parse = (line.index("(") || line.index("\"") || line.index("\'"))
          end
          ret_line = line
          if (need_to_parse || continued_line || ret_line.index("soa") || ret_line.index("SOA") ||
                (line.index("$TTL") == 0) || (line.index("$ORIGIN") == 0))
            # Build up the RR from the input lines until we have the whole thing
            begin
              ret_line = zone_reader.process_line(line)
            rescue Exception => e
              KASPAuditor.exit("ERROR - Can't process zone file : #{file.inspect} : #{e}", 1)
            end
            if (!ret_line)
              continued_line = true
              next
            end
            need_to_parse = false
            continued_line = false
          end
          next if (line.index("$ORIGIN") == 0)
          next if (line.index("$TTL") == 0)
          if (ret_line=~/DNSKEY|RRSIG|NSEC|NSEC3|NSEC3PARAM|TYPE/)
            begin
              rr = RR.create(ret_line)
              if ([Types::RRSIG, Types::DNSKEY, Types::NSEC, Types::NSEC3, Types::NSEC3PARAM].include?rr.type)
                @parent.log(LOG_WARNING, "#{rr.type} present in unsigned file : #{ret_line.chomp}")
                need_to_parse = false
                continued_line = false
                if (rr.type == Types::DNSKEY)
                  @unsigned_keys.push(rr)
                end
                next
              end
            rescue Exception
            end
          end
          if (ret_line.index("soa") || ret_line.index("SOA"))
            rr = RR.create(ret_line)
            if (rr.type == Types::SOA)
              if (soa)
                # Check not more than one SOA in file!
                @parent.log(LOG_ERR, "Multiple SOA records found in signed file")
              end
              soa = ret_line
            end
          end
          need_to_parse = false
          continued_line = false
          # Handle out-of-zone data. 
          # We're interested in non-absolute names which are not in zone.
          rr_name = ret_line.split()[0]
          if (rr_name[rr_name.length-1, 1] != ".") || (rr_name.downcase=~/#{@config.name.downcase}\.$/)
            rr_counter += 1
          end
        }
        return rr_counter, soa
      end