Migrated to SQLite (patching race condition vuln)

This commit is contained in:
rail5 2020-12-30 10:31:45 +00:00 committed by GitHub
parent 268a933cfb
commit 91cccef316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,8 @@ function seconduser(checkE) {
<?php
require('functions.global.php');
if ($_POST['formsubmitted'] == "true") {
if (strlen($_POST['username']) < 3 || strlen($_POST['password']) < 3) {
die('Error: Use a username/password of at least 3 characters');
@ -73,7 +75,18 @@ if ($_POST['formsubmitted'] == "true") {
}
fwrite($myfile, "?>".PHP_EOL);
echo '<br>Created. I mean, check config.global.php to make sure, but then delete this file ASAP.';
echo '<br>User(s) created. I mean, check config.global.php to make sure, but then delete this file ASAP.';
if (!file_exists("./filedb.sqlite")) {
touch("./filedb.sqlite");
$initializeDB = contactDB("CREATE TABLE files (
fileid int NOT NULL PRIMARY KEY,
filepath varchar(255) NOT NULL,
fileowner varchar(255) NOT NULL
);", 0);
echo '<br>Initialized file database';
}
}
@ -81,4 +94,4 @@ if ($_POST['formsubmitted'] == "true") {
</div>
</body>
</html>
</html>