From: Blaisorblade <blaisorblade@yahoo.it>
To: Rob Landley <rob@landley.net>
Cc: user-mode-linux-devel@lists.sourceforge.net,
Antoine Martin <antoine@nagafix.co.uk>
Subject: Re: [uml-devel] Re: pcap cross-linking [PATCH]
Date: Tue, 20 Dec 2005 21:43:53 +0100 [thread overview]
Message-ID: <200512202143.53814.blaisorblade@yahoo.it> (raw)
In-Reply-To: <200512201401.03853.rob@landley.net>
[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]
On Tuesday 20 December 2005 21:01, Rob Landley wrote:
> On Monday 19 December 2005 12:33, Antoine Martin wrote:
> > I think I'll rebuild it with compartment and build su without pam to
> > trim it down even more.
> > > > (also lib/security so I can get into the chroot)
> > > That's for su, right? There are some tools (including "compartment") to
> > > combine chroot + su together.
> > Yep, it's a shame compartment does not ship with all distros.
> > chroot without su is pointless (since you can use 'chroot-again' to
> > escape) changing uid/guid should really be included in chroot.
> This is the first I've heard of it, and after few minutes of googling the
> best I can find on it is this:
> http://www.suse.de/~marc/SuSE.html
> Which is from February 2001.
> Is that the newest version?
Don't know, guess yes - and that's more or less the URL I had. I know it just
because it was mentioned here (by Gerd Knorr, maybe - former SuSE UML
maintainer).
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
[-- Attachment #2: chroot-setuid.c --]
[-- Type: text/x-csrc, Size: 669 bytes --]
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int uid;
char *dir, **command, *end;
if(argc < 3){
fprintf(stderr, "Usage - do-chroot dir uid "
"command-line...\n");
exit(1);
}
dir = argv[1];
uid = strtoul(argv[2], &end, 10);
if(*end != '\0'){
fprintf(stderr, "the uid \"%s\" isn't a number\n", \
argv[2]);
exit(1);
}
command = &argv[3];
if(chdir(dir) < 0){
perror("chroot");
exit(1);
}
if(chroot(".") < 0){
perror("chroot");
exit(1);
}
if(setuid(uid) < 0){
perror("setuid");
exit(1);
}
execv(command[0], command);
perror("execv");
exit(1);
}
next prev parent reply other threads:[~2005-12-20 20:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-18 19:03 [uml-devel] pcap cross-linking Antoine Martin
2005-12-19 16:16 ` [uml-devel] " Blaisorblade
2005-12-19 18:33 ` [uml-devel] Re: pcap cross-linking [PATCH] Antoine Martin
2005-12-19 19:27 ` Blaisorblade
2005-12-19 21:47 ` Antoine Martin
2005-12-20 14:23 ` Blaisorblade
2005-12-20 16:25 ` Antoine Martin
2005-12-20 19:24 ` Blaisorblade
2005-12-20 20:01 ` Rob Landley
2005-12-20 20:24 ` Antoine Martin
2005-12-20 20:43 ` Blaisorblade [this message]
2005-12-21 18:13 ` Blaisorblade
2005-12-22 17:57 ` Anthony Brock
2005-12-23 16:11 ` Blaisorblade
2005-12-26 7:47 ` Anthony Brock
2005-12-29 20:12 ` Rob Landley
2006-01-01 18:51 ` Blaisorblade
2006-01-01 21:01 ` Rob Landley
2006-01-02 20:10 ` Blaisorblade
2005-12-19 18:39 ` [uml-devel] Re: pcap cross-linking Blaisorblade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200512202143.53814.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=antoine@nagafix.co.uk \
--cc=rob@landley.net \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox