Fix reversion in init when ran as root, introduced in version 5.20150731.
This commit is contained in:
parent
1e3d7ad4e0
commit
c242e248e8
4 changed files with 17 additions and 2 deletions
|
@ -40,6 +40,7 @@ import Upgrade
|
|||
import Utility.UserInfo
|
||||
import Utility.FileMode
|
||||
import Annex.Perms
|
||||
import System.Posix.User
|
||||
#endif
|
||||
|
||||
genDescription :: Maybe String -> Annex String
|
||||
|
@ -141,8 +142,10 @@ probeCrippledFileSystem = do
|
|||
-- Should be unable to write to the file, unless
|
||||
-- running as root, but some crippled
|
||||
-- filesystems ignore write bit removals.
|
||||
unlessM
|
||||
not <$> catchBoolIO (writeFile f "2" >> return True)
|
||||
ifM ((== 0) <$> getRealUserID)
|
||||
( return True
|
||||
, not <$> catchBoolIO (writeFile f "2" >> return True)
|
||||
)
|
||||
#endif
|
||||
|
||||
checkCrippledFileSystem :: Annex ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue