Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37041744
en ru br
Репозитории ALT
S:1.3.59-alt4
5.1: 1.3.29-alt2
4.1: 1.3.29-alt2
4.0: 1.3.29-alt2
3.0: 1.2.24-alt5
+backports:1.3.29-alt0.M30.1
www.altlinux.org/Changes

Группа :: Система/Настройка/Загрузка и инициализация
Пакет: chkconfig

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: chkconfig-1.3.25-alt-installer.patch
Скачать


--- chkconfig-1.3.25/chkconfig.c.orig	2005-12-22 20:50:17 +0000
+++ chkconfig-1.3.25/chkconfig.c	2005-12-22 20:51:29 +0000
@@ -14,6 +14,7 @@
 
 #define _(String) gettext((String)) 
 #define progname program_invocation_short_name
+#define CONFIG_FILE "/etc/chkconfig.allow"
 
 #include "leveldb.h"
 #include "xmalloc.h"
@@ -219,6 +220,29 @@ static void frobDependencies(struct serv
 	frobOneDependencies(s, servs, numservs, 1);
 }
 
+static int disallowed_add(char *name){
+    if (getenv ("RPM_INSTALL_NAME") && getenv ("DURING_INSTALL")){
+	    char buffer[BUFSIZ];
+	    FILE *config = fopen(CONFIG_FILE,"r");
+
+	    if (!config) return 0;
+	
+	    while (fgets (buffer, sizeof(buffer), config))
+	    {
+		size_t len = strlen(buffer);
+		if ((len>2) && (buffer[len-1]=='\n'))
+		    buffer[len-1] = '\0';
+		if (!strcmp (name, buffer)){
+		    fclose (config);
+		    return 0;
+		}
+	    }
+	    fclose (config);
+	    return 1;
+    }
+    return 0;
+}
+
 static int addService(char * name) {
     int i, rc;
     struct service s;
@@ -415,6 +439,8 @@ int setService(char * name, int where, i
 	        (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6);
     }
 
+    if (disallowed_add (name)) return 0;
+    
     if ((rc = readServiceInfo(name, &s, 0))) {
 	readServiceError(rc, name);
 	return 1;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin