~bpv/finger

f34db9e35bbbcab00c9c354b044afb6a067c283c — Bryce Vandegrift a month ago 817d1cc master v0.6
Add OpenBSD pledge support and bump to 0.6

Added OpenBSD pledges and added flags for building on other BSD systems.
Bumped to version 0.6
3 files changed, 14 insertions(+), 2 deletions(-)

M config.mk
M finger.c
M fingerd.c
M config.mk => config.mk +2 -2
@@ 1,12 1,12 @@
# finger and fingerd version
VERSION = 0.5
VERSION = 0.6

# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man

# flags
CPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DVERSION=\"${VERSION}\"
CPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" -D__BSD_VISIBLE -D_BSD_SOURCE
#CFLAGS = -std=c89 -pedantic -Wall -Wextra -g ${CPPFLAGS}
CFLAGS = -std=c89 -pedantic -Wall -Wextra -Os ${CPPFLAGS}


M finger.c => finger.c +6 -0
@@ 78,6 78,12 @@ main(int argc, char *argv[])
		}
	}

#ifdef __OpenBSD__
	if (pledge("stdio inet unix dns", NULL) == -1) {
		die("pledge");
	}
#endif /* __OpenBSD__ */

	srv = fdopen(dial(host, port), "r+");
	if (!srv) {
		die("fdopen:");

M fingerd.c => fingerd.c +6 -0
@@ 167,6 167,12 @@ int main(int argc, char *argv[])
		}
	}

#ifdef __OpenBSD__
	if (pledge("stdio rpath inet unix dns getpw proc", NULL) == -1) {
		die("pledge");
	}
#endif /* __OpenBSD__ */

	/* Ignore child exit signal */
	if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
		die("could not ignore SIGCHLD");