From dc2ac46fd4d1003c20504e17e097e2570ef3a7d8 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Mon, 31 Mar 2014 16:06:41 -0400 Subject: [PATCH] Update to latest ncmlib and remove some dead preprocessor defines. --- Makefile | 2 +- ndhc/ndhc.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e8a065b..4d179b3 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ OBJ_DIR = $(BUILD_DIR)/objs CC = gcc AR = ar RANLIB = ranlib -CFLAGS = -O2 -s -std=gnu99 -pedantic -Wall -D_GNU_SOURCE -DHAVE_CLEARENV -DLINUX +CFLAGS = -O2 -s -std=gnu99 -pedantic -Wall -D_GNU_SOURCE all: makedir ifchd-parse.o ncmlib.a ndhc diff --git a/ndhc/ndhc.c b/ndhc/ndhc.c index 74e9b93..8421ece 100644 --- a/ndhc/ndhc.c +++ b/ndhc/ndhc.c @@ -471,10 +471,12 @@ int main(int argc, char **argv) cs.clientAddr = inet_addr(optarg); break; case 'u': - ndhc_uid = nk_uidgidbyname(optarg, &ndhc_gid); + if (nk_uidgidbyname(optarg, &ndhc_uid, &ndhc_gid)) + suicide("invalid ndhc user '%s' specified", optarg); break; case 'U': - ifch_uid = nk_uidgidbyname(optarg, &ifch_gid); + if (nk_uidgidbyname(optarg, &ifch_uid, &ifch_gid)) + suicide("invalid ifch user '%s' specified", optarg); break; case 'C': copy_cmdarg(chroot_dir, optarg, sizeof chroot_dir, "chroot");