Procházet zdrojové kódy

Fix test for incorrect packagename for -p option.

Wichert Akkerman před 24 roky
rodič
revize
41c03b208b
4 změnil soubory, kde provedl 23 přidání a 10 odebrání
  1. 9 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 2 2
      scripts/dpkg-gencontrol.pl
  4. 11 8
      utils/start-stop-daemon.c

+ 9 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Mon Feb 25 15:22:34 CET 2002 Wichert Akkerman <wakkerma@debian.org>
+
+  * scripts/dpkg-gencontrol.pl: Fix test for incorrect packagename
+    for -p option.
+
 Sat Feb 16 15:14:30 CET 2002 peter karlsson <peterk@debian.org>
 
   * man/sv/deb-control.5, deb-old.5, deb.5, dpkg-split.8,
@@ -6,6 +11,10 @@ Sat Feb 16 15:14:30 CET 2002 peter karlsson <peterk@debian.org>
   * man/sv/dpkg.cfg.5, man/sv/dselect.cfg.5: Translated new files.
   * man/en/dselect.cfg.5: Fixed numerous copy'n'paste errors.
 
+Sun Feb 10 01:40:52 CET 2002 Wichert Akkerman <wakkerma@debian.org>
+
+  * utils/start-stop-daemon.c: add FreeBSD support
+
 Sun Feb 10 01:31:57 CET 2002 Wichert Akkerman <wakkerma@debian.org>
 
   * man/en/dselect.cfg.5, man/en/dpkg.cfg.5: new files

+ 1 - 0
debian/changelog

@@ -83,6 +83,7 @@ dpkg (1.10) unstable; urgency=low
   * Copy bugs and origin information into status file. Closes: Bug#132714
   * Improve wording of update-alternatives --config text. Closes: Bug#133035
   * Add manpages for dpkg.cfg and dselect.cfg. Closes: Bug#132901
+  * Improve test for illegal packagename for dpkg-gencontrol -p option
 
  -- Wichert Akkerman <wakkerma@debian.org>  Mon, 20 Aug 2001 14:54:38 +0200
 

+ 2 - 2
scripts/dpkg-gencontrol.pl

@@ -56,8 +56,8 @@ while (@ARGV) {
     $_=shift(@ARGV);
     if (m/^-p([-+0-9a-z.]+)$/) {
         $oppackage= $1;
-    } elsif (m/^-p/) {
-        &usageerr("Illegal package name \`$1'");
+    } elsif (m/^-p(.*)/) {
+        &error("Illegal package name \`$1'");
     } elsif (m/^-c/) {
         $controlfile= $';
     } elsif (m/^-l/) {

+ 11 - 8
utils/start-stop-daemon.c

@@ -32,6 +32,8 @@
 #  define OSOpenBSD
 #elif defined(hpux)
 #  define OShpux
+#elif defined(__FreeBSD__)
+#  define OSFreeBSD
 #else
 #  error Unknown architecture - cannot build start-stop-daemon
 #endif
@@ -43,7 +45,7 @@
 #  include <ps.h>
 #endif
 
-#if defined(OSOpenBSD)
+#if defined(OSOpenBSD) || defined(OSFreeBSD)
 #include <sys/param.h>
 #include <sys/user.h>
 #include <sys/proc.h>
@@ -675,7 +677,7 @@ check(pid_t pid)
 {
 #if defined(OSLinux) || defined(OShpux)
 	if (execname && !pid_is_exec(pid, &exec_stat))
-#elif defined(OSHURD)
+#elif defined(OSHURD) || defined(OSFreeBSD)
     /* I will try this to see if it works */
 	if (execname && !pid_is_cmd(pid, execname))
 #endif
@@ -707,7 +709,8 @@ do_pidfile(const char *name)
 
 /* WTA: this  needs to be an autoconf check for /proc/pid existance.
  */
-#if defined(OSLinux) || defined (OSsunos)
+
+#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd)
 static void
 do_procinit(void)
 {
@@ -768,8 +771,8 @@ do_procinit(void)
 #endif /* OSHURD */
 
 
-#if defined(OSOpenBSD)
-int
+#if defined(OSOpenBSD) || defined(OSFreeBSD)
+static int
 pid_is_cmd(pid_t pid, const char *name)
 {
         kvm_t *kd;
@@ -810,8 +813,8 @@ pid_is_cmd(pid_t pid, const char *name)
         return (strcmp(name, start_argv_0_p) == 0) ? 1 : 0;
 }
  
-int
-pid_is_user(pid_t pid, int uid)
+static int
+pid_is_user(pid_t pid, uid_t uid)
 {
 	kvm_t *kd;
 	int nentries;   /* Value not used */
@@ -833,7 +836,7 @@ pid_is_user(pid_t pid, int uid)
 	return (proc_uid == (uid_t)uid);
 }
 
-int
+static int
 pid_is_exec(pid_t pid, const char *name)
 {
 	kvm_t *kd;