Tips
VXE Home
Overview
Installation guide
User's guide
Download
FAQ
Tips
Discussion
Contacts

Q:

How to fix the problem, when some lines in the kernel log are lost or broken?

A:

Increase size of the buffer which is used by 'printk' function in the kernel. To do that, locate the file 'kernel/printk.c' in the kernel source tree. Following line defines buffer size:

#define LOG_BUF_LEN     (16384)

Change the size to reasonable value, for example - (65536).

Q:

How do I limit where a person can go in a telnet environment? I don't want the user to go outside of his/her home directory or one level above it.

A:

Run shell in VXE. Describe what resources are available for user. You can use one VXED for all users. To do so a configuration program will be started instead of shell. This program will read VXED, change it accordingly to UID, home directory and so on. After that, it run shell in this, modified VXE. Let's see how it can be done in PERL. (Skip sub vxexec definition, it's here for completeness).

#!/usr/bin/perl -w
# See Tips at
http://www.intes.odessa.ua/vxe/

use IO::Pipe;
use Fcntl;

sub vxexec {
         $pipe = new IO::Pipe;
         if ($pid = fork()) {
# Parent
            $pipe->reader();
            shift;
            fcntl($pipe, F_SETFD, 0);
            exec('/usr/local/vxe/vxe', fileno($pipe), @_);
        }
        elsif (defined $pid) {
# Child
            $pipe->writer();
            print $pipe $_[0];
            close $pipe;
        }
}

# Here will be yours VXED path
$VxeConfFile = "/usr/local/vxe/tracesum.vxt";

open(VFD, $VxeConfFile) or die "Can't open $VxeConfFile\n";

#@VxeConf = <VFD>;
# read and change @VxeConf here
while(<VFD>) {
#       s?/home/user1/?/home/user2/?;
        push @VxeConf, $_;
}
close(VFD);

# here the shell or desired program will be started
vxexec(join('', @VxeConf), "/bin/date", "date");

# End

This script (vxexec.pl) resides in /usr/local/vxe directory. It reads defined VXED and change paths in description (s?/home/user1/?/home/user2/?;). In real life you will get path of home directory from /etc/passwd and use it instead /home/user2/. After applying changes, start shell using vxexec subroutine.

/bin/date and /usr/local/vxe/tracesum.vxt are used to show complete, working program.

 

[VXE Home] [Overview] [Instalation guide] [User's guide] [Download] [FAQ] [Tips] [Discussion] [Contacts]

VXE is a trademark of  InteS. All other products mentioned are registered trademarks or trademarks of their respective companies. Questions or problems regarding this web site should be directed to webmaster@quercitron.com. Copyright © 1999-2004 InteS. All rights reserved.