Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 169711 - sys-apps/fakeroot - fakeroot chgrp root <filename> fails
Summary: sys-apps/fakeroot - fakeroot chgrp root <filename> fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-07 07:35 UTC by Kees Jongenburger
Modified: 2007-03-25 12:39 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kees Jongenburger 2007-03-07 07:35:22 UTC
the fakeroot packages is supposed to allow chgrp and chown on files but does currently not.

Reproducible: Always

Steps to Reproduce:
1.a user  type fakeroot chown root .

Actual Results:  
chown: changing ownership of `.': Operation not permitted


Expected Results:  
that is works like on debian based systems
keesj@box:~$ fakeroot chown root .
keesj@box:~$ 


chown/chgrp the coreutil used by gentoo does not use the chown system calls
but uses fchownat this is why the calls are not intercepted

I have added this method on libfakeroot.c and it seams to help  it is not complete yet.

int fchownat (int __fd, __const char *__file, __uid_t __owner, __gid_t __group, int __flag){
 int fd,st,rt;
 struct stat file_stat;

 rt = fstatat(__fd, __file ,&file_stat, __flag);
 if (fd ==-1){
  return errno ;
 }
 if (S_ISDIR(file_stat.st_mode)){
   printf("FIXME \n");
   return 0;
 } else {
   fd = openat(__fd,__file,__flag);
 }
 if (fd ==-1){
  return errno ;
 }
 rt = fchown(fd,__owner,__group);

 close(fd);//always cloase the handle even if rt is invalid
 return rt;
}
Comment 1 Kees Jongenburger 2007-03-07 07:38:10 UTC
make check in a clean fakeroot also fails when changing ownership
Comment 2 SpanKY gentoo-dev 2007-03-25 12:39:41 UTC
fakeroot-1.6.5 is now in portage