!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/intermezzo/   drwxr-xr-x
Free 318.35 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:     kml.c (6.04 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#define __NO_VERSION__
#include <linux/module.h>
#include <asm/uaccess.h>

#include <linux/intermezzo_fs.h>
#include <linux/intermezzo_upcall.h>
#include <linux/intermezzo_psdev.h>
#include <linux/intermezzo_kml.h>

static struct presto_file_set * kml_getfset (char *path)
{
        return presto_path2fileset(path);
}

/* Send the KML buffer and related volume info into kernel */
int begin_kml_reint (struct file *file, unsigned long arg)
{
        struct {
                char *volname;
                int   namelen;  
                char *recbuf;
                int   reclen;     /* int   newpos; */
        } input;
        struct kml_fsdata *kml_fsdata = NULL;
        struct presto_file_set *fset = NULL;
        char   *path;
        int    error;

        ENTRY;
        /* allocate buffer & copy it to kernel space */
        error = copy_from_user(&input, (char *)arg, sizeof(input));
        if ( error ) {
                EXIT;
                return error;
        }

        if (input.reclen > kml_fsdata->kml_maxsize)
                return -ENOMEM; /* we'll find solution to this in the future */

        PRESTO_ALLOC(path, char *, input.namelen + 1);
        if ( !path ) {
                EXIT;
                return -ENOMEM;
        }
        error = copy_from_user(path, input.volname, input.namelen);
        if ( error ) {
                PRESTO_FREE(path, input.namelen + 1);
                EXIT;
                return error;
        }
        path[input.namelen] = '\0';
        fset = kml_getfset (path);
        PRESTO_FREE(path, input.namelen + 1);

        kml_fsdata = FSET_GET_KMLDATA(fset);
        /* read the buf from user memory here */
        error = copy_from_user(kml_fsdata->kml_buf, input.recbuf, input.reclen);
        if ( error ) {
                EXIT;
                return error;
        }
        kml_fsdata->kml_len = input.reclen;

        decode_kmlrec (&kml_fsdata->kml_reint_cache,
                        kml_fsdata->kml_buf, kml_fsdata->kml_len);

        kml_fsdata->kml_reint_current = kml_fsdata->kml_reint_cache.next;
        kml_fsdata->kml_reintpos = 0;
        kml_fsdata->kml_count = 0;
        return 0;
}

/* DO_KML_REINT  */
int do_kml_reint (struct file *file, unsigned long arg)
{
        struct {
                char *volname;
                int   namelen;  
                char *path;
                int pathlen;
                int recno;
                int offset;
                int len;
                int generation;
                __u64 ino;
        } input;
        int error;
        char   *path;
        struct kml_rec *close_rec;
        struct kml_fsdata *kml_fsdata;
        struct presto_file_set *fset;

        ENTRY;
        error = copy_from_user(&input, (char *)arg, sizeof(input));
        if ( error ) {
                EXIT;
                return error;
        }
        PRESTO_ALLOC(path, char *, input.namelen + 1);
        if ( !path ) {
                EXIT;
                return -ENOMEM;
        }
        error = copy_from_user(path, input.volname, input.namelen);
        if ( error ) {
                PRESTO_FREE(path, input.namelen + 1);
                EXIT;
                return error;
        }
        path[input.namelen] = '\0';
        fset = kml_getfset (path);
        PRESTO_FREE(path, input.namelen + 1);

        kml_fsdata = FSET_GET_KMLDATA(fset);

        error = kml_reintbuf(kml_fsdata, 
                fset->fset_mtpt->d_name.name, 
                &close_rec);

        if (error == KML_CLOSE_BACKFETCH && close_rec != NULL) {
                struct kml_close *close = &close_rec->rec_kml.close;
                input.ino = close->ino;
                input.generation = close->generation;
                if (strlen (close->path) + 1 < input.pathlen) {
                        strcpy (input.path, close->path);
                        input.pathlen = strlen (close->path) + 1;
                        input.recno = close_rec->rec_tail.recno;
                        input.offset = close_rec->rec_kml_offset;
                        input.len = close_rec->rec_size;
                        input.generation = close->generation;
                        input.ino = close->ino;
                }
                else {
                        CDEBUG(D_KML, "KML_DO_REINT::no space to save:%d < %d",
                                strlen (close->path) + 1, input.pathlen);
                        error = -ENOMEM;
                }
                copy_to_user((char *)arg, &input, sizeof (input));
        }
        return error;
}

/* END_KML_REINT */
int end_kml_reint (struct file *file, unsigned long arg)
{
        /* Free KML buffer and related volume info */
        struct {
                char *volname;
                int   namelen;  
#if 0
                int   count; 
                int   newpos; 
#endif
        } input;
        struct presto_file_set *fset = NULL;
        struct kml_fsdata *kml_fsdata = NULL;
        int error;
        char *path;

        ENTRY;
        error = copy_from_user(&input, (char *)arg, sizeof(input));
        if ( error ) {
               EXIT;
               return error;
        }

        PRESTO_ALLOC(path, char *, input.namelen + 1);
        if ( !path ) {
                EXIT;
                return -ENOMEM;
        }
        error = copy_from_user(path, input.volname, input.namelen);
        if ( error ) {
                PRESTO_FREE(path, input.namelen + 1);
                EXIT;
                return error;
        }
        path[input.namelen] = '\0';
        fset = kml_getfset (path);
        PRESTO_FREE(path, input.namelen + 1);

        kml_fsdata = FSET_GET_KMLDATA(fset);
        delete_kmlrec (&kml_fsdata->kml_reint_cache);

        /* kml reint support */
        kml_fsdata->kml_reint_current = NULL;
        kml_fsdata->kml_len = 0;
        kml_fsdata->kml_reintpos = 0;
        kml_fsdata->kml_count = 0;
#if 0
        input.newpos = kml_upc->newpos;
        input.count = kml_upc->count;
        copy_to_user((char *)arg, &input, sizeof (input));
#endif
        return error;
}

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