Compare commits
32 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d59979fa05 | ||
|
|
6c69926dbf | ||
|
|
334e0e7abe | ||
|
|
39ece656f3 | ||
|
|
f5753f26bf | ||
|
|
f5b82120dc | ||
|
|
ad6c4cead9 | ||
|
|
84c61844a0 | ||
|
|
a668ec5732 | ||
|
|
c8f122a16e | ||
|
|
aaefb1b1e9 | ||
|
|
719e877065 | ||
|
|
b5c0655ff7 | ||
|
|
ac8c6510b0 | ||
|
|
ad3276c60e | ||
|
|
c5424ee0fe | ||
|
|
b160158d1d | ||
|
|
3469b9156c | ||
|
|
ebf27ef6b1 | ||
|
|
895e26434c | ||
|
|
f2798a3ae7 | ||
|
|
23fc39cc0a | ||
|
|
508868f471 | ||
|
|
68cfaf1c07 | ||
|
|
8e0edf3045 | ||
|
|
0b5b5047d5 | ||
|
|
ad59cd7228 | ||
|
|
ad52cd8da8 | ||
|
|
9cc0805afc | ||
|
|
65b849d161 | ||
|
|
54801c4aa3 | ||
|
|
3d39c82c09 |
26 changed files with 6 additions and 3340 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,2 +1,5 @@
|
|||
util-linux-ng-2.16.2.tar.bz2
|
||||
floppy-0.16.tar.bz2
|
||||
util-linux-ng-2.18.tar.bz2
|
||||
*~
|
||||
*.rpm
|
||||
*.log
|
||||
|
|
|
|||
2
dead.package
Normal file
2
dead.package
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
util-linux-ng has been renamed to util-linux
|
||||
27
mount.tmpfs
27
mount.tmpfs
|
|
@ -1,27 +0,0 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# Copyright (C) 2009 Eric Paris <eparis@redhat.com>
|
||||
# Daniel Walsh <dwalsh@redhat.com>
|
||||
# Karel Zak <kzak@redhat.com>
|
||||
#
|
||||
# http://bugzilla.redhat.com/show_bug.cgi?id=476964
|
||||
#
|
||||
# Usage:
|
||||
# /sbin/mount.tmpfs spec dir [-sfnv] [-o options]
|
||||
#
|
||||
|
||||
# Remount with context mount options is unsupported
|
||||
# http://bugzilla.redhat.com/show_bug.cgi?id=563267
|
||||
#
|
||||
if ! echo "$@" | grep -q -E '\-o.*remount'; then
|
||||
|
||||
if ! echo "$@" | grep -q -E '(fs|def|root)?context='; then
|
||||
con=$(ls --scontext -d "$2" | cut -f 1 -d ' ')
|
||||
if [ -n "$con" ] && [ "$con" != "?" ] && [ "$con" != "unlabeled" ]; then
|
||||
exec /bin/mount "$@" -o "rootcontext=\"$con\"" -i -t tmpfs
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exec /bin/mount "$@" -i -t tmpfs
|
||||
63
nologin.8
63
nologin.8
|
|
@ -1,63 +0,0 @@
|
|||
.\" $OpenBSD: nologin.8,v 1.8 1999/06/04 02:45:19 aaron Exp $
|
||||
.\" $NetBSD: nologin.8,v 1.3 1995/03/18 14:59:09 cgd Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the University of
|
||||
.\" California, Berkeley and its contributors.
|
||||
.\" 4. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)nologin.8 8.1 (Berkeley) 6/19/93
|
||||
.\"
|
||||
.Dd February 15, 1997
|
||||
.Dt NOLOGIN 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm nologin
|
||||
.Nd politely refuse a login
|
||||
.Sh SYNOPSIS
|
||||
.Nm nologin
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
displays a message that an account is not available and
|
||||
exits non-zero.
|
||||
It is intended as a replacement shell field for accounts that
|
||||
have been disabled.
|
||||
.Pp
|
||||
If the file
|
||||
.Pa /etc/nologin.txt
|
||||
exists,
|
||||
.Nm
|
||||
displays its contents to the user instead of the default message.
|
||||
.Sh SEE ALSO
|
||||
.Xr login 1
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
command appeared in
|
||||
.Bx 4.4 .
|
||||
58
nologin.c
58
nologin.c
|
|
@ -1,58 +0,0 @@
|
|||
/* $OpenBSD: nologin.c,v 1.2 1997/04/04 16:51:37 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, Jason Downs. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Distinctly different from _PATH_NOLOGIN. */
|
||||
#define _PATH_NOLOGIN_TXT "/etc/nologin.txt"
|
||||
|
||||
#define DEFAULT_MESG "This account is currently not available.\n"
|
||||
|
||||
/*ARGSUSED*/
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int nfd, nrd;
|
||||
char nbuf[128];
|
||||
|
||||
nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
|
||||
if (nfd < 0) {
|
||||
write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
while ((nrd = read(nfd, nbuf, sizeof(nbuf))) > 0)
|
||||
write(STDOUT_FILENO, nbuf, nrd);
|
||||
close (nfd);
|
||||
|
||||
exit (1);
|
||||
}
|
||||
2
sources
2
sources
|
|
@ -1,2 +0,0 @@
|
|||
edd1f7a82fd388cc0e1e3d2d1e7ea55a util-linux-ng-2.16.2.tar.bz2
|
||||
7eeb9a6f7a258174bf0fa80f1370788d floppy-0.16.tar.bz2
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- util-linux-2.13-pre6/sys-utils/ctrlaltdel.8.kzak 2006-08-10 12:23:53.000000000 +0200
|
||||
+++ util-linux-2.13-pre6/sys-utils/ctrlaltdel.8 2006-08-10 12:24:08.000000000 +0200
|
||||
@@ -32,7 +32,6 @@
|
||||
.SH FILES
|
||||
.I /etc/rc.local
|
||||
.SH "SEE ALSO"
|
||||
-.BR simpleinit (8),
|
||||
.BR init (8)
|
||||
.SH AUTHOR
|
||||
Peter Orbaek (poe@daimi.aau.dk)
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
--- util-linux-ng-2.13-rc3/disk-utils/fdformat.8.xxx 2007-07-03 01:56:04.000000000 +0200
|
||||
+++ util-linux-ng-2.13-rc3/disk-utils/fdformat.8 2007-08-13 12:07:58.000000000 +0200
|
||||
@@ -45,6 +45,10 @@
|
||||
.BR setfdprm (8)
|
||||
to load the disk parameters.
|
||||
|
||||
+For ATAPI IDE floppy driver (also known as LS-120 drives or "Superdisk"
|
||||
+drives) you have to use the
|
||||
+.BR floppy (8).
|
||||
+
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-n
|
||||
@@ -54,7 +58,8 @@
|
||||
.BR fd (4),
|
||||
.BR setfdprm (8),
|
||||
.BR mkfs (8),
|
||||
-.BR emkfs (8)
|
||||
+.BR emkfs (8),
|
||||
+.BR floppy (8)
|
||||
.SH AUTHOR
|
||||
Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
|
||||
.SH AVAILABILITY
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
--- util-linux-2.12p/floppy-0.16/floppyfloppy.c.generic 2001-02-13 01:15:38.000000000 +0100
|
||||
+++ util-linux-2.12p/floppy-0.16/floppyfloppy.c 2005-09-30 15:38:08.000000000 +0200
|
||||
@@ -264,6 +264,33 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
+/* -1=error, 1=true, 0=false */
|
||||
+static int check_generic(const char *dev, int n)
|
||||
+{
|
||||
+ struct floppy_struct param;
|
||||
+ int fd;
|
||||
+
|
||||
+ if ((fd=open(dev, O_RDONLY)) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (ioctl(fd,FDGETPRM,(long) ¶m) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ close(fd);
|
||||
+
|
||||
+ if (param.sect==floppy_type[n].sectors &&
|
||||
+ param.head==floppy_type[n].heads &&
|
||||
+ param.track==floppy_type[n].tracks)
|
||||
+ /* generic device uses expected format */
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
static int do_format(const char *dev, int fmtnum,
|
||||
int (*fmt_func)(const char *, int), int flags)
|
||||
@@ -275,6 +302,7 @@
|
||||
struct format_descr curtrack;
|
||||
int pct;
|
||||
struct stat stat_buf;
|
||||
+ int gen = 0;
|
||||
|
||||
int i, j;
|
||||
char *devname;
|
||||
@@ -297,23 +325,52 @@
|
||||
|
||||
strcat(strcpy(devname, dev), floppy_type[fmtnum].dev);
|
||||
|
||||
+ if (stat(devname, &stat_buf)==-1 && errno==ENOENT)
|
||||
+ {
|
||||
+ /* /dev/fd0xxxxx doesn't exist ...try to use generic device
|
||||
+ *
|
||||
+ * Note: we needn't size specific device if the generic device uses
|
||||
+ * right floppy format (FDGETPRM). -- Karel Zak [30/09/2005]
|
||||
+ */
|
||||
+ if ((gen = check_generic(dev, fmtnum))==1) /* true */
|
||||
+ {
|
||||
+ fprintf(stderr, _("WARNING: size specific device %s doesn't exist, using generic device: %s\n"),
|
||||
+ devname, dev);
|
||||
+ strcpy(devname, dev);
|
||||
+ }
|
||||
+ else if (gen==0) /* false */
|
||||
+ {
|
||||
+ fprintf(stderr, _("ERROR: size specific device %1$s doesn't exist. Use \"MAKEDEV %1$s\" and try it again.\n"), devname);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ else /* error -- no floppy medium or device? */
|
||||
+ return(1);
|
||||
+ }
|
||||
fd=open(devname, O_WRONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror(devname);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
- if (fstat(fd, &stat_buf) ||
|
||||
- !S_ISBLK(stat_buf.st_mode) ||
|
||||
- MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
+ if (fstat(fd, &stat_buf) < 0)
|
||||
+ {
|
||||
+ perror(devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (!S_ISBLK(stat_buf.st_mode))
|
||||
+ {
|
||||
+ fprintf(stderr,_("%s: not a block device\n"), devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (gen==0 && MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
{
|
||||
errno=EINVAL;
|
||||
perror(devname);
|
||||
close(fd);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
if (ioctl(fd, FDGETPRM, &geo) < 0)
|
||||
{
|
||||
perror(devname);
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- util-linux-ng-2.13-rc3/floppy-0.16/superfloppy.c.kzak 2001-07-14 05:26:16.000000000 +0200
|
||||
+++ util-linux-ng-2.13-rc3/floppy-0.16/superfloppy.c 2007-08-13 13:14:53.000000000 +0200
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <errno.h>
|
||||
#include <popt.h>
|
||||
#include <libintl.h>
|
||||
+#include <locale.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Index: util-linux-ng-2.14.2-rc1/login-utils/login.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.14.2-rc1.orig/login-utils/login.c
|
||||
+++ util-linux-ng-2.14.2-rc1/login-utils/login.c
|
||||
@@ -1415,7 +1415,7 @@ dolastlog(int quiet) {
|
||||
struct lastlog ll;
|
||||
int fd;
|
||||
|
||||
- if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
|
||||
+ if ((fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0)) >= 0) {
|
||||
lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET);
|
||||
if (!quiet) {
|
||||
if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) &&
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
diff -up util-linux-ng-2.14-rc3/disk-utils/blockdev.c.rm util-linux-ng-2.14-rc3/disk-utils/blockdev.c
|
||||
--- util-linux-ng-2.14-rc3/disk-utils/blockdev.c.rm 2008-04-22 10:59:53.000000000 +0200
|
||||
+++ util-linux-ng-2.14-rc3/disk-utils/blockdev.c 2008-05-19 12:31:52.000000000 +0200
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
+#include <linux/blkpg.h>
|
||||
|
||||
#include "nls.h"
|
||||
#include "blkdev.h"
|
||||
@@ -47,8 +48,11 @@ struct bdc {
|
||||
{ "--setfra", "BLKFRASET", BLKFRASET, ARGINTA, 0, "FSREADAHEAD", N_("set filesystem readahead") },
|
||||
{ "--getfra", "BLKFRAGET", BLKFRAGET, ARGLINTG, -1, NULL, N_("get filesystem readahead") },
|
||||
{ "--flushbufs", "BLKFLSBUF", BLKFLSBUF, ARGNONE, 0, NULL, N_("flush buffers") },
|
||||
- { "--rereadpt", "BLKRRPART", BLKRRPART, ARGNONE, 0, NULL,
|
||||
- N_("reread partition table") },
|
||||
+ { "--rereadpt", "BLKRRPART", BLKRRPART, ARGNONE, 0, NULL, N_("reread partition table") },
|
||||
+#ifdef BLKPG
|
||||
+ { "--rmpart", "BLKPG", BLKPG, ARGINTAP, 0, "PARTNO", N_("disable partition") },
|
||||
+ { "--rmparts", "BLKPG", BLKPG, ARGNONE, 0, NULL, N_("disable all partitions") },
|
||||
+#endif
|
||||
};
|
||||
|
||||
#define SIZE(a) (sizeof(a)/sizeof((a)[0]))
|
||||
@@ -89,6 +93,40 @@ find_cmd(char *s) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#ifdef BLKPG
|
||||
+static int
|
||||
+disable_partition(int fd, int partno) {
|
||||
+ struct blkpg_partition part = {
|
||||
+ .pno = partno,
|
||||
+ .start = 0,
|
||||
+ .length = 0,
|
||||
+ .devname[0] = 0,
|
||||
+ .volname[0] = 0,
|
||||
+ };
|
||||
+ struct blkpg_ioctl_arg io = {
|
||||
+ .op = BLKPG_DEL_PARTITION,
|
||||
+ .datalen = sizeof(part),
|
||||
+ .data = &part,
|
||||
+ .flags = 0,
|
||||
+ };
|
||||
+ int res;
|
||||
+
|
||||
+ res = ioctl(fd, BLKPG, &io);
|
||||
+ if (res < 0)
|
||||
+ return 0;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+disable_partitions(int fd) {
|
||||
+ int p, res = 0;
|
||||
+
|
||||
+ for (p = 1; p <= 256; p++)
|
||||
+ res += disable_partition(fd, p);
|
||||
+ return res ? 0 : -1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
void do_commands(int fd, char **argv, int d);
|
||||
void report_header(void);
|
||||
void report_device(char *device, int quiet);
|
||||
@@ -206,6 +244,12 @@ do_commands(int fd, char **argv, int d)
|
||||
switch(bdcms[j].argtype) {
|
||||
default:
|
||||
case ARGNONE:
|
||||
+#ifdef BLKPG
|
||||
+ if (bdcms[j].ioc == BLKPG) {
|
||||
+ res = disable_partitions(fd);
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
res = ioctl(fd, bdcms[j].ioc, 0);
|
||||
break;
|
||||
case ARGINTA:
|
||||
@@ -223,6 +267,13 @@ do_commands(int fd, char **argv, int d)
|
||||
bdcms[j].name);
|
||||
usage();
|
||||
}
|
||||
+#ifdef BLKPG
|
||||
+ if (bdcms[j].ioc == BLKPG) {
|
||||
+ iarg = atoi(argv[++i]);
|
||||
+ res = disable_partition(fd, iarg) ? 0 : -1;
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
iarg = atoi(argv[++i]);
|
||||
res = ioctl(fd, bdcms[j].ioc, &iarg);
|
||||
break;
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
diff -up util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c
|
||||
--- util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak 2009-03-25 13:19:08.000000000 +0100
|
||||
+++ util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c 2009-06-04 15:22:48.000000000 +0200
|
||||
@@ -243,6 +243,26 @@ print_perms (int id, struct ipc_perm *ip
|
||||
printf(" %-10d\n", ipcp->gid);
|
||||
}
|
||||
|
||||
+static unsigned long long
|
||||
+shminfo_from_proc(const char *name, unsigned long def)
|
||||
+{
|
||||
+ char path[256];
|
||||
+ char buf[64];
|
||||
+ FILE *f;
|
||||
+ unsigned long long res = def;
|
||||
+
|
||||
+ if (!name)
|
||||
+ return res;
|
||||
+
|
||||
+ snprintf(path, sizeof(path), "/proc/sys/kernel/%s", name);
|
||||
+
|
||||
+ if (!(f = fopen(path, "r")))
|
||||
+ return res;
|
||||
+ if (fgets(buf, sizeof(buf), f))
|
||||
+ res = atoll(buf);
|
||||
+ fclose(f);
|
||||
+ return res;
|
||||
+}
|
||||
|
||||
void do_shm (char format)
|
||||
{
|
||||
@@ -266,12 +286,12 @@ void do_shm (char format)
|
||||
return;
|
||||
/* glibc 2.1.3 and all earlier libc's have ints as fields
|
||||
of struct shminfo; glibc 2.1.91 has unsigned long; ach */
|
||||
- printf (_("max number of segments = %lu\n"),
|
||||
- (unsigned long) shminfo.shmmni);
|
||||
- printf (_("max seg size (kbytes) = %lu\n"),
|
||||
- (unsigned long) (shminfo.shmmax >> 10));
|
||||
+ printf (_("max number of segments = %llu\n"),
|
||||
+ shminfo_from_proc("shmmni", shminfo.shmmni));
|
||||
+ printf (_("max seg size (kbytes) = %llu\n"),
|
||||
+ (shminfo_from_proc("shmmax", shminfo.shmmax) >> 10));
|
||||
printf (_("max total shared memory (kbytes) = %llu\n"),
|
||||
- getpagesize() / 1024 * (unsigned long long) shminfo.shmall);
|
||||
+ getpagesize() / 1024 * shminfo_from_proc("shmall", shminfo.shmall));
|
||||
printf (_("min seg size (bytes) = %lu\n"),
|
||||
(unsigned long) shminfo.shmmin);
|
||||
return;
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c
|
||||
--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c.kzak 2009-11-30 12:43:13.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/adaptec_raid.c 2009-12-15 14:18:10.000000000 +0100
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "blkidP.h"
|
||||
|
||||
struct adaptec_metadata {
|
||||
+
|
||||
uint32_t b0idcode;
|
||||
uint8_t lunsave[8];
|
||||
uint16_t sdtype;
|
||||
@@ -63,13 +64,13 @@ struct adaptec_metadata {
|
||||
uint32_t fwTestMagic;
|
||||
uint32_t fwTestSeqNum;
|
||||
uint8_t fwTestRes[8];
|
||||
- uint8_t smagic[4];
|
||||
+ uint32_t smagic;
|
||||
uint32_t raidtbl;
|
||||
uint16_t raidline;
|
||||
uint8_t res9[0xF6];
|
||||
} __attribute__((packed));
|
||||
|
||||
-#define AD_SIGNATURE "DPTM"
|
||||
+#define AD_SIGNATURE 0x4450544D /* "DPTM" */
|
||||
#define AD_MAGIC 0x37FC4D1E
|
||||
|
||||
static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag)
|
||||
@@ -87,7 +88,7 @@ static int probe_adraid(blkid_probe pr,
|
||||
sizeof(struct adaptec_metadata));
|
||||
if (!ad)
|
||||
return -1;
|
||||
- if (memcmp(ad->smagic, AD_SIGNATURE, sizeof(AD_SIGNATURE)) != 0)
|
||||
+ if (ad->smagic != be32_to_cpu(AD_SIGNATURE))
|
||||
return -1;
|
||||
if (ad->b0idcode != be32_to_cpu(AD_MAGIC))
|
||||
return -1;
|
||||
diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c
|
||||
--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c.kzak 2009-11-30 12:37:08.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/highpoint_raid.c 2009-12-15 14:18:10.000000000 +0100
|
||||
@@ -45,18 +45,25 @@ static int probe_highpoint45x(blkid_prob
|
||||
}
|
||||
|
||||
const struct blkid_idinfo highpoint45x_idinfo = {
|
||||
- .name = "highpoint_raid_member",
|
||||
+ .name = "hpt45x_raid_member",
|
||||
.usage = BLKID_USAGE_RAID,
|
||||
.probefunc = probe_highpoint45x,
|
||||
.magics = BLKID_NONE_MAGIC
|
||||
};
|
||||
|
||||
const struct blkid_idinfo highpoint37x_idinfo = {
|
||||
- .name = "highpoint_raid_member",
|
||||
+ .name = "hpt37x_raid_member",
|
||||
.usage = BLKID_USAGE_RAID,
|
||||
.magics = {
|
||||
- { .magic = "\xf0\x16\x78\x5a", .len = 4, .kboff = 4 },
|
||||
- { .magic = "\xfd\x16\x78\x5a", .len = 4, .kboff = 4 },
|
||||
+ /*
|
||||
+ * Superblok offset: 4608 bytes (9 sectors)
|
||||
+ * Magic string offset within superblock: 32 bytes
|
||||
+ *
|
||||
+ * kboff = (4608 + 32) / 1024
|
||||
+ * sboff = (4608 + 32) % kboff
|
||||
+ */
|
||||
+ { .magic = "\xf0\x16\x78\x5a", .len = 4, .kboff = 4, .sboff = 544 },
|
||||
+ { .magic = "\xfd\x16\x78\x5a", .len = 4, .kboff = 4, .sboff = 544 },
|
||||
{ NULL }
|
||||
}
|
||||
};
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
diff -up util-linux-ng-2.16/misc-utils/blkid.8.kzak util-linux-ng-2.16/misc-utils/blkid.8
|
||||
--- util-linux-ng-2.16/misc-utils/blkid.8.kzak 2009-07-04 01:20:01.000000000 +0200
|
||||
+++ util-linux-ng-2.16/misc-utils/blkid.8 2009-07-16 00:41:28.000000000 +0200
|
||||
@@ -64,7 +64,7 @@ more devices.
|
||||
Read from
|
||||
.I cachefile
|
||||
instead of reading from the default cache file
|
||||
-.IR /etc/blkid.tab .
|
||||
+.IR /etc/blkid/blkid.tab .
|
||||
If you want to start with a clean cache (i.e. don't report devices previously
|
||||
scanned but not necessarily available at this time), specify
|
||||
.IR /dev/null .
|
||||
@@ -179,7 +179,7 @@ Display version number and exit.
|
||||
Write the device cache to
|
||||
.I writecachefile
|
||||
instead of writing it to the default cache file
|
||||
-.IR /etc/blkid.tab .
|
||||
+.IR /etc/blkid/blkid.tab .
|
||||
If you don't want to save the cache to the default file, specify
|
||||
.IR /dev/null.
|
||||
If not specified it will be the same file as that given by the
|
||||
diff -up util-linux-ng-2.16/misc-utils/blkid.c.kzak util-linux-ng-2.16/misc-utils/blkid.c
|
||||
--- util-linux-ng-2.16/misc-utils/blkid.c.kzak 2009-07-04 01:20:01.000000000 +0200
|
||||
+++ util-linux-ng-2.16/misc-utils/blkid.c 2009-07-16 00:41:28.000000000 +0200
|
||||
@@ -60,7 +60,7 @@ static void usage(int error)
|
||||
" [-t <token>] [-w <file>] [dev ...]\n\n"
|
||||
" %1$s -p [-O <offset>] [-S <size>] [-o format] <dev> [dev ...]\n\n"
|
||||
"Options:\n"
|
||||
- " -c <file> cache file (default: /etc/blkid.tab, /dev/null = none)\n"
|
||||
+ " -c <file> cache file (default: /etc/blkid/blkid.tab, /dev/null = none)\n"
|
||||
" -h print this usage message and exit\n"
|
||||
" -g garbage collect the blkid cache\n"
|
||||
" -o <format> output format; can be one of:\n"
|
||||
diff -up util-linux-ng-2.16/shlibs/blkid/libblkid.3.kzak util-linux-ng-2.16/shlibs/blkid/libblkid.3
|
||||
--- util-linux-ng-2.16/shlibs/blkid/libblkid.3.kzak 2009-07-04 01:20:03.000000000 +0200
|
||||
+++ util-linux-ng-2.16/shlibs/blkid/libblkid.3 2009-07-16 00:40:13.000000000 +0200
|
||||
@@ -24,7 +24,7 @@ A common use is to allow use of LABEL= a
|
||||
specific block device names into configuration files.
|
||||
.P
|
||||
Block device information is normally kept in a cache file
|
||||
-.I /etc/blkid.tab
|
||||
+.I /etc/blkid/blkid.tab
|
||||
and is verified to still be valid before being returned to the user
|
||||
(if the user has read permission on the raw block device, otherwise not).
|
||||
The cache file also allows unprivileged users (normally anyone other
|
||||
@@ -59,7 +59,7 @@ symlink does not match with LABEL or UUI
|
||||
.I CACHE_FILE=<path>
|
||||
Overrides the standard location of the cache file. This setting can be
|
||||
overridden by the environment variable BLKID_FILE. Default is
|
||||
-.I /etc/blkid.tab.
|
||||
+.I /etc/blkid/blkid.tab.
|
||||
.TP
|
||||
.I EVALUATE=<methods>
|
||||
Defines LABEL and UUID evaluation method(s). Currently, the libblkid library
|
||||
@@ -77,7 +77,7 @@ from Ted Ts'o. The library was subseque
|
||||
The low-level probing code was rewritten by Karel Zak.
|
||||
.SH FILES
|
||||
.TP 18
|
||||
-.I /etc/blkid.tab
|
||||
+.I /etc/blkid/blkid.tab
|
||||
caches data extracted from each recognized block device
|
||||
.TP
|
||||
.I /etc/blkid.conf
|
||||
diff -up util-linux-ng-2.16/shlibs/blkid/src/blkidP.h.kzak util-linux-ng-2.16/shlibs/blkid/src/blkidP.h
|
||||
--- util-linux-ng-2.16/shlibs/blkid/src/blkidP.h.kzak 2009-07-13 20:30:36.000000000 +0200
|
||||
+++ util-linux-ng-2.16/shlibs/blkid/src/blkidP.h 2009-07-16 00:40:13.000000000 +0200
|
||||
@@ -223,7 +223,7 @@ struct blkid_struct_cache
|
||||
extern char *blkid_strdup(const char *s);
|
||||
extern char *blkid_strndup(const char *s, const int length);
|
||||
|
||||
-#define BLKID_CACHE_FILE "/etc/blkid.tab"
|
||||
+#define BLKID_CACHE_FILE "/etc/blkid/blkid.tab"
|
||||
#define BLKID_CONFIG_FILE "/etc/blkid.conf"
|
||||
|
||||
#define BLKID_ERR_IO 5
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From: Scott James Remnant <scott@ubuntu.com>
|
||||
Subject: [PATCH] libblkid: return first detected crypto device
|
||||
|
||||
Crypto devices may sometimes have multiple additional prober matches,
|
||||
however just like RAID, there's no danger of activating the wrong one
|
||||
since special help is needed to activate the block device before it
|
||||
can be used.
|
||||
|
||||
Thus modify blkid_do_safeprobe() to break out of the loop when a
|
||||
crypto device is detected, as it does already for RAID.
|
||||
|
||||
[kzak@redhar.com: - backport to 2.16.2 for Fedora-12]
|
||||
|
||||
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probe.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probe.c
|
||||
--- util-linux-ng-2.16.2/shlibs/blkid/src/probe.c.kzak 2009-12-07 09:44:46.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/shlibs/blkid/src/probe.c 2009-12-07 09:47:12.000000000 +0100
|
||||
@@ -538,9 +538,9 @@ int blkid_do_probe(blkid_probe pr)
|
||||
* (cannot be used in while()) and checks for ambivalen results (more
|
||||
* filesystems on the device) -- in such case returns -2.
|
||||
*
|
||||
- * The function does not check for filesystems when a RAID signature is
|
||||
- * detected. The function also does not check for collision between RAIDs. The
|
||||
- * first detected RAID is returned.
|
||||
+ * The function does not check for filesystems when a RAID or crypto signature
|
||||
+ * is detected. The function also does not check for collision between RAIDs
|
||||
+ * and crypto devices. The first detected RAID or crypto device is returned.
|
||||
*/
|
||||
int blkid_do_safeprobe(blkid_probe pr)
|
||||
{
|
||||
@@ -558,7 +558,7 @@ int blkid_do_safeprobe(blkid_probe pr)
|
||||
}
|
||||
count++;
|
||||
|
||||
- if (idinfos[pr->idx]->usage & BLKID_USAGE_RAID)
|
||||
+ if (idinfos[pr->idx]->usage & (BLKID_USAGE_RAID | BLKID_USAGE_CRYPTO))
|
||||
break;
|
||||
if (!(idinfos[pr->idx]->flags & BLKID_IDINFO_TOLERANT))
|
||||
intol++;
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c
|
||||
--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c.kzak 2009-11-30 12:37:08.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/minix.c 2010-03-08 13:11:54.000000000 +0100
|
||||
@@ -9,22 +9,96 @@
|
||||
* GNU Lesser General Public License.
|
||||
*/
|
||||
|
||||
+#include <string.h>
|
||||
#include "blkidP.h"
|
||||
|
||||
+struct minix_super_block {
|
||||
+ uint16_t s_ninodes;
|
||||
+ uint16_t s_nzones;
|
||||
+ uint16_t s_imap_blocks;
|
||||
+ uint16_t s_zmap_blocks;
|
||||
+ uint16_t s_firstdatazone;
|
||||
+ uint16_t s_log_zone_size;
|
||||
+ uint32_t s_max_size;
|
||||
+ uint16_t s_magic;
|
||||
+ uint16_t s_state;
|
||||
+ uint32_t s_zones;
|
||||
+};
|
||||
+
|
||||
+struct minix3_super_block {
|
||||
+ uint32_t s_ninodes;
|
||||
+ uint16_t s_pad0;
|
||||
+ uint16_t s_imap_blocks;
|
||||
+ uint16_t s_zmap_blocks;
|
||||
+ uint16_t s_firstdatazone;
|
||||
+ uint16_t s_log_zone_size;
|
||||
+ uint16_t s_pad1;
|
||||
+ uint32_t s_max_size;
|
||||
+ uint32_t s_zones;
|
||||
+ uint16_t s_magic;
|
||||
+ uint16_t s_pad2;
|
||||
+ uint16_t s_blocksize;
|
||||
+ uint8_t s_disk_version;
|
||||
+};
|
||||
+
|
||||
+#define MINIX_BLOCK_SIZE_BITS 10
|
||||
+#define MINIX_BLOCK_SIZE (1 << MINIX_BLOCK_SIZE_BITS)
|
||||
+
|
||||
static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag)
|
||||
{
|
||||
+ unsigned char *ext;
|
||||
+ int version;
|
||||
+
|
||||
/* for more details see magic strings below */
|
||||
switch(mag->magic[1]) {
|
||||
case '\023':
|
||||
- blkid_probe_set_version(pr, "1");
|
||||
+ version = 1;
|
||||
break;
|
||||
case '\044':
|
||||
- blkid_probe_set_version(pr, "2");
|
||||
+ version = 2;
|
||||
break;
|
||||
case '\115':
|
||||
- blkid_probe_set_version(pr, "3");
|
||||
+ version = 3;
|
||||
break;
|
||||
+ default:
|
||||
+ return -1;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (version <= 2) {
|
||||
+ struct minix_super_block *sb;
|
||||
+ uint32_t zones;
|
||||
+
|
||||
+ sb = blkid_probe_get_sb(pr, mag, struct minix_super_block);
|
||||
+ if (!sb || sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ zones = version == 2 ? sb->s_zones : sb->s_nzones;
|
||||
+
|
||||
+ /* sanity checks to be sure that the FS is really minix */
|
||||
+ if (sb->s_imap_blocks * MINIX_BLOCK_SIZE * 8 < sb->s_ninodes + 1)
|
||||
+ return -1;
|
||||
+ if (sb->s_zmap_blocks * MINIX_BLOCK_SIZE * 8 < zones - sb->s_firstdatazone + 1)
|
||||
+ return -1;
|
||||
+
|
||||
+ } else if (version == 3) {
|
||||
+ struct minix3_super_block *sb;
|
||||
+
|
||||
+ sb = blkid_probe_get_sb(pr, mag, struct minix3_super_block);
|
||||
+ if (!sb || sb->s_imap_blocks == 0 || sb->s_zmap_blocks == 0)
|
||||
+ return -1;
|
||||
+
|
||||
}
|
||||
+
|
||||
+ /* unfortunately, some parts of ext3 is sometimes possible to
|
||||
+ * interpreted as minix superblock. So check for extN magic
|
||||
+ * string. (For extN magic string and offsets see ext.c.)
|
||||
+ */
|
||||
+ ext = blkid_probe_get_buffer(pr, 0x400 + 0x38, 2);
|
||||
+ if (ext && memcmp(ext, "\123\357", 2) == 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ blkid_probe_sprintf_version(pr, "%d", version);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
|
||||
Backport from upstream to Fedora-12, original patch:
|
||||
|
||||
commit 832b3f2eb6a6c5f2e7d8db422767404320e45ced
|
||||
Author: Karel Zak <kzak@redhat.com>
|
||||
Date: Fri Nov 13 00:10:48 2009 +0100
|
||||
|
||||
libblkid: fix NTFS non-ASCII labels
|
||||
|
||||
Addresses-Red-Hat-Bug: #536797
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
|
||||
|
||||
diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c
|
||||
--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c.kzak 2009-11-30 12:43:13.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/ntfs.c 2009-12-07 10:34:10.000000000 +0100
|
||||
@@ -65,10 +65,9 @@ static int probe_ntfs(blkid_probe pr, co
|
||||
struct ntfs_super_block *ns;
|
||||
struct master_file_table_record *mft;
|
||||
struct file_attribute *attr;
|
||||
- unsigned char label_str[129], *cp;
|
||||
int bytes_per_sector, sectors_per_cluster;
|
||||
int mft_record_size, attr_off, attr_len;
|
||||
- unsigned int i, attr_type, val_len;
|
||||
+ unsigned int attr_type, val_len;
|
||||
int val_off;
|
||||
uint64_t nr_clusters;
|
||||
blkid_loff_t off;
|
||||
@@ -128,7 +127,6 @@ static int probe_ntfs(blkid_probe pr, co
|
||||
mft = (struct master_file_table_record *) buf_mft;
|
||||
|
||||
attr_off = le16_to_cpu(mft->attrs_offset);
|
||||
- label_str[0] = 0;
|
||||
|
||||
while (1) {
|
||||
attr = (struct file_attribute *) (buf_mft + attr_off);
|
||||
@@ -147,16 +145,8 @@ static int probe_ntfs(blkid_probe pr, co
|
||||
break;
|
||||
|
||||
if (attr_type == MFT_RECORD_ATTR_VOLUME_NAME) {
|
||||
- if (val_len > sizeof(label_str))
|
||||
- val_len = sizeof(label_str)-1;
|
||||
-
|
||||
- for (i=0, cp=label_str; i < val_len; i+=2,cp++) {
|
||||
- val = ((uint8_t *) attr) + val_off + i;
|
||||
- *cp = val[0];
|
||||
- if (val[1])
|
||||
- *cp = '?';
|
||||
- }
|
||||
- *cp = 0;
|
||||
+ val = ((uint8_t *) attr) + val_off;
|
||||
+ blkid_probe_set_utf8label(pr, val, val_len, BLKID_ENC_UTF16LE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,8 +154,6 @@ static int probe_ntfs(blkid_probe pr, co
|
||||
(unsigned char *) &ns->volume_serial,
|
||||
sizeof(ns->volume_serial),
|
||||
"%016" PRIX64, le64_to_cpu(ns->volume_serial));
|
||||
- if (label_str[0])
|
||||
- blkid_probe_set_label(pr, label_str, strlen((char *)label_str));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
diff -up util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c.kzak util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c
|
||||
--- util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c.kzak 2009-11-30 12:43:13.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/shlibs/blkid/src/probers/zfs.c 2010-02-17 10:31:33.000000000 +0100
|
||||
@@ -23,21 +23,22 @@ struct zfs_uberblock {
|
||||
uint64_t ub_txg; /* txg of last sync */
|
||||
uint64_t ub_guid_sum; /* sum of all vdev guids */
|
||||
uint64_t ub_timestamp; /* UTC time of last sync */
|
||||
- /*blkptr_t ub_rootbp;*/ /* MOS objset_phys_t */
|
||||
+ char ub_rootbp; /* MOS objset_phys_t */
|
||||
} __attribute__((packed));
|
||||
|
||||
static int probe_zfs(blkid_probe pr, const struct blkid_idmag *mag)
|
||||
{
|
||||
struct zfs_uberblock *ub;
|
||||
- int swab_endian;
|
||||
uint64_t spa_version;
|
||||
|
||||
ub = blkid_probe_get_sb(pr, mag, struct zfs_uberblock);
|
||||
if (!ub)
|
||||
return -1;
|
||||
|
||||
- swab_endian = (ub->ub_magic == swab64(UBERBLOCK_MAGIC));
|
||||
- spa_version = swab_endian ? swab64(ub->ub_version) : ub->ub_version;
|
||||
+ if (ub->ub_magic == be64_to_cpu(UBERBLOCK_MAGIC))
|
||||
+ spa_version = be64_to_cpu(ub->ub_version);
|
||||
+ else
|
||||
+ spa_version = le64_to_cpu(ub->ub_version);
|
||||
|
||||
blkid_probe_sprintf_version(pr, "%" PRIu64, spa_version);
|
||||
#if 0
|
||||
@@ -56,10 +57,19 @@ const struct blkid_idinfo zfs_idinfo =
|
||||
.probefunc = probe_zfs,
|
||||
.magics =
|
||||
{
|
||||
- { .magic = "\0\0\x02\xf5\xb0\x07\xb1\x0c", .len = 8, .kboff = 8 },
|
||||
- { .magic = "\x1c\xb1\x07\xb0\xf5\x02\0\0", .len = 8, .kboff = 8 },
|
||||
- { .magic = "\0\0\x02\xf5\xb0\x07\xb1\x0c", .len = 8, .kboff = 264 },
|
||||
- { .magic = "\x0c\xb1\x07\xb0\xf5\x02\0\0", .len = 8, .kboff = 264 },
|
||||
+ /* ZFS has 128 root blocks (#4 is the first used), check only 6 of them */
|
||||
+ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 128 },
|
||||
+ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 128 },
|
||||
+ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 132 },
|
||||
+ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 132 },
|
||||
+ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 136 },
|
||||
+ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 136 },
|
||||
+ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 384 },
|
||||
+ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 384 },
|
||||
+ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 388 },
|
||||
+ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 388 },
|
||||
+ { .magic = "\0\0\0\0\0\xba\xb1\x0c", .len = 8, .kboff = 392 },
|
||||
+ { .magic = "\x0c\xb1\xba\0\0\0\0\0", .len = 8, .kboff = 392 },
|
||||
{ NULL }
|
||||
}
|
||||
};
|
||||
diff -up util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs.kzak util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs
|
||||
--- util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs.kzak 2009-10-16 22:50:03.000000000 +0200
|
||||
+++ util-linux-ng-2.16.2/tests/expected/blkid/low-probe-zfs 2010-02-17 10:31:33.000000000 +0100
|
||||
@@ -1,3 +1,3 @@
|
||||
ID_FS_TYPE=zfs
|
||||
ID_FS_USAGE=filesystem
|
||||
-ID_FS_VERSION=1
|
||||
+ID_FS_VERSION=8
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
diff -up util-linux-ng-2.16.2/mount/mount.8.kzak util-linux-ng-2.16.2/mount/mount.8
|
||||
--- util-linux-ng-2.16.2/mount/mount.8.kzak 2009-11-30 15:54:35.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/mount/mount.8 2010-04-12 17:32:22.000000000 +0200
|
||||
@@ -439,6 +439,14 @@ This is necessary for example when
|
||||
.I /etc
|
||||
is on a read-only filesystem.
|
||||
.TP
|
||||
+.B \-\-no\-canonicalize
|
||||
+Don't canonicalize paths. The mount command canonicalizes all paths
|
||||
+(from command line or fstab) and stores canonicalized paths to the
|
||||
+.IR /etc/mtab
|
||||
+file. This option can be used together with the
|
||||
+.B \-f
|
||||
+flag for already canonicalized absolut paths.
|
||||
+.TP
|
||||
.BI \-p " num"
|
||||
In case of a loop mount with encryption, read the passphrase from
|
||||
file descriptor
|
||||
diff -up util-linux-ng-2.16.2/mount/mount.c.kzak util-linux-ng-2.16.2/mount/mount.c
|
||||
--- util-linux-ng-2.16.2/mount/mount.c.kzak 2010-04-12 17:40:39.000000000 +0200
|
||||
+++ util-linux-ng-2.16.2/mount/mount.c 2010-04-12 17:34:34.000000000 +0200
|
||||
@@ -1878,6 +1878,7 @@ static struct option longopts[] = {
|
||||
{ "make-rslave", 0, 0, 141 },
|
||||
{ "make-rprivate", 0, 0, 142 },
|
||||
{ "make-runbindable", 0, 0, 143 },
|
||||
+ { "no-canonicalize", 0, 0, 144 },
|
||||
{ "internal-only", 0, 0, 'i' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
@@ -2170,7 +2171,9 @@ main(int argc, char *argv[]) {
|
||||
case 143:
|
||||
mounttype = (MS_UNBINDABLE | MS_REC);
|
||||
break;
|
||||
-
|
||||
+ case 144:
|
||||
+ nocanonicalize = 1;
|
||||
+ break;
|
||||
case '?':
|
||||
default:
|
||||
usage (stderr, EX_USAGE);
|
||||
@@ -2209,7 +2212,8 @@ main(int argc, char *argv[]) {
|
||||
|
||||
if (restricted &&
|
||||
(types || options || readwrite || nomtab || mount_all ||
|
||||
- fake || mounttype || (argc + specseen) != 1)) {
|
||||
+ nocanonicalize || fake || mounttype || (argc + specseen) != 1)) {
|
||||
+
|
||||
die (EX_USAGE, _("mount: only root can do that"));
|
||||
}
|
||||
|
||||
diff -up util-linux-ng-2.16.2/mount/sundries.c.kzak util-linux-ng-2.16.2/mount/sundries.c
|
||||
--- util-linux-ng-2.16.2/mount/sundries.c.kzak 2009-11-30 15:42:33.000000000 +0100
|
||||
+++ util-linux-ng-2.16.2/mount/sundries.c 2010-04-12 17:29:49.000000000 +0200
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
int mount_quiet;
|
||||
int verbose;
|
||||
+int nocanonicalize;
|
||||
char *progname;
|
||||
|
||||
char *
|
||||
@@ -270,9 +271,9 @@ canonicalize_spec (const char *path)
|
||||
{
|
||||
char *res;
|
||||
|
||||
- if (path == NULL)
|
||||
+ if (!path)
|
||||
return NULL;
|
||||
- if (is_pseudo_fs(path))
|
||||
+ if (nocanonicalize || is_pseudo_fs(path))
|
||||
return xstrdup(path);
|
||||
|
||||
res = canonicalize_path(path);
|
||||
@@ -283,8 +284,14 @@ canonicalize_spec (const char *path)
|
||||
|
||||
char *canonicalize (const char *path)
|
||||
{
|
||||
- char *res = canonicalize_path(path);
|
||||
+ char *res;
|
||||
|
||||
+ if (!path)
|
||||
+ return NULL;
|
||||
+ else if (nocanonicalize)
|
||||
+ return xstrdup(path);
|
||||
+
|
||||
+ res = canonicalize_path(path);
|
||||
if (!res)
|
||||
die(EX_SYSERR, _("not enough memory"));
|
||||
return res;
|
||||
diff -up util-linux-ng-2.16.2/mount/sundries.h.kzak util-linux-ng-2.16.2/mount/sundries.h
|
||||
--- util-linux-ng-2.16.2/mount/sundries.h.kzak 2009-10-16 22:50:03.000000000 +0200
|
||||
+++ util-linux-ng-2.16.2/mount/sundries.h 2010-04-12 17:29:49.000000000 +0200
|
||||
@@ -16,6 +16,7 @@
|
||||
/* global mount, umount, and losetup variables */
|
||||
extern int mount_quiet;
|
||||
extern int verbose;
|
||||
+extern int nocanonicalize;
|
||||
extern char *progname;
|
||||
|
||||
#define streq(s, t) (strcmp ((s), (t)) == 0)
|
||||
diff -up util-linux-ng-2.16.2/mount/umount.8.kzak util-linux-ng-2.16.2/mount/umount.8
|
||||
--- util-linux-ng-2.16.2/mount/umount.8.kzak 2009-10-16 22:50:03.000000000 +0200
|
||||
+++ util-linux-ng-2.16.2/mount/umount.8 2010-04-12 17:34:44.000000000 +0200
|
||||
@@ -119,6 +119,10 @@ Lazy unmount. Detach the filesystem from
|
||||
and cleanup all references to the filesystem as soon as it is not busy
|
||||
anymore.
|
||||
(Requires kernel 2.4.11 or later.)
|
||||
+.IP "\fB\-\-no\-canonicalize\fP"
|
||||
+Don't canonicalize paths. For more details about this option see the
|
||||
+.B mount(8)
|
||||
+man page.
|
||||
|
||||
.SH "THE LOOP DEVICE"
|
||||
The
|
||||
diff -up util-linux-ng-2.16.2/mount/umount.c.kzak util-linux-ng-2.16.2/mount/umount.c
|
||||
--- util-linux-ng-2.16.2/mount/umount.c.kzak 2009-10-16 22:50:03.000000000 +0200
|
||||
+++ util-linux-ng-2.16.2/mount/umount.c 2010-04-12 17:34:44.000000000 +0200
|
||||
@@ -388,6 +388,8 @@ static struct option longopts[] =
|
||||
{ "version", 0, 0, 'V' },
|
||||
{ "read-only", 0, 0, 'r' },
|
||||
{ "types", 1, 0, 't' },
|
||||
+
|
||||
+ { "no-canonicalize", 0, 0, 144 },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -672,7 +674,10 @@ main (int argc, char *argv[]) {
|
||||
types = optarg;
|
||||
break;
|
||||
case 'i':
|
||||
- external_allowed = 0;
|
||||
+ external_allowed = 0;
|
||||
+ break;
|
||||
+ case 144:
|
||||
+ nocanonicalize = 1;
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
@@ -691,7 +696,8 @@ main (int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
- if (restricted && (all || types || nomtab || force || remount)) {
|
||||
+ if (restricted &&
|
||||
+ (all || types || nomtab || force || remount || nocanonicalize)) {
|
||||
die (2, _("umount: only root can do that"));
|
||||
}
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# This file and interface are deprecated.
|
||||
# Applications needing raw device access should open regular
|
||||
# block devices with O_DIRECT.
|
||||
#
|
||||
# Enter raw device bindings here.
|
||||
#
|
||||
# An example would be:
|
||||
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
|
||||
# to bind /dev/raw/raw1 to /dev/sda, or
|
||||
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
|
||||
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#%PAM-1.0
|
||||
auth sufficient pam_rootok.so
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#%PAM-1.0
|
||||
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
|
||||
auth include system-auth
|
||||
account required pam_nologin.so
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
# pam_selinux.so close should be the first session rule
|
||||
session required pam_selinux.so close
|
||||
session required pam_loginuid.so
|
||||
session optional pam_console.so
|
||||
# pam_selinux.so open should only be followed by sessions to be executed in the user context
|
||||
session required pam_selinux.so open
|
||||
session required pam_namespace.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include system-auth
|
||||
-session optional pam_ck_connector.so
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#%PAM-1.0
|
||||
auth required pam_securetty.so
|
||||
auth include password-auth
|
||||
account required pam_nologin.so
|
||||
account include password-auth
|
||||
password include password-auth
|
||||
# pam_selinux.so close should be the first session rule
|
||||
session required pam_selinux.so close
|
||||
session required pam_loginuid.so
|
||||
# pam_selinux.so open should only be followed by sessions to be executed in the user context
|
||||
session required pam_selinux.so open
|
||||
session required pam_namespace.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include password-auth
|
||||
2206
util-linux-ng.spec
2206
util-linux-ng.spec
File diff suppressed because it is too large
Load diff
74
uuidd.init
74
uuidd.init
|
|
@ -1,74 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# uuidd uuidd daemon for unique time-based UUID generation
|
||||
#
|
||||
# Author: Eric Sandeen <sandeen@redhat.com>
|
||||
#
|
||||
# chkconfig: - 60 99
|
||||
#
|
||||
# description: uuidd is a helper daemon to guarantee uniqueness of \
|
||||
# time-based UUIDs when using libuuid.
|
||||
# processname: uuidd
|
||||
# pidfile: /var/lib/libuuid/uuidd.pid
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: uuidd
|
||||
# Required-Start: $time $local_fs
|
||||
# Required-Stop: $time $local_fs
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: UUID daemon
|
||||
# Description: Daemon which guarantees uniqueness of time-based UUIDS
|
||||
# when using libuuid.
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
# source function library
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
RETVAL=0
|
||||
DAEMON=uuidd
|
||||
|
||||
start() {
|
||||
echo -n $"Starting uuidd: "
|
||||
daemon --user uuidd --pidfile /var/run/uuidd/uuidd.pid /usr/sbin/uuidd
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/uuidd
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping uuidd: "
|
||||
killproc uuidd
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/uuidd
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|force-reload|reload)
|
||||
restart
|
||||
;;
|
||||
condrestart)
|
||||
[ -f /var/lock/subsys/uuidd ] && restart
|
||||
;;
|
||||
status)
|
||||
status -p /var/run/uuidid/uuidd.pid uuidd uuidd
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
Loading…
Add table
Add a link
Reference in a new issue