Compare commits

..

2 commits

52 changed files with 2682 additions and 3645 deletions

6
.cvsignore Normal file
View file

@ -0,0 +1,6 @@
cramfs-1.1.tar.gz
floppy-0.12.tar.gz
kbdrate.tar.gz
util-linux-2.12a.tar.gz
util-linux-2.12j.tar.gz
util-linux-2.12p.tar.gz

View file

@ -1 +0,0 @@
1

108
.gitignore vendored
View file

@ -1,108 +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
/util-linux-2.39.tar.xz
/util-linux-2.39.1.tar.xz
/util-linux-2.39.2.tar.xz
/util-linux-2.39.3.tar.xz
/util-linux-2.40-rc1.tar.xz
/util-linux-2.40.tar.xz
/util-linux-2.40.1.tar.xz
/util-linux-2.40.2.tar.xz
/util-linux-2.40.4.tar.xz
/util-linux-2.41.tar.xz
/util-linux-2.41.1.tar.xz
/util-linux-2.41.2.tar.xz
/util-linux-2.41.3.tar.xz
/util-linux-2.42.tar.xz
/util-linux-2.42.1.tar.xz
/util-linux-2.42.2.tar.xz

View file

@ -1,27 +0,0 @@
From a2357184ff3dc3beb001fcb12e1e4c0dcf8d0dbd Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 2 Dec 2025 16:15:44 +0100
Subject: login: use O_CREAT on lastlog
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=151635
Signed-off-by: Karel Zak <kzak@redhat.com>
---
login-utils/login.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/login-utils/login.c b/login-utils/login.c
index 321f9d6ce..edc69fd9a 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -682,7 +682,7 @@ static void log_lastlog(struct login_context *cxt)
sa.sa_handler = SIG_IGN;
sigaction(SIGXFSZ, &sa, &oldsa_xfsz);
- fd = open(_PATH_LASTLOG, O_RDWR, 0);
+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0);
if (fd < 0)
goto done;
offset = cxt->pwd->pw_uid * sizeof(ll);
--
2.51.1

View file

