Parcourir la source

scripts/cl-debian.pl: Allow space between `#' and the bugnumber in the changelog scripts
scripts/start-stop-daemon.c: test for __sparc__ instead
scripts/Makefile.in: add optlib to CFLAGS
utils/start-stop-daemon.c: add option to chroot first, patch from Marco d'Itri
utils/start-stop-daemon.8: document chroot option
dselect/pkgtop.cc: use waddnstr to print package description instead of waddch

Wichert Akkerman il y a 26 ans
Parent
commit
07270aee02
10 fichiers modifiés avec 52 ajouts et 5 suppressions
  1. 10 0
      ChangeLog
  2. 1 0
      THANKS
  3. 7 0
      TODO
  4. 1 1
      configure.in
  5. 8 0
      debian/changelog
  6. 1 1
      dselect/pkgtop.cc
  7. 1 1
      scripts/cl-debian.pl
  8. 2 0
      utils/Makefile.in
  9. 6 0
      utils/start-stop-daemon.8
  10. 15 2
      utils/start-stop-daemon.c

+ 10 - 0
ChangeLog

@@ -1,3 +1,13 @@
+Sun Jan  9 01:40:23 CET 2000 Wichert Akkerman <wakkerma@debian.org>
+
+  * scripts/cl-debian.pl: Allow space between `#' and the bugnumber in the
+    changelog scripts
+  * scripts/start-stop-daemon.c: test for __sparc__ instead
+  * scripts/Makefile.in: add optlib to CFLAGS
+  * utils/start-stop-daemon.c: add option to chroot first, patch from Marco d'Itri
+  * utils/start-stop-daemon.8: document chroot option
+  * dselect/pkgtop.cc: use waddnstr to print package description instead of waddch
+
 Fri Jan  7 18:24:45 CET 2000 Wichert Akkerman <wakkerma@debian.org>
 
   * dselect/method.cc: pass admindir to dpkg

+ 1 - 0
THANKS

@@ -29,6 +29,7 @@ Juergen Menden <menden@morgana.camelot.de>
 Juho Vuori <javuori@cc.helsinki.fi>
 Kim-Minh Kaplan <kkaplan@cdfhp3.in2p3.fr>
 Klee Dienes <klee@debian.org>
+Marco d'Itri <md@linux.it>
 Marcus Brinkmann <brinkmd@debian.org> 
 Masato Taruishi <taru@debian.or.jp>
 Matt Welsh <mdw@sunsite.unc.edu>

+ 7 - 0
TODO

@@ -1,3 +1,10 @@
+
+* start-stop-daemon: write pidfile before we chroot?
+
+------------------------------------------------------------------------------
+
+Old TODO entries from IWJ:
+
 Here are some currently-known inadequacies:
 
 urgent

+ 1 - 1
configure.in

@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ([2.12])
+AC_PREREQ([2.13])
 
 AC_INIT(include/dpkg.h.in)
 AC_CONFIG_HEADER(config.h)

+ 8 - 0
debian/changelog

@@ -1,3 +1,11 @@
+dpkg (1.6.7) unstable; urgency=low
+
+  * start-stop-daemon can chroot now, Closes: Bug#54513
+  * Allow space between # and the bugnumber in the changelog
+  * Display package description with waddnstr, Closes: Bug#54313
+
+ -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
+
 dpkg (1.6.6) unstable; urgency=low
 
   * dpkg-buildpackage supports debsign, Closes: Bug#58333

+ 1 - 1
dselect/pkgtop.cc

@@ -221,7 +221,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
 
     i= description_width;
     p= info->description ? info->description : "";
