- /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)
This commit is contained in:
parent
c82b4cbfc9
commit
169b953cab
@ -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
|
||||
|
2
sources
2
sources
@ -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
|
||||
|
25
util-linux-2.12p-execl.patch
Normal file
25
util-linux-2.12p-execl.patch
Normal file
@ -0,0 +1,25 @@
|
||||
--- util-linux-2.12p/login-utils/agetty.c.execl 2005-07-12 15:53:25.000000000 +0200
|
||||
+++ util-linux-2.12p/login-utils/agetty.c 2005-07-12 15:53:49.000000000 +0200
|
||||
@@ -382,7 +382,7 @@
|
||||
|
||||
/* Let the login program take care of password validation. */
|
||||
|
||||
- (void) execl(options.login, options.login, "--", logname, (char *) 0);
|
||||
+ (void) execl(options.login, options.login, "--", logname, NULL);
|
||||
error(_("%s: can't exec %s: %m"), options.tty, options.login);
|
||||
exit(0); /* quiet GCC */
|
||||
}
|
||||
--- util-linux-2.12p/misc-utils/script.c.execl 2005-07-12 15:54:17.000000000 +0200
|
||||
+++ util-linux-2.12p/misc-utils/script.c 2005-07-12 15:54:28.000000000 +0200
|
||||
@@ -325,9 +325,9 @@
|
||||
shname = shell;
|
||||
|
||||
if (cflg)
|
||||
- execl(shell, shname, "-c", cflg, 0);
|
||||
+ execl(shell, shname, "-c", cflg, NULL);
|
||||
else
|
||||
- execl(shell, shname, "-i", 0);
|
||||
+ execl(shell, shname, "-i", NULL);
|
||||
|
||||
perror(shell);
|
||||
fail();
|
187
util-linux-2.12p-mount-ocfs2.patch
Normal file
187
util-linux-2.12p-mount-ocfs2.patch
Normal file
@ -0,0 +1,187 @@
|
||||
--- util-linux-2.12p/mount/mount.c.ocfs2 2005-07-12 16:31:16.000000000 +0200
|
||||
+++ util-linux-2.12p/mount/mount.c 2005-07-12 16:31:46.000000000 +0200
|
||||
@@ -466,6 +466,61 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * check_special_mountprog()
|
||||
+ * If there is a special mount program for this type, exec it.
|
||||
+ * returns: 0: no exec was done, 1: exec was done, status has result
|
||||
+ */
|
||||
+
|
||||
+static int
|
||||
+check_special_mountprog(const char *spec, const char *node, const char *type, int flags,
|
||||
+ char *extra_opts, int *status) {
|
||||
+ char mountprog[120];
|
||||
+ struct stat statbuf;
|
||||
+ int res;
|
||||
+
|
||||
+ if (!external_allowed)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (type && strlen(type) < 100) {
|
||||
+ sprintf(mountprog, "/sbin/mount.%s", type);
|
||||
+ if (stat(mountprog, &statbuf) == 0) {
|
||||
+ res = fork();
|
||||
+ if (res == 0) {
|
||||
+ char *oo, *mountargs[10];
|
||||
+ int i = 0;
|
||||
+
|
||||
+ setuid(getuid());
|
||||
+ setgid(getgid());
|
||||
+ oo = fix_opts_string (flags, extra_opts, NULL);
|
||||
+ mountargs[i++] = mountprog;
|
||||
+ mountargs[i++] = spec;
|
||||
+ mountargs[i++] = node;
|
||||
+ if (nomtab)
|
||||
+ mountargs[i++] = "-n";
|
||||
+ if (verbose)
|
||||
+ mountargs[i++] = "-v";
|
||||
+ if (oo && *oo) {
|
||||
+ mountargs[i++] = "-o";
|
||||
+ mountargs[i++] = oo;
|
||||
+ }
|
||||
+ mountargs[i] = NULL;
|
||||
+ execv(mountprog, mountargs);
|
||||
+ exit(1); /* exec failed */
|
||||
+ } else if (res != -1) {
|
||||
+ int st;
|
||||
+ wait(&st);
|
||||
+ *status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
|
||||
+ return 1;
|
||||
+ } else {
|
||||
+ int errsv = errno;
|
||||
+ error(_("mount: cannot fork: %s"), strerror(errsv));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* guess_fstype_and_mount()
|
||||
* Mount a single file system. Guess the type when unknown.
|
||||
* returns: 0: OK, -1: error in errno, 1: other error
|
||||
@@ -474,9 +529,11 @@
|
||||
*/
|
||||
static int
|
||||
guess_fstype_and_mount(const char *spec, const char *node, const char **types,
|
||||
- int flags, char *mount_opts) {
|
||||
+ int flags, char *mount_opts, int *special, int *status) {
|
||||
struct mountargs args = { spec, node, NULL, flags & ~MS_NOSYS, mount_opts };
|
||||
|
||||
+ *special = 0;
|
||||
+
|
||||
if (*types && strcasecmp (*types, "auto") == 0)
|
||||
*types = NULL;
|
||||
|
||||
@@ -485,10 +542,16 @@
|
||||
|
||||
if (!*types && !(flags & MS_REMOUNT)) {
|
||||
*types = guess_fstype(spec);
|
||||
- if (*types && !strcmp(*types, "swap")) {
|
||||
- error(_("%s looks like swapspace - not mounted"), spec);
|
||||
- *types = NULL;
|
||||
- return 1;
|
||||
+ if (*types) {
|
||||
+ if (!strcmp(*types, "swap")) {
|
||||
+ error(_("%s looks like swapspace - not mounted"), spec);
|
||||
+ *types = NULL;
|
||||
+ return 1;
|
||||
+ } else if (check_special_mountprog(spec, node, *types, flags,
|
||||
+ mount_opts, status)) {
|
||||
+ *special = 1;
|
||||
+ return 0;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,61 +804,6 @@
|
||||
}
|
||||
|
||||
/*
|
||||
- * check_special_mountprog()
|
||||
- * If there is a special mount program for this type, exec it.
|
||||
- * returns: 0: no exec was done, 1: exec was done, status has result
|
||||
- */
|
||||
-
|
||||
-static int
|
||||
-check_special_mountprog(const char *spec, const char *node, const char *type,
|
||||
- int flags, char *extra_opts, int *status) {
|
||||
- char mountprog[120];
|
||||
- struct stat statbuf;
|
||||
- int res;
|
||||
-
|
||||
- if (!external_allowed)
|
||||
- return 0;
|
||||
-
|
||||
- if (type && strlen(type) < 100) {
|
||||
- sprintf(mountprog, "/sbin/mount.%s", type);
|
||||
- if (stat(mountprog, &statbuf) == 0) {
|
||||
- res = fork();
|
||||
- if (res == 0) {
|
||||
- const char *oo, *mountargs[10];
|
||||
- int i = 0;
|
||||
-
|
||||
- setuid(getuid());
|
||||
- setgid(getgid());
|
||||
- oo = fix_opts_string (flags, extra_opts, NULL);
|
||||
- mountargs[i++] = mountprog;
|
||||
- mountargs[i++] = spec;
|
||||
- mountargs[i++] = node;
|
||||
- if (nomtab)
|
||||
- mountargs[i++] = "-n";
|
||||
- if (verbose)
|
||||
- mountargs[i++] = "-v";
|
||||
- if (oo && *oo) {
|
||||
- mountargs[i++] = "-o";
|
||||
- mountargs[i++] = oo;
|
||||
- }
|
||||
- mountargs[i] = NULL;
|
||||
- execv(mountprog, (char **) mountargs);
|
||||
- exit(1); /* exec failed */
|
||||
- } else if (res != -1) {
|
||||
- int st;
|
||||
- wait(&st);
|
||||
- *status = (WIFEXITED(st) ? WEXITSTATUS(st) : EX_SYSERR);
|
||||
- return 1;
|
||||
- } else {
|
||||
- int errsv = errno;
|
||||
- error(_("mount: cannot fork: %s"), strerror(errsv));
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
* try_mount_one()
|
||||
* Try to mount one file system. When "bg" is 1, this is a retry
|
||||
* in the background. One additional exit code EX_BG is used here.
|
||||
@@ -807,7 +815,7 @@
|
||||
static int
|
||||
try_mount_one (const char *spec0, const char *node0, const char *types0,
|
||||
const char *opts0, int freq, int pass, int bg, int ro) {
|
||||
- int res = 0, status;
|
||||
+ int res = 0, status, special;
|
||||
int mnt5_res = 0; /* only for gcc */
|
||||
int mnt_err;
|
||||
int flags;
|
||||
@@ -898,9 +906,15 @@
|
||||
block_signals (SIG_BLOCK);
|
||||
nosigblock:
|
||||
|
||||
- if (!fake)
|
||||
+ if (!fake) {
|
||||
mnt5_res = guess_fstype_and_mount (spec, node, &types, flags & ~MS_NOSYS,
|
||||
- mount_opts);
|
||||
+ mount_opts, &special, &status);
|
||||
+
|
||||
+ if (special) {
|
||||
+ block_signals (SIG_UNBLOCK);
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (fake || mnt5_res == 0) {
|
||||
/* Mount succeeded, report this (if verbose) and write mtab entry. */
|
94
util-linux-2.13-arch.patch
Normal file
94
util-linux-2.13-arch.patch
Normal file
@ -0,0 +1,94 @@
|
||||
--- util-linux-2.13-pre1/sys-utils/Makefile.am.arch 2005-08-16 12:54:22.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/sys-utils/Makefile.am 2005-08-16 12:55:00.000000000 +0200
|
||||
@@ -1,6 +1,6 @@
|
||||
include $(top_srcdir)/config/include-Makefile.am
|
||||
|
||||
-bin_PROGRAMS = dmesg
|
||||
+bin_PROGRAMS = dmesg arch
|
||||
|
||||
usrbin_PROGRAMS = cytune flock ipcrm ipcs renice setsid
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
usrsbin_PROGRAMS = readprofile tunelp
|
||||
|
||||
-man_MANS = flock.1 readprofile.1 \
|
||||
+man_MANS = flock.1 readprofile.1 arch.1 \
|
||||
ctrlaltdel.8 cytune.8 dmesg.8 ipcrm.8 ipcs.8 renice.8 \
|
||||
setsid.8 tunelp.8
|
||||
|
||||
--- util-linux-2.13-pre1/sys-utils/arch.1.arch 2005-08-16 12:55:34.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/sys-utils/arch.1 2005-08-16 12:59:51.000000000 +0200
|
||||
@@ -0,0 +1,34 @@
|
||||
+.\" arch.1 --
|
||||
+.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
+.\" Public domain: may be freely distributed.
|
||||
+.TH ARCH 1 "4 July 1997" "Linux 2.0" "Linux Programmer's Manual"
|
||||
+.SH NAME
|
||||
+arch \- print machine architecture
|
||||
+.SH SYNOPSIS
|
||||
+.B arch
|
||||
+.SH DESCRIPTION
|
||||
+.B arch
|
||||
+is deprecated command since release util-linux 2.13. Use
|
||||
+.BR "uname -m" .
|
||||
+
|
||||
+On current Linux systems,
|
||||
+.B arch
|
||||
+prints things such as "i386", "i486", "i586", "alpha", "sparc",
|
||||
+"arm", "m68k", "mips", "ppc".
|
||||
+.SH SEE ALSO
|
||||
+.BR uname (1),
|
||||
+.BR uname (2)
|
||||
+.\"
|
||||
+.\" Details:
|
||||
+.\" arch prints the machine part of the system_utsname struct
|
||||
+.\" This struct is defined in version.c, and this field is
|
||||
+.\" initialized with UTS_MACHINE, which is defined as $ARCH
|
||||
+.\" in the main Makefile.
|
||||
+.\" That gives the possibilities
|
||||
+.\" alpha arm i386 m68k mips ppc sparc sparc64
|
||||
+.\"
|
||||
+.\" If Makefile is not edited, ARCH is guessed by
|
||||
+.\" ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
|
||||
+.\" Then how come we get these i586 values?
|
||||
+.\" Well, the routine check_bugs() does system_utsname.machine[1] = '0' + x86;
|
||||
+.\" (called in init/main.c, defined in ./include/asm-i386/bugs.h)
|
||||
--- util-linux-2.13-pre1/sys-utils/arch.c.arch 2005-08-16 12:55:43.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/sys-utils/arch.c 1999-07-09 04:56:41.000000000 +0200
|
||||
@@ -0,0 +1,35 @@
|
||||
+/* arch -- print machine architecture information
|
||||
+ * Created: Mon Dec 20 12:27:15 1993 by faith@cs.unc.edu
|
||||
+ * Revised: Mon Dec 20 12:29:23 1993 by faith@cs.unc.edu
|
||||
+ * Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
+
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License as published by the
|
||||
+ * Free Software Foundation; either version 2, or (at your option) any
|
||||
+ * later version.
|
||||
+
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+
|
||||
+ * You should have received a copy of the GNU General Public License along
|
||||
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
+ * 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <sys/utsname.h>
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ struct utsname utsbuf;
|
||||
+
|
||||
+ if (uname( &utsbuf )) {
|
||||
+ perror( "arch" );
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ printf( "%s\n", utsbuf.machine );
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
324
util-linux-2.13-audit-hwclock.patch
Normal file
324
util-linux-2.13-audit-hwclock.patch
Normal file
@ -0,0 +1,324 @@
|
||||
--- 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@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@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)
|
102
util-linux-2.13-ctty3.patch
Normal file
102
util-linux-2.13-ctty3.patch
Normal file
@ -0,0 +1,102 @@
|
||||
--- util-linux-2.13-pre1/login-utils/login.c.ctty3 2005-08-02 18:10:24.000000000 +0200
|
||||
+++ util-linux-2.13-pre1/login-utils/login.c 2005-08-15 15:51:35.000000000 +0200
|
||||
@@ -285,7 +285,21 @@
|
||||
updwtmp(_PATH_BTMP, &ut);
|
||||
#endif
|
||||
}
|
||||
-#endif /* HAVE_SECURITY_PAM_MISC_H */
|
||||
+
|
||||
+static int childPid = 0;
|
||||
+static volatile int got_sig = 0;
|
||||
+
|
||||
+static void
|
||||
+parent_sig_handler(int signal)
|
||||
+{
|
||||
+ if(childPid)
|
||||
+ kill(-childPid, signal);
|
||||
+ else
|
||||
+ got_sig = 1;
|
||||
+ if(signal == SIGTERM)
|
||||
+ kill(-childPid, SIGHUP); /* because the shell often ignores SIGTERM */
|
||||
+}
|
||||
+#endif /* HAVE_SECURITY_PAM_MISC_H */
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
@@ -307,7 +321,7 @@
|
||||
int retcode;
|
||||
pam_handle_t *pamh = NULL;
|
||||
struct pam_conv conv = { misc_conv, NULL };
|
||||
- pid_t childPid;
|
||||
+ struct sigaction sa, oldsa_hup, oldsa_term;
|
||||
#else
|
||||
char *salt, *pp;
|
||||
#endif
|
||||
@@ -1023,7 +1037,18 @@
|
||||
* We must fork before setuid() because we need to call
|
||||
* pam_close_session() as root.
|
||||
*/
|
||||
+ memset(&sa, 0, sizeof(sa));
|
||||
+ sa.sa_handler = SIG_IGN;
|
||||
+ sigaction(SIGINT, &sa, NULL);
|
||||
+
|
||||
+ sigaction(SIGHUP, &sa, &oldsa_hup); /* ignore while we detach from the tty */
|
||||
+ ioctl(0, TIOCNOTTY, NULL);
|
||||
+
|
||||
+ sa.sa_handler = parent_sig_handler;
|
||||
+ sigaction(SIGHUP, &sa, NULL);
|
||||
+ sigaction(SIGTERM, &sa, &oldsa_term);
|
||||
|
||||
+ closelog();
|
||||
childPid = fork();
|
||||
if (childPid < 0) {
|
||||
int errsv = errno;
|
||||
@@ -1034,19 +1059,20 @@
|
||||
}
|
||||
|
||||
if (childPid) {
|
||||
- /* parent - wait for child to finish, then cleanup session */
|
||||
- signal(SIGHUP, SIG_IGN);
|
||||
- signal(SIGINT, SIG_IGN);
|
||||
- signal(SIGQUIT, SIG_IGN);
|
||||
- signal(SIGTSTP, SIG_IGN);
|
||||
- signal(SIGTTIN, SIG_IGN);
|
||||
- signal(SIGTTOU, SIG_IGN);
|
||||
-
|
||||
- wait(NULL);
|
||||
+ close(0); close(1); close(2);
|
||||
+ sa.sa_handler = SIG_IGN;
|
||||
+ sigaction(SIGQUIT, &sa, NULL);
|
||||
+ sigaction(SIGINT, &sa, NULL);
|
||||
+ while(wait(NULL) == -1 && errno == EINTR) /**/ ;
|
||||
+ openlog("login", LOG_ODELAY, LOG_AUTHPRIV);
|
||||
PAM_END;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
+ sigaction(SIGHUP, &oldsa_hup, NULL);
|
||||
+ sigaction(SIGTERM, &oldsa_term, NULL);
|
||||
+ if(got_sig) exit(1);
|
||||
+
|
||||
/* child */
|
||||
/*
|
||||
* Problem: if the user's shell is a shell like ash that doesnt do
|
||||
@@ -1058,14 +1084,15 @@
|
||||
setsid();
|
||||
|
||||
/* make sure we have a controlling tty */
|
||||
- opentty(ttyn);
|
||||
openlog("login", LOG_ODELAY, LOG_AUTHPRIV); /* reopen */
|
||||
|
||||
/*
|
||||
* TIOCSCTTY: steal tty from other process group.
|
||||
*/
|
||||
- if (ioctl(0, TIOCSCTTY, 1))
|
||||
- syslog(LOG_ERR, _("TIOCSCTTY failed: %m"));
|
||||
+ if (ioctl(0, TIOCSCTTY, (char *)1)) {
|
||||
+ syslog(LOG_ERR, _("Couldn't set controlling terminal: %s"), strerror(errno));
|
||||
+ exit(1);
|
||||
+ }
|
||||
#endif
|
||||
signal(SIGINT, SIG_DFL);
|
||||
|
500
util-linux-2.13-fdisk-gpt.patch
Normal file
500
util-linux-2.13-fdisk-gpt.patch
Normal file
@ -0,0 +1,500 @@
|
||||
--- 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@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);
|
||||
|
107
util-linux-2.13-moretc.patch
Normal file
107
util-linux-2.13-moretc.patch
Normal file
@ -0,0 +1,107 @@
|
||||
--- 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) {}
|
||||
|
6
util-linux-chsh-chfn.pamd
Normal file
6
util-linux-chsh-chfn.pamd
Normal file
@ -0,0 +1,6 @@
|
||||
#%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
|
351
util-linux.spec
351
util-linux.spec
@ -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@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@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: texinfo
|
||||
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 @@ Patch153: util-linux-2.12a-16415-rdevman.patch
|
||||
|
||||
# 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 @@ Patch187: util-linux-2.12p-fstab-man.patch
|
||||
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 @@ utilities that are necessary for a Linux system to function. Among
|
||||
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 @@ mv MCONFIG.new MCONFIG
|
||||
%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
|
||||
|
||||
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 ..
|
||||
# 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
|
||||
|
||||
# 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 @@ mkdir -p %{buildroot}/var/log
|
||||
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 @@ gzip -9nf ${RPM_BUILD_ROOT}%{_infodir}/ipc.info
|
||||
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%{_bindir}/cytune $RPM_BUILD_ROOT%{_mandir}/man8/cytune.8*
|
||||
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 @@ fi
|
||||
|
||||
%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 @@ fi
|
||||
/sbin/blockdev
|
||||
/sbin/pivot_root
|
||||
/sbin/ctrlaltdel
|
||||
/sbin/elvtune
|
||||
/sbin/addpart
|
||||
/sbin/delpart
|
||||
/sbin/partx
|
||||
@ -480,7 +480,6 @@ fi
|
||||
%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 @@ fi
|
||||
%{_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 @@ fi
|
||||
%endif
|
||||
%{_bindir}/namei
|
||||
|
||||
# newgrp disabled
|
||||
#%attr(4711,root,root) %{_bindir}/newgrp
|
||||
|
||||
%if %{include_raw}
|
||||
%{_bindir}/raw
|
||||
%endif
|
||||
@ -538,9 +538,6 @@ fi
|
||||
%{_bindir}/renice
|
||||
%{_bindir}/rev
|
||||
%{_bindir}/script
|
||||
%ifnarch s390 s390x
|
||||
%{_bindir}/setfdprm
|
||||
%endif
|
||||
%{_bindir}/setsid
|
||||
%{_bindir}/setterm
|
||||
%ifarch sparc sparc64 sparcv9
|
||||
@ -589,10 +586,6 @@ fi
|
||||
%{_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 @@ fi
|
||||
%{_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 @@ fi
|
||||
%{_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 @@ fi
|
||||
%{_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@redhat.com> 2.12p-10
|
||||
* Tue Aug 16 2005 Karel Zak <kzak@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@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@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
|
||||
|
Loading…
Reference in New Issue
Block a user