diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-14 19:09:00 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-05-14 19:09:00 +0200 |
| commit | c1b34ef94cc4aab4b362fe4630a154f6acff490f (patch) | |
| tree | c98af53e332580be832241940f84a2e166cf6555 | |
| parent | ebb9552ab50fa22ac2989c3c462ab0b495979b78 (diff) | |
| download | nixos-c1b34ef94cc4aab4b362fe4630a154f6acff490f.tar nixos-c1b34ef94cc4aab4b362fe4630a154f6acff490f.tar.gz nixos-c1b34ef94cc4aab4b362fe4630a154f6acff490f.tar.bz2 nixos-c1b34ef94cc4aab4b362fe4630a154f6acff490f.tar.xz nixos-c1b34ef94cc4aab4b362fe4630a154f6acff490f.zip | |
setuid foo
| -rw-r--r-- | custom/thinklight.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/custom/thinklight.nix b/custom/thinklight.nix index f001f9fd..ced11d02 100644 --- a/custom/thinklight.nix +++ b/custom/thinklight.nix | |||
| @@ -21,7 +21,7 @@ stdenv.mkDerivation { | |||
| 21 | import Prelude hiding (readFile) | 21 | import Prelude hiding (readFile) |
| 22 | import Data.List (intersperse) | 22 | import Data.List (intersperse) |
| 23 | import Data.Maybe (fromMaybe) | 23 | import Data.Maybe (fromMaybe) |
| 24 | import System.Posix.User (setUserID) | 24 | import System.Posix.User (setEffectiveUserID) |
| 25 | 25 | ||
| 26 | data Mode = On | Off | Toggle | Blink deriving (Read, Show, Eq) | 26 | data Mode = On | Off | Toggle | Blink deriving (Read, Show, Eq) |
| 27 | 27 | ||
| @@ -29,7 +29,7 @@ stdenv.mkDerivation { | |||
| 29 | main = do | 29 | main = do |
| 30 | args <- getArgs | 30 | args <- getArgs |
| 31 | let mode = if length args >= 1 then read $ head args else Toggle | 31 | let mode = if length args >= 1 then read $ head args else Toggle |
| 32 | setUserID 0 | 32 | setEffectiveUserID 0 |
| 33 | sequence $ map (\g -> catchIOError g (\e -> if isDoesNotExistError e then return () else ioError e)) [thinklight mode] | 33 | sequence $ map (\g -> catchIOError g (\e -> if isDoesNotExistError e then return () else ioError e)) [thinklight mode] |
| 34 | return () | 34 | return () |
| 35 | 35 | ||