-    while (i>0 && *p && *p != '\n') { waddch(listpad,*p); i--; p++; }
+    while (i>0 && *p && *p != '\n') { waddnstr(listpad,p,1); i--; p++; }
       
   } else {
 

+ 1 - 1
scripts/cl-debian.pl

@@ -138,7 +138,7 @@ $expect eq 'next heading or eof' || die "found eof where expected $expect";
 $f{'Changes'} =~ s/\n$//;
 $f{'Changes'} =~ s/^/\n/;
 
-while ($f{'Changes'} =~ /closes:\s*(?:bug)?\#\d+(?:,\s*(?:bug)?\#\d+)*/ig) {
+while ($f{'Changes'} =~ /closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*/ig) {
   push(@closes, $& =~ /\#(\d+)/g);
 }
 $f{'Closes'} = join(' ',sort { $a <=> $b} @closes);

+ 2 - 0
utils/Makefile.in

@@ -5,6 +5,8 @@ top_srcdir	= @top_srcdir@
 
 include ../Makefile.conf
 
+CFLAGS			+= $(top_srcdir)/optlib
+
 SSD_SOURCES		= start-stop-daemon.c
 SSD_OBJECTS		= $(patsubst %.c, %.o, $(SSD_SOURCES))
 SSD_MANPAGES		= start-stop-daemon.8

+ 6 - 0
utils/start-stop-daemon.8

@@ -130,6 +130,12 @@ even if the `group' options is not specified. The group option is only for
 groups that the user isn't normally a member of (like adding per/process
 group membership for generic users like `nobody').
 .TP
+.I -r|--chroot root
+Chdir and chroot to
+.B root
+before starting the process. Please note that the pidfile is also written
+after the chroot.
+.TP
 .I -b|--background
 Typically used with programs that don't detach on their own. This option
 will force

+ 15 - 2
utils/start-stop-daemon.c

@@ -21,7 +21,7 @@
 #define OSLinux
 #elif defined(__GNU__)
 #define OSHURD
-#elif defined(Sparc)
+#elif defined(__sparc__)
 #define OSsunos
 #else
 #error Unknown architecture - cannot build start-stop-daemon
@@ -73,6 +73,7 @@ static int runas_gid = -1;
 static const char *userspec = NULL;
 static char *changeuser = NULL;
 static char *changegroup = NULL;
+static char *changeroot = NULL;
 static const char *cmdname = NULL;
 static char *execname = NULL;
 static char *startas = NULL;
@@ -255,6 +256,7 @@ parse_options(int argc, char * const *argv)
 		{ "signal",	  1, NULL, 's'},
 		{ "test",	  0, NULL, 't'},
 		{ "user",	  1, NULL, 'u'},
+		{ "chroot",	  1, NULL, 'r'},
 		{ "verbose",	  0, NULL, 'v'},
 		{ "exec",	  1, NULL, 'x'},
 		{ "chuid",	  1, NULL, 'c'},
@@ -265,7 +267,7 @@ parse_options(int argc, char * const *argv)
 	int c;
 
 	for (;;) {
-		c = getopt_long(argc, argv, "HKSVa:n:op:qs:tu:vx:c:bm",
+		c = getopt_long(argc, argv, "HKSVa:n:op:qr:s:tu:vx:c:bm",
 				longopts, (int *) 0);
 		if (c == -1)
 			break;
@@ -319,6 +321,9 @@ parse_options(int argc, char * const *argv)
 			changeuser = strtok(changeuser, ":");
 			changegroup = strtok(NULL, ":");
 			break;
+		case 'r':  /* --chroot /new/root */
+			changeroot = optarg;
+			break;
 		case 'b':  /* --background */
 			background = 1;
 			break;
@@ -650,12 +655,20 @@ main(int argc, char **argv)
 			else
 				printf(")");
 		}
+		if (changeroot != NULL)
+			printf(" in directory %s", changeroot);
 		printf(".\n");
 		exit(0);
 	}
 	if (quietmode < 0)
 		printf("Starting %s...\n", startas);
 	*--argv = startas;
+	if (changeroot != NULL) {
+		if (chdir(changeroot) < 0)
+			fatal("Unable to chdir() to %s", changeroot);
+		if (chroot(changeroot) < 0)
+			fatal("Unable to chroot() to %s", changeroot);
+	}
 	if (changeuser != NULL) {
  		if (setgid(runas_gid))
  			fatal("Unable to set gid to %d", runas_gid);