LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-04-2007, 04:37 PM   #1
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Rep: Reputation: 15
man not working within chroot


H iI was wondering if any can help, I just can seem to get man commanf to work properly within a chroot (im using jailkit), the command works but it does not pull any information.. I tried debugging using strace and i get the following result from strace on the chrooted man command and normal enviroment


Jailkit


open("/etc/ld.so.cache", O_RDONLY) = 4
open("/lib/libc.so.6", O_RDONLY) = 4
open("/etc/man.config", O_RDONLY) = 4
open("/usr/share/locale/C/man", O_RDONLY) = 5

Process 26204 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
nan 0.000000 0 4 read
nan 0.000000 0 1 write
nan 0.000000 0 4 open
nan 0.000000 0 3 close
nan 0.000000 0 1 execve
nan 0.000000 0 1 1 access
nan 0.000000 0 4 brk
nan 0.000000 0 3 ioctl
nan 0.000000 0 6 old_mmap
nan 0.000000 0 1 munmap
nan 0.000000 0 2 mprotect
nan 0.000000 0 2 mmap2
nan 0.000000 0 4 fstat64
nan 0.000000 0 1 getuid32
nan 0.000000 0 1 getgid32
nan 0.000000 0 1 geteuid32
nan 0.000000 0 1 getegid32
nan 0.000000 0 1 set_thread_area
------ ----------- ----------- --------- --------- ----------------
100.00 0.000000 41 1 total







real life

open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
open("/etc/man.config", O_RDONLY) = 3
open("/usr/share/locale/en/man", O_RDONLY) = 4


% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
nan 0.000000 0 4 read
nan 0.000000 0 1 write
nan 0.000000 0 7 2 open
nan 0.000000 0 4 close
nan 0.000000 0 1 execve
nan 0.000000 0 1 1 access
nan 0.000000 0 4 brk
nan 0.000000 0 3 ioctl
nan 0.000000 0 6 old_mmap
nan 0.000000 0 1 munmap
nan 0.000000 0 2 mprotect
nan 0.000000 0 3 mmap2
nan 0.000000 0 5 fstat64
nan 0.000000 0 1 getuid32
nan 0.000000 0 1 getgid32
nan 0.000000 0 1 geteuid32
nan 0.000000 0 1 getegid32
nan 0.000000 0 1 set_thread_area
------ ----------- ----------- --------- --------- ----------------
100.00 0.000000 47 3 total
 
Old 10-04-2007, 06:13 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Do you have the needed libraries and a copy of the /usr/share/man hierarchy and man.conf in the jailed environment. I think you also need to check the man.conf file. You may be missing some commands like gzip which man needs to uncompress man pages. Also check for the other programs mentioned in man.conf like groff, etc.
 
Old 10-08-2007, 06:26 AM   #3
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Original Poster
Rep: Reputation: 15
All of them seem to be there.. that's what confusing me. I've also notice strace has gives different numbers for the output. they are mainly 3 in the non-chroot environment and 4's in the chroot.. I've search and i can't find any documentation that indicates what the output numbers are ( i know 0 indicates the file cant be found)..
 
Old 10-09-2007, 08:42 AM   #4
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Original Poster
Rep: Reputation: 15
Does anyone know what the strace return value of 4 actually means?
 
Old 10-09-2007, 08:57 AM   #5
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
ldd /usr/bin/man might be eaiser to find out what libraries are required.

"ldd - print shared library dependencies"
 
Old 10-10-2007, 04:53 AM   #6
Roosta21
Member
 
Registered: Aug 2004
Distribution: Fedora core 4
Posts: 55

Original Poster
Rep: Reputation: 15
this was the output

linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/libc.so.6 (0xb7dbd000)
/lib/ld-linux.so.2 (0xb7eee000)

running locate, they both seem to be there, (below)

chroot/lib/libc.so.6

chroot/lib/ld-linux.so.2

If im correct in my read linux-gate.so.1 is not actually a libary, its a it's a virtual DSO?

In fact man actually loads ok it just does no pull any info into the screen if you do ie man ls, all the programs that man seem to you use in config file are also installed

Last edited by Roosta21; 10-10-2007 at 04:55 AM.
 
Old 10-10-2007, 06:00 AM   #7
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
you also need to copy the man pages into there. i think they are in /usr/share/man
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 04:57 AM
Working on Apache Chroot zhizaki Linux - Security 9 11-29-2005 06:53 AM
etc of the host changes while working in chroot env sharmashikha Linux From Scratch 3 06-15-2005 01:20 PM
chroot not working for vsftp anymore noisybastard Linux - Newbie 5 11-26-2003 11:31 PM
chroot not working. dkc_ace Linux - General 9 08-13-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration