From: Andreas Dilger Date: Thu, 2 Feb 2017 05:55:15 +0000 (-0700) Subject: LU-9073 gss: quiet insecure key file warning X-Git-Tag: 2.9.53~9 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=b5c4f0305323a44c38357420e1ee84dd343f4875;p=fs%2Flustre-release.git LU-9073 gss: quiet insecure key file warning Quiet spurious warning about insecure file access mode, because the st_mode contains file type as well. Signed-off-by: Andreas Dilger Change-Id: If347eb3de67074269de4fe279ba4a849e03ebbe5 Reviewed-on: https://review.whamcloud.com/25201 Tested-by: Jenkins Reviewed-by: Nathan Lavender Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/gss/sk_utils.c b/lustre/utils/gss/sk_utils.c index 8b7aecf..a0d71ac 100644 --- a/lustre/utils/gss/sk_utils.c +++ b/lustre/utils/gss/sk_utils.c @@ -124,7 +124,7 @@ struct sk_keyfile_config *sk_read_file(char *filename) struct stat st; rc = fstat(fd, &st); - if (rc == 0 && (st.st_mode & ~0600)) + if (rc == 0 && (st.st_mode & ~(S_IFREG | 0600))) fprintf(stderr, "warning: " "secret key '%s' has insecure file mode %#o\n", filename, st.st_mode);