!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/udf/   drwxr-xr-x
Free 318.34 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     symlink.c (2.52 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * symlink.c
 *
 * PURPOSE
 *    Symlink handling routines for the OSTA-UDF(tm) filesystem.
 *
 * CONTACTS
 *    E-mail regarding any portion of the Linux UDF file system should be
 *    directed to the development team mailing list (run by majordomo):
 *        linux_udf@hpesjro.fc.hp.com
 *
 * COPYRIGHT
 *    This file is distributed under the terms of the GNU General Public
 *    License (GPL). Copies of the GPL can be obtained from:
 *        ftp://prep.ai.mit.edu/pub/gnu/GPL
 *    Each contributing author retains all rights to their own work.
 *
 *  (C) 1998-2000 Ben Fennema
 *  (C) 1999 Stelias Computing Inc 
 *
 * HISTORY
 *
 *  04/16/99 blf  Created.
 *
 */

#include "udfdecl.h"
#include <asm/uaccess.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/udf_fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/stat.h>
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/smp_lock.h>
#include "udf_i.h"

static void udf_pc_to_char(char *from, int fromlen, char *to)
{
    struct PathComponent *pc;
    int elen = 0;
    char *p = to;

    while (elen < fromlen)
    {
        pc = (struct PathComponent *)(from + elen);
        switch (pc->componentType)
        {
            case 1:
                if (pc->lengthComponentIdent == 0)
                {
                    p = to;
                    *p++ = '/';
                }
                break;
            case 3:
                memcpy(p, "../", 3);
                p += 3;
                break;
            case 4:
                memcpy(p, "./", 2);
                p += 2;
                /* that would be . - just ignore */
                break;
            case 5:
                memcpy(p, pc->componentIdent, pc->lengthComponentIdent);
                p += pc->lengthComponentIdent;
                *p++ = '/';
        }
        elen += sizeof(struct PathComponent) + pc->lengthComponentIdent;
    }
    if (p > to+1)
        p[-1] = '\0';
    else
        p[0] = '\0';
}

static int udf_symlink_filler(struct file *file, struct page *page)
{
    struct inode *inode = page->mapping->host;
    struct buffer_head *bh = NULL;
    char *symlink;
    int err = -EIO;
    char *p = kmap(page);
    
    lock_kernel();
    if (UDF_I_ALLOCTYPE(inode) == ICB_FLAG_AD_IN_ICB)
    {
        bh = udf_tread(inode->i_sb, inode->i_ino);

        if (!bh)
            goto out;

        symlink = bh->b_data + udf_file_entry_alloc_offset(inode);
    }
    else
    {
        bh = sb_bread(inode->i_sb, udf_block_map(inode, 0));

        if (!bh)
            goto out;

        symlink = bh->b_data;
    }

    udf_pc_to_char(symlink, inode->i_size, p);
    udf_release_data(bh);

    unlock_kernel();
    SetPageUptodate(page);
    kunmap(page);
    UnlockPage(page);
    return 0;
out:
    unlock_kernel();
    SetPageError(page);
    kunmap(page);
    UnlockPage(page);
    return err;
}

/*
 * symlinks can't do much...
 */
struct address_space_operations udf_symlink_aops = {
    readpage:        udf_symlink_filler,
};

:: 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.0044 ]--