]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/radattr.c
Merge pull request #362 from enaess/ppp-crypto
[ppp.git] / pppd / plugins / radius / radattr.c
index 1dee313bc1cb04a84b46e4f09d86ec6735a3518e..16f7fba0f1b1680bf986971ee9818291dd50367c 100644 (file)
 static char const RCSID[] =
 "$Id: radattr.c,v 1.2 2004/10/28 00:24:40 paulus Exp $";
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <stdio.h>
+#include <sys/stat.h>
+#include <pppd/pppd.h>
 
-#include "pppd.h"
 #include "radiusclient.h"
-#include <stdio.h>
 
 extern void (*radius_attributes_hook)(VALUE_PAIR *);
 static void print_attributes(VALUE_PAIR *);
 static void cleanup(void *opaque, int arg);
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 /**********************************************************************
 * %FUNCTION: plugin_init
@@ -75,9 +73,12 @@ print_attributes(VALUE_PAIR *vp)
     char name[2048];
     char value[2048];
     int cnt = 0;
+    mode_t old_umask;
 
     slprintf(fname, sizeof(fname), "/var/run/radattr.%s", ifname);
+    old_umask = umask(077);
     fp = fopen(fname, "w");
+    umask(old_umask);
     if (!fp) {
        warn("radattr plugin: Could not open %s for writing: %m", fname);
        return;