From 29c5cba17e73baa8a44bf51d6ee22cc5b31a9ad0 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Tue, 7 Jul 1998 23:37:34 +0000 Subject: [PATCH] (main): create place-holder ticket file with open(O_EXCL | O_CREAT) instead of creat git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5065 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/xnlock/xnlock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index 4f699d361..5501289b7 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -975,8 +975,13 @@ main (int argc, char **argv) if (appres.destroytickets) { #ifdef KRB4 + int fd; + dest_tkt(); /* Nuke old ticket file */ - creat(TKT_FILE, 0600); /* but keep a place holder */ + /* but keep a place holder */ + fd = open (TKT_FILE, O_WRONLY | O_CREAT | O_EXCL, 0600); + if (fd >= 0) + close (fd); #endif }