Cleanup configuration attributes.
()
| 1668 | _pympTempLeakPatch(kb.tempDir) |
| 1669 | |
| 1670 | def _cleanupOptions(): |
| 1671 | """ |
| 1672 | Cleanup configuration attributes. |
| 1673 | """ |
| 1674 | |
| 1675 | if conf.encoding: |
| 1676 | try: |
| 1677 | codecs.lookup(conf.encoding) |
| 1678 | except LookupError: |
| 1679 | errMsg = "unknown encoding '%s'" % conf.encoding |
| 1680 | raise SqlmapValueException(errMsg) |
| 1681 | |
| 1682 | debugMsg = "cleaning up configuration parameters" |
| 1683 | logger.debug(debugMsg) |
| 1684 | |
| 1685 | width = getConsoleWidth() |
| 1686 | |
| 1687 | if conf.eta: |
| 1688 | conf.progressWidth = width - 26 |
| 1689 | else: |
| 1690 | conf.progressWidth = width - 46 |
| 1691 | |
| 1692 | for key, value in conf.items(): |
| 1693 | if value and any(key.endswith(_) for _ in ("Path", "File", "Dir")): |
| 1694 | if isinstance(value, str): |
| 1695 | conf[key] = safeExpandUser(value) |
| 1696 | |
| 1697 | if conf.testParameter: |
| 1698 | conf.testParameter = urldecode(conf.testParameter) |
| 1699 | conf.testParameter = [_.strip() for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.testParameter)] |
| 1700 | else: |
| 1701 | conf.testParameter = [] |
| 1702 | |
| 1703 | if conf.ignoreCode: |
| 1704 | if conf.ignoreCode == IGNORE_CODE_WILDCARD: |
| 1705 | conf.ignoreCode = xrange(0, 1000) |
| 1706 | else: |
| 1707 | try: |
| 1708 | conf.ignoreCode = [int(_) for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.ignoreCode)] |
| 1709 | except ValueError: |
| 1710 | errMsg = "option '--ignore-code' should contain a list of integer values or a wildcard value '%s'" % IGNORE_CODE_WILDCARD |
| 1711 | raise SqlmapSyntaxException(errMsg) |
| 1712 | else: |
| 1713 | conf.ignoreCode = [] |
| 1714 | |
| 1715 | if conf.abortCode: |
| 1716 | try: |
| 1717 | conf.abortCode = [int(_) for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.abortCode)] |
| 1718 | except ValueError: |
| 1719 | errMsg = "option '--abort-code' should contain a list of integer values" |
| 1720 | raise SqlmapSyntaxException(errMsg) |
| 1721 | else: |
| 1722 | conf.abortCode = [] |
| 1723 | |
| 1724 | if conf.paramFilter: |
| 1725 | conf.paramFilter = [_.strip() for _ in re.split(PARAMETER_SPLITTING_REGEX, conf.paramFilter.upper())] |
| 1726 | else: |
| 1727 | conf.paramFilter = [] |
no test coverage detected
searching dependent graphs…