ublksrv_tgt: change default directory of pid file into /tmp/ublksrvd
Prepare for supporting unprivileged ublk device, so create pid file dir
as /tmp/ublksrvd, which can be available for every user.
It won't cause info leak, because normal user can just see how many
devices are created from /tmp/ublksrvd, which info can be retrieved
from /dev/ too.
And pid file is always created in the io handler process context, so
it won't be readable for other users by following system security
policy.
Signed-off-by: Ming Lei <[email protected]>
diff --git a/include/ublksrv_tgt.h b/include/ublksrv_tgt.h
index 95ad578..234d31e 100644
--- a/include/ublksrv_tgt.h
+++ b/include/ublksrv_tgt.h
@@ -34,7 +34,7 @@
}
#define MAX_NR_UBLK_DEVS 128
-#define UBLKSRV_PID_DIR "/var/run/ublksrvd"
+#define UBLKSRV_PID_DIR "/tmp/ublksrvd"
/* json device data is stored at this offset of pid file */
#define JSON_OFFSET 32