Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37559125
en ru br
ALT Linux repos
S:1.6b15-alt1
5.0: 1.5p6-alt1
4.1: 1.5p5-alt3
4.0: 1.5p5-alt3
3.0: 1.5p4-alt1

Group :: System/Servers
RPM: mathopd

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: mathopd-1.5p5-alt-pidfile.patch
Download


--- mathopd-1.5p5/src/main.c.orig	2005-03-22 21:46:55 +0300
+++ mathopd-1.5p5/src/main.c	2005-09-07 16:19:56 +0400
@@ -235,6 +235,13 @@ int main(int argc, char *argv[])
 		if (chdir("/") == -1)
 			die("chdir", 0);
 	}
+	if (pid_filename) {
+		pid_fd = open(pid_filename, O_WRONLY | O_CREAT, 0600);
+		if (pid_fd == -1)
+			die("open", "Cannot open PID file");
+	} else {
+		pid_fd = -1;
+	}
 	setuid(geteuid());
 	if (geteuid() == 0) {
 		if (server_uid == 0)
@@ -265,12 +272,6 @@ int main(int argc, char *argv[])
 	}
 	setrlimit(RLIMIT_CORE, &rl);
 	umask(fcm);
-	if (pid_filename) {
-		pid_fd = open(pid_filename, O_WRONLY | O_CREAT, 0666);
-		if (pid_fd == -1)
-			die("open", "Cannot open PID file");
-	} else
-		pid_fd = -1;
 	current_time = time(0);
 	if (init_logs(tee) == -1)
 		die("open", "Cannot open log files");
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin