Skip to content

Commit 2de890b

Browse files
author
gluafamichl
committed
Mod: set DB fields and frontend fields for attackCmd to the same value (65535 => text field in DB)
1 parent 6d31a9f commit 2de890b

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/dba/models/HealthCheck.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static function getFeatures() {
4646
$dict['hashtypeId'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "hashtypeId"];
4747
$dict['crackerBinaryId'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "crackerBinaryId"];
4848
$dict['expectedCracks'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => True, "private" => False, "alias" => "expectedCracks"];
49-
$dict['attackCmd'] = ['read_only' => True, "type" => "str(16384)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => True, "private" => False, "alias" => "attackCmd"];
49+
$dict['attackCmd'] = ['read_only' => True, "type" => "str(65535)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => True, "private" => False, "alias" => "attackCmd"];
5050

5151
return $dict;
5252
}

src/dba/models/Pretask.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static function getFeatures() {
5656
$dict = array();
5757
$dict['pretaskId'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => True, "protected" => True, "private" => False, "alias" => "pretaskId"];
5858
$dict['taskName'] = ['read_only' => False, "type" => "str(100)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "taskName"];
59-
$dict['attackCmd'] = ['read_only' => False, "type" => "str(16384)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "attackCmd"];
59+
$dict['attackCmd'] = ['read_only' => False, "type" => "str(65535)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "attackCmd"];
6060
$dict['chunkTime'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "chunkTime"];
6161
$dict['statusTimer'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "statusTimer"];
6262
$dict['color'] = ['read_only' => False, "type" => "str(20)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "color"];

src/dba/models/Task.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static function getFeatures() {
8989
$dict = array();
9090
$dict['taskId'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => True, "protected" => True, "private" => False, "alias" => "taskId"];
9191
$dict['taskName'] = ['read_only' => False, "type" => "str(256)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "taskName"];
92-
$dict['attackCmd'] = ['read_only' => False, "type" => "str(16384)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "attackCmd"];
92+
$dict['attackCmd'] = ['read_only' => False, "type" => "str(65535)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "attackCmd"];
9393
$dict['chunkTime'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "chunkTime"];
9494
$dict['statusTimer'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "statusTimer"];
9595
$dict['keyspace'] = ['read_only' => True, "type" => "int64", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => True, "private" => False, "alias" => "keyspace"];

src/dba/models/generator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
['name' => 'hashtypeId', 'read_only' => False, 'type' => 'int'],
268268
['name' => 'crackerBinaryId', 'read_only' => False, 'type' => 'int'],
269269
['name' => 'expectedCracks', 'read_only' => True, 'type' => 'int', 'protected' => True],
270-
['name' => 'attackCmd', 'read_only' => True, 'type' => 'str(16384)', 'protected' => True],
270+
['name' => 'attackCmd', 'read_only' => True, 'type' => 'str(65535)', 'protected' => True],
271271
],
272272
];
273273
$CONF['HealthCheckAgent'] = [
@@ -319,7 +319,7 @@
319319
'columns' => [
320320
['name' => 'pretaskId', 'read_only' => True, 'type' => 'int', 'protected' => True],
321321
['name' => 'taskName', 'read_only' => False, 'type' => 'str(100)'],
322-
['name' => 'attackCmd', 'read_only' => False, 'type' => 'str(16384)'],
322+
['name' => 'attackCmd', 'read_only' => False, 'type' => 'str(65535)'],
323323
['name' => 'chunkTime', 'read_only' => False, 'type' => 'int'],
324324
['name' => 'statusTimer', 'read_only' => False, 'type' => 'int'],
325325
['name' => 'color', 'read_only' => False, 'type' => 'str(20)'],
@@ -382,7 +382,7 @@
382382
'columns' => [
383383
['name' => 'taskId', 'read_only' => True, 'type' => 'int', 'protected' => True],
384384
['name' => 'taskName', 'read_only' => False, 'type' => 'str(256)'],
385-
['name' => 'attackCmd', 'read_only' => False, 'type' => 'str(16384)'],
385+
['name' => 'attackCmd', 'read_only' => False, 'type' => 'str(65535)'],
386386
['name' => 'chunkTime', 'read_only' => False, 'type' => 'int'],
387387
['name' => 'statusTimer', 'read_only' => False, 'type' => 'int'],
388388
['name' => 'keyspace', 'read_only' => True, 'type' => 'int64', 'protected' => True],

src/inc/utils/PretaskUtils.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ public static function createPretask($name, $cmdLine, $chunkTime, $statusTimer,
305305
else if (strpos($cmdLine, SConfig::getInstance()->getVal(DConfig::HASHLIST_ALIAS)) === false) {
306306
throw new HTException("The attack command does not contain the hashlist alias!");
307307
}
308-
else if (strlen($cmdLine) > 16384) {
309-
throw new HTException("Attack command is too long (max 16384 characters)!");
308+
else if (strlen($cmdLine) > 65535) {
309+
throw new HTException("Attack command is too long (max 65535 characters)!");
310310
}
311311
else if (Util::containsBlacklistedChars($cmdLine)) {
312312
throw new HTException("The command must contain no blacklisted characters!");

src/inc/utils/TaskUtils.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ public static function createTask($hashlistId, $name, $attackCmd, $chunkTime, $s
763763
else if (strpos($attackCmd, SConfig::getInstance()->getVal(DConfig::HASHLIST_ALIAS)) === false) {
764764
throw new HTException("Attack command does not contain hashlist alias!");
765765
}
766-
else if (strlen($attackCmd) > 16384) {
767-
throw new HTException("Attack command is too long (max 16384 characters)!");
766+
else if (strlen($attackCmd) > 65535) {
767+
throw new HTException("Attack command is too long (max 65535 characters)!");
768768
}
769769
else if ($staticChunking < DTaskStaticChunking::NORMAL || $staticChunking > DTaskStaticChunking::NUM_CHUNKS) {
770770
throw new HTException("Invalid static chunk setting!");

0 commit comments

Comments
 (0)