Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 144518

Summary: sandbox mkdir wrapper differs in behavior than kernel
Product: Portage Development Reporter: SpanKY <vapier>
Component: SandboxAssignee: Sandbox Maintainers <sandbox>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description SpanKY gentoo-dev 2006-08-20 05:25:42 UTC
the `make check` of coreutils fails because it tries to do:
rm -rf d2
install -d d2/..

normal behavior would be:
mkdir("d2/..", 0755)                    = -1 ENOENT (No such file or directory)
mkdir("d2", 0755)                       = 0
mkdir("d2/..", 0755)                    = -1 EEXIST (File exists)
stat("d2/..", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
<success!>

the wrapper-funcs/mkdir.c does an lstat() on the canonicalized path rather than the original ... since canonicalize() doesnt actually do any filesystem calls, it has no idea if the specified path can even be resolved, it just assumes that it can be

if i change the lstat() to operate on the original pathname rather than the canonicalized one, the `install -d d2/..` works just fine ...
Comment 1 SpanKY gentoo-dev 2009-03-11 23:25:59 UTC
it's been too long since i filed this bug, so i dont recall the behind-the-scene details.  the proposed test case with `install` works fine with latest sandbox, so let's call it a day.