Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#346515 - 20/07/2011 11:37 Hijack v515 -- save a little RAM
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Hijack v515 is now released.

This version (sadly) omits David's Whack-A-Mole game from the compiled binaries (still in the sources though) to save some RAM at run-time. I'm hoping this helps to improve stability with the RAM-challenged v3alpha software.

Also for this version, I've provided a new tree snapshot, this time including the heretofore secret code that displays the event and birthday notifications.

This undoubtedly will confuse the git trees that some of you are maintaining, but I'll probably continue to keep it all out in the open going forward now. smile

Cheers

Top
#346516 - 20/07/2011 11:40 Re: Hijack v515 -- save a little RAM [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Hey, wild.. I was just looking over the Hijack change logs, and noticed that I apparently included a ktelnetd at some point.

Wow.. no recollection of that whatsoever! But it actually works!

-ml
Code:
static int
ktelnetd_handle_connection (server_parms_t *parms)
{
        static char shell[] = "/bin/bash";
        static char *envp[] = { "HOME=/", "TERM=ansi", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
        char *argv[] = { shell, "--login", "-i", NULL };
        int sockfd, errno;

        // we don't need the original server socket here
        //close(parms->servsock);  /* not a file descriptor */

        // Allow syscall args to come from kernel space
        set_fs(KERNEL_DS);

        // cd to home directory
        (void)sys_chdir("/");

        // set up stdin,stdout,stderr to all point at the socket
        sockfd = get_fd(parms->clientsock->inode);
        dup(sockfd);
        dup(sockfd);

        // toss garbage (unsupported protocol leftovers) from client side
        read(sockfd, parms->buf, sizeof(parms->buf));

        // free the client parms structure now that we're done with it
        free_pages((unsigned long)parms, 1);

        // launch the shell.  FIXME: do this on a pty someday, to get job control goodies working
        errno = execve(shell, argv, envp);      // never returns
        if (!hijack_silent)
                printk(KERN_ERR "ktelnetd_handle_connection: failed, errno = %d\n", errno);
        return -errno;
}


Edited by mlord (20/07/2011 11:43)

Top