A little background: in linux emulation any access to file system node is first tried with "/compt/linux" prepended to its path, original path is tried only if linuxified path is not vaiable. In that fashion linux applications can access both files under linux emulation root (/compat/linux) and those files under the real root that are not shadowed by the former files. This behavior is reverted only for one filesystem node - "/compat/linux" itself. That is, no application under linux emualtion is able to access linux compatibility root, real root ("/") is given to it instead. This seems to be illogical, linux application is probably more ineterested in linux root directory rather than real root directory. Also, no linux application should ever want to "break out" from linux root by "cd ..". So I think that the special handling for root directories should be removed and real root directory should be shadowed by /compat/linux. Existing linux emulation behavior also breaks "mkdir -p" from linux base r7, if you want to creat a directory with more than one path unexstistant component: in this case mkdir first performs chdir("/") and then iterativly mkdir()s and chdir()s to subdirectories. So, the first action, chdir("/") would chdir to real root and directory created either will be wrong one or will not be created at all because of permissions. Please also see my attemps to discuss this issue on mailing lists: http://docs.freebsd.org/cgi/mid.cgi?4178DBA0.8050605 http://docs.freebsd.org/cgi/mid.cgi?4176A6C0.5070408 I have applied the patch attached on my system and have not seen any problems with linux emulation, only improvements. I run oracle 9, ibm websphere 5.1 with mq and wemps. How-To-Repeat: 1. work as unpriviledged user with shell /compat/linux/bin/bash 2. make sure /var and /compat/linux/var are different directories 3. create /compat/linux/var/foo directory with rwx permission for the user mentioned in step 1. 4. make sure there is no /var/foo directory 5. execute "mkdir -p /var/foo/1/2/3" as user from step 1. 6. see the above command fail with permission denied error 7. apply the attached patch 8. recompile kernel and/or linux.ko, reboot 9. try the same again 10. see successful creation of expected directory
Responsible Changed From-To: freebsd-bugs->emulation Reassign to appropriate mailing list.
Andriy, I'm sorry to see your PR being in GNATS for years. I've checked your issue and was not able to get your patch into sync with current RELENG_7 sources. I'm wondering if you're still thinking, the issue is real and am willing to send in new patches? If you think this issue has been solved in the meantime, please report back so we can close this PR. Thanks!
State Changed From-To: open->feedback Note that submitter has been asked for feedback.
Well, I think that the issue described in this PR still holds. On the other hand, I now think that some people might still prefer current behavior over what I suggest. There could be some POLA concerns too. Another concern is that now the code is common to all emulation, so it's not linux specific anymore. In any case, I am attaching a patch that I currently use. -- Andriy Gapon
An updated patch that makes the proposed behavior controlled by sysctl. Present behavior is the default. -- Andriy Gapon
State Changed From-To: feedback->open feedback and new patch provided
State Changed From-To: open->closed It seems that the suggested change is not really useful for general FreeBSD user base. And I have no use for it now as well.