summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-07-17 12:20:32 +0200
committerLennart Poettering <lennart@poettering.net>2024-07-19 11:44:04 +0200
commit4a24cc859f2fc9834ce2af633d5b4c582e5627f7 (patch)
treef3ec04dfd54c3f21218fa17f77254e61f3c65300 /src/shared
parentman: clarify what TTYReset= and TTYVTDisallocate= do and do not do regarding ... (diff)
downloadsystemd-4a24cc859f2fc9834ce2af633d5b4c582e5627f7.tar.xz
systemd-4a24cc859f2fc9834ce2af633d5b4c582e5627f7.zip
terminal-util: move lock_dev_console() here
It doesn't really make sense to have that in dev-setup.c, which is mostly about setting up /dev/, creating device nodes and stuff. let's move it to the other stuff that deals with /dev/console's peculiarities.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/dev-setup.c17
-rw-r--r--src/shared/dev-setup.h2
2 files changed, 0 insertions, 19 deletions
diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c
index 4b4b62565c..eb72793c04 100644
--- a/src/shared/dev-setup.c
+++ b/src/shared/dev-setup.c
@@ -18,23 +18,6 @@
#include "umask-util.h"
#include "user-util.h"
-int lock_dev_console(void) {
- _cleanup_close_ int fd = -EBADF;
- int r;
-
- /* NB: We do not use O_NOFOLLOW here, because some container managers might place a symlink to some
- * pty in /dev/console, in which case it should be fine to lock the target TTY. */
- fd = open_terminal("/dev/console", O_RDONLY|O_CLOEXEC|O_NOCTTY);
- if (fd < 0)
- return fd;
-
- r = lock_generic(fd, LOCK_BSD, LOCK_EX);
- if (r < 0)
- return r;
-
- return TAKE_FD(fd);
-}
-
int dev_setup(const char *prefix, uid_t uid, gid_t gid) {
static const char symlinks[] =
"-/proc/kcore\0" "/dev/core\0"
diff --git a/src/shared/dev-setup.h b/src/shared/dev-setup.h
index 5339bc4e5e..92ba6cf764 100644
--- a/src/shared/dev-setup.h
+++ b/src/shared/dev-setup.h
@@ -3,8 +3,6 @@
#include <sys/types.h>
-int lock_dev_console(void);
-
int dev_setup(const char *prefix, uid_t uid, gid_t gid);
int make_inaccessible_nodes(const char *parent_dir, uid_t uid, gid_t gid);