Compare commits
No commits in common. "mistress" and "v1.1" have entirely different histories.
4 changed files with 14 additions and 46 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
/kissy
|
|
||||||
19
Makefile
19
Makefile
|
|
@ -1,19 +0,0 @@
|
||||||
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
|
|
||||||
|
|
@ -7,8 +7,6 @@ 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 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)
|
- 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:
|
### Usage:
|
||||||
`kissy [target] <message>`
|
`kissy [target] <message>`
|
||||||
|
|
||||||
|
|
|
||||||
32
kissy.c
32
kissy.c
|
|
@ -1,4 +1,4 @@
|
||||||
// KISSY (Kissing Interface for Sapphic Smooching over ttY) v1.2
|
// KISSY (Kissing Interface for Sapphic Smooching over ttY) v1.1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2025 Magdalunaa <magdalunaa@linuxposting.xyz>
|
Copyright (C) 2025 Magdalunaa <magdalunaa@linuxposting.xyz>
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
// mreowww meow nya :3
|
// mreowww meow nya :3
|
||||||
|
|
||||||
|
|
@ -54,7 +53,7 @@ int main (int argc, char **argv) {
|
||||||
printf("%s\n", "Cannot find target");
|
printf("%s\n", "Cannot find target");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
uid_t target = pw->pw_uid;
|
int target = pw->pw_uid;
|
||||||
|
|
||||||
// get current username
|
// get current username
|
||||||
struct passwd *pw2 = getpwuid(getuid());
|
struct passwd *pw2 = getpwuid(getuid());
|
||||||
|
|
@ -65,26 +64,17 @@ int main (int argc, char **argv) {
|
||||||
char* user = pw2->pw_name;
|
char* user = pw2->pw_name;
|
||||||
|
|
||||||
// if we have a second argument, set a custom kiss message
|
// if we have a second argument, set a custom kiss message
|
||||||
char kiss[32] = "*mwah*";
|
char* kiss;
|
||||||
if (argc >= 3) {
|
if (argc >= 3)
|
||||||
int len = strlen(argv[2]);
|
kiss = argv[2];
|
||||||
int written_chars = 0;
|
else
|
||||||
for (int i = 0; i < len; i++) {
|
kiss = "*mwah*";
|
||||||
if (written_chars >= 31) {
|
|
||||||
kiss[31] = '\0';
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
if (iscntrl(argv[2][i])) continue;
|
|
||||||
kiss[i] = argv[2][i];
|
|
||||||
written_chars++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool kissed = false;
|
bool kissed = false;
|
||||||
// iterate over all files in directory
|
// iterate over all files in directory
|
||||||
DIR *dir = opendir("/dev/pts");
|
DIR *dir = opendir("/dev/pts");
|
||||||
while (1) {
|
while (1) {
|
||||||
struct dirent *ent = readdir(dir);
|
struct dirent *ent = readdir (dir);
|
||||||
if (ent == NULL)
|
if (ent == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -100,10 +90,10 @@ int main (int argc, char **argv) {
|
||||||
kissed = true;
|
kissed = true;
|
||||||
|
|
||||||
if (stats.st_gid != getegid()) { // are we running as the tty user?
|
if (stats.st_gid != getegid()) { // are we running as the tty user?
|
||||||
fprintf(stderr, "%s\n", "Mismatch between file owner group and current effective group. Make sure this program is running with setgid.");
|
printf("%s\n", "Mismatch between file owner group and current effective group. Make sure this program is running with setgid.");
|
||||||
} else {
|
} else {
|
||||||
FILE *tty = fopen(filepath, "a"); // write to terminal!
|
FILE *tty = fopen(filepath, "a"); // write to terminal!
|
||||||
fprintf(tty, "\a\n%s\n--%s\n", kiss, user);
|
fprintf(tty, "\n%s\n--%s\n", kiss, user);
|
||||||
fclose(tty);
|
fclose(tty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -111,5 +101,5 @@ int main (int argc, char **argv) {
|
||||||
|
|
||||||
// print a message if a suitable terminal couldn't be found
|
// print a message if a suitable terminal couldn't be found
|
||||||
if (!kissed)
|
if (!kissed)
|
||||||
fprintf(stderr, "%s\n", "Couldn't find any suitable terminals. User is not logged in or has not enabled messages.");
|
printf("%s\n", "Couldn't find any suitable terminals. User is not logged in or has not enabled messages.");
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue