ALT Linux repositórios
S: | 1.21.2-alt1 |
5.0: | 1.6.3-alt6.M50.2 |
4.1: | 1.6.3-alt3.M41.4 |
4.0: | 1.5.1-alt4.M40.5 |
+updates: | 1.5.1-alt4.M40.5 |
3.0: | 1.4.1-alt1 |
Group :: Sistema/Bibliotecas
RPM: krb5
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: krb5-1.4.1-alt-kadmind-pidfile.patch
Download
Download
--- krb5-1.4.1/src/kadmin/server/ovsec_kadmd.c..pidfile 2004-09-21 22:20:16 +0400
+++ krb5-1.4.1/src/kadmin/server/ovsec_kadmd.c 2005-06-18 20:43:46 +0400
@@ -117,6 +117,9 @@
void kadm5_set_use_password_server (void);
#endif
+static int pidfd = -1;
+static const char *pidfile = "/var/run/kadmind.pid";
+
/*
* Function: usage
*
@@ -139,6 +142,32 @@
}
/*
+ * Creates/truncates pidfile
+ */
+static void create_pidfile(void)
+{
+ FILE *fp;
+
+ unlink(pidfile);
+ fp = fopen(pidfile, "w");
+ if (!fp)
+ krb5_klog_syslog(LOG_ERR, "Opening %s failed: %s",
+ pidfile, error_message(errno));
+
+ fprintf(fp, "%d\n", getpid());
+ pidfd = dup(fileno(fp));
+ if (fclose(fp) < 0)
+ krb5_klog_syslog(LOG_NOTICE, "Flushing pid file %s failed",
+ pidfile);
+}
+
+static void truncate_pidfile(void)
+{
+ if (pidfd >= 0)
+ ftruncate(pidfd, 0);
+}
+
+/*
* Function: display_status
*
* Purpose: displays GSS-API messages
@@ -603,6 +632,8 @@
}
setup_signal_handlers();
+ create_pidfile();
+ atexit(truncate_pidfile);
krb5_klog_syslog(LOG_INFO, "starting");
kadm_svc_run(¶ms);
krb5_klog_syslog(LOG_INFO, "finished, exiting");