Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: setfscreatecon-w/invalid-context can mistakenly succeed Version-Release number of selected component (if applicable): mcstrans-0.2.7-2.fc9.x86_64 How reproducible: consistently Steps to Reproduce: with mcstransd started and selinux=enforcing, run this: while :;do mkdir d -Z xxx 2>/dev/null&&{t=X;rmdir d;}||t=.;printf $t;done Actual results: ..............................................................................\ ..............................................................................\ ..............................................................................\ ..............................................................................\ ..............................................................................\ .........................................................XX.XXX.XXXX.XXXXXXX.X\ XX.................................................XXXX.......................\ .............X.XXXX.XXX.XXX.XXX...XX.XXXXXXX.XXX.XXXX.XXX.XXX......XX..XX..XX.\ .XX..XX..XX...XX..XX..XX......................................................\ .................................................................X.XXX.XXX.XXX\ XXXX.XXX.XXXXXXXXXXXXX.XXXXXX.XXXXXXXXXXXX.XXXXXXXXX.XXXX.XXX.XXXXXX.XXXX.XX.X\ XX.XXXXXXXXXXXX.XXXX.XXX.XXX.XXX.XXXXXXX.XXX.XXX.XXXXXX.X.XXXXXX.XXX.XXXXXXX.X\ XX.XXX.XXX.XXX.XXX.XXX.XXX.XXXXXX.XXX.XXXXXXX.XX.XXXXXXXXXXXXXXXX.XXXX.XXX.XXX\ .XXXXXXX.XXX.XXXXXXX.XXXX......................................XXXXXXXXX.XXX.X\ XX.XXXXXX.XXX.XXXXXX.XXXXXXXXXXXX.XXXXXX.XXXX.XXX.XXX.XXX.XXX.XXX.XXXX.XXX.XXX\ XXXX.XXX.XXX.XXXXXXXXXXXXXXXXXX.....XXXX........X.X..XXXXXXXXXXXXXXXXX.XXX....\ .X............................................................................\ ..............................................................................\ .................................^C Expected results: all '.'s Additional info: > Each X represents a mkdir command that has mistakenly succeeded, which > includes a setfscreatecon call that is expected to fail due to the > invalid "xxx" context. Normally it fails, corresponding to "."s above: > > $ mkdir d -Z xxx > /bin/mkdir: failed to set default file creation context to `xxx': \ > Invalid argument > [Exit 1]
BTW, when I disable mcstransd, I do get all "."s
[root@rawhide ~]# while :;do mkdir d -Z xxx 2>/dev/null&&{t=X;rmdir d;}||t=.;printf $t;done bash: syntax error near unexpected token `}' What am I missing?
bash requires extra spaces near braces (I use zsh, which doesn't). This works even with bash: while :;do mkdir d -Z xxx 2>/dev/null&&{ t=X;rmdir d; }||t=.;printf $t;done
Fixed in mcstrans-0.2.8-1.fc9