@ -1,27 +0,0 @@
From 617a887a6ec7e433f6a9f4c60592ed38b12b9f18 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 2 Dec 2025 16:17:55 +0100
Subject: login: add /run/motd.d` to the hardcoded MOTD_FILE
Addresses: https://github.com/coreos/console-login-helper-messages/issues/60
Signed-off-by: Karel Zak <kzak@redhat.com>
---
include/pathnames.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/pathnames.h b/include/pathnames.h
index 34ba11ca3..c91a077e1 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -41,7 +41,7 @@
#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR "/var/spool/mail"
#endif
-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd"
+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d"
#ifndef _PATH_NOLOGIN
# define _PATH_NOLOGIN "/etc/nologin"
#endif
--
2.51.1

6
Makefile Normal file
View file

@ -0,0 +1,6 @@
# Makefile for source rpm: util-linux
# $Id$
NAME := util-linux
SPECFILE = $(firstword $(wildcard *.spec))
include ../common/Makefile.common

View file

@ -1,12 +0,0 @@
srpm util-linux
mcd $BUILDDIR/$1
cat <<EOF > config.cache
ax_cv_have_tls=yes
scanf_cv_alloc_modifier=ms
EOF
$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --without-tinfo \
--prefix=/usr --libexecdir=/usr/lib${SUFFIX} --libdir=/usr/lib${SUFFIX} \
--disable-wall --cache-file=config.cache --without-python --without-systemd
notparallel
make $J V=1
make $J install DESTDIR=${ROOTFS}

View file

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

2341
changelog

File diff suppressed because it is too large Load diff

10
floppy-0.12-locale.patch Normal file
View 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>

63
nologin.8 Normal file
View file

@ -0,0 +1,63 @@
.\" $OpenBSD: nologin.8,v 1.8 1999/06/04 02:45:19 aaron Exp $
.\" $NetBSD: nologin.8,v 1.3 1995/03/18 14:59:09 cgd Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)nologin.8 8.1 (Berkeley) 6/19/93
.\"
.Dd February 15, 1997
.Dt NOLOGIN 8
.Os
.Sh NAME
.Nm nologin
.Nd politely refuse a login
.Sh SYNOPSIS
.Nm nologin
.Sh DESCRIPTION
.Nm
displays a message that an account is not available and
exits non-zero.
It is intended as a replacement shell field for accounts that
have been disabled.
.Pp
If the file
.Pa /etc/nologin.txt
exists,
.Nm
displays its contents to the user instead of the default message.
.Sh SEE ALSO
.Xr login 1
.Sh HISTORY
The
.Nm
command appeared in
.Bx 4.4 .

58
nologin.c Normal file
View file

@ -0,0 +1,58 @@
/* $OpenBSD: nologin.c,v 1.2 1997/04/04 16:51:37 millert Exp $ */
/*
* Copyright (c) 1997, Jason Downs. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
/* Distinctly different from _PATH_NOLOGIN. */
#define _PATH_NOLOGIN_TXT "/etc/nologin.txt"
#define DEFAULT_MESG "This account is currently not available.\n"
/*ARGSUSED*/
int main(argc, argv)
int argc;
char *argv[];
{
int nfd, nrd;
char nbuf[128];
nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
if (nfd < 0) {
write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
exit (1);
}
while ((nrd = read(nfd, nbuf, sizeof(nbuf))) > 0)
write(STDOUT_FILENO, nbuf, nrd);
close (nfd);
exit (1);
}

View file

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

View file

@ -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",

View file

@ -1 +1,4 @@
SHA512 (util-linux-2.42.2.tar.xz) = 7415add0be2930654e322830808dde03ff6d511bd357f0679e6b6287a13ca79fe58ce4ac05edef86b76fb381b3a36ca2da9d3c31b5dc0a1d889c203156a57277
d3912b9f7bf745fbfea68f6a9b9de30f cramfs-1.1.tar.gz
7d3ac81855e26687dada6a31d2677875 floppy-0.12.tar.gz
555e4bd2a23347fddac4268cbf4e1fe4 kbdrate.tar.gz
d47e820f6880c21c8b4c0c7e8a7376cc util-linux-2.12p.tar.gz

View file

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/util-linux/various
# Description: This test groups small sanity and regression tests for util-linux
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/util-linux/Sanity/various
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Miroslav Vadkerti <mvadkert@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: This test groups small sanity and regression tests for util-linux" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: util-linux" >> $(METADATA)
@echo "Requires: util-linux util-linux-user" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL3 -RHEL4 -RHEL5Server -RHEL5Client -RHEL6" >> $(METADATA)
rhts-lint $(METADATA)

View file

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

View file

@ -1,13 +0,0 @@
summary: This test groups small sanity and regression tests for util-linux
description: ''
contact: Miroslav Vadkerti <mvadkert@redhat.com>
component:
- util-linux
test: ./runtest.sh
framework: beakerlib
recommend:
- util-linux
- util-linux-user
duration: 10m
extra-summary: /CoreOS/util-linux/Sanity/various
extra-task: /CoreOS/util-linux/Sanity/various

View file

@ -1,51 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/util-linux/various
# Description: This test groups small sanity and regression tests for util-linux
# Author: Miroslav Vadkerti <mvadkert@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="util-linux"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlPhaseEnd
rlPhaseStartTest "return code of chfn should be always 1 in case failure"
rlRun "chfn -f a:b" 1
rlRun "chfn -o a:b" 1
rlRun "chfn -p a:b" 1
rlRun "chfn -h a:b" 1
rlRun "chfn -x a:b" 1
rlRun "chfn -f a -o b -p c -h d unknown-user" 1
rlPhaseEnd
rlPhaseStartCleanup
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

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

View 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);

View 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) {

View 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);

View 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);

View 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 */

View 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.

View 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

View 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;

View 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

View 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 */

View 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));

View 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

View 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

View 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 }
};

View 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).

View 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)

View 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

View 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:

View 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) &&

View 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;

View 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

View 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);
}
}

View 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;
}

View file

@ -1,6 +0,0 @@
#%PAM-1.0
auth sufficient pam_rootok.so
auth include system-auth
account include system-auth
password include system-auth
session include system-auth

View file

@ -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

View file

@ -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

View file

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

View file

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

View file

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

View file

@ -1,15 +0,0 @@
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth substack system-auth
auth include postlogin
account sufficient pam_succeed_if.so uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session include postlogin
session optional pam_xauth.so

File diff suppressed because it is too large Load diff

View file

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