Compare commits

..

9 commits

Author SHA1 Message Date
Karel Zak
ccfa199c64 2.19.1-1.4: fix #707035
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-11 13:27:49 +02:00
Karel Zak
52a02ebeb9 2.19.1-1.3: #716483
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-04 23:45:38 +02:00
Karel Zak
d6ea7f6451 2.19.1-1.2: fix #709681
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-14 11:43:44 +02:00
Karel Zak
3d7bc453eb 2.19.1-1.1: fix mount -a
- fix #709319 - 'mount -a' mounts already mounted directories
- fix kernel version parsing

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-14 11:09:02 +02:00
Karel Zak
ca854f7da3 2.19.1-1: upgrade
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-06 14:28:01 +02:00
Karel Zak
b21024ce79 2.19-4: fix mountinfo parsing
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-21 10:46:35 +02:00
Karel Zak
6bb4e20fb3 update URLs in spec file
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-07 10:23:50 +01:00
Karel Zak
f3bea18c63 2.19-3: fix #679799
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-24 14:35:25 +01:00
Karel Zak
e342b75ef9 2.19-2; fix #677569
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-15 11:05:08 +01:00
38 changed files with 3176 additions and 3408 deletions

View file

@ -1 +0,0 @@
1

101
.gitignore vendored
View file

@ -4,105 +4,4 @@
/util-linux-2.19-rc2.tar.bz2
/util-linux-2.19-rc3.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.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
/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

View file

@ -1,27 +0,0 @@
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

View file

@ -1,27 +0,0 @@
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

View file

@ -1,12 +0,0 @@
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}

View file

@ -1,2 +0,0 @@
0.0 0 0.0
0

2341
changelog

File diff suppressed because it is too large Load diff

63
nologin.8 Normal file
View file

@ -0,0 +1,63 @@
.\" $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 Normal file
View file

@ -0,0 +1,58 @@
/* $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);
}

View file

@ -1,5 +0,0 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View file

@ -1 +1,2 @@
SHA512 (util-linux-2.42.2.tar.xz) = 7415add0be2930654e322830808dde03ff6d511bd357f0679e6b6287a13ca79fe58ce4ac05edef86b76fb381b3a36ca2da9d3c31b5dc0a1d889c203156a57277
3eab06f05163dfa65479c44e5231932c util-linux-2.19.1.tar.bz2
7eeb9a6f7a258174bf0fa80f1370788d floppy-0.16.tar.bz2

View file

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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)

View file

@ -1,3 +0,0 @@
PURPOSE of /CoreOS/util-linux/various
Description: This test groups small sanity and regression tests for util-linux
Author: Miroslav Vadkerti <mvadkert@redhat.com>

View file

@ -1,13 +0,0 @@
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

View file

@ -1,51 +0,0 @@
#!/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

View file

@ -0,0 +1,32 @@
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

View file

@ -0,0 +1,290 @@
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

View file

@ -0,0 +1,105 @@
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

View file

@ -0,0 +1,66 @@
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

View file

@ -0,0 +1,33 @@
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

View file

@ -0,0 +1,76 @@
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

11
util-linux-60-raw.rules Normal file
View file

@ -0,0 +1,11 @@
# 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.

View file

@ -1,4 +1,5 @@
#%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
@ -7,6 +8,7 @@ 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

View file

@ -0,0 +1,10 @@
--- 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)

View file

@ -0,0 +1,23 @@
--- 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

View file

@ -0,0 +1,102 @@
--- 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) &param) < 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);

View file

@ -0,0 +1,10 @@
--- 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>

View file

@ -0,0 +1,13 @@
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) &&

View file

@ -0,0 +1,48 @@
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;

View file

@ -0,0 +1,78 @@
---
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

View file

@ -1,4 +1,5 @@
#%PAM-1.0
auth required pam_securetty.so
auth substack password-auth
auth include postlogin
account required pam_nologin.so

View file

@ -1,5 +0,0 @@
#%PAM-1.0
auth include runuser
session optional pam_keyinit.so force revoke
-session optional pam_systemd.so
session include runuser

View file

@ -1,5 +0,0 @@
#%PAM-1.0
auth sufficient pam_rootok.so
session optional pam_keyinit.so revoke
session required pam_limits.so
session required pam_unix.so

View file

@ -1,6 +0,0 @@
#%PAM-1.0
auth include su
account include su
password include su
session optional pam_keyinit.so force revoke
session include su

View file

@ -1,15 +0,0 @@
#%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

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
d /run/uuidd 2775 uuidd uuidd

117
uuidd.init Executable file
View file

@ -0,0 +1,117 @@
#!/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 $?