From e1bc28d1ddaf6bcfb35ea302beefaf5df09aa342 Mon Sep 17 00:00:00 2001 From: ppatience0 Date: Sat, 1 Jun 2013 19:40:38 -0400 Subject: fgui: check if fd is valid before entering new key --- sys/src/cmd/auth/factotum/fgui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/src/cmd/auth/factotum/fgui.c b/sys/src/cmd/auth/factotum/fgui.c index f4a9f2826..ce372e864 100644 --- a/sys/src/cmd/auth/factotum/fgui.c +++ b/sys/src/cmd/auth/factotum/fgui.c @@ -792,10 +792,12 @@ needkey(Request *r) entry[i].a->type = AttrNameval; } - /* enter the new key !!!!need to do something in case of error!!!! */ + /* enter the new key */ fd = open("/mnt/factotum/ctl", OWRITE); - fprint(fd, "key %A", r->a); - close(fd); + if(fd >= 0){ + fprint(fd, "key %A", r->a); + close(fd); + } teardownneedkey(r); out: -- cgit v1.2.3