~csurbhi/ubuntu/maverick/e2fsprogs/e2fsprogs.fix-505719

« back to all changes in this revision

Viewing changes to lib/blkid/probe.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-08-08 20:32:11 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20080808203211-w72lpsd9q7o3bw6x
Tags: 1.41.0-3ubuntu1
* Merge from Debian unstable (LP: #254152, #246461), remaining changes:
  - Do not build-depend on dietlibc-dev, which is in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
777
777
static int probe_zfs(struct blkid_probe *probe, struct blkid_magic *id,
778
778
                     unsigned char *buf)
779
779
{
 
780
#if 0
780
781
        char *vdev_label;
781
782
        const char *pool_name = 0;
782
783
 
783
784
        /* read nvpair data for pool name, pool GUID (complex) */
784
 
#if 0
785
785
        blkid_set_tag(probe->dev, "LABEL", pool_name, sizeof(pool_name));
786
786
        set_uuid(probe->dev, pool_guid, 0);
787
787
#endif
793
793
                       unsigned char *buf)
794
794
{
795
795
        char uuid[40];
 
796
 
796
797
        /* 168 is the offset to the 40 character uuid:
797
798
         * http://luks.endorphin.org/LUKS-on-disk-format.pdf */
798
799
        strncpy(uuid, (char *) buf+168, 40);
840
841
}
841
842
 
842
843
static int probe_swap1(struct blkid_probe *probe,
843
 
                       struct blkid_magic *id __BLKID_ATTR((unused)),
 
844
                       struct blkid_magic *id,
844
845
                       unsigned char *buf __BLKID_ATTR((unused)))
845
846
{
846
847
        struct swap_id_block *sws;
856
857
        if (!sws)
857
858
                return 1;
858
859
 
 
860
        /* check for wrong version or zeroed pagecount, for sanity */
 
861
        if (!memcmp(id->bim_magic, "SWAPSPACE2", id->bim_len) &&
 
862
                        (sws->sws_version != 1 || sws->sws_lastpage == 0))
 
863
                return 1;
 
864
 
859
865
        /* arbitrary sanity check.. is there any garbage down there? */
860
866
        if (sws->sws_pad[32] == 0 && sws->sws_pad[33] == 0)  {
861
867
                if (sws->sws_volume[0])
1059
1065
                        struct blkid_magic *id,
1060
1066
                        unsigned char *buf)
1061
1067
{
1062
 
        int sector = (id->bim_kboff) << 1;;
 
1068
        int sector = (id->bim_kboff) << 1;
1063
1069
        struct lvm2_pv_label_header *label= (struct lvm2_pv_label_header *)buf;
1064
1070
        char *p, *q, uuid[40];
1065
1071
        unsigned int i, b;
1246
1252
                return dev;
1247
1253
 
1248
1254
        DBG(DEBUG_PROBE,
1249
 
            printf("need to revalidate %s (cache time %d, stat time %d,\n\t"
 
1255
            printf("need to revalidate %s (cache time %lu, stat time %lu,\n\t"
1250
1256
                   "time since last check %lu)\n",
1251
 
                   dev->bid_name, dev->bid_time, st.st_mtime, (unsigned long)diff));
 
1257
                   dev->bid_name, (unsigned long)dev->bid_time,
 
1258
                   (unsigned long)st.st_mtime, (unsigned long)diff));
1252
1259
 
1253
1260
        if ((probe.fd = open(dev->bid_name, O_RDONLY)) < 0) {
1254
1261
                DBG(DEBUG_PROBE, printf("blkid_verify: error %s (%d) while "