~ubuntu-branches/ubuntu/hardy/silo/hardy-updates

« back to all changes in this revision

Viewing changes to debian/patches/11-silocheck_non-failure_on_stat.patch

  • Committer: Bazaar Package Importer
  • Author(s): Fabio M. Di Nitto
  • Date: 2007-10-25 09:28:08 UTC
  • mfrom: (15.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071025092808-1yhj12t7s4zqsfu5
Tags: 1.4.13a+git20070930-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build with -fno-stack-protector.
  - Change silo.postinst to automatically update the boot block without
    invoking siloconfig and keep asking questions on upgrades.
  - Convert silo.conf to use /dev/disk/by-uuid.
  - Ubuntu maintainer foobar.
  - Fix debian/rules call to dh_installdocs.
  - Drop the requirement of gcc-4.1 and start using default gcc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -ruN a/silo/silocheck.c b/silo/silocheck.c
 
2
--- a/silo/silocheck.c        2006-06-01 17:24:53.000000000 +0000
 
3
+++ b/silo/silocheck.c       2007-08-13 15:26:21.000000000 +0000
 
4
@@ -22,6 +22,7 @@
 
5
 #include "../second/fs/ufs.c"
 
6
 #endif
 
7
 
 
8
+#include <errno.h>
 
9
 #include <stdio.h>
 
10
 #include <stdarg.h>
 
11
 #include <string.h>
 
12
@@ -254,7 +255,11 @@
 
13
     p = strchr (name, 0);
 
14
     while ((dir = readdir(dp)) != NULL) {
 
15
         strcpy(p,dir->d_name);
 
16
-        if (stat(name,&s) < 0) return NULL;
 
17
+        /*
 
18
+         * It is possible that we got an unresolved symlink under /dev.
 
19
+         * Such a file will make silocheck fail and we do not want this.
 
20
+         */
 
21
+        if (stat(name,&s) < 0 && errno != ENOENT) return NULL;
 
22
         if (S_ISBLK(s.st_mode) && s.st_rdev == number) return name;
 
23
     }
 
24
     return NULL;