X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=66770a5918606578c9e7b6e10cb4d19b7dc9d13d;hb=b2d5027dd8d1f5dcabf4411b30884e6ab8c44240;hp=6fd750f3ebfd489eb9a2664b015c02a32920ec46;hpb=db6112a8290cd07569d1c34237a50a17668c68f3;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 6fd750f..66770a5 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: options.c,v 1.67 1999/11/15 01:51:52 paulus Exp $" +#define RCSID "$Id: options.c,v 1.68 1999/11/15 03:55:37 paulus Exp $" #include #include @@ -1523,7 +1523,9 @@ setlogfile(argv) if (!privileged_option) seteuid(getuid()); - fd = open(*argv, O_WRONLY | O_APPEND); + fd = open(*argv, O_WRONLY | O_APPEND | O_CREAT | O_EXCL, 0644); + if (fd < 0 && errno == EEXIST) + fd = open(*argv, O_WRONLY | O_APPEND); err = errno; if (!privileged_option) seteuid(0);