Skip to content

Commit b65c176

Browse files
pdelagravestamparm
andauthored
Fixed hanging on stdin in API mode. (sqlmapproject#4657)
Fixed regression introduced in 1.4.11 Co-authored-by: Miroslav Stampar <miroslav@sqlmap.org>
1 parent aec527d commit b65c176

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/parse/cmdline.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,10 +1057,12 @@ def _format_action_invocation(self, action):
10571057
if args.dummy:
10581058
args.url = args.url or DUMMY_URL
10591059

1060-
if hasattr(sys.stdin, "fileno") and not os.isatty(sys.stdin.fileno()) and '-' not in sys.argv and "GITHUB_ACTIONS" not in os.environ:
1061-
args.stdinPipe = iter(sys.stdin.readline, None)
1062-
else:
1063-
args.stdinPipe = None
1060+
args.stdinPipe = None
1061+
if hasattr(sys.stdin, "fileno") and not os.isatty(sys.stdin.fileno()) and '-' not in sys.argv:
1062+
if args.api:
1063+
logger.info("Ignoring STDIN in API mode")
1064+
else:
1065+
args.stdinPipe = iter(sys.stdin.readline, None)
10641066

10651067
if not any((args.direct, args.url, args.logFile, args.bulkFile, args.googleDork, args.configFile, args.requestFile, args.updateAll, args.smokeTest, args.vulnTest, args.wizard, args.dependencies, args.purge, args.listTampers, args.hashFile, args.stdinPipe)):
10661068
errMsg = "missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, --wizard, --shell, --update, --purge, --list-tampers or --dependencies). "

0 commit comments

Comments
 (0)