fix: no need for unnecessary dependencies

fix(vsftpd): a few bugs
This commit is contained in:
Mahdi Dibaiee 2017-03-21 13:35:37 +03:30
parent 5550b17522
commit 46eaf3e4f6
6 changed files with 19 additions and 21 deletions

View File

@ -18,7 +18,6 @@ executable mongodb
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >= 4.7 && < 5 build-depends: base >= 4.7 && < 5
, data-default-class , data-default-class
, mtl
, mongoDB >= 2.1.1.1 && < 3 , mongoDB >= 2.1.1.1 && < 3
, bytestring , bytestring
, text , text

View File

@ -18,5 +18,4 @@ executable mysql
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >= 4.7 && < 5 build-depends: base >= 4.7 && < 5
, data-default-class , data-default-class
, mtl
, mysql >= 0.1.4 && < 1 , mysql >= 0.1.4 && < 1

View File

@ -19,6 +19,4 @@ executable nginx
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >= 4.7 && < 5 build-depends: base >= 4.7 && < 5
, data-default-class , data-default-class
, monad-control
, mtl
, free , free

View File

@ -18,4 +18,3 @@ executable vsftpd
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >= 4.7 && < 5 build-depends: base >= 4.7 && < 5
, data-default-class , data-default-class
, mtl

View File

@ -14,7 +14,7 @@ module Main (call, main) where
import Control.Monad.Free import Control.Monad.Free
import Data.List import Data.List
import Data.Either import Data.Either
import Control.Monad.State import Control.Monad.State hiding (liftIO)
call :: Service -> App () call :: Service -> App ()
@ -33,10 +33,13 @@ module Main (call, main) where
(Right opensslResponse) <- execute "openssl" ["passwd", "-1", pass] "" True (Right opensslResponse) <- execute "openssl" ["passwd", "-1", pass] "" True
let encryptedPassword = head . lines $ opensslResponse let encryptedPassword = head . lines $ opensslResponse
executeRoot "useradd" [user, "-d", directory, "-G", "ftp", "-p", encryptedPassword] "" True executeRoot "groupadd" ["-f", "ftp"] "" False
executeRoot "useradd" [user, "-d", directory, "-G", "ftp", "-p", encryptedPassword] "" False
liftIO $ do liftIO $ do
execIfExists original $ do
renameFileIfMissing original (original ++ ".backup") renameFileIfMissing original (original ++ ".backup")
writeFile original content writeFile original content
writeFile userList user writeFile userList user

View File

@ -35,7 +35,6 @@ module Types ( FileSharingParams (..)
, anonymousWrite = False , anonymousWrite = False
, recreateUser = False , recreateUser = False
} }
instance Show FileSharingParams where instance Show FileSharingParams where
show (FileSharingParams { directory, user, pass, port, writable, anonymous, anonymousWrite }) = show (FileSharingParams { directory, user, pass, port, writable, anonymous, anonymousWrite }) =
let boolToEnglish True = "YES" let boolToEnglish True = "YES"
@ -50,6 +49,7 @@ module Types ( FileSharingParams (..)
, ("userlist_enable", "YES") , ("userlist_enable", "YES")
, ("userlist_file", "/etc/vsftpd-serverman-user-list") , ("userlist_file", "/etc/vsftpd-serverman-user-list")
, ("userlist_deny", "NO") , ("userlist_deny", "NO")
, ("chroot_local_user", "YES") , ("local_root", directory)
, ("xferlog_enable", "YES") , ("xferlog_enable", "YES")
, ("local_enable", "YES")] "=" , ("local_enable", "YES")
, ("pam_service_name", "ftp")] "="