aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlogin (tilde.institute) <login@tilde.institute>2020-07-14 14:55:04 -0400
committerlogin (tilde.institute) <login@tilde.institute>2020-07-14 14:55:04 -0400
commit08783c2043ba8cf9837267905a32e515a4300c2e (patch)
tree4dfb33fe078f172f4327e95f2a6eaf9b72b504f5
parentb73e169b72daff3f1edf991cd6e0613f44d6f3c4 (diff)
downloadtcoin-08783c2043ba8cf9837267905a32e515a4300c2e.tar.gz
Updated tcoin.cpp and pcoin.cpp
1. Removed unneeded WHOAMI_PATH preprocessor constant from pcoin.cpp. 2. Updated WHOAMI_PATH for tilde.institute to use "id -ru" to get the real uid on OpenBSD (/usr/bin/whoami doesn't get the real username on OpenBSD).
-rw-r--r--10
-rw-r--r--pcoin.cpp1
-rw-r--r--tcoin.cpp8
3 files changed, 6 insertions, 3 deletions
diff --git a/1 b/1
deleted file mode 100644
index e69de29..0000000
--- a/1
+++ /dev/null
diff --git a/pcoin.cpp b/pcoin.cpp
index d421c76..526c70e 100644
--- a/pcoin.cpp
+++ b/pcoin.cpp
@@ -43,7 +43,6 @@
#ifndef KROWBAR_OFF
#define KROWBAR_SCORE_PATH "/home/krowbar/Code/irc/data/tildescores.txt"
#endif
-#define WHOAMI_PATH "/usr/bin/whoami"
#ifndef DA_OFF
#define TROIDO_DACOINS_CMD "cd /home/troido/daily_adventure/client/ && /home/troido/daily_adventure/client/daclient printinfo 2>&1 | /bin/grep -oP '(?<=\"Coins\", )\[[:digit:]]+'"
#endif
diff --git a/tcoin.cpp b/tcoin.cpp
index b9963d8..5c9226e 100644
--- a/tcoin.cpp
+++ b/tcoin.cpp
@@ -38,7 +38,11 @@
#ifndef KROWBAR_OFF
#define KROWBAR_SCORE_PATH "/home/krowbar/Code/irc/data/tildescores.txt"
#endif
-#define WHOAMI_PATH "/usr/bin/whoami"
+#ifndef TILDEINSTITUTE
+ #define WHOAMI_PATH "/usr/bin/whoami"
+#else
+ #define WHOAMI_PATH "/usr/bin/getent passwd $(/usr/bin/id -ru) | /usr/bin/cut -d: -f1"
+#endif
#ifndef DA_OFF
#define TROIDO_DACOINS_CMD "cd /home/troido/daily_adventure/client/ && /home/troido/daily_adventure/client/daclient printinfo 2>&1 | /bin/grep -oP '(?<=\"Coins\", )[[:digit:]]+'"
#endif
@@ -1543,7 +1547,7 @@ int main(int argc, char *argv[])
{
std::string salt_file = std::string(TCOIN_SALT_PATH) + get_username() + std::string("_salt.txt");
std::string password_file = std::string(TCOIN_PASS_PATH) + get_username() + std::string("_password.txt");
- execl(TCOIN_SCRYPT_PATH, "scrypt", "enc", salt_file.c_str(), password_file.c_str(), NULL);
+ execl(TCOIN_SCRYPT_PATH, "scrypt", "enc", "-m", "0.25", "-t", "10", salt_file.c_str(), password_file.c_str(), NULL);
}
if(argc==2 && !strctcmp(argv[1], code2))
{