From 91b12918a968c04de119d2193a966ca0f1ea1c9f Mon Sep 17 00:00:00 2001 From: Yargo Date: Wed, 8 May 2019 16:38:00 +0000 Subject: add LICENSE and telem.c to repo --- LICENSE | 25 +++++++++++++++++++++++++ telem.c | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 LICENSE create mode 100644 telem.c diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..96ac3d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2018, Solderpunk and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/telem.c b/telem.c new file mode 100644 index 0000000..a57a189 --- /dev/null +++ b/telem.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +int main() { + struct passwd *pw; + uid_t uid; + char username[32]; + char command[128]; + + uid = getuid(); + pw = getpwuid(uid); + + if(strcmp(pw->pw_name, "krixano") == 0) { + printf("Sorry, krixano, no BBS for you!"); + exit(1); + } + + if (pw) { + strncpy(command, "/usr/bin/lua /usr/local/src/telem/telem.lua ", 127); + strncat(command, pw->pw_name, 127); + system(command); + } +} -- cgit v1.2.3