From: John Hodge Date: Sat, 19 Feb 2011 10:03:36 +0000 (+0800) Subject: Fixed bug with llogin args X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=2263a6c4b7df73a8c5ac6968f0bb180ac5f7fb0e;p=tpg%2Fopendispense2.git Fixed bug with llogin args --- diff --git a/src/server/handler_door.c b/src/server/handler_door.c index b2c6c2b..69c5bce 100644 --- a/src/server/handler_door.c +++ b/src/server/handler_door.c @@ -84,7 +84,6 @@ int Door_CanDispense(int User, int Item) int Door_DoDispense(int User, int Item) { FILE *child_stdin; - char buf[512]; int stdin_pair[2]; int stdout_pair[2]; pid_t childPid; @@ -132,7 +131,7 @@ int Door_DoDispense(int User, int Item) close(stdout_pair[0]); dup2(stdout_pair[1], 1); //execl("/bin/sh", "sh", "-c", "llogin door -w-", NULL); - execl("/usr/bin/llogin", "llogin" "door" "-w-", NULL); + execl("/usr/bin/llogin", "llogin", "door", "-w-", NULL); perror("execl"); exit(-1); } @@ -142,8 +141,9 @@ int Door_DoDispense(int User, int Item) close(stdout_pair[1]); // child stdout write { + char buf[1024]; int len; - if( giDoor_ChildStatus || (len = read(stdout_pair[0], buf, 512)) < 0) + if( giDoor_ChildStatus || (len = read(stdout_pair[0], buf, sizeof buf)) < 0) { #if DEBUG int child_exit;