rpms/util-linux/devel util-linux-2.12p-execl.patch, NONE, 1.1 util-linux-2.12p-mount-ocfs2.patch, NONE, 1.1 util-linux-2.13-agetty-man.patch, NONE, 1.1 util-linux-2.13-arch.patch, NONE, 1.1 util-linux-2.13-audit-hwclock.patch, NONE, 1.1 util-linux-2.13-ctty3.patch, NONE, 1.1 util-linux-2.13-fdisk-gpt.patch, NONE, 1.1 util-linux-2.13-init.patch, NONE, 1.1 util-linux-2.13-moretc.patch, NONE, 1.1 util-linux-2.13-nfsv4.patch, NONE, 1.1 util-linux-chsh-chfn.pamd, NONE, 1.1 .cvsignore, 1.13, 1.14 sources, 1.13, 1.14 util-linux-selinux.pamd, 1.2, 1.3 util-linux.spec, 1.77, 1.78 util-linux-2.11r-ctty3.patch, 1.1, NONE util-linux-2.12a-moretc.patch, 1.1, NONE util-linux-2.12j-143597-newgrp.patch, 1.1, NONE util-linux-2.12p-mount-man-sync.patch, 1.1, NONE util-linux-2.12p-newgrp-disable.patch, 1.1, NONE util-linux-2.12p-nfsv4.patch, 1.1, NONE util-linux-2.12p-sfdisk-fgets.patch, 1.1, NONE util-linux-2.7-chfn.pamd, 1.2, NONE util-linux-2.7-chsh.pamd, 1.2, NONE util-linux-2.7-login.pamd, 1.4, NONE
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Aug 16 17:58:04 UTC 2005
Author: kzak
Update of /cvs/dist/rpms/util-linux/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv27814
Modified Files:
.cvsignore sources util-linux-selinux.pamd util-linux.spec
Added Files:
util-linux-2.12p-execl.patch
util-linux-2.12p-mount-ocfs2.patch
util-linux-2.13-agetty-man.patch util-linux-2.13-arch.patch
util-linux-2.13-audit-hwclock.patch
util-linux-2.13-ctty3.patch util-linux-2.13-fdisk-gpt.patch
util-linux-2.13-init.patch util-linux-2.13-moretc.patch
util-linux-2.13-nfsv4.patch util-linux-chsh-chfn.pamd
Removed Files:
util-linux-2.11r-ctty3.patch util-linux-2.12a-moretc.patch
util-linux-2.12j-143597-newgrp.patch
util-linux-2.12p-mount-man-sync.patch
util-linux-2.12p-newgrp-disable.patch
util-linux-2.12p-nfsv4.patch
util-linux-2.12p-sfdisk-fgets.patch util-linux-2.7-chfn.pamd
util-linux-2.7-chsh.pamd util-linux-2.7-login.pamd
Log Message:
- /usr/share/misc/getopt/* -move-> /usr/share/doc/util-linux-2.13/getopt-*
- the arch command marked as deprecated
- removed: elvtune, rescuept and setfdprm
- removed: man8/sln.8 (moved to man-pages, see #10601)
- removed REDAME.pg and README.reset
- .spec file cleanup
- added schedutils (commands: chrt, ionice and taskset)
util-linux-2.12p-execl.patch:
login-utils/agetty.c | 2 +-
misc-utils/script.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
--- NEW FILE util-linux-2.12p-execl.patch ---
--- 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();
util-linux-2.12p-mount-ocfs2.patch:
mount.c | 140 +++++++++++++++++++++++++++++++++++-----------------------------
1 files changed, 77 insertions(+), 63 deletions(-)
--- NEW FILE util-linux-2.12p-mount-ocfs2.patch ---
--- 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. */
util-linux-2.13-agetty-man.patch:
Makefile.am | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- NEW FILE util-linux-2.13-agetty-man.patch ---
--- util-linux-2.13-pre1/login-utils/Makefile.am.agetty 2005-08-16 13:22:34.000000000 +0200
+++ util-linux-2.13-pre1/login-utils/Makefile.am 2005-08-16 13:22:45.000000000 +0200
@@ -8,7 +8,7 @@
if BUILD_AGETTY
sbin_PROGRAMS += agetty
-man_MANS += agetty
+man_MANS += agetty.8
endif
if BUILD_INIT
util-linux-2.13-arch.patch:
Makefile.am | 4 ++--
arch.1 | 34 ++++++++++++++++++++++++++++++++++
arch.c | 35 +++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 2 deletions(-)
--- NEW FILE util-linux-2.13-arch.patch ---
--- 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 at 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 at cs.unc.edu
+ * Revised: Mon Dec 20 12:29:23 1993 by faith at cs.unc.edu
+ * Copyright 1993 Rickard E. Faith (faith at 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;
+}
util-linux-2.13-audit-hwclock.patch:
Makefile.am | 3 +-
audit.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
audit.h | 34 +++++++++++++++++++++++++++++
clock.h | 7 +++++-
hwclock.c | 37 +++++++++++++++++++++++--------
kd.c | 5 ++--
rtc.c | 7 +++---
7 files changed, 146 insertions(+), 17 deletions(-)
--- NEW FILE util-linux-2.13-audit-hwclock.patch ---
--- util-linux-2.13-pre1/hwclock/hwclock.c.audit 2005-07-31 22:15:18.000000000 +0200
+++ util-linux-2.13-pre1/hwclock/hwclock.c 2005-08-12 14:36:57.000000000 +0200
@@ -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,12 @@
/* Remember what time we were invoked */
gettimeofday(&startup_time, NULL);
+ audit_fd = audit_open();
+ if (audit_fd < 0) {
+ 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 +1401,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 +1418,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 +1452,7 @@
if (rc != 0) {
fprintf(stderr, _("No usable set-to time. "
"Cannot set clock.\n"));
- exit(EX_USAGE);
+ audit_exit(EX_USAGE);
}
}
@@ -1469,11 +1484,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 +1502,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 */
--- /dev/null 2005-08-10 15:18:23.129961080 +0200
+++ util-linux-2.13-pre1/hwclock/audit.c 2005-08-12 14:36:57.000000000 +0200
@@ -0,0 +1,70 @@
+/* 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 at redhat.com>
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <libaudit.h>
+#include "audit.h"
+
+int audit_fd = -1;
+
+/*
+ * This function will log a message to the audit system using a predefined
+ * message format. Parameter usage is as follows:
+ *
+ * op - operation. "adding user", "changing finger info", "deleting group"
+ * result - 0 = "success" or 1 = "failed"
+ */
+static void audit_logger(const char *op, int result)
+{
+ char msg_buf[256]; /* Common buffer for messaging */
+ const char *success;
+ extern char *progname;
+
+ if (!result)
+ success = "success";
+ else
+ success = "failed";
+
+ /* Add some audit info & log it. */
+ snprintf(msg_buf, sizeof(msg_buf),
+ "%s: op=%s id=%u res=%s", progname, op, getuid(), success);
+ audit_send_user_message(audit_fd, AUDIT_USYS_CONFIG, msg_buf);
+ close(audit_fd);
+}
+
+static int audit_this = 0;
+void auditable_event(int i)
+{
+ audit_this = i;
+}
+
+void audit_exit(int status)
+{
+ if (audit_this)
+ audit_logger("changing system time", status);
+ exit(status);
+}
+
--- util-linux-2.13-pre1/hwclock/kd.c.audit 2005-07-31 18:01:20.000000000 +0200
+++ util-linux-2.13-pre1/hwclock/kd.c 2005-08-12 14:36:57.000000000 +0200
@@ -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;
}
--- util-linux-2.13-pre1/hwclock/Makefile.am.audit 2005-08-12 14:37:27.000000000 +0200
+++ util-linux-2.13-pre1/hwclock/Makefile.am 2005-08-12 14:50:39.000000000 +0200
@@ -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
--- /dev/null 2005-08-10 15:18:23.129961080 +0200
+++ util-linux-2.13-pre1/hwclock/audit.h 2005-08-12 14:36:57.000000000 +0200
@@ -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 at 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
--- util-linux-2.13-pre1/hwclock/clock.h.audit 2000-12-07 17:39:53.000000000 +0100
+++ util-linux-2.13-pre1/hwclock/clock.h 2005-08-12 14:36:57.000000000 +0200
@@ -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);
--- util-linux-2.13-pre1/hwclock/rtc.c.audit 2005-07-31 22:15:45.000000000 +0200
+++ util-linux-2.13-pre1/hwclock/rtc.c 2005-08-12 14:36:57.000000000 +0200
@@ -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)
util-linux-2.13-ctty3.patch:
login.c | 55 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 14 deletions(-)
--- NEW FILE util-linux-2.13-ctty3.patch ---
--- 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);
util-linux-2.13-fdisk-gpt.patch:
Makefile.am | 6 -
fdisk.8 | 5 +
fdisk.c | 15 +++
gpt.c | 287 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
gpt.h | 9 +
sfdisk.8 | 5 +
sfdisk.c | 28 +++++
7 files changed, 352 insertions(+), 3 deletions(-)
--- NEW FILE util-linux-2.13-fdisk-gpt.patch ---
--- util-linux-2.13-pre1/fdisk/fdisk.c.gpt 2005-08-12 15:24:28.000000000 +0200
+++ util-linux-2.13-pre1/fdisk/fdisk.c 2005-08-12 15:24:28.000000000 +0200
@@ -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-08-10 15:18:23.129961080 +0200
+++ util-linux-2.13-pre1/fdisk/gpt.h 2005-08-12 15:24:28.000000000 +0200
@@ -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-pre1/fdisk/Makefile.am.gpt 2005-08-12 15:24:59.000000000 +0200
+++ util-linux-2.13-pre1/fdisk/Makefile.am 2005-08-12 15:25:35.000000000 +0200
@@ -3,13 +3,13 @@
sbin_PROGRAMS = fdisk
man_MANS = fdisk.8
fdisk_SOURCES = fdisk.c llseek.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
@@ -25,4 +25,4 @@
endif
endif
-endif
\ No newline at end of file
+endif
--- util-linux-2.13-pre1/fdisk/fdisk.8.gpt 2005-08-12 15:24:28.000000000 +0200
+++ util-linux-2.13-pre1/fdisk/fdisk.8 2005-08-12 15:24:28.000000000 +0200
@@ -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-pre1/fdisk/sfdisk.8.gpt 2004-12-31 17:28:30.000000000 +0100
+++ util-linux-2.13-pre1/fdisk/sfdisk.8 2005-08-12 15:24:28.000000000 +0200
@@ -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-08-10 15:18:23.129961080 +0200
+++ util-linux-2.13-pre1/fdisk/gpt.c 2005-08-12 15:24:28.000000000 +0200
@@ -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 at 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-pre1/fdisk/sfdisk.c.gpt 2005-08-01 21:35:55.000000000 +0200
+++ util-linux-2.13-pre1/fdisk/sfdisk.c 2005-08-12 15:24:28.000000000 +0200
@@ -50,6 +50,8 @@
#include "nls.h"
#include "common.h"
+#include "gpt.h"
+
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
/*
@@ -2476,6 +2478,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);
@@ -2621,6 +2640,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)
@@ -2648,6 +2668,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)
@@ -2676,6 +2697,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);
@@ -2685,6 +2707,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)
@@ -2861,6 +2885,8 @@
z = &oldp;
+ gpt_warning(dev, 0);
+
rw = (!no_write && (arg || ac > 1));
fd = my_open(dev, rw, 0);
@@ -2934,6 +2960,8 @@
z = &oldp;
+ gpt_warning(dev, 0);
+
rw = !no_write;
fd = my_open(dev, rw, 0);
util-linux-2.13-init.patch:
Makefile.am | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
--- NEW FILE util-linux-2.13-init.patch ---
--- util-linux-2.13-pre1/login-utils/Makefile.am.init 2005-08-16 14:48:24.000000000 +0200
+++ util-linux-2.13-pre1/login-utils/Makefile.am 2005-08-16 14:48:44.000000000 +0200
@@ -97,7 +97,7 @@
endif
-
+if BUILD_INIT
install-exec-hook::
cd $(DESTDIR)$(sbindir) && ln -sf shutdown reboot
cd $(DESTDIR)$(sbindir) && ln -sf shutdown fastboot
@@ -109,4 +109,5 @@
cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 need.8
cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 display-services.8
cd $(DESTDIR)$(mandir)/man8 && ln -sf initctl.8 provide.8
+endif
util-linux-2.13-moretc.patch:
Makefile.am | 7 ++-----
more.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 51 insertions(+), 9 deletions(-)
--- NEW FILE util-linux-2.13-moretc.patch ---
--- util-linux-2.13-pre1/text-utils/Makefile.am.moretc 2005-08-01 20:11:07.000000000 +0200
+++ util-linux-2.13-pre1/text-utils/Makefile.am 2005-08-15 13:36:12.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
usrbin_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
\ No newline at end of file
--- util-linux-2.13-pre1/text-utils/more.c.moretc 2005-07-28 23:49:31.000000000 +0200
+++ util-linux-2.13-pre1/text-utils/more.c 2005-08-15 13:40:55.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) {}
util-linux-2.13-nfsv4.patch:
Makefile.am | 4
mount.8 | 75 +++
mount.c | 10
nfs.5 | 219 +++++++++
nfs4_mount.h | 82 +++
nfs4mount.c | 433 ++++++++++++++++++
nfs_mount4.h | 22
nfsmount.c | 1361 +++++++++++++++++++++++++++++++++++++++--------------------
sundries.h | 4
umount.c | 7
10 files changed, 1757 insertions(+), 460 deletions(-)
--- NEW FILE util-linux-2.13-nfsv4.patch ---
--- util-linux-2.13-pre1/mount/mount.8.nfsv4 2005-08-02 19:34:16.000000000 +0200
+++ util-linux-2.13-pre1/mount/mount.8 2005-08-12 13:32:53.000000000 +0200
@@ -384,6 +384,7 @@
.IR msdos ,
.IR ncpfs ,
.IR nfs ,
+.IR nfs4 ,
.IR ntfs ,
.IR proc ,
.IR qnx4 ,
@@ -421,7 +422,7 @@
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, smbfs, ncpfs) ad hoc code is
+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
have a separate mount program. In order to make it possible to
treat all types in a uniform way, mount will execute the program
@@ -449,9 +450,10 @@
All of the filesystem types listed there will be tried,
except for those that are labeled "nodev" (e.g.,
.IR devpts ,
-.I proc
+.IR proc ,
+.IR nfs ,
and
-.IR nfs ).
+.IR nfs4 ).
If
.I /etc/filesystems
ends in a line with a single * only, mount will read
@@ -1373,6 +1375,73 @@
.B nolock
Do not use locking. Do not start lockd.
+.SH "Mount options for nfs4"
+Instead of a textual option string, parsed by the kernel, the
+.I nfs4
+file system expects a binary argument of type
+.IR "struct nfs4_mount_data" .
+The program
+.B mount
+itself parses the following options of the form `tag=value',
+and puts them in the structure mentioned:
+.BI rsize= n,
+.BI wsize= n,
+.BI timeo= n,
+.BI retrans= n,
+.BI acregmin= n,
+.BI acregmax= n,
+.BI acdirmin= n,
+.BI acdirmax= n,
+.BI actimeo= n,
+.BI retry= n,
+.BI port= n,
+.BI proto= n,
+.BI clientaddr= n,
+.BI sec= n.
+The option
+.BI addr= n
+is accepted but ignored.
+Also the following Boolean options, possibly preceded by
+.B no
+are recognized:
+.BR bg ,
+.BR fg ,
+.BR soft ,
+.BR hard ,
+.BR intr ,
+.BR cto ,
+.BR ac ,
+For details, see
+.BR nfs (5).
+
+Especially useful options include
+.TP
+.B rsize=32768,wsize=32768
+This will make your NFS connection faster than with the default
+buffer size of 4096.
+.TP
+.B hard
+The program accessing a file on a NFS mounted file system will hang
+when the server crashes. The process cannot be interrupted or
+killed unless you also specify
+.BR intr .
+When the NFS server is back online the program will continue undisturbed
+from where it was. This is probably what you want.
+.TP
+.B soft
+This option allows the kernel to time out if the NFS server is not
+responding for some time. The time can be
+specified with
+.BR timeo=time .
+This timeout value is expressed in tenths of a second.
+The
+.BR soft
+option might be useful if your NFS server sometimes doesn't respond
+or will be rebooted while some process tries to get a file from the server.
+Avoid using this option with
+.BR proto=udp
+or with a short timeout.
+
.SH "Mount options for ntfs"
.TP
.BI iocharset= name
--- util-linux-2.13-pre1/mount/nfs.5.nfsv4 2002-06-27 23:31:33.000000000 +0200
+++ util-linux-2.13-pre1/mount/nfs.5 2005-08-12 13:32:53.000000000 +0200
@@ -3,7 +3,7 @@
.\" patches. "
.TH NFS 5 "20 November 1993" "Linux 0.99" "Linux Programmer's Manual"
.SH NAME
-nfs \- nfs fstab format and options
+nfs \- nfs and nfs4 fstab format and options
.SH SYNOPSIS
.B /etc/fstab
.SH DESCRIPTION
@@ -17,14 +17,51 @@
and the NFS specific options that control
the way the filesystem is mounted.
.P
-Here is an example from an \fI/etc/fstab\fP file from an NFS mount.
+Three different versions of the NFS protocol are
+supported by the Linux NFS client:
+NFS version 2, NFS version 3, and NFS version 4.
+To mount via NFS version 2, use the
+.BR nfs
+file system type and specify
+.BR nfsvers=2 .
+Version 2 is the default protocol version for the
+.BR nfs
+file system type when
+.BR nfsvers=
+is not specified on the mount command.
+To mount via NFS version 3, use the
+.BR nfs
+file system type and specify
+.BR nfsvers=3 .
+To mount via NFS version 4, use the
+.BR nfs4
+file system type.
+The
+.BR nfsvers=
+keyword is not supported for the
+.BR nfs4
+file system type.
+.P
+These file system types share similar mount options;
+the differences are listed below.
+.P
+Here is an example from an \fI/etc/fstab\fP file for an NFSv2 mount
+over UDP.
.sp
.nf
.ta 2.5i +0.75i +0.75i +1.0i
server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr
.fi
+.P
+Here is an example for an NFSv4 mount over TCP using Kerberos
+5 mutual authentication.
+.sp
+.nf
+.ta 2.5i +0.75i +0.75i +1.0i
+server:/usr/local/pub /pub nfs4 proto=tcp,sec=krb5,hard,intr
+.fi
.DT
-.SS Options
+.SS Options for the nfs file system type
.TP 1.5i
.I rsize=n
The number of bytes NFS uses when reading files from an NFS server.
@@ -128,7 +165,7 @@
Use an alternate RPC version number to contact the
mount daemon on the remote host. This option is useful
for hosts that can run multiple NFS servers.
-The default value is version 1.
+The default value depends on which kernel you are using.
.TP 1.5i
.I nfsprog=n
Use an alternate RPC program number to contact the
@@ -141,7 +178,7 @@
Use an alternate RPC version number to contact the
NFS daemon on the remote host. This option is useful
for hosts that can run multiple NFS servers.
-The default value is version 2.
+The default value depends on which kernel you are using.
.TP 1.5i
.I nolock
Disable NFS locking. Do not start lockd.
@@ -193,9 +230,25 @@
.TP 1.5i
.I noac
Disable all forms of attribute caching entirely. This extracts a
-server performance penalty but it allows two different NFS clients
-to get reasonable good results when both clients are actively
-writing to common filesystem on the server.
+significant performance penalty but it allows two different NFS clients
+to get reasonable results when both clients are actively
+writing to a common export on the server.
[...2203 lines suppressed...]
- /* clean up */
+ out_ok:
+ /* Ensure we have enough padding for the following strcat()s */
+ if (strlen(new_opts) + strlen(s) + 30 >= sizeof(new_opts)) {
+ fprintf(stderr, _("mount: "
+ "excessively long option argument\n"));
+ goto fail;
+ }
+
+ sprintf(cbuf, "addr=%s", s);
+ strcat(new_opts, cbuf);
- auth_destroy(mclient->cl_auth);
- clnt_destroy(mclient);
- close(msock);
+ *extra_opts = xstrdup(new_opts);
return 0;
/* abort */
-
fail:
- if (msock != -1) {
- if (mclient) {
- auth_destroy(mclient->cl_auth);
- clnt_destroy(mclient);
- }
- close(msock);
- }
if (fsock != -1)
close(fsock);
return retval;
-}
+}
+
+static inline enum clnt_stat
+nfs3_umount(dirpath *argp, CLIENT *clnt)
+{
+ static char clnt_res;
+ memset (&clnt_res, 0, sizeof(clnt_res));
+ return clnt_call(clnt, MOUNTPROC_UMNT,
+ (xdrproc_t) xdr_dirpath, (caddr_t)argp,
+ (xdrproc_t) xdr_void, (caddr_t) &clnt_res,
+ TIMEOUT);
+}
+
+static inline enum clnt_stat
+nfs2_umount(dirpath *argp, CLIENT *clnt)
+{
+ static char clnt_res;
+ memset (&clnt_res, 0, sizeof(clnt_res));
+ return clnt_call(clnt, MOUNTPROC_UMNT,
+ (xdrproc_t) xdr_dirpath, (caddr_t)argp,
+ (xdrproc_t) xdr_void, (caddr_t) &clnt_res,
+ TIMEOUT);
+}
+
+static int
+nfs_call_umount(clnt_addr_t *mnt_server, dirpath *argp)
+{
+ CLIENT *clnt;
+ enum clnt_stat res = 0;
+ int msock;
+
+ clnt = mnt_openclnt(mnt_server, &msock, 1);
+ if (!clnt)
+ goto out_bad;
+ switch (mnt_server->pmap.pm_vers) {
+ case 3:
+ res = nfs3_umount(argp, clnt);
+ break;
+ case 2:
+ case 1:
+ res = nfs2_umount(argp, clnt);
+ break;
+ default:
+ break;
+ }
+ mnt_closeclnt(clnt, msock);
+ if (res == RPC_SUCCESS)
+ return 1;
+ out_bad:
+ return 0;
+}
+
+int
+nfsumount(const char *spec, const char *opts)
+{
+ char *hostname;
+ char *dirname;
+ clnt_addr_t mnt_server = { &hostname, };
+ struct pmap *pmap = &mnt_server.pmap;
+ char *p;
+
+ nfs_mount_version = find_kernel_nfs_mount_version();
+ if (spec == NULL || (p = strchr(spec,':')) == NULL)
+ goto out_bad;
+ hostname = xstrndup(spec, p-spec);
+ dirname = xstrdup(p+1);
+#ifdef NFS_MOUNT_DEBUG
+ printf(_("host: %s, directory: %s\n"), hostname, dirname);
+#endif
+
+ if (opts && (p = strstr(opts, "addr="))) {
+ char *q;
+
+ free(hostname);
+ p += 5;
+ q = p;
+ while (*q && *q != ',') q++;
+ hostname = xstrndup(p,q-p);
+ }
+
+ if (opts && (p = strstr(opts, "mounthost="))) {
+ char *q;
+
+ free(hostname);
+ p += 10;
+ q = p;
+ while (*q && *q != ',') q++;
+ hostname = xstrndup(p,q-p);
+ }
+
+ pmap->pm_prog = MOUNTPROG;
+ pmap->pm_vers = MOUNTVERS;
+ if (opts && (p = strstr(opts, "mountprog=")) && isdigit(*(p+10)))
+ pmap->pm_prog = atoi(p+10);
+ if (opts && (p = strstr(opts, "mountport=")) && isdigit(*(p+10)))
+ pmap->pm_port = atoi(p+10);
+ if (opts && (p = strstr(opts, "nfsvers=")) && isdigit(*(p+8)))
+ pmap->pm_vers = nfsvers_to_mnt(atoi(p+8));
+ if (opts && (p = strstr(opts, "mountvers=")) && isdigit(*(p+10)))
+ pmap->pm_vers = atoi(p+10);
+
+ if (!nfs_gethostbyname(hostname, &mnt_server.saddr))
+ goto out_bad;
+ if (!probe_mntport(&mnt_server))
+ goto out_bad;
+ return nfs_call_umount(&mnt_server, &dirname);
+ out_bad:
+ return 0;
+}
/*
* We need to translate between nfs status return values and
--- util-linux-2.13-pre1/mount/nfs_mount4.h.nfsv4 2000-10-14 16:20:51.000000000 +0200
+++ util-linux-2.13-pre1/mount/nfs_mount4.h 2005-08-12 13:32:53.000000000 +0200
@@ -8,7 +8,9 @@
* so it is easiest to ignore the kernel altogether (at compile time).
*/
-#define NFS_MOUNT_VERSION 4
+#define NFS_MOUNT_VERSION 6
+#define NFS_MAX_CONTEXT_LEN 256
+
struct nfs2_fh {
char data[32];
@@ -36,6 +38,9 @@
int namlen; /* 2 */
unsigned int bsize; /* 3 */
struct nfs3_fh root; /* 4 */
+ int pseudoflavor; /* 5 */
+ char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */
+
};
/* bits in the flags field */
@@ -51,4 +56,19 @@
#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
+#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
+
+/* security pseudoflavors */
+
+#ifndef AUTH_GSS_KRB5
+#define AUTH_GSS_KRB5 390003
+#define AUTH_GSS_KRB5I 390004
+#define AUTH_GSS_KRB5P 390005
+#define AUTH_GSS_LKEY 390006
+#define AUTH_GSS_LKEYI 390007
+#define AUTH_GSS_LKEYP 390008
+#define AUTH_GSS_SPKM 390009
+#define AUTH_GSS_SPKMI 390010
+#define AUTH_GSS_SPKMP 390011
+#endif
--- util-linux-2.13-pre1/mount/sundries.h.nfsv4 2005-07-29 01:07:31.000000000 +0200
+++ util-linux-2.13-pre1/mount/sundries.h 2005-08-12 14:04:39.000000000 +0200
@@ -37,6 +37,10 @@
int nfsmount (const char *spec, const char *node, int *flags,
char **orig_opts, char **opt_args, int *version, int running_bg);
+int nfs4mount (const char *spec, const char *node, int *flags,
+ char **orig_opts, char **opt_args, int running_bg);
+int nfsumount(const char *spec, const char *opts);
+
/* exit status - bits below are ORed */
#define EX_USAGE 1 /* incorrect invocation or permission */
#define EX_SYSERR 2 /* out of memory, cannot fork, ... */
--- NEW FILE util-linux-chsh-chfn.pamd ---
#%PAM-1.0
auth sufficient pam_rootok.so
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth
session required pam_stack.so service=system-auth
Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/.cvsignore,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- .cvsignore 23 Dec 2004 20:25:22 -0000 1.13
+++ .cvsignore 16 Aug 2005 17:58:01 -0000 1.14
@@ -1,6 +1,4 @@
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
+util-linux-2.13-pre1.tar.bz2
Index: sources
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/sources,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- sources 23 Dec 2004 20:25:22 -0000 1.13
+++ sources 16 Aug 2005 17:58:01 -0000 1.14
@@ -1,4 +1,4 @@
d3912b9f7bf745fbfea68f6a9b9de30f cramfs-1.1.tar.gz
7d3ac81855e26687dada6a31d2677875 floppy-0.12.tar.gz
555e4bd2a23347fddac4268cbf4e1fe4 kbdrate.tar.gz
-d47e820f6880c21c8b4c0c7e8a7376cc util-linux-2.12p.tar.gz
+d65154c41657f7bcb1b2025cdbe588a7 util-linux-2.13-pre1.tar.bz2
Index: util-linux-selinux.pamd
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux-selinux.pamd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util-linux-selinux.pamd 13 Sep 2004 20:58:25 -0000 1.2
+++ util-linux-selinux.pamd 16 Aug 2005 17:58:01 -0000 1.3
@@ -7,6 +7,8 @@
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_stack.so service=system-auth
+session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should be the last session rule
session required pam_selinux.so multiple open
+
Index: util-linux.spec
===================================================================
RCS file: /cvs/dist/rpms/util-linux/devel/util-linux.spec,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- util-linux.spec 18 Jun 2005 09:20:18 -0000 1.77
+++ util-linux.spec 16 Aug 2005 17:58:01 -0000 1.78
@@ -1,36 +1,38 @@
# Rules for hacking:
-# When you add a patch to fix a bug, include the bug number in its filename.
+# - when adding patches, please make sure that it is easy to find out what bug ID
+# patch fixes. Tip: cut&past bug title with bug ID from bugzilla.
+#
+# Notes:
+# - upstream maintainer Adrian Bunk <bunk at kernel.org>
#
# TODO:
-# Investigate turning on HAVE_BLKID - it's the right idea, it just needs verifying.
+# - remove deprecated (since release 2.13) the arch command
#
-# Upstream maintainer Adrian Bunk <bunk at stusta.de>
-# 'raw' support is deprecated, only ship it if we need compatibility stuff.
+### Features
%define include_raw 0
-
-%if %{include_raw}
-%define raw_options ADD_RAW=yes
-%else
-%define raw_options %{nil}
-%endif
-
-%define make_options HAVE_BLKID=yes HAVE_PIVOT_ROOT=yes HAVE_PAM=yes HAVE_SHADOW=no HAVE_PASSWD=yes ALLOW_VCS_USE=no %{raw_options} HAVE_SLANG=yes HAVE_SELINUX=yes SLANGFLAGS=-I/usr/include/slang INSTALLSUID='$(INSTALL) -m $(SUIDMODE)' USE_TTY_GROUP=no
-%define make_cflags -DUSE_TTY_GROUP -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-
%define with_kbdrate 0
+
+### Macros
%define floppyver 0.12
%define cramfsver 1.1
%define no_hwclock_archs s390 s390x
%define cytune_archs %{ix86} alpha armv4l
+### Paths
+BuildRoot: %{_tmppath}/%{name}-root
+# see build section for _prefix
+
+### Header
+# note: this is experimental unstable package. See "TODO [stable]" notes. -- kzak
Summary: A collection of basic system utilities.
Name: util-linux
-Version: 2.12p
-Release: 10
+Version: 2.13
+Release: 0.1.pre1
License: distributable
Group: System Environment/Base
+### Dependences
BuildRequires: sed
BuildRequires: pam-devel
BuildRequires: ncurses-devel
@@ -41,34 +43,50 @@
BuildRequires: gettext
BuildRequires: libselinux-devel
BuildRequires: e2fsprogs-devel >= 1.36
+BuildRequires: audit-libs-devel
-Source0: ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/util-linux-%{version}.tar.gz
+### Sources
+# TODO [stable]: s/2.13-pre1/%{version}/
+Source0: ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/util-linux-2.13-pre1.tar.bz2
Source1: util-linux-selinux.pamd
-Source4: util-linux-2.7-login.pamd
-Source2: util-linux-2.7-chfn.pamd
-Source3: util-linux-2.7-chsh.pamd
+Source2: util-linux-chsh-chfn.pamd
Source8: nologin.c
Source9: nologin.8
Source10: kbdrate.tar.gz
Source11: http://download.sourceforge.net/floppyutil/floppy-%{floppyver}.tar.gz
Source12: http://download.sourceforge.net/cramfs/cramfs-%{cramfsver}.tar.gz
-##### Red Hat Linux-specific patches
-# Not really RH-specific
-Patch: util-linux-2.12a-moretc.patch
+### Obsoletes & Conflicts & Provides
+Obsoletes: fdisk tunelp mount losetup schedutils
+%ifarch alpha sparc sparc64 sparcv9 s390
+Obsoletes: clock
+%endif
+%ifarch alpha
+Conflicts: initscripts <= 4.58, timeconfig <= 3.0.1
+%endif
+Requires: pam >= 0.66-4, /etc/pam.d/system-auth
+%if %{with_kbdrate}
+Requires: usermode
+%endif
+Conflicts: kernel < 2.2.12-7,
+Prereq: /sbin/install-info
+Provides: mount = %{version}
+Provides: losetup = %{version}
+Provides: schedutils
+### Patches
+# let's use -ltermcap from the more command
+Patch1: util-linux-2.13-moretc.patch
# Reduce MAX_PARTS to 16 (upstream reasonably won't take it)
Patch70: util-linux-2.12a-partlimit.patch
-
# Note on how to set up raw device mappings using RHL /etc/sysconfig/rawdevices
Patch109: util-linux-2.11f-rawman.patch
-######## Patches that should be upstream eventually
Patch100: util-linux-2.12j-managed.patch
Patch106: util-linux-2.12p-swaponsymlink-57300.patch
Patch107: util-linux-2.11y-procpartitions-37436.patch
-Patch113: util-linux-2.11r-ctty3.patch
+Patch113: util-linux-2.13-ctty3.patch
Patch120: util-linux-2.11y-skipraid2.patch
Patch126: util-linux-2.11y-multibyte.patch
@@ -88,23 +106,15 @@
# Patch to enabled remote service for login/pam (#91174)
Patch157: util-linux-2.12a-pamstart.patch
-
# Patch to enable the pamconsole flag for restricting mounting to users at the console (#133941)
Patch159: util-linux-2.12j-pamconsole.patch
-
# Allow raw(8) to bind raw devices whose device nodes do not yet exist.
Patch160: raw-handle-nonpresent-devs.patch
Patch164: util-linux-2.12j-113790-hotkeys.patch
-# newgrp disabled
-#Patch168: util-linux-2.12j-143597-newgrp.patch
-
-# disable newgrp, in shadow-utils is better implementation (#149997, #151613)
-Patch169: util-linux-2.12p-newgrp-disable.patch
-
# patches required for NFSv4 support
-Patch170: util-linux-2.12p-nfsv4.patch
+Patch170: util-linux-2.13-nfsv4.patch
Patch171: util-linux-2.12a-mount-proto.patch
Patch172: util-linux-2.12a-nfsmount-overflow.patch
Patch173: util-linux-2.12a-nfsmount-reservp.patch
@@ -130,32 +140,24 @@
Patch188: util-linux-2.12p-look-separator.patch
# 157656 - CRM 546998 : Possible bug in vipw, changes permissions of /etc/shadow
Patch189: util-linux-2.12p-vipw-perm.patch
-# 159418 â sfdisk unusable - crashes immediately on invocation
-Patch200: util-linux-2.12p-sfdisk-fgets.patch
-# 157674 â sync option on VFAT mount destroys flash drives
-Patch201: util-linux-2.12p-mount-man-sync.patch
+# 159339 - util-linux updates for new audit system
+Patch202: util-linux-2.13-audit-hwclock.patch
+# 158737 - sfdisk warning for large partitions, gpt
+Patch203: util-linux-2.13-fdisk-gpt.patch
+# 150912 - Add ocfs2 support
+Patch204: util-linux-2.12p-mount-ocfs2.patch
+# NULL is better than zero at end of execl()
+Patch205: util-linux-2.12p-execl.patch
+# deprecated the arch command (for compatibility only)
+Patch206: util-linux-2.13-arch.patch
+# upstream mistakes
+Patch207: util-linux-2.13-agetty-man.patch
+Patch208: util-linux-2.13-init.patch
# When adding patches, please make sure that it is easy to find out what bug # the
# patch fixes.
########### END upstreamable
-Obsoletes: fdisk tunelp
-%ifarch alpha sparc sparc64 sparcv9 s390
-Obsoletes: clock
-%endif
-%ifarch alpha
-Conflicts: initscripts <= 4.58, timeconfig <= 3.0.1
-%endif
-BuildRoot: %{_tmppath}/%{name}-root
-Requires: pam >= 0.66-4, /etc/pam.d/system-auth
-%if %{with_kbdrate}
-Requires: usermode
-%endif
-Conflicts: kernel < 2.2.12-7,
-Prereq: /sbin/install-info
-Obsoletes: mount losetup
-Provides: mount = %{version}
-Provides: losetup = %{version}
%description
The util-linux package contains a large variety of low-level system
@@ -163,97 +165,47 @@
others, Util-linux contains the fdisk configuration tool and the login
program.
-%if 0
-%package -n mount
-Group: System Environment/Base
-Summary: Programs for mounting and unmounting filesystems.
-ExclusiveOS: Linux
-
-%description -n mount
-The mount package contains the mount, umount, swapon, and swapoff
-programs. Accessible files on your system are arranged in one big tree
-or hierarchy. These files can be spread out over several devices. The
-mount command attaches a filesystem on some device to your system's
-file tree. The umount command detaches a filesystem from the
-tree. Swapon and swapoff, respectively, specify and disable devices
-and files for paging and swapping.
-
-%package -n losetup
-Summary: Programs for setting up and configuring loopback devices.
-Group: System Environment/Base
-
-%description -n losetup
-Linux supports a special block device called the loop device, which
-maps a normal file onto a virtual block device. This allows for the
-file to be used as a "virtual file system" inside another file.
-Losetup is used to associate loop devices with regular files or block
-devices, to detach loop devices and to query the status of a loop
-device.
-%endif
-
%prep
+# TODO [stable]: remove -n
+%setup -q -a 10 -a 11 -a 12 -n util-linux-2.13-pre1
-%setup -q -a 10 -a 11 -a 12
-
-%patch0 -p1
-
+%patch1 -p1 -b .moretc
%patch70 -p1
-
# nologin
cp %{SOURCE8} %{SOURCE9} .
-
%patch100 -p1
-
-sed -e 's:^MAN_DIR=.*:MAN_DIR=%{_mandir}:' -e 's:^INFO_DIR=.*:INFO_DIR=%{_infodir}:' MCONFIG > MCONFIG.new
-mv MCONFIG.new MCONFIG
-
%patch106 -p1
%patch107 -p1
%if %{include_raw}
%patch109 -p1
%endif
-
-%patch113 -p1
+%patch113 -p1 -b .ctty3
%patch120 -p1
-
%patch126 -p1
%patch128 -p1
-
%patch138 -p1
%patch139 -p1
-
# cramfs
%patch143 -p0
%patch144 -p1
-
%patch147 -p1
%patch150 -p0
-
%patch151 -p1
%patch153 -p1
%patch157 -p1 -b .pamstart
%patch159 -p1 -b .console
-
%if %{include_raw}
%patch160 -p1
%endif
-
%patch164 -p1
-
-# newgrp disabled
-#%patch168 -p1
-
-%patch169 -p1
%patch170 -p1 -b .nfsv4
%patch171 -p1
%patch172 -p1
%patch173 -p1
%patch174 -p1
-
%patch180 -p1 -b .lastlog
%patch181 -p1
%patch182 -p1 -b .typo
-
%patch183 -p1
%patch184 -p1
%patch185 -p1
@@ -261,39 +213,70 @@
%patch187 -p1
%patch188 -p1
%patch189 -p1
-%patch200 -p1
-%patch201 -p1
+%patch202 -p1 -b .audit
+%patch203 -p1 -b .gpt
+%patch204 -p1
+%patch205 -p1
+%patch206 -p1
+%patch207 -p1
+%patch208 -p1
%build
unset LINGUAS || :
-%configure
+# rebuild build system
+aclocal
+automake -a
+autoconf
+
+# CFLAGS
+%define make_cflags -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+# note: we install to /bin and /usr/bin, so there's $bindir and $usrbindir in
+# util-linux build system. It's better follow package build-system than rpm
+# macros (where is prefix=/usr)
+%define _prefix ""
+
+# configure
+export CFLAGS="%{make_cflags} $RPM_OPT_FLAGS" %{?_smp_mflags}
+%configure \
+ --disable-wall \
+ --enable-partx \
+ --enable-login-utils \
+ --enable-kill \
+ --enable-write \
+%if %{include_raw}
+ --enable-raw \
+%endif
+ --enable-rdev
+
+# reset to original
+%define _prefix /usr
-make OPT="$RPM_OPT_FLAGS %{make_cflags}" \
- LDFLAGS="" \
- %{make_options} \
- %{?_smp_mflags}
-make LDFLAGS="" CFLAGS="$RPM_OPT_FLAGS" -C partx %{?_smp_mflags}
-cd rescuept
-cc -D_FILE_OFFSET_BITS=64 $RPM_OPT_FLAGS -o rescuept rescuept.c
-cd ..
+# build util-linux
+make
+# build kbdrate
%if %{with_kbdrate}
pushd kbdrate
cc $RPM_OPT_FLAGS -o kbdrate kbdrate.c
popd
%endif
+# build floppy stuff
pushd floppy-%{floppyver}
# We have to disable floppygtk somehow...
%configure --with-gtk-prefix=/asfd/jkl
make %{?_smp_mflags}
popd
+# build cramfs 1.1
make -C cramfs-%{cramfsver} %{?_smp_mflags}
+# build nologin
gcc $RPM_OPT_FLAGS -o nologin nologin.c
+# build docs
pushd sys-utils
makeinfo --number-sections ipc.texi
popd
@@ -310,44 +293,35 @@
touch %{buildroot}/var/log/lastlog
chmod 0400 %{buildroot}/var/log/lastlog
-make \
- OPT="$RPM_OPT_FLAGS %{make_cflags}" \
- LDFLAGS="" \
- %{make_options} \
- INSTALLDIR="install -d -m 755" \
- INSTALLSUID="install -m 755" \
- INSTALLBIN="install -m 755" \
- INSTALLMAN="install -m 644" \
- install DESTDIR=${RPM_BUILD_ROOT}
+# install util-linux
+make install DESTDIR=${RPM_BUILD_ROOT}
+
+# inslall floppy stuff
pushd floppy-%{floppyver}
%makeinstall
popd
+# install cramfs 1.1
pushd cramfs-%{cramfsver}
install -s -m 755 mkcramfs ${RPM_BUILD_ROOT}/sbin/mkfs.cramfs
ln -s ../../sbin/mkfs.cramfs ${RPM_BUILD_ROOT}/usr/bin/mkcramfs
install -s -m 755 cramfsck ${RPM_BUILD_ROOT}/sbin/fsck.cramfs
popd
-install -m 755 mount/pivot_root ${RPM_BUILD_ROOT}/sbin
-install -m 644 mount/pivot_root.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
-install -m 755 rescuept/rescuept ${RPM_BUILD_ROOT}/sbin
-mv rescuept/README rescuept/README.rescuept
+# install no login
install -m 755 nologin ${RPM_BUILD_ROOT}/sbin
install -m 644 nologin.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
+
%if %{with_kbdrate}
install -m 755 kbdrate/kbdrate ${RPM_BUILD_ROOT}/sbin
install -m 644 kbdrate/kbdrate.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
ln -s consolehelper ${RPM_BUILD_ROOT}/usr/bin/kbdrate
%endif
+
%if %{include_raw}
echo '.so man8/raw.8' > $RPM_BUILD_ROOT%{_mandir}/man8/rawdevices.8
-%else
-rm -f $RPM_BUILD_ROOT%{_bindir}/raw $RPM_BUILD_ROOT%{_mandir}/man8/raw.8*
%endif
-install -m 755 partx/{addpart,delpart,partx} $RPM_BUILD_ROOT/sbin
-
# Correct mail spool path.
sed -e 's,/usr/spool/mail,/var/spool/mail,g' ${RPM_BUILD_ROOT}%{_mandir}/man1/login.1 > ${RPM_BUILD_ROOT}%{_mandir}/man1/login.1.new
mv ${RPM_BUILD_ROOT}%{_mandir}/man1/login.1.new ${RPM_BUILD_ROOT}%{_mandir}/man1/login.1
@@ -381,23 +355,20 @@
install -m644 kbdrate/kbdrate.apps $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/kbdrate
install -m644 kbdrate/kbdrate.pam $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/kbdrate
%endif
+
+# PAM settings
{
pushd ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d
install -m 644 %{SOURCE1} ./login
install -m 644 %{SOURCE1} ./remote
- install -m 644 ${RPM_SOURCE_DIR}/util-linux-2.7-chsh.pamd ./chsh
- install -m 644 ${RPM_SOURCE_DIR}/util-linux-2.7-chsh.pamd ./chfn
+ install -m 644 %{SOURCE2} ./chsh
+ install -m 644 %{SOURCE2} ./chfn
popd
}
ln -sf ../../sbin/hwclock ${RPM_BUILD_ROOT}/usr/sbin/hwclock
-# we needn't /usr/sbin/clock in 'install' section if we ignore it in 'files' section [24-Jun-2005, Karel Zak]
-#ln -sf ../../sbin/clock ${RPM_BUILD_ROOT}/usr/sbin/clock
ln -sf hwclock ${RPM_BUILD_ROOT}/sbin/clock
-# We do not want dependencies on csh
-chmod 644 ${RPM_BUILD_ROOT}%{_datadir}/misc/getopt/*
-rm -f fdisk/README.cfdisk
# Final cleanup
%ifnarch %cytune_archs
@@ -407,21 +378,50 @@
rm -f $RPM_BUILD_ROOT/sbin/{hwclock,clock} $RPM_BUILD_ROOT%{_mandir}/man8/hwclock.8* $RPM_BUILD_ROOT/usr/sbin/{hwclock,clock}
%endif
%ifarch s390 s390x
-rm -f $RPM_BUILD_ROOT/usr/{bin,sbin}/{fdformat,tunelp,floppy,setfdprm} $RPM_BUILD_ROOT%{_mandir}/man8/{fdformat,tunelp,floppy,setfdprm}.8*
+rm -f $RPM_BUILD_ROOT/usr/{bin,sbin}/{fdformat,tunelp,floppy} $RPM_BUILD_ROOT%{_mandir}/man8/{fdformat,tunelp,floppy}.8*
rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/fdprm
%endif
-for I in /sbin/cfdisk /sbin/fsck.minix /sbin/mkfs.{bfs,minix} /sbin/sln /usr/bin/chkdupexe \
- %{_bindir}/line %{_bindir}/pg; do
+# deprecated commands
+for I in /sbin/cfdisk /sbin/fsck.minix /sbin/mkfs.{bfs,minix} /sbin/sln \
+ /usr/bin/chkdupexe %{_bindir}/line %{_bindir}/pg %{_bindir}/newgrp \
+ /sbin/shutdown %{_bindir}/wall %{_bindir}/scriptreplay; do
rm -f $RPM_BUILD_ROOT$I
done
-for I in man1/chkdupexe.1 man1/line.1 man1/pg.1 man8/cfdisk.8 man8/fsck.minix.8 man8/mkfs.minix.8 man8/mkfs.bfs.8; do
+# deprecated man pages
+for I in man1/chkdupexe.1 man1/line.1 man1/pg.1 man1/newgrp.1 man8/cfdisk.8 \
+ man8/fsck.minix.8 man8/mkfs.minix.8 man8/mkfs.bfs.8 man1/wall.1; do
rm -rf $RPM_BUILD_ROOT%{_mandir}/${I}*
done
+# deprecated docs
+for I in fdisk/README.cfdisk text-utils/README.pg text-utils/README.reset; do
+ rm -rf $I
+done
+
+# we install getopt/getopt-*.{bash,tcsh} as doc files
+# note: versions <=2.12 use path "%{_datadir}/misc/getopt/*"
+chmod 644 getopt/getopt-*.{bash,tcsh}
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/getopt/*
+rmdir ${RPM_BUILD_ROOT}%{_datadir}/getopt
+
ln -sf ../../bin/kill $RPM_BUILD_ROOT%{_bindir}/kill
+# /bin -> /sbin
+for I in pivot_root losetup swapon swapoff; do
+ if [ -e $RPM_BUILD_ROOT/bin/$I -o -h $RPM_BUILD_ROOT/bin/$I ]; then
+ mv $RPM_BUILD_ROOT/bin/$I $RPM_BUILD_ROOT/sbin/$I
+ fi
+done
+
+# /usr/sbin -> /sbin
+for I in addpart delpart partx; do
+ if [ -e $RPM_BUILD_ROOT/usr/sbin/$I ]; then
+ mv $RPM_BUILD_ROOT/usr/sbin/$I $RPM_BUILD_ROOT/sbin/$I
+ fi
+done
+
%find_lang %{name}
%clean
@@ -440,7 +440,8 @@
%files -f %{name}.lang
%defattr(-,root,root)
-%doc */README.* HISTORY MAINTAINER
+%doc */README.* NEWS AUTHORS
+%doc getopt/getopt-*.{bash,tcsh}
/bin/arch
/bin/dmesg
@@ -461,7 +462,6 @@
/sbin/blockdev
/sbin/pivot_root
/sbin/ctrlaltdel
-/sbin/elvtune
/sbin/addpart
/sbin/delpart
/sbin/partx
@@ -480,7 +480,6 @@
%endif
/sbin/mkfs
/sbin/mkswap
-/sbin/rescuept
/sbin/nologin
%{_mandir}/man8/nologin.8*
%ghost %attr(0400,root,root) %verify(not md5 size mtime) /var/log/lastlog
@@ -494,6 +493,10 @@
%{_sysconfdir}/security/console.apps/kbdrate
%endif
+%{_bindir}/chrt
+%{_bindir}/ionice
+%{_bindir}/taskset
+
%{_bindir}/cal
%attr(4711,root,root) %{_bindir}/chfn
%attr(4711,root,root) %{_bindir}/chsh
@@ -528,9 +531,6 @@
%endif
%{_bindir}/namei
-# newgrp disabled
-#%attr(4711,root,root) %{_bindir}/newgrp
-
%if %{include_raw}
%{_bindir}/raw
%endif
@@ -538,9 +538,6 @@
%{_bindir}/renice
%{_bindir}/rev
%{_bindir}/script
-%ifnarch s390 s390x
-%{_bindir}/setfdprm
-%endif
%{_bindir}/setsid
%{_bindir}/setterm
%ifarch sparc sparc64 sparcv9
@@ -589,10 +586,6 @@
%{_mandir}/man1/mcookie.1*
%{_mandir}/man1/more.1*
%{_mandir}/man1/namei.1*
-
-# newgrp disabled
-#%{_mandir}/man1/newgrp.1*
-
%{_mandir}/man1/readprofile.1*
%{_mandir}/man1/rename.1*
%{_mandir}/man1/rev.1*
@@ -603,10 +596,13 @@
%{_mandir}/man1/whereis.1*
%{_mandir}/man1/write.1*
+%{_mandir}/man1/chrt.1*
+%{_mandir}/man1/ionice.1*
+%{_mandir}/man1/taskset.1*
+
%{_mandir}/man8/blockdev.8*
%{_mandir}/man8/ctrlaltdel.8*
%{_mandir}/man8/dmesg.8*
-%{_mandir}/man8/elvtune.8*
%ifnarch s390 s390x
%{_mandir}/man8/fdformat.8*
%endif
@@ -621,22 +617,13 @@
%{_mandir}/man8/rawdevices.8*
%endif
%{_mandir}/man8/renice.8*
-%ifnarch s390 s390x
-%{_mandir}/man8/setfdprm.8*
-%endif
%{_mandir}/man8/setsid.8*
-# XXX this man page should be moved to glibc.
-%{_mandir}/man8/sln.8*
%ifnarch s390 s390x
%{_mandir}/man8/tunelp.8*
%endif
%{_mandir}/man8/vigr.8*
%{_mandir}/man8/vipw.8*
-%{_datadir}/misc/getopt
-
-#files -n mount
-#defattr(-,root,root)
%attr(4755,root,root) /bin/mount
%attr(4755,root,root) /bin/umount
/sbin/swapon
@@ -647,14 +634,26 @@
%{_mandir}/man8/swapoff.8*
%{_mandir}/man8/swapon.8*
%{_mandir}/man8/umount.8*
-
-#files -n losetup
-#defattr(-,root,root)
%{_mandir}/man8/losetup.8*
/sbin/losetup
%changelog
-* Thu Jun 16 2005 Karel Zak <kzak at redhat.com> 2.12p-10
+* Tue Aug 16 2005 Karel Zak <kzak at redhat.com> 2.13-0.1.pre1
+- /usr/share/misc/getopt/* -move-> /usr/share/doc/util-linux-2.13/getopt-*
+- the arch command marked as deprecated
+- removed: elvtune, rescuept and setfdprm
+- removed: man8/sln.8 (moved to man-pages, see #10601)
+- removed REDAME.pg and README.reset
+- .spec file cleanup
+- added schedutils (commands: chrt, ionice and taskset)
+
+* Tue Jul 12 2005 Karel Zak <kzak at redhat.com> 2.12p-9.7
+- fix #159339 - util-linux updates for new audit system
+- fix #158737 - sfdisk warning for large partitions, gpt
+- fix #150912 â Add ocfs2 support
+- NULL is better than zero at end of execl()
+
+* Thu Jun 16 2005 Karel Zak <kzak at redhat.com> 2.12p-9.5
- fix #157656 - CRM 546998: Possible bug in vipw, changes permissions of /etc/shadow and /etc/gshadow
- fix #159339 - util-linux updates for new audit system (pam_loginuid.so added to util-linux-selinux.pamd)
- fix #159418 - sfdisk unusable - crashes immediately on invocation
--- util-linux-2.11r-ctty3.patch DELETED ---
--- util-linux-2.12a-moretc.patch DELETED ---
--- util-linux-2.12j-143597-newgrp.patch DELETED ---
--- util-linux-2.12p-mount-man-sync.patch DELETED ---
--- util-linux-2.12p-newgrp-disable.patch DELETED ---
--- util-linux-2.12p-nfsv4.patch DELETED ---
--- util-linux-2.12p-sfdisk-fgets.patch DELETED ---
--- util-linux-2.7-chfn.pamd DELETED ---
--- util-linux-2.7-chsh.pamd DELETED ---
--- util-linux-2.7-login.pamd DELETED ---
More information about the fedora-cvs-commits
mailing list