Files
systemd/src/shared
Djalal Harouni af7fce1cdb install: create_symlink() check unlink() return value
create_symlink() do not check the return value of unlink(), this may
confuse the user.

Before the unlink() call we check the 'force' argument. If it is not set
we fail with -EEXIST, otherwise we unlink() the file, therefore the next
symlink() should not fail with -EEXIST (do not count races...).

However since callers may not have appropriate privileges to unlink()
the file we lose the -EPERM or any other errno code of unlink(), and
return the -EEXIST of the next symlink(). Fix this by checking unlink()
results.

Before:
$ systemctl --force --root=~/container-03 set-default multi-user.target
Failed to set default target: File exists

After:
$ systemctl --force --root=~/container-03 set-default multi-user.target
Failed to set default target: Permission denied
2014-04-16 23:13:22 -04:00
..
2014-02-12 18:30:36 +01:00
2014-02-19 17:53:50 +01:00
2014-03-04 21:06:05 +01:00
2014-03-04 21:06:05 +01:00
2014-02-19 17:53:50 +01:00
2014-03-19 16:25:11 +01:00
2013-11-22 04:23:22 +01:00
2013-11-22 04:23:22 +01:00
2014-03-24 20:07:42 +01:00
2014-03-24 20:07:42 +01:00
2013-11-30 22:20:20 -05:00
2014-04-12 17:23:13 -04:00
2013-11-20 19:36:14 +01:00
2013-10-10 21:22:59 +02:00
2013-12-03 22:27:45 +01:00
2013-10-09 17:31:41 +02:00
…
2014-03-17 01:55:47 -04:00
2014-03-17 01:55:47 -04:00
2014-04-12 17:23:13 -04:00
2013-11-20 20:52:36 +01:00
2013-10-10 04:44:48 +02:00
2014-02-21 18:42:14 +01:00
2013-02-13 08:45:13 -05:00
2013-05-16 21:58:34 +02:00
2014-02-19 17:53:50 +01:00
2014-03-17 01:55:48 -04:00
2014-02-19 17:53:50 +01:00
2014-03-17 01:55:48 -04:00
2012-11-12 19:47:43 +01:00
2013-12-03 22:27:45 +01:00
2014-02-24 19:24:14 -05:00