fix dir owner

This commit is contained in:
Joey Hess 2014-05-21 14:57:04 -04:00
parent 38bba6c8ed
commit 07d3d359d2
1 changed files with 6 additions and 2 deletions

View File

@ -107,12 +107,13 @@ keyImported keytype user = combineProperties desc
f <- liftIO $ keyfile ext
ifM (liftIO $ doesFileExist f)
( noChange
, ensureProperty $ combineProperties desc
, ensureProperties
[ property desc $
withPrivData p $ \key -> makeChange $ do
createDirectoryIfMissing True (takeDirectory f)
writer f key
, File.ownerGroup f user user
, File.ownerGroup (takeDirectory f) user user
]
)
keyfile ext = do
@ -150,4 +151,7 @@ authorizedKeys user = property (user ++ " has authorized_keys") $
liftIO $ do
createDirectoryIfMissing True (takeDirectory f)
writeFileProtected f v
ensureProperty $ File.ownerGroup f user user
ensureProperties
[ File.ownerGroup f user user
, File.ownerGroup (takeDirectory f) user user
]