diff options
author | maximilian attems <max@stro.at> | 2012-05-22 11:04:42 +0200 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2012-05-22 11:04:42 +0200 |
commit | db9f464c660023eac861d661840fcef6809db163 (patch) | |
tree | 4e6287e2e8b7f00275b28110caabac8941c65b15 | |
parent | f41c1d74c6a8e3d463e7e4291b112b367eb8b097 (diff) | |
download | klibc-db9f464c660023eac861d661840fcef6809db163.tar.gz |
[klibc] ipconfig: Use /run/ directory for script file
This could be made to be an optional switch,
but for security reason /run is just as good, due to unprivileged
users not beeing allowed to write there.
http://www.zytor.com/pipermail/klibc/2011-May/002912.html
Reported-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/kinit/ipconfig/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c index 476384acbd04b4..7be2a1fcb5af91 100644 --- a/usr/kinit/ipconfig/main.c +++ b/usr/kinit/ipconfig/main.c @@ -147,8 +147,9 @@ static void dump_device_config(struct netdev *dev) * sizeof(UINT64_MAX)==21 */ char buf21[21]; + const char path[] = "/run/"; - snprintf(fn, sizeof(fn), "/tmp/net-%s.conf", dev->name); + snprintf(fn, sizeof(fn), "%snet-%s.conf", path, dev->name); f = fopen(fn, "w"); if (f) { write_option(f, "DEVICE", dev->name); |