Fix security hole in ‘nix-store --serve’

Since it didn't check that the path received from the client is a
store path, the client could dump any path in the file system.
This commit is contained in:
Eelco Dolstra 2014-07-10 11:46:01 +02:00
parent 66dbc0fdee
commit 2c3a8f787b

View file

@ -923,7 +923,7 @@ static void opServe(Strings opFlags, Strings opArgs)
}
break;
case cmdSubstitute:
dumpPath(readString(in), out);
dumpPath(readStorePath(in), out);
break;
default:
throw Error(format("unknown serve command `%1%'") % cmd);