All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] srp_daemon: Avoid extra permissions for the lock file
@ 2020-09-16  5:51 Sergey Gorenko
  0 siblings, 0 replies; only message in thread
From: Sergey Gorenko @ 2020-09-16  5:51 UTC (permalink / raw)
  To: linux-rdma; +Cc: Sergey Gorenko, Max Gurtovoy, Bart Van Assche

There is no need to create a world-writable lock file.
It's enough to have an RW permission for the file owner only.

Fixes: ee138ce1e40d ("Cause srp_daemon launch to fail if another srp_daemon is already working on the same HCA port.")
Signed-off-by: Sergey Gorenko <sergeygo@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
Changelog:
v1: Add the fixes line.
---
 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-16  6:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  5:51 [PATCH v1] srp_daemon: Avoid extra permissions for the lock file Sergey Gorenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.