Compare commits
1 Commits
rawhide
...
util-linux
Author | SHA1 | Date | |
---|---|---|---|
|
7fb4868b1e |
2
.cvsignore
Normal file
2
.cvsignore
Normal file
@ -0,0 +1,2 @@
|
||||
floppy-0.12.tar.gz
|
||||
util-linux-2.13-pre6.tar.bz2
|
92
.gitignore
vendored
92
.gitignore
vendored
@ -1,92 +0,0 @@
|
||||
/floppy-0.16.tar.bz2
|
||||
/util-linux-2.19-rc1.tar.bz2
|
||||
/util-linux-2.19-rc1-32-gbded43d.tar.bz2
|
||||
/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
|
6
Makefile
Normal file
6
Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
# Makefile for source rpm: util-linux
|
||||
# $Id$
|
||||
NAME := util-linux
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
include ../common/Makefile.common
|
@ -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}
|
10
floppy-0.12-locale.patch
Normal file
10
floppy-0.12-locale.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- floppy-0.12/superfloppy.c.fixfail 2004-07-15 14:41:21.835145325 -0400
|
||||
+++ floppy-0.12/superfloppy.c 2004-07-15 14:41:32.385876513 -0400
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <errno.h>
|
||||
#include <popt.h>
|
||||
#include <libintl.h>
|
||||
+#include <locale.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
@ -1,13 +0,0 @@
|
||||
diff --git a/include/pathnames.h b/include/pathnames.h
|
||||
index 3845d4c33..fac3a0783 100644
|
||||
--- a/include/pathnames.h
|
||||
+++ b/include/pathnames.h
|
||||
@@ -41,7 +41,7 @@
|
||||
#ifndef _PATH_MAILDIR
|
||||
# define _PATH_MAILDIR "/var/spool/mail"
|
||||
#endif
|
||||
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
|
||||
+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
|
||||
#ifndef _PATH_NOLOGIN
|
||||
# define _PATH_NOLOGIN "/etc/nologin"
|
||||
#endif
|
@ -1,12 +0,0 @@
|
||||
diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c
|
||||
--- util-linux-2.36/login-utils/login.c.kzak 2020-07-23 14:13:26.777030764 +0200
|
||||
+++ util-linux-2.36/login-utils/login.c 2020-07-23 14:11:22.793686983 +0200
|
||||
@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
|
||||
|
||||
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
|
||||
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
|
||||
if (fd < 0)
|
||||
goto done;
|
||||
offset = cxt->pwd->pw_uid * sizeof(ll);
|
63
nologin.8
Normal file
63
nologin.8
Normal 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
58
nologin.c
Normal 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);
|
||||
}
|
73
raw-handle-nonpresent-devs.patch
Normal file
73
raw-handle-nonpresent-devs.patch
Normal file
@ -0,0 +1,73 @@
|
||||
--- util-linux-2.12a/disk-utils/raw.c.=K0000=.orig
|
||||
+++ util-linux-2.12a/disk-utils/raw.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#endif
|
||||
#define DEVFS_RAWCTLDEV "/dev/raw/rawctl"
|
||||
|
||||
+#define RAW_NR_MINORS 8192
|
||||
|
||||
char * progname;
|
||||
int do_query = 0;
|
||||
@@ -94,7 +95,7 @@ int main(int argc, char *argv[])
|
||||
if (do_query_all) {
|
||||
if (optind < argc)
|
||||
usage(1);
|
||||
- for (i=1; i<255; i++)
|
||||
+ for (i = 1; i < RAW_NR_MINORS; i++)
|
||||
query(i, 1);
|
||||
exit(0);
|
||||
}
|
||||
@@ -109,9 +110,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
err = stat(raw_name, &statbuf);
|
||||
if (err) {
|
||||
- fprintf (stderr, "Cannot locate raw device '%s' (%s)\n",
|
||||
- raw_name, strerror(errno));
|
||||
- exit(2);
|
||||
+ int rc;
|
||||
+
|
||||
+ rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
|
||||
+ if (rc != 1) {
|
||||
+ fprintf (stderr,
|
||||
+ "Cannot locate raw device '%s' (%s)\n",
|
||||
+ raw_name, strerror(errno));
|
||||
+ exit(2);
|
||||
+ }
|
||||
+ goto skip_test_rawdev;
|
||||
}
|
||||
|
||||
if (!S_ISCHR(statbuf.st_mode)) {
|
||||
@@ -127,6 +135,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
raw_minor = minor(statbuf.st_rdev);
|
||||
|
||||
+skip_test_rawdev:
|
||||
if (do_query)
|
||||
return query(raw_minor, 0);
|
||||
|
||||
@@ -193,6 +202,7 @@ void open_raw_ctl(void)
|
||||
int query(int minor, int quiet)
|
||||
{
|
||||
struct raw_config_request rq;
|
||||
+ static int has_worked = 0;
|
||||
int err;
|
||||
|
||||
rq.raw_minor = minor;
|
||||
@@ -200,11 +210,17 @@ int query(int minor, int quiet)
|
||||
if (err < 0) {
|
||||
if (quiet && errno == ENODEV)
|
||||
return 3;
|
||||
+ if (has_worked && errno == EINVAL)
|
||||
+ return 0;
|
||||
fprintf (stderr,
|
||||
"Error querying raw device (%s)\n",
|
||||
strerror(errno));
|
||||
exit(3);
|
||||
}
|
||||
+ /* If one query has worked, mark that fact so that we don't
|
||||
+ * report spurious fatal errors if raw(8) has been built to
|
||||
+ * support more raw minor numbers than the kernel has. */
|
||||
+ has_worked = 1;
|
||||
if (quiet && !rq.block_major && !rq.block_minor)
|
||||
return 0;
|
||||
printf (RAWDEVDIR "raw%d: bound to major %d, minor %d\n",
|
3
sources
3
sources
@ -1 +1,2 @@
|
||||
SHA512 (util-linux-2.39-rc3.tar.xz) = 8a93d32a5ceb38d50a4b2c8bfa48bcab7ec9b758c89b5a1a4f7fd74558dce37385bd7ea203345148d4389de4ea60ec42058f9d7889a8075d3e616773d085427e
|
||||
7d3ac81855e26687dada6a31d2677875 floppy-0.12.tar.gz
|
||||
1db1249029439e5e965c2c7178149616 util-linux-2.13-pre6.tar.bz2
|
||||
|
@ -1,13 +0,0 @@
|
||||
# Test which run in classic and docker environemnt
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
- container
|
||||
- atomic
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tests:
|
||||
- various
|
||||
required_packages:
|
||||
- util-linux
|
||||
- util-linux-user
|
@ -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)
|
@ -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>
|
@ -1,52 +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/bin/rhts-environment.sh || exit 1
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="util-linux"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "return code of chfn should be always 1 in case failure"
|
||||
rlRun "chfn -f a:b" 1
|
||||
rlRun "chfn -o a:b" 1
|
||||
rlRun "chfn -p a:b" 1
|
||||
rlRun "chfn -h a:b" 1
|
||||
rlRun "chfn -x a:b" 1
|
||||
rlRun "chfn -f a -o b -p c -h d unknown-user" 1
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
14
util-linux-2.11f-rawman.patch
Normal file
14
util-linux-2.11f-rawman.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- util-linux-2.11f/disk-utils/raw.8.sopwith Tue Feb 26 13:15:34 2002
|
||||
+++ util-linux-2.11f/disk-utils/raw.8 Tue Feb 26 13:16:28 2002
|
||||
@@ -58,6 +58,11 @@
|
||||
disk, they must be an exact number of sectors long, and the data buffer
|
||||
in virtual memory must also be aligned to a multiple of the sector
|
||||
size. The sector size is 512 bytes for most devices.
|
||||
+.PP
|
||||
+Use the /etc/sysconfig/rawdevices file to define the set of raw device
|
||||
+mappings automatically created during the system startup sequence. The
|
||||
+format of the file is the same used in the command line with the exception
|
||||
+that the "raw" command itself is omitted.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B -q
|
19
util-linux-2.11y-chsh-103004.patch
Normal file
19
util-linux-2.11y-chsh-103004.patch
Normal file
@ -0,0 +1,19 @@
|
||||
--- util-linux-2.11y/login-utils/chsh.c.sopwith Fri Sep 5 08:51:49 2003
|
||||
+++ util-linux-2.11y/login-utils/chsh.c Fri Sep 5 08:53:43 2003
|
||||
@@ -185,7 +185,6 @@
|
||||
printf (_("Shell not changed.\n"));
|
||||
return 0;
|
||||
}
|
||||
- if (!strcmp(shell, "/bin/sh")) shell = "";
|
||||
pw->pw_shell = shell;
|
||||
if (setpwnam (pw) < 0) {
|
||||
perror ("setpwnam");
|
||||
@@ -299,6 +298,8 @@
|
||||
check_shell (char *shell) {
|
||||
int i, c;
|
||||
|
||||
+ if (! *shell) shell = "/bin/sh"; /* Fudge it */
|
||||
+
|
||||
if (*shell != '/') {
|
||||
printf (_("%s: shell must be a full path name.\n"), whoami);
|
||||
return (-1);
|
31
util-linux-2.11y-fdisksegv-103954.patch
Normal file
31
util-linux-2.11y-fdisksegv-103954.patch
Normal file
@ -0,0 +1,31 @@
|
||||
*** util-linux-2.11y/fdisk/fdisk.c.000 2003-09-08 14:47:41.000000000 +0200
|
||||
--- util-linux-2.11y/fdisk/fdisk.c 2003-09-08 15:01:42.000000000 +0200
|
||||
***************
|
||||
*** 2020,2028 ****
|
||||
for (i = 0; i < 4; i++)
|
||||
free_primary += !ptes[i].part_table->sys_ind;
|
||||
|
||||
! if (!free_primary && partitions >= MAXIMUM_PARTS) {
|
||||
! printf(_("The maximum number of partitions has been created\n"));
|
||||
! return;
|
||||
}
|
||||
|
||||
if (!free_primary) {
|
||||
--- 2020,2036 ----
|
||||
for (i = 0; i < 4; i++)
|
||||
free_primary += !ptes[i].part_table->sys_ind;
|
||||
|
||||
! // Fix to only add primary partition if all logical partions are used <leonardjo@hetnet.nl>
|
||||
! if (partitions >= MAXIMUM_PARTS) {
|
||||
! if (!free_primary) {
|
||||
! printf(_("The maximum number of partitions has been created\n"));
|
||||
! return;
|
||||
! }
|
||||
! else {
|
||||
! add_partition(get_partition(0, 4),
|
||||
! LINUX_NATIVE);
|
||||
! return;
|
||||
! }
|
||||
}
|
||||
|
||||
if (!free_primary) {
|
26
util-linux-2.11y-multibyte.patch
Normal file
26
util-linux-2.11y-multibyte.patch
Normal file
@ -0,0 +1,26 @@
|
||||
--- util-linux-2.11y/text-utils/more.c.multibyte 2003-02-03 16:22:32.000000000 +0000
|
||||
+++ util-linux-2.11y/text-utils/more.c 2003-02-03 17:03:45.000000000 +0000
|
||||
@@ -1163,7 +1163,23 @@
|
||||
my_putstring(state ? ULenter : ULexit);
|
||||
}
|
||||
if (c != ' ' || pstate == 0 || state != 0 || ulglitch == 0)
|
||||
+#ifdef ENABLE_WIDECHAR
|
||||
+ {
|
||||
+ wchar_t wc;
|
||||
+ size_t mblength;
|
||||
+ mbstate_t state;
|
||||
+ memset (&state, '\0', sizeof (mbstate_t));
|
||||
+ s--; n++;
|
||||
+ mblength = mbrtowc (&wc, s, n, &state);
|
||||
+ if (mblength == (size_t) -2 || mblength == (size_t) -1)
|
||||
+ mblength = 1;
|
||||
+ while (mblength--)
|
||||
+ putchar (*s++);
|
||||
+ n += mblength;
|
||||
+ }
|
||||
+#else
|
||||
putchar(c);
|
||||
+#endif /* ENABLE_WIDECHAR */
|
||||
if (state && *chUL) {
|
||||
pr(chBS);
|
||||
my_putstring(chUL);
|
70
util-linux-2.11y-procpartitions-37436.patch
Normal file
70
util-linux-2.11y-procpartitions-37436.patch
Normal file
@ -0,0 +1,70 @@
|
||||
--- util-linux-2.11y/disk-utils/blockdev.c.procpartitions 2002-03-08 17:57:02.000000000 -0500
|
||||
+++ util-linux-2.11y/disk-utils/blockdev.c 2003-01-13 14:28:41.000000000 -0500
|
||||
@@ -290,6 +290,7 @@
|
||||
char ptname[200];
|
||||
char device[210];
|
||||
int ma, mi, sz;
|
||||
+ char iobuf[32*1024];
|
||||
|
||||
procpt = fopen(PROC_PARTITIONS, "r");
|
||||
if (!procpt) {
|
||||
@@ -297,6 +298,7 @@
|
||||
progname, PROC_PARTITIONS);
|
||||
exit(1);
|
||||
}
|
||||
+ setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
|
||||
|
||||
while (fgets(line, sizeof(line), procpt)) {
|
||||
if (sscanf (line, " %d %d %d %[^\n ]",
|
||||
--- util-linux-2.11y/fdisk/fdisk.c.procpartitions 2003-01-13 14:28:41.000000000 -0500
|
||||
+++ util-linux-2.11y/fdisk/fdisk.c 2003-01-13 14:28:41.000000000 -0500
|
||||
@@ -2371,12 +2371,14 @@
|
||||
FILE *procpt;
|
||||
char line[100], ptname[100], devname[120], *s;
|
||||
int ma, mi, sz;
|
||||
+ char iobuf[32*1024];
|
||||
|
||||
procpt = fopen(PROC_PARTITIONS, "r");
|
||||
if (procpt == NULL) {
|
||||
fprintf(stderr, _("cannot open %s\n"), PROC_PARTITIONS);
|
||||
return;
|
||||
}
|
||||
+ setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
|
||||
|
||||
while (fgets(line, sizeof(line), procpt)) {
|
||||
if (sscanf (line, " %d %d %d %[^\n ]",
|
||||
--- util-linux-2.11y/mount/mount_by_label.c.procpartitions 2002-11-26 04:23:49.000000000 -0500
|
||||
+++ util-linux-2.11y/mount/mount_by_label.c 2003-01-13 14:31:53.000000000 -0500
|
||||
@@ -136,9 +136,7 @@
|
||||
char device[110];
|
||||
int firstPass;
|
||||
int handleOnFirst;
|
||||
-#if 0
|
||||
char iobuf[32*1024]; /* For setvbuf */
|
||||
-#endif
|
||||
|
||||
if (uuidCache)
|
||||
return;
|
||||
@@ -155,7 +153,6 @@
|
||||
PROC_PARTITIONS);
|
||||
return;
|
||||
}
|
||||
-#if 0
|
||||
/* Ugly kludge - the contents of /proc/partitions change in time,
|
||||
and this causes failures when the file is not read in one go.
|
||||
In particular, one cannot use stdio on /proc/partitions.
|
||||
@@ -166,9 +163,12 @@
|
||||
to keep statistics in /proc/partitions. Of course, statistics belong
|
||||
in some /proc/diskstats, not in some /proc file that happened to
|
||||
exist already. */
|
||||
-
|
||||
+/* Until someone actually implements something else, /proc/partitions _IS_
|
||||
+ /proc/diskstats. And no matter what file we are reading, we will still
|
||||
+ need to increase the buffer size, because 8k is just not Enough For
|
||||
+ Everyone even if stats aren't in /proc/partitions.
|
||||
+*/
|
||||
setvbuf(procpt, iobuf, _IOFBF, sizeof(iobuf));
|
||||
-#endif
|
||||
|
||||
for (firstPass = 1; firstPass >= 0; firstPass--) {
|
||||
fseek(procpt, 0, SEEK_SET);
|
109
util-linux-2.11y-skipraid2.patch
Normal file
109
util-linux-2.11y-skipraid2.patch
Normal file
@ -0,0 +1,109 @@
|
||||
--- util-linux-2.11y/mount/linux_fs.h.skipraid2 2002-10-07 09:08:22.000000000 -0400
|
||||
+++ util-linux-2.11y/mount/linux_fs.h 2003-01-13 14:42:57.000000000 -0500
|
||||
@@ -13,6 +13,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#include <inttypes.h>
|
||||
+#ifndef BLKGETSIZE64
|
||||
+#include <sys/ioctl.h>
|
||||
+#define BLKGETSIZE64 _IOR(0x12,114,sizeof(uint64_t))
|
||||
+#endif
|
||||
+
|
||||
#define MINIX_SUPER_MAGIC 0x137F /* minix v1, 14 char names */
|
||||
#define MINIX_SUPER_MAGIC2 0x138F /* minix v1, 30 char names */
|
||||
#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2, 14 char names */
|
||||
--- util-linux-2.11y/mount/get_label_uuid.c.skipraid2 2003-01-13 14:44:04.000000000 -0500
|
||||
+++ util-linux-2.11y/mount/get_label_uuid.c 2003-01-13 14:46:34.000000000 -0500
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <endian.h>
|
||||
+#include <sys/stat.h>
|
||||
|
||||
#include "linux_fs.h"
|
||||
#include "get_label_uuid.h"
|
||||
@@ -19,28 +21,62 @@
|
||||
* not on the disks that form the raid array. This test causes a lot of
|
||||
* problems when run on my striped promise fasttrak 100 array."
|
||||
*/
|
||||
-static inline int
|
||||
-is_raid_partition(int fd) {
|
||||
-#if 0
|
||||
- struct mdp_super_block mdsb;
|
||||
- int n;
|
||||
-
|
||||
- /* hardcode 4096 here in various places, because that's
|
||||
- what it's defined to be. Note that even if we used
|
||||
- the actual kernel headers, sizeof(mdp_super_t) is
|
||||
- slightly larger in the 2.2 kernel on 64-bit archs,
|
||||
- so using that wouldn't work. */
|
||||
- lseek(fd, -4096, SEEK_END); /* Ignore possible error
|
||||
- about return value overflow */
|
||||
- n = 4096;
|
||||
- if (sizeof(mdsb) < n)
|
||||
- n = sizeof(mdsb);
|
||||
- if (read(fd, &mdsb, n) != n)
|
||||
- return 1; /* error */
|
||||
- return (mdsbmagic(mdsb) == MD_SB_MAGIC);
|
||||
+
|
||||
+#if BYTE_ORDER == BIG_ENDIAN
|
||||
+#define INT32_FROM_LE(val) ((unsigned int) ( \
|
||||
+ (((unsigned int) (val) & (unsigned int) 0x000000ffU) << 24) | \
|
||||
+ (((unsigned int) (val) & (unsigned int) 0x0000ff00U) << 8) | \
|
||||
+ (((unsigned int) (val) & (unsigned int) 0x00ff0000U) >> 8) | \
|
||||
+ (((unsigned int) (val) & (unsigned int) 0xff000000U) >> 24)))
|
||||
#else
|
||||
- return 0;
|
||||
+#define INT32_FROM_LE(val) (val)
|
||||
+#endif
|
||||
+
|
||||
+typedef struct {
|
||||
+ unsigned int md_magic;
|
||||
+} mdp_super_t;
|
||||
+#ifndef MD_SB_MAGIC
|
||||
+#define MD_SB_MAGIC 0xa92b4efc
|
||||
+#endif
|
||||
+#ifndef MD_RESERVED_BYTES
|
||||
+#define MD_RESERVED_BYTES 65536L
|
||||
#endif
|
||||
+#ifndef MD_NEW_SIZE_BYTES
|
||||
+#define MD_NEW_SIZE_BYTES(x) ((x & ~(MD_RESERVED_BYTES - 1L)) - MD_RESERVED_BYTES)
|
||||
+#endif
|
||||
+
|
||||
+static int
|
||||
+is_raid_partition(int fd)
|
||||
+{
|
||||
+ mdp_super_t mdsb;
|
||||
+ int n;
|
||||
+ struct stat sbuf;
|
||||
+ if(fstat(fd, &sbuf))
|
||||
+ return 2;
|
||||
+ if(!sbuf.st_size) {
|
||||
+ uint64_t bsize64;
|
||||
+ unsigned int bsize32;
|
||||
+ if(!ioctl(fd, BLKGETSIZE64, &bsize64))
|
||||
+ sbuf.st_size = bsize64;
|
||||
+ else if(!ioctl(fd, BLKGETSIZE, &bsize32))
|
||||
+ sbuf.st_size = bsize32;
|
||||
+ }
|
||||
+ if(!sbuf.st_size) return 3;
|
||||
+ /* hardcode 4096 here in various places,
|
||||
+ because that's what it's defined to be.
|
||||
+ Note that even if we used the actual kernel headers,
|
||||
+ sizeof(mdp_super_t) is slightly larger in the 2.2 kernel on 64-bit
|
||||
+ archs, so using that wouldn't work. */
|
||||
+ lseek(fd, MD_NEW_SIZE_BYTES(sbuf.st_size), SEEK_SET);
|
||||
+ n = 4096; if(sizeof(mdsb) < n) n = sizeof(mdsb);
|
||||
+ if(read(fd, &mdsb, n) != n)
|
||||
+ return 4; /* error */
|
||||
+ mdsb.md_magic = INT32_FROM_LE(mdsb.md_magic);
|
||||
+ return (mdsb.md_magic == MD_SB_MAGIC); /* If this device has a
|
||||
+ RAID superblock at
|
||||
+ the end, it must be
|
||||
+ part of a RAID
|
||||
+ array. */
|
||||
}
|
||||
|
||||
/* for now, only ext2, ext3, xfs, ocfs are supported */
|
32
util-linux-2.12a-126572-fdiskman.patch
Normal file
32
util-linux-2.12a-126572-fdiskman.patch
Normal file
@ -0,0 +1,32 @@
|
||||
--- util-linux-2.12a/fdisk/fdisk.8.sopwith 2004-07-09 17:49:08.522648265 -0400
|
||||
+++ util-linux-2.12a/fdisk/fdisk.8 2004-07-09 17:50:24.281128923 -0400
|
||||
@@ -213,28 +213,9 @@
|
||||
There are several *fdisk programs around.
|
||||
Each has its problems and strengths.
|
||||
Try them in the order
|
||||
-.BR cfdisk ,
|
||||
+.BR parted ,
|
||||
.BR fdisk ,
|
||||
.BR sfdisk .
|
||||
-(Indeed,
|
||||
-.B cfdisk
|
||||
-is a beautiful program that has strict requirements on
|
||||
-the partition tables it accepts, and produces high quality partition
|
||||
-tables. Use it if you can.
|
||||
-.B fdisk
|
||||
-is a buggy program that does fuzzy things - usually it happens to
|
||||
-produce reasonable results. Its single advantage is that it has
|
||||
-some support for BSD disk labels and other non-DOS partition tables.
|
||||
-Avoid it if you can.
|
||||
-.B sfdisk
|
||||
-is for hackers only - the user interface is terrible, but it is
|
||||
-more correct than fdisk and more powerful than both fdisk and cfdisk.
|
||||
-Moreover, it can be used noninteractively.)
|
||||
-.PP
|
||||
-These days there also is
|
||||
-.BR parted .
|
||||
-The cfdisk interface is nicer, but parted does much more: it not only
|
||||
-resizes partitions, but also the filesystems that live in them.
|
||||
.PP
|
||||
The IRIX/SGI type disklabel is currently not supported by the kernel.
|
||||
Moreover, IRIX/SGI header directories are not fully supported yet.
|
55
util-linux-2.12a-16415-rdevman.patch
Normal file
55
util-linux-2.12a-16415-rdevman.patch
Normal file
@ -0,0 +1,55 @@
|
||||
--- util-linux-2.12a/fdisk/fdisk.8.sopwith 2004-08-20 14:46:47.062722632 -0400
|
||||
+++ util-linux-2.12a/fdisk/fdisk.8 2004-08-20 14:47:12.496816302 -0400
|
||||
@@ -149,12 +149,12 @@
|
||||
this extra information even if the /U flag is given -- we consider
|
||||
this a bug in DOS FORMAT and DOS FDISK.
|
||||
|
||||
-The bottom line is that if you use cfdisk or fdisk to change the size of a
|
||||
+The bottom line is that if you use fdisk to change the size of a
|
||||
DOS partition table entry, then you must also use
|
||||
.B dd
|
||||
to zero the first 512 bytes of that partition before using DOS FORMAT to
|
||||
-format the partition. For example, if you were using cfdisk to make a DOS
|
||||
-partition table entry for /dev/hda1, then (after exiting fdisk or cfdisk
|
||||
+format the partition. For example, if you were using disk to make a DOS
|
||||
+partition table entry for /dev/hda1, then (after exiting fdisk
|
||||
and rebooting Linux so that the partition table information is valid) you
|
||||
would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero
|
||||
the first 512 bytes of the partition.
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
For best results, you should always use an OS-specific partition table
|
||||
program. For example, you should make DOS partitions with the DOS FDISK
|
||||
-program and Linux partitions with the Linux fdisk or Linux cfdisk program.
|
||||
+program and Linux partitions with the Linux fdisk program.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
@@ -228,7 +228,6 @@
|
||||
.\" Andreas Neuper (ANeuper@GUUG.de)
|
||||
.\" and many others.
|
||||
.SH "SEE ALSO"
|
||||
-.BR cfdisk (8),
|
||||
.BR mkfs (8),
|
||||
.BR parted (8),
|
||||
.BR sfdisk (8)
|
||||
--- util-linux-2.12a/sys-utils/rdev.8.sopwith 2004-08-20 11:35:56.740842004 -0400
|
||||
+++ util-linux-2.12a/sys-utils/rdev.8 2004-08-20 11:38:38.291622818 -0400
|
||||
@@ -79,7 +79,8 @@
|
||||
.B ramsize
|
||||
command, the
|
||||
.B size
|
||||
-parameter specifies the size of the RAM disk in kilobytes.
|
||||
+parameter specifies the size of the RAM disk in kilobytes. 2.0.x kernels and newer dynamically allocate the ramdisk
|
||||
+and do not need this setting.
|
||||
|
||||
For the
|
||||
.B rootflags
|
||||
@@ -121,6 +122,7 @@
|
||||
.B rdev
|
||||
to act like
|
||||
.BR ramsize .
|
||||
+(Not relevant for 2.0.x and newer kernels.)
|
||||
.TP
|
||||
.B \-R
|
||||
Causes
|
21
util-linux-2.12a-ipcs-84243-86285.patch
Normal file
21
util-linux-2.12a-ipcs-84243-86285.patch
Normal file
@ -0,0 +1,21 @@
|
||||
--- util-linux-2.12a/sys-utils/ipcs.c.ipcs 2004-03-04 14:28:42.000000000 -0500
|
||||
+++ util-linux-2.12a/sys-utils/ipcs.c 2004-05-26 18:05:44.967792668 -0400
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <time.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
+#include <unistd.h>
|
||||
#include "nls.h"
|
||||
|
||||
/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
|
||||
@@ -279,8 +280,8 @@
|
||||
(unsigned long) shminfo.shmmni);
|
||||
printf (_("max seg size (kbytes) = %lu\n"),
|
||||
(unsigned long) (shminfo.shmmax >> 10));
|
||||
- printf (_("max total shared memory (pages) = %lu\n"),
|
||||
- (unsigned long) shminfo.shmall);
|
||||
+ printf (_("max total shared memory (kbytes) = %lu\n"),
|
||||
+ (getpagesize()*((unsigned long) shminfo.shmall))/1024UL);
|
||||
printf (_("min seg size (bytes) = %lu\n"),
|
||||
(unsigned long) shminfo.shmmin);
|
||||
return;
|
30
util-linux-2.12a-mount-man-cifs.patch
Normal file
30
util-linux-2.12a-mount-man-cifs.patch
Normal file
@ -0,0 +1,30 @@
|
||||
--- util-linux-2.12a/mount/mount.8.cifs 2005-11-23 16:34:34.000000000 +0100
|
||||
+++ util-linux-2.12a/mount/mount.8 2005-11-23 16:38:37.000000000 +0100
|
||||
@@ -413,8 +413,8 @@
|
||||
program has to do is issue a simple
|
||||
.IR mount (2)
|
||||
system call, and no detailed knowledge of the filesystem type is required.
|
||||
-For a few types however (like nfs, nfs4, smbfs, ncpfs) ad hoc code is
|
||||
-necessary. The nfs ad hoc code is built in, but smbfs and ncpfs
|
||||
+For a few types however (like nfs, nfs4, smbfs, ncpfs, cifs) ad hoc code is
|
||||
+necessary. The nfs ad hoc code is built in, but smbfs, ncpfs and cifs
|
||||
have a separate mount program. In order to make it possible to
|
||||
treat all types in a uniform way, mount will execute the program
|
||||
.I /sbin/mount.TYPE
|
||||
@@ -720,6 +720,16 @@
|
||||
(However, quota utilities may react to such strings in
|
||||
.IR /etc/fstab .)
|
||||
|
||||
+.SH "Mount options for cifs"
|
||||
+Just like
|
||||
+.IR nfs " or " smbfs
|
||||
+implementation expects a binary argument
|
||||
+to the mount system call. This argument is constructed by
|
||||
+.BR mount.cifs (8)
|
||||
+and the current version of
|
||||
+.B mount
|
||||
+(2.12) does not know anything about cifs.
|
||||
+
|
||||
.SH "Mount options for coherent"
|
||||
None.
|
||||
|
63
util-linux-2.12a-mountbylabel-dm.patch
Normal file
63
util-linux-2.12a-mountbylabel-dm.patch
Normal file
@ -0,0 +1,63 @@
|
||||
--- util-linux-2.12a/mount/mount_by_label.c.old 2004-08-11 22:25:06.000000000 +0100
|
||||
+++ util-linux-2.12a/mount/mount_by_label.c 2004-08-11 22:25:21.000000000 +0100
|
||||
@@ -17,6 +17,8 @@
|
||||
* - Added JFS v2 format support
|
||||
* 2002-07-26 Luciano Chavez <lnx1138@us.ibm.com>
|
||||
* - Added EVMS support
|
||||
+ * 2004-08-11 Alasdair Kergon <agk@redhat.com>
|
||||
+ * - Added LVM2/device-mapper support
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -38,6 +40,7 @@
|
||||
#define VG_DIR "/proc/lvm/VGs"
|
||||
#define EVMS_VOLUME_NAME_SIZE 127
|
||||
#define PROC_EVMS_VOLUMES "/proc/evms/volumes"
|
||||
+#define DEVICEMAPPERDIR "/dev/mapper"
|
||||
|
||||
static struct uuidCache_s {
|
||||
struct uuidCache_s *next;
|
||||
@@ -101,6 +104,34 @@
|
||||
closedir(vg_dir);
|
||||
}
|
||||
|
||||
+/* LVM2/device-mapper support */
|
||||
+static void
|
||||
+uuidcache_init_dm(void) {
|
||||
+ char lvm_device[PATH_MAX];
|
||||
+ DIR *d;
|
||||
+ struct dirent *lv_iter;
|
||||
+ char uuid[16], *label;
|
||||
+
|
||||
+ if (!(d = opendir(DEVICEMAPPERDIR))) {
|
||||
+ if (errno != ENOENT)
|
||||
+ perror("mount (init_dm)");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ while ((lv_iter = readdir(d))) {
|
||||
+ if (!strcmp(lv_iter->d_name, "control") ||
|
||||
+ !strcmp(lv_iter->d_name, ".") ||
|
||||
+ !strcmp(lv_iter->d_name, ".."))
|
||||
+ continue;
|
||||
+ snprintf(lvm_device, sizeof(lvm_device), "%s/%s",
|
||||
+ DEVICEMAPPERDIR, lv_iter->d_name);
|
||||
+ if (!get_label_uuid(strdup(lvm_device), &label, uuid))
|
||||
+ uuidcache_addentry(strdup(lvm_device),
|
||||
+ label, uuid);
|
||||
+ }
|
||||
+ closedir(d);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
uuidcache_init_evms(void) {
|
||||
FILE *procvol;
|
||||
@@ -250,6 +281,8 @@
|
||||
fclose(procpt);
|
||||
|
||||
uuidcache_init_lvm();
|
||||
+
|
||||
+ uuidcache_init_dm();
|
||||
}
|
||||
|
||||
#define UUID 1
|
12
util-linux-2.12a-pamsession.patch
Normal file
12
util-linux-2.12a-pamsession.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -urb util-linux-2.12a.orig/login-utils/login.c util-linux-2.12a/login-utils/login.c
|
||||
--- util-linux-2.12a.orig/login-utils/login.c 2005-04-08 09:43:37.000000000 -0400
|
||||
+++ util-linux-2.12a/login-utils/login.c 2005-04-08 11:14:37.850579656 -0400
|
||||
@@ -703,6 +703,8 @@
|
||||
PAM_FAIL_CHECK;
|
||||
|
||||
retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED);
|
||||
+ if (retcode != PAM_SUCCESS)
|
||||
+ pam_close_session(pamh, 0);
|
||||
PAM_FAIL_CHECK;
|
||||
|
||||
#else /* ! USE_PAM */
|
11
util-linux-2.12a-pamstart.patch
Normal file
11
util-linux-2.12a-pamstart.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- util-linux-2.12a/login-utils/login.c.pamstart 2004-09-15 16:13:36.462028734 +0200
|
||||
+++ util-linux-2.12a/login-utils/login.c 2004-09-15 16:13:50.790278325 +0200
|
||||
@@ -549,7 +549,7 @@
|
||||
* Therefore, we are safe not setting it to anything
|
||||
*/
|
||||
|
||||
- retcode = pam_start("login",username, &conv, &pamh);
|
||||
+ retcode = pam_start(hflag?"remote":"login",username, &conv, &pamh);
|
||||
if(retcode != PAM_SUCCESS) {
|
||||
fprintf(stderr, _("login: PAM Failure, aborting: %s\n"),
|
||||
pam_strerror(pamh, retcode));
|
22
util-linux-2.12a-partlimit.patch
Normal file
22
util-linux-2.12a-partlimit.patch
Normal file
@ -0,0 +1,22 @@
|
||||
--- util-linux-2.12pre/fdisk/fdisk.8.miscfixes 2002-08-06 10:33:33.000000000 -0400
|
||||
+++ util-linux-2.12pre/fdisk/fdisk.8 2003-12-17 13:55:16.000000000 -0500
|
||||
@@ -65,7 +65,7 @@
|
||||
name followed by a partition number. For example,
|
||||
.B /dev/hda1
|
||||
is the first partition on the first IDE hard disk in the system.
|
||||
-IDE disks can have up to 63 partitions, SCSI disks up to 15.
|
||||
+Disks can have up to 15 partitions.
|
||||
See also
|
||||
.IR /usr/src/linux/Documentation/devices.txt .
|
||||
|
||||
--- util-linux-2.12pre/fdisk/fdisk.h.miscfixes 2003-07-13 14:25:00.000000000 -0400
|
||||
+++ util-linux-2.12pre/fdisk/fdisk.h 2003-12-17 13:55:16.000000000 -0500
|
||||
@@ -5,7 +5,7 @@
|
||||
#define DEFAULT_SECTOR_SIZE 512
|
||||
#define MAX_SECTOR_SIZE 2048
|
||||
#define SECTOR_SIZE 512 /* still used in BSD code */
|
||||
-#define MAXIMUM_PARTS 60
|
||||
+#define MAXIMUM_PARTS 15
|
||||
|
||||
#define ACTIVE_FLAG 0x80
|
||||
|
44
util-linux-2.12j-113790-hotkeys.patch
Normal file
44
util-linux-2.12j-113790-hotkeys.patch
Normal file
@ -0,0 +1,44 @@
|
||||
--- util-linux-2.12j/po/ca.po.sopwith 2004-12-05 14:08:08.000000000 -0500
|
||||
+++ util-linux-2.12j/po/ca.po 2004-12-10 13:10:52.411668785 -0500
|
||||
@@ -7183,7 +7183,7 @@
|
||||
#: login-utils/vipw.c:354
|
||||
#, c-format
|
||||
msgid "Would you like to edit %s now [y/n]? "
|
||||
-msgstr "Desitgeu editar %s ara? [s/n] "
|
||||
+msgstr "Desitgeu editar %s ara? [y/n] "
|
||||
|
||||
#: login-utils/wall.c:104
|
||||
#, c-format
|
||||
--- util-linux-2.12j/po/da.po.sopwith 2004-12-05 14:08:09.000000000 -0500
|
||||
+++ util-linux-2.12j/po/da.po 2004-12-10 13:09:50.382880759 -0500
|
||||
@@ -1470,7 +1470,7 @@
|
||||
|
||||
#: fdisk/cfdisk.c:1526
|
||||
msgid "Do you wish to start with a zero table [y/N] ?"
|
||||
-msgstr "Vil du starte med nulstillet tabel [j/N] ?"
|
||||
+msgstr "Vil du starte med nulstillet tabel [y/N] ?"
|
||||
|
||||
#: fdisk/cfdisk.c:1574
|
||||
msgid "You specified more cylinders than fit on disk"
|
||||
--- util-linux-2.12j/po/nl.po.sopwith 2004-12-05 14:08:15.000000000 -0500
|
||||
+++ util-linux-2.12j/po/nl.po 2004-12-10 13:09:50.390878282 -0500
|
||||
@@ -1493,7 +1493,7 @@
|
||||
|
||||
#: fdisk/cfdisk.c:1526
|
||||
msgid "Do you wish to start with a zero table [y/N] ?"
|
||||
-msgstr "Wilt u met een lege tabel beginnen [j/N] ?"
|
||||
+msgstr "Wilt u met een lege tabel beginnen [y/N] ?"
|
||||
|
||||
#: fdisk/cfdisk.c:1574
|
||||
msgid "You specified more cylinders than fit on disk"
|
||||
--- util-linux-2.12j/po/pt_BR.po.sopwith 2004-12-05 14:08:15.000000000 -0500
|
||||
+++ util-linux-2.12j/po/pt_BR.po 2004-12-10 13:11:47.560587674 -0500
|
||||
@@ -7161,7 +7161,7 @@
|
||||
#: login-utils/vipw.c:354
|
||||
#, c-format
|
||||
msgid "Would you like to edit %s now [y/n]? "
|
||||
-msgstr "Você gostaria de editar %s agora [s/n]"
|
||||
+msgstr "Você gostaria de editar %s agora [y/n]"
|
||||
|
||||
#: login-utils/wall.c:104
|
||||
#, c-format
|
11
util-linux-2.12j-managed.patch
Normal file
11
util-linux-2.12j-managed.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- util-linux-2.12a/mount/mount.c.sopwith 2004-03-04 20:28:22.000000000 -0500
|
||||
+++ util-linux-2.12a/mount/mount.c 2004-07-16 16:50:18.792814782 -0400
|
||||
@@ -191,6 +191,8 @@
|
||||
{ "diratime", 0, 1, MS_NODIRATIME }, /* Update dir access times */
|
||||
{ "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
|
||||
#endif
|
||||
+ { "kudzu", 0, 0, MS_COMMENT }, /* Silently remove this option (backwards compat use only - deprecated) */
|
||||
+ { "managed", 0, 0, MS_COMMENT }, /* Silently remove this option */
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
|
139
util-linux-2.12j-pamconsole.patch
Normal file
139
util-linux-2.12j-pamconsole.patch
Normal file
@ -0,0 +1,139 @@
|
||||
--- util-linux-2.12j/mount/mount.c.console 2004-12-10 12:32:57.887137495 -0500
|
||||
+++ util-linux-2.12j/mount/mount.c 2004-12-10 12:43:06.136750656 -0500
|
||||
@@ -97,14 +97,16 @@
|
||||
#define MS_USER 0x20000000
|
||||
#define MS_OWNER 0x10000000
|
||||
#define MS_GROUP 0x08000000
|
||||
+#define MS_PAMCONSOLE 0x04000000
|
||||
#define MS_COMMENT 0x00020000
|
||||
#define MS_LOOP 0x00010000
|
||||
|
||||
+
|
||||
/* Options that we keep the mount system call from seeing. */
|
||||
-#define MS_NOSYS (MS_NOAUTO|MS_USERS|MS_USER|MS_COMMENT|MS_LOOP)
|
||||
+#define MS_NOSYS (MS_NOAUTO|MS_USERS|MS_USER|MS_COMMENT|MS_LOOP|MS_PAMCONSOLE)
|
||||
|
||||
/* Options that we keep from appearing in the options field in the mtab. */
|
||||
-#define MS_NOMTAB (MS_REMOUNT|MS_NOAUTO|MS_USERS|MS_USER)
|
||||
+#define MS_NOMTAB (MS_REMOUNT|MS_NOAUTO|MS_USERS|MS_USER|MS_PAMCONSOLE)
|
||||
|
||||
/* Options that we make ordinary users have by default. */
|
||||
#define MS_SECURE (MS_NOEXEC|MS_NOSUID|MS_NODEV)
|
||||
@@ -142,6 +144,8 @@
|
||||
{ "comment", 0, 0, MS_COMMENT}, /* fstab comment only (kudzu,_netdev)*/
|
||||
|
||||
/* add new options here */
|
||||
+ { "pamconsole", 0, 0, MS_PAMCONSOLE }, /* Allow users at console to mount */
|
||||
+ { "nopamconsole", 0, 1, MS_PAMCONSOLE }, /* Console user has no special privs */
|
||||
#ifdef MS_NOSUB
|
||||
{ "sub", 0, 1, MS_NOSUB }, /* allow submounts */
|
||||
{ "nosub", 0, 0, MS_NOSUB }, /* don't allow submounts */
|
||||
@@ -265,7 +269,7 @@
|
||||
*mask &= ~om->mask;
|
||||
else
|
||||
*mask |= om->mask;
|
||||
- if ((om->mask == MS_USER || om->mask == MS_USERS)
|
||||
+ if ((om->mask == MS_USER || om->mask == MS_USERS || om->mask == MS_PAMCONSOLE)
|
||||
&& !om->inv)
|
||||
*mask |= MS_SECURE;
|
||||
if ((om->mask == MS_OWNER || om->mask == MS_GROUP)
|
||||
@@ -554,7 +558,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
- /* James Kehl <mkehl@gil.com.au> came with a similar patch:
|
||||
+ /* Red Hat patch: allow users at console to mount when fstab
|
||||
+ contains the console option. This option should not be used
|
||||
+ in a high security environment but is useful to give console
|
||||
+ users the possibility of using locally attached devices
|
||||
+ such as USB keychains and USB harddisks where it is now suitable
|
||||
+ to give the console owner write access to the device node */
|
||||
+ if (*flags & MS_PAMCONSOLE) {
|
||||
+ char *username;
|
||||
+ char pamconsole_file_name[256];
|
||||
+ struct stat sb;
|
||||
+
|
||||
+ username = getusername ();
|
||||
+
|
||||
+ if (username != NULL) {
|
||||
+ snprintf (pamconsole_file_name, sizeof (pamconsole_file_name),
|
||||
+ "/var/run/console/%s", username);
|
||||
+ if (stat (pamconsole_file_name, &sb) == 0) {
|
||||
+ *flags |= MS_USER;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* James Kehl <mkehl@gil.com.au> came with a similar patch:
|
||||
allow an arbitrary user to mount when he is the owner of
|
||||
the mount-point and has write-access to the device.
|
||||
This is even less secure. Let me skip it for the time being;
|
||||
@@ -570,7 +596,7 @@
|
||||
*user = getusername();
|
||||
}
|
||||
|
||||
- *flags &= ~(MS_OWNER | MS_GROUP);
|
||||
+ *flags &= ~(MS_OWNER | MS_GROUP | MS_PAMCONSOLE);
|
||||
}
|
||||
|
||||
static int
|
||||
--- util-linux-2.12j/mount/umount.c.console 2004-12-10 12:32:57.885138115 -0500
|
||||
+++ util-linux-2.12j/mount/umount.c 2004-12-10 12:44:51.494119742 -0500
|
||||
@@ -546,7 +546,7 @@
|
||||
umount_file (char *arg) {
|
||||
struct mntentchn *mc, *fs;
|
||||
const char *file, *options;
|
||||
- int fstab_has_user, fstab_has_users, fstab_has_owner, fstab_has_group;
|
||||
+ int fstab_has_user, fstab_has_users, fstab_has_owner, fstab_has_group, fstab_has_pamconsole;
|
||||
int ok;
|
||||
|
||||
file = canonicalize(arg); /* mtab paths are canonicalized */
|
||||
@@ -608,13 +608,16 @@
|
||||
fstab_has_users = contains(options, "users");
|
||||
fstab_has_owner = contains(options, "owner");
|
||||
fstab_has_group = contains(options, "group");
|
||||
+ fstab_has_pamconsole = contains(options, "pamconsole");
|
||||
ok = 0;
|
||||
|
||||
if (fstab_has_users)
|
||||
ok = 1;
|
||||
|
||||
if (!ok && (fstab_has_user || fstab_has_owner ||
|
||||
- fstab_has_group)) {
|
||||
+ fstab_has_group || fstab_has_pamconsole)) {
|
||||
+ char pamconsole_file_name[256];
|
||||
+ struct stat sb;
|
||||
char *user = getusername();
|
||||
|
||||
options = mc->m.mnt_opts;
|
||||
@@ -624,6 +627,14 @@
|
||||
|
||||
if (user && mtab_user && streq (user, mtab_user))
|
||||
ok = 1;
|
||||
+
|
||||
+ /*pam_console user check*/
|
||||
+ if (user && fstab_has_pamconsole) {
|
||||
+ snprintf (pamconsole_file_name, sizeof (pamconsole_file_name), "/var/run/console/%s", user);
|
||||
+ if (stat (pamconsole_file_name, &sb) == 0) {
|
||||
+ ok = 1;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
if (!ok)
|
||||
die (2, _("umount: only %s can unmount %s from %s"),
|
||||
--- util-linux-2.12j/mount/fstab.5.console 2004-09-28 10:13:42.000000000 -0400
|
||||
+++ util-linux-2.12j/mount/fstab.5 2004-12-10 12:59:05.088744506 -0500
|
||||
@@ -156,10 +156,10 @@
|
||||
.BR nfs (5).
|
||||
Common for all types of file system are the options ``noauto''
|
||||
(do not mount when "mount -a" is given, e.g., at boot time), ``user''
|
||||
-(allow a user to mount), and ``owner''
|
||||
-(allow device owner to mount), and ``comment''
|
||||
+(allow a user to mount), ``owner''
|
||||
+(allow device owner to mount), ``pamconsole'' (allow a user at the console to mount), and ``comment''
|
||||
(e.g., for use by fstab-maintaining programs).
|
||||
-The ``owner'' and ``comment'' options are Linux-specific.
|
||||
+The ``owner'', ``pamconsole'' and ``comment'' options are Linux-specific.
|
||||
For more details, see
|
||||
.BR mount (8).
|
||||
|
53
util-linux-2.12p-cal-wide.patch
Normal file
53
util-linux-2.12p-cal-wide.patch
Normal file
@ -0,0 +1,53 @@
|
||||
--- util-linux-2.12p/misc-utils/cal.c.wide 2004-12-05 20:20:36.000000000 +0100
|
||||
+++ util-linux-2.12p/misc-utils/cal.c 2006-01-02 15:13:50.000000000 +0100
|
||||
@@ -368,7 +368,7 @@
|
||||
int i, wd;
|
||||
#ifdef ENABLE_WIDECHAR
|
||||
wchar_t day_headings_wc[22],j_day_headings_wc[29];
|
||||
- wchar_t wd_wc[10];
|
||||
+ char *cur_dh = day_headings, *cur_j_dh = j_day_headings;
|
||||
#endif
|
||||
|
||||
strcpy(day_headings,"");
|
||||
@@ -385,30 +385,25 @@
|
||||
#endif
|
||||
|
||||
for(i = 0 ; i < 7 ; i++ ) {
|
||||
+ ssize_t space_left;
|
||||
wd = (i + week1stday) % 7;
|
||||
#ifdef ENABLE_WIDECHAR
|
||||
- mbstowcs(wd_wc,weekday(wd),10);
|
||||
- if (wcswidth(wd_wc,10) < 3)
|
||||
- wcscat(j_day_headings_wc,L" ");
|
||||
- if (wcswidth(wd_wc,10) < 2) {
|
||||
- wcscat(day_headings_wc, L" ");
|
||||
- wcscat(j_day_headings_wc, L" ");
|
||||
- }
|
||||
- wcsncat(day_headings_wc,wd_wc,2);
|
||||
- wcsncat(j_day_headings_wc,wd_wc,3);
|
||||
- wcscat(day_headings_wc, L" ");
|
||||
- wcscat(j_day_headings_wc, L" ");
|
||||
+ swprintf(day_headings_wc, sizeof(day_headings_wc)/sizeof(day_headings_wc[0]),
|
||||
+ L"%1.2s ", weekday(wd));
|
||||
+ swprintf(j_day_headings_wc, sizeof(j_day_headings_wc)/sizeof(j_day_headings_wc[0]),
|
||||
+ L"%3.3s ", weekday(wd));
|
||||
+ space_left = sizeof(day_headings)-(cur_dh-day_headings);
|
||||
+ if(space_left <= 0) break;
|
||||
+ cur_dh += wcstombs(cur_dh,day_headings_wc, space_left);
|
||||
+ space_left = sizeof(j_day_headings)-(cur_j_dh-j_day_headings);
|
||||
+ if(space_left <= 0) break;
|
||||
+ cur_j_dh += wcstombs(cur_j_dh,j_day_headings_wc, space_left);
|
||||
#else
|
||||
sprintf(eos(day_headings), "%2.2s ", weekday(wd));
|
||||
sprintf(eos(j_day_headings), "%3.3s ", weekday(wd));
|
||||
#endif
|
||||
}
|
||||
|
||||
-#ifdef ENABLE_WIDECHAR
|
||||
- wcstombs(day_headings,day_headings_wc,sizeof(day_headings));
|
||||
- wcstombs(j_day_headings,j_day_headings_wc,sizeof(j_day_headings));
|
||||
-#endif
|
||||
-
|
||||
trim_trailing_spaces(day_headings);
|
||||
trim_trailing_spaces(j_day_headings);
|
||||
#undef weekday
|
38
util-linux-2.12p-col-EILSEQ.patch
Normal file
38
util-linux-2.12p-col-EILSEQ.patch
Normal file
@ -0,0 +1,38 @@
|
||||
--- util-linux-2.13-pre6/text-utils/col.c.kzak 2002-03-09 00:05:12.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/text-utils/col.c 2006-02-21 22:25:48.000000000 +0100
|
||||
@@ -128,6 +128,7 @@
|
||||
int this_line; /* line l points to */
|
||||
int nflushd_lines; /* number of lines that were flushed */
|
||||
int adjust, opt, warned;
|
||||
+ int ret = 0;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
@@ -175,8 +176,16 @@
|
||||
cur_line = max_line = nflushd_lines = this_line = 0;
|
||||
cur_set = last_set = CS_NORMAL;
|
||||
lines = l = alloc_line();
|
||||
-
|
||||
- while ((ch = getwchar()) != WEOF) {
|
||||
+
|
||||
+ while (feof(stdin)==0) {
|
||||
+ errno = 0;
|
||||
+ if ((ch = getwchar()) == WEOF) {
|
||||
+ if (errno==EILSEQ) {
|
||||
+ perror("col");
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
if (!iswgraph(ch)) {
|
||||
switch (ch) {
|
||||
case BS: /* can't go back further */
|
||||
@@ -332,7 +341,7 @@
|
||||
flush_blanks();
|
||||
if (ferror(stdout) || fclose(stdout))
|
||||
return 1;
|
||||
- return 0;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
void flush_lines(int nflush)
|
25
util-linux-2.12p-execl.patch
Normal file
25
util-linux-2.12p-execl.patch
Normal file
@ -0,0 +1,25 @@
|
||||
--- util-linux-2.12p/login-utils/agetty.c.execl 2005-07-12 15:53:25.000000000 +0200
|
||||
+++ util-linux-2.12p/login-utils/agetty.c 2005-07-12 15:53:49.000000000 +0200
|
||||
@@ -382,7 +382,7 @@
|
||||
|
||||
/* Let the login program take care of password validation. */
|
||||
|
||||
- (void) execl(options.login, options.login, "--", logname, (char *) 0);
|
||||
+ (void) execl(options.login, options.login, "--", logname, NULL);
|
||||
error(_("%s: can't exec %s: %m"), options.tty, options.login);
|
||||
exit(0); /* quiet GCC */
|
||||
}
|
||||
--- util-linux-2.12p/misc-utils/script.c.execl 2005-07-12 15:54:17.000000000 +0200
|
||||
+++ util-linux-2.12p/misc-utils/script.c 2005-07-12 15:54:28.000000000 +0200
|
||||
@@ -325,9 +325,9 @@
|
||||
shname = shell;
|
||||
|
||||
if (cflg)
|
||||
- execl(shell, shname, "-c", cflg, 0);
|
||||
+ execl(shell, shname, "-c", cflg, NULL);
|
||||
else
|
||||
- execl(shell, shname, "-i", 0);
|
||||
+ execl(shell, shname, "-i", NULL);
|
||||
|
||||
perror(shell);
|
||||
fail();
|
22
util-linux-2.12p-fdformat-ide.patch
Normal file
22
util-linux-2.12p-fdformat-ide.patch
Normal file
@ -0,0 +1,22 @@
|
||||
--- util-linux-2.12p/disk-utils/fdformat.8.ide 2005-04-25 11:39:19.528340384 +0200
|
||||
+++ util-linux-2.12p/disk-utils/fdformat.8 2005-04-25 11:44:07.189609224 +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,6 +58,7 @@
|
||||
.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)
|
102
util-linux-2.12p-floppy-generic.patch
Normal file
102
util-linux-2.12p-floppy-generic.patch
Normal file
@ -0,0 +1,102 @@
|
||||
--- util-linux-2.12p/floppy-0.12/floppyfloppy.c.generic 2001-02-13 01:15:38.000000000 +0100
|
||||
+++ util-linux-2.12p/floppy-0.12/floppyfloppy.c 2005-09-30 15:38:08.000000000 +0200
|
||||
@@ -264,6 +264,33 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
+/* -1=error, 1=true, 0=false */
|
||||
+static int check_generic(const char *dev, int n)
|
||||
+{
|
||||
+ struct floppy_struct param;
|
||||
+ int fd;
|
||||
+
|
||||
+ if ((fd=open(dev, O_RDONLY)) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (ioctl(fd,FDGETPRM,(long) ¶m) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ close(fd);
|
||||
+
|
||||
+ if (param.sect==floppy_type[n].sectors &&
|
||||
+ param.head==floppy_type[n].heads &&
|
||||
+ param.track==floppy_type[n].tracks)
|
||||
+ /* generic device uses expected format */
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
static int do_format(const char *dev, int fmtnum,
|
||||
int (*fmt_func)(const char *, int), int flags)
|
||||
@@ -275,6 +302,7 @@
|
||||
struct format_descr curtrack;
|
||||
int pct;
|
||||
struct stat stat_buf;
|
||||
+ int gen = 0;
|
||||
|
||||
int i, j;
|
||||
char *devname;
|
||||
@@ -297,23 +325,52 @@
|
||||
|
||||
strcat(strcpy(devname, dev), floppy_type[fmtnum].dev);
|
||||
|
||||
+ if (stat(devname, &stat_buf)==-1 && errno==ENOENT)
|
||||
+ {
|
||||
+ /* /dev/fd0xxxxx doesn't exist ...try to use generic device
|
||||
+ *
|
||||
+ * Note: we needn't size specific device if the generic device uses
|
||||
+ * right floppy format (FDGETPRM). -- Karel Zak [30/09/2005]
|
||||
+ */
|
||||
+ if ((gen = check_generic(dev, fmtnum))==1) /* true */
|
||||
+ {
|
||||
+ fprintf(stderr, _("WARNING: size specific device %s doesn't exist, using generic device: %s\n"),
|
||||
+ devname, dev);
|
||||
+ strcpy(devname, dev);
|
||||
+ }
|
||||
+ else if (gen==0) /* false */
|
||||
+ {
|
||||
+ fprintf(stderr, _("ERROR: size specific device %1$s doesn't exist. Use \"MAKEDEV %1$s\" and try it again.\n"), devname);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ else /* error -- no floppy medium or device? */
|
||||
+ return(1);
|
||||
+ }
|
||||
fd=open(devname, O_WRONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror(devname);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
- if (fstat(fd, &stat_buf) ||
|
||||
- !S_ISBLK(stat_buf.st_mode) ||
|
||||
- MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
+ if (fstat(fd, &stat_buf) < 0)
|
||||
+ {
|
||||
+ perror(devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (!S_ISBLK(stat_buf.st_mode))
|
||||
+ {
|
||||
+ fprintf(stderr,_("%s: not a block device\n"), devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (gen==0 && MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
{
|
||||
errno=EINVAL;
|
||||
perror(devname);
|
||||
close(fd);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
if (ioctl(fd, FDGETPRM, &geo) < 0)
|
||||
{
|
||||
perror(devname);
|
25
util-linux-2.12p-fstab-man.patch
Normal file
25
util-linux-2.12p-fstab-man.patch
Normal file
@ -0,0 +1,25 @@
|
||||
--- util-linux-2.12p/mount/fstab.5.sync 2005-04-25 11:56:00.625150536 +0200
|
||||
+++ util-linux-2.12p/mount/fstab.5 2005-04-25 12:07:12.089072504 +0200
|
||||
@@ -49,10 +49,11 @@
|
||||
The file
|
||||
.B fstab
|
||||
contains descriptive information about the various file systems.
|
||||
+It is the duty of the system administrator to properly create and maintain this file.
|
||||
.B fstab
|
||||
-is only read by programs, and not written; it is the duty of the system
|
||||
-administrator to properly create and maintain this file. Each filesystem
|
||||
-is described on a separate line; fields on each line are separated by tabs
|
||||
+can be modified by special utils (e.g.
|
||||
+.BR fstab-sync (8)).
|
||||
+Each filesystem is described on a separate line; fields on each line are separated by tabs
|
||||
or spaces. Lines starting with '#' are comments. The order of records in
|
||||
.B fstab
|
||||
is important because
|
||||
@@ -200,6 +201,7 @@
|
||||
.BR swapon (8),
|
||||
.BR fs (5)
|
||||
.BR nfs (5)
|
||||
+.BR fstab-sync (8)
|
||||
.SH HISTORY
|
||||
The ancestor of this
|
||||
.B fstab
|
14
util-linux-2.12p-ipcs-typo.patch
Normal file
14
util-linux-2.12p-ipcs-typo.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- util-linux-2.12p/sys-utils/ipcs.c.typo 2005-03-25 13:01:54.871752240 +0100
|
||||
+++ util-linux-2.12p/sys-utils/ipcs.c 2005-03-25 13:02:43.745322328 +0100
|
||||
@@ -423,9 +423,9 @@
|
||||
break;
|
||||
|
||||
case TIME:
|
||||
- printf (_("------ Shared Memory Operation/Change Times --------\n"));
|
||||
+ printf (_("------ Semaphore Operation/Change Times --------\n"));
|
||||
printf (_("%-8s %-10s %-26.24s %-26.24s\n"),
|
||||
- _("shmid"),_("owner"),_("last-op"),_("last-changed"));
|
||||
+ _("semid"),_("owner"),_("last-op"),_("last-changed"));
|
||||
break;
|
||||
|
||||
case PID:
|
11
util-linux-2.12p-login-lastlog.patch
Normal file
11
util-linux-2.12p-login-lastlog.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- util-linux-2.12p/login-utils/login.c.login-lastlog 2005-03-24 13:26:06.516865128 +0100
|
||||
+++ util-linux-2.12p/login-utils/login.c 2005-03-24 13:26:58.136017824 +0100
|
||||
@@ -1397,7 +1397,7 @@
|
||||
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) &&
|
16
util-linux-2.12p-look-separator.patch
Normal file
16
util-linux-2.12p-look-separator.patch
Normal file
@ -0,0 +1,16 @@
|
||||
--- util-linux-2.12p/misc-utils/look.c.sep 2005-05-02 12:51:17.808227240 +0200
|
||||
+++ util-linux-2.12p/misc-utils/look.c 2005-05-02 12:53:18.078943312 +0200
|
||||
@@ -327,9 +327,12 @@
|
||||
/* copy, ignoring things that should be ignored */
|
||||
p = comparbuf;
|
||||
i = stringlen;
|
||||
- while(s2 < s2end && *s2 != '\n' && i--) {
|
||||
+ while(s2 < s2end && *s2 != '\n' && i) {
|
||||
if (!dflag || isalnum(*s2))
|
||||
+ {
|
||||
*p++ = *s2;
|
||||
+ i--;
|
||||
+ }
|
||||
s2++;
|
||||
}
|
||||
*p = 0;
|
27
util-linux-2.12p-lvm2dupes-76467.patch
Normal file
27
util-linux-2.12p-lvm2dupes-76467.patch
Normal file
@ -0,0 +1,27 @@
|
||||
--- util-linux-2.12p/mount/mount_by_label.c.lvm2dupes 2005-04-25 11:33:53.657880224 +0200
|
||||
+++ util-linux-2.12p/mount/mount_by_label.c 2005-04-25 11:36:32.075797040 +0200
|
||||
@@ -195,6 +195,15 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
+/* We need to avoid listing /dev/dm-X devices, because they are added to the uuidcache separately by the
|
||||
+ uuidcache_init_dm routine. Duplicate entries cause mount-by-label to fail.
|
||||
+ */
|
||||
+static int
|
||||
+is_lvm2(char *ptname)
|
||||
+{
|
||||
+ return !strncmp(ptname, "dm-", 3);
|
||||
+}
|
||||
+
|
||||
static void
|
||||
uuidcache_init(void) {
|
||||
char line[100];
|
||||
@@ -266,7 +275,7 @@
|
||||
/* devfs has .../disc and .../part1 etc. */
|
||||
|
||||
for (s = ptname; *s; s++);
|
||||
- if (isdigit(s[-1]) || is_xvm(ptname)) {
|
||||
+ if ((isdigit(s[-1]) || is_xvm(ptname)) && !is_lvm2(ptname)) {
|
||||
|
||||
/*
|
||||
* Note: this is a heuristic only - there is no reason
|
187
util-linux-2.12p-mount-ocfs2.patch
Normal file
187
util-linux-2.12p-mount-ocfs2.patch
Normal file
@ -0,0 +1,187 @@
|
||||
--- util-linux-2.12p/mount/mount.c.ocfs2 2005-07-12 16:31:16.000000000 +0200
|
||||
+++ util-linux-2.12p/mount/mount.c 2005-07-12 16:31:46.000000000 +0200
|
||||
@@ -466,6 +466,61 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * check_special_mountprog()
|
||||
+ * If there is a special mount program for this type, exec it.
|
||||
+ * returns: 0: no exec was done, 1: exec was done, status has result
|
||||
+ */
|
||||
+
|
||||
+static int
|
||||
+check_special_mountprog(const char *spec, const char *node, const char *type, int flags,
|
||||
+ char *extra_opts, int *status) {
|
||||
+ char mountprog[120];
|
||||
+ struct stat statbuf;
|
||||
+ int res;
|
||||
+
|
||||
+ if (!external_allowed)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (type && strlen(type) < 100) {
|
||||
+ sprintf(mountprog, "/sbin/mount.%s", type);
|
||||
+ if (stat(mountprog, &statbuf) == 0) {
|
||||
+ res = fork();
|
||||
+ if (res == 0) {
|
||||
+ char *oo, *mountargs[10];
|
||||
+ int i = 0;
|
||||
+
|
||||
+ setuid(getuid());
|
||||
+ setgid(getgid());
|
||||
+ oo = fix_opts_string (flags, extra_opts, NULL);
|
||||
+ mountargs[i++] = mountprog;
|
||||
+ mountargs[i++] = spec;
|
||||
+ mountargs[i++] = node;
|
||||
+ if (nomtab)
|
||||
+ mountargs[i++] = "-n";
|
||||
+ if (verbose)
|
||||
+ mountargs[i++] = "-v";
|
||||
+ if (oo && *oo) {
|
||||
+ mountargs[i++] = "-o";
|
||||
+ mountargs[i++] = oo;
|
||||
+ }
|
||||
+ mountargs[i] = NULL;
|
||||
+ execv(mountprog, mountargs);
|
||||
+ exit(1); /* exec failed */
|
||||
+ } else if (res != -1) {
|
||||
+ int st;
|
||||
+ wait(&st);
|
||||
+ *status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
|
||||
+ return 1;
|
||||
+ } else {
|
||||
+ int errsv = errno;
|
||||
+ error(_("mount: cannot fork: %s"), strerror(errsv));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* guess_fstype_and_mount()
|
||||
* Mount a single file system. Guess the type when unknown.
|
||||
* returns: 0: OK, -1: error in errno, 1: other error
|
||||
@@ -474,9 +529,11 @@
|
||||
*/
|
||||
static int
|
||||
guess_fstype_and_mount(const char *spec, const char *node, const char **types,
|
||||
- int flags, char *mount_opts) {
|
||||
+ int flags, char *mount_opts, int *special, int *status) {
|
||||
struct mountargs args = { spec, node, NULL, flags & ~MS_NOSYS, mount_opts };
|
||||
|
||||
+ *special = 0;
|
||||
+
|
||||
if (*types && strcasecmp (*types, "auto") == 0)
|
||||
*types = NULL;
|
||||
|
||||
@@ -485,10 +542,16 @@
|
||||
|
||||
if (!*types && !(flags & MS_REMOUNT)) {
|
||||
*types = guess_fstype(spec);
|
||||
- if (*types && !strcmp(*types, "swap")) {
|
||||
- error(_("%s looks like swapspace - not mounted"), spec);
|
||||
- *types = NULL;
|
||||
- return 1;
|
||||
+ if (*types) {
|
||||
+ if (!strcmp(*types, "swap")) {
|
||||
+ error(_("%s looks like swapspace - not mounted"), spec);
|
||||
+ *types = NULL;
|
||||
+ return 1;
|
||||
+ } else if (check_special_mountprog(spec, node, *types, flags,
|
||||
+ mount_opts, status)) {
|
||||
+ *special = 1;
|
||||
+ return 0;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,61 +804,6 @@
|
||||
}
|
||||
|
||||
/*
|
||||
- * check_special_mountprog()
|
||||
- * If there is a special mount program for this type, exec it.
|
||||
- * returns: 0: no exec was done, 1: exec was done, status has result
|
||||
- */
|
||||
-
|
||||
-static int
|
||||
-check_special_mountprog(const char *spec, const char *node, const char *type,
|
||||
- int flags, char *extra_opts, int *status) {
|
||||
- char mountprog[120];
|
||||
- struct stat statbuf;
|
||||
- int res;
|
||||
-
|
||||
- if (!external_allowed)
|
||||
- return 0;
|
||||
-
|
||||
- if (type && strlen(type) < 100) {
|
||||
- sprintf(mountprog, "/sbin/mount.%s", type);
|
||||
- if (stat(mountprog, &statbuf) == 0) {
|
||||
- res = fork();
|
||||
- if (res == 0) {
|
||||
- const char *oo, *mountargs[10];
|
||||
- int i = 0;
|
||||
-
|
||||
- setuid(getuid());
|
||||
- setgid(getgid());
|
||||
- oo = fix_opts_string (flags, extra_opts, NULL);
|
||||
- mountargs[i++] = mountprog;
|
||||
- mountargs[i++] = spec;
|
||||
- mountargs[i++] = node;
|
||||
- if (nomtab)
|
||||
- mountargs[i++] = "-n";
|
||||
- if (verbose)
|
||||
- mountargs[i++] = "-v";
|
||||
- if (oo && *oo) {
|
||||
- mountargs[i++] = "-o";
|
||||
- mountargs[i++] = oo;
|
||||
- }
|
||||
- mountargs[i] = NULL;
|
||||
- execv(mountprog, (char **) mountargs);
|
||||
- exit(1); /* exec failed */
|
||||
- } else if (res != -1) {
|
||||
- int st;
|
||||
- wait(&st);
|
||||
- *status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
|
||||
- return 1;
|
||||
- } else {
|
||||
- int errsv = errno;
|
||||
- error(_("mount: cannot fork: %s"), strerror(errsv));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
* try_mount_one()
|
||||
* Try to mount one file system. When "bg" is 1, this is a retry
|
||||
* in the background. One additional exit code EX_BG is used here.
|
||||
@@ -807,7 +815,7 @@
|
||||
static int
|
||||
try_mount_one (const char *spec0, const char *node0, const char *types0,
|
||||
const char *opts0, int freq, int pass, int bg, int ro) {
|
||||
- int res = 0, status;
|
||||
+ int res = 0, status, special;
|
||||
int mnt5_res = 0; /* only for gcc */
|
||||
int mnt_err;
|
||||
int flags;
|
||||
@@ -898,9 +906,15 @@
|
||||
block_signals (SIG_BLOCK);
|
||||
nosigblock:
|
||||
|
||||
- if (!fake)
|
||||
+ if (!fake) {
|
||||
mnt5_res = guess_fstype_and_mount (spec, node, &types, flags & ~MS_NOSYS,
|
||||
- mount_opts);
|
||||
+ mount_opts, &special, &status);
|
||||
+
|
||||
+ if (special) {
|
||||
+ block_signals (SIG_UNBLOCK);
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (fake || mnt5_res == 0) {
|
||||
/* Mount succeeded, report this (if verbose) and write mtab entry. */
|
150
util-linux-2.12p-mtab-lock.patch
Normal file
150
util-linux-2.12p-mtab-lock.patch
Normal file
@ -0,0 +1,150 @@
|
||||
--- util-linux-2.12p/mount/fstab.c.mtab-lock 2005-03-22 14:05:22.481297072 +0100
|
||||
+++ util-linux-2.12p/mount/fstab.c 2005-03-22 14:50:55.719781664 +0100
|
||||
@@ -395,6 +395,7 @@
|
||||
|
||||
/* Flag for already existing lock file. */
|
||||
static int we_created_lockfile = 0;
|
||||
+static int lockfile_fd = -1;
|
||||
|
||||
/* Flag to indicate that signals have been set up. */
|
||||
static int signals_have_been_setup = 0;
|
||||
@@ -416,6 +417,8 @@
|
||||
void
|
||||
unlock_mtab (void) {
|
||||
if (we_created_lockfile) {
|
||||
+ close(lockfile_fd);
|
||||
+ lockfile_fd = -1;
|
||||
unlink (MOUNTED_LOCK);
|
||||
we_created_lockfile = 0;
|
||||
}
|
||||
@@ -443,7 +446,7 @@
|
||||
|
||||
void
|
||||
lock_mtab (void) {
|
||||
- int tries = 3;
|
||||
+ int tries = 100000, i;
|
||||
char linktargetfile[MOUNTLOCK_LINKTARGET_LTH];
|
||||
|
||||
at_die = unlock_mtab;
|
||||
@@ -469,45 +472,48 @@
|
||||
|
||||
sprintf(linktargetfile, MOUNTLOCK_LINKTARGET, getpid ());
|
||||
|
||||
+ i = open (linktargetfile, O_WRONLY|O_CREAT, 0);
|
||||
+ if (i < 0) {
|
||||
+ int errsv = errno;
|
||||
+ /* linktargetfile does not exist (as a file)
|
||||
+ and we cannot create it. Read-only filesystem?
|
||||
+ Too many files open in the system?
|
||||
+ Filesystem full? */
|
||||
+ die (EX_FILEIO, _("can't create lock file %s: %s "
|
||||
+ "(use -n flag to override)"),
|
||||
+ linktargetfile, strerror (errsv));
|
||||
+ }
|
||||
+ close(i);
|
||||
+
|
||||
/* Repeat until it was us who made the link */
|
||||
while (!we_created_lockfile) {
|
||||
struct flock flock;
|
||||
- int errsv, fd, i, j;
|
||||
-
|
||||
- i = open (linktargetfile, O_WRONLY|O_CREAT, 0);
|
||||
- if (i < 0) {
|
||||
- int errsv = errno;
|
||||
- /* linktargetfile does not exist (as a file)
|
||||
- and we cannot create it. Read-only filesystem?
|
||||
- Too many files open in the system?
|
||||
- Filesystem full? */
|
||||
- die (EX_FILEIO, _("can't create lock file %s: %s "
|
||||
- "(use -n flag to override)"),
|
||||
- linktargetfile, strerror (errsv));
|
||||
- }
|
||||
- close(i);
|
||||
+ int errsv, j;
|
||||
|
||||
j = link(linktargetfile, MOUNTED_LOCK);
|
||||
errsv = errno;
|
||||
|
||||
- (void) unlink(linktargetfile);
|
||||
-
|
||||
if (j == 0)
|
||||
we_created_lockfile = 1;
|
||||
|
||||
if (j < 0 && errsv != EEXIST) {
|
||||
+ (void) unlink(linktargetfile);
|
||||
die (EX_FILEIO, _("can't link lock file %s: %s "
|
||||
"(use -n flag to override)"),
|
||||
MOUNTED_LOCK, strerror (errsv));
|
||||
}
|
||||
|
||||
- fd = open (MOUNTED_LOCK, O_WRONLY);
|
||||
+ lockfile_fd = open (MOUNTED_LOCK, O_WRONLY);
|
||||
|
||||
- if (fd < 0) {
|
||||
+ if (lockfile_fd < 0) {
|
||||
int errsv = errno;
|
||||
/* Strange... Maybe the file was just deleted? */
|
||||
- if (errno == ENOENT && tries-- > 0)
|
||||
+ if (errno == ENOENT && tries-- > 0) {
|
||||
+ if (tries % 200 == 0)
|
||||
+ usleep(30);
|
||||
continue;
|
||||
+ }
|
||||
+ (void) unlink(linktargetfile);
|
||||
die (EX_FILEIO, _("can't open lock file %s: %s "
|
||||
"(use -n flag to override)"),
|
||||
MOUNTED_LOCK, strerror (errsv));
|
||||
@@ -520,7 +526,7 @@
|
||||
|
||||
if (j == 0) {
|
||||
/* We made the link. Now claim the lock. */
|
||||
- if (fcntl (fd, F_SETLK, &flock) == -1) {
|
||||
+ if (fcntl (lockfile_fd, F_SETLK, &flock) == -1) {
|
||||
if (verbose) {
|
||||
int errsv = errno;
|
||||
printf(_("Can't lock lock file %s: %s\n"),
|
||||
@@ -528,13 +534,15 @@
|
||||
}
|
||||
/* proceed anyway */
|
||||
}
|
||||
+ (void) unlink(linktargetfile);
|
||||
} else {
|
||||
static int tries = 0;
|
||||
|
||||
/* Someone else made the link. Wait. */
|
||||
alarm(LOCK_TIMEOUT);
|
||||
- if (fcntl (fd, F_SETLKW, &flock) == -1) {
|
||||
+ if (fcntl (lockfile_fd, F_SETLKW, &flock) == -1) {
|
||||
int errsv = errno;
|
||||
+ (void) unlink(linktargetfile);
|
||||
die (EX_FILEIO, _("can't lock lock file %s: %s"),
|
||||
MOUNTED_LOCK, (errno == EINTR) ?
|
||||
_("timed out") : strerror (errsv));
|
||||
@@ -542,16 +550,18 @@
|
||||
alarm(0);
|
||||
/* Limit the number of iterations - maybe there
|
||||
still is some old /etc/mtab~ */
|
||||
- if (tries++ > 3) {
|
||||
- if (tries > 5)
|
||||
- die (EX_FILEIO, _("Cannot create link %s\n"
|
||||
- "Perhaps there is a stale lock file?\n"),
|
||||
- MOUNTED_LOCK);
|
||||
- sleep(1);
|
||||
- }
|
||||
+ ++tries;
|
||||
+ if (tries % 200 == 0)
|
||||
+ usleep(30);
|
||||
+ if (tries > 100000) {
|
||||
+ (void) unlink(linktargetfile);
|
||||
+ close(lockfile_fd);
|
||||
+ die (EX_FILEIO, _("Cannot create link %s\n"
|
||||
+ "Perhaps there is a stale lock file?\n"),
|
||||
+ MOUNTED_LOCK);
|
||||
+ }
|
||||
+ close(lockfile_fd);
|
||||
}
|
||||
-
|
||||
- close(fd);
|
||||
}
|
||||
}
|
||||
|
24
util-linux-2.12p-swaponsymlink-57300.patch
Normal file
24
util-linux-2.12p-swaponsymlink-57300.patch
Normal file
@ -0,0 +1,24 @@
|
||||
--- util-linux-2.12p/mount/swapon.c.sopwith Wed Dec 22 04:50:19 2004
|
||||
+++ util-linux-2.12p/mount/swapon.c Thu Dec 23 14:44:49 2004
|
||||
@@ -138,9 +138,19 @@
|
||||
is_in_proc_swaps(const char *fname) {
|
||||
int i;
|
||||
|
||||
- for (i = 0; i < numSwaps; i++)
|
||||
- if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
|
||||
+ for (i = 0; i < numSwaps; i++) {
|
||||
+ struct stat swapped, swapping;
|
||||
+
|
||||
+ if (!swapFiles[i]) continue;
|
||||
+
|
||||
+ if (!strcmp(fname, swapFiles[i])
|
||||
+ || (!stat (swapFiles[i], &swapped)
|
||||
+ && !stat (fname, &swapping)
|
||||
+ && (swapped.st_dev == swapping.st_dev
|
||||
+ && swapped.st_ino == swapping.st_ino))
|
||||
+ )
|
||||
return 1;
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
16
util-linux-2.12p-vipw-perm.patch
Normal file
16
util-linux-2.12p-vipw-perm.patch
Normal file
@ -0,0 +1,16 @@
|
||||
--- util-linux-2.12p/login-utils/vipw.c.perm 2005-06-16 10:33:46.387891456 +0200
|
||||
+++ util-linux-2.12p/login-utils/vipw.c 2005-06-16 10:34:37.077185512 +0200
|
||||
@@ -299,11 +299,11 @@
|
||||
}
|
||||
if (!is_shadow)
|
||||
chmod(tmp_file, 0644);
|
||||
-#if 0
|
||||
+/*#if 0*/
|
||||
/* if shadow file, then mode is 0600 now */
|
||||
else
|
||||
chmod(tmp_file, 0400);
|
||||
-#endif
|
||||
+/*#endif*/
|
||||
pw_unlock();
|
||||
}
|
||||
|
94
util-linux-2.13-arch.patch
Normal file
94
util-linux-2.13-arch.patch
Normal file
@ -0,0 +1,94 @@
|
||||
--- util-linux-2.13-pre1/sys-utils/Makefile.am.arch 2005-08-16 12:54:22.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/sys-utils/Makefile.am 2005-08-16 12:55:00.000000000 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
include $(top_srcdir)/config/include-Makefile.am
|
||||
|
||||
-bin_PROGRAMS = dmesg
|
||||
+bin_PROGRAMS = dmesg arch
|
||||
|
||||
usrbin_PROGRAMS = cytune flock ipcrm ipcs renice setsid
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
usrsbin_PROGRAMS = readprofile tunelp
|
||||
|
||||
-man_MANS = flock.1 readprofile.1 \
|
||||
+man_MANS = flock.1 readprofile.1 arch.1 \
|
||||
ctrlaltdel.8 cytune.8 dmesg.8 ipcrm.8 ipcs.8 renice.8 \
|
||||
setsid.8 tunelp.8
|
||||
|
||||
--- util-linux-2.13-pre1/sys-utils/arch.1.arch 2005-08-16 12:55:34.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/sys-utils/arch.1 2005-08-16 12:59:51.000000000 +0200
|
||||
@@ -0,0 +1,34 @@
|
||||
+.\" arch.1 --
|
||||
+.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
+.\" Public domain: may be freely distributed.
|
||||
+.TH ARCH 1 "4 July 1997" "Linux 2.0" "Linux Programmer's Manual"
|
||||
+.SH NAME
|
||||
+arch \- print machine architecture
|
||||
+.SH SYNOPSIS
|
||||
+.B arch
|
||||
+.SH DESCRIPTION
|
||||
+.B arch
|
||||
+is deprecated command since release util-linux 2.13. Use
|
||||
+.BR "uname -m" .
|
||||
+
|
||||
+On current Linux systems,
|
||||
+.B arch
|
||||
+prints things such as "i386", "i486", "i586", "alpha", "sparc",
|
||||
+"arm", "m68k", "mips", "ppc".
|
||||
+.SH SEE ALSO
|
||||
+.BR uname (1),
|
||||
+.BR uname (2)
|
||||
+.\"
|
||||
+.\" Details:
|
||||
+.\" arch prints the machine part of the system_utsname struct
|
||||
+.\" This struct is defined in version.c, and this field is
|
||||
+.\" initialized with UTS_MACHINE, which is defined as $ARCH
|
||||
+.\" in the main Makefile.
|
||||
+.\" That gives the possibilities
|
||||
+.\" alpha arm i386 m68k mips ppc sparc sparc64
|
||||
+.\"
|
||||
+.\" If Makefile is not edited, ARCH is guessed by
|
||||
+.\" ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
|
||||
+.\" Then how come we get these i586 values?
|
||||
+.\" Well, the routine check_bugs() does system_utsname.machine[1] = '0' + x86;
|
||||
+.\" (called in init/main.c, defined in ./include/asm-i386/bugs.h)
|
||||
--- util-linux-2.13-pre1/sys-utils/arch.c.arch 2005-08-16 12:55:43.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/sys-utils/arch.c 1999-07-09 04:56:41.000000000 +0200
|
||||
@@ -0,0 +1,35 @@
|
||||
+/* arch -- print machine architecture information
|
||||
+ * Created: Mon Dec 20 12:27:15 1993 by faith@cs.unc.edu
|
||||
+ * Revised: Mon Dec 20 12:29:23 1993 by faith@cs.unc.edu
|
||||
+ * Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
+
|
||||
+ * This program 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, or (at your option) any
|
||||
+ * later version.
|
||||
+
|
||||
+ * 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.,
|
||||
+ * 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <sys/utsname.h>
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ struct utsname utsbuf;
|
||||
+
|
||||
+ if (uname( &utsbuf )) {
|
||||
+ perror( "arch" );
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ printf( "%s\n", utsbuf.machine );
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
314
util-linux-2.13-audit-hwclock.patch
Normal file
314
util-linux-2.13-audit-hwclock.patch
Normal file
@ -0,0 +1,314 @@
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/audit.c util-linux-2.13-pre5/hwclock/audit.c
|
||||
--- util-linux-2.13-pre5.orig/hwclock/audit.c 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ util-linux-2.13-pre5/hwclock/audit.c 2005-10-25 17:14:46.000000000 -0400
|
||||
@@ -0,0 +1,50 @@
|
||||
+/* audit.c -- This file contains the audit system extensions
|
||||
+ *
|
||||
+ * Copyright 2005 Red Hat Inc., Durham, North Carolina.
|
||||
+ * All Rights Reserved.
|
||||
+ *
|
||||
+ * This program 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ *
|
||||
+ * Authors:
|
||||
+ * Steve Grubb <sgrubb@redhat.com>
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+#include <libaudit.h>
|
||||
+#include "audit.h"
|
||||
+
|
||||
+int audit_fd = -1;
|
||||
+static int audit_this = 0;
|
||||
+
|
||||
+
|
||||
+void auditable_event(int i)
|
||||
+{
|
||||
+ audit_this = i;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+void audit_exit(int status)
|
||||
+{
|
||||
+ if (audit_this) {
|
||||
+ audit_log_user_message(audit_fd, AUDIT_USYS_CONFIG,
|
||||
+ "changing system time", NULL, NULL, NULL, status ? 0 : 1);
|
||||
+ close(audit_fd);
|
||||
+ }
|
||||
+ exit(status);
|
||||
+}
|
||||
+
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/audit.h util-linux-2.13-pre5/hwclock/audit.h
|
||||
--- util-linux-2.13-pre5.orig/hwclock/audit.h 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ util-linux-2.13-pre5/hwclock/audit.h 2005-10-25 17:09:40.000000000 -0400
|
||||
@@ -0,0 +1,34 @@
|
||||
+/* audit.h -- This file contains the function prototypes for audit calls
|
||||
+ * Copyright 2005 Red Hat Inc., Durham, North Carolina.
|
||||
+ * All Rights Reserved.
|
||||
+ *
|
||||
+ * This program 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ *
|
||||
+ * Author:
|
||||
+ * Steve Grubb <sgrubb@redhat.com>
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#ifndef HW_AUDIT_H
|
||||
+#define HW_AUDIT_H
|
||||
+
|
||||
+/* This is the file descriptor used by the audit system */
|
||||
+extern int audit_fd;
|
||||
+
|
||||
+/* This is the logging functions */
|
||||
+void auditable_event(int i);
|
||||
+void audit_exit(int status);
|
||||
+
|
||||
+#endif
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/clock.h util-linux-2.13-pre5/hwclock/clock.h
|
||||
--- util-linux-2.13-pre5.orig/hwclock/clock.h 2005-10-25 17:08:26.000000000 -0400
|
||||
+++ util-linux-2.13-pre5/hwclock/clock.h 2005-10-25 17:09:40.000000000 -0400
|
||||
@@ -24,7 +24,12 @@
|
||||
extern char *progname;
|
||||
extern int debug;
|
||||
extern int epoch_option;
|
||||
-extern void outsyserr(char *msg, ...);
|
||||
+extern void outsyserr(char *msg, ...)
|
||||
+#ifdef __GNUC__
|
||||
+ __attribute__ ((format (printf, 1, 2)));
|
||||
+#else
|
||||
+ ;
|
||||
+#endif
|
||||
|
||||
/* cmos.c */
|
||||
extern void set_cmos_epoch(int ARCconsole, int SRM);
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/hwclock.c util-linux-2.13-pre5/hwclock/hwclock.c
|
||||
--- util-linux-2.13-pre5.orig/hwclock/hwclock.c 2005-10-25 17:08:26.000000000 -0400
|
||||
+++ util-linux-2.13-pre5/hwclock/hwclock.c 2005-10-25 17:09:40.000000000 -0400
|
||||
@@ -81,9 +81,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <getopt.h>
|
||||
#include <sysexits.h>
|
||||
+#include <libaudit.h>
|
||||
|
||||
#include "clock.h"
|
||||
#include "nls.h"
|
||||
+#include "audit.h"
|
||||
|
||||
#define MYNAME "hwclock"
|
||||
|
||||
@@ -1234,7 +1236,7 @@
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
- exit(fmt ? EX_USAGE : 0);
|
||||
+ audit_exit(fmt ? EX_USAGE : 0);
|
||||
}
|
||||
|
||||
static const struct option longopts[] = {
|
||||
@@ -1298,6 +1300,15 @@
|
||||
/* Remember what time we were invoked */
|
||||
gettimeofday(&startup_time, NULL);
|
||||
|
||||
+ audit_fd = audit_open();
|
||||
+ if (audit_fd < 0 && !(errno == EINVAL || errno == EPROTONOSUPPORT ||
|
||||
+ errno == EAFNOSUPPORT)) {
|
||||
+ /* You get these error codes only when the kernel doesn't have
|
||||
+ * audit compiled in. */
|
||||
+ fprintf(stderr, "Error - unable to connect to audit system\n");
|
||||
+ return EX_NOPERM;
|
||||
+ }
|
||||
+
|
||||
setlocale(LC_ALL, "");
|
||||
#ifdef LC_NUMERIC
|
||||
/* We need LC_CTYPE and LC_TIME and LC_MESSAGES, but must avoid
|
||||
@@ -1393,6 +1404,13 @@
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
+ if (testing != TRUE) {
|
||||
+ if (adjust == TRUE || hctosys == TRUE || systohc == TRUE ||
|
||||
+ set == TRUE || setepoch == TRUE) {
|
||||
+ auditable_event(1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (argc > 0) {
|
||||
usage(_("%s takes no non-option arguments. "
|
||||
"You supplied %d.\n"),
|
||||
@@ -1403,27 +1421,27 @@
|
||||
fprintf(stderr, _("You have specified multiple functions.\n"
|
||||
"You can only perform one function "
|
||||
"at a time.\n"));
|
||||
- exit(EX_USAGE);
|
||||
+ audit_exit(EX_USAGE);
|
||||
}
|
||||
|
||||
if (utc && local_opt) {
|
||||
fprintf(stderr, _("%s: The --utc and --localtime options "
|
||||
"are mutually exclusive. You specified "
|
||||
"both.\n"), MYNAME);
|
||||
- exit(EX_USAGE);
|
||||
+ audit_exit(EX_USAGE);
|
||||
}
|
||||
|
||||
if (adjust && noadjfile) {
|
||||
fprintf(stderr, _("%s: The --adjust and --noadjfile options "
|
||||
"are mutually exclusive. You specified "
|
||||
"both.\n"), MYNAME);
|
||||
- exit(EX_USAGE);
|
||||
+ audit_exit(EX_USAGE);
|
||||
}
|
||||
|
||||
if (noadjfile && !(utc || local_opt)) {
|
||||
fprintf(stderr, _("%s: With --noadjfile, you must specify "
|
||||
"either --utc or --localtime\n"), MYNAME);
|
||||
- exit(EX_USAGE);
|
||||
+ audit_exit(EX_USAGE);
|
||||
}
|
||||
|
||||
#ifdef __alpha__
|
||||
@@ -1437,7 +1455,7 @@
|
||||
if (rc != 0) {
|
||||
fprintf(stderr, _("No usable set-to time. "
|
||||
"Cannot set clock.\n"));
|
||||
- exit(EX_USAGE);
|
||||
+ audit_exit(EX_USAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1469,11 +1487,11 @@
|
||||
}
|
||||
|
||||
if (!permitted)
|
||||
- exit(EX_NOPERM);
|
||||
+ audit_exit(EX_NOPERM);
|
||||
|
||||
if (getepoch || setepoch) {
|
||||
manipulate_epoch(getepoch, setepoch, epoch_option, testing);
|
||||
- return 0;
|
||||
+ audit_exit(0);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
@@ -1487,12 +1505,14 @@
|
||||
fprintf(stderr,
|
||||
_("Use the --debug option to see the details "
|
||||
"of our search for an access method.\n"));
|
||||
- exit(1);
|
||||
+ audit_exit(1);
|
||||
}
|
||||
|
||||
- return manipulate_clock(show, adjust, noadjfile, set, set_time,
|
||||
+ rc = manipulate_clock(show, adjust, noadjfile, set, set_time,
|
||||
hctosys, systohc, startup_time, utc,
|
||||
local_opt, testing);
|
||||
+ audit_exit(rc);
|
||||
+ return rc; /* Not reached */
|
||||
}
|
||||
|
||||
/* A single routine for greater uniformity */
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/kd.c util-linux-2.13-pre5/hwclock/kd.c
|
||||
--- util-linux-2.13-pre5.orig/hwclock/kd.c 2005-10-25 17:08:26.000000000 -0400
|
||||
+++ util-linux-2.13-pre5/hwclock/kd.c 2005-10-25 17:09:40.000000000 -0400
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "clock.h"
|
||||
#include "nls.h"
|
||||
+#include "audit.h"
|
||||
|
||||
static int con_fd = -1; /* opened by probe_for_kd_clock() */
|
||||
/* never closed */
|
||||
@@ -103,7 +104,7 @@
|
||||
|
||||
if (ioctl(con_fd, KDGHWCLK, &t) == -1) {
|
||||
outsyserr(_("ioctl() failed to read time from %s"), con_fd_filename);
|
||||
- exit(EX_IOERR);
|
||||
+ audit_exit(EX_IOERR);
|
||||
}
|
||||
|
||||
tm->tm_sec = t.sec;
|
||||
@@ -139,7 +140,7 @@
|
||||
|
||||
if (ioctl(con_fd, KDSHWCLK, &t ) == -1) {
|
||||
outsyserr(_("ioctl KDSHWCLK failed"));
|
||||
- exit(1);
|
||||
+ audit_exit(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/Makefile.am util-linux-2.13-pre5/hwclock/Makefile.am
|
||||
--- util-linux-2.13-pre5.orig/hwclock/Makefile.am 2005-10-25 17:08:26.000000000 -0400
|
||||
+++ util-linux-2.13-pre5/hwclock/Makefile.am 2005-10-25 17:09:40.000000000 -0400
|
||||
@@ -4,4 +4,5 @@
|
||||
|
||||
sbin_PROGRAMS = hwclock
|
||||
|
||||
-hwclock_SOURCES = hwclock.c cmos.c rtc.c kd.c
|
||||
\ No newline at end of file
|
||||
+hwclock_SOURCES = hwclock.c cmos.c rtc.c kd.c audit.c
|
||||
+hwclock_LDADD = -laudit
|
||||
\ No newline at end of file
|
||||
diff -urN util-linux-2.13-pre5.orig/hwclock/rtc.c util-linux-2.13-pre5/hwclock/rtc.c
|
||||
--- util-linux-2.13-pre5.orig/hwclock/rtc.c 2005-10-25 17:08:26.000000000 -0400
|
||||
+++ util-linux-2.13-pre5/hwclock/rtc.c 2005-10-25 17:09:40.000000000 -0400
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "clock.h"
|
||||
#include "nls.h"
|
||||
+#include "audit.h"
|
||||
|
||||
/*
|
||||
* Get defines for rtc stuff.
|
||||
@@ -114,7 +115,7 @@
|
||||
|
||||
if (rtc_fd < 0) {
|
||||
outsyserr(_("open() of %s failed"), rtc_dev_name);
|
||||
- exit(EX_OSFILE);
|
||||
+ audit_exit(EX_OSFILE);
|
||||
}
|
||||
return rtc_fd;
|
||||
}
|
||||
@@ -149,7 +150,7 @@
|
||||
perror(ioctlname);
|
||||
fprintf(stderr, _("ioctl() to %s to read the time failed.\n"),
|
||||
rtc_dev_name);
|
||||
- exit(EX_IOERR);
|
||||
+ audit_exit(EX_IOERR);
|
||||
}
|
||||
|
||||
tm->tm_isdst = -1; /* don't know whether it's dst */
|
||||
@@ -329,7 +330,7 @@
|
||||
perror(ioctlname);
|
||||
fprintf(stderr, _("ioctl() to %s to set the time failed.\n"),
|
||||
rtc_dev_name);
|
||||
- exit(EX_IOERR);
|
||||
+ audit_exit(EX_IOERR);
|
||||
}
|
||||
|
||||
if (debug)
|
101
util-linux-2.13-audit-login.patch
Normal file
101
util-linux-2.13-audit-login.patch
Normal file
@ -0,0 +1,101 @@
|
||||
diff -ur util-linux-2.13-pre4.orig/login-utils/login.c util-linux-2.13-pre4/login-utils/login.c
|
||||
--- util-linux-2.13-pre4.orig/login-utils/login.c 2005-10-14 13:59:08.000000000 -0400
|
||||
+++ util-linux-2.13-pre4/login-utils/login.c 2005-10-14 15:43:54.000000000 -0400
|
||||
@@ -106,6 +106,7 @@
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <netdb.h>
|
||||
+#include <libaudit.h>
|
||||
#include "pathnames.h"
|
||||
#include "my_crypt.h"
|
||||
#include "login.h"
|
||||
@@ -329,6 +330,7 @@
|
||||
#ifdef LOGIN_CHOWN_VCS
|
||||
char vcsn[20], vcsan[20];
|
||||
#endif
|
||||
+ int audit_fd;
|
||||
|
||||
pid = getpid();
|
||||
|
||||
@@ -545,11 +547,25 @@
|
||||
(retcode == PAM_USER_UNKNOWN) ||
|
||||
(retcode == PAM_CRED_INSUFFICIENT) ||
|
||||
(retcode == PAM_AUTHINFO_UNAVAIL))) {
|
||||
+ struct passwd *pw;
|
||||
+ char buf[64];
|
||||
pam_get_item(pamh, PAM_USER, (const void **) &username);
|
||||
|
||||
syslog(LOG_NOTICE,_("FAILED LOGIN %d FROM %s FOR %s, %s"),
|
||||
failcount, hostname, username, pam_strerror(pamh, retcode));
|
||||
logbtmp(tty_name, username, hostname);
|
||||
+ audit_fd = audit_open();
|
||||
+ pw = getpwnam(username);
|
||||
+ if (pw) {
|
||||
+ snprintf(buf, sizeof(buf), "uid=%d", pw->pw_uid);
|
||||
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
|
||||
+ buf, hostname, NULL, tty_name, 0);
|
||||
+ } else {
|
||||
+ snprintf(buf, sizeof(buf), "acct=%s", username);
|
||||
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
|
||||
+ buf, hostname, NULL, tty_name, 0);
|
||||
+ }
|
||||
+ close(audit_fd);
|
||||
|
||||
fprintf(stderr,_("Login incorrect\n\n"));
|
||||
pam_set_item(pamh,PAM_USER,NULL);
|
||||
@@ -557,6 +573,8 @@
|
||||
}
|
||||
|
||||
if (retcode != PAM_SUCCESS) {
|
||||
+ struct passwd *pw;
|
||||
+ char buf[64];
|
||||
pam_get_item(pamh, PAM_USER, (const void **) &username);
|
||||
|
||||
if (retcode == PAM_MAXTRIES)
|
||||
@@ -567,6 +585,18 @@
|
||||
syslog(LOG_NOTICE,_("FAILED LOGIN SESSION FROM %s FOR %s, %s"),
|
||||
hostname, username, pam_strerror(pamh, retcode));
|
||||
logbtmp(tty_name, username, hostname);
|
||||
+ audit_fd = audit_open();
|
||||
+ pw = getpwnam(username);
|
||||
+ if (pw) {
|
||||
+ snprintf(buf, sizeof(buf), "uid=%d", pw->pw_uid);
|
||||
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
|
||||
+ buf, hostname, NULL, tty_name, 0);
|
||||
+ } else {
|
||||
+ snprintf(buf, sizeof(buf), "acct=%s", username);
|
||||
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
|
||||
+ buf, hostname, NULL, tty_name, 0);
|
||||
+ }
|
||||
+ close(audit_fd);
|
||||
|
||||
fprintf(stderr,_("\nLogin incorrect\n"));
|
||||
pam_end(pamh, retcode);
|
||||
@@ -908,6 +938,15 @@
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
+
|
||||
+ {
|
||||
+ char buf[32];
|
||||
+ audit_fd = audit_open();
|
||||
+ snprintf(buf, sizeof(buf), "uid=%d", pwd->pw_uid);
|
||||
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
|
||||
+ buf, hostname, NULL, tty_name, 1);
|
||||
+ close(audit_fd);
|
||||
+ }
|
||||
|
||||
dolastlog(quietlog);
|
||||
|
||||
diff -ur util-linux-2.13-pre4.orig/login-utils/Makefile.am util-linux-2.13-pre4/login-utils/Makefile.am
|
||||
--- util-linux-2.13-pre4.orig/login-utils/Makefile.am 2005-10-14 13:59:08.000000000 -0400
|
||||
+++ util-linux-2.13-pre4/login-utils/Makefile.am 2005-10-14 15:45:22.000000000 -0400
|
||||
@@ -55,7 +55,7 @@
|
||||
if HAVE_PAM
|
||||
chfn_LDADD += -lpam -lpam_misc
|
||||
chsh_LDADD += -lpam -lpam_misc
|
||||
-login_LDADD += -lpam -lpam_misc
|
||||
+login_LDADD += -lpam -lpam_misc -laudit
|
||||
login_SOURCES = login.c
|
||||
else
|
||||
login_SOURCES = login.c checktty.c
|
47
util-linux-2.13-cramfs-maxentries.patch
Normal file
47
util-linux-2.13-cramfs-maxentries.patch
Normal file
@ -0,0 +1,47 @@
|
||||
--- util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c.maxentries 2005-10-20 23:46:19.000000000 +0200
|
||||
+++ util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c 2005-10-20 23:54:07.000000000 +0200
|
||||
@@ -471,11 +471,13 @@
|
||||
* entries, using a stack to remember the directories
|
||||
* we've seen.
|
||||
*/
|
||||
-#define MAXENTRIES (100)
|
||||
static unsigned int write_directory_structure(struct entry *entry, char *base, unsigned int offset)
|
||||
{
|
||||
int stack_entries = 0;
|
||||
- struct entry *entry_stack[MAXENTRIES];
|
||||
+ int stack_size = 64;
|
||||
+ struct entry **entry_stack;
|
||||
+
|
||||
+ entry_stack = xmalloc(stack_size * sizeof(struct entry *));
|
||||
|
||||
for (;;) {
|
||||
int dir_start = stack_entries;
|
||||
@@ -508,13 +510,13 @@
|
||||
if (verbose)
|
||||
printf(" %s\n", entry->name);
|
||||
if (entry->child) {
|
||||
- if (stack_entries >= MAXENTRIES) {
|
||||
- fprintf(stderr,
|
||||
- _("Exceeded MAXENTRIES. Raise"
|
||||
- " this value in mkcramfs.c "
|
||||
- "and recompile. Exiting.\n")
|
||||
- );
|
||||
- exit(8);
|
||||
+ if (stack_entries >= stack_size) {
|
||||
+ stack_size *= 2;
|
||||
+ entry_stack = realloc(entry_stack, stack_size * sizeof(struct entry *));
|
||||
+ if (!entry_stack) {
|
||||
+ perror(NULL);
|
||||
+ exit(8); /* out of memory */
|
||||
+ }
|
||||
}
|
||||
entry_stack[stack_entries] = entry;
|
||||
stack_entries++;
|
||||
@@ -551,6 +553,7 @@
|
||||
printf("'%s':\n", entry->name);
|
||||
entry = entry->child;
|
||||
}
|
||||
+ free(entry_stack);
|
||||
return offset;
|
||||
}
|
||||
|
11
util-linux-2.13-cramfs-zerofiles.patch
Normal file
11
util-linux-2.13-cramfs-zerofiles.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c.zerofiles 2005-11-07 13:05:27.000000000 +0100
|
||||
+++ util-linux-2.13-pre5/disk-utils/mkfs.cramfs.c 2005-11-07 13:06:38.000000000 +0100
|
||||
@@ -661,7 +661,7 @@
|
||||
if (e->same) {
|
||||
set_data_offset(e, base, e->same->offset);
|
||||
e->offset = e->same->offset;
|
||||
- } else {
|
||||
+ } else if (e->size) {
|
||||
set_data_offset(e, base, offset);
|
||||
e->offset = offset;
|
||||
offset = do_compress(base, offset, e->name,
|
102
util-linux-2.13-ctty3.patch
Normal file
102
util-linux-2.13-ctty3.patch
Normal file
@ -0,0 +1,102 @@
|
||||
--- util-linux-2.13-pre1/login-utils/login.c.ctty3 2005-08-02 18:10:24.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/login-utils/login.c 2005-08-15 15:51:35.000000000 +0200
|
||||
@@ -285,7 +285,21 @@
|
||||
updwtmp(_PATH_BTMP, &ut);
|
||||
#endif
|
||||
}
|
||||
-#endif /* HAVE_SECURITY_PAM_MISC_H */
|
||||
+
|
||||
+static int childPid = 0;
|
||||
+static volatile int got_sig = 0;
|
||||
+
|
||||
+static void
|
||||
+parent_sig_handler(int signal)
|
||||
+{
|
||||
+ if(childPid)
|
||||
+ kill(-childPid, signal);
|
||||
+ else
|
||||
+ got_sig = 1;
|
||||
+ if(signal == SIGTERM)
|
||||
+ kill(-childPid, SIGHUP); /* because the shell often ignores SIGTERM */
|
||||
+}
|
||||
+#endif /* HAVE_SECURITY_PAM_MISC_H */
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
@@ -307,7 +321,7 @@
|
||||
int retcode;
|
||||
pam_handle_t *pamh = NULL;
|
||||
struct pam_conv conv = { misc_conv, NULL };
|
||||
- pid_t childPid;
|
||||
+ struct sigaction sa, oldsa_hup, oldsa_term;
|
||||
#else
|
||||
char *salt, *pp;
|
||||
#endif
|
||||
@@ -1023,7 +1037,18 @@
|
||||
* We must fork before setuid() because we need to call
|
||||
* pam_close_session() as root.
|
||||
*/
|
||||
+ memset(&sa, 0, sizeof(sa));
|
||||
+ sa.sa_handler = SIG_IGN;
|
||||
+ sigaction(SIGINT, &sa, NULL);
|
||||
+
|
||||
+ sigaction(SIGHUP, &sa, &oldsa_hup); /* ignore while we detach from the tty */
|
||||
+ ioctl(0, TIOCNOTTY, NULL);
|
||||
+
|
||||
+ sa.sa_handler = parent_sig_handler;
|
||||
+ sigaction(SIGHUP, &sa, NULL);
|
||||
+ sigaction(SIGTERM, &sa, &oldsa_term);
|
||||
|
||||
+ closelog();
|
||||
childPid = fork();
|
||||
if (childPid < 0) {
|
||||
int errsv = errno;
|
||||
@@ -1034,19 +1059,20 @@
|
||||
}
|
||||
|
||||
if (childPid) {
|
||||
- /* parent - wait for child to finish, then cleanup session */
|
||||
- signal(SIGHUP, SIG_IGN);
|
||||
- signal(SIGINT, SIG_IGN);
|
||||
- signal(SIGQUIT, SIG_IGN);
|
||||
- signal(SIGTSTP, SIG_IGN);
|
||||
- signal(SIGTTIN, SIG_IGN);
|
||||
- signal(SIGTTOU, SIG_IGN);
|
||||
-
|
||||
- wait(NULL);
|
||||
+ close(0); close(1); close(2);
|
||||
+ sa.sa_handler = SIG_IGN;
|
||||
+ sigaction(SIGQUIT, &sa, NULL);
|
||||
+ sigaction(SIGINT, &sa, NULL);
|
||||
+ while(wait(NULL) == -1 && errno == EINTR) /**/ ;
|
||||
+ openlog("login", LOG_ODELAY, LOG_AUTHPRIV);
|
||||
PAM_END;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
+ sigaction(SIGHUP, &oldsa_hup, NULL);
|
||||
+ sigaction(SIGTERM, &oldsa_term, NULL);
|
||||
+ if(got_sig) exit(1);
|
||||
+
|
||||
/* child */
|
||||
/*
|
||||
* Problem: if the user's shell is a shell like ash that doesnt do
|
||||
@@ -1058,14 +1084,15 @@
|
||||
setsid();
|
||||
|
||||
/* make sure we have a controlling tty */
|
||||
- opentty(ttyn);
|
||||
openlog("login", LOG_ODELAY, LOG_AUTHPRIV); /* reopen */
|
||||
|
||||
/*
|
||||
* TIOCSCTTY: steal tty from other process group.
|
||||
*/
|
||||
- if (ioctl(0, TIOCSCTTY, 1))
|
||||
- syslog(LOG_ERR, _("TIOCSCTTY failed: %m"));
|
||||
+ if (ioctl(0, TIOCSCTTY, (char *)1)) {
|
||||
+ syslog(LOG_ERR, _("Couldn't set controlling terminal: %s"), strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
#endif
|
||||
signal(SIGINT, SIG_DFL);
|
||||
|
493
util-linux-2.13-fdisk-gpt.patch
Normal file
493
util-linux-2.13-fdisk-gpt.patch
Normal file
@ -0,0 +1,493 @@
|
||||
--- util-linux-2.13-pre6/fdisk/fdisk.c.gpt 2005-11-24 15:30:36.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/fdisk/fdisk.c 2005-11-24 15:30:36.000000000 +0100
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <linux/blkpg.h>
|
||||
#endif
|
||||
|
||||
+#include "gpt.h"
|
||||
+
|
||||
static void delete_partition(int i);
|
||||
|
||||
#define hex_val(c) ({ \
|
||||
@@ -2400,6 +2402,14 @@
|
||||
}
|
||||
|
||||
static void
|
||||
+gpt_warning(char *dev)
|
||||
+{
|
||||
+ if (gpt_probe_signature_devname(dev))
|
||||
+ fprintf(stderr, _("\nWARNING: GPT (GUID Partition Table) detected on '%s'! "
|
||||
+ "The util fdisk doesn't support GPT. Use GNU Parted.\n\n"), dev);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
try(char *device, int user_specified) {
|
||||
int gb;
|
||||
|
||||
@@ -2409,6 +2419,7 @@
|
||||
if (!user_specified)
|
||||
if (is_ide_cdrom_or_tape(device))
|
||||
return;
|
||||
+ gpt_warning(device);
|
||||
if ((fd = open(disk_device, type_open)) >= 0) {
|
||||
gb = get_boot(try_only);
|
||||
if (gb > 0) { /* I/O error */
|
||||
@@ -2470,6 +2481,8 @@
|
||||
printf(_("%c: unknown command\n"), c);
|
||||
}
|
||||
|
||||
+
|
||||
+
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
int j, c;
|
||||
@@ -2574,6 +2587,7 @@
|
||||
|
||||
for (j = optind; j < argc; j++) {
|
||||
disk_device = argv[j];
|
||||
+ gpt_warning(disk_device);
|
||||
if ((fd = open(disk_device, type_open)) < 0)
|
||||
fatal(unable_to_open);
|
||||
if (disksize(fd, &size))
|
||||
@@ -2594,6 +2608,7 @@
|
||||
else
|
||||
fatal(usage2);
|
||||
|
||||
+ gpt_warning(disk_device);
|
||||
get_boot(fdisk);
|
||||
|
||||
if (osf_label) {
|
||||
--- /dev/null 2005-11-14 15:52:26.044616250 +0100
|
||||
+++ util-linux-2.13-pre6/fdisk/gpt.h 2005-11-24 15:30:36.000000000 +0100
|
||||
@@ -0,0 +1,9 @@
|
||||
+
|
||||
+#ifndef __GPT_H__
|
||||
+#define __GPT_H__
|
||||
+
|
||||
+extern int gpt_probe_signature_fd(int fd);
|
||||
+extern int gpt_probe_signature_devname(char *devname);
|
||||
+
|
||||
+#endif /* __GPT_H__ */
|
||||
+
|
||||
--- util-linux-2.13-pre6/fdisk/Makefile.am.gpt 2005-10-16 14:12:52.000000000 +0200
|
||||
+++ util-linux-2.13-pre6/fdisk/Makefile.am 2005-11-24 15:31:42.000000000 +0100
|
||||
@@ -5,13 +5,13 @@
|
||||
sbin_PROGRAMS = fdisk
|
||||
man_MANS = fdisk.8
|
||||
fdisk_SOURCES = fdisk.c disksize.c fdiskbsdlabel.c fdisksgilabel.c \
|
||||
- fdisksunlabel.c fdiskaixlabel.c i386_sys_types.c partname.c
|
||||
+ fdisksunlabel.c fdiskaixlabel.c i386_sys_types.c partname.c gpt.c
|
||||
|
||||
if !SPARC
|
||||
|
||||
sbin_PROGRAMS += sfdisk
|
||||
man_MANS += sfdisk.8
|
||||
-sfdisk_SOURCES = sfdisk.c disksize.c i386_sys_types.c partname.c
|
||||
+sfdisk_SOURCES = sfdisk.c disksize.c i386_sys_types.c partname.c gpt.c
|
||||
|
||||
if USE_SLANG
|
||||
sbin_PROGRAMS += cfdisk
|
||||
--- util-linux-2.13-pre6/fdisk/fdisk.8.gpt 2005-11-24 15:30:36.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/fdisk/fdisk.8 2005-11-24 15:30:36.000000000 +0100
|
||||
@@ -42,6 +42,11 @@
|
||||
partition tables.
|
||||
It understands DOS type partition tables and BSD or SUN type disklabels.
|
||||
|
||||
+.B fdisk
|
||||
+doesn't understand GUID Partition Table (GPT) and
|
||||
+it is not designed for large partitions. In particular case use more advanced GNU
|
||||
+.B parted(8).
|
||||
+
|
||||
The
|
||||
.I device
|
||||
is usually one of the following:
|
||||
--- util-linux-2.13-pre6/fdisk/sfdisk.8.gpt 2004-12-31 17:28:30.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/fdisk/sfdisk.8 2005-11-24 15:30:36.000000000 +0100
|
||||
@@ -18,6 +18,11 @@
|
||||
on a device, check the partitions on a device, and - very dangerous -
|
||||
repartition a device.
|
||||
|
||||
+.B sfdisk
|
||||
+doesn't understand GUID Partition Table (GPT) and
|
||||
+it is not designed for large partitions. In particular case use more advanced GNU
|
||||
+.B parted(8).
|
||||
+
|
||||
.SS "List Sizes"
|
||||
.BI "sfdisk \-s " partition
|
||||
gives the size of
|
||||
--- /dev/null 2005-11-14 15:52:26.044616250 +0100
|
||||
+++ util-linux-2.13-pre6/fdisk/gpt.c 2005-11-24 15:30:36.000000000 +0100
|
||||
@@ -0,0 +1,287 @@
|
||||
+/*
|
||||
+ GPT (GUID Partition Table) signature detection. Based on libparted and
|
||||
+ util-linux/partx.
|
||||
+
|
||||
+ Warning: this code doesn't do all GPT checks (CRC32, Protective MBR, ..). It's
|
||||
+ really GPT signature detection only.
|
||||
+
|
||||
+ -- Karel Zak <kzak@redhat.com> (Jun-2-2005)
|
||||
+
|
||||
+*/
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <inttypes.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <sys/utsname.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <unistd.h>
|
||||
+#include <errno.h>
|
||||
+#include <linux/fs.h>
|
||||
+
|
||||
+#include "gpt.h"
|
||||
+
|
||||
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||
+#define SECTOR_SIZE 512 /* default */
|
||||
+
|
||||
+#define _GET_BYTE(x, n) ( ((x) >> (8 * (n))) & 0xff )
|
||||
+
|
||||
+#define _PED_SWAP64(x) ( (_GET_BYTE(x, 0) << 56) \
|
||||
+ + (_GET_BYTE(x, 1) << 48) \
|
||||
+ + (_GET_BYTE(x, 2) << 40) \
|
||||
+ + (_GET_BYTE(x, 3) << 32) \
|
||||
+ + (_GET_BYTE(x, 4) << 24) \
|
||||
+ + (_GET_BYTE(x, 5) << 16) \
|
||||
+ + (_GET_BYTE(x, 6) << 8) \
|
||||
+ + (_GET_BYTE(x, 7) << 0) )
|
||||
+
|
||||
+#define PED_SWAP64(x) ((uint64_t) _PED_SWAP64( (uint64_t) (x) ))
|
||||
+
|
||||
+#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
+# define CPU_TO_LE64(x) (x)
|
||||
+#else
|
||||
+# define CPU_TO_LE64(x) PED_SWAP64(x)
|
||||
+#endif
|
||||
+
|
||||
+#define BLKSSZGET _IO(0x12,104) /* get block device sector size */
|
||||
+#define BLKGETLASTSECT _IO(0x12,108) /* get last sector of block device */
|
||||
+#define BLKGETSIZE _IO(0x12,96) /* return device size */
|
||||
+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
|
||||
+
|
||||
+#define GPT_HEADER_SIGNATURE 0x5452415020494645LL
|
||||
+#define GPT_PRIMARY_PARTITION_TABLE_LBA 1
|
||||
+
|
||||
+typedef struct {
|
||||
+ uint32_t time_low;
|
||||
+ uint16_t time_mid;
|
||||
+ uint16_t time_hi_and_version;
|
||||
+ uint8_t clock_seq_hi_and_reserved;
|
||||
+ uint8_t clock_seq_low;
|
||||
+ uint8_t node[6];
|
||||
+} /* __attribute__ ((packed)) */ efi_guid_t;
|
||||
+/* commented out "__attribute__ ((packed))" to work around gcc bug (fixed
|
||||
+ * in gcc3.1): __attribute__ ((packed)) breaks addressing on initialized
|
||||
+ * data. It turns out we don't need it in this case, so it doesn't break
|
||||
+ * anything :)
|
||||
+ */
|
||||
+
|
||||
+typedef struct _GuidPartitionTableHeader_t {
|
||||
+ uint64_t Signature;
|
||||
+ uint32_t Revision;
|
||||
+ uint32_t HeaderSize;
|
||||
+ uint32_t HeaderCRC32;
|
||||
+ uint32_t Reserved1;
|
||||
+ uint64_t MyLBA;
|
||||
+ uint64_t AlternateLBA;
|
||||
+ uint64_t FirstUsableLBA;
|
||||
+ uint64_t LastUsableLBA;
|
||||
+ efi_guid_t DiskGUID;
|
||||
+ uint64_t PartitionEntryLBA;
|
||||
+ uint32_t NumberOfPartitionEntries;
|
||||
+ uint32_t SizeOfPartitionEntry;
|
||||
+ uint32_t PartitionEntryArrayCRC32;
|
||||
+ uint8_t Reserved2[512 - 92];
|
||||
+} __attribute__ ((packed)) GuidPartitionTableHeader_t;
|
||||
+
|
||||
+struct blkdev_ioctl_param {
|
||||
+ unsigned int block;
|
||||
+ size_t content_length;
|
||||
+ char * block_contents;
|
||||
+};
|
||||
+
|
||||
+static int
|
||||
+_get_linux_version (void)
|
||||
+{
|
||||
+ static int kver = -1;
|
||||
+ struct utsname uts;
|
||||
+ int major;
|
||||
+ int minor;
|
||||
+ int teeny;
|
||||
+
|
||||
+ if (kver != -1)
|
||||
+ return kver;
|
||||
+ if (uname (&uts))
|
||||
+ return kver = 0;
|
||||
+ if (sscanf (uts.release, "%u.%u.%u", &major, &minor, &teeny) != 3)
|
||||
+ return kver = 0;
|
||||
+ return kver = KERNEL_VERSION (major, minor, teeny);
|
||||
+}
|
||||
+
|
||||
+static unsigned int
|
||||
+_get_sector_size (int fd)
|
||||
+{
|
||||
+ unsigned int sector_size;
|
||||
+
|
||||
+ if (_get_linux_version() < KERNEL_VERSION (2,3,0))
|
||||
+ return SECTOR_SIZE;
|
||||
+ if (ioctl (fd, BLKSSZGET, §or_size))
|
||||
+ return SECTOR_SIZE;
|
||||
+ return sector_size;
|
||||
+}
|
||||
+
|
||||
+static uint64_t
|
||||
+_get_num_sectors(int fd)
|
||||
+{
|
||||
+ int version = _get_linux_version();
|
||||
+ unsigned long size;
|
||||
+ uint64_t bytes=0;
|
||||
+
|
||||
+ if (version >= KERNEL_VERSION(2,5,4) ||
|
||||
+ (version < KERNEL_VERSION(2,5,0) &&
|
||||
+ version >= KERNEL_VERSION (2,4,18)))
|
||||
+ {
|
||||
+ if (ioctl(fd, BLKGETSIZE64, &bytes) == 0)
|
||||
+ return bytes / _get_sector_size(fd);
|
||||
+ }
|
||||
+ if (ioctl (fd, BLKGETSIZE, &size))
|
||||
+ return 0;
|
||||
+ return size;
|
||||
+}
|
||||
+
|
||||
+static uint64_t
|
||||
+last_lba(int fd)
|
||||
+{
|
||||
+ int rc;
|
||||
+ uint64_t sectors = 0;
|
||||
+ struct stat s;
|
||||
+
|
||||
+ memset(&s, 0, sizeof (s));
|
||||
+ rc = fstat(fd, &s);
|
||||
+ if (rc == -1)
|
||||
+ {
|
||||
+ fprintf(stderr, "last_lba() could not stat: %s\n",
|
||||
+ strerror(errno));
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (S_ISBLK(s.st_mode))
|
||||
+ sectors = _get_num_sectors(fd);
|
||||
+ else
|
||||
+ {
|
||||
+ fprintf(stderr,
|
||||
+ "last_lba(): I don't know how to handle files with mode %x\n",
|
||||
+ s.st_mode);
|
||||
+ sectors = 1;
|
||||
+ }
|
||||
+ return sectors - 1;
|
||||
+}
|
||||
+
|
||||
+static ssize_t
|
||||
+read_lastoddsector(int fd, uint64_t lba, void *buffer, size_t count)
|
||||
+{
|
||||
+ int rc;
|
||||
+ struct blkdev_ioctl_param ioctl_param;
|
||||
+
|
||||
+ if (!buffer) return 0;
|
||||
+
|
||||
+ ioctl_param.block = 0; /* read the last sector */
|
||||
+ ioctl_param.content_length = count;
|
||||
+ ioctl_param.block_contents = buffer;
|
||||
+
|
||||
+ rc = ioctl(fd, BLKGETLASTSECT, &ioctl_param);
|
||||
+ if (rc == -1) perror("read failed");
|
||||
+
|
||||
+ return !rc;
|
||||
+}
|
||||
+
|
||||
+static ssize_t
|
||||
+read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
|
||||
+{
|
||||
+ int sector_size = _get_sector_size(fd);
|
||||
+ off_t offset = lba * sector_size;
|
||||
+ ssize_t bytesread;
|
||||
+
|
||||
+ lseek(fd, offset, SEEK_SET);
|
||||
+ bytesread = read(fd, buffer, bytes);
|
||||
+
|
||||
+ /* Kludge. This is necessary to read/write the last
|
||||
+ block of an odd-sized disk, until Linux 2.5.x kernel fixes.
|
||||
+ This is only used by gpt.c, and only to read
|
||||
+ one sector, so we don't have to be fancy.
|
||||
+ */
|
||||
+ if (!bytesread && !(last_lba(fd) & 1) && lba == last_lba(fd))
|
||||
+ bytesread = read_lastoddsector(fd, lba, buffer, bytes);
|
||||
+ return bytesread;
|
||||
+}
|
||||
+
|
||||
+static GuidPartitionTableHeader_t *
|
||||
+alloc_read_gpt_header(int fd, uint64_t lba)
|
||||
+{
|
||||
+ GuidPartitionTableHeader_t *gpt =
|
||||
+ (GuidPartitionTableHeader_t *) malloc(sizeof (GuidPartitionTableHeader_t));
|
||||
+ if (!gpt)
|
||||
+ return NULL;
|
||||
+ memset(gpt, 0, sizeof (*gpt));
|
||||
+ if (!read_lba(fd, lba, gpt, sizeof (GuidPartitionTableHeader_t)))
|
||||
+ {
|
||||
+ free(gpt);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ return gpt;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+gpt_check_signature(int fd, uint64_t lba)
|
||||
+{
|
||||
+ GuidPartitionTableHeader_t *gpt;
|
||||
+ int res=0;
|
||||
+
|
||||
+ if ((gpt = alloc_read_gpt_header(fd, lba)))
|
||||
+ {
|
||||
+ if (gpt->Signature == CPU_TO_LE64(GPT_HEADER_SIGNATURE))
|
||||
+ res = 1;
|
||||
+ free(gpt);
|
||||
+ }
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+/* returns:
|
||||
+ * 0 not found GPT
|
||||
+ * 1 for valid primary GPT header
|
||||
+ * 2 for valid alternative GPT header
|
||||
+ */
|
||||
+int
|
||||
+gpt_probe_signature_fd(int fd)
|
||||
+{
|
||||
+ int res = 0;
|
||||
+
|
||||
+ /* check primary GPT header */
|
||||
+ if (gpt_check_signature(fd, GPT_PRIMARY_PARTITION_TABLE_LBA))
|
||||
+ res = 1;
|
||||
+ else
|
||||
+ {
|
||||
+ /* check alternative GPT header */
|
||||
+ uint64_t lastlba = last_lba(fd);
|
||||
+ if (gpt_check_signature(fd, lastlba))
|
||||
+ res = 2;
|
||||
+ }
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+gpt_probe_signature_devname(char *devname)
|
||||
+{
|
||||
+ int res, fd;
|
||||
+ if ((fd = open(devname, O_RDONLY)) < 0)
|
||||
+ return 0;
|
||||
+ res = gpt_probe_signature_fd(fd);
|
||||
+ close(fd);
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+#ifdef GPT_TEST_MAIN
|
||||
+int
|
||||
+main(int argc, char **argv)
|
||||
+{
|
||||
+ if (argc!=2)
|
||||
+ {
|
||||
+ fprintf(stderr, "usage: %s <dev>\n", argv[0]);
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
+ if (gpt_probe_signature_devname(argv[1]))
|
||||
+ printf("GPT (GUID Partition Table) detected on %s\n", argv[1]);
|
||||
+ exit(EXIT_SUCCESS);
|
||||
+}
|
||||
+#endif
|
||||
--- util-linux-2.13-pre6/fdisk/sfdisk.c.gpt 2005-10-16 14:18:32.000000000 +0200
|
||||
+++ util-linux-2.13-pre6/fdisk/sfdisk.c 2005-11-24 15:30:36.000000000 +0100
|
||||
@@ -50,6 +50,8 @@
|
||||
#include "nls.h"
|
||||
#include "common.h"
|
||||
|
||||
+#include "gpt.h"
|
||||
+
|
||||
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
|
||||
/*
|
||||
@@ -2457,6 +2459,23 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+static void
|
||||
+gpt_warning(char *dev, int warn_only)
|
||||
+{
|
||||
+ if (force)
|
||||
+ warn_only = 1;
|
||||
+
|
||||
+ if (gpt_probe_signature_devname(dev)) {
|
||||
+ fflush(stdout);
|
||||
+ fprintf(stderr, _("\nWARNING: GPT (GUID Partition Table) detected on '%s'! "
|
||||
+ "The util sfdisk doesn't support GPT. Use GNU Parted.\n\n"), dev);
|
||||
+ if (!warn_only) {
|
||||
+ fprintf(stderr, _("Use the --force flag to overrule this check.\n"));
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void do_list(char *dev, int silent);
|
||||
static void do_size(char *dev, int silent);
|
||||
static void do_geom(char *dev, int silent);
|
||||
@@ -2602,6 +2621,7 @@
|
||||
while ((dev = nextproc()) != NULL) {
|
||||
if (is_ide_cdrom_or_tape(dev))
|
||||
continue;
|
||||
+ gpt_warning(dev, 1);
|
||||
if (opt_out_geom)
|
||||
do_geom(dev, 1);
|
||||
if (opt_out_pt_geom)
|
||||
@@ -2629,6 +2649,7 @@
|
||||
|
||||
if (opt_list || opt_out_geom || opt_out_pt_geom || opt_size || verify) {
|
||||
while (optind < argc) {
|
||||
+ gpt_warning(argv[optind], 1);
|
||||
if (opt_out_geom)
|
||||
do_geom(argv[optind], 0);
|
||||
if (opt_out_pt_geom)
|
||||
@@ -2657,6 +2678,7 @@
|
||||
fatal(_("usage: sfdisk --change-id device partition-number Id\n"));
|
||||
else if (optind != argc-3 && optind != argc-2)
|
||||
fatal(_("usage: sfdisk --id device partition-number [Id]\n"));
|
||||
+ gpt_warning(argv[optind], 0);
|
||||
do_change_id(argv[optind], argv[optind+1],
|
||||
(optind == argc-2) ? 0 : argv[optind+2]);
|
||||
exit(exit_status);
|
||||
@@ -2666,6 +2688,8 @@
|
||||
fatal(_("can specify only one device (except with -l or -s)\n"));
|
||||
dev = argv[optind];
|
||||
|
||||
+ gpt_warning(dev, 0);
|
||||
+
|
||||
if (opt_reread)
|
||||
do_reread(dev);
|
||||
else if (restore_sector_file)
|
||||
@@ -2842,6 +2866,8 @@
|
||||
|
||||
z = &oldp;
|
||||
|
||||
+ gpt_warning(dev, 0);
|
||||
+
|
||||
rw = (!no_write && (arg || ac > 1));
|
||||
fd = my_open(dev, rw, 0);
|
||||
|
||||
@@ -2943,6 +2969,8 @@
|
||||
|
||||
z = &oldp;
|
||||
|
||||
+ gpt_warning(dev, 0);
|
||||
+
|
||||
rw = !no_write;
|
||||
fd = my_open(dev, rw, 0);
|
||||
|
18
util-linux-2.13-ipcs-shmax.patch
Normal file
18
util-linux-2.13-ipcs-shmax.patch
Normal file
@ -0,0 +1,18 @@
|
||||
--- util-linux-2.13-pre4/sys-utils/ipcs.c.shmax 2005-10-18 17:04:42.000000000 +0200
|
||||
+++ util-linux-2.13-pre4/sys-utils/ipcs.c 2005-10-18 17:31:28.000000000 +0200
|
||||
@@ -280,8 +280,14 @@
|
||||
(unsigned long) shminfo.shmmni);
|
||||
printf (_("max seg size (kbytes) = %lu\n"),
|
||||
(unsigned long) (shminfo.shmmax >> 10));
|
||||
+
|
||||
+ /* max shmem = pagesize * shminfo.shmall / 1024
|
||||
+ *
|
||||
+ * note: that "shminfo.shmall * getpagesize()" is greater than ULONG_MAX (32bit)
|
||||
+ * it means that better is "/" before "*" or use "long long"
|
||||
+ */
|
||||
printf (_("max total shared memory (kbytes) = %lu\n"),
|
||||
- (getpagesize()*((unsigned long) shminfo.shmall))/1024UL);
|
||||
+ getpagesize()/1024 * (unsigned long) shminfo.shmall);
|
||||
printf (_("min seg size (bytes) = %lu\n"),
|
||||
(unsigned long) shminfo.shmmin);
|
||||
return;
|
20
util-linux-2.13-login-hang.patch
Normal file
20
util-linux-2.13-login-hang.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- util-linux-2.13-pre2/login-utils/login.c.hang 2005-10-03 16:02:54.000000000 +0200
|
||||
+++ util-linux-2.13-pre2/login-utils/login.c 2005-10-03 16:16:16.000000000 +0200
|
||||
@@ -223,7 +223,8 @@
|
||||
|
||||
if (lstat(ttyn, &statbuf)
|
||||
|| !S_ISCHR(statbuf.st_mode)
|
||||
- || (statbuf.st_nlink > 1 && strncmp(ttyn, "/dev/", 5))) {
|
||||
+ || (statbuf.st_nlink > 1 && strncmp(ttyn, "/dev/", 5))
|
||||
+ || (access(ttyn, R_OK | W_OK) != 0)) {
|
||||
syslog(LOG_ERR, _("FATAL: bad tty"));
|
||||
sleep(1);
|
||||
exit(1);
|
||||
@@ -332,6 +333,7 @@
|
||||
pid = getpid();
|
||||
|
||||
signal(SIGALRM, timedout);
|
||||
+ siginterrupt(SIGALRM,1); /* we have to interrupt syscalls like ioclt() */
|
||||
alarm((unsigned int)timeout);
|
||||
signal(SIGQUIT, SIG_IGN);
|
||||
signal(SIGINT, SIG_IGN);
|
31
util-linux-2.13-login-pam-acct.patch
Normal file
31
util-linux-2.13-login-pam-acct.patch
Normal file
@ -0,0 +1,31 @@
|
||||
--- util-linux-2.13-pre6/login-utils/login.c.acct 2006-02-22 21:43:03.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/login-utils/login.c 2006-02-22 21:57:55.000000000 +0100
|
||||
@@ -602,16 +602,22 @@
|
||||
pam_end(pamh, retcode);
|
||||
exit(0);
|
||||
}
|
||||
+ }
|
||||
|
||||
- retcode = pam_acct_mgmt(pamh, 0);
|
||||
-
|
||||
- if(retcode == PAM_NEW_AUTHTOK_REQD) {
|
||||
- retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
|
||||
- }
|
||||
+ /*
|
||||
+ * Authentication may be skipped (for example, during krlogin, rlogin, etc...),
|
||||
+ * but it doesn't mean that we can skip other account checks. The account
|
||||
+ * could be disabled or password expired (althought kerberos ticket is valid).
|
||||
+ * -- kzak@redhat.com (22-Feb-2006)
|
||||
+ */
|
||||
+ retcode = pam_acct_mgmt(pamh, 0);
|
||||
|
||||
- PAM_FAIL_CHECK;
|
||||
+ if(retcode == PAM_NEW_AUTHTOK_REQD) {
|
||||
+ retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
|
||||
}
|
||||
|
||||
+ PAM_FAIL_CHECK;
|
||||
+
|
||||
/*
|
||||
* Grab the user information out of the password file for future usage
|
||||
* First get the username that we are actually using, though.
|
140
util-linux-2.13-losetup-all.patch
Normal file
140
util-linux-2.13-losetup-all.patch
Normal file
@ -0,0 +1,140 @@
|
||||
--- util-linux-2.13-pre2/mount/lomount.c.all 2005-08-29 16:59:06.000000000 +0200
|
||||
+++ util-linux-2.13-pre2/mount/lomount.c 2005-08-29 17:17:49.000000000 +0200
|
||||
@@ -28,6 +28,8 @@
|
||||
extern char *xstrdup (const char *s); /* not: #include "sundries.h" */
|
||||
extern void error (const char *fmt, ...); /* idem */
|
||||
|
||||
+#define SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
+
|
||||
#ifdef LOOP_SET_FD
|
||||
|
||||
static int
|
||||
@@ -128,6 +130,42 @@
|
||||
close (fd);
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+static int
|
||||
+show_used_loop_devices (void) {
|
||||
+ char dev[20];
|
||||
+ char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
|
||||
+ int i, j, fd, permission = 0, somedev = 0;
|
||||
+ struct stat statbuf;
|
||||
+ struct loop_info loopinfo;
|
||||
+
|
||||
+ for (j = 0; j < SIZE(loop_formats); j++) {
|
||||
+ for(i = 0; i < 256; i++) {
|
||||
+ sprintf(dev, loop_formats[j], i);
|
||||
+ if (stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) {
|
||||
+ somedev++;
|
||||
+ fd = open (dev, O_RDONLY);
|
||||
+ if (fd >= 0) {
|
||||
+ if(ioctl (fd, LOOP_GET_STATUS, &loopinfo) == 0)
|
||||
+ show_loop(dev);
|
||||
+ close (fd);
|
||||
+ somedev++;
|
||||
+ } else if (errno == EACCES)
|
||||
+ permission++;
|
||||
+ continue; /* continue trying as long as devices exist */
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (somedev==0 && permission) {
|
||||
+ error(_("%s: no permission to look at /dev/loop#"), progname);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
#endif
|
||||
|
||||
int
|
||||
@@ -139,8 +177,6 @@
|
||||
major(statbuf.st_rdev) == LOOPMAJOR);
|
||||
}
|
||||
|
||||
-#define SIZE(a) (sizeof(a)/sizeof(a[0]))
|
||||
-
|
||||
char *
|
||||
find_unused_loop_device (void) {
|
||||
/* Just creating a device, say in /tmp, is probably a bad idea -
|
||||
@@ -403,12 +439,13 @@
|
||||
|
||||
static void
|
||||
usage(void) {
|
||||
- fprintf(stderr, _("usage:\n\
|
||||
- %s loop_device # give info\n\
|
||||
- %s -d loop_device # delete\n\
|
||||
- %s -f # find unused\n\
|
||||
- %s [-e encryption] [-o offset] {-f|loop_device} file # setup\n"),
|
||||
- progname, progname, progname, progname);
|
||||
+ fprintf(stderr, _("usage:\n"
|
||||
+ " %1$s loop_device # give info\n"
|
||||
+ " %1$s -d loop_device # delete\n"
|
||||
+ " %1$s -f # find unused\n"
|
||||
+ " %1$s -a # list all used\n"
|
||||
+ " %1$s [-e encryption] [-o offset] {-f|loop_device} file # setup\n"),
|
||||
+ progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -442,7 +479,7 @@
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
char *p, *offset, *encryption, *passfd, *device, *file;
|
||||
- int delete, find, c;
|
||||
+ int delete, find, c, all;
|
||||
int res = 0;
|
||||
int ro = 0;
|
||||
int pfd = -1;
|
||||
@@ -452,7 +489,7 @@
|
||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
textdomain(PACKAGE);
|
||||
|
||||
- delete = find = 0;
|
||||
+ delete = find = all = 0;
|
||||
off = 0;
|
||||
offset = encryption = passfd = NULL;
|
||||
|
||||
@@ -460,8 +497,11 @@
|
||||
if ((p = strrchr(progname, '/')) != NULL)
|
||||
progname = p+1;
|
||||
|
||||
- while ((c = getopt(argc, argv, "de:E:fo:p:v")) != -1) {
|
||||
+ while ((c = getopt(argc, argv, "ade:E:fo:p:v")) != -1) {
|
||||
switch (c) {
|
||||
+ case 'a':
|
||||
+ all = 1;
|
||||
+ break;
|
||||
case 'd':
|
||||
delete = 1;
|
||||
break;
|
||||
@@ -489,17 +529,22 @@
|
||||
if (argc == 1) {
|
||||
usage();
|
||||
} else if (delete) {
|
||||
- if (argc != optind+1 || encryption || offset || find)
|
||||
+ if (argc != optind+1 || encryption || offset || find || all)
|
||||
usage();
|
||||
} else if (find) {
|
||||
- if (argc < optind || argc > optind+1)
|
||||
+ if (all || argc < optind || argc > optind+1)
|
||||
+ usage();
|
||||
+ } else if (all) {
|
||||
+ if (argc > 2)
|
||||
usage();
|
||||
} else {
|
||||
if (argc < optind+1 || argc > optind+2)
|
||||
usage();
|
||||
}
|
||||
|
||||
- if (find) {
|
||||
+ if (all)
|
||||
+ return show_used_loop_devices();
|
||||
+ else if (find) {
|
||||
device = find_unused_loop_device();
|
||||
if (device == NULL)
|
||||
return -1;
|
81
util-linux-2.13-mkswap-selinux.patch
Normal file
81
util-linux-2.13-mkswap-selinux.patch
Normal file
@ -0,0 +1,81 @@
|
||||
--- util-linux-2.13-pre6/disk-utils/mkswap.c.selinux 2005-08-14 17:34:49.000000000 +0200
|
||||
+++ util-linux-2.13-pre6/disk-utils/mkswap.c 2006-03-08 16:35:08.000000000 +0100
|
||||
@@ -39,6 +39,12 @@
|
||||
#include <sys/ioctl.h> /* for _IO */
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <errno.h>
|
||||
+#ifdef HAVE_LIBSELINUX
|
||||
+#include <selinux/selinux.h>
|
||||
+#include <selinux/context.h>
|
||||
+#endif
|
||||
+
|
||||
#include "swapheader.h"
|
||||
#include "xstrncpy.h"
|
||||
#include "nls.h"
|
||||
@@ -76,6 +82,8 @@
|
||||
|
||||
#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
|
||||
|
||||
+#define SELINUX_SWAPFILE_TYPE "swapfile_t"
|
||||
+
|
||||
static int
|
||||
linux_version_code(void) {
|
||||
struct utsname my_utsname;
|
||||
@@ -718,5 +726,39 @@
|
||||
if (fsync(DEV))
|
||||
die(_("fsync failed"));
|
||||
#endif
|
||||
+
|
||||
+#ifdef HAVE_LIBSELINUX
|
||||
+ if (S_ISREG(statbuf.st_mode) && is_selinux_enabled()) {
|
||||
+ security_context_t context_string;
|
||||
+ security_context_t oldcontext;
|
||||
+ context_t newcontext;
|
||||
+
|
||||
+ if ((fgetfilecon(DEV, &oldcontext) < 0) &&
|
||||
+ (errno != ENODATA)) {
|
||||
+ fprintf(stderr, _("%s: %s: unable to obtain selinux file label: %s\n"),
|
||||
+ program_name, device_name,
|
||||
+ strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (!(newcontext = context_new(oldcontext)))
|
||||
+ die(_("unable to create new selinux context"));
|
||||
+ if (context_type_set(newcontext, SELINUX_SWAPFILE_TYPE))
|
||||
+ die(_("couldn't compute selinux context"));
|
||||
+
|
||||
+ context_string = context_str(newcontext);
|
||||
+
|
||||
+ if (strcmp(context_string, oldcontext)!=0) {
|
||||
+ if (fsetfilecon(DEV, context_string)) {
|
||||
+ fprintf(stderr, _("%s: unable to relabel %s to %s: %s\n"),
|
||||
+ program_name, device_name,
|
||||
+ context_string,
|
||||
+ strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ }
|
||||
+ context_free(newcontext);
|
||||
+ freecon(oldcontext);
|
||||
+ }
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
--- util-linux-2.13-pre6/disk-utils/Makefile.am.selinux 2005-09-10 19:46:10.000000000 +0200
|
||||
+++ util-linux-2.13-pre6/disk-utils/Makefile.am 2006-03-08 16:27:03.000000000 +0100
|
||||
@@ -30,6 +30,13 @@
|
||||
mkfs_cramfs_LDADD = -lz $(top_srcdir)/lib/libmd5.a
|
||||
endif
|
||||
|
||||
+mkswap_LDADD =
|
||||
+
|
||||
if HAVE_UUID
|
||||
-mkswap_LDADD = -luuid
|
||||
+mkswap_LDADD += -luuid
|
||||
+endif
|
||||
+
|
||||
+if HAVE_SELINUX
|
||||
+mkswap_LDADD += -lselinux
|
||||
endif
|
||||
+
|
106
util-linux-2.13-moretc.patch
Normal file
106
util-linux-2.13-moretc.patch
Normal file
@ -0,0 +1,106 @@
|
||||
--- util-linux-2.13-pre2/text-utils/Makefile.am.moretc 2005-08-17 10:40:44.000000000 +0200
|
||||
+++ util-linux-2.13-pre2/text-utils/Makefile.am 2005-08-17 10:41:52.000000000 +0200
|
||||
@@ -7,16 +7,13 @@
|
||||
man_MANS = col.1 colcrt.1 colrm.1 column.1 hexdump.1 rev.1 line.1 tailf.1
|
||||
|
||||
if HAVE_NCURSES
|
||||
-bin_PROGRAMS = more
|
||||
usrbinexec_PROGRAMS += ul pg
|
||||
-more_LDADD = -lncurses
|
||||
pg_LDADD = -lncurses
|
||||
ul_LDADD = -lncurses
|
||||
-man_MANS += ul.1 more.1 pg.1
|
||||
-else
|
||||
+man_MANS += ul.1 pg.1
|
||||
+endif
|
||||
if HAVE_TERMCAP
|
||||
bin_PROGRAMS = more
|
||||
more_LDADD = -ltermcap
|
||||
man_MANS += more.1
|
||||
endif
|
||||
-endif
|
||||
--- util-linux-2.13-pre2/text-utils/more.c.moretc 2005-07-28 23:49:31.000000000 +0200
|
||||
+++ util-linux-2.13-pre2/text-utils/more.c 2005-08-17 10:40:23.000000000 +0200
|
||||
@@ -59,6 +59,8 @@
|
||||
#include "nls.h"
|
||||
#include "widechar.h"
|
||||
|
||||
+#include "../config.h"
|
||||
+
|
||||
#define _REGEX_RE_COMP
|
||||
#include <regex.h>
|
||||
#undef _REGEX_RE_COMP
|
||||
@@ -165,19 +167,60 @@
|
||||
} context, screen_start;
|
||||
extern char PC; /* pad character */
|
||||
|
||||
+#ifdef HAVE_LIBTERMCAP
|
||||
+
|
||||
+#include <termcap.h>
|
||||
+
|
||||
+char termbuffer[4096];
|
||||
+char tcbuffer[4096];
|
||||
+char *strbuf = termbuffer;
|
||||
+
|
||||
+static void
|
||||
+my_putstring(char *s) {
|
||||
+ tputs (s, 1, putchar);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+my_setupterm(const char *term, int fildes, int *errret) {
|
||||
+ *errret = tgetent(tcbuffer, term);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+my_tgetnum(char *s, char *ss) {
|
||||
+ return tgetnum(s);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+my_tgetflag(char *s, char *ss) {
|
||||
+ return tgetflag(s);
|
||||
+}
|
||||
+
|
||||
+static char *
|
||||
+my_tgetstr(char *s, char *ss) {
|
||||
+ return tgetstr(s, &strbuf);
|
||||
+}
|
||||
+
|
||||
+static char *
|
||||
+my_tgoto(const char *cap, int col, int row) {
|
||||
+ return tgoto(cap, col, row);
|
||||
+}
|
||||
+
|
||||
+#else /* !HAVE_TERMCAP */
|
||||
+
|
||||
#ifdef HAVE_NCURSES_H
|
||||
-#include <ncurses.h>
|
||||
+# include <ncurses.h>
|
||||
+# include <term.h>
|
||||
#elif defined(HAVE_NCURSES_NCURSES_H)
|
||||
-#include <ncurses/ncurses.h>
|
||||
+# include <ncurses/ncurses.h>
|
||||
+# include <term.h>
|
||||
#endif
|
||||
|
||||
-#include <term.h> /* include after <curses.h> */
|
||||
-
|
||||
static void
|
||||
my_putstring(char *s) {
|
||||
tputs (s, 1, putchar); /* putp(s); */
|
||||
}
|
||||
|
||||
+
|
||||
static void
|
||||
my_setupterm(const char *term, int fildes, int *errret) {
|
||||
setupterm(term, fildes, errret);
|
||||
@@ -203,6 +246,8 @@
|
||||
return tparm(cap, col, row);
|
||||
}
|
||||
|
||||
+#endif /* !HAVE_TERMCAP */
|
||||
+
|
||||
static void
|
||||
idummy(int *kk) {}
|
||||
|
62
util-linux-2.13-mount-twiceloop.patch
Normal file
62
util-linux-2.13-mount-twiceloop.patch
Normal file
@ -0,0 +1,62 @@
|
||||
--- util-linux-2.13-pre6/mount/fstab.c.twiceloop 2006-01-03 18:35:05.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/mount/fstab.c 2006-01-03 18:37:44.000000000 +0100
|
||||
@@ -254,6 +254,27 @@
|
||||
return (ct == 1);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Given the loop file LOOPFILE, and the mount point DIR, check that
|
||||
+ * same file is already mounted on same directory
|
||||
+ *
|
||||
+ * Don't forget there's
|
||||
+ * /path/loopfile /path/dir loop=/dev/loop0
|
||||
+ * in mtab for loop devices.
|
||||
+ */
|
||||
+int
|
||||
+is_mounted_same_loopfile(const char *loopfile, const char *dir) {
|
||||
+ struct mntentchn *mc, *mc0;
|
||||
+ int ct = 0;
|
||||
+
|
||||
+ mc0 = mtab_head();
|
||||
+ for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev)
|
||||
+ if (streq(mc->m.mnt_fsname, loopfile) &&
|
||||
+ streq(mc->m.mnt_dir, dir))
|
||||
+ ct++;
|
||||
+ return (ct == 1);
|
||||
+}
|
||||
+
|
||||
/* Given the name FILE, try to find the option "loop=FILE" in mtab. */
|
||||
struct mntentchn *
|
||||
getmntoptfile (const char *file) {
|
||||
--- util-linux-2.13-pre6/mount/mount.c.twiceloop 2006-01-03 18:35:06.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/mount/mount.c 2006-01-03 18:37:44.000000000 +0100
|
||||
@@ -671,7 +671,7 @@
|
||||
|
||||
static int
|
||||
loop_check(const char **spec, const char **type, int *flags,
|
||||
- int *loop, const char **loopdev, const char **loopfile) {
|
||||
+ int *loop, const char **loopdev, const char **loopfile, const char *dir) {
|
||||
int looptype;
|
||||
unsigned long long offset;
|
||||
|
||||
@@ -709,6 +709,11 @@
|
||||
} else {
|
||||
int loopro = (*flags & MS_RDONLY);
|
||||
|
||||
+ if (is_mounted_same_loopfile(*loopfile, dir)) {
|
||||
+ error(_("mount: %s already mounted on %s"), *loopfile, dir);
|
||||
+ return EX_FAIL;
|
||||
+ }
|
||||
+
|
||||
if (!*loopdev || !**loopdev)
|
||||
*loopdev = find_unused_loop_device();
|
||||
if (!*loopdev)
|
||||
@@ -856,7 +861,7 @@
|
||||
* stale assignments of files to loop devices. Nasty when used for
|
||||
* encryption.
|
||||
*/
|
||||
- res = loop_check(&spec, &types, &flags, &loop, &loopdev, &loopfile);
|
||||
+ res = loop_check(&spec, &types, &flags, &loop, &loopdev, &loopfile, node);
|
||||
if (res)
|
||||
goto out;
|
||||
}
|
105
util-linux-2.13-rmparts.patch
Normal file
105
util-linux-2.13-rmparts.patch
Normal file
@ -0,0 +1,105 @@
|
||||
--- util-linux-2.13-pre6/disk-utils/blockdev.c.rmparts 2006-02-08 14:10:48.000000000 -0500
|
||||
+++ util-linux-2.13-pre6/disk-utils/blockdev.c 2006-02-08 14:19:31.000000000 -0500
|
||||
@@ -29,6 +29,28 @@
|
||||
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
|
||||
#endif
|
||||
|
||||
+#ifndef BLKPG
|
||||
+#define BLKPG _IO(0x12,105)
|
||||
+#define BLKPG_DEL_PARTITION 2
|
||||
+#define BLKPG_DEVNAMELTH 64
|
||||
+#define BLKPG_VOLNAMELTH 64
|
||||
+
|
||||
+struct blkpg_partition {
|
||||
+ long long start;
|
||||
+ long long length;
|
||||
+ long long pno;
|
||||
+ char devname[BLKPG_DEVNAMELTH];
|
||||
+ char volname[BLKPG_VOLNAMELTH];
|
||||
+};
|
||||
+
|
||||
+struct blkpg_ioctl_arg {
|
||||
+ int op;
|
||||
+ int flags;
|
||||
+ int datalen;
|
||||
+ void *data;
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
/* Maybe <linux/hdreg.h> could be included */
|
||||
#ifndef HDIO_GETGEO
|
||||
#define HDIO_GETGEO 0x0301
|
||||
@@ -93,6 +115,10 @@
|
||||
{ "--rereadpt", "BLKRRPART", BLKRRPART, ARGNONE, 0, NULL,
|
||||
N_("reread partition table") },
|
||||
#endif
|
||||
+#ifdef BLKPG
|
||||
+ { "--rmpart", "BLKPG", BLKPG, ARGINTAP, 0, "PARTNO", N_("disable partition") },
|
||||
+ { "--rmparts", "BLKPG", BLKPG, ARGNONE, 0, NULL, N_("disable all partitions") },
|
||||
+#endif
|
||||
};
|
||||
|
||||
#define SIZE(a) (sizeof(a)/sizeof((a)[0]))
|
||||
@@ -144,6 +170,35 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef BLKPG
|
||||
+static int
|
||||
+disable_partition(int fd, int partno) {
|
||||
+ struct blkpg_partition part = {
|
||||
+ .pno = partno,
|
||||
+ };
|
||||
+ struct blkpg_ioctl_arg io = {
|
||||
+ .op = BLKPG_DEL_PARTITION,
|
||||
+ .datalen = sizeof(part),
|
||||
+ .data = &part,
|
||||
+ };
|
||||
+ int res;
|
||||
+
|
||||
+ res = ioctl(fd, BLKPG, &io);
|
||||
+ if (res < 0)
|
||||
+ return 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+disable_partitions(int fd) {
|
||||
+ int p, res = 0;
|
||||
+
|
||||
+ for (p = 1; p <= 256; p++)
|
||||
+ res += disable_partition(fd, p);
|
||||
+ return res ? 0 : -1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
void do_commands(int fd, char **argv, int d);
|
||||
void report_header(void);
|
||||
void report_device(char *device, int quiet);
|
||||
@@ -259,6 +314,12 @@
|
||||
switch(bdcms[j].argtype) {
|
||||
default:
|
||||
case ARGNONE:
|
||||
+#ifdef BLKPG
|
||||
+ if (bdcms[j].ioc == BLKPG) {
|
||||
+ res = disable_partitions(fd);
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
res = ioctl(fd, bdcms[j].ioc, 0);
|
||||
break;
|
||||
case ARGINTA:
|
||||
@@ -276,6 +337,13 @@
|
||||
bdcms[j].name);
|
||||
usage();
|
||||
}
|
||||
+#ifdef BLKPG
|
||||
+ if (bdcms[j].ioc == BLKPG) {
|
||||
+ iarg = atoi(argv[++i]);
|
||||
+ res = disable_partition(fd, iarg) ? 0 : -1;
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
iarg = atoi(argv[++i]);
|
||||
res = ioctl(fd, bdcms[j].ioc, &iarg);
|
||||
break;
|
22
util-linux-2.13-schedutils-man.patch
Normal file
22
util-linux-2.13-schedutils-man.patch
Normal file
@ -0,0 +1,22 @@
|
||||
--- util-linux-2.13-pre6/schedutils/taskset.1.kzak 2006-02-22 16:10:26.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/schedutils/taskset.1 2006-02-22 16:10:38.000000000 +0100
|
||||
@@ -82,7 +82,7 @@
|
||||
.SH USAGE
|
||||
.TP
|
||||
The default behavior is to run a new command with a given affinity mask:
|
||||
-taskset [mask] -- [command] [arguments]
|
||||
+taskset [mask] [command] [arguments]
|
||||
.TP
|
||||
You can also retrieve the CPU affinity of an existing task:
|
||||
taskset -p [pid]
|
||||
--- util-linux-2.13-pre6/schedutils/chrt.1.kzak 2006-02-22 16:09:02.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/schedutils/chrt.1 2006-02-22 16:09:22.000000000 +0100
|
||||
@@ -72,7 +72,7 @@
|
||||
.SH USAGE
|
||||
.TP
|
||||
The default behavior is to run a new command::
|
||||
-chrt [prio] -- [command] [arguments]
|
||||
+chrt [prio] [command] [arguments]
|
||||
.TP
|
||||
You can also retrieve the real-time attributes of an existing task:
|
||||
chrt -p [pid]
|
161
util-linux-2.13-swapon-suspend.patch
Normal file
161
util-linux-2.13-swapon-suspend.patch
Normal file
@ -0,0 +1,161 @@
|
||||
--- util-linux-2.13-pre2/mount/swapon.c.swsuspend 2005-09-02 14:32:53.000000000 +0200
|
||||
+++ util-linux-2.13-pre2/mount/swapon.c 2005-09-02 16:29:43.000000000 +0200
|
||||
@@ -11,6 +11,9 @@
|
||||
#include <mntent.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/wait.h>
|
||||
+#include <fcntl.h>
|
||||
#include "xmalloc.h"
|
||||
#include "swap_constants.h"
|
||||
#include "swapargs.h"
|
||||
@@ -22,6 +25,7 @@
|
||||
|
||||
#define _PATH_FSTAB "/etc/fstab"
|
||||
#define PROC_SWAPS "/proc/swaps"
|
||||
+#define PATH_MKSWAP "/sbin/mkswap"
|
||||
|
||||
#define SWAPON_NEEDS_TWO_ARGS
|
||||
|
||||
@@ -173,6 +177,84 @@
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * It's better do swsuspend detection by follow routine than
|
||||
+ * include huge mount_guess_fstype.o to swapon. We need only
|
||||
+ * swsuspend and no the others filesystems.
|
||||
+ */
|
||||
+#ifdef HAVE_LIBBLKID
|
||||
+static int
|
||||
+swap_is_swsuspend(const char *device) {
|
||||
+ const char *type = blkid_get_tag_value(blkid, "TYPE", device);
|
||||
+
|
||||
+ if (type && strcmp(type, "swsuspend")==0)
|
||||
+ return 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+#else
|
||||
+static int
|
||||
+swap_is_swsuspend(const char *device) {
|
||||
+ int fd, re = 1, n = getpagesize() - 10;
|
||||
+ char buf[10];
|
||||
+
|
||||
+ fd = open(device, O_RDONLY);
|
||||
+ if (fd < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (lseek(fd, n, SEEK_SET) >= 0 &&
|
||||
+ read(fd, buf, sizeof buf) == sizeof buf &&
|
||||
+ (memcmp("S1SUSPEND", buf, 9)==0 ||
|
||||
+ memcmp("S2SUSPEND", buf, 9)==0))
|
||||
+ re = 0;
|
||||
+
|
||||
+ close(fd);
|
||||
+ return re;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+/* calls mkswap */
|
||||
+static int
|
||||
+swap_reinitialize(const char *device) {
|
||||
+ const char *label = mount_get_volume_label_by_spec(device);
|
||||
+ pid_t pid;
|
||||
+
|
||||
+ switch((pid=fork())) {
|
||||
+ case -1: /* fork error */
|
||||
+ fprintf(stderr, _("%s: cannot fork: %s\n"),
|
||||
+ progname, strerror(errno));
|
||||
+ return -1;
|
||||
+
|
||||
+ case 0: /* child */
|
||||
+ if (label && *label)
|
||||
+ execl(PATH_MKSWAP, PATH_MKSWAP, "-L", label, device, NULL);
|
||||
+ else
|
||||
+ execl(PATH_MKSWAP, PATH_MKSWAP, device, NULL);
|
||||
+ exit(1); /* error */
|
||||
+
|
||||
+ default: /* parent */
|
||||
+ {
|
||||
+ int status;
|
||||
+ int ret;
|
||||
+
|
||||
+ do {
|
||||
+ if ((ret = waitpid(pid, &status, 0)) < 0
|
||||
+ && errno == EINTR)
|
||||
+ continue;
|
||||
+ else if (ret < 0) {
|
||||
+ fprintf(stderr, _("%s: waitpid: %s\n"),
|
||||
+ progname, strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ } while (0);
|
||||
+
|
||||
+ /* mkswap returns: 0=suss, 1=error */
|
||||
+ if (WIFEXITED(status) && WEXITSTATUS(status)==0)
|
||||
+ return 0; /* ok */
|
||||
+ }
|
||||
+ }
|
||||
+ return -1; /* error */
|
||||
+}
|
||||
+
|
||||
static int
|
||||
do_swapon(const char *orig_special, int prio) {
|
||||
int status;
|
||||
@@ -196,6 +278,18 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ /* We have to reinitialize swap with old (=useless) software suspend
|
||||
+ * data. The problem is that if we don't do it, then we get data
|
||||
+ * corruption the next time with suspended on.
|
||||
+ */
|
||||
+ if (swap_is_swsuspend(special)==0) {
|
||||
+ fprintf(stdout, _("%s: %s: software suspend data detected. "
|
||||
+ "Reinitializing the swap.\n"),
|
||||
+ progname, special);
|
||||
+ if (swap_reinitialize(special) < 0)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/* people generally dislike this warning - now it is printed
|
||||
only when `verbose' is set */
|
||||
if (verbose) {
|
||||
--- util-linux-2.13-pre2/mount/get_label_uuid.c.swsuspend 2005-09-02 14:32:53.000000000 +0200
|
||||
+++ util-linux-2.13-pre2/mount/get_label_uuid.c 2005-09-02 16:21:20.000000000 +0200
|
||||
@@ -129,7 +129,24 @@
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
-
|
||||
+
|
||||
+static int
|
||||
+is_swsuspend_partition(int fd, char **label, char *uuid) {
|
||||
+ int n = getpagesize();
|
||||
+ char *buf = xmalloc(n);
|
||||
+ struct swap_header_v1_2 *p = (struct swap_header_v1_2 *) buf;
|
||||
+
|
||||
+ if (lseek(fd, 0, SEEK_SET) == 0
|
||||
+ && read(fd, buf, n) == n
|
||||
+ && (strncmp(buf+n-10, "S1SUSPEND", 9)==0 ||
|
||||
+ strncmp(buf+n-10, "S2SUSPEND", 9)==0)
|
||||
+ && p->version == 1) {
|
||||
+ store_uuid(uuid, p->uuid);
|
||||
+ store_label(label, p->volume_name, 16);
|
||||
+ return 1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
/*
|
||||
* Get both label and uuid.
|
||||
@@ -162,6 +179,8 @@
|
||||
|
||||
if (is_v1_swap_partition(fd, label, uuid))
|
||||
goto done;
|
||||
+ if (is_swsuspend_partition(fd, label, uuid))
|
||||
+ goto done;
|
||||
|
||||
if (lseek(fd, 1024, SEEK_SET) == 1024
|
||||
&& read(fd, (char *) &e2sb, sizeof(e2sb)) == sizeof(e2sb)
|
11
util-linux-2.13-umount-sysfs.patch
Normal file
11
util-linux-2.13-umount-sysfs.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- util-linux-2.13-pre6/mount/umount.c.sysfs 2006-02-23 10:09:53.000000000 +0100
|
||||
+++ util-linux-2.13-pre6/mount/umount.c 2006-02-23 10:10:39.000000000 +0100
|
||||
@@ -734,7 +734,7 @@
|
||||
if (all) {
|
||||
/* nodev stuff: sysfs, usbfs, oprofilefs, ... */
|
||||
if (types == NULL)
|
||||
- types = "noproc,nodevfs,nodevpts";
|
||||
+ types = "noproc,nodevfs,nodevpts,nosysfs";
|
||||
result = umount_all (types, test_opts);
|
||||
} else if (argc < 1) {
|
||||
usage (stderr, 2);
|
@ -1,16 +0,0 @@
|
||||
#%PAM-1.0
|
||||
auth substack system-auth
|
||||
auth include postlogin
|
||||
account required pam_nologin.so
|
||||
account include system-auth
|
||||
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
|
||||
# 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
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include system-auth
|
||||
session include postlogin
|
||||
-session optional pam_ck_connector.so
|
@ -1,15 +0,0 @@
|
||||
#%PAM-1.0
|
||||
auth substack password-auth
|
||||
auth include postlogin
|
||||
account required pam_nologin.so
|
||||
account include password-auth
|
||||
password include password-auth
|
||||
# pam_selinux.so close should be the first session rule
|
||||
session required pam_selinux.so close
|
||||
session required pam_loginuid.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
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include password-auth
|
||||
session include postlogin
|
@ -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
|
@ -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
|
@ -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
|
@ -1,14 +0,0 @@
|
||||
#%PAM-1.0
|
||||
auth sufficient pam_rootok.so
|
||||
# Uncomment the following line to implicitly trust users in the "wheel" group.
|
||||
#auth sufficient pam_wheel.so trust use_uid
|
||||
# Uncomment the following line to require a user to be in the "wheel" group.
|
||||
#auth required pam_wheel.so use_uid
|
||||
auth substack system-auth
|
||||
auth include postlogin
|
||||
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
||||
session include postlogin
|
||||
session optional pam_xauth.so
|
2565
util-linux.spec
2565
util-linux.spec
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
d /run/uuidd 2775 uuidd uuidd
|
Loading…
Reference in New Issue
Block a user