Questions tagged [fakeroot]

The original version `fakeroot` uses `LD_PRELOAD` to coerce child processes that expect to run as superuser (root) into thinking they get to run as superuser. A rewrite based on `ptrace` exists, named `fakeroot-ng`.

19 questions
18
votes
3 answers

How fakeroot is not a security breach in Linux?

After reading some pretty nice answers from this question, I am still fuzzy on why you would want to pretend that you are root without getting any of the benefits of actually being root. So far, what I can gather is that fakeroot is used to give…
ng.newbie
  • 1,105
  • 6
  • 17
  • 29
11
votes
3 answers

Is it possible to run debootstrap within a fakeroot environment?

I have a script that prepares an installation image by running debootstrap, does some modifications on the files and then copies the files to a disk image backed up by a file. This works under root, but I wanted to be able to run the script without…
Petr
  • 1,624
  • 2
  • 19
  • 35
6
votes
2 answers

Issue with changing permissions with fakeroot

I don't understand why the permission does not change for a user when I run the chmod command with fakeroot. Initially, the file has these permissions: -rwxr-xr-x a.txt* When I try to change the permission for the file using chmod it works…
5
votes
2 answers

fakeroot cdebootstrap: Failed to unshare: Operation not permitted

On Debian, when running: $ fakeroot cdebootstrap stable /tmp/foo cdebootstrap downloads the packages, but when it has to extract them, I get this error: E: Failed to unshare: Operation not permitted How can I run cdebootstrap as non-root? This…
Florian Margaine
  • 523
  • 4
  • 11
3
votes
1 answer

Within fakeroot, why does chown return EPERM even though it succeeds (but then again it didn't)?

I've been running into bizarre behavior when using chown(2) within a fakeroot environment. The following minimal program illustrates the issue: #include #include #include #include int main() { …
Stefan Majewsky
  • 658
  • 5
  • 15
3
votes
1 answer

dh_install: libnanomsg-dev missing files (usr/lib/*/lib*.a), aborting

I'm trying to backport libnanomsg-dev from jessie to squeeze and following this tutorial. Here's what I get: $ fakeroot debian/rules binary ... dh_testroot -O--parallel dh_prep -O--parallel dh_installdirs -O--parallel dh_auto_install…
x-yuri
  • 3,223
  • 10
  • 39
  • 62
2
votes
3 answers

How to run old 32 bit linux software in a container inside a modern 64-bit distribution

I need to create a container to run an old proprietary software that used to work in my old 32 bit computer with Ubuntu 8.04. I have been adapting this software in successive OS upgrades by linking the required libraries to the modern versions, but…
Mephisto
  • 1,067
  • 1
  • 11
  • 25
1
vote
1 answer

debootstrap --second-stage with fakechroot fails on docker (/lib/ld-linux-armhf.so.3: No such file or directory)

I am trying to set up a foreign chroot in a docker container. Excerpt from the script: apt-get -y install debootstrap fakechroot fakeroot qemu-user-static binfmt-support mkdir -p $CROSS_ROOT fakechroot fakeroot -s .fakeroot.state debootstrap…
user149408
  • 1,105
  • 1
  • 14
  • 23
1
vote
2 answers

Applications of fakeroot and chroot

Why are there two utilities chroot and fakeroot when both can fake a privileged access to the user?
Franc
  • 229
  • 3
  • 15
1
vote
1 answer

Do file writes as in-memory fake on Linux

I'd like to run a Linux process in a fake-write environment where all file writes (with the write(2) system call) are redirected to an in-memory cache, and subsequent reads (of the same region only) will be served from the cache. The cache can be…
pts
  • 1,041
  • 13
  • 22
1
vote
0 answers

Fakeroot on macOS tries to delete system directories

I’m having a problem with fakeroot on macOS. I created a pacman fork. When I’d like to delete a package, pacman tries to delete /usr/ instead of a subdirectory. On Linux, it is working fine, though. Error output: ~ sudo meme -R but-why checking…
oioioi
  • 33
  • 4
1
vote
1 answer

How to avoid running make as root in the last step of installing an application from source?

I am always reluctant to run make install as root as the last step of installing an application from source. After all, it allows executing arbitrary code form the Makefile. It has already happened to me that due to the lack of proper quoting,…
Zoltan
  • 446
  • 5
  • 16
1
vote
0 answers

fakeroot-ng with debootstrap variant fakechroot hangs on makedev

So I am trying to bootstrap a Ubuntu as unprivileged user on Ubuntu. The little script I am using is: #!/usr/bin/env bash DEBARCHIVE_URL="http://localhost:3142/de.archive.ubuntu.com/ubuntu/" LANG=en_US.UTF-8 \ fakeroot-ng -f…
0xC0000022L
  • 16,189
  • 24
  • 102
  • 168
0
votes
2 answers

How does su detect fakeroot?

If I run su, it asks for the password of the target user. If i run it as root, it does not ask for a password. But if I run it in fakeroot, how is it possible that it will ask for a password? Should fakeroot not make all programs think that you are…
jp_
  • 5
  • 2
0
votes
2 answers

Passing variables and functions through fakeroot

I want to use fakeroot for a project, but the project has lots of functions and variables that I need to pass through to fakeroot. #!/bin/bash myVar="foo" function testFunction() { echo "$myVar" } fakeroot -- bash -c testFunction but it…
Plasma
  • 121
  • 6
1
2