Compare commits
316 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0317f94b5 | ||
|
|
9213a0ec8f | ||
|
|
d3c879ee06 | ||
|
|
e20697608b | ||
|
|
62e94b8fcb | ||
|
|
49c5ecdbfb | ||
|
|
ad160404f2 | ||
|
|
f891325268 | ||
|
|
da7125e4bb | ||
|
|
196be3f2a1 | ||
|
|
47417a6e2e | ||
|
|
4737f2d702 | ||
|
|
06dbf9bb28 | ||
|
|
4bac19fd38 | ||
|
|
df438c4170 | ||
| ab6d50b588 | |||
|
|
9c226720cb | ||
|
|
7ef16d92f7 | ||
|
|
ba1905c6c7 | ||
|
|
9e2caeba0d | ||
|
|
5679a7db71 | ||
|
|
b9ed3a9a74 | ||
|
|
39c148ff89 | ||
|
|
04d2b6b0ad | ||
| eeebe2875e | |||
|
|
164a6760ec | ||
|
|
0382798ff4 |
||
|
|
7d135acec2 | ||
|
|
b309d832e2 | ||
|
|
404f522557 | ||
|
|
bf8d5779df | ||
|
|
8e9f6cee44 | ||
|
|
0e7e2e7599 | ||
|
|
ca46de6072 | ||
|
|
67c133a8d4 | ||
|
|
e873a14a1d | ||
|
|
cd951d5e56 |
||
|
|
3e60999497 | ||
| 347d30bca0 | |||
|
|
674f706e83 | ||
|
3abb2f6222 |
|||
|
|
56f4756f3a | ||
|
|
0298d7d2a2 | ||
|
|
d6af9bf445 | ||
| 240d76d679 | |||
|
|
61d2c55ceb | ||
|
|
5a2471d6e5 | ||
|
|
6975c91b71 | ||
|
|
0921016466 | ||
|
|
479766f342 | ||
| c96f6dfba7 | |||
| 480d4cbafa | |||
|
|
abe9339a37 | ||
|
|
8472af8e2c | ||
|
|
e345fc8ab4 | ||
|
|
981295a856 | ||
|
|
bc83b318de | ||
|
|
f0320c8ef7 | ||
|
|
0bd50d406f | ||
|
|
1d94d2966a | ||
|
|
5854ee9f05 | ||
| ceb56aabcb | |||
| b15359d1d4 | |||
| dc6a971801 | |||
| e5d9a1e3ef | |||
| a4d9e81291 | |||
| 1d0d7588dd | |||
|
|
bac574c283 | ||
|
|
c9ce0bbf54 | ||
|
|
8ecb7f1bee | ||
|
|
a16ce36c6f | ||
|
|
302188f833 | ||
|
|
58dc9b6959 | ||
|
|
9a5289e70c | ||
|
|
59309f26f2 | ||
|
|
0b1e1d7cfe | ||
|
|
8760847a17 | ||
|
|
b2320e7499 | ||
|
|
b04999a5a6 | ||
|
|
7961e208cd | ||
|
|
db855d07b8 | ||
|
|
fe2d027119 | ||
|
|
844dcc152c | ||
|
|
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 | ||
|
|
5fd3817ee5 | ||
|
|
49e6ba1400 | ||
|
|
1d0642d057 | ||
|
|
e5224a209a |
36 changed files with 3328 additions and 3015 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
84
.gitignore
vendored
84
.gitignore
vendored
|
|
@ -22,3 +22,87 @@
|
|||
/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
|
||||
/util-linux-2.39.tar.xz
|
||||
/util-linux-2.39.1.tar.xz
|
||||
/util-linux-2.39.2.tar.xz
|
||||
/util-linux-2.39.3.tar.xz
|
||||
/util-linux-2.40-rc1.tar.xz
|
||||
/util-linux-2.40.tar.xz
|
||||
/util-linux-2.40.1.tar.xz
|
||||
/util-linux-2.40.2.tar.xz
|
||||
/util-linux-2.40.4.tar.xz
|
||||
/util-linux-2.41.tar.xz
|
||||
/util-linux-2.41.1.tar.xz
|
||||
/util-linux-2.41.2.tar.xz
|
||||
/util-linux-2.41.3.tar.xz
|
||||
/util-linux-2.42.tar.xz
|
||||
/util-linux-2.42.1.tar.xz
|
||||
/util-linux-2.42.2.tar.xz
|
||||
|
|
|
|||
27
0000-login-use-O_CREAT-on-lastlog.patch
Normal file
27
0000-login-use-O_CREAT-on-lastlog.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
From a2357184ff3dc3beb001fcb12e1e4c0dcf8d0dbd Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Tue, 2 Dec 2025 16:15:44 +0100
|
||||
Subject: login: use O_CREAT on lastlog
|
||||
|
||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=151635
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
login-utils/login.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/login-utils/login.c b/login-utils/login.c
|
||||
index 321f9d6ce..edc69fd9a 100644
|
||||
--- a/login-utils/login.c
|
||||
+++ b/login-utils/login.c
|
||||
@@ -682,7 +682,7 @@ static void log_lastlog(struct login_context *cxt)
|
||||
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);
|
||||
--
|
||||
2.51.1
|
||||
|
||||
27
0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch
Normal file
27
0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
From 617a887a6ec7e433f6a9f4c60592ed38b12b9f18 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Tue, 2 Dec 2025 16:17:55 +0100
|
||||
Subject: login: add /run/motd.d` to the hardcoded MOTD_FILE
|
||||
|
||||
Addresses: https://github.com/coreos/console-login-helper-messages/issues/60
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
include/pathnames.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/pathnames.h b/include/pathnames.h
|
||||
index 34ba11ca3..c91a077e1 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
|
||||
--
|
||||
2.51.1
|
||||
|
||||
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}
|
||||
2
adjtime
Normal file
2
adjtime
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
0.0 0 0.0
|
||||
0
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From 7afbf6f20e1de62fb5595411d998703c95af8965 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Wed, 2 Jan 2013 08:23:00 +0100
|
||||
Subject: [PATCH 1/3] agetty: replace perms 660 to 620
|
||||
|
||||
... the default is root:tty 620
|
||||
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
login-utils/login.1 | 5 ++++-
|
||||
term-utils/agetty.c | 2 +-
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/login-utils/login.1 b/login-utils/login.1
|
||||
index 092213d..e37e5e6 100644
|
||||
--- a/login-utils/login.1
|
||||
+++ b/login-utils/login.1
|
||||
@@ -184,7 +184,10 @@ login failure. The default value is
|
||||
(string)
|
||||
.RS 4
|
||||
The terminal permissions. The default value is
|
||||
-.IR 0600 .
|
||||
+.IR 0600
|
||||
+or
|
||||
+.IR 0620
|
||||
+if tty group is used.
|
||||
.RE
|
||||
.PP
|
||||
.B TTYGROUP
|
||||
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
|
||||
index 7ee252d..17ebfba 100644
|
||||
--- a/term-utils/agetty.c
|
||||
+++ b/term-utils/agetty.c
|
||||
@@ -894,7 +894,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
|
||||
* Linux login(1) will change tty permissions. Use root owner and group
|
||||
* with permission -rw------- for the period between getty and login.
|
||||
*/
|
||||
- if (chown(buf, 0, gid) || chmod(buf, (gid ? 0660 : 0600))) {
|
||||
+ if (chown(buf, 0, gid) || chmod(buf, (gid ? 0620 : 0600))) {
|
||||
if (errno == EROFS)
|
||||
log_warn("%s: %m", buf);
|
||||
else
|
||||
--
|
||||
1.8.1
|
||||
|
||||
|
|
@ -1,139 +0,0 @@
|
|||
From c265cc40a8ece740084fbfb3ebd4c1894b3b29b7 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Thu, 17 Jan 2013 18:48:16 +0100
|
||||
Subject: [PATCH 3/3] cal: don't mix ncurses output functions and printf()
|
||||
|
||||
Fedora 18 (ncurses-libs-5.9-7.20121017, glibc-2.16-28):
|
||||
|
||||
$ cal | cat
|
||||
Actual results:
|
||||
January 2013 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8
|
||||
9 10 11 1213 14 15 16 17 18 1920 21 22 23 24 25 2627 28 29 30 31
|
||||
|
||||
Not sure where is the problem, but it's too fragile to mix two
|
||||
output methods in one code.
|
||||
|
||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=896447
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
misc-utils/cal.c | 43 +++++++++++++++++++++++++++----------------
|
||||
1 file changed, 27 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
|
||||
index 60e85df..0e204b9 100644
|
||||
--- a/misc-utils/cal.c
|
||||
+++ b/misc-utils/cal.c
|
||||
@@ -498,7 +498,7 @@ monthly(int day, int month, int year) {
|
||||
do_monthly(day, month, year, &out);
|
||||
for (i = 0; i < FMT_ST_LINES; i++) {
|
||||
my_putstring(out.s[i]);
|
||||
- putchar('\n');
|
||||
+ my_putstring("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,8 +533,11 @@ monthly3(int day, int month, int year) {
|
||||
do_monthly(day, next_month, next_year, &out_next);
|
||||
|
||||
width = (julian ? J_WEEK_LEN : WEEK_LEN) -1;
|
||||
- for (i = 0; i < 2; i++)
|
||||
- printf("%s %s %s\n", out_prev.s[i], out_curm.s[i], out_next.s[i]);
|
||||
+ for (i = 0; i < 2; i++) {
|
||||
+ snprintf(lineout, sizeof(lineout),
|
||||
+ "%s %s %s\n", out_prev.s[i], out_curm.s[i], out_next.s[i]);
|
||||
+ my_putstring(lineout);
|
||||
+ }
|
||||
for (i = 2; i < FMT_ST_LINES; i++) {
|
||||
int w1, w2, w3;
|
||||
w1 = w2 = w3 = width;
|
||||
@@ -562,7 +565,7 @@ j_yearly(int day, int year) {
|
||||
|
||||
snprintf(lineout, sizeof(lineout), "%d", year);
|
||||
center(lineout, J_WEEK_LEN*2 + J_HEAD_SEP - 1, 0);
|
||||
- printf("\n\n");
|
||||
+ my_putstring("\n\n");
|
||||
|
||||
for (i = 0; i < 12; i++)
|
||||
day_array(day, i + 1, year, days[i]);
|
||||
@@ -571,8 +574,10 @@ j_yearly(int day, int year) {
|
||||
for (month = 0; month < 12; month += 2) {
|
||||
center(full_month[month], J_WEEK_LEN-1, J_HEAD_SEP+1);
|
||||
center(full_month[month + 1], J_WEEK_LEN-1, 0);
|
||||
- printf("\n%s%*s %s\n", j_day_headings, J_HEAD_SEP, "",
|
||||
- j_day_headings);
|
||||
+ snprintf(lineout, sizeof(lineout),
|
||||
+ "\n%s%*s %s\n", j_day_headings, J_HEAD_SEP, "",
|
||||
+ j_day_headings);
|
||||
+ my_putstring(lineout);
|
||||
for (row = 0; row < 6; row++) {
|
||||
p = lineout;
|
||||
for (which_cal = 0; which_cal < 2; which_cal++) {
|
||||
@@ -584,10 +589,10 @@ j_yearly(int day, int year) {
|
||||
*p = '\0';
|
||||
trim_trailing_spaces(lineout);
|
||||
my_putstring(lineout);
|
||||
- putchar('\n');
|
||||
+ my_putstring("\n");
|
||||
}
|
||||
}
|
||||
- printf("\n");
|
||||
+ my_putstring("\n");
|
||||
}
|
||||
|
||||
void
|
||||
@@ -598,7 +603,7 @@ yearly(int day, int year) {
|
||||
|
||||
snprintf(lineout, sizeof(lineout), "%d", year);
|
||||
center(lineout, WEEK_LEN*3 + HEAD_SEP*2 - 1, 0);
|
||||
- printf("\n\n");
|
||||
+ my_putstring("\n\n");
|
||||
|
||||
for (i = 0; i < 12; i++)
|
||||
day_array(day, i + 1, year, days[i]);
|
||||
@@ -608,8 +613,10 @@ yearly(int day, int year) {
|
||||
center(full_month[month], WEEK_LEN-1, HEAD_SEP+1);
|
||||
center(full_month[month + 1], WEEK_LEN-1, HEAD_SEP+1);
|
||||
center(full_month[month + 2], WEEK_LEN-1, 0);
|
||||
- printf("\n%s%*s %s%*s %s\n", day_headings, HEAD_SEP,
|
||||
- "", day_headings, HEAD_SEP, "", day_headings);
|
||||
+ snprintf(lineout, sizeof(lineout),
|
||||
+ "\n%s%*s %s%*s %s\n", day_headings, HEAD_SEP,
|
||||
+ "", day_headings, HEAD_SEP, "", day_headings);
|
||||
+ my_putstring(lineout);
|
||||
for (row = 0; row < 6; row++) {
|
||||
p = lineout;
|
||||
for (which_cal = 0; which_cal < 3; which_cal++) {
|
||||
@@ -621,10 +628,10 @@ yearly(int day, int year) {
|
||||
*p = '\0';
|
||||
trim_trailing_spaces(lineout);
|
||||
my_putstring(lineout);
|
||||
- putchar('\n');
|
||||
+ my_putstring("\n");
|
||||
}
|
||||
}
|
||||
- putchar('\n');
|
||||
+ my_putstring("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -773,10 +780,14 @@ void
|
||||
center(const char *str, size_t len, int separate)
|
||||
{
|
||||
char lineout[FMT_ST_CHARS];
|
||||
+
|
||||
center_str(str, lineout, ARRAY_SIZE(lineout), len);
|
||||
- fputs(lineout, stdout);
|
||||
- if (separate)
|
||||
- printf("%*s", separate, "");
|
||||
+ my_putstring(lineout);
|
||||
+
|
||||
+ if (separate) {
|
||||
+ snprintf(lineout, sizeof(lineout), "%*s", separate, "");
|
||||
+ my_putstring(lineout);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void __attribute__ ((__noreturn__)) usage(FILE * out)
|
||||
--
|
||||
1.8.1
|
||||
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
From 85c24fe2b11cd136d43bbffd983014a3f967c25e Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Oprala <ooprala@redhat.com>
|
||||
Date: Fri, 21 Dec 2012 13:04:04 +0100
|
||||
Subject: [PATCH 2/3] hexdump: do not segfault when iterating over an empty
|
||||
format string
|
||||
|
||||
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
|
||||
---
|
||||
tests/commands.sh | 1 +
|
||||
tests/expected/hexdump/empty-format | 1 +
|
||||
tests/ts/hexdump/empty-format | 26 ++++++++++++++++++++++++++
|
||||
text-utils/parse.c | 16 +++++++++-------
|
||||
4 files changed, 37 insertions(+), 7 deletions(-)
|
||||
create mode 100644 tests/expected/hexdump/empty-format
|
||||
create mode 100755 tests/ts/hexdump/empty-format
|
||||
|
||||
diff --git a/tests/commands.sh b/tests/commands.sh
|
||||
index db1d4ac..3672095 100644
|
||||
--- a/tests/commands.sh
|
||||
+++ b/tests/commands.sh
|
||||
@@ -62,3 +62,4 @@ TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/findmnt"}
|
||||
|
||||
TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
|
||||
|
||||
+TS_CMD_HEXDUMP=${TS_CMD_HEXDUMP-"$top_builddir/hexdump"}
|
||||
diff --git a/tests/expected/hexdump/empty-format b/tests/expected/hexdump/empty-format
|
||||
new file mode 100644
|
||||
index 0000000..9d60796
|
||||
--- /dev/null
|
||||
+++ b/tests/expected/hexdump/empty-format
|
||||
@@ -0,0 +1 @@
|
||||
+11
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/ts/hexdump/empty-format b/tests/ts/hexdump/empty-format
|
||||
new file mode 100755
|
||||
index 0000000..4a3e528
|
||||
--- /dev/null
|
||||
+++ b/tests/ts/hexdump/empty-format
|
||||
@@ -0,0 +1,26 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+# This file is part of util-linux.
|
||||
+#
|
||||
+# This file is free software; you can redistribute it and/or modify
|
||||
+# it under the terms of the GNU General Public License as published by
|
||||
+# the Free Software Foundation; either version 2 of the License, or
|
||||
+# (at your option) any later version.
|
||||
+#
|
||||
+# This file 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.
|
||||
+#
|
||||
+TS_TOPDIR="$(dirname $0)/../.."
|
||||
+TS_DESC="format-strings"
|
||||
+
|
||||
+. $TS_TOPDIR/functions.sh
|
||||
+ts_init "$*"
|
||||
+
|
||||
+INPUT=$(printf \\1)
|
||||
+$TS_CMD_HEXDUMP -n1 -ve '2 "" "%x"' <<< $INPUT 2>&1 >> $TS_OUTPUT
|
||||
+
|
||||
+$TS_CMD_HEXDUMP -n1 -ve '4 "%x"' -e '2 ""' <<< $INPUT 2>&1 >> $TS_OUTPUT
|
||||
+
|
||||
+ts_finalize
|
||||
diff --git a/text-utils/parse.c b/text-utils/parse.c
|
||||
index 5f1e2bd..bd96961 100644
|
||||
--- a/text-utils/parse.c
|
||||
+++ b/text-utils/parse.c
|
||||
@@ -421,13 +421,15 @@ isint2: switch(fu->bcnt) {
|
||||
!(fu->flags&F_SETREP) && fu->bcnt)
|
||||
fu->reps += (blocksize - fs->bcnt) / fu->bcnt;
|
||||
if (fu->reps > 1) {
|
||||
- for (pr = fu->nextpr;; pr = pr->nextpr)
|
||||
- if (!pr->nextpr)
|
||||
- break;
|
||||
- for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
|
||||
- p2 = isspace((unsigned char)*p1) ? p1 : NULL;
|
||||
- if (p2)
|
||||
- pr->nospace = p2;
|
||||
+ if (fu->nextpr) {
|
||||
+ for (pr = fu->nextpr; ; pr = pr->nextpr)
|
||||
+ if (!pr->nextpr)
|
||||
+ break;
|
||||
+ for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
|
||||
+ p2 = isspace((unsigned char)*p1) ? p1 : NULL;
|
||||
+ if (p2)
|
||||
+ pr->nospace = p2;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
1.8.1
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
From d4a276491269b6502c15e0089fba6b616f5c5df8 Mon Sep 17 00:00:00 2001
|
||||
From: Goffredo Baroncelli <kreijack@inwind.it>
|
||||
Date: Wed, 9 Jan 2013 22:14:43 +0100
|
||||
Subject: [PATCH] libblkid: add support for btrfs backup superblock
|
||||
|
||||
Btrfs has three superblock. The first one is placed at 64KB, the second one at
|
||||
64MB, the third one at 256GB.
|
||||
|
||||
If the first superblock is valid except that the "magic field" is zeroed, btrfs
|
||||
skips the check of the other superblocks. If the first superblock is fully
|
||||
invalid, btrfs checks for the other superblock.
|
||||
|
||||
So zeroing the first superblock "magic field" at the beginning seems that the
|
||||
filesystem is wiped. But when the first superblock is overwritten (eg by
|
||||
another filesystem), then the other two superblock may be considered valid, and
|
||||
the filesystem may resurrect.
|
||||
|
||||
This patch allow to find and wipe the other btrfs superblocks signature.
|
||||
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
libblkid/src/superblocks/btrfs.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/libblkid/src/superblocks/btrfs.c b/libblkid/src/superblocks/btrfs.c
|
||||
index 039be42..1bd1df9 100644
|
||||
--- a/libblkid/src/superblocks/btrfs.c
|
||||
+++ b/libblkid/src/superblocks/btrfs.c
|
||||
@@ -87,6 +87,14 @@ const struct blkid_idinfo btrfs_idinfo =
|
||||
.magics =
|
||||
{
|
||||
{ .magic = "_BHRfS_M", .len = 8, .kboff = 64, .sboff = 0x40 },
|
||||
+ { .magic = "_BHRfS_M",
|
||||
+ .len = 8,
|
||||
+ .kboff = 64 * 1024,
|
||||
+ .sboff = 0x40 },
|
||||
+ { .magic = "_BHRfS_M",
|
||||
+ .len = 8,
|
||||
+ .kboff = 256 * 1024 * 1024,
|
||||
+ .sboff = 0x40 },
|
||||
{ NULL }
|
||||
}
|
||||
};
|
||||
--
|
||||
1.7.11.7
|
||||
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
diff -up util-linux-2.22.2/libblkid/src/blkidP.h.kzak util-linux-2.22.2/libblkid/src/blkidP.h
|
||||
--- util-linux-2.22.2/libblkid/src/blkidP.h.kzak 2012-12-12 21:04:47.902355093 +0100
|
||||
+++ util-linux-2.22.2/libblkid/src/blkidP.h 2013-02-20 10:54:33.885606609 +0100
|
||||
@@ -224,6 +224,9 @@ struct blkid_struct_probe
|
||||
|
||||
/* private per-probing flags */
|
||||
#define BLKID_PROBE_FL_IGNORE_PT (1 << 1) /* ignore partition table */
|
||||
+#define BLKID_PROBE_FL_IGNORE_BACKUP (1 << 2) /* ignore backup superblocks or PT */
|
||||
+
|
||||
+extern int blkid_probe_ignore_backup(blkid_probe pr);
|
||||
|
||||
extern blkid_probe blkid_clone_probe(blkid_probe parent);
|
||||
extern blkid_probe blkid_probe_get_wholedisk_probe(blkid_probe pr);
|
||||
diff -up util-linux-2.22.2/libblkid/src/probe.c.kzak util-linux-2.22.2/libblkid/src/probe.c
|
||||
--- util-linux-2.22.2/libblkid/src/probe.c.kzak 2012-12-12 21:04:47.903355101 +0100
|
||||
+++ util-linux-2.22.2/libblkid/src/probe.c 2013-02-20 11:02:48.525255696 +0100
|
||||
@@ -810,6 +810,7 @@ int blkid_probe_get_idmag(blkid_probe pr
|
||||
static inline void blkid_probe_start(blkid_probe pr)
|
||||
{
|
||||
if (pr) {
|
||||
+ DBG(DEBUG_LOWPROBE, printf("%p: start probe\n", pr));
|
||||
pr->cur_chain = NULL;
|
||||
pr->prob_flags = 0;
|
||||
blkid_probe_set_wiper(pr, 0, 0);
|
||||
@@ -819,6 +820,7 @@ static inline void blkid_probe_start(blk
|
||||
static inline void blkid_probe_end(blkid_probe pr)
|
||||
{
|
||||
if (pr) {
|
||||
+ DBG(DEBUG_LOWPROBE, printf("%p: end probe\n", pr));
|
||||
pr->cur_chain = NULL;
|
||||
pr->prob_flags = 0;
|
||||
blkid_probe_set_wiper(pr, 0, 0);
|
||||
@@ -1057,6 +1059,8 @@ int blkid_do_safeprobe(blkid_probe pr)
|
||||
|
||||
blkid_probe_start(pr);
|
||||
|
||||
+ pr->prob_flags |= BLKID_PROBE_FL_IGNORE_BACKUP;
|
||||
+
|
||||
for (i = 0; i < BLKID_NCHAINS; i++) {
|
||||
struct blkid_chain *chn;
|
||||
|
||||
@@ -1679,3 +1683,7 @@ void blkid_probe_use_wiper(blkid_probe p
|
||||
}
|
||||
}
|
||||
|
||||
+int blkid_probe_ignore_backup(blkid_probe pr)
|
||||
+{
|
||||
+ return pr && (pr->prob_flags & BLKID_PROBE_FL_IGNORE_BACKUP);
|
||||
+}
|
||||
diff -up util-linux-2.22.2/libblkid/src/superblocks/btrfs.c.kzak util-linux-2.22.2/libblkid/src/superblocks/btrfs.c
|
||||
--- util-linux-2.22.2/libblkid/src/superblocks/btrfs.c.kzak 2013-02-20 10:54:03.422381876 +0100
|
||||
+++ util-linux-2.22.2/libblkid/src/superblocks/btrfs.c 2013-02-20 10:54:33.886606616 +0100
|
||||
@@ -63,6 +63,11 @@ static int probe_btrfs(blkid_probe pr, c
|
||||
{
|
||||
struct btrfs_super_block *bfs;
|
||||
|
||||
+ if (mag->kboff > 64 && blkid_probe_ignore_backup(pr)) {
|
||||
+ DBG(DEBUG_LOWPROBE, printf("btrfs: found backup superblock, ignore\n"));
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
bfs = blkid_probe_get_sb(pr, mag, struct btrfs_super_block);
|
||||
if (!bfs)
|
||||
return -1;
|
||||
|
|
@ -1,165 +0,0 @@
|
|||
From 2270b1ad90b394950f4fe215eb2fc1042020cef0 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Fri, 1 Feb 2013 15:59:58 +0100
|
||||
Subject: [PATCH] libblkid: remove optimization from verify( funrtion
|
||||
|
||||
Now libblkid (the cache based part) tries to probe for the cached
|
||||
filesystem firstly. This optimization is broken, because:
|
||||
|
||||
* new another superblock could be on the device and the original
|
||||
is already obsolete
|
||||
* we still need to probe for partitions and raids
|
||||
* the code was too fragile
|
||||
|
||||
The patch also suggests lsblk --fs in blkid.8 for end users. lsblk
|
||||
read information from used db.
|
||||
|
||||
Reported-by: Andreas Hofmeister <andi@collax.com>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
libblkid/src/verify.c | 76 ++++++++-------------------------------------------
|
||||
misc-utils/blkid.8 | 11 ++++++++
|
||||
2 files changed, 22 insertions(+), 65 deletions(-)
|
||||
|
||||
diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c
|
||||
index 4bab4de..0f48c48 100644
|
||||
--- a/libblkid/src/verify.c
|
||||
+++ b/libblkid/src/verify.c
|
||||
@@ -43,26 +43,6 @@ static void blkid_probe_to_tags(blkid_probe pr, blkid_dev dev)
|
||||
blkid_set_tag(dev, name, data, len);
|
||||
}
|
||||
}
|
||||
-
|
||||
- /*
|
||||
- * remove obsolete tags
|
||||
- */
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "LABEL"))
|
||||
- blkid_set_tag(dev, "LABEL", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "UUID"))
|
||||
- blkid_set_tag(dev, "UUID", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "PART_ENTRY_UUID"))
|
||||
- blkid_set_tag(dev, "PARTUUID", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "PART_ENTRY_NAME"))
|
||||
- blkid_set_tag(dev, "PARTLABEL", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "TYPE"))
|
||||
- blkid_set_tag(dev, "TYPE", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "SEC_TYPE"))
|
||||
- blkid_set_tag(dev, "SEC_TYPE", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "EXT_JOURNAL")) /* extN */
|
||||
- blkid_set_tag(dev, "EXT_JOURNAL", NULL, 0);
|
||||
- if (!nvals || !blkid_probe_has_value(pr, "MOUNT")) /* ocfs */
|
||||
- blkid_set_tag(dev, "MOUNT", NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -76,9 +56,10 @@ static void blkid_probe_to_tags(blkid_probe pr, blkid_dev dev)
|
||||
*/
|
||||
blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
|
||||
{
|
||||
+ blkid_tag_iterate iter;
|
||||
+ const char *type, *value;
|
||||
struct stat st;
|
||||
time_t diff, now;
|
||||
- char *fltr[2];
|
||||
int fd;
|
||||
|
||||
if (!dev)
|
||||
@@ -155,64 +136,29 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- blkid_probe_enable_superblocks(cache->probe, TRUE);
|
||||
+ /* remove old cache info */
|
||||
+ iter = blkid_tag_iterate_begin(dev);
|
||||
+ while (blkid_tag_next(iter, &type, &value) == 0)
|
||||
+ blkid_set_tag(dev, type, NULL, 0);
|
||||
+ blkid_tag_iterate_end(iter);
|
||||
|
||||
+ /* enable superblocks probing */
|
||||
+ blkid_probe_enable_superblocks(cache->probe, TRUE);
|
||||
blkid_probe_set_superblocks_flags(cache->probe,
|
||||
BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
|
||||
BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE);
|
||||
|
||||
- /*
|
||||
- * If we already know the type, then try that first.
|
||||
- */
|
||||
- if (dev->bid_type) {
|
||||
- blkid_tag_iterate iter;
|
||||
- const char *type, *value;
|
||||
-
|
||||
- fltr[0] = dev->bid_type;
|
||||
- fltr[1] = NULL;
|
||||
-
|
||||
- blkid_probe_filter_superblocks_type(cache->probe,
|
||||
- BLKID_FLTR_ONLYIN, fltr);
|
||||
-
|
||||
- if (blkid_do_probe(cache->probe) == 0) {
|
||||
- /*
|
||||
- * Cool, we found FS type, let's also read PART{UUID,LABEL}
|
||||
- */
|
||||
- blkid_probe_enable_superblocks(cache->probe, FALSE);
|
||||
- blkid_probe_enable_partitions(cache->probe, TRUE);
|
||||
- blkid_probe_set_partitions_flags(cache->probe, BLKID_PARTS_ENTRY_DETAILS);
|
||||
- if (blkid_do_probe(cache->probe) == 0)
|
||||
- goto found_type;
|
||||
- }
|
||||
-
|
||||
- blkid_probe_enable_superblocks(cache->probe, TRUE);
|
||||
- blkid_probe_invert_superblocks_filter(cache->probe);
|
||||
-
|
||||
- /*
|
||||
- * Zap the device filesystem information and try again
|
||||
- */
|
||||
- DBG(DEBUG_PROBE,
|
||||
- printf("previous fs type %s not valid, "
|
||||
- "trying full probe\n", dev->bid_type));
|
||||
- iter = blkid_tag_iterate_begin(dev);
|
||||
- while (blkid_tag_next(iter, &type, &value) == 0)
|
||||
- blkid_set_tag(dev, type, 0, 0);
|
||||
- blkid_tag_iterate_end(iter);
|
||||
- }
|
||||
-
|
||||
+ /* enable partitions probing */
|
||||
blkid_probe_enable_partitions(cache->probe, TRUE);
|
||||
blkid_probe_set_partitions_flags(cache->probe, BLKID_PARTS_ENTRY_DETAILS);
|
||||
|
||||
- /*
|
||||
- * Probe for all types.
|
||||
- */
|
||||
+ /* probe */
|
||||
if (blkid_do_safeprobe(cache->probe)) {
|
||||
/* found nothing or error */
|
||||
blkid_free_dev(dev);
|
||||
dev = NULL;
|
||||
}
|
||||
|
||||
-found_type:
|
||||
if (dev) {
|
||||
#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
||||
struct timeval tv;
|
||||
diff --git a/misc-utils/blkid.8 b/misc-utils/blkid.8
|
||||
index 2ba1ab4..eb8d716 100644
|
||||
--- a/misc-utils/blkid.8
|
||||
+++ b/misc-utils/blkid.8
|
||||
@@ -64,6 +64,17 @@ library. It can determine the type of content (e.g. filesystem or swap)
|
||||
that a block device holds, and also attributes (tokens, NAME=value pairs)
|
||||
from the content metadata (e.g. LABEL or UUID fields).
|
||||
.PP
|
||||
+Note that
|
||||
+.B blkid
|
||||
+reads information directly from devices and for non-root users
|
||||
+it returns cached unverified information. It's better to use
|
||||
+.B lsblk --fs
|
||||
+to get user-friendly overview about filesystems and devices.
|
||||
+.BR lsblk (8)
|
||||
+is also easy to use in scripts.
|
||||
+.B blkid
|
||||
+is mostly designed for system services and to test libblkid functionality.
|
||||
+.PP
|
||||
.B blkid
|
||||
has two main forms of operation: either searching for a device with a
|
||||
specific NAME=value pair, or displaying NAME=value pairs for one or
|
||||
--
|
||||
1.8.1
|
||||
|
||||
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);
|
||||
}
|
||||
5
plans/ci.fmf
Normal file
5
plans/ci.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
3
sources
3
sources
|
|
@ -1,2 +1 @@
|
|||
eeacbfdd2556acd899a2d0ffdb446185 util-linux-2.22.2.tar.xz
|
||||
a02aac97c74259ca1b24972c89147ca4 floppy-0.18.tar.bz2
|
||||
SHA512 (util-linux-2.42.2.tar.xz) = 7415add0be2930654e322830808dde03ff6d511bd357f0679e6b6287a13ca79fe58ce4ac05edef86b76fb381b3a36ca2da9d3c31b5dc0a1d889c203156a57277
|
||||
|
|
|
|||
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>
|
||||
13
tests/various/main.fmf
Normal file
13
tests/various/main.fmf
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
summary: This test groups small sanity and regression tests for util-linux
|
||||
description: ''
|
||||
contact: Miroslav Vadkerti <mvadkert@redhat.com>
|
||||
component:
|
||||
- util-linux
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- util-linux
|
||||
- util-linux-user
|
||||
duration: 10m
|
||||
extra-summary: /CoreOS/util-linux/Sanity/various
|
||||
extra-task: /CoreOS/util-linux/Sanity/various
|
||||
51
tests/various/runtest.sh
Executable file
51
tests/various/runtest.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/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/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,103 +0,0 @@
|
|||
diff -up util-linux-2.19/floppy-0.18/floppyfloppy.c.kzak util-linux-2.19/floppy-0.18/floppyfloppy.c
|
||||
--- util-linux-2.19/floppy-0.18/floppyfloppy.c.kzak 2009-09-24 03:36:33.000000000 +0200
|
||||
+++ util-linux-2.19/floppy-0.18/floppyfloppy.c 2011-03-07 10:40:42.000000000 +0100
|
||||
@@ -271,6 +271,33 @@ static RETSIGTYPE sighandler(int signum)
|
||||
#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)
|
||||
@@ -282,6 +309,7 @@ static int do_format(const char *dev, in
|
||||
struct format_descr curtrack;
|
||||
int pct;
|
||||
struct stat stat_buf;
|
||||
+ int gen = 0;
|
||||
|
||||
int i, j;
|
||||
char *devname;
|
||||
@@ -304,23 +332,52 @@ static int do_format(const char *dev, in
|
||||
|
||||
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,11 +0,0 @@
|
|||
diff -up util-linux-2.19/floppy-0.18/superfloppy.c.kzak util-linux-2.19/floppy-0.18/superfloppy.c
|
||||
--- util-linux-2.19/floppy-0.18/superfloppy.c.kzak 2009-09-23 02:47:26.000000000 +0200
|
||||
+++ util-linux-2.19/floppy-0.18/superfloppy.c 2011-03-07 10:37:20.000000000 +0100
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <popt.h>
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
+#include <locale.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
diff -up util-linux-2.22.2/disk-utils/fdformat.8.kzak util-linux-2.22.2/disk-utils/fdformat.8
|
||||
--- util-linux-2.22.2/disk-utils/fdformat.8.kzak 2012-06-11 12:06:53.620195844 +0200
|
||||
+++ util-linux-2.22.2/disk-utils/fdformat.8 2013-02-19 16:16:27.130214023 +0100
|
||||
@@ -43,6 +43,11 @@ when a non-standard format is being used
|
||||
autodetected earlier. In this case, use
|
||||
.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
|
||||
\fB\-n\fR, \fB\-\-no\-verify\fR
|
||||
@@ -57,7 +62,8 @@ Display help and exit.
|
||||
.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,49 +0,0 @@
|
|||
diff -up util-linux-2.22.2/sys-utils/ipcs.c.kzak util-linux-2.22.2/sys-utils/ipcs.c
|
||||
--- util-linux-2.22.2/sys-utils/ipcs.c.kzak 2012-12-12 21:04:47.976355744 +0100
|
||||
+++ util-linux-2.22.2/sys-utils/ipcs.c 2013-02-19 16:12:54.712551108 +0100
|
||||
@@ -264,6 +264,27 @@ static void print_perms (int id, struct
|
||||
printf(" %-10u\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)
|
||||
{
|
||||
int maxid, shmid, id;
|
||||
@@ -288,12 +309,12 @@ void do_shm (char format)
|
||||
* 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,8 +0,0 @@
|
|||
#
|
||||
# Enter raw device bindings here.
|
||||
#
|
||||
# An example would be:
|
||||
# ACTION=="add", KERNEL=="sda", RUN+="/usr/bin/raw /dev/raw/raw1 %N"
|
||||
# to bind /dev/raw/raw1 to /dev/sda, or
|
||||
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/usr/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
|
||||
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
|
||||
auth substack system-auth
|
||||
auth include postlogin
|
||||
account required pam_nologin.so
|
||||
|
|
@ -8,7 +7,6 @@ password include system-auth
|
|||
# pam_selinux.so close should be the first session rule
|
||||
session required pam_selinux.so close
|
||||
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
|
||||
session required pam_selinux.so open
|
||||
session required pam_namespace.so
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
|
||||
Based on upstream patch:
|
||||
|
||||
From 8998ad001fdb58ceba4147f8aa4c72203117db25 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Wed, 5 Jun 2013 14:31:00 +0200
|
||||
Subject: [PATCH] login: use TCSANOW to remove HUPCL
|
||||
|
||||
login(1) code:
|
||||
|
||||
ttt.c_cflag &= ~HUPCL;
|
||||
tcsetattr(0, TCSAFLUSH, &ttt);
|
||||
|
||||
close(STDIN_FILENO);
|
||||
close(STDOUT_FILENO);
|
||||
close(STDERR_FILENO);
|
||||
|
||||
signal(SIGHUP, SIG_IGN); /* so vhangup() wont kill us */
|
||||
vhangup();
|
||||
signal(SIGHUP, SIG_DFL);
|
||||
|
||||
strace :
|
||||
|
||||
ioctl(0, SNDCTL_TMR_CONTINUE or SNDRV_TIMER_IOCTL_GPARAMS or TCSETSF, {B9600 opost isig icanon echo ...}) = 0
|
||||
close(0) = 0
|
||||
close(1) = 0
|
||||
close(2) = 0
|
||||
--- SIGHUP {si_signo=SIGHUP, si_code=SI_KERNEL} ---
|
||||
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
|
||||
+++ killed by SIGTERM +++
|
||||
|
||||
It seems we get SIGHUP (and SIGTERM from systemd) before vhangup().
|
||||
The problem occur sometimes.
|
||||
|
||||
I guess it's because TCSAFLUSH is not applied immediately, so it would
|
||||
be probably better to use TCSANOW to make the code more robust.
|
||||
|
||||
References: https://bugzilla.redhat.com/show_bug.cgi?id=962145
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
diff -up util-linux-2.22.2/login-utils/login.c.kzak util-linux-2.22.2/login-utils/login.c
|
||||
--- util-linux-2.22.2/login-utils/login.c.kzak 2013-08-01 14:03:39.189156123 +0200
|
||||
+++ util-linux-2.22.2/login-utils/login.c 2013-08-01 14:06:16.942580758 +0200
|
||||
@@ -407,7 +407,7 @@ static void init_tty(struct login_contex
|
||||
}
|
||||
|
||||
/* Kill processes left on this tty */
|
||||
- tcsetattr(0, TCSAFLUSH, &ttt);
|
||||
+ tcsetattr(0, TCSANOW, &ttt);
|
||||
|
||||
/*
|
||||
* Let's close file decriptors before vhangup
|
||||
@@ -1323,10 +1323,10 @@ int main(int argc, char **argv)
|
||||
close(cnt);
|
||||
|
||||
setpgrp(); /* set pgid to pid this means that setsid() will fail */
|
||||
+ init_tty(&cxt);
|
||||
|
||||
openlog("login", LOG_ODELAY, LOG_AUTHPRIV);
|
||||
|
||||
- init_tty(&cxt);
|
||||
init_loginpam(&cxt);
|
||||
|
||||
/* login -f, then the user has already been authenticated */
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
diff -up util-linux-2.22.2/login-utils/login.c.kzak util-linux-2.22.2/login-utils/login.c
|
||||
--- util-linux-2.22.2/login-utils/login.c.kzak 2012-12-12 21:04:47.906355128 +0100
|
||||
+++ util-linux-2.22.2/login-utils/login.c 2013-02-19 16:14:33.224339106 +0100
|
||||
@@ -514,7 +514,7 @@ static void log_lastlog(struct login_con
|
||||
if (!cxt->pwd)
|
||||
return;
|
||||
|
||||
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
|
||||
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#%PAM-1.0
|
||||
auth required pam_securetty.so
|
||||
auth substack password-auth
|
||||
auth include postlogin
|
||||
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
|
||||
15
util-linux-su.pamd
Normal file
15
util-linux-su.pamd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#%PAM-1.0
|
||||
auth required pam_env.so
|
||||
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
|
||||
2730
util-linux.spec
2730
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue