summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.c4
-rw-r--r--src/core/mount.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 2cef70e668..e718c43df9 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -552,6 +552,10 @@ static int chown_terminal(int fd, uid_t uid) {
assert(fd >= 0);
+ /* Before we chown/chmod the TTY, let's ensure this is actually a tty */
+ if (isatty(fd) < 1)
+ return 0;
+
/* This might fail. What matters are the results. */
(void) fchown(fd, uid, -1);
(void) fchmod(fd, TTY_MODE);
diff --git a/src/core/mount.c b/src/core/mount.c
index 665a60bb55..fda4d65d6f 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1706,6 +1706,7 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
/* This has just been unmounted by
* somebody else, follow the state
* change. */
+ mount->result = MOUNT_SUCCESS; /* make sure we forget any earlier umount failures */
mount_enter_dead(mount, MOUNT_SUCCESS);
break;