From: Sergey Gorenko <sergeygo@nvidia.com>
To: bvanassche@acm.org
Cc: linux-rdma@vger.kernel.org, Sergey Gorenko <sergeygo@nvidia.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: [PATCH] srp_daemon: Avoid extra permissions for the lock file
Date: Wed, 19 Aug 2020 14:17:45 +0000 [thread overview]
Message-ID: <20200819141745.11005-1-sergeygo@nvidia.com> (raw)
There is no need to create a world-writable lock file.
It's enough to have an RW permission for the file owner only.
Signed-off-by: Sergey Gorenko <sergeygo@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
srp_daemon/srp_daemon.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index f14d9f56c9f2..fcf94537cebb 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -142,7 +142,6 @@ static int check_process_uniqueness(struct config_t *conf)
return -1;
}
- fchmod(fd, S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR|S_IWGRP|S_IWOTH);
if (0 != lockf(fd, F_TLOCK, 0)) {
pr_err("failed to lock %s (errno: %d). possibly another "
"srp_daemon is locking it\n", path, errno);
--
2.21.1
next reply other threads:[~2020-08-19 14:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 14:17 Sergey Gorenko [this message]
2020-09-14 9:24 ` [PATCH] srp_daemon: Avoid extra permissions for the lock file Sergey Gorenko
2020-09-14 16:50 ` Bart Van Assche
2020-09-14 16:56 ` Bart Van Assche
2020-09-15 8:10 ` Sergey Gorenko
2020-09-15 20:32 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200819141745.11005-1-sergeygo@nvidia.com \
--to=sergeygo@nvidia.com \
--cc=bvanassche@acm.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mgurtovoy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).