Compare commits

...

3 commits
obsd ... 0.6.4

Author SHA1 Message Date
Kenny Levinsen
df13d03f9c Bump version to 0.6.4 2022-02-21 22:52:04 +01:00
Kenny Levinsen
615c10c75d seatd-launch: Use snprintf for socket path
We also reduce the size of the buffer from 256 bytes to a much more
reasonable 32 bytes.
2022-02-21 22:52:04 +01:00
Kenny Levinsen
7cffe0797f seatd-launch: Remove socket path command line arg
This should not need to be configured, so remove the argument. If
downstream prefers a different folder, the location can be made
compile-time configurable like for seatd itself.
2022-02-21 22:52:04 +01:00
2 changed files with 6 additions and 14 deletions

View file

@ -1,7 +1,7 @@
project( project(
'seatd', 'seatd',
'c', 'c',
version: '0.6.3', version: '0.6.4',
license: 'MIT', license: 'MIT',
meson_version: '>=0.56.0', meson_version: '>=0.56.0',
default_options: [ default_options: [

View file

@ -15,18 +15,13 @@ int main(int argc, char *argv[]) {
const char *usage = "Usage: seatd-launch [options] [--] command\n" const char *usage = "Usage: seatd-launch [options] [--] command\n"
"\n" "\n"
" -h Show this help message\n" " -h Show this help message\n"
" -s <path> Where to create the seatd socket\n" " -v Show the version number\n"
" -v Show the version number\n"
"\n"; "\n";
int c; int c;
char *sockpath = NULL; while ((c = getopt(argc, argv, "vh")) != -1) {
while ((c = getopt(argc, argv, "vhs:")) != -1) {
switch (c) { switch (c) {
case 's':
sockpath = optarg;
break;
case 'v': case 'v':
printf("seatd-launch version %s\n", SEATD_VERSION); printf("seatd-launch version %s\n", SEATD_VERSION);
return 0; return 0;
@ -47,11 +42,8 @@ int main(int argc, char *argv[]) {
} }
char **command = &argv[optind]; char **command = &argv[optind];
char sockbuf[256]; char sockpath[32];
if (sockpath == NULL) { snprintf(sockpath, sizeof sockpath, "/tmp/seatd.%d.sock", getpid());
sprintf(sockbuf, "/tmp/seatd.%d.sock", getpid());
sockpath = sockbuf;
}
unlink(sockpath); unlink(sockpath);