Commit 6582f304 authored by Seblu's avatar Seblu
Browse files

Remove pxe

parent da374fa3
Loading
Loading
Loading
Loading

pxe/01-logfile.patch

deleted100644 → 0
+0 −12
Original line number Diff line number Diff line
diff -Naur pxe-1.4.2.orig/logfile.cc pxe-1.4.2/logfile.cc
--- pxe-1.4.2.orig/logfile.cc	2003-02-02 12:33:32.000000000 +0000
+++ pxe-1.4.2/logfile.cc	2006-06-30 10:07:43.000000000 +0000
@@ -57,7 +57,7 @@
 LogFile::Open(const char *filename)
 {
 	/* open the file */
-	umask(077);
+	umask(022);
 	logfile = new std::fstream(filename, std::ios::out|std::ios::app);
 	if(logfile == NULL)
 	{

pxe/02-lockfile.patch

deleted100644 → 0
+0 −24
Original line number Diff line number Diff line
diff -Naur pxe-1.4.2.orig/autoconf.h.in pxe-1.4.2/autoconf.h.in
--- pxe-1.4.2.orig/autoconf.h.in	2002-08-22 18:06:11.000000000 +0000
+++ pxe-1.4.2/autoconf.h.in	2006-07-22 19:50:33.000000000 +0000
@@ -61,7 +61,7 @@
 /* should not need to change from here onwards */
 
 /* the lock file */
-#define LOCKFILE "/tmp/pxe.pid"
+#define LOCKFILE "/var/run/pxe/pxe.pid"
 
 #define DEF_MULTI_BOOT 0xe0000102
 #define DEF_ADDR "0.0.0.0"
diff -Naur pxe-1.4.2.orig/pxe.cc pxe-1.4.2/pxe.cc
--- pxe-1.4.2.orig/pxe.cc	2003-02-02 12:39:26.000000000 +0000
+++ pxe-1.4.2/pxe.cc	2006-07-22 19:50:33.000000000 +0000
@@ -312,7 +312,7 @@
 				umask(0);
 
 				// write out the pid
-				sprintf(pidnum, "%ld", (long)getpid());
+				sprintf(pidnum, "%ld\n", (long)getpid());
 				if(write(chk, pidnum, strlen(pidnum)) !=
 				  (ssize_t)strlen(pidnum)) {
 					std::cerr << "Unable to write lockfile\n";

pxe/03-pidfile.patch

deleted100644 → 0
+0 −51
Original line number Diff line number Diff line
diff -Naur pxe-1.4.2.BAR/pxe.cc pxe-1.4.2.FOO/pxe.cc
--- pxe-1.4.2.BAR/pxe.cc	2006-08-15 10:12:25.000000000 +0000
+++ pxe-1.4.2.FOO/pxe.cc	2006-08-15 10:10:51.000000000 +0000
@@ -214,7 +214,7 @@
  ******************************************************************************/
 int main(int argc, char **argv)
 {
-	int chk;
+	int chk,log;
 	char pidnum[8];
 	int _debug, c, errflg;
 	const char *configfile=PXECONFIGFILE;
@@ -258,6 +258,13 @@
 		debug.close();
 	}
 
+	// check to see if the daemon is already running
+	chk = open(LOCKFILE, O_WRONLY|O_CREAT|O_EXCL, 0666);
+	if(-1 == chk)
+	{
+		std::cerr << "PXE daemon already running\n";
+		return(-1);
+	}
 
 	// set the UID/GID to a low user
 #ifndef NO_SUID
@@ -269,6 +276,9 @@
 		     << ", continuing with user id " << getuid() << "\n";
 	else
 	{
+	  if(log=open(PXELOGFILE, O_CREAT, 0666)) close(log);
+	  if(chown(PXELOGFILE,pw->pw_uid,pw->pw_gid)<0)
+	    std::cout << "Unable to acquire logfile " << PXELOGFILE << "\n";
 		if((-1 == setgid(pw->pw_gid)) || (-1 == setegid(pw->pw_gid)))
 			std::cout << "Unable to change group id, continuing with group id "
 			     << getgid() << "\n";
@@ -278,14 +288,6 @@
 	}
 #endif
 
-	// check to see if the daemon is already running
-	chk = open(LOCKFILE, O_WRONLY|O_CREAT|O_EXCL, 0644);
-	if(-1 == chk)
-	{
-		std::cerr << "PXE daemon already running\n";
-		return(-1);
-	}
-
 	// if not in debug mode, fork and go
 	if (0 == _debug) {
 		signal(SIGCHLD, SIG_IGN);

pxe/04-gcc4.patch

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
diff -Naur pxe-1.4.2.orig/pxe.cc pxe-1.4.2/pxe.cc
--- pxe-1.4.2.orig/pxe.cc	2006-08-15 10:49:17.000000000 +0000
+++ pxe-1.4.2/pxe.cc	2006-08-15 10:48:33.000000000 +0000
@@ -263,7 +263,7 @@
 	if(-1 == chk)
 	{
 		std::cerr << "PXE daemon already running\n";
-		return(-1);
+		exit(-1);
 	}
 
 	// set the UID/GID to a low user
@@ -333,5 +333,5 @@
 		StartPxeService(configfile);
 	}
 	
-	return(0);
+	exit(0);
 }

pxe/05-makefile.patch

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
--- a/Makefile	2011-01-17 20:44:18.000000000 +0100
+++ b/Makefile	2011-01-17 20:48:45.000000000 +0100
@@ -3,7 +3,11 @@
 LDFLAGS		=	-Wl,--hash-style=gnu -Wl,--as-needed -lresolv -lnsl 
 
 EXECS		=	pxe
-CP		=	cp
+INSTALL = /bin/install
+DESTDIR =
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/sbin
+sysconfdir = $(PREFIX)/etc
 
 all:	$(EXECS)
 
@@ -31,7 +35,7 @@
 	$(CXX) $(CXXFLAGS) -c $*.cc
 
 install:	all
-	$(CP) pxe /usr/sbin/
-	@if test ! -e /etc/pxe.conf; then \
-		$(CP) pxe.conf /etc/; \
-	fi
+	$(INSTALL) -d $(DESTDIR)$(BINDIR)
+	$(INSTALL) -m 744 pxe $(DESTDIR)$(BINDIR)
+	$(INSTALL) -d $(DESTDIR)$(sysconfdir)
+	$(INSTALL) -m 644 pxe.conf $(DESTDIR)$(sysconfdir)/pxe.conf
Loading