summaryrefslogtreecommitdiffstats
path: root/source/lib/pidfile.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-11 06:38:36 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-11 06:38:36 +0000
commitee09e9dadb69aaba5a751dd20ccc6d587d841bd6 (patch)
treeb7d08dcf7d06d74c7bba90655f720c14cff8981a /source/lib/pidfile.c
parent6b0c1733d2ebf3b8f09f3bf88b8648d8b371bb1f (diff)
downloadsamba-ee09e9dadb69aaba5a751dd20ccc6d587d841bd6.tar.gz
samba-ee09e9dadb69aaba5a751dd20ccc6d587d841bd6.tar.xz
samba-ee09e9dadb69aaba5a751dd20ccc6d587d841bd6.zip
changed to use slprintf() instead of sprintf() just about
everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes.
Diffstat (limited to 'source/lib/pidfile.c')
-rw-r--r--source/lib/pidfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/lib/pidfile.c b/source/lib/pidfile.c
index 6cad1436eb2..46d6a9d5b8c 100644
--- a/source/lib/pidfile.c
+++ b/source/lib/pidfile.c
@@ -37,7 +37,7 @@ void pidfile_create(char *name)
pstring pidFile;
int pid;
- sprintf(pidFile, "%s/%s.pid", lp_lockdir(), name);
+ slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
pid = pidfile_pid(name);
if (pid > 0 && process_exists(pid)) {
@@ -76,7 +76,7 @@ int pidfile_pid(char *name)
pstring pidFile;
unsigned ret;
- sprintf(pidFile, "%s/%s.pid", lp_lockdir(), name);
+ slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
f = fopen(pidFile, "r");
if (!f) {