[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: make-kpkg: permission denied making modules_image



On Monday 30 June 2003 05:06 pm, martin f krafft wrote:
> also sprach Kevin McKinley <ronin2@bellatlantic.net> [2003.06.30.1548 
+0200]:
> > When you do "fakeroot make-kpkg ..." make-kpkg itself runs under
> > fakeroot, so a root environment is provided whenever necessary,
> > instead of "as expected" by make-kpkg's author.
>
> I still don't understand why that would solve the problem.

I don't think that I have really understood fakeroot myself..  After 
running some experiments myself because of this thread, I think a light is 
beginning to come on...

> piper:/usr/src> ls -ld .
> drwxrwsr-x    2 root     src            48 2002-02-08 16:42 .
> piper:/usr/src> groups | grep src || echo not a member of group src.
> not a member of group src.
> piper:/usr/src> fakeroot touch foo
> touch: cannot touch `foo': Permission denied

Correct...  I believe that to have write access to the files in /usr/src, 
you need to be in group "src"... it seems that fakeroot does not give you 
any "real" file permissions...  it seems that you cannot access a file 
under fakeroot in any way that you couldn't as a real user..  As a matter 
if fact, after looking at the examples given in the man page, if you write 
a file under fakeroot,  as long as you're operating under fakeroot, it all 
looks like it's root's file.. but after you exit fakeroot, all of a sudden, 
it's really "your" file, after all.. 

dlb@localhost:~$ fakeroot
root@localhost:~# whoami
root
root@localhost:~# touch tmp/rootfile
root@localhost:~# ll tmp/rootfile (Note:  I don't even have ll aliased for 
root)
-rw-r--r--    1 root     root            0 Jul  1 14:59 tmp/rootfile
root@localhost:~# exit
exit
dlb@localhost:~$ ll tmp/rootfile
-rw-r--r--    1 dlb      dlb             0 Jul  1 14:59 tmp/rootfile

So, in reality, fakeroot is only an "illusion"..  and it's only use, 
AFAICT, is to write files to the debs that show root ownership.

Also, after reading the manpage for fakeroot, the "correct" way to run 
make-kpkg may be with the --rootcmd option.  In a previous post in this 
thread, I said that I got a permission error on rewriting the debian/ 
directory if I ran with the --rootcmd option but not with "fakeroot 
make-kpkg...", but now... I don't understand why this would make a 
difference.....



Reply to: