aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-12-08 18:29:38 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-12-08 18:29:38 +0000
commitc959fc742eb10c516261765718a761536b0b8f4a (patch)
tree6cc92545c1c6df6338ad6ab07b6619e094e36f93 /misc.c
parentFixed some gcc 4 warnings in misc.c. (diff)
downloadopenvpn-c959fc742eb10c516261765718a761536b0b8f4a.tar.xz
Inline file capability now works for
--secret and --tls-auth. For example: <secret> [ascii key data] </secret> git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@844 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/misc.c b/misc.c
index 349a608..6184208 100644
--- a/misc.c
+++ b/misc.c
@@ -433,15 +433,20 @@ void
warn_if_group_others_accessible (const char* filename)
{
#ifdef HAVE_STAT
- struct stat st;
- if (stat (filename, &st))
- {
- msg (M_WARN | M_ERRNO, "WARNING: cannot stat file '%s'", filename);
- }
- else
+#if ENABLE_INLINE_FILES
+ if (strcmp (filename, INLINE_FILE_TAG))
+#endif
{
- if (st.st_mode & (S_IRWXG|S_IRWXO))
- msg (M_WARN, "WARNING: file '%s' is group or others accessible", filename);
+ struct stat st;
+ if (stat (filename, &st))
+ {
+ msg (M_WARN | M_ERRNO, "WARNING: cannot stat file '%s'", filename);
+ }
+ else
+ {
+ if (st.st_mode & (S_IRWXG|S_IRWXO))
+ msg (M_WARN, "WARNING: file '%s' is group or others accessible", filename);
+ }
}
#endif
}