Compare commits
258 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c87ed81c2c | ||
|
09904cbd56 | ||
|
5fa93ec5e0 | ||
|
3bf1f5a44f | ||
|
4ffd39d553 | ||
|
a228e53a4b | ||
|
a04c11370c | ||
|
d65ce0b32c | ||
|
260ccc24c5 | ||
|
c96992b25e | ||
|
dd1f0e5a82 | ||
|
f64c455630 | ||
|
1f18765a68 | ||
|
6c5649c0b6 | ||
|
6578411a87 | ||
|
3b965f951d | ||
|
c409cb5073 | ||
|
f3b1a65177 | ||
|
5abc3df64a | ||
|
f9a78e1def | ||
|
f55af7b31a | ||
|
93b5e7b623 | ||
|
b3ca809df8 | ||
|
2abaf6eb96 | ||
|
f9f53d46a2 | ||
|
31097faf0c | ||
|
e7be6ae5f5 | ||
|
cca6bc092d | ||
|
e86e462be5 | ||
|
b50e3f3a07 | ||
|
f00635cf14 | ||
|
985b3cb330 | ||
|
05489e2334 | ||
|
2002e7d438 | ||
|
8abfa74392 | ||
|
1c853c1f4b | ||
|
b188598d35 | ||
|
08aad7c190 | ||
|
5977e189d6 | ||
|
347549f079 | ||
|
c48435329a | ||
|
b441300c92 | ||
|
b0e9e3bcb8 | ||
|
16f25ffc54 | ||
|
5aecaa99fe | ||
|
f991f6faa9 | ||
|
98af691bc7 | ||
|
ed9b0d3627 | ||
|
acc3919c15 | ||
|
e998a685f7 | ||
|
098671aa4d | ||
|
fe0e3c7437 | ||
|
7c81cc769f | ||
|
580f0fece0 | ||
|
9a75633915 | ||
|
f1bf9845c3 | ||
|
20ae04497c | ||
|
2831759869 | ||
|
523a7c4f54 | ||
|
086a8aa5c9 | ||
|
028de3ee58 | ||
|
b3e437baf2 | ||
|
7c4fd7f42a | ||
|
80deb77249 | ||
|
a61dbe7cc6 | ||
|
2cde2b2546 | ||
|
42ab31a080 | ||
|
707076abd5 | ||
|
83243ee93c | ||
|
4ac61ab4ac | ||
|
4820f4132a | ||
|
a1ba076eea | ||
|
a495296401 | ||
|
c0267df5f2 | ||
|
7748eaf530 | ||
|
351fc04cd1 | ||
|
5ecbe52e91 | ||
|
6469bd527b | ||
|
8645c3a8bd | ||
|
11d74871f2 | ||
|
7152f9510d | ||
|
ffe5e68263 | ||
|
bdd2c5116b | ||
|
a3884eaf3e | ||
|
59614e3019 | ||
|
bfac7fc8c6 | ||
|
052fa90bc6 | ||
|
5940ccada5 | ||
|
4ada5eaed7 | ||
|
437d842852 | ||
|
c18880bcb1 | ||
|
ba7c336b4c | ||
|
c96e764d51 | ||
|
3d6431f7c5 | ||
|
4c91ee804e | ||
|
279eda57a9 | ||
|
d3224d47ec | ||
|
3d667f8a82 | ||
|
8039d29dfb | ||
|
530b947e7b | ||
|
58bac092a5 | ||
|
55938ef1c2 | ||
|
8db7d85a0e | ||
|
4420515181 | ||
|
3251a896f8 | ||
|
95b12b7aa0 | ||
|
a56a94947c | ||
|
401fd81490 | ||
|
8aba0e5c79 | ||
|
208b062ff6 | ||
|
2cbb58aee9 | ||
|
93789c7721 | ||
|
558fdf8110 | ||
|
8aba564a5f | ||
|
d8ee2107f1 | ||
|
f898c96467 | ||
|
c186315fe8 | ||
|
cdab8b4a76 | ||
|
17b923cc1e | ||
|
77887c051b | ||
|
4efad38df3 | ||
|
04f1d57f74 | ||
|
07ed6e64f8 | ||
|
d3eae21d69 | ||
|
3d940d4e83 | ||
|
b570e8a4eb | ||
|
c55c42ae5d | ||
|
b106becc25 | ||
|
ef494ba0d6 | ||
|
e91f50c406 | ||
|
de66720388 | ||
|
2afb30fac6 | ||
|
02e8b22b8e | ||
|
77818367d0 | ||
|
e466e3cc2f | ||
|
c67f1a42d8 | ||
|
ae201aa504 | ||
|
3f8e6b01a1 | ||
|
c3fa85dd81 | ||
|
9f10eae074 | ||
|
c9e662019e | ||
|
9da9be552a | ||
|
6af60835d3 | ||
|
1a7e2063fd | ||
|
1dd1b6a182 | ||
|
298e4e50ad | ||
|
185c052093 | ||
|
bfcb468173 | ||
|
6278f8fb46 | ||
|
781e4d0274 | ||
|
b92fbbf0f8 | ||
|
ee6d69b122 | ||
|
fa67a47381 | ||
|
c9a44d115f | ||
|
05c81d18b2 | ||
|
0b35981e89 | ||
|
3fe05ecbfc | ||
|
eab90e03d7 | ||
|
0d11c1c42f | ||
|
8b794a5fc5 | ||
|
aa5805ac25 | ||
|
f6a3ca6784 | ||
|
55f81a38e7 | ||
|
8e74662110 | ||
|
d6ff12d6dc | ||
|
34a74aadf6 | ||
|
89d447eb6c | ||
|
f789f0d9fc | ||
|
d4fa6b5537 | ||
|
b079edfd15 | ||
|
71fd605ed8 | ||
|
8d539d225f | ||
|
5de818c896 | ||
|
ab1e5c59d6 | ||
|
361265db38 | ||
|
9165bd23fd | ||
|
1fc81bb819 | ||
|
4be87e9faa | ||
|
9016a84fba | ||
|
594dffa0d4 | ||
|
b06e73cfce | ||
|
5c303e7460 | ||
|
299715637f | ||
|
a8e3fb405f | ||
|
ec1e4fccb3 | ||
|
f708bc4f81 | ||
|
d9d58da0e7 | ||
|
90488bdc3b | ||
|
aca47746da | ||
|
ea09323fa7 | ||
|
120f8c1351 | ||
|
3c3df501f7 | ||
|
636ae6f91d | ||
|
f16c031219 | ||
|
a6e628e5e7 | ||
|
49ff57a01e | ||
|
2cfecf3529 | ||
|
706e746809 | ||
|
d7262717be | ||
|
5a1ed95fbe | ||
|
2919d71edd | ||
|
bf69284dde | ||
|
e1b05c26c4 | ||
|
85ffd93331 | ||
|
067da383fc | ||
|
d2b0e417cf | ||
|
506ce7948f | ||
|
1ae81e57b4 | ||
|
19ed00a32f | ||
|
59ea5186b7 | ||
|
3fc0e67f32 | ||
|
379232cd95 | ||
|
7bc31e71b7 | ||
|
3d430624ce | ||
|
4a3cb48228 | ||
|
4788cbd6e7 | ||
|
27a5499f1e | ||
|
2c19cdfe49 | ||
|
c2496a27a2 | ||
|
cb9405c20e | ||
|
2a4e9f041e | ||
|
8e3b51d51a | ||
|
1bc2448b90 | ||
|
0a456518f3 | ||
|
dff9e6fd53 | ||
|
ead2073dab | ||
|
84d2be4ab3 | ||
|
7443d56081 | ||
|
2adc0e74a6 | ||
|
4d123a0a11 | ||
|
5fd3817ee5 | ||
|
e79ab2d9de | ||
|
82639d6500 | ||
|
49e6ba1400 | ||
|
1de1774f06 | ||
|
1d0642d057 | ||
|
e5224a209a | ||
|
0d8c506be7 | ||
|
7518e4396c | ||
|
77dc49ad7c | ||
|
a887e3b8da | ||
|
32be86ade7 | ||
|
7cb4cff5d3 | ||
|
6c2b43a945 | ||
|
952f94ffaf | ||
|
f6117ff853 | ||
|
b2fdd8fbf3 | ||
|
d1bad96edd | ||
|
8587dd2a9a | ||
|
9966c1fdc6 | ||
|
8a8438a080 | ||
|
dc4135e724 | ||
|
16cfb1591e | ||
|
c8007f2ee2 | ||
|
6d73e5dfdf | ||
|
1d99930816 | ||
|
ad1b19d275 | ||
|
cbffb8f231 |
85
.gitignore
vendored
85
.gitignore
vendored
@ -4,4 +4,89 @@
|
|||||||
/util-linux-2.19-rc2.tar.bz2
|
/util-linux-2.19-rc2.tar.bz2
|
||||||
/util-linux-2.19-rc3.tar.bz2
|
/util-linux-2.19-rc3.tar.bz2
|
||||||
/util-linux-2.19.tar.bz2
|
/util-linux-2.19.tar.bz2
|
||||||
|
*~
|
||||||
|
.*.log
|
||||||
|
*.rpm
|
||||||
|
/floppy-0.18.tar.bz2
|
||||||
|
/util-linux-2.19.1-rc1.tar.bz2
|
||||||
/util-linux-2.19.1.tar.bz2
|
/util-linux-2.19.1.tar.bz2
|
||||||
|
/util-linux-2.20-rc1.tar.bz2
|
||||||
|
/util-linux-2.20-rc2.tar.bz2
|
||||||
|
/util-linux-2.20.tar.bz2
|
||||||
|
/util-linux-2.20.1.tar.bz2
|
||||||
|
/util-linux-2.21-rc2.tar.xz
|
||||||
|
/util-linux-2.21.tar.xz
|
||||||
|
/util-linux-2.21.1.tar.xz
|
||||||
|
/util-linux-2.21.2.tar.xz
|
||||||
|
/util-linux-2.22-rc2.tar.xz
|
||||||
|
/util-linux-2.22.tar.xz
|
||||||
|
/util-linux-2.22.1.tar.xz
|
||||||
|
/util-linux-2.22.2.tar.xz
|
||||||
|
/util-linux-2.23-rc1.tar.xz
|
||||||
|
/util-linux-2.23-rc2.tar.xz
|
||||||
|
/util-linux-2.23.tar.xz
|
||||||
|
/util-linux-2.23.1.tar.xz
|
||||||
|
/util-linux-2.23.2.tar.xz
|
||||||
|
/util-linux-2.24-rc1.tar.xz
|
||||||
|
/util-linux-2.24.tar.xz
|
||||||
|
/util-linux-2.24.1.tar.xz
|
||||||
|
/util-linux-2.24.2.tar.xz
|
||||||
|
/util-linux-2.25-rc1.tar.xz
|
||||||
|
/util-linux-2.25-rc2.tar.xz
|
||||||
|
/util-linux-2.25.tar.xz
|
||||||
|
/util-linux-2.25.1-rc1.tar.xz
|
||||||
|
/util-linux-2.25.1.tar.xz
|
||||||
|
/util-linux-2.25.2.tar.xz
|
||||||
|
/util-linux-2.26-rc1.tar.xz
|
||||||
|
/util-linux-2.26-rc2.tar.xz
|
||||||
|
/util-linux-2.26.tar.xz
|
||||||
|
/util-linux-2.26.2.tar.xz
|
||||||
|
/util-linux-2.27-rc1.tar.xz
|
||||||
|
/util-linux-2.27-rc2.tar.xz
|
||||||
|
/util-linux-2.27.tar.xz
|
||||||
|
/util-linux-2.27.1.tar.xz
|
||||||
|
/util-linux-2.28-rc1.tar.xz
|
||||||
|
/util-linux-2.28-rc2.tar.xz
|
||||||
|
/util-linux-2.28.tar.xz
|
||||||
|
/util-linux-2.28.1.tar.xz
|
||||||
|
/util-linux-2.28.2.tar.xz
|
||||||
|
/util-linux-2.29-rc1.tar.xz
|
||||||
|
/util-linux-2.29-rc2.tar.xz
|
||||||
|
/util-linux-2.29.tar.xz
|
||||||
|
/util-linux-2.29.1.tar.xz
|
||||||
|
/util-linux-2.29.2.tar.xz
|
||||||
|
/util-linux-2.30-rc1.tar.xz
|
||||||
|
/util-linux-2.30.tar.xz
|
||||||
|
/util-linux-2.30.1.tar.xz
|
||||||
|
/util-linux-2.30.2.tar.xz
|
||||||
|
/util-linux-2.31-rc1.tar.xz
|
||||||
|
/util-linux-2.31-rc2.tar.xz
|
||||||
|
/util-linux-2.31.tar.xz
|
||||||
|
/util-linux-2.32-rc1.tar.xz
|
||||||
|
/util-linux-2.32.tar.xz
|
||||||
|
/util-linux-2.32.1.tar.xz
|
||||||
|
/util-linux-2.33-rc2.tar.xz
|
||||||
|
/util-linux-2.33.1.tar.xz
|
||||||
|
/util-linux-2.33.2.tar.xz
|
||||||
|
/util-linux-2.34-rc1.tar.xz
|
||||||
|
/util-linux-2.34-rc2.tar.xz
|
||||||
|
/util-linux-2.34.tar.xz
|
||||||
|
/util-linux-2.35-rc1.tar.xz
|
||||||
|
/util-linux-2.35-rc1-20-63f8.tar.xz
|
||||||
|
/util-linux-2.35-rc2.tar.xz
|
||||||
|
/util-linux-2.35.tar.xz
|
||||||
|
/util-linux-2.35.1.tar.xz
|
||||||
|
/util-linux-2.35.2.tar.xz
|
||||||
|
/util-linux-2.36.tar.xz
|
||||||
|
/util-linux-2.36.1.tar.xz
|
||||||
|
/util-linux-2.36.2.tar.xz
|
||||||
|
/util-linux-2.37-rc2.tar.xz
|
||||||
|
/util-linux-2.37.tar.xz
|
||||||
|
/util-linux-2.37.2.tar.xz
|
||||||
|
/util-linux-2.38-rc1.tar.xz
|
||||||
|
/util-linux-2.38-rc3.tar.xz
|
||||||
|
/util-linux-2.38.tar.xz
|
||||||
|
/util-linux-2.38.1.tar.xz
|
||||||
|
/util-linux-2.39-rc1.tar.xz
|
||||||
|
/util-linux-2.39-rc2.tar.xz
|
||||||
|
/util-linux-2.39-rc3.tar.xz
|
||||||
|
12
STAGE1-util-linux
Normal file
12
STAGE1-util-linux
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
srpm util-linux
|
||||||
|
mcd $BUILDDIR/$1
|
||||||
|
cat <<EOF > config.cache
|
||||||
|
ax_cv_have_tls=yes
|
||||||
|
scanf_cv_alloc_modifier=ms
|
||||||
|
EOF
|
||||||
|
$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --without-tinfo \
|
||||||
|
--prefix=/usr --libexecdir=/usr/lib${SUFFIX} --libdir=/usr/lib${SUFFIX} \
|
||||||
|
--disable-wall --cache-file=config.cache --without-python --without-systemd
|
||||||
|
notparallel
|
||||||
|
make $J V=1
|
||||||
|
make $J install DESTDIR=${ROOTFS}
|
13
login-default-motd-file.patch
Normal file
13
login-default-motd-file.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/include/pathnames.h b/include/pathnames.h
|
||||||
|
index 3845d4c33..fac3a0783 100644
|
||||||
|
--- a/include/pathnames.h
|
||||||
|
+++ b/include/pathnames.h
|
||||||
|
@@ -41,7 +41,7 @@
|
||||||
|
#ifndef _PATH_MAILDIR
|
||||||
|
# define _PATH_MAILDIR "/var/spool/mail"
|
||||||
|
#endif
|
||||||
|
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
|
||||||
|
+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
|
||||||
|
#ifndef _PATH_NOLOGIN
|
||||||
|
# define _PATH_NOLOGIN "/etc/nologin"
|
||||||
|
#endif
|
12
login-lastlog-create.patch
Normal file
12
login-lastlog-create.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c
|
||||||
|
--- util-linux-2.36/login-utils/login.c.kzak 2020-07-23 14:13:26.777030764 +0200
|
||||||
|
+++ util-linux-2.36/login-utils/login.c 2020-07-23 14:11:22.793686983 +0200
|
||||||
|
@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con
|
||||||
|
sa.sa_handler = SIG_IGN;
|
||||||
|
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
|
||||||
|
|
||||||
|
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
|
||||||
|
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
|
||||||
|
if (fd < 0)
|
||||||
|
goto done;
|
||||||
|
offset = cxt->pwd->pw_uid * sizeof(ll);
|
63
nologin.8
63
nologin.8
@ -1,63 +0,0 @@
|
|||||||
.\" $OpenBSD: nologin.8,v 1.8 1999/06/04 02:45:19 aaron Exp $
|
|
||||||
.\" $NetBSD: nologin.8,v 1.3 1995/03/18 14:59:09 cgd Exp $
|
|
||||||
.\"
|
|
||||||
.\" Copyright (c) 1993
|
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
|
||||||
.\"
|
|
||||||
.\" Redistribution and use in source and binary forms, with or without
|
|
||||||
.\" modification, are permitted provided that the following conditions
|
|
||||||
.\" are met:
|
|
||||||
.\" 1. Redistributions of source code must retain the above copyright
|
|
||||||
.\" notice, this list of conditions and the following disclaimer.
|
|
||||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
.\" notice, this list of conditions and the following disclaimer in the
|
|
||||||
.\" documentation and/or other materials provided with the distribution.
|
|
||||||
.\" 3. All advertising materials mentioning features or use of this software
|
|
||||||
.\" must display the following acknowledgement:
|
|
||||||
.\" This product includes software developed by the University of
|
|
||||||
.\" California, Berkeley and its contributors.
|
|
||||||
.\" 4. Neither the name of the University nor the names of its contributors
|
|
||||||
.\" may be used to endorse or promote products derived from this software
|
|
||||||
.\" without specific prior written permission.
|
|
||||||
.\"
|
|
||||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
||||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
||||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
||||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
.\" SUCH DAMAGE.
|
|
||||||
.\"
|
|
||||||
.\" @(#)nologin.8 8.1 (Berkeley) 6/19/93
|
|
||||||
.\"
|
|
||||||
.Dd February 15, 1997
|
|
||||||
.Dt NOLOGIN 8
|
|
||||||
.Os
|
|
||||||
.Sh NAME
|
|
||||||
.Nm nologin
|
|
||||||
.Nd politely refuse a login
|
|
||||||
.Sh SYNOPSIS
|
|
||||||
.Nm nologin
|
|
||||||
.Sh DESCRIPTION
|
|
||||||
.Nm
|
|
||||||
displays a message that an account is not available and
|
|
||||||
exits non-zero.
|
|
||||||
It is intended as a replacement shell field for accounts that
|
|
||||||
have been disabled.
|
|
||||||
.Pp
|
|
||||||
If the file
|
|
||||||
.Pa /etc/nologin.txt
|
|
||||||
exists,
|
|
||||||
.Nm
|
|
||||||
displays its contents to the user instead of the default message.
|
|
||||||
.Sh SEE ALSO
|
|
||||||
.Xr login 1
|
|
||||||
.Sh HISTORY
|
|
||||||
The
|
|
||||||
.Nm
|
|
||||||
command appeared in
|
|
||||||
.Bx 4.4 .
|
|
58
nologin.c
58
nologin.c
@ -1,58 +0,0 @@
|
|||||||
/* $OpenBSD: nologin.c,v 1.2 1997/04/04 16:51:37 millert Exp $ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 1997, Jason Downs. All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
|
|
||||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
|
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/* Distinctly different from _PATH_NOLOGIN. */
|
|
||||||
#define _PATH_NOLOGIN_TXT "/etc/nologin.txt"
|
|
||||||
|
|
||||||
#define DEFAULT_MESG "This account is currently not available.\n"
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
int main(argc, argv)
|
|
||||||
int argc;
|
|
||||||
char *argv[];
|
|
||||||
{
|
|
||||||
int nfd, nrd;
|
|
||||||
char nbuf[128];
|
|
||||||
|
|
||||||
nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
|
|
||||||
if (nfd < 0) {
|
|
||||||
write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((nrd = read(nfd, nbuf, sizeof(nbuf))) > 0)
|
|
||||||
write(STDOUT_FILENO, nbuf, nrd);
|
|
||||||
close (nfd);
|
|
||||||
|
|
||||||
exit (1);
|
|
||||||
}
|
|
3
sources
3
sources
@ -1,2 +1 @@
|
|||||||
3eab06f05163dfa65479c44e5231932c util-linux-2.19.1.tar.bz2
|
SHA512 (util-linux-2.39-rc3.tar.xz) = 8a93d32a5ceb38d50a4b2c8bfa48bcab7ec9b758c89b5a1a4f7fd74558dce37385bd7ea203345148d4389de4ea60ec42058f9d7889a8075d3e616773d085427e
|
||||||
7eeb9a6f7a258174bf0fa80f1370788d floppy-0.16.tar.bz2
|
|
||||||
|
13
tests/tests.yml
Normal file
13
tests/tests.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Test which run in classic and docker environemnt
|
||||||
|
- hosts: localhost
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
- container
|
||||||
|
- atomic
|
||||||
|
roles:
|
||||||
|
- role: standard-test-beakerlib
|
||||||
|
tests:
|
||||||
|
- various
|
||||||
|
required_packages:
|
||||||
|
- util-linux
|
||||||
|
- util-linux-user
|
64
tests/various/Makefile
Normal file
64
tests/various/Makefile
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Makefile of /CoreOS/util-linux/various
|
||||||
|
# Description: This test groups small sanity and regression tests for util-linux
|
||||||
|
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||||
|
#
|
||||||
|
# This copyrighted material is made available to anyone wishing
|
||||||
|
# to use, modify, copy, or redistribute it subject to the terms
|
||||||
|
# and conditions of the GNU General Public License version 2.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free
|
||||||
|
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
export TEST=/CoreOS/util-linux/Sanity/various
|
||||||
|
export TESTVERSION=1.0
|
||||||
|
|
||||||
|
BUILT_FILES=
|
||||||
|
|
||||||
|
FILES=$(METADATA) runtest.sh Makefile PURPOSE
|
||||||
|
|
||||||
|
.PHONY: all install download clean
|
||||||
|
|
||||||
|
run: $(FILES) build
|
||||||
|
./runtest.sh
|
||||||
|
|
||||||
|
build: $(BUILT_FILES)
|
||||||
|
test -x runtest.sh || chmod a+x runtest.sh
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ $(BUILT_FILES)
|
||||||
|
|
||||||
|
|
||||||
|
include /usr/share/rhts/lib/rhts-make.include
|
||||||
|
|
||||||
|
$(METADATA): Makefile
|
||||||
|
@echo "Owner: Miroslav Vadkerti <mvadkert@redhat.com>" > $(METADATA)
|
||||||
|
@echo "Name: $(TEST)" >> $(METADATA)
|
||||||
|
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||||
|
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||||
|
@echo "Description: This test groups small sanity and regression tests for util-linux" >> $(METADATA)
|
||||||
|
@echo "Type: Sanity" >> $(METADATA)
|
||||||
|
@echo "TestTime: 10m" >> $(METADATA)
|
||||||
|
@echo "RunFor: util-linux" >> $(METADATA)
|
||||||
|
@echo "Requires: util-linux util-linux-user" >> $(METADATA)
|
||||||
|
@echo "Priority: Normal" >> $(METADATA)
|
||||||
|
@echo "License: GPLv2" >> $(METADATA)
|
||||||
|
@echo "Confidential: no" >> $(METADATA)
|
||||||
|
@echo "Destructive: no" >> $(METADATA)
|
||||||
|
@echo "Releases: -RHEL3 -RHEL4 -RHEL5Server -RHEL5Client -RHEL6" >> $(METADATA)
|
||||||
|
|
||||||
|
rhts-lint $(METADATA)
|
3
tests/various/PURPOSE
Normal file
3
tests/various/PURPOSE
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
PURPOSE of /CoreOS/util-linux/various
|
||||||
|
Description: This test groups small sanity and regression tests for util-linux
|
||||||
|
Author: Miroslav Vadkerti <mvadkert@redhat.com>
|
52
tests/various/runtest.sh
Executable file
52
tests/various/runtest.sh
Executable file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# runtest.sh of /CoreOS/util-linux/various
|
||||||
|
# Description: This test groups small sanity and regression tests for util-linux
|
||||||
|
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||||||
|
#
|
||||||
|
# This copyrighted material is made available to anyone wishing
|
||||||
|
# to use, modify, copy, or redistribute it subject to the terms
|
||||||
|
# and conditions of the GNU General Public License version 2.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be
|
||||||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
# PURPOSE. See the GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free
|
||||||
|
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
|
# Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Include Beaker environment
|
||||||
|
#. /usr/bin/rhts-environment.sh || exit 1
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
PACKAGE="util-linux"
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm $PACKAGE
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest "return code of chfn should be always 1 in case failure"
|
||||||
|
rlRun "chfn -f a:b" 1
|
||||||
|
rlRun "chfn -o a:b" 1
|
||||||
|
rlRun "chfn -p a:b" 1
|
||||||
|
rlRun "chfn -h a:b" 1
|
||||||
|
rlRun "chfn -x a:b" 1
|
||||||
|
rlRun "chfn -f a -o b -p c -h d unknown-user" 1
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalPrintText
|
||||||
|
rlJournalEnd
|
@ -1,32 +0,0 @@
|
|||||||
From fa7e0d6d442de9f5940f99fd93f4522602439131 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Mon, 6 Jun 2011 12:35:26 +0200
|
|
||||||
Subject: [PATCH] lib: [linux_version.c] accommodate two-component linux
|
|
||||||
version (e.g. 3.0)
|
|
||||||
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
lib/linux_version.c | 6 +++---
|
|
||||||
1 files changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/linux_version.c b/lib/linux_version.c
|
|
||||||
index f9fbd8d..ada566a 100644
|
|
||||||
--- a/lib/linux_version.c
|
|
||||||
+++ b/lib/linux_version.c
|
|
||||||
@@ -16,10 +16,10 @@ get_linux_version (void)
|
|
||||||
return kver;
|
|
||||||
if (uname (&uts))
|
|
||||||
kver = 0;
|
|
||||||
- else if (sscanf (uts.release, "%d.%d.%d", &major, &minor, &teeny) != 3)
|
|
||||||
- kver = 0;
|
|
||||||
- else
|
|
||||||
+ else if (sscanf (uts.release, "%d.%d.%d", &major, &minor, &teeny) == 3)
|
|
||||||
kver = KERNEL_VERSION (major, minor, teeny);
|
|
||||||
+ else if (sscanf (uts.release, "%d.%d", &major, &minor) == 2)
|
|
||||||
+ kver = KERNEL_VERSION (major, minor, 0);
|
|
||||||
|
|
||||||
return kver;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
1.7.5.2
|
|
||||||
|
|
@ -1,290 +0,0 @@
|
|||||||
From 5c60a0eab5155043f58fa88909d89e0b06cad2f8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Tue, 31 May 2011 18:01:36 +0200
|
|
||||||
Subject: [PATCH] libmount: add mnt_table_is_mounted()
|
|
||||||
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
shlibs/mount/src/libmount.h.in | 3 +
|
|
||||||
shlibs/mount/src/libmount.sym | 1 +
|
|
||||||
shlibs/mount/src/tab.c | 210 ++++++++++++++++++++++++++++++++++++++++
|
|
||||||
shlibs/mount/src/tab_update.c | 2 +-
|
|
||||||
4 files changed, 215 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/shlibs/mount/src/libmount.h.in b/shlibs/mount/src/libmount.h.in
|
|
||||||
index 3ea2f92..1522208 100644
|
|
||||||
--- a/shlibs/mount/src/libmount.h.in
|
|
||||||
+++ b/shlibs/mount/src/libmount.h.in
|
|
||||||
@@ -308,6 +308,9 @@ extern int mnt_table_find_next_fs(struct libmnt_table *tb,
|
|
||||||
int (*match_func)(struct libmnt_fs *, void *), void *userdata,
|
|
||||||
struct libmnt_fs **fs);
|
|
||||||
|
|
||||||
+extern int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
/* tab_update.c */
|
|
||||||
extern struct libmnt_update *mnt_new_update(void);
|
|
||||||
extern void mnt_free_update(struct libmnt_update *upd);
|
|
||||||
diff --git a/shlibs/mount/src/libmount.sym b/shlibs/mount/src/libmount.sym
|
|
||||||
index 0b7c560..a498916 100644
|
|
||||||
--- a/shlibs/mount/src/libmount.sym
|
|
||||||
+++ b/shlibs/mount/src/libmount.sym
|
|
||||||
@@ -195,6 +195,7 @@ global:
|
|
||||||
mnt_update_is_ready;
|
|
||||||
mnt_update_set_fs;
|
|
||||||
mnt_update_table;
|
|
||||||
+ mnt_table_is_fs_mounted;
|
|
||||||
local:
|
|
||||||
*;
|
|
||||||
};
|
|
||||||
diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c
|
|
||||||
index 2a6a235..38a5d5b 100644
|
|
||||||
--- a/shlibs/mount/src/tab.c
|
|
||||||
+++ b/shlibs/mount/src/tab.c
|
|
||||||
@@ -712,6 +712,175 @@ struct libmnt_fs *mnt_table_find_pair(struct libmnt_table *tb, const char *sourc
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * @tb: /proc/self/mountinfo
|
|
||||||
+ * @fs: filesystem
|
|
||||||
+ * @mountflags: MS_BIND or 0
|
|
||||||
+ * @fsroot: fs-root that will be probably used in the mountinfo file
|
|
||||||
+ * for @fs after mount(2)
|
|
||||||
+ *
|
|
||||||
+ * For btrfs subvolumes this function returns NULL, but @fsroot properly set.
|
|
||||||
+ *
|
|
||||||
+ * Returns: entry from @tb that will be used as a source for @fs if the @fs is
|
|
||||||
+ * bindmount.
|
|
||||||
+ */
|
|
||||||
+struct libmnt_fs *mnt_table_get_fs_root(struct libmnt_table *tb,
|
|
||||||
+ struct libmnt_fs *fs,
|
|
||||||
+ unsigned long mountflags,
|
|
||||||
+ char **fsroot)
|
|
||||||
+{
|
|
||||||
+ char *root = NULL, *mnt = NULL;
|
|
||||||
+ const char *fstype;
|
|
||||||
+ struct libmnt_fs *src_fs = NULL;
|
|
||||||
+
|
|
||||||
+ assert(tb);
|
|
||||||
+ assert(fs);
|
|
||||||
+ assert(fsroot);
|
|
||||||
+
|
|
||||||
+ DBG(TAB, mnt_debug("lookup fs-root for %s", mnt_fs_get_source(fs)));
|
|
||||||
+
|
|
||||||
+ fstype = mnt_fs_get_fstype(fs);
|
|
||||||
+
|
|
||||||
+ if (mountflags & MS_BIND) {
|
|
||||||
+ const char *src, *src_root;
|
|
||||||
+
|
|
||||||
+ DBG(TAB, mnt_debug("fs-root for bind"));
|
|
||||||
+
|
|
||||||
+ src = mnt_resolve_spec(mnt_fs_get_source(fs), tb->cache);
|
|
||||||
+ if (!src)
|
|
||||||
+ goto err;
|
|
||||||
+
|
|
||||||
+ mnt = mnt_get_mountpoint(src);
|
|
||||||
+ if (!mnt)
|
|
||||||
+ goto err;
|
|
||||||
+
|
|
||||||
+ root = mnt_get_fs_root(src, mnt);
|
|
||||||
+
|
|
||||||
+ src_fs = mnt_table_find_target(tb, mnt, MNT_ITER_BACKWARD);
|
|
||||||
+ if (!src_fs) {
|
|
||||||
+ DBG(TAB, mnt_debug("not found '%s' in mountinfo -- using default", mnt));
|
|
||||||
+ goto dflt;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* on btrfs the subvolume is used as fs-root in
|
|
||||||
+ * /proc/self/mountinfo, so we have to get the original subvolume
|
|
||||||
+ * name from src_fs and prepend the subvolume name to the
|
|
||||||
+ * fs-root path
|
|
||||||
+ */
|
|
||||||
+ src_root = mnt_fs_get_root(src_fs);
|
|
||||||
+ if (src_root && !startswith(root, src_root)) {
|
|
||||||
+ size_t sz = strlen(root) + strlen(src_root) + 1;
|
|
||||||
+ char *tmp = malloc(sz);
|
|
||||||
+
|
|
||||||
+ if (!tmp)
|
|
||||||
+ goto err;
|
|
||||||
+ snprintf(tmp, sz, "%s%s", src_root, root);
|
|
||||||
+ free(root);
|
|
||||||
+ root = tmp;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * btrfs-subvolume mount -- get subvolume name and use it as a root-fs path
|
|
||||||
+ */
|
|
||||||
+ else if (fstype && !strcmp(fstype, "btrfs")) {
|
|
||||||
+ char *vol = NULL, *p;
|
|
||||||
+ size_t sz, volsz = 0;
|
|
||||||
+
|
|
||||||
+ if (mnt_fs_get_option(fs, "subvol", &vol, &volsz))
|
|
||||||
+ goto dflt;
|
|
||||||
+
|
|
||||||
+ DBG(TAB, mnt_debug("setting FS root: btrfs subvol"));
|
|
||||||
+
|
|
||||||
+ sz = volsz;
|
|
||||||
+ if (*vol != '/')
|
|
||||||
+ sz++;
|
|
||||||
+ root = malloc(sz + 1);
|
|
||||||
+ if (!root)
|
|
||||||
+ goto err;
|
|
||||||
+ p = root;
|
|
||||||
+ if (*vol != '/')
|
|
||||||
+ *p++ = '/';
|
|
||||||
+ memcpy(p, vol, volsz);
|
|
||||||
+ *(root + sz) = '\0';
|
|
||||||
+ }
|
|
||||||
+dflt:
|
|
||||||
+ if (!root) {
|
|
||||||
+ root = strdup("/");
|
|
||||||
+ if (!root)
|
|
||||||
+ goto err;
|
|
||||||
+ }
|
|
||||||
+ *fsroot = root;
|
|
||||||
+
|
|
||||||
+ DBG(TAB, mnt_debug("FS root result: %s", root));
|
|
||||||
+
|
|
||||||
+ free(mnt);
|
|
||||||
+ return src_fs;
|
|
||||||
+err:
|
|
||||||
+ free(root);
|
|
||||||
+ free(mnt);
|
|
||||||
+ return NULL;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * mnt_table_is_mounted:
|
|
||||||
+ * @tb: /proc/self/mountinfo file
|
|
||||||
+ * @fstab_fs: /etc/fstab entry
|
|
||||||
+ *
|
|
||||||
+ * Checks if the @fstab_fs entry is already in the @tb table. The "swap"
|
|
||||||
+ * is ignored.
|
|
||||||
+ *
|
|
||||||
+ * TODO: check for loopdev (see mount/mount.c is_fstab_entry_mounted().
|
|
||||||
+ *
|
|
||||||
+ * Returns: 0 or 1
|
|
||||||
+ */
|
|
||||||
+int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
|
|
||||||
+{
|
|
||||||
+ char *root = NULL;
|
|
||||||
+ struct libmnt_fs *src_fs;
|
|
||||||
+ const char *src, *tgt;
|
|
||||||
+ int flags = 0, rc = 0;
|
|
||||||
+
|
|
||||||
+ assert(tb);
|
|
||||||
+ assert(fstab_fs);
|
|
||||||
+
|
|
||||||
+ if (fstab_fs->flags & MNT_FS_SWAP)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ if (mnt_fs_get_option(fstab_fs, "bind", NULL, NULL) == 0)
|
|
||||||
+ flags = MS_BIND;
|
|
||||||
+
|
|
||||||
+ src_fs = mnt_table_get_fs_root(tb, fstab_fs, flags, &root);
|
|
||||||
+ if (src_fs)
|
|
||||||
+ src = mnt_fs_get_srcpath(src_fs);
|
|
||||||
+ else
|
|
||||||
+ src = mnt_resolve_spec(mnt_fs_get_source(fstab_fs), tb->cache);
|
|
||||||
+
|
|
||||||
+ tgt = mnt_fs_get_target(fstab_fs);
|
|
||||||
+
|
|
||||||
+ if (tgt || src || root) {
|
|
||||||
+ struct libmnt_iter itr;
|
|
||||||
+ struct libmnt_fs *fs;
|
|
||||||
+
|
|
||||||
+ mnt_reset_iter(&itr, MNT_ITER_FORWARD);
|
|
||||||
+
|
|
||||||
+ while(mnt_table_next_fs(tb, &itr, &fs) == 0) {
|
|
||||||
+ const char *s = mnt_fs_get_srcpath(fs),
|
|
||||||
+ *t = mnt_fs_get_target(fs),
|
|
||||||
+ *r = mnt_fs_get_root(fs);
|
|
||||||
+
|
|
||||||
+ if (s && t && r && !strcmp(t, tgt) &&
|
|
||||||
+ !strcmp(s, src) && !strcmp(r, root))
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ if (fs)
|
|
||||||
+ rc = 1; /* success */
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ free(root);
|
|
||||||
+ return rc;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#ifdef TEST_PROGRAM
|
|
||||||
|
|
||||||
static int parser_errcb(struct libmnt_table *tb, const char *filename, int line)
|
|
||||||
@@ -869,6 +1038,46 @@ done:
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int test_is_mounted(struct libmnt_test *ts, int argc, char *argv[])
|
|
||||||
+{
|
|
||||||
+ struct libmnt_table *tb = NULL, *fstab = NULL;
|
|
||||||
+ struct libmnt_fs *fs;
|
|
||||||
+ struct libmnt_iter *itr = NULL;
|
|
||||||
+ int rc;
|
|
||||||
+
|
|
||||||
+ tb = mnt_new_table_from_file("/proc/self/mountinfo");
|
|
||||||
+ if (!tb) {
|
|
||||||
+ fprintf(stderr, "failed to parse mountinfo\n");
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ fstab = create_table(argv[1]);
|
|
||||||
+ if (!fstab)
|
|
||||||
+ goto done;
|
|
||||||
+
|
|
||||||
+ itr = mnt_new_iter(MNT_ITER_FORWARD);
|
|
||||||
+ if (!itr)
|
|
||||||
+ goto done;
|
|
||||||
+
|
|
||||||
+ while(mnt_table_next_fs(fstab, itr, &fs) == 0) {
|
|
||||||
+ if (mnt_table_is_fs_mounted(tb, fs))
|
|
||||||
+ printf("%s already mounted on %s\n",
|
|
||||||
+ mnt_fs_get_source(fs),
|
|
||||||
+ mnt_fs_get_target(fs));
|
|
||||||
+ else
|
|
||||||
+ printf("%s not mounted on %s\n",
|
|
||||||
+ mnt_fs_get_source(fs),
|
|
||||||
+ mnt_fs_get_target(fs));
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ rc = 0;
|
|
||||||
+done:
|
|
||||||
+ mnt_free_table(tb);
|
|
||||||
+ mnt_free_table(fstab);
|
|
||||||
+ mnt_free_iter(itr);
|
|
||||||
+ return rc;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
struct libmnt_test tss[] = {
|
|
||||||
@@ -877,6 +1086,7 @@ int main(int argc, char *argv[])
|
|
||||||
{ "--find-backward", test_find_bw, "<file> <source|target> <string>" },
|
|
||||||
{ "--find-pair", test_find_pair, "<file> <source> <target>" },
|
|
||||||
{ "--copy-fs", test_copy_fs, "<file> copy root FS from the file" },
|
|
||||||
+ { "--is-mounted", test_is_mounted, "<fstab> check what from <file> are already mounted" },
|
|
||||||
{ NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/shlibs/mount/src/tab_update.c b/shlibs/mount/src/tab_update.c
|
|
||||||
index 5abb566..9817f20 100644
|
|
||||||
--- a/shlibs/mount/src/tab_update.c
|
|
||||||
+++ b/shlibs/mount/src/tab_update.c
|
|
||||||
@@ -410,7 +410,7 @@ static int set_fs_root(struct libmnt_fs *result, struct libmnt_fs *fs, unsigned
|
|
||||||
mnt_fs_set_fstype(result, mnt_fs_get_fstype(src_fs));
|
|
||||||
|
|
||||||
/* on btrfs the subvolume is used as fs-root in
|
|
||||||
- * /proc/self/mountinfo, so we have get the original subvolume
|
|
||||||
+ * /proc/self/mountinfo, so we have to get the original subvolume
|
|
||||||
* name from src_fs and prepend the subvolume name to the
|
|
||||||
* fs-root path
|
|
||||||
*/
|
|
||||||
--
|
|
||||||
1.7.5.2
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
|||||||
From 0cac8948216a298deaf5fd30837ed9cc80618f80 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Tue, 31 May 2011 18:02:29 +0200
|
|
||||||
Subject: [PATCH] mount: use libmount to detect already mounted bind mounts
|
|
||||||
|
|
||||||
It's pretty tricky to detect that a bind mount from fstab is already
|
|
||||||
mounted on system without /etc/mtab. Let's use functionality from
|
|
||||||
libmount.
|
|
||||||
|
|
||||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=701176
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
mount/mount.c | 42 ++++++++++++++++++++++++++++++++++++++----
|
|
||||||
1 files changed, 38 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/mount/mount.c b/mount/mount.c
|
|
||||||
index 29963c2..3ba705f 100644
|
|
||||||
--- a/mount/mount.c
|
|
||||||
+++ b/mount/mount.c
|
|
||||||
@@ -212,7 +212,7 @@ static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_sizelimit,
|
|
||||||
*opt_encryption, *opt_speed, *opt_comment, *opt_uhelper;
|
|
||||||
|
|
||||||
static int is_readonly(const char *node);
|
|
||||||
-static int mounted (const char *spec0, const char *node0);
|
|
||||||
+static int mounted (const char *spec0, const char *node0, struct mntentchn *fstab_mc);
|
|
||||||
static int check_special_mountprog(const char *spec, const char *node,
|
|
||||||
const char *type, int flags, char *extra_opts, int *status);
|
|
||||||
|
|
||||||
@@ -1562,7 +1562,7 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
|
|
||||||
/* The "mount -f" checks for for existing record in /etc/mtab (with
|
|
||||||
* regular non-fake mount this is usually done by kernel)
|
|
||||||
*/
|
|
||||||
- if (!(flags & MS_REMOUNT) && fake && mounted (spec, node))
|
|
||||||
+ if (!(flags & MS_REMOUNT) && fake && mounted (spec, node, NULL))
|
|
||||||
die(EX_USAGE, _("mount: according to mtab, "
|
|
||||||
"%s is already mounted on %s\n"),
|
|
||||||
spec, node);
|
|
||||||
@@ -2016,13 +2016,46 @@ mount_one (const char *spec, const char *node, const char *types,
|
|
||||||
return try_mount_one (spec, node, types, opts, freq, pass, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef HAVE_LIBMOUNT_MOUNT
|
|
||||||
+static struct libmnt_table *minfo; /* parsed mountinfo file */
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Check if an fsname/dir pair was already in the old mtab. */
|
|
||||||
static int
|
|
||||||
-mounted (const char *spec0, const char *node0) {
|
|
||||||
+mounted (const char *spec0, const char *node0, struct mntentchn *fstab_mc) {
|
|
||||||
struct mntentchn *mc, *mc0;
|
|
||||||
const char *spec, *node;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
+#ifdef HAVE_LIBMOUNT_MOUNT
|
|
||||||
+ /*
|
|
||||||
+ * Use libmount to check for already mounted bind mounts on systems
|
|
||||||
+ * without mtab.
|
|
||||||
+ */
|
|
||||||
+ if (fstab_mc && fstab_mc->m.mnt_opts &&
|
|
||||||
+ mtab_is_a_symlink() && strstr(fstab_mc->m.mnt_opts, "bind")) {
|
|
||||||
+
|
|
||||||
+ struct libmnt_fs *fs = mnt_new_fs();
|
|
||||||
+ int rc = fs ? 0 : -1;
|
|
||||||
+
|
|
||||||
+ if (!rc)
|
|
||||||
+ rc = mnt_fs_set_fstype(fs, fstab_mc->m.mnt_type);
|
|
||||||
+ if (!rc)
|
|
||||||
+ rc = mnt_fs_set_source(fs, fstab_mc->m.mnt_fsname);
|
|
||||||
+ if (!rc)
|
|
||||||
+ rc = mnt_fs_set_target(fs, fstab_mc->m.mnt_dir);
|
|
||||||
+ if (!rc)
|
|
||||||
+ rc = mnt_fs_set_options(fs, fstab_mc->m.mnt_opts);
|
|
||||||
+ if (!rc && !minfo)
|
|
||||||
+ minfo = mnt_new_table_from_file("/proc/self/mountinfo");
|
|
||||||
+ if (!rc && minfo)
|
|
||||||
+ rc = mnt_table_is_fs_mounted(minfo, fs);
|
|
||||||
+
|
|
||||||
+ mnt_free_fs(fs);
|
|
||||||
+ if (rc == 1)
|
|
||||||
+ return 1;
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
/* Handle possible UUID= and LABEL= in spec */
|
|
||||||
spec = spec_to_devname(spec0);
|
|
||||||
if (!spec)
|
|
||||||
@@ -2030,6 +2063,7 @@ mounted (const char *spec0, const char *node0) {
|
|
||||||
|
|
||||||
node = canonicalize(node0);
|
|
||||||
|
|
||||||
+
|
|
||||||
mc0 = mtab_head();
|
|
||||||
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
|
|
||||||
if (streq (spec, mc->m.mnt_fsname) &&
|
|
||||||
@@ -2050,7 +2084,7 @@ is_fstab_entry_mounted(struct mntentchn *mc, int verbose)
|
|
||||||
{
|
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
- if (mounted(mc->m.mnt_fsname, mc->m.mnt_dir))
|
|
||||||
+ if (mounted(mc->m.mnt_fsname, mc->m.mnt_dir, mc))
|
|
||||||
goto yes;
|
|
||||||
|
|
||||||
/* extra care for loop devices */
|
|
||||||
--
|
|
||||||
1.7.5.2
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
From 400459e897045b40eb3711fa4814176f7422a76a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kirill Elagin <kirelagin@gmail.com>
|
|
||||||
Date: Mon, 11 Jul 2011 12:53:43 +0200
|
|
||||||
Subject: [PATCH] mount: fix double free in mount.c with SELinux enabled
|
|
||||||
|
|
||||||
append_context reallocates memory, invalidating extra_opts1. As a
|
|
||||||
result my_free(extra_opts1) crashes.
|
|
||||||
|
|
||||||
Signed-off-by: Kirill Elagin <kirelagin@gmail.com>
|
|
||||||
Signed-off-by: Nikita Ofitserov <himikof@gmail.com>
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
mount/mount.c | 15 ++++++++-------
|
|
||||||
1 files changed, 8 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/mount/mount.c b/mount/mount.c
|
|
||||||
index cb04d9d..ea2c478 100644
|
|
||||||
--- a/mount/mount.c
|
|
||||||
+++ b/mount/mount.c
|
|
||||||
@@ -1535,7 +1535,7 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
|
|
||||||
struct stat statbuf;
|
|
||||||
|
|
||||||
/* copies for freeing on exit */
|
|
||||||
- const char *opts1, *spec1, *node1, *types1, *extra_opts1;
|
|
||||||
+ const char *opts1, *spec1, *node1, *types1;
|
|
||||||
|
|
||||||
if (verbose > 2) {
|
|
||||||
printf("mount: spec: \"%s\"\n", spec0);
|
|
||||||
@@ -1550,8 +1550,7 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
|
|
||||||
opts = opts1 = xstrdup(opts0);
|
|
||||||
|
|
||||||
parse_opts (opts, &flags, &extra_opts);
|
|
||||||
- extra_opts1 = extra_opts;
|
|
||||||
- mount_opts = extra_opts;
|
|
||||||
+ mount_opts = xstrdup(extra_opts);
|
|
||||||
|
|
||||||
/* quietly succeed for fstab entries that don't get mounted automatically */
|
|
||||||
if (mount_all && (flags & MS_NOAUTO))
|
|
||||||
@@ -1592,8 +1591,11 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
|
|
||||||
/*
|
|
||||||
* Linux kernel does not accept any selinux context option on remount
|
|
||||||
*/
|
|
||||||
- if (mount_opts)
|
|
||||||
+ if (mount_opts) {
|
|
||||||
+ char *tmp = mount_opts;
|
|
||||||
mount_opts = remove_context_options(mount_opts);
|
|
||||||
+ my_free(tmp);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
} else if (types && strcmp(types, "tmpfs") == 0 && is_selinux_enabled() > 0 &&
|
|
||||||
!has_context_option(mount_opts)) {
|
|
||||||
@@ -1922,9 +1924,8 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- if (extra_opts1 != mount_opts)
|
|
||||||
- my_free(mount_opts);
|
|
||||||
- my_free(extra_opts1);
|
|
||||||
+ my_free(mount_opts);
|
|
||||||
+ my_free(extra_opts);
|
|
||||||
my_free(spec1);
|
|
||||||
my_free(node1);
|
|
||||||
my_free(opts1);
|
|
||||||
--
|
|
||||||
1.7.6
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
From aab72640daa7ee2db3d42fc8278ab86e3aef2d71 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Thu, 2 Jun 2011 14:53:42 +0200
|
|
||||||
Subject: [PATCH] mount: canonicalize fstab mnt_dir
|
|
||||||
|
|
||||||
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=709681
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
mount/fstab.c | 8 +++++++-
|
|
||||||
1 files changed, 7 insertions(+), 1 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/mount/fstab.c b/mount/fstab.c
|
|
||||||
index 8ce733b..4fa26b4 100644
|
|
||||||
--- a/mount/fstab.c
|
|
||||||
+++ b/mount/fstab.c
|
|
||||||
@@ -455,7 +455,13 @@ getfs_by_dir (const char *dir) {
|
|
||||||
|
|
||||||
cdir = canonicalize(dir);
|
|
||||||
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) {
|
|
||||||
- if (streq(mc->m.mnt_dir, cdir)) {
|
|
||||||
+ int ok = streq(mc->m.mnt_dir, cdir);
|
|
||||||
+ if (!ok) {
|
|
||||||
+ char *dr = canonicalize(mc->m.mnt_dir);
|
|
||||||
+ ok = dr ? streq(dr, cdir) : 0;
|
|
||||||
+ free(dr);
|
|
||||||
+ }
|
|
||||||
+ if (ok) {
|
|
||||||
free(cdir);
|
|
||||||
return mc;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
1.7.5.2
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
|||||||
From 067e9b4934372f72b89b2c0442a3d28290834537 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Wed, 29 Jun 2011 09:02:50 +0200
|
|
||||||
Subject: [PATCH] mount: first look for mountpoint
|
|
||||||
|
|
||||||
# mount <device|dir>
|
|
||||||
|
|
||||||
The current code looks for a device and then for a mountpoint in
|
|
||||||
/etc/fstab. This is not user friendly solution. People usually use
|
|
||||||
|
|
||||||
# mount /dir
|
|
||||||
|
|
||||||
to mount any filesystem. It makes more sense to check for mountpoint
|
|
||||||
and if not found then for device.
|
|
||||||
|
|
||||||
This is also important for bind mounts, for example if you have in
|
|
||||||
your fstab:
|
|
||||||
|
|
||||||
/dev/sda1 /mnt/foo auto defaults
|
|
||||||
/mnt/foo /mnt/bar none bind
|
|
||||||
|
|
||||||
then
|
|
||||||
# mount /mnt/foo
|
|
||||||
|
|
||||||
should be interpreted as the first entry and /dev/sda1 should be
|
|
||||||
mounted.
|
|
||||||
|
|
||||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=716483
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
mount/mount.8 | 11 +++++++++++
|
|
||||||
mount/mount.c | 4 ++--
|
|
||||||
2 files changed, 13 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/mount/mount.8 b/mount/mount.8
|
|
||||||
index 8982537..e9a52dd 100644
|
|
||||||
--- a/mount/mount.8
|
|
||||||
+++ b/mount/mount.8
|
|
||||||
@@ -101,6 +101,17 @@ the pathname
|
|
||||||
refers to the root of the filesystem on
|
|
||||||
.IR device .
|
|
||||||
|
|
||||||
+If only directory or device is given, for example:
|
|
||||||
+.RS
|
|
||||||
+
|
|
||||||
+.br
|
|
||||||
+.BI "mount /dir"
|
|
||||||
+.br
|
|
||||||
+
|
|
||||||
+.RE
|
|
||||||
+then mount looks for a mountpoint and if not found then for a device in the
|
|
||||||
+/etc/fstab file.
|
|
||||||
+
|
|
||||||
.B The listing and help.
|
|
||||||
.RS
|
|
||||||
Three forms of invocation do not actually mount anything:
|
|
||||||
diff --git a/mount/mount.c b/mount/mount.c
|
|
||||||
index 3ba705f..00637f5 100644
|
|
||||||
--- a/mount/mount.c
|
|
||||||
+++ b/mount/mount.c
|
|
||||||
@@ -2347,10 +2347,10 @@ getfs(const char *spec, const char *uuid, const char *label)
|
|
||||||
else if (label)
|
|
||||||
mc = getfs_by_label(label);
|
|
||||||
else {
|
|
||||||
- mc = getfs_by_spec(spec);
|
|
||||||
+ mc = getfs_by_dir(spec);
|
|
||||||
|
|
||||||
if (!mc)
|
|
||||||
- mc = getfs_by_dir(spec);
|
|
||||||
+ mc = getfs_by_spec(spec);
|
|
||||||
}
|
|
||||||
if (mc)
|
|
||||||
return mc;
|
|
||||||
--
|
|
||||||
1.7.5.4
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
# This file and interface are deprecated.
|
|
||||||
# Applications needing raw device access should open regular
|
|
||||||
# block devices with O_DIRECT.
|
|
||||||
#
|
|
||||||
# Enter raw device bindings here.
|
|
||||||
#
|
|
||||||
# An example would be:
|
|
||||||
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
|
|
||||||
# to bind /dev/raw/raw1 to /dev/sda, or
|
|
||||||
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
|
|
||||||
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
|
|
@ -1,5 +1,4 @@
|
|||||||
#%PAM-1.0
|
#%PAM-1.0
|
||||||
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
|
|
||||||
auth substack system-auth
|
auth substack system-auth
|
||||||
auth include postlogin
|
auth include postlogin
|
||||||
account required pam_nologin.so
|
account required pam_nologin.so
|
||||||
@ -8,7 +7,6 @@ password include system-auth
|
|||||||
# pam_selinux.so close should be the first session rule
|
# pam_selinux.so close should be the first session rule
|
||||||
session required pam_selinux.so close
|
session required pam_selinux.so close
|
||||||
session required pam_loginuid.so
|
session required pam_loginuid.so
|
||||||
session optional pam_console.so
|
|
||||||
# pam_selinux.so open should only be followed by sessions to be executed in the user context
|
# pam_selinux.so open should only be followed by sessions to be executed in the user context
|
||||||
session required pam_selinux.so open
|
session required pam_selinux.so open
|
||||||
session required pam_namespace.so
|
session required pam_namespace.so
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
--- util-linux-2.13-pre6/sys-utils/ctrlaltdel.8.kzak 2006-08-10 12:23:53.000000000 +0200
|
|
||||||
+++ util-linux-2.13-pre6/sys-utils/ctrlaltdel.8 2006-08-10 12:24:08.000000000 +0200
|
|
||||||
@@ -32,7 +32,6 @@
|
|
||||||
.SH FILES
|
|
||||||
.I /etc/rc.local
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
-.BR simpleinit (8),
|
|
||||||
.BR init (8)
|
|
||||||
.SH AUTHOR
|
|
||||||
Peter Orbaek (poe@daimi.aau.dk)
|
|
@ -1,23 +0,0 @@
|
|||||||
--- util-linux-ng-2.13-rc3/disk-utils/fdformat.8.xxx 2007-07-03 01:56:04.000000000 +0200
|
|
||||||
+++ util-linux-ng-2.13-rc3/disk-utils/fdformat.8 2007-08-13 12:07:58.000000000 +0200
|
|
||||||
@@ -45,6 +45,10 @@
|
|
||||||
.BR setfdprm (8)
|
|
||||||
to load the disk parameters.
|
|
||||||
|
|
||||||
+For ATAPI IDE floppy driver (also known as LS-120 drives or "Superdisk"
|
|
||||||
+drives) you have to use the
|
|
||||||
+.BR floppy (8).
|
|
||||||
+
|
|
||||||
.SH OPTIONS
|
|
||||||
.TP
|
|
||||||
.B \-n
|
|
||||||
@@ -54,7 +58,8 @@
|
|
||||||
.BR fd (4),
|
|
||||||
.BR setfdprm (8),
|
|
||||||
.BR mkfs (8),
|
|
||||||
-.BR emkfs (8)
|
|
||||||
+.BR emkfs (8),
|
|
||||||
+.BR floppy (8)
|
|
||||||
.SH AUTHOR
|
|
||||||
Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
|
|
||||||
.SH AVAILABILITY
|
|
@ -1,102 +0,0 @@
|
|||||||
--- util-linux-2.12p/floppy-0.16/floppyfloppy.c.generic 2001-02-13 01:15:38.000000000 +0100
|
|
||||||
+++ util-linux-2.12p/floppy-0.16/floppyfloppy.c 2005-09-30 15:38:08.000000000 +0200
|
|
||||||
@@ -264,6 +264,33 @@
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* -1=error, 1=true, 0=false */
|
|
||||||
+static int check_generic(const char *dev, int n)
|
|
||||||
+{
|
|
||||||
+ struct floppy_struct param;
|
|
||||||
+ int fd;
|
|
||||||
+
|
|
||||||
+ if ((fd=open(dev, O_RDONLY)) < 0)
|
|
||||||
+ {
|
|
||||||
+ perror(dev);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ if (ioctl(fd,FDGETPRM,(long) ¶m) < 0)
|
|
||||||
+ {
|
|
||||||
+ perror(dev);
|
|
||||||
+ close(fd);
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ close(fd);
|
|
||||||
+
|
|
||||||
+ if (param.sect==floppy_type[n].sectors &&
|
|
||||||
+ param.head==floppy_type[n].heads &&
|
|
||||||
+ param.track==floppy_type[n].tracks)
|
|
||||||
+ /* generic device uses expected format */
|
|
||||||
+ return 1;
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
|
|
||||||
static int do_format(const char *dev, int fmtnum,
|
|
||||||
int (*fmt_func)(const char *, int), int flags)
|
|
||||||
@@ -275,6 +302,7 @@
|
|
||||||
struct format_descr curtrack;
|
|
||||||
int pct;
|
|
||||||
struct stat stat_buf;
|
|
||||||
+ int gen = 0;
|
|
||||||
|
|
||||||
int i, j;
|
|
||||||
char *devname;
|
|
||||||
@@ -297,23 +325,52 @@
|
|
||||||
|
|
||||||
strcat(strcpy(devname, dev), floppy_type[fmtnum].dev);
|
|
||||||
|
|
||||||
+ if (stat(devname, &stat_buf)==-1 && errno==ENOENT)
|
|
||||||
+ {
|
|
||||||
+ /* /dev/fd0xxxxx doesn't exist ...try to use generic device
|
|
||||||
+ *
|
|
||||||
+ * Note: we needn't size specific device if the generic device uses
|
|
||||||
+ * right floppy format (FDGETPRM). -- Karel Zak [30/09/2005]
|
|
||||||
+ */
|
|
||||||
+ if ((gen = check_generic(dev, fmtnum))==1) /* true */
|
|
||||||
+ {
|
|
||||||
+ fprintf(stderr, _("WARNING: size specific device %s doesn't exist, using generic device: %s\n"),
|
|
||||||
+ devname, dev);
|
|
||||||
+ strcpy(devname, dev);
|
|
||||||
+ }
|
|
||||||
+ else if (gen==0) /* false */
|
|
||||||
+ {
|
|
||||||
+ fprintf(stderr, _("ERROR: size specific device %1$s doesn't exist. Use \"MAKEDEV %1$s\" and try it again.\n"), devname);
|
|
||||||
+ return (1);
|
|
||||||
+ }
|
|
||||||
+ else /* error -- no floppy medium or device? */
|
|
||||||
+ return(1);
|
|
||||||
+ }
|
|
||||||
fd=open(devname, O_WRONLY);
|
|
||||||
if (fd < 0)
|
|
||||||
{
|
|
||||||
perror(devname);
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- if (fstat(fd, &stat_buf) ||
|
|
||||||
- !S_ISBLK(stat_buf.st_mode) ||
|
|
||||||
- MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
|
||||||
+ if (fstat(fd, &stat_buf) < 0)
|
|
||||||
+ {
|
|
||||||
+ perror(devname);
|
|
||||||
+ close(fd);
|
|
||||||
+ return (1);
|
|
||||||
+ }
|
|
||||||
+ if (!S_ISBLK(stat_buf.st_mode))
|
|
||||||
+ {
|
|
||||||
+ fprintf(stderr,_("%s: not a block device\n"), devname);
|
|
||||||
+ close(fd);
|
|
||||||
+ return (1);
|
|
||||||
+ }
|
|
||||||
+ if (gen==0 && MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
|
||||||
{
|
|
||||||
errno=EINVAL;
|
|
||||||
perror(devname);
|
|
||||||
close(fd);
|
|
||||||
return (1);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
if (ioctl(fd, FDGETPRM, &geo) < 0)
|
|
||||||
{
|
|
||||||
perror(devname);
|
|
@ -1,10 +0,0 @@
|
|||||||
--- util-linux-ng-2.13-rc3/floppy-0.16/superfloppy.c.kzak 2001-07-14 05:26:16.000000000 +0200
|
|
||||||
+++ util-linux-ng-2.13-rc3/floppy-0.16/superfloppy.c 2007-08-13 13:14:53.000000000 +0200
|
|
||||||
@@ -12,6 +12,7 @@
|
|
||||||
#include <errno.h>
|
|
||||||
#include <popt.h>
|
|
||||||
#include <libintl.h>
|
|
||||||
+#include <locale.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
@ -1,13 +0,0 @@
|
|||||||
Index: util-linux-ng-2.14.2-rc1/login-utils/login.c
|
|
||||||
===================================================================
|
|
||||||
--- util-linux-ng-2.14.2-rc1.orig/login-utils/login.c
|
|
||||||
+++ util-linux-ng-2.14.2-rc1/login-utils/login.c
|
|
||||||
@@ -1415,7 +1415,7 @@ dolastlog(int quiet) {
|
|
||||||
struct lastlog ll;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
- if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
|
|
||||||
+ if ((fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0)) >= 0) {
|
|
||||||
lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET);
|
|
||||||
if (!quiet) {
|
|
||||||
if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) &&
|
|
@ -1,48 +0,0 @@
|
|||||||
diff -up util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c
|
|
||||||
--- util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak 2009-03-25 13:19:08.000000000 +0100
|
|
||||||
+++ util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c 2009-06-04 15:22:48.000000000 +0200
|
|
||||||
@@ -243,6 +243,26 @@ print_perms (int id, struct ipc_perm *ip
|
|
||||||
printf(" %-10d\n", ipcp->gid);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static unsigned long long
|
|
||||||
+shminfo_from_proc(const char *name, unsigned long def)
|
|
||||||
+{
|
|
||||||
+ char path[256];
|
|
||||||
+ char buf[64];
|
|
||||||
+ FILE *f;
|
|
||||||
+ unsigned long long res = def;
|
|
||||||
+
|
|
||||||
+ if (!name)
|
|
||||||
+ return res;
|
|
||||||
+
|
|
||||||
+ snprintf(path, sizeof(path), "/proc/sys/kernel/%s", name);
|
|
||||||
+
|
|
||||||
+ if (!(f = fopen(path, "r")))
|
|
||||||
+ return res;
|
|
||||||
+ if (fgets(buf, sizeof(buf), f))
|
|
||||||
+ res = atoll(buf);
|
|
||||||
+ fclose(f);
|
|
||||||
+ return res;
|
|
||||||
+}
|
|
||||||
|
|
||||||
void do_shm (char format)
|
|
||||||
{
|
|
||||||
@@ -266,12 +286,12 @@ void do_shm (char format)
|
|
||||||
return;
|
|
||||||
/* glibc 2.1.3 and all earlier libc's have ints as fields
|
|
||||||
of struct shminfo; glibc 2.1.91 has unsigned long; ach */
|
|
||||||
- printf (_("max number of segments = %lu\n"),
|
|
||||||
- (unsigned long) shminfo.shmmni);
|
|
||||||
- printf (_("max seg size (kbytes) = %lu\n"),
|
|
||||||
- (unsigned long) (shminfo.shmmax >> 10));
|
|
||||||
+ printf (_("max number of segments = %llu\n"),
|
|
||||||
+ shminfo_from_proc("shmmni", shminfo.shmmni));
|
|
||||||
+ printf (_("max seg size (kbytes) = %llu\n"),
|
|
||||||
+ (shminfo_from_proc("shmmax", shminfo.shmmax) >> 10));
|
|
||||||
printf (_("max total shared memory (kbytes) = %llu\n"),
|
|
||||||
- getpagesize() / 1024 * (unsigned long long) shminfo.shmall);
|
|
||||||
+ getpagesize() / 1024 * shminfo_from_proc("shmall", shminfo.shmall));
|
|
||||||
printf (_("min seg size (bytes) = %lu\n"),
|
|
||||||
(unsigned long) shminfo.shmmin);
|
|
||||||
return;
|
|
@ -1,78 +0,0 @@
|
|||||||
---
|
|
||||||
misc-utils/blkid.8 | 4 ++--
|
|
||||||
misc-utils/blkid.c | 2 +-
|
|
||||||
shlibs/blkid/libblkid.3 | 6 +++---
|
|
||||||
shlibs/blkid/src/blkidP.h | 2 +-
|
|
||||||
4 files changed, 7 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
--- util-linux-ng-2.18-rc1.orig/misc-utils/blkid.8
|
|
||||||
+++ util-linux-ng-2.18-rc1/misc-utils/blkid.8
|
|
||||||
@@ -81,7 +81,7 @@ same meaning as "KiB") or decimal (10^N)
|
|
||||||
Read from
|
|
||||||
.I cachefile
|
|
||||||
instead of reading from the default cache file
|
|
||||||
-.IR /etc/blkid.tab .
|
|
||||||
+.IR /etc/blkid/blkid.tab .
|
|
||||||
If you want to start with a clean cache (i.e. don't report devices previously
|
|
||||||
scanned but not necessarily available at this time), specify
|
|
||||||
.IR /dev/null .
|
|
||||||
@@ -228,7 +228,7 @@ Display version number and exit.
|
|
||||||
Write the device cache to
|
|
||||||
.I writecachefile
|
|
||||||
instead of writing it to the default cache file
|
|
||||||
-.IR /etc/blkid.tab .
|
|
||||||
+.IR /etc/blkid/blkid.tab .
|
|
||||||
If you don't want to save the cache to the default file, specify
|
|
||||||
.IR /dev/null.
|
|
||||||
If not specified it will be the same file as that given by the
|
|
||||||
--- util-linux-ng-2.18-rc1.orig/misc-utils/blkid.c
|
|
||||||
+++ util-linux-ng-2.18-rc1/misc-utils/blkid.c
|
|
||||||
@@ -65,7 +65,7 @@ static void usage(int error)
|
|
||||||
" [-o format] <dev> [dev ...]\n\n"
|
|
||||||
" %1$s -i [-s <tag>] [-o format] <dev> [dev ...]\n\n"
|
|
||||||
"Options:\n"
|
|
||||||
- " -c <file> cache file (default: /etc/blkid.tab, /dev/null = none)\n"
|
|
||||||
+ " -c <file> cache file (default: /etc/blkid/blkid.tab, /dev/null = none)\n"
|
|
||||||
" -h print this usage message and exit\n"
|
|
||||||
" -g garbage collect the blkid cache\n"
|
|
||||||
" -o <format> output format; can be one of:\n"
|
|
||||||
--- util-linux-ng-2.18-rc1.orig/shlibs/blkid/libblkid.3
|
|
||||||
+++ util-linux-ng-2.18-rc1/shlibs/blkid/libblkid.3
|
|
||||||
@@ -24,7 +24,7 @@ A common use is to allow use of LABEL= a
|
|
||||||
specific block device names into configuration files.
|
|
||||||
.P
|
|
||||||
Block device information is normally kept in a cache file
|
|
||||||
-.I /etc/blkid.tab
|
|
||||||
+.I /etc/blkid/blkid.tab
|
|
||||||
and is verified to still be valid before being returned to the user
|
|
||||||
(if the user has read permission on the raw block device, otherwise not).
|
|
||||||
The cache file also allows unprivileged users (normally anyone other
|
|
||||||
@@ -59,7 +59,7 @@ symlink does not match with LABEL or UUI
|
|
||||||
.I CACHE_FILE=<path>
|
|
||||||
Overrides the standard location of the cache file. This setting can be
|
|
||||||
overridden by the environment variable BLKID_FILE. Default is
|
|
||||||
-.I /etc/blkid.tab.
|
|
||||||
+.I /etc/blkid/blkid.tab.
|
|
||||||
.TP
|
|
||||||
.I EVALUATE=<methods>
|
|
||||||
Defines LABEL and UUID evaluation method(s). Currently, the libblkid library
|
|
||||||
@@ -77,7 +77,7 @@ from Ted Ts'o. The library was subseque
|
|
||||||
The low-level probing code was rewritten by Karel Zak.
|
|
||||||
.SH FILES
|
|
||||||
.TP 18
|
|
||||||
-.I /etc/blkid.tab
|
|
||||||
+.I /etc/blkid/blkid.tab
|
|
||||||
caches data extracted from each recognized block device
|
|
||||||
.TP
|
|
||||||
.I /etc/blkid.conf
|
|
||||||
--- util-linux-ng-2.18-rc1.orig/shlibs/blkid/src/blkidP.h
|
|
||||||
+++ util-linux-ng-2.18-rc1/shlibs/blkid/src/blkidP.h
|
|
||||||
@@ -279,7 +279,7 @@ extern int blkid_fstatat(DIR *dir, const
|
|
||||||
extern int blkid_openat(DIR *dir, const char *dirname, const char *filename,
|
|
||||||
int flags);
|
|
||||||
|
|
||||||
-#define BLKID_CACHE_FILE "/etc/blkid.tab"
|
|
||||||
+#define BLKID_CACHE_FILE "/etc/blkid/blkid.tab"
|
|
||||||
#define BLKID_CONFIG_FILE "/etc/blkid.conf"
|
|
||||||
|
|
||||||
#define BLKID_ERR_IO 5
|
|
@ -1,5 +1,4 @@
|
|||||||
#%PAM-1.0
|
#%PAM-1.0
|
||||||
auth required pam_securetty.so
|
|
||||||
auth substack password-auth
|
auth substack password-auth
|
||||||
auth include postlogin
|
auth include postlogin
|
||||||
account required pam_nologin.so
|
account required pam_nologin.so
|
||||||
|
5
util-linux-runuser-l.pamd
Normal file
5
util-linux-runuser-l.pamd
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#%PAM-1.0
|
||||||
|
auth include runuser
|
||||||
|
session optional pam_keyinit.so force revoke
|
||||||
|
-session optional pam_systemd.so
|
||||||
|
session include runuser
|
5
util-linux-runuser.pamd
Normal file
5
util-linux-runuser.pamd
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#%PAM-1.0
|
||||||
|
auth sufficient pam_rootok.so
|
||||||
|
session optional pam_keyinit.so revoke
|
||||||
|
session required pam_limits.so
|
||||||
|
session required pam_unix.so
|
6
util-linux-su-l.pamd
Normal file
6
util-linux-su-l.pamd
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#%PAM-1.0
|
||||||
|
auth include su
|
||||||
|
account include su
|
||||||
|
password include su
|
||||||
|
session optional pam_keyinit.so force revoke
|
||||||
|
session include su
|
14
util-linux-su.pamd
Normal file
14
util-linux-su.pamd
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#%PAM-1.0
|
||||||
|
auth sufficient pam_rootok.so
|
||||||
|
# Uncomment the following line to implicitly trust users in the "wheel" group.
|
||||||
|
#auth sufficient pam_wheel.so trust use_uid
|
||||||
|
# Uncomment the following line to require a user to be in the "wheel" group.
|
||||||
|
#auth required pam_wheel.so use_uid
|
||||||
|
auth substack system-auth
|
||||||
|
auth include postlogin
|
||||||
|
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
|
||||||
|
account include system-auth
|
||||||
|
password include system-auth
|
||||||
|
session include system-auth
|
||||||
|
session include postlogin
|
||||||
|
session optional pam_xauth.so
|
1707
util-linux.spec
1707
util-linux.spec
File diff suppressed because it is too large
Load Diff
1
uuidd-tmpfiles.conf
Normal file
1
uuidd-tmpfiles.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
d /run/uuidd 2775 uuidd uuidd
|
117
uuidd.init
117
uuidd.init
@ -1,117 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# uuidd uuidd daemon for unique time-based UUID generation
|
|
||||||
#
|
|
||||||
# Author: Eric Sandeen <sandeen@redhat.com>
|
|
||||||
#
|
|
||||||
# chkconfig: - 60 99
|
|
||||||
#
|
|
||||||
# description: uuidd is a helper daemon to guarantee uniqueness of \
|
|
||||||
# time-based UUIDs when using libuuid.
|
|
||||||
# processname: uuidd
|
|
||||||
# pidfile: /var/lib/libuuid/uuidd.pid
|
|
||||||
#
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: uuidd
|
|
||||||
# Required-Start: $time $local_fs
|
|
||||||
# Required-Stop: $time $local_fs
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: UUID daemon
|
|
||||||
# Description: Daemon which guarantees uniqueness of time-based UUIDS
|
|
||||||
# when using libuuid.
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# source function library
|
|
||||||
. /etc/rc.d/init.d/functions
|
|
||||||
|
|
||||||
[ -e /etc/sysconfig/uuidd ] && . /etc/sysconfig/uuidd
|
|
||||||
|
|
||||||
DAEMON=uuidd
|
|
||||||
exec=/usr/sbin/uuidd
|
|
||||||
prog=uuidd
|
|
||||||
user=uuidd
|
|
||||||
lockfile=/var/lock/subsys/$DAEMON
|
|
||||||
pidfile=/var/run/uuidd/uuidd.pid
|
|
||||||
|
|
||||||
check() {
|
|
||||||
# Check that we're a privileged user
|
|
||||||
[ $(id -u) -eq 0 ] || exit 4
|
|
||||||
|
|
||||||
# Check if daemon binary is executable
|
|
||||||
[ -x $exec ] || exit 5
|
|
||||||
}
|
|
||||||
|
|
||||||
start () {
|
|
||||||
check
|
|
||||||
echo -n $"Starting $prog: "
|
|
||||||
daemon --user $user --pidfile $pidfile $DAEMON
|
|
||||||
retval=$?
|
|
||||||
echo
|
|
||||||
[ $retval -eq 0 ] && touch $lockfile
|
|
||||||
return $retval
|
|
||||||
}
|
|
||||||
|
|
||||||
stop () {
|
|
||||||
check
|
|
||||||
echo -n $"Stopping $prog: "
|
|
||||||
killproc $DAEMON
|
|
||||||
retval=$?
|
|
||||||
echo
|
|
||||||
[ $retval -eq 0 ] && rm -f $lockfile
|
|
||||||
return $retval
|
|
||||||
}
|
|
||||||
|
|
||||||
restart() {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
reload() {
|
|
||||||
restart
|
|
||||||
}
|
|
||||||
|
|
||||||
force_reload() {
|
|
||||||
restart
|
|
||||||
}
|
|
||||||
|
|
||||||
rh_status() {
|
|
||||||
status -p $pidfile $DAEMON
|
|
||||||
}
|
|
||||||
|
|
||||||
rh_status_q() {
|
|
||||||
rh_status >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
rh_status_q && exit 0
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
rh_status_q || exit 0
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
rh_status_q || exit 7
|
|
||||||
$1
|
|
||||||
;;
|
|
||||||
force-reload)
|
|
||||||
force_reload
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
rh_status
|
|
||||||
;;
|
|
||||||
condrestart|try-restart)
|
|
||||||
rh_status_q || exit 0
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
|
||||||
exit 2
|
|
||||||
esac
|
|
||||||
exit $?
|
|
Loading…
Reference in New Issue
Block a user