27639a
Index: pptpsetup
27639a
===================================================================
27639a
RCS file: /cvsroot/pptpclient/pptp-linux/pptpsetup,v
27639a
retrieving revision 1.4
27639a
diff -u -r1.4 pptpsetup
27639a
--- pptpsetup	2 Aug 2006 07:02:47 -0000	1.4
27639a
+++ pptpsetup	25 Mar 2009 13:41:37 -0000
27639a
@@ -154,6 +154,7 @@
27639a
 
27639a
     # delete entry from chap-secrets
27639a
     my $chap_file = '/etc/ppp/chap-secrets';
27639a
+    my $mode = (stat($chap_file))[2] & 07777;
27639a
 
27639a
     open( FILE, $chap_file )
27639a
         or die "$0: can't read '$chap_file': $!\n";
27639a
@@ -171,6 +172,7 @@
27639a
     # write new chap-secrets
27639a
     open( FILE, ">$chap_file" )
27639a
         or die "$0: can't write '$chap_file': $!\n";
27639a
+    chmod $mode, $chap_file;
27639a
     print FILE $new_chap;
27639a
     close FILE;
27639a