(os)
| 416 | |
| 417 | @staticmethod |
| 418 | def setOs(os): |
| 419 | if os is None: |
| 420 | return None |
| 421 | |
| 422 | # Little precaution, in theory this condition should always be false |
| 423 | elif kb.os is not None and isinstance(os, six.string_types) and kb.os.lower() != os.lower(): |
| 424 | msg = "sqlmap previously fingerprinted back-end DBMS " |
| 425 | msg += "operating system %s. However now it has " % kb.os |
| 426 | msg += "been fingerprinted to be %s. " % os |
| 427 | msg += "Please, specify which OS is " |
| 428 | msg += "correct [%s (default)/%s] " % (kb.os, os) |
| 429 | |
| 430 | while True: |
| 431 | choice = readInput(msg, default=kb.os) |
| 432 | |
| 433 | if choice == kb.os: |
| 434 | break |
| 435 | elif choice == os: |
| 436 | kb.os = choice.capitalize() |
| 437 | break |
| 438 | else: |
| 439 | warnMsg = "invalid value" |
| 440 | logger.warning(warnMsg) |
| 441 | |
| 442 | elif kb.os is None and isinstance(os, six.string_types): |
| 443 | kb.os = os.capitalize() |
| 444 | |
| 445 | return kb.os |
| 446 | |
| 447 | @staticmethod |
| 448 | def setOsVersion(version): |
no test coverage detected