Compare commits
22 commits
Author | SHA1 | Date | |
---|---|---|---|
|
c5b89a12ac | ||
|
94b4f90018 | ||
|
5e028ed26b | ||
|
da168ed89b | ||
|
858fc55d20 | ||
|
b399f87c7b | ||
|
12ce07a558 | ||
|
4e70cf070e | ||
|
0b529eaf0a | ||
|
7048ff3a3e | ||
|
1e40bcdd9c | ||
|
df798805c0 | ||
|
457bd3e133 | ||
|
372195b111 | ||
|
789db6a95a | ||
|
70b20258dc | ||
|
3ae6779e31 | ||
|
fea47ed0c9 | ||
|
aaab497afd | ||
|
c4714fb5ec | ||
|
29fe66e9cd | ||
|
445973ab71 |
6 changed files with 1069 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -129,6 +129,7 @@ ylwrap
|
|||
/more
|
||||
/mount
|
||||
/mountpoint
|
||||
/mountsh
|
||||
/namei
|
||||
/newgrp
|
||||
/nologin
|
||||
|
|
14
configure.ac
14
configure.ac
|
@ -1390,6 +1390,20 @@ AS_IF([test "x$build_fallocate" = xyes], [
|
|||
])
|
||||
|
||||
|
||||
AC_ARG_ENABLE([mountsh],
|
||||
AS_HELP_STRING([--disable-mountsh], [do not build mountsh]),
|
||||
[], [UL_DEFAULT_ENABLE([mountsh], [check])]
|
||||
)
|
||||
UL_BUILD_INIT([mountsh])
|
||||
UL_REQUIRES_LINUX([mountsh])
|
||||
UL_REQUIRES_SYSCALL_CHECK([mountsh], [UL_CHECK_SYSCALL([fsopen])], [fsopen])
|
||||
UL_REQUIRES_SYSCALL_CHECK([mountsh], [UL_CHECK_SYSCALL([fsmount])], [fsmount])
|
||||
UL_REQUIRES_SYSCALL_CHECK([mountsh], [UL_CHECK_SYSCALL([fsconfig])], [fsconfig])
|
||||
UL_REQUIRES_SYSCALL_CHECK([mountsh], [UL_CHECK_SYSCALL([move_mount])], [move_mount])
|
||||
UL_REQUIRES_SYSCALL_CHECK([mountsh], [UL_CHECK_SYSCALL([open_tree])], [open_tree])
|
||||
AM_CONDITIONAL([BUILD_MOUNTSH], [test "x$build_mountsh" = xyes])
|
||||
|
||||
|
||||
AC_ARG_ENABLE([unshare],
|
||||
AS_HELP_STRING([--disable-unshare], [do not build unshare]),
|
||||
[], [UL_DEFAULT_ENABLE([unshare], [check])]
|
||||
|
|
|
@ -311,23 +311,28 @@ static inline size_t ltrim_whitespace(unsigned char *str)
|
|||
return len;
|
||||
}
|
||||
|
||||
static inline void strrep(char *s, int find, int replace)
|
||||
static inline char *strrep(char *s, int find, int replace)
|
||||
{
|
||||
char *re = s;
|
||||
|
||||
while (s && *s && (s = strchr(s, find)) != NULL)
|
||||
*s++ = replace;
|
||||
return re;
|
||||
}
|
||||
|
||||
static inline void strrem(char *s, int rem)
|
||||
static inline char *strrem(char *s, int rem)
|
||||
{
|
||||
char *p;
|
||||
char *p, *re = s;
|
||||
|
||||
if (!s)
|
||||
return;
|
||||
return NULL;
|
||||
for (p = s; *s; s++) {
|
||||
if (*s != rem)
|
||||
*p++ = *s;
|
||||
}
|
||||
*p = '\0';
|
||||
|
||||
return re;
|
||||
}
|
||||
|
||||
extern char *strnappend(const char *s, const char *suffix, size_t b);
|
||||
|
|
4
m4/ul.m4
4
m4/ul.m4
|
@ -105,8 +105,8 @@ AC_DEFUN([UL_CHECK_SYSCALL], [
|
|||
[syscall=SYS_$1],
|
||||
[dnl Our libc failed use, so see if we can get the kernel
|
||||
dnl headers to play ball ...
|
||||
_UL_SYSCALL_CHECK_DECL([_NR_$1],
|
||||
[syscall=_NR_$1],
|
||||
_UL_SYSCALL_CHECK_DECL([__NR_$1],
|
||||
[syscall=__NR_$1],
|
||||
[
|
||||
syscall=no
|
||||
if test "x$linux_os" = xyes; then
|
||||
|
|
|
@ -322,6 +322,14 @@ INSTALL_EXEC_HOOKS += install-exec-hook-mount
|
|||
endif # BUILD_MOUNT
|
||||
|
||||
|
||||
###if BUILD_MOUNTSH
|
||||
bin_PROGRAMS += mountsh
|
||||
mountsh_SOURCES = sys-utils/mountsh.c
|
||||
mountsh_LDADD = $(LDADD) libcommon.la $(READLINE_LIBS)
|
||||
mountsh_CFLAGS = $(AM_CFLAGS)
|
||||
###endif # BUILD_MOUNTSH
|
||||
|
||||
|
||||
if BUILD_SWAPON
|
||||
sbin_PROGRAMS += swapon swapoff
|
||||
dist_man_MANS += \
|
||||
|
|
1035
sys-utils/mountsh.c
Normal file
1035
sys-utils/mountsh.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue