This commit is contained in:
2024-05-03 18:47:37 +08:00
parent ad78dad7c7
commit c1b00bb9f1
5 changed files with 77 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ namespace hpcstat
process = std::make_unique<bp::child>
(program.string(), bp::args(args), bp::std_out > output, bp::std_err > stderr, bp::std_in < input);
input << *stdin;
input.close();
input.pipe().close();
}
else process = std::make_unique<bp::child>
(program.string(), bp::args(args), bp::std_out > output, bp::std_err > stderr, bp::std_in < bp::null);

View File

@@ -34,7 +34,7 @@ int main(int argc, const char** argv)
if (!signature) return 1;
data.Signature = *signature;
sql::writedb(data);
std::cout << fmt::format("\33[2K\rLogged in as {}.\n", *fp);
std::cout << fmt::format("\33[2K\rLogged in as {}.\n", Keys[*fp].Username);
}
}
else if (args[1] == "logout")

View File

@@ -47,7 +47,7 @@ namespace hpcstat::ssh
(
std::filesystem::path(*datadir) / "ssh-keygen",
{
"-Y", "sign",
"-Y", "sign", "-q",
"-f", fmt::format("{}/keys/{}", *datadir, Keys[fingerprint].PubkeyFilename),
"-n", "hpcstat@chn.moe", "-"
},