From e856805464eb05eca5c9a8986d279345ccd30689 Mon Sep 17 00:00:00 2001 From: Magdalunaa Date: Mon, 17 Nov 2025 18:33:52 +0100 Subject: [PATCH 1/8] i guess it's better to recommend root:tty ownership --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8de72d9..bb715d1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Ever wanted to kiss girls through a tty? Well now you can! ### Installation: - download kissy from the releases page and place it in the system's path -- run `sudo chown :tty /path/to/kissy` (or whatever group it's supposed to be) +- run `sudo chown root:tty /path/to/kissy` (or whatever ownership it's supposed to have) - run `sudo chmod 2755 /path/to/kissy` (or whatever permissions work for you. has to run with setgid) ### Usage: From 419859a3660b17e4a5345fc7456f1d1b2f3fe6ee Mon Sep 17 00:00:00 2001 From: "Luna Magdalena :3" <3"@girlkissing.tips> Date: Mon, 17 Nov 2025 15:22:46 -0300 Subject: [PATCH 2/8] You can now do --help and -h. also they work better yay --- kissy.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/kissy.c b/kissy.c index 9d67a1e..5167a5b 100644 --- a/kissy.c +++ b/kissy.c @@ -1,4 +1,4 @@ -// KISSY (Kissing Interface for Sapphic Smooching over ttY) v1.0 +// KISSY (Kissing Interface for Sapphic Smooching over ttY) v1.1 /* Copyright (C) 2025 Magdalunaa @@ -17,17 +17,6 @@ along with this program. If not, see . */ -/* -This file needs to: -- be owned by the tty group (or whatever group owns the terminal devices in your system) -- have setgid set -- be group executable -- not be world writeable - -You can probably just use 2755 permissions. those work - -*/ - #include #include #include @@ -35,25 +24,29 @@ You can probably just use 2755 permissions. those work #include #include #include +#include // mreowww meow nya :3 int main (int argc, char **argv) { + + // print help + if (argc < 2 || strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0) { + printf("%s\n", "Usage: kissy [target] \n\n" + "Kissy is a utility that allows you to kiss currently logged in users who allow messages.\n" + "It works by writing to files in /dev/pts. It needs to run as the group who owns said files (usually tty), using setgid (2755 permissions)."); + return 0; + } + // are we running with setgid? struct stat stat_self; stat("/proc/self/exe", &stat_self); if (!(stat_self.st_mode & S_ISGID && !(stat_self.st_mode & S_IWOTH))) { - printf("%s\n", "setgid is not set, or this file is world writeable."); + printf("%s\n", "setgid is not set, or this file is world writable."); return 3; } - // check we have at least one argument - if (argc < 2) { - printf("%s\n", "Not enough arguments!\nUsage: kissy [target] "); - return 0; - } - // try to find the target's uid struct passwd *pw = getpwnam(argv[1]); if (pw == NULL) { @@ -77,7 +70,7 @@ int main (int argc, char **argv) { else kiss = "*mwah*"; - short kissed = 0; + bool kissed = false; // iterate over all files in directory DIR *dir = opendir("/dev/pts"); while (1) { @@ -94,7 +87,7 @@ int main (int argc, char **argv) { // find all terminals with the correct user and that are group-writable if (stats.st_mode & S_IWGRP && stats.st_uid == target) { - kissed = 1; + kissed = true; if (stats.st_gid != getegid()) { // are we running as the tty user? printf("%s\n", "Mismatch between file owner group and current effective group. Make sure this program is running with setgid."); From 703b2e661df27ba03cbf955f36f6da93d65b4263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C3=A6l=C5=8Drum=20spect=C4=81tr=C4=ABx?= Date: Mon, 17 Nov 2025 19:35:29 +0100 Subject: [PATCH 3/8] Add Makefile --- .gitignore | 1 + Makefile | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b86185 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/kissy diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b3fbc1e --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +CC := gcc +CFLAGS := -O2 -pipe -Wall -Wextra +INSTALL := install +PREFIX := /usr/local +BINDIR := bin + +.PHONY: all +all: kissy + +kissy: kissy.c + $(CC) $(CFLAGS) -o kissy kissy.c + +.PHONY: install +install: + $(INSTALL) -Dm2755 -oroot -gtty -s kissy $(DESTDIR)$(PREFIX)/$(BINDIR)/kissy + +.PHONY: clean +clean: + rm -f kissy From 54ef14ba940b2ee98843a73ef007015bc322f163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C3=A6l=C5=8Drum=20spect=C4=81tr=C4=ABx?= Date: Mon, 17 Nov 2025 19:38:33 +0100 Subject: [PATCH 4/8] Add make instructions to README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bb715d1..a052f0d 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Ever wanted to kiss girls through a tty? Well now you can! - run `sudo chown root:tty /path/to/kissy` (or whatever ownership it's supposed to have) - run `sudo chmod 2755 /path/to/kissy` (or whatever permissions work for you. has to run with setgid) +- alternatively, build kissy from source using `make` then `sudo make install` + ### Usage: `kissy [target] ` @@ -18,4 +20,4 @@ Have fun girlkissing! :3 ## License -This project is licensed with [GPLv3](https://www.gnu.org/licenses/gpl-3.0.txt) \ No newline at end of file +This project is licensed with [GPLv3](https://www.gnu.org/licenses/gpl-3.0.txt) From 8260b0af7f2872051b35437b4740b75ccc189c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?c=C3=A6l=C5=8Drum=20spect=C4=81tr=C4=ABx?= Date: Mon, 17 Nov 2025 19:43:01 +0100 Subject: [PATCH 5/8] Use uid_t to avoid signed comparison warning, output diagnostic messages to stderr --- kissy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kissy.c b/kissy.c index 5167a5b..4c7763d 100644 --- a/kissy.c +++ b/kissy.c @@ -53,7 +53,7 @@ int main (int argc, char **argv) { printf("%s\n", "Cannot find target"); return 1; } - int target = pw->pw_uid; + uid_t target = pw->pw_uid; // get current username struct passwd *pw2 = getpwuid(getuid()); @@ -74,7 +74,7 @@ int main (int argc, char **argv) { // iterate over all files in directory DIR *dir = opendir("/dev/pts"); while (1) { - struct dirent *ent = readdir (dir); + struct dirent *ent = readdir(dir); if (ent == NULL) break; @@ -90,7 +90,7 @@ int main (int argc, char **argv) { kissed = true; if (stats.st_gid != getegid()) { // are we running as the tty user? - printf("%s\n", "Mismatch between file owner group and current effective group. Make sure this program is running with setgid."); + fprintf(stderr, "%s\n", "Mismatch between file owner group and current effective group. Make sure this program is running with setgid."); } else { FILE *tty = fopen(filepath, "a"); // write to terminal! fprintf(tty, "\n%s\n--%s\n", kiss, user); @@ -101,5 +101,5 @@ int main (int argc, char **argv) { // print a message if a suitable terminal couldn't be found if (!kissed) - printf("%s\n", "Couldn't find any suitable terminals. User is not logged in or has not enabled messages."); -} \ No newline at end of file + fprintf(stderr, "%s\n", "Couldn't find any suitable terminals. User is not logged in or has not enabled messages."); +} From b30daa74690945e1128ca828d5c1a8af3473938a Mon Sep 17 00:00:00 2001 From: "Luna Magdalena :3" <3"@girlkissing.tips> Date: Tue, 18 Nov 2025 10:54:43 -0300 Subject: [PATCH 6/8] we beeping now --- kissy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kissy.c b/kissy.c index 4c7763d..856174c 100644 --- a/kissy.c +++ b/kissy.c @@ -93,7 +93,7 @@ int main (int argc, char **argv) { fprintf(stderr, "%s\n", "Mismatch between file owner group and current effective group. Make sure this program is running with setgid."); } else { FILE *tty = fopen(filepath, "a"); // write to terminal! - fprintf(tty, "\n%s\n--%s\n", kiss, user); + fprintf(tty, "\a\n%s\n--%s\n", kiss, user); fclose(tty); } } From 16f8d35c13c2a7a705b557f542fddc04fd986206 Mon Sep 17 00:00:00 2001 From: "Luna Magdalena :3" <3"@girlkissing.tips> Date: Tue, 18 Nov 2025 10:55:03 -0300 Subject: [PATCH 7/8] bump version number, we releasin' now babyyy --- kissy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kissy.c b/kissy.c index 856174c..8de9eee 100644 --- a/kissy.c +++ b/kissy.c @@ -1,4 +1,4 @@ -// KISSY (Kissing Interface for Sapphic Smooching over ttY) v1.1 +// KISSY (Kissing Interface for Sapphic Smooching over ttY) v1.2 /* Copyright (C) 2025 Magdalunaa From 9ad62f990ebc17c55ededd5da67d2617a1cdb128 Mon Sep 17 00:00:00 2001 From: veneficium Date: Tue, 3 Feb 2026 19:35:30 +0100 Subject: [PATCH 8/8] add control character sanitization --- kissy.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/kissy.c b/kissy.c index 8de9eee..87f5cd7 100644 --- a/kissy.c +++ b/kissy.c @@ -25,6 +25,7 @@ #include #include #include +#include // mreowww meow nya :3 @@ -64,12 +65,21 @@ int main (int argc, char **argv) { char* user = pw2->pw_name; // if we have a second argument, set a custom kiss message - char* kiss; - if (argc >= 3) - kiss = argv[2]; - else - kiss = "*mwah*"; - + char kiss[32] = "*mwah*"; + if (argc >= 3) { + int len = strlen(argv[2]); + int written_chars = 0; + for (int i = 0; i < len; i++) { + if (written_chars >= 31) { + kiss[31] = '\0'; + break; + }; + if (iscntrl(argv[2][i])) continue; + kiss[i] = argv[2][i]; + written_chars++; + } + } + bool kissed = false; // iterate over all files in directory DIR *dir = opendir("/dev/pts");