summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/auth/factotum/fgui.c8
1 files 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: