!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/fs/partitions/   drwxr-xr-x
Free 318.37 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     sun.c (2.53 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 *  fs/partitions/sun.c
 *
 *  Code extracted from drivers/block/genhd.c
 *
 *  Copyright (C) 1991-1998  Linus Torvalds
 *  Re-organised Feb 1998 Russell King
 */

#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/blk.h>

#include <asm/system.h>

#include "check.h"
#include "sun.h"

int sun_partition(struct gendisk *hd, struct block_device *bdev, unsigned long first_sector, int first_part_minor)
{
    int i, csum;
    unsigned short *ush;
    Sector sect;
    kdev_t dev = to_kdev_t(bdev->bd_dev);
    struct sun_disklabel {
        unsigned char info[128];   /* Informative text string */
        unsigned char spare[292];  /* Boot information etc. */
        unsigned short rspeed;     /* Disk rotational speed */
        unsigned short pcylcount;  /* Physical cylinder count */
        unsigned short sparecyl;   /* extra sects per cylinder */
        unsigned char spare2[4];   /* More magic... */
        unsigned short ilfact;     /* Interleave factor */
        unsigned short ncyl;       /* Data cylinder count */
        unsigned short nacyl;      /* Alt. cylinder count */
        unsigned short ntrks;      /* Tracks per cylinder */
        unsigned short nsect;      /* Sectors per track */
        unsigned char spare3[4];   /* Even more magic... */
        struct sun_partition {
            __u32 start_cylinder;
            __u32 num_sectors;
        } partitions[8];
        unsigned short magic;      /* Magic number */
        unsigned short csum;       /* Label xor'd checksum */
    } * label;        
    struct sun_partition *p;
    unsigned long spc;

    label = (struct sun_disklabel *)read_dev_sector(bdev, 0, &sect);
    if (!label)
        return -1;

    p = label->partitions;
    if (be16_to_cpu(label->magic) != SUN_LABEL_MAGIC) {
/*        printk(KERN_INFO "Dev %s Sun disklabel: bad magic %04x\n",
               bdevname(dev), be16_to_cpu(label->magic)); */
        put_dev_sector(sect);
        return 0;
    }
    /* Look at the checksum */
    ush = ((unsigned short *) (label+1)) - 1;
    for (csum = 0; ush >= ((unsigned short *) label);)
        csum ^= *ush--;
    if(csum) {
        printk("Dev %s Sun disklabel: Csum bad, label corrupted\n",
               bdevname(dev));
        put_dev_sector(sect);
        return 0;
    }
    /* All Sun disks have 8 partition entries */
    spc = be16_to_cpu(label->ntrks) * be16_to_cpu(label->nsect);
    for(i=0; i < 8; i++, p++) {
        unsigned long st_sector;
        int num_sectors;

        st_sector = first_sector + be32_to_cpu(p->start_cylinder) * spc;
        num_sectors = be32_to_cpu(p->num_sectors);
        if (num_sectors)
            add_gd_partition(hd, first_part_minor, st_sector, num_sectors);
        first_part_minor++;
    }
    printk("\n");
    put_dev_sector(sect);
    return 1;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0244 ]--