shadow/shadow-utils-fix-lock-file-residue.patch

32 lines
1007 B
Diff
Raw Normal View History

2019-12-25 17:13:08 +08:00
From f0c78e7ba1e2721398ff811b709cc1d46ae31386 Mon Sep 17 00:00:00 2001
From: lubing <lubing@localhost.localdomain>
Date: Fri, 3 May 2019 16:46:45 +0800
Subject: [PATCH] shadow-utils: fix lock file residue
reason: fix lock file residue
Signed-off-by: lubing <lubing@localhost.localdomain>
---
lib/commonio.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/commonio.c b/lib/commonio.c
index 2c223e4..a110ca9 100644
--- a/lib/commonio.c
+++ b/lib/commonio.c
@@ -389,8 +389,9 @@ int commonio_lock_nowait (struct commonio_db *db, bool log)
if (db->locked) {
return 1;
}
- file_len = strlen(db->filename) + 11;/* %lu max size */
- lock_file_len = strlen(db->filename) + 6; /* sizeof ".lock" */
+ /* files moved from /etc/ to /var/run/, change malloc size */
+ file_len = strlen(db->filename) + 15;/* %lu max size */
+ lock_file_len = strlen(db->filename) + 15; /* sizeof ".lock" */
file = (char*)malloc(file_len);
if(file == NULL) {
goto cleanup_ENOMEM;
--
1.8.3.1