clang lint
This commit is contained in:
@@ -499,13 +499,15 @@ void savePassword(resp_https_t response, req_https_t request) {
|
|||||||
if(newUsername.length() == 0) {
|
if(newUsername.length() == 0) {
|
||||||
outputTree.put("status", false);
|
outputTree.put("status", false);
|
||||||
outputTree.put("error", "Invalid Username");
|
outputTree.put("error", "Invalid Username");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string();
|
auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string();
|
||||||
if(config::sunshine.username.empty() || (username == config::sunshine.username && hash == config::sunshine.password)) {
|
if(config::sunshine.username.empty() || (username == config::sunshine.username && hash == config::sunshine.password)) {
|
||||||
if(newPassword.empty() || newPassword != confirmPassword) {
|
if(newPassword.empty() || newPassword != confirmPassword) {
|
||||||
outputTree.put("status", false);
|
outputTree.put("status", false);
|
||||||
outputTree.put("error", "Password Mismatch");
|
outputTree.put("error", "Password Mismatch");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
http::save_user_creds(config::sunshine.credentials_file, newUsername, newPassword);
|
http::save_user_creds(config::sunshine.credentials_file, newUsername, newPassword);
|
||||||
http::reload_user_creds(config::sunshine.credentials_file);
|
http::reload_user_creds(config::sunshine.credentials_file);
|
||||||
outputTree.put("status", true);
|
outputTree.put("status", true);
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ int init() {
|
|||||||
}
|
}
|
||||||
if(user_creds_exist(config::sunshine.credentials_file)) {
|
if(user_creds_exist(config::sunshine.credentials_file)) {
|
||||||
if(reload_user_creds(config::sunshine.credentials_file)) return -1;
|
if(reload_user_creds(config::sunshine.credentials_file)) return -1;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
BOOST_LOG(info) << "Open the Web UI to set your new username and password and getting started";
|
BOOST_LOG(info) << "Open the Web UI to set your new username and password and getting started";
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+1
-1
@@ -24,8 +24,8 @@
|
|||||||
#include "rtsp.h"
|
#include "rtsp.h"
|
||||||
#include "thread_pool.h"
|
#include "thread_pool.h"
|
||||||
#include "upnp.h"
|
#include "upnp.h"
|
||||||
#include "video.h"
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "video.h"
|
||||||
|
|
||||||
#include "platform/common.h"
|
#include "platform/common.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#ifndef SUNSHINE_WINDOWS_MISC_H
|
#ifndef SUNSHINE_WINDOWS_MISC_H
|
||||||
#define SUNSHINE_WINDOWS_MISC_H
|
#define SUNSHINE_WINDOWS_MISC_H
|
||||||
|
|
||||||
|
#include <string_view>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winnt.h>
|
#include <winnt.h>
|
||||||
#include <string_view>
|
|
||||||
|
|
||||||
namespace platf {
|
namespace platf {
|
||||||
void print_status(const std::string_view &prefix, HRESULT status);
|
void print_status(const std::string_view &prefix, HRESULT status);
|
||||||
HDESK syncThreadDesktop();
|
HDESK syncThreadDesktop();
|
||||||
}
|
} // namespace platf
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
@@ -112,9 +112,11 @@ int proc_t::execute(int app_id) {
|
|||||||
if(proc.cmd.empty()) {
|
if(proc.cmd.empty()) {
|
||||||
BOOST_LOG(debug) << "Executing [Desktop]"sv;
|
BOOST_LOG(debug) << "Executing [Desktop]"sv;
|
||||||
placebo = true;
|
placebo = true;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
boost::filesystem::path working_dir = proc.working_dir.empty() ?
|
boost::filesystem::path working_dir = proc.working_dir.empty() ?
|
||||||
boost::filesystem::path(proc.cmd).parent_path() : boost::filesystem::path(proc.working_dir);
|
boost::filesystem::path(proc.cmd).parent_path() :
|
||||||
|
boost::filesystem::path(proc.working_dir);
|
||||||
if(proc.output.empty() || proc.output == "null"sv) {
|
if(proc.output.empty() || proc.output == "null"sv) {
|
||||||
BOOST_LOG(info) << "Executing: ["sv << proc.cmd << ']';
|
BOOST_LOG(info) << "Executing: ["sv << proc.cmd << ']';
|
||||||
_process = bp::child(_process_handle, proc.cmd, _env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);
|
_process = bp::child(_process_handle, proc.cmd, _env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);
|
||||||
|
|||||||
Reference in New Issue
Block a user