Imported from util-linux-2.12pre tarball.

This commit is contained in:
Karel Zak 2006-12-07 00:26:13 +01:00
parent df1dddf9ff
commit a21409f54e
18 changed files with 655 additions and 812 deletions

View File

@ -1,11 +1,3 @@
util-linux 2.12
* losetup: -p option specifies fd for passphrase
* fdisk: sgi layout fix
* mount: -p option specifies fd for passphrase
* mount: recognize some PCDOS floppies
* umount: in "umount name", first try to interpret "name" as a mount point
util-linux 2.12pre util-linux 2.12pre
* Catalan messages (Antoni Bella Perez) * Catalan messages (Antoni Bella Perez)

View File

@ -1 +1 @@
2.12 2.12pre

View File

@ -190,10 +190,12 @@ check_sgi_label() {
void void
sgi_list_table(int xtra) { sgi_list_table(int xtra) {
int i, w, wd; int i, w;
int kpi = 0; /* kernel partition ID */ int kpi = 0; /* kernel partition ID */
char *type; char *type;
w = strlen(disk_device);
if (xtra) { if (xtra) {
printf(_("\nDisk %s (SGI disk label): %d heads, %d sectors\n" printf(_("\nDisk %s (SGI disk label): %d heads, %d sectors\n"
"%d cylinders, %d physical cylinders\n" "%d cylinders, %d physical cylinders\n"
@ -213,15 +215,9 @@ sgi_list_table(int xtra) {
disk_device, heads, sectors, cylinders, disk_device, heads, sectors, cylinders,
str_units(PLURAL), units_per_sector); str_units(PLURAL), units_per_sector);
} }
w = strlen(disk_device);
wd = strlen(_("Device"));
if (w < wd)
w = wd;
printf(_("----- partitions -----\n" printf(_("----- partitions -----\n"
"Pt# %*s Info Start End Sectors Id System\n"), "Pt# %*s Info Start End Sectors Id System\n"),
w + 2, _("Device")); w + 1, _("Device"));
for (i = 0 ; i < partitions; i++) { for (i = 0 ; i < partitions; i++) {
if (sgi_get_num_sectors(i) || debug) { if (sgi_get_num_sectors(i) || debug) {
__u32 start = sgi_get_start_sector(i); __u32 start = sgi_get_start_sector(i);
@ -230,7 +226,7 @@ sgi_list_table(int xtra) {
printf( printf(
"%2d: %s %4s %9ld %9ld %9ld %2x %s\n", "%2d: %s %4s %9ld %9ld %9ld %2x %s\n",
/* fdisk part number */ i+1, /* fdisk part number */ i+1,
/* device */ partname(disk_device, kpi, w+3), /* device */ partname(disk_device, kpi, w+2),
/* flags */ (sgi_get_swappartition() == i) ? "swap" : /* flags */ (sgi_get_swappartition() == i) ? "swap" :
/* flags */ (sgi_get_bootpartition() == i) ? "boot" : " ", /* flags */ (sgi_get_bootpartition() == i) ? "boot" : " ",
/* start */ (long) scround(start), /* start */ (long) scround(start),

View File

@ -72,7 +72,7 @@ mount.o: $(LIB)/setproctitle.h
mount.o umount.o getusername.o: getusername.h mount.o umount.o getusername.o: getusername.h
mount.o umount.o losetup.o lomount.o: lomount.h loop.h my_dev_t.h mount.o umount.o losetup.o lomount.o: lomount.h loop.h
swapon.o: swap_constants.h swapargs.h swapon.o: swap_constants.h swapargs.h
@ -118,9 +118,12 @@ nfsmount.o: nfs_mount4.h
swapargs.h: swapargs.h:
sh swap.configure sh swap.configure
loop.h:
sh mk_loop_h
clean: clean:
rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE) rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE)
rm -f nfs_mountversion.h rm -f loop.h nfs_mountversion.h
clobber distclean realclean: clean clobber distclean realclean: clean
rm -f $(GEN_FILES) rm -f $(GEN_FILES)

View File

@ -100,7 +100,7 @@ read_mntentchn(mntFILE *mfp, const char *fnam, struct mntentchn *mc0) {
struct mntent *mnt; struct mntent *mnt;
while ((mnt = my_getmntent (mfp)) != NULL) { while ((mnt = my_getmntent (mfp)) != NULL) {
if (!streq(mnt->mnt_type, MNTTYPE_IGNORE)) { if (!streq (mnt->mnt_type, MNTTYPE_IGNORE)) {
mc->nxt = (struct mntentchn *) xmalloc(sizeof(*mc)); mc->nxt = (struct mntentchn *) xmalloc(sizeof(*mc));
mc->nxt->prev = mc; mc->nxt->prev = mc;
mc = mc->nxt; mc = mc->nxt;
@ -179,62 +179,30 @@ getmntfile (const char *name) {
mc0 = mtab_head(); mc0 = mtab_head();
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if (streq(mc->m.mnt_dir, name) || if (streq (mc->m.mnt_dir, name) ||
streq(mc->m.mnt_fsname, name)) streq (mc->m.mnt_fsname, name))
return mc; return mc;
return NULL; return NULL;
} }
/* /*
* Given the directory name NAME, and the place MCPREV we found it last time, * Given the name NAME, and the place MCPREV we found it last time,
* try to find more occurrences. * try to find more occurrences.
*/ */
struct mntentchn * struct mntentchn *
getmntdirbackward (const char *name, struct mntentchn *mcprev) { getmntfilesbackward (const char *name, struct mntentchn *mcprev) {
struct mntentchn *mc, *mc0; struct mntentchn *mc, *mc0;
mc0 = mtab_head(); mc0 = mtab_head();
if (!mcprev) if (!mcprev)
mcprev = mc0; mcprev = mc0;
for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev) for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
if (streq(mc->m.mnt_dir, name)) if (streq (mc->m.mnt_dir, name) ||
streq (mc->m.mnt_fsname, name))
return mc; return mc;
return NULL; return NULL;
} }
/*
* Given the device name NAME, and the place MCPREV we found it last time,
* try to find more occurrences.
*/
struct mntentchn *
getmntdevbackward (const char *name, struct mntentchn *mcprev) {
struct mntentchn *mc, *mc0;
mc0 = mtab_head();
if (!mcprev)
mcprev = mc0;
for (mc = mcprev->prev; mc && mc != mc0; mc = mc->prev)
if (streq(mc->m.mnt_fsname, name))
return mc;
return NULL;
}
/*
* Given the name NAME, check that it occurs precisely once as dir or dev.
*/
int
is_mounted_once(const char *name) {
struct mntentchn *mc, *mc0;
int ct = 0;
mc0 = mtab_head();
for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev)
if (streq(mc->m.mnt_dir, name) ||
streq(mc->m.mnt_fsname, name))
ct++;
return (ct == 1);
}
/* Given the name FILE, try to find the option "loop=FILE" in mtab. */ /* Given the name FILE, try to find the option "loop=FILE" in mtab. */
struct mntentchn * struct mntentchn *
getmntoptfile (const char *file) { getmntoptfile (const char *file) {
@ -285,29 +253,29 @@ getfsspecfile (const char *spec, const char *file) {
/* first attempt: names occur precisely as given */ /* first attempt: names occur precisely as given */
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if (streq(mc->m.mnt_dir, file) && if (streq (mc->m.mnt_dir, file) &&
streq(mc->m.mnt_fsname, spec)) streq (mc->m.mnt_fsname, spec))
return mc; return mc;
/* second attempt: names found after symlink resolution */ /* second attempt: names found after symlink resolution */
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if ((streq(mc->m.mnt_dir, file) || if ((streq (mc->m.mnt_dir, file) ||
streq(canonicalize(mc->m.mnt_dir), file)) streq (canonicalize(mc->m.mnt_dir), file))
&& (streq(mc->m.mnt_fsname, spec) || && (streq (mc->m.mnt_fsname, spec) ||
streq(canonicalize(mc->m.mnt_fsname), spec))) streq (canonicalize(mc->m.mnt_fsname), spec)))
return mc; return mc;
/* third attempt: names found after LABEL= or UUID= resolution */ /* third attempt: names found after LABEL= or UUID= resolution */
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) { for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) {
if (!strncmp (mc->m.mnt_fsname, "LABEL=", 6) && if (!strncmp (mc->m.mnt_fsname, "LABEL=", 6) &&
(streq(mc->m.mnt_dir, file) || (streq (mc->m.mnt_dir, file) ||
streq(canonicalize(mc->m.mnt_dir), file))) { streq (canonicalize(mc->m.mnt_dir), file))) {
if (has_label(spec, mc->m.mnt_fsname+6)) if (has_label(spec, mc->m.mnt_fsname+6))
return mc; return mc;
} }
if (!strncmp (mc->m.mnt_fsname, "UUID=", 5) && if (!strncmp (mc->m.mnt_fsname, "UUID=", 5) &&
(streq(mc->m.mnt_dir, file) || (streq (mc->m.mnt_dir, file) ||
streq(canonicalize(mc->m.mnt_dir), file))) { streq (canonicalize(mc->m.mnt_dir), file))) {
if (has_uuid(spec, mc->m.mnt_fsname+5)) if (has_uuid(spec, mc->m.mnt_fsname+5))
return mc; return mc;
} }
@ -322,7 +290,7 @@ getfsfile (const char *file) {
mc0 = fstab_head(); mc0 = fstab_head();
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if (streq(mc->m.mnt_dir, file)) if (streq (mc->m.mnt_dir, file))
return mc; return mc;
return NULL; return NULL;
} }
@ -334,7 +302,7 @@ getfsspec (const char *spec) {
mc0 = fstab_head(); mc0 = fstab_head();
for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt) for (mc = mc0->nxt; mc && mc != mc0; mc = mc->nxt)
if (streq(mc->m.mnt_fsname, spec)) if (streq (mc->m.mnt_fsname, spec))
return mc; return mc;
return NULL; return NULL;
} }
@ -563,7 +531,7 @@ update_mtab (const char *dir, struct mntent *instead) {
/* find last occurrence of dir */ /* find last occurrence of dir */
for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev) for (mc = mc0->prev; mc && mc != mc0; mc = mc->prev)
if (streq(mc->m.mnt_dir, dir)) if (streq (mc->m.mnt_dir, dir))
break; break;
if (mc && mc != mc0) { if (mc && mc != mc0) {
if (instead == NULL) { if (instead == NULL) {

View File

@ -12,7 +12,6 @@
int mtab_is_writable(void); int mtab_is_writable(void);
int mtab_does_not_exist(void); int mtab_does_not_exist(void);
int mtab_is_a_symlink(void); int mtab_is_a_symlink(void);
int is_mounted_once(const char *name);
struct mntentchn { struct mntentchn {
struct mntentchn *nxt, *prev; struct mntentchn *nxt, *prev;
@ -22,8 +21,7 @@ struct mntentchn {
struct mntentchn *mtab_head (void); struct mntentchn *mtab_head (void);
struct mntentchn *getmntfile (const char *name); struct mntentchn *getmntfile (const char *name);
struct mntentchn *getmntoptfile (const char *file); struct mntentchn *getmntoptfile (const char *file);
struct mntentchn *getmntdirbackward (const char *dir, struct mntentchn *mc); struct mntentchn *getmntfilesbackward (const char *file, struct mntentchn *mc);
struct mntentchn *getmntdevbackward (const char *dev, struct mntentchn *mc);
struct mntentchn *fstab_head (void); struct mntentchn *fstab_head (void);
struct mntentchn *getfsfile (const char *file); struct mntentchn *getfsfile (const char *file);

37
mount/h/loop.h Normal file
View File

@ -0,0 +1,37 @@
/*
* include/linux/loop.h
*
* Written by Theodore Ts'o, 3/29/93.
*
* Copyright 1993 by Theodore Ts'o. Redistribution of this file is
* permitted under the GNU Public License.
*/
#define LO_NAME_SIZE 64
#define LO_KEY_SIZE 32
struct loop_info {
int lo_number; /* ioctl r/o */
dev_t lo_device; /* ioctl r/o */
unsigned long lo_inode; /* ioctl r/o */
dev_t lo_rdevice; /* ioctl r/o */
int lo_offset;
int lo_encrypt_type;
int lo_encrypt_key_size; /* ioctl w/o */
int lo_flags; /* ioctl r/o */
char lo_name[LO_NAME_SIZE];
unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
unsigned long lo_init[2];
char reserved[4];
};
#define LO_CRYPT_NONE 0
#define LO_CRYPT_XOR 1
#define LO_CRYPT_DES 2
#define LO_CRYPT_IDEA 3
#define MAX_LO_CRYPT 4
#define LOOP_SET_FD 0x4C00
#define LOOP_CLR_FD 0x4C01
#define LOOP_SET_STATUS 0x4C02
#define LOOP_GET_STATUS 0x4C03

View File

@ -2,18 +2,13 @@
/* Added vfs mount options - aeb - 960223 */ /* Added vfs mount options - aeb - 960223 */
/* Removed lomount - aeb - 960224 */ /* Removed lomount - aeb - 960224 */
/* /* 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
* 1999-02-22 Arkadiusz Mikiewicz <misiek@pld.ORG.PL>
* - added Native Language Support * - added Native Language Support
* 1999-03-21 Arnaldo Carvalho de Melo <acme@conectiva.com.br> * Sun Mar 21 1999 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* - fixed strerr(errno) in gettext calls * - fixed strerr(errno) in gettext calls
* 2000-09-24 Marc Mutz <Marc@Mutz.com>
* - added -p option to pass passphrases via fd's to losetup/mount.
* Used for encryption in non-interactive environments.
* The idea behind xgetpass() is stolen from GnuPG, v.1.0.3.
*/ */
#define LOOPMAJOR 7 #define PROC_DEVICES "/proc/devices"
/* /*
* losetup.c - setup and control loop devices * losetup.c - setup and control loop devices
@ -41,114 +36,93 @@ extern char *xstrdup (const char *s); /* not: #include "sundries.h" */
extern void error (const char *fmt, ...); /* idem */ extern void error (const char *fmt, ...); /* idem */
#ifdef LOOP_SET_FD #ifdef LOOP_SET_FD
struct crypt_type_struct {
int id;
char *name;
} crypt_type_tbl[] = {
{ LO_CRYPT_NONE, "no" },
{ LO_CRYPT_NONE, "none" },
{ LO_CRYPT_XOR, "xor" },
{ LO_CRYPT_DES, "DES" },
{ -1, NULL }
};
static int static int
loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info) crypt_type (const char *name) {
{ int i;
memset(info, 0, sizeof(*info));
info->lo_number = info64->lo_number;
info->lo_device = info64->lo_device;
info->lo_inode = info64->lo_inode;
info->lo_rdevice = info64->lo_rdevice;
info->lo_offset = info64->lo_offset;
info->lo_encrypt_type = info64->lo_encrypt_type;
info->lo_encrypt_key_size = info64->lo_encrypt_key_size;
info->lo_flags = info64->lo_flags;
info->lo_init[0] = info64->lo_init[0];
info->lo_init[1] = info64->lo_init[1];
if (info->lo_encrypt_type == LO_CRYPT_CRYPTOAPI)
memcpy(info->lo_name, info64->lo_crypt_name, LO_NAME_SIZE);
else
memcpy(info->lo_name, info64->lo_file_name, LO_NAME_SIZE);
memcpy(info->lo_encrypt_key, info64->lo_encrypt_key, LO_KEY_SIZE);
/* error in case values were truncated */ if (name) {
if (info->lo_device != info64->lo_device || for (i = 0; crypt_type_tbl[i].id != -1; i++)
info->lo_rdevice != info64->lo_rdevice || if (!strcasecmp (name, crypt_type_tbl[i].name))
info->lo_inode != info64->lo_inode || return crypt_type_tbl[i].id;
info->lo_offset != info64->lo_offset) }
return -EOVERFLOW; return -1;
return 0;
} }
#ifdef MAIN #ifdef MAIN
static char *
crypt_name (int id) {
int i;
for (i = 0; crypt_type_tbl[i].id != -1; i++)
if (id == crypt_type_tbl[i].id)
return crypt_type_tbl[i].name;
return "undefined";
}
static int static int
show_loop(char *device) { show_loop (char *device) {
struct loop_info loopinfo; struct loop_info loopinfo;
struct loop_info64 loopinfo64; int fd;
int fd, errsv;
if ((fd = open(device, O_RDONLY)) < 0) { if ((fd = open (device, O_RDONLY)) < 0) {
int errsv = errno; int errsv = errno;
fprintf(stderr, _("loop: can't open device %s: %s\n"), fprintf(stderr, _("loop: can't open device %s: %s\n"),
device, strerror (errsv)); device, strerror (errsv));
return 2; return 2;
} }
if (ioctl (fd, LOOP_GET_STATUS, &loopinfo) < 0) {
if (ioctl(fd, LOOP_GET_STATUS64, &loopinfo64) == 0) { int errsv = errno;
fprintf(stderr, _("loop: can't get info on device %s: %s\n"),
loopinfo64.lo_file_name[LO_NAME_SIZE-2] = '*'; device, strerror (errsv));
loopinfo64.lo_file_name[LO_NAME_SIZE-1] = 0;
loopinfo64.lo_crypt_name[LO_NAME_SIZE-1] = 0;
printf("%s: [%04llx]:%llu (%s)",
device, loopinfo64.lo_device, loopinfo64.lo_inode,
loopinfo64.lo_file_name);
if (loopinfo64.lo_offset)
printf(_(", offset %lld"), loopinfo64.lo_offset);
if (loopinfo64.lo_sizelimit)
printf(_(", sizelimit %lld"), loopinfo64.lo_sizelimit);
if (loopinfo64.lo_encrypt_type ||
loopinfo64.lo_crypt_name[0]) {
char *e = loopinfo64.lo_crypt_name;
if (*e == 0 && loopinfo64.lo_encrypt_type == 1)
e = "XOR";
printf(_(", encryption %s (type %d)"),
e, loopinfo64.lo_encrypt_type);
}
printf("\n");
close (fd); close (fd);
return 0; return 1;
} }
printf (_("%s: [%04x]:%ld (%s) offset %d, %s encryption\n"),
if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) == 0) { device, loopinfo.lo_device, loopinfo.lo_inode,
printf ("%s: [%04x]:%ld (%s)", loopinfo.lo_name, loopinfo.lo_offset,
device, loopinfo.lo_device, loopinfo.lo_inode, crypt_name (loopinfo.lo_encrypt_type));
loopinfo.lo_name);
if (loopinfo.lo_offset)
printf(_(", offset %d"), loopinfo.lo_offset);
if (loopinfo.lo_encrypt_type)
printf(_(", encryption type %d\n"),
loopinfo.lo_encrypt_type);
printf("\n");
close (fd);
return 0;
}
errsv = errno;
fprintf(stderr, _("loop: can't get info on device %s: %s\n"),
device, strerror (errsv));
close (fd); close (fd);
return 1;
return 0;
} }
#endif #endif
int int
is_loop_device (const char *device) { is_loop_device (const char *device) {
struct stat statbuf; struct stat statbuf;
int loopmajor;
#if 1
loopmajor = 7;
#else
FILE *procdev;
char line[100], *cp;
return (stat(device, &statbuf) == 0 && loopmajor = 0;
if ((procdev = fopen(PROC_DEVICES, "r")) != NULL) {
while (fgets (line, sizeof(line), procdev)) {
if ((cp = strstr (line, " loop\n")) != NULL) {
*cp='\0';
loopmajor=atoi(line);
break;
}
}
fclose(procdev);
}
#endif
return (loopmajor && stat(device, &statbuf) == 0 &&
S_ISBLK(statbuf.st_mode) && S_ISBLK(statbuf.st_mode) &&
major(statbuf.st_rdev) == LOOPMAJOR); major(statbuf.st_rdev) == loopmajor);
} }
#define SIZE(a) (sizeof(a)/sizeof(a[0])) #define SIZE(a) (sizeof(a)/sizeof(a[0]))
@ -160,9 +134,10 @@ find_unused_loop_device (void) {
So, we just try /dev/loop[0-7]. */ So, we just try /dev/loop[0-7]. */
char dev[20]; char dev[20];
char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" }; char *loop_formats[] = { "/dev/loop%d", "/dev/loop/%d" };
int i, j, fd, somedev = 0, someloop = 0; int i, j, fd, somedev = 0, someloop = 0, loop_known = 0;
struct stat statbuf; struct stat statbuf;
struct loop_info loopinfo; struct loop_info loopinfo;
FILE *procdev;
for (j = 0; j < SIZE(loop_formats); j++) { for (j = 0; j < SIZE(loop_formats); j++) {
for(i = 0; i < 256; i++) { for(i = 0; i < 256; i++) {
@ -185,103 +160,73 @@ find_unused_loop_device (void) {
} }
} }
/* Nothing found. Why not? */
if ((procdev = fopen(PROC_DEVICES, "r")) != NULL) {
char line[100];
while (fgets (line, sizeof(line), procdev))
if (strstr (line, " loop\n")) {
loop_known = 1;
break;
}
fclose(procdev);
if (!loop_known)
loop_known = -1;
}
if (!somedev) if (!somedev)
error(_("mount: could not find any device /dev/loop#")); error(_("mount: could not find any device /dev/loop#"));
else if (!someloop) { else if (!someloop) {
if (loop_known == 1)
error(_( error(_(
"mount: Could not find any loop device. Maybe this kernel " "mount: Could not find any loop device.\n"
"does not know\n" " Maybe /dev/loop# has a wrong major number?"));
" about the loop device? (If so, recompile or " else if (loop_known == -1)
"`modprobe loop'.)")); error(_(
"mount: Could not find any loop device, and, according to %s,\n"
" this kernel does not know about the loop device.\n"
" (If so, then recompile or `insmod loop.o'.)"),
PROC_DEVICES);
else
error(_(
"mount: Could not find any loop device. Maybe this kernel does not know\n"
" about the loop device (then recompile or `insmod loop.o'), or\n"
" maybe /dev/loop# has the wrong major number?"));
} else } else
error(_("mount: could not find any free loop device")); error(_("mount: could not find any free loop device"));
return 0; return 0;
} }
/*
* A function to read the passphrase either from the terminal or from
* an open file descriptor.
*/
static char *
xgetpass(int pfd, const char *prompt) {
char *pass;
int buflen, i;
if (pfd < 0) /* terminal */
return getpass(prompt);
pass = NULL;
buflen = 0;
for (i=0; ; i++) {
if (i >= buflen-1) {
/* we're running out of space in the buffer.
* Make it bigger: */
char *tmppass = pass;
buflen += 128;
pass = realloc(tmppass, buflen);
if (pass == NULL) {
/* realloc failed. Stop reading. */
error("Out of memory while reading passphrase");
pass = tmppass; /* the old buffer hasn't changed */
break;
}
}
if (read(pfd, pass+i, 1) != 1 || pass[i] == '\n')
break;
}
if (pass == NULL)
return "";
else {
pass[i] = 0;
return pass;
}
}
static int
digits_only(const char *s) {
while (*s)
if (!isdigit(*s++))
return 0;
return 1;
}
int int
set_loop(const char *device, const char *file, int offset, set_loop (const char *device, const char *file, int offset,
const char *encryption, int pfd, int *loopro) { const char *encryption, int *loopro) {
struct loop_info64 loopinfo64; struct loop_info loopinfo;
int fd, ffd, mode; int fd, ffd, mode, i;
char *pass; char *pass;
mode = (*loopro ? O_RDONLY : O_RDWR); mode = (*loopro ? O_RDONLY : O_RDWR);
if ((ffd = open(file, mode)) < 0) { if ((ffd = open (file, mode)) < 0) {
if (!*loopro && errno == EROFS) if (!*loopro && errno == EROFS)
ffd = open(file, mode = O_RDONLY); ffd = open (file, mode = O_RDONLY);
if (ffd < 0) { if (ffd < 0) {
perror(file); perror (file);
return 1; return 1;
} }
} }
if ((fd = open(device, mode)) < 0) { if ((fd = open (device, mode)) < 0) {
perror (device); perror (device);
return 1; return 1;
} }
*loopro = (mode == O_RDONLY); *loopro = (mode == O_RDONLY);
memset(&loopinfo64, 0, sizeof(loopinfo64)); memset (&loopinfo, 0, sizeof (loopinfo));
xstrncpy (loopinfo.lo_name, file, LO_NAME_SIZE);
xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE); if (encryption && (loopinfo.lo_encrypt_type = crypt_type (encryption))
< 0) {
if (encryption && *encryption) { fprintf (stderr, _("Unsupported encryption type %s\n"),
if (digits_only(encryption)) { encryption);
loopinfo64.lo_encrypt_type = atoi(encryption); return 1;
} else {
loopinfo64.lo_encrypt_type = LO_CRYPT_CRYPTOAPI;
snprintf(loopinfo64.lo_crypt_name, LO_NAME_SIZE,
"%s", encryption);
}
} }
loopinfo.lo_offset = offset;
loopinfo64.lo_offset = offset;
#ifdef MCL_FUTURE #ifdef MCL_FUTURE
/* /*
@ -296,55 +241,53 @@ set_loop(const char *device, const char *file, int offset,
} }
#endif #endif
switch (loopinfo64.lo_encrypt_type) { switch (loopinfo.lo_encrypt_type) {
case LO_CRYPT_NONE: case LO_CRYPT_NONE:
loopinfo64.lo_encrypt_key_size = 0; loopinfo.lo_encrypt_key_size = 0;
break; break;
case LO_CRYPT_XOR: case LO_CRYPT_XOR:
pass = getpass(_("Password: ")); pass = getpass (_("Password: "));
xstrncpy(loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE); xstrncpy (loopinfo.lo_encrypt_key, pass, LO_KEY_SIZE);
loopinfo64.lo_encrypt_key_size = loopinfo.lo_encrypt_key_size = strlen(loopinfo.lo_encrypt_key);
strlen(loopinfo64.lo_encrypt_key); break;
case LO_CRYPT_DES:
pass = getpass (_("Password: "));
strncpy (loopinfo.lo_encrypt_key, pass, 8);
loopinfo.lo_encrypt_key[8] = 0;
loopinfo.lo_encrypt_key_size = 8;
pass = getpass (_("Init (up to 16 hex digits): "));
for (i = 0; i < 16 && pass[i]; i++)
if (isxdigit (pass[i])) {
loopinfo.lo_init[i >> 3] |= (pass[i] > '9' ?
(islower (pass[i]) ? toupper (pass[i]) :
pass[i])-'A'+10 : pass[i]-'0') << (i&7) * 4;
} else {
fprintf (stderr, _("Non-hex digit '%c'.\n"),
pass[i]);
return 1;
}
break; break;
default: default:
pass = xgetpass(pfd, _("Password: ")); fprintf (stderr,
xstrncpy(loopinfo64.lo_encrypt_key, pass, LO_KEY_SIZE); _("Don't know how to get key for encryption system %d\n"),
loopinfo64.lo_encrypt_key_size = LO_KEY_SIZE; loopinfo.lo_encrypt_type);
}
if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
perror("ioctl: LOOP_SET_FD");
return 1; return 1;
} }
close (ffd); if (ioctl (fd, LOOP_SET_FD, ffd) < 0) {
perror ("ioctl: LOOP_SET_FD");
if (ioctl(fd, LOOP_SET_STATUS64, &loopinfo64) < 0) { return 1;
struct loop_info loopinfo; }
int errsv = errno; if (ioctl (fd, LOOP_SET_STATUS, &loopinfo) < 0) {
(void) ioctl (fd, LOOP_CLR_FD, 0);
errno = loop_info64_to_old(&loopinfo64, &loopinfo); perror ("ioctl: LOOP_SET_STATUS");
if (errno) { return 1;
errno = errsv;
perror("ioctl: LOOP_SET_STATUS64");
goto fail;
}
if (ioctl(fd, LOOP_SET_STATUS, &loopinfo) < 0) {
perror("ioctl: LOOP_SET_STATUS");
goto fail;
}
} }
close (fd); close (fd);
close (ffd);
if (verbose > 1) if (verbose > 1)
printf(_("set_loop(%s,%s,%d): success\n"), printf(_("set_loop(%s,%s,%d): success\n"),
device, file, offset); device, file, offset);
return 0; return 0;
fail:
(void) ioctl (fd, LOOP_CLR_FD, 0);
close (fd);
return 1;
} }
int int
@ -445,34 +388,29 @@ error (const char *fmt, ...) {
int int
main(int argc, char **argv) { main(int argc, char **argv) {
char *offset, *encryption, *passfd; char *offset, *encryption;
int delete, off, c; int delete,off,c;
int res = 0; int res = 0;
int ro = 0; int ro = 0;
int pfd = -1;
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR); bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE); textdomain(PACKAGE);
delete = off = 0; delete = off = 0;
offset = encryption = passfd = NULL; offset = encryption = NULL;
progname = argv[0]; progname = argv[0];
while ((c = getopt(argc,argv,"de:E:o:p:v")) != -1) { while ((c = getopt(argc,argv,"de:o:v")) != -1) {
switch (c) { switch (c) {
case 'd': case 'd':
delete = 1; delete = 1;
break; break;
case 'E':
case 'e': case 'e':
encryption = optarg; encryption = optarg;
break; break;
case 'o': case 'o':
offset = optarg; offset = optarg;
break; break;
case 'p':
passfd = optarg;
break;
case 'v': case 'v':
verbose = 1; verbose = 1;
break; break;
@ -492,10 +430,7 @@ main(int argc, char **argv) {
} else { } else {
if (offset && sscanf(offset,"%d",&off) != 1) if (offset && sscanf(offset,"%d",&off) != 1)
usage(); usage();
if (passfd && sscanf(passfd,"%d",&pfd) != 1) res = set_loop(argv[optind],argv[optind+1],off,encryption,&ro);
usage();
res = set_loop(argv[optind], argv[optind+1], off,
encryption, pfd, &ro);
} }
return res; return res;
} }

View File

@ -1,6 +1,5 @@
extern int verbose; extern int verbose;
extern int set_loop(const char *, const char *, int, const char *, extern int set_loop (const char *, const char *, int, const char *, int *);
int, int *); extern int del_loop (const char *);
extern int del_loop(const char *); extern int is_loop_device (const char *);
extern int is_loop_device(const char *); extern char * find_unused_loop_device (void);
extern char * find_unused_loop_device(void);

View File

@ -1,51 +0,0 @@
#define LO_CRYPT_NONE 0
#define LO_CRYPT_XOR 1
#define LO_CRYPT_DES 2
#define LO_CRYPT_CRYPTOAPI 18
#define LOOP_SET_FD 0x4C00
#define LOOP_CLR_FD 0x4C01
#define LOOP_SET_STATUS 0x4C02
#define LOOP_GET_STATUS 0x4C03
#define LOOP_SET_STATUS64 0x4C04
#define LOOP_GET_STATUS64 0x4C05
#define LO_NAME_SIZE 64
#define LO_KEY_SIZE 32
#include "my_dev_t.h"
struct loop_info {
int lo_number;
my_dev_t lo_device;
unsigned long lo_inode;
my_dev_t lo_rdevice;
int lo_offset;
int lo_encrypt_type;
int lo_encrypt_key_size;
int lo_flags;
char lo_name[LO_NAME_SIZE];
unsigned char lo_encrypt_key[LO_KEY_SIZE];
unsigned long lo_init[2];
char reserved[4];
};
/*
* Where to get __u8, __u32, __u64? Let us use unsigned char/int/long long
* and get punished when someone comes with 128-bit long longs.
*/
struct loop_info64 {
unsigned long long lo_device;
unsigned long long lo_inode;
unsigned long long lo_rdevice;
unsigned long long lo_offset;
unsigned long long lo_sizelimit; /* bytes, 0 == max available */
unsigned int lo_number;
unsigned int lo_encrypt_type;
unsigned int lo_encrypt_key_size;
unsigned int lo_flags;
unsigned char lo_file_name[LO_NAME_SIZE];
unsigned char lo_crypt_name[LO_NAME_SIZE];
unsigned char lo_encrypt_key[LO_KEY_SIZE];
unsigned long long lo_init[2];
};

View File

@ -1,18 +1,15 @@
.TH LOSETUP 8 "2003-07-01" "Linux" "MAINTENANCE COMMANDS" .TH LOSETUP 8 "Nov 24 1993" "Linux" "MAINTENANCE COMMANDS"
.SH NAME .SH NAME
losetup \- set up and control loop devices losetup \- set up and control loop devices
.SH SYNOPSIS .SH SYNOPSIS
.ad l .ad l
.B losetup .B losetup
[ [
.RB [ \-e | \-E ] .B \-e
.I encryption .I encryption
] [ ] [
.B \-o .B \-o
.I offset .I offset
] [
.B \-p
.I pfd
] ]
.I loop_device file .I loop_device file
.br .br
@ -28,41 +25,27 @@ 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. If only the to detach loop devices and to query the status of a loop device. If only the
\fIloop_device\fP argument is given, the status of the corresponding loop \fIloop_device\fP argument is given, the status of the corresponding loop
device is shown. device is shown.
.SS "Encryption"
It is possible to specify transfer functions (for encryption/decryption
or other purposes) using one of the
.B \-E
and
.B \-e
options.
There are two mechanisms to specify the desired encryption: by number
and by name. If an encryption is specified by number then one
has to make sure that the Linux kernel knows about the encryption with that
number, probably by patching the kernel. Standard numbers that are
always present are 0 (no encryption) and 1 (XOR encryption).
When the cryptoloop module is loaded (or compiled in), it uses number 18.
This cryptoloop module wil take the name of an arbitrary encryption type
and finds the module that knows how to perform that encryption.
(Thus, either one uses a number different from 18 with the
.B \-E
option, or one uses a name with the
.B \-e
option.)
.SH OPTIONS .SH OPTIONS
.IP \fB\-d\fP .IP \fB\-d\fP
Detach the file or device associated with the specified loop device. detach the file or device associated with the specified loop device.
.IP "\fB\-E \fIencryption_type\fP" .IP "\fB\-e \fIencryption\fP"
Enable data encryption with specified number. .RS
.IP "\fB\-e \fIencryption_name\fP" enable data encryption. The following keywords are recognized:
Enable data encryption with specified name. .IP \fBNONE\fP
use no encryption (default).
.PD 0
.IP \fBXOR\fP
use a simple XOR encryption.
.IP \fBDES\fP
use DES encryption. DES encryption is only available if the optional
DES package has been added to the kernel. DES encryption uses an additional
start value that is used to protect passwords against dictionary
attacks.
.PD
.RE
.IP "\fB\-o \fIoffset\fP" .IP "\fB\-o \fIoffset\fP"
The data start is moved \fIoffset\fP bytes into the specified file or the data start is moved \fIoffset\fP bytes into the specified file or
device. device.
.IP "\fB\-p \fInum\fP"
Read the passphrase from file descriptor with number
.I num
instead of from the terminal.
.SH RETURN VALUE .SH RETURN VALUE
.B losetup .B losetup
returns 0 on success, nonzero on failure. When returns 0 on success, nonzero on failure. When
@ -74,7 +57,7 @@ from determining the status of the device.
.SH FILES .SH FILES
.nf .nf
/dev/loop0, /dev/loop1, ... loop devices (major=7) /dev/loop0,/dev/loop1,... loop devices (major=7)
.fi .fi
.SH EXAMPLE .SH EXAMPLE
If you are using the loadable module you must have the module loaded If you are using the loadable module you must have the module loaded
@ -82,23 +65,18 @@ first with the command
.IP .IP
# insmod loop.o # insmod loop.o
.LP .LP
Maybe also encryption modules are needed.
.IP
# insmod des.o
# insmod cryptoloop.o
.LP
The following commands can be used as an example of using the loop device. The following commands can be used as an example of using the loop device.
.nf .nf
.IP .IP
# dd if=/dev/zero of=/file bs=1k count=100 dd if=/dev/zero of=/file bs=1k count=100
# losetup -e des /dev/loop0 /file losetup -e des /dev/loop0 /file
Password: Password:
Init (up to 16 hex digits): Init (up to 16 hex digits):
# mkfs -t ext2 /dev/loop0 100 mkfs -t ext2 /dev/loop0 100
# mount -t ext2 /dev/loop0 /mnt mount -t ext2 /dev/loop0 /mnt
... ...
# umount /dev/loop0 umount /dev/loop0
# losetup -d /dev/loop0 losetup -d /dev/loop0
.fi .fi
.LP .LP
If you are using the loadable module you may remove the module with If you are using the loadable module you may remove the module with
@ -109,8 +87,8 @@ the command
.fi .fi
.SH RESTRICTION .SH RESTRICTION
DES encryption is painfully slow. On the other hand, XOR is terribly weak. DES encryption is painfully slow. On the other hand, XOR is terribly weak.
.\" .SH AUTHORS .SH AUTHORS
.\" .nf .nf
.\" Original version: Theodore Ts'o <tytso@athena.mit.edu> Original version: Theodore Ts'o <tytso@athena.mit.edu>
.\" Original DES by: Eric Young <eay@psych.psy.uq.oz.au> Original DES by: Eric Young <eay@psych.psy.uq.oz.au>
.\" .fi .fi

34
mount/mk_loop_h Normal file
View File

@ -0,0 +1,34 @@
#!/bin/sh
#
# Figure out (i) the type of dev_t (ii) the defines for loop stuff
#
rm -f loop.h
# Since 1.3.79 there is an include file <asm/posix_types.h>
# that defines __kernel_dev_t.
# (The file itself appeared in 1.3.78, but there it defined __dev_t.)
# If it exists, we use it, or, rather, <linux/posix_types.h> which
# avoids namespace pollution. Otherwise we guess that __kernel_dev_t
# is an unsigned short (which is true on i386, but false on alpha).
if [ -f /usr/include/linux/posix_types.h ]; then
echo '#include <linux/posix_types.h>' >> loop.h
echo '#undef dev_t' >> loop.h
echo '#define dev_t __kernel_dev_t' >> loop.h
else
echo '#undef dev_t' >> loop.h
echo '#define dev_t unsigned short' >> loop.h
fi
# Next we have to find the loop stuff itself.
# First try kernel source, then a private version.
if [ -f /usr/include/linux/loop.h ]; then
echo '#include <linux/loop.h>' >> loop.h
else
echo '#include "h/loop.h"' >> loop.h
fi
echo '#undef dev_t' >> loop.h

View File

@ -315,12 +315,6 @@ This is necessary for example when
.I /etc .I /etc
is on a read-only file system. is on a read-only file system.
.TP .TP
.BI \-p " num"
In case of a loop mount with encryption, read the passphrase from
file descriptor
.I num
instead of from the terminal.
.TP
.B \-s .B \-s
Tolerate sloppy mount options rather than failing. This will ignore Tolerate sloppy mount options rather than failing. This will ignore
mount options not supported by a filesystem type. Not all filesystems mount options not supported by a filesystem type. Not all filesystems

View File

@ -113,9 +113,6 @@ static int mounttype = 0;
/* True if ruid != euid. */ /* True if ruid != euid. */
static int suid = 0; static int suid = 0;
/* Contains the fd to read the passphrase from, if any. */
static int pfd = -1;
/* Map from -o and fstab option strings to the flag argument to mount(2). */ /* Map from -o and fstab option strings to the flag argument to mount(2). */
struct opt_map { struct opt_map {
const char *opt; /* option name */ const char *opt; /* option name */
@ -604,8 +601,7 @@ loop_check(char **spec, char **type, int *flags,
if (verbose) if (verbose)
printf(_("mount: going to use the loop device %s\n"), *loopdev); printf(_("mount: going to use the loop device %s\n"), *loopdev);
offset = opt_offset ? strtoul(opt_offset, NULL, 0) : 0; offset = opt_offset ? strtoul(opt_offset, NULL, 0) : 0;
if (set_loop(*loopdev, *loopfile, offset, if (set_loop (*loopdev, *loopfile, offset, opt_encryption, &loopro)) {
opt_encryption, pfd, &loopro)) {
if (verbose) if (verbose)
printf(_("mount: failed setting up loop device\n")); printf(_("mount: failed setting up loop device\n"));
return EX_FAIL; return EX_FAIL;
@ -663,14 +659,6 @@ update_mtab_entry(char *spec, char *node, char *type, char *opts,
} }
} }
static void
set_pfd(char *s) {
if (!isdigit(*s))
die(EX_USAGE,
_("mount: argument to -p or --pass-fd must be a number"));
pfd = atoi(optarg);
}
static void static void
cdrom_setspeed(char *spec) { cdrom_setspeed(char *spec) {
#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */ #define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */
@ -780,7 +768,7 @@ try_mount_one (const char *spec0, const char *node0, char *types0,
if (mount_all && (flags & MS_NOAUTO)) if (mount_all && (flags & MS_NOAUTO))
return 0; return 0;
suid_check(spec, node, &flags, &user); suid_check (spec, node, &flags, &user);
mount_opts = extra_opts; mount_opts = extra_opts;
@ -788,12 +776,11 @@ try_mount_one (const char *spec0, const char *node0, char *types0,
cdrom_setspeed(spec); cdrom_setspeed(spec);
if (!(flags & MS_REMOUNT)) { if (!(flags & MS_REMOUNT)) {
/* /* don't set up a (new) loop device if we only remount - this left
* Don't set up a (new) loop device if we only remount - this left
* stale assignments of files to loop devices. Nasty when used for * stale assignments of files to loop devices. Nasty when used for
* encryption. * encryption.
*/ */
res = loop_check(&spec, &types, &flags, &loop, &loopdev, &loopfile); res = loop_check (&spec, &types, &flags, &loop, &loopdev, &loopfile);
if (res) if (res)
return res; return res;
} }
@ -1370,7 +1357,6 @@ static struct option longopts[] = {
{ "rw", 0, 0, 'w' }, { "rw", 0, 0, 'w' },
{ "options", 1, 0, 'o' }, { "options", 1, 0, 'o' },
{ "test-opts", 1, 0, 'O' }, { "test-opts", 1, 0, 'O' },
{ "pass-fd", 1, 0, 'p' },
{ "types", 1, 0, 't' }, { "types", 1, 0, 't' },
{ "bind", 0, 0, 128 }, { "bind", 0, 0, 128 },
{ "replace", 0, 0, 129 }, { "replace", 0, 0, 129 },
@ -1408,7 +1394,7 @@ usage (FILE *fp, int n) {
" mount --move olddir newdir\n" " mount --move olddir newdir\n"
"A device can be given by name, say /dev/hda1 or /dev/cdrom,\n" "A device can be given by name, say /dev/hda1 or /dev/cdrom,\n"
"or by label, using -L label or by uuid, using -U uuid .\n" "or by label, using -L label or by uuid, using -U uuid .\n"
"Other options: [-nfFrsvw] [-o options] [-p passwdfd].\n" "Other options: [-nfFrsvw] [-o options].\n"
"For many more details, say man 8 mount .\n" "For many more details, say man 8 mount .\n"
)); ));
/* /*
@ -1447,7 +1433,7 @@ main (int argc, char *argv[]) {
initproctitle(argc, argv); initproctitle(argc, argv);
#endif #endif
while ((c = getopt_long (argc, argv, "afFhilL:no:O:p:rsU:vVwt:", while ((c = getopt_long (argc, argv, "afFhilL:no:O:rsU:vVwt:",
longopts, NULL)) != -1) { longopts, NULL)) != -1) {
switch (c) { switch (c) {
case 'a': /* mount everything in fstab */ case 'a': /* mount everything in fstab */
@ -1486,9 +1472,6 @@ main (int argc, char *argv[]) {
else else
test_opts = xstrdup(optarg); test_opts = xstrdup(optarg);
break; break;
case 'p': /* fd on which to read passwd */
set_pfd(optarg);
break;
case 'r': /* mount readonly */ case 'r': /* mount readonly */
readonly = 1; readonly = 1;
readwrite = 0; readwrite = 0;

View File

@ -297,8 +297,6 @@ do_guess_fstype(const char *device) {
else if ((!strncmp(xsb.fatsb.s_os, "MSDOS", 5) || else if ((!strncmp(xsb.fatsb.s_os, "MSDOS", 5) ||
!strncmp(xsb.fatsb.s_os, "MSWIN", 5) || !strncmp(xsb.fatsb.s_os, "MSWIN", 5) ||
!strncmp(xsb.fatsb.s_os, "MTOOL", 5) || !strncmp(xsb.fatsb.s_os, "MTOOL", 5) ||
!strncmp(xsb.fatsb.s_os, "IBM", 3) ||
!strncmp(xsb.fatsb.s_os, "DRDOS", 5) ||
!strncmp(xsb.fatsb.s_os, "mkdosfs", 7) || !strncmp(xsb.fatsb.s_os, "mkdosfs", 7) ||
!strncmp(xsb.fatsb.s_os, "kmkdosfs", 8) || !strncmp(xsb.fatsb.s_os, "kmkdosfs", 8) ||
/* Michal Svec: created by fdformat, old msdos utility for /* Michal Svec: created by fdformat, old msdos utility for

View File

@ -1,7 +0,0 @@
/* silliness to get dev_t defined as the kernel defines it */
/* glibc uses a different dev_t */
/* maybe we need __kernel_old_dev_t -- later */
/* for ancient systems use "unsigned short" */
#include <linux/posix_types.h>
#define my_dev_t __kernel_dev_t

View File

@ -400,23 +400,15 @@ umount_one (const char *spec, const char *node, const char *type,
* In both cases, it is best to try the last occurrence first. * In both cases, it is best to try the last occurrence first.
*/ */
static int static int
umount_one_bw (const char *file, struct mntentchn *mc0) { umount_one_bw (const char *file, struct mntentchn *mc) {
struct mntentchn *mc; int res = 1;
int res = 1;
mc = mc0; while (res && mc) {
while (res && mc) { res = umount_one(mc->m.mnt_fsname, mc->m.mnt_dir,
res = umount_one(mc->m.mnt_fsname, mc->m.mnt_dir, mc->m.mnt_type, mc->m.mnt_opts, mc);
mc->m.mnt_type, mc->m.mnt_opts, mc); mc = getmntfilesbackward (file, mc);
mc = getmntdirbackward(file, mc); }
} return res;
mc = mc0;
while (res && mc) {
res = umount_one(mc->m.mnt_fsname, mc->m.mnt_dir,
mc->m.mnt_type, mc->m.mnt_opts, mc);
mc = getmntdevbackward(file, mc);
}
return res;
} }
/* Unmount all filesystems of type VFSTYPES found in mtab. Since we are /* Unmount all filesystems of type VFSTYPES found in mtab. Since we are
@ -533,6 +525,7 @@ get_value(string_list list, char *s) {
} }
return 0; return 0;
} }
/*=======================================================================*/
static int static int
umount_file (char *arg) { umount_file (char *arg) {
@ -541,25 +534,19 @@ umount_file (char *arg) {
string_list options; string_list options;
int fstab_has_user, fstab_has_users, fstab_has_owner, ok; int fstab_has_user, fstab_has_users, fstab_has_owner, ok;
file = canonicalize(arg); /* mtab paths are canonicalized */ file = canonicalize (arg); /* mtab paths are canonicalized */
if (verbose > 1) if (verbose > 1)
printf(_("Trying to umount %s\n"), file); printf(_("Trying to umount %s\n"), file);
mc = getmntdirbackward(file, NULL); mc = getmntfilesbackward (file, NULL);
if (!mc)
mc = getmntdevbackward(file, NULL);
if (!mc && verbose) if (!mc && verbose)
printf(_("Could not find %s in mtab\n"), file); printf(_("Could not find %s in mtab\n"), file);
if (suid) { if (suid) {
if (!mc) if (!mc)
die(2, die (2, _("umount: %s is not mounted (according to mtab)"), file);
_("umount: %s is not mounted (according to mtab)"), if (getmntfilesbackward (file, mc))
file); die (2, _("umount: it seems %s is mounted multiple times"), file);
if (!is_mounted_once(file))
die(2,
_("umount: it seems %s is mounted multiple times"),
file);
/* If fstab contains the two lines /* If fstab contains the two lines
/dev/sda1 /mnt/zip auto user,noauto 0 0 /dev/sda1 /mnt/zip auto user,noauto 0 0

View File

@ -2046,7 +2046,7 @@ mount: the kernel does not recognize %s as a block device\n\
{"label", 1552}, {"label", 1552},
{"mount: no such partition found", 1553}, {"mount: no such partition found", 1553},
{"mount: no type was given - I'll assume nfs because of the colon\n", 1554}, {"mount: no type was given - I'll assume nfs because of the colon\n", 1554},
{"mount: no type was given - I'll assume smbfs because of the // prefix\n", 1555}, {"mount: no type was given - I'll assume smb because of the // prefix\n", 1555},
{"mount: backgrounding \"%s\"\n", 1556}, {"mount: backgrounding \"%s\"\n", 1556},
{"mount: giving up \"%s\"\n", 1557}, {"mount: giving up \"%s\"\n", 1557},
{"mount: %s already mounted on %s\n", 1558}, {"mount: %s already mounted on %s\n", 1558},
@ -2070,292 +2070,291 @@ or move a subtree:\n\
mount --move olddir newdir\n\ mount --move olddir newdir\n\
A device can be given by name, say /dev/hda1 or /dev/cdrom,\n\ A device can be given by name, say /dev/hda1 or /dev/cdrom,\n\
or by label, using -L label or by uuid, using -U uuid .\n\ or by label, using -L label or by uuid, using -U uuid .\n\
Other options: [-nfFrsvw] [-o options] [-p passwdfd].\n\ Other options: [-nfFrsvw] [-o options].\n\
For many more details, say man 8 mount .\n", 1559}, For many more details, say man 8 mount .\n", 1559},
{"mount: argument to -p or --pass-fd must be a number", 1560}, {"mount: only root can do that", 1560},
{"mount: only root can do that", 1561}, {"mount: no %s found - creating it..\n", 1561},
{"mount: no %s found - creating it..\n", 1562}, {"mount: the label %s occurs on both %s and %s - not mounted\n", 1562},
{"mount: the label %s occurs on both %s and %s - not mounted\n", 1563}, {"mount: mounting %s\n", 1563},
{"mount: mounting %s\n", 1564}, {"nothing was mounted", 1564},
{"nothing was mounted", 1565}, {"mount: cannot find %s in %s", 1565},
{"mount: cannot find %s in %s", 1566}, {"mount: can't find %s in %s or %s", 1566},
{"mount: can't find %s in %s or %s", 1567},
{"\ {"\
mount: could not open %s, so UUID and LABEL conversion cannot be done.\n", 1568}, mount: could not open %s, so UUID and LABEL conversion cannot be done.\n", 1567},
{"mount: bad UUID", 1569}, {"mount: bad UUID", 1568},
{"mount: error while guessing filesystem type\n", 1570}, {"mount: error while guessing filesystem type\n", 1569},
{"mount: you didn't specify a filesystem type for %s\n", 1571}, {"mount: you didn't specify a filesystem type for %s\n", 1570},
{" I will try all types mentioned in %s or %s\n", 1572}, {" I will try all types mentioned in %s or %s\n", 1571},
{" and it looks like this is swapspace\n", 1573}, {" and it looks like this is swapspace\n", 1572},
{" I will try type %s\n", 1574}, {" I will try type %s\n", 1573},
{"Trying %s\n", 1575}, {"Trying %s\n", 1574},
{"mount: excessively long host:dir argument\n", 1576}, {"mount: excessively long host:dir argument\n", 1575},
{"mount: warning: multiple hostnames not supported\n", 1577}, {"mount: warning: multiple hostnames not supported\n", 1576},
{"mount: directory to mount not in host:dir format\n", 1578}, {"mount: directory to mount not in host:dir format\n", 1577},
{"mount: can't get address for %s\n", 1579}, {"mount: can't get address for %s\n", 1578},
{"mount: got bad hp->h_length\n", 1580}, {"mount: got bad hp->h_length\n", 1579},
{"mount: excessively long option argument\n", 1581}, {"mount: excessively long option argument\n", 1580},
{"Warning: Unrecognized proto= option.\n", 1582}, {"Warning: Unrecognized proto= option.\n", 1581},
{"Warning: Option namlen is not supported.\n", 1583}, {"Warning: Option namlen is not supported.\n", 1582},
{"unknown nfs mount parameter: %s=%d\n", 1584}, {"unknown nfs mount parameter: %s=%d\n", 1583},
{"Warning: option nolock is not supported.\n", 1585}, {"Warning: option nolock is not supported.\n", 1584},
{"unknown nfs mount option: %s%s\n", 1586}, {"unknown nfs mount option: %s%s\n", 1585},
{"mount: got bad hp->h_length?\n", 1587}, {"mount: got bad hp->h_length?\n", 1586},
{"NFS over TCP is not supported.\n", 1588}, {"NFS over TCP is not supported.\n", 1587},
{"nfs socket", 1589}, {"nfs socket", 1588},
{"nfs bindresvport", 1590}, {"nfs bindresvport", 1589},
{"nfs server reported service unavailable", 1591}, {"nfs server reported service unavailable", 1590},
{"used portmapper to find NFS port\n", 1592}, {"used portmapper to find NFS port\n", 1591},
{"using port %d for nfs deamon\n", 1593}, {"using port %d for nfs deamon\n", 1592},
{"nfs connect", 1594}, {"nfs connect", 1593},
{"unknown nfs status return value: %d", 1595}, {"unknown nfs status return value: %d", 1594},
{"bug in xstrndup call", 1596}, {"bug in xstrndup call", 1595},
{"\ {"\
usage: %s [-hV]\n\ usage: %s [-hV]\n\
%s -a [-e] [-v]\n\ %s -a [-e] [-v]\n\
%s [-v] [-p priority] special ...\n\ %s [-v] [-p priority] special ...\n\
%s [-s]\n", 1597}, %s [-s]\n", 1596},
{"\ {"\
usage: %s [-hV]\n\ usage: %s [-hV]\n\
%s -a [-v]\n\ %s -a [-v]\n\
%s [-v] special ...\n", 1598}, %s [-v] special ...\n", 1597},
{"%s on %s\n", 1599}, {"%s on %s\n", 1598},
{"swapon: cannot stat %s: %s\n", 1600}, {"swapon: cannot stat %s: %s\n", 1599},
{"swapon: warning: %s has insecure permissions %04o, %04o suggested\n", 1601}, {"swapon: warning: %s has insecure permissions %04o, %04o suggested\n", 1600},
{"swapon: Skipping file %s - it appears to have holes.\n", 1602}, {"swapon: Skipping file %s - it appears to have holes.\n", 1601},
{"Not superuser.\n", 1603}, {"Not superuser.\n", 1602},
{"%s: cannot open %s: %s\n", 1604}, {"%s: cannot open %s: %s\n", 1603},
{"umount: compiled without support for -f\n", 1605}, {"umount: compiled without support for -f\n", 1604},
{"host: %s, directory: %s\n", 1606}, {"host: %s, directory: %s\n", 1605},
{"umount: can't get address for %s\n", 1607}, {"umount: can't get address for %s\n", 1606},
{"umount: got bad hostp->h_length\n", 1608}, {"umount: got bad hostp->h_length\n", 1607},
{"umount: %s: invalid block device", 1609}, {"umount: %s: invalid block device", 1608},
{"umount: %s: not mounted", 1610}, {"umount: %s: not mounted", 1609},
{"umount: %s: can't write superblock", 1611}, {"umount: %s: can't write superblock", 1610},
{"umount: %s: device is busy", 1612}, {"umount: %s: device is busy", 1611},
{"umount: %s: not found", 1613}, {"umount: %s: not found", 1612},
{"umount: %s: must be superuser to umount", 1614}, {"umount: %s: must be superuser to umount", 1613},
{"umount: %s: block devices not permitted on fs", 1615}, {"umount: %s: block devices not permitted on fs", 1614},
{"umount: %s: %s", 1616}, {"umount: %s: %s", 1615},
{"no umount2, trying umount...\n", 1617}, {"no umount2, trying umount...\n", 1616},
{"could not umount %s - trying %s instead\n", 1618}, {"could not umount %s - trying %s instead\n", 1617},
{"umount: %s busy - remounted read-only\n", 1619}, {"umount: %s busy - remounted read-only\n", 1618},
{"umount: could not remount %s read-only\n", 1620}, {"umount: could not remount %s read-only\n", 1619},
{"%s umounted\n", 1621}, {"%s umounted\n", 1620},
{"umount: cannot find list of filesystems to unmount", 1622}, {"umount: cannot find list of filesystems to unmount", 1621},
{"\ {"\
Usage: umount [-hV]\n\ Usage: umount [-hV]\n\
umount -a [-f] [-r] [-n] [-v] [-t vfstypes] [-O opts]\n\ umount -a [-f] [-r] [-n] [-v] [-t vfstypes] [-O opts]\n\
umount [-f] [-r] [-n] [-v] special | node...\n", 1623}, umount [-f] [-r] [-n] [-v] special | node...\n", 1622},
{"Trying to umount %s\n", 1624}, {"Trying to umount %s\n", 1623},
{"Could not find %s in mtab\n", 1625}, {"Could not find %s in mtab\n", 1624},
{"umount: %s is not mounted (according to mtab)", 1626}, {"umount: %s is not mounted (according to mtab)", 1625},
{"umount: it seems %s is mounted multiple times", 1627}, {"umount: it seems %s is mounted multiple times", 1626},
{"umount: %s is not in the fstab (and you are not root)", 1628}, {"umount: %s is not in the fstab (and you are not root)", 1627},
{"umount: %s mount disagrees with the fstab", 1629}, {"umount: %s mount disagrees with the fstab", 1628},
{"umount: only root can unmount %s from %s", 1630}, {"umount: only root can unmount %s from %s", 1629},
{"umount: only root can do that", 1631}, {"umount: only root can do that", 1630},
{"You must be root to set the Ctrl-Alt-Del behaviour.\n", 1632}, {"You must be root to set the Ctrl-Alt-Del behaviour.\n", 1631},
{"Usage: ctrlaltdel hard|soft\n", 1633}, {"Usage: ctrlaltdel hard|soft\n", 1632},
{"\ {"\
File %s, For threshold value %lu, Maximum characters in fifo were %d,\n\ File %s, For threshold value %lu, Maximum characters in fifo were %d,\n\
and the maximum transfer rate in characters/second was %f\n", 1634}, and the maximum transfer rate in characters/second was %f\n", 1633},
{"\ {"\
File %s, For threshold value %lu and timrout value %lu, Maximum characters \ File %s, For threshold value %lu and timrout value %lu, Maximum characters \
in fifo were %d,\n\ in fifo were %d,\n\
and the maximum transfer rate in characters/second was %f\n", 1635}, and the maximum transfer rate in characters/second was %f\n", 1634},
{"Invalid interval value: %s\n", 1636}, {"Invalid interval value: %s\n", 1635},
{"Invalid set value: %s\n", 1637}, {"Invalid set value: %s\n", 1636},
{"Invalid default value: %s\n", 1638}, {"Invalid default value: %s\n", 1637},
{"Invalid set time value: %s\n", 1639}, {"Invalid set time value: %s\n", 1638},
{"Invalid default time value: %s\n", 1640}, {"Invalid default time value: %s\n", 1639},
{"\ {"\
Usage: %s [-q [-i interval]] ([-s value]|[-S value]) ([-t value]|[-T value]) \ Usage: %s [-q [-i interval]] ([-s value]|[-S value]) ([-t value]|[-T value]) \
[-g|-G] file [file...]\n", 1641}, [-g|-G] file [file...]\n", 1640},
{"Can't open %s: %s\n", 1642}, {"Can't open %s: %s\n", 1641},
{"Can't set %s to threshold %d: %s\n", 1643}, {"Can't set %s to threshold %d: %s\n", 1642},
{"Can't set %s to time threshold %d: %s\n", 1644}, {"Can't set %s to time threshold %d: %s\n", 1643},
{"Can't get threshold for %s: %s\n", 1645}, {"Can't get threshold for %s: %s\n", 1644},
{"Can't get timeout for %s: %s\n", 1646}, {"Can't get timeout for %s: %s\n", 1645},
{"%s: %ld current threshold and %ld current timeout\n", 1647}, {"%s: %ld current threshold and %ld current timeout\n", 1646},
{"%s: %ld default threshold and %ld default timeout\n", 1648}, {"%s: %ld default threshold and %ld default timeout\n", 1647},
{"Can't set signal handler", 1649}, {"Can't set signal handler", 1648},
{"gettimeofday failed", 1650}, {"gettimeofday failed", 1649},
{"Can't issue CYGETMON on %s: %s\n", 1651}, {"Can't issue CYGETMON on %s: %s\n", 1650},
{"\ {"\
%s: %lu ints, %lu/%lu chars; fifo: %lu thresh, %lu tmout, %lu max, %lu now\n", 1652}, %s: %lu ints, %lu/%lu chars; fifo: %lu thresh, %lu tmout, %lu max, %lu now\n", 1651},
{" %f int/sec; %f rec, %f send (char/sec)\n", 1653}, {" %f int/sec; %f rec, %f send (char/sec)\n", 1652},
{"\ {"\
%s: %lu ints, %lu chars; fifo: %lu thresh, %lu tmout, %lu max, %lu now\n", 1654}, %s: %lu ints, %lu chars; fifo: %lu thresh, %lu tmout, %lu max, %lu now\n", 1653},
{" %f int/sec; %f rec (char/sec)\n", 1655}, {" %f int/sec; %f rec (char/sec)\n", 1654},
{"Usage: %s [-c] [-n level] [-s bufsize]\n", 1656}, {"Usage: %s [-c] [-n level] [-s bufsize]\n", 1655},
{"invalid id: %s\n", 1657}, {"invalid id: %s\n", 1656},
{"cannot remove id %s (%s)\n", 1658}, {"cannot remove id %s (%s)\n", 1657},
{"deprecated usage: %s {shm | msg | sem} id ...\n", 1659}, {"deprecated usage: %s {shm | msg | sem} id ...\n", 1658},
{"unknown resource type: %s\n", 1660}, {"unknown resource type: %s\n", 1659},
{"resource(s) deleted\n", 1661}, {"resource(s) deleted\n", 1660},
{"\ {"\
usage: %s [ [-q msqid] [-m shmid] [-s semid]\n\ usage: %s [ [-q msqid] [-m shmid] [-s semid]\n\
[-Q msgkey] [-M shmkey] [-S semkey] ... ]\n", 1662}, [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n", 1661},
{"%s: illegal option -- %c\n", 1663}, {"%s: illegal option -- %c\n", 1662},
{"%s: illegal key (%s)\n", 1664}, {"%s: illegal key (%s)\n", 1663},
{"permission denied for key", 1665}, {"permission denied for key", 1664},
{"already removed key", 1666}, {"already removed key", 1665},
{"invalid key", 1667}, {"invalid key", 1666},
{"unknown error in key", 1668}, {"unknown error in key", 1667},
{"permission denied for id", 1669}, {"permission denied for id", 1668},
{"invalid id", 1670}, {"invalid id", 1669},
{"already removed id", 1671}, {"already removed id", 1670},
{"unknown error in id", 1672}, {"unknown error in id", 1671},
{"%s: %s (%s)\n", 1673}, {"%s: %s (%s)\n", 1672},
{"%s: unknown argument: %s\n", 1674}, {"%s: unknown argument: %s\n", 1673},
{"usage : %s -asmq -tclup \n", 1675}, {"usage : %s -asmq -tclup \n", 1674},
{"\t%s [-s -m -q] -i id\n", 1676}, {"\t%s [-s -m -q] -i id\n", 1675},
{"\t%s -h for help.\n", 1677}, {"\t%s -h for help.\n", 1676},
{"\ {"\
%s provides information on ipc facilities for which you have read access.\n", 1678}, %s provides information on ipc facilities for which you have read access.\n", 1677},
{"\ {"\
Resource Specification:\n\ Resource Specification:\n\
\t-m : shared_mem\n\ \t-m : shared_mem\n\
\t-q : messages\n", 1679}, \t-q : messages\n", 1678},
{"\ {"\
\t-s : semaphores\n\ \t-s : semaphores\n\
\t-a : all (default)\n", 1680}, \t-a : all (default)\n", 1679},
{"\ {"\
Output Format:\n\ Output Format:\n\
\t-t : time\n\ \t-t : time\n\
\t-p : pid\n\ \t-p : pid\n\
\t-c : creator\n", 1681}, \t-c : creator\n", 1680},
{"\ {"\
\t-l : limits\n\ \t-l : limits\n\
\t-u : summary\n", 1682}, \t-u : summary\n", 1681},
{"-i id [-s -q -m] : details on resource identified by id\n", 1683}, {"-i id [-s -q -m] : details on resource identified by id\n", 1682},
{"kernel not configured for shared memory\n", 1684}, {"kernel not configured for shared memory\n", 1683},
{"------ Shared Memory Limits --------\n", 1685}, {"------ Shared Memory Limits --------\n", 1684},
{"max number of segments = %ld\n", 1686}, {"max number of segments = %ld\n", 1685},
{"max seg size (kbytes) = %ld\n", 1687}, {"max seg size (kbytes) = %ld\n", 1686},
{"max total shared memory (kbytes) = %ld\n", 1688}, {"max total shared memory (kbytes) = %ld\n", 1687},
{"min seg size (bytes) = %ld\n", 1689}, {"min seg size (bytes) = %ld\n", 1688},
{"------ Shared Memory Status --------\n", 1690}, {"------ Shared Memory Status --------\n", 1689},
{"segments allocated %d\n", 1691}, {"segments allocated %d\n", 1690},
{"pages allocated %ld\n", 1692}, {"pages allocated %ld\n", 1691},
{"pages resident %ld\n", 1693}, {"pages resident %ld\n", 1692},
{"pages swapped %ld\n", 1694}, {"pages swapped %ld\n", 1693},
{"Swap performance: %ld attempts\t %ld successes\n", 1695}, {"Swap performance: %ld attempts\t %ld successes\n", 1694},
{"------ Shared Memory Segment Creators/Owners --------\n", 1696}, {"------ Shared Memory Segment Creators/Owners --------\n", 1695},
{"%-10s %-10s %-10s %-10s %-10s %-10s\n", 1697}, {"%-10s %-10s %-10s %-10s %-10s %-10s\n", 1696},
{"shmid", 1698}, {"shmid", 1697},
{"perms", 1699}, {"perms", 1698},
{"cuid", 1700}, {"cuid", 1699},
{"cgid", 1701}, {"cgid", 1700},
{"uid", 1702}, {"uid", 1701},
{"gid", 1703}, {"gid", 1702},
{"------ Shared Memory Attach/Detach/Change Times --------\n", 1704}, {"------ Shared Memory Attach/Detach/Change Times --------\n", 1703},
{"%-10s %-10s %-20s %-20s %-20s\n", 1705}, {"%-10s %-10s %-20s %-20s %-20s\n", 1704},
{"owner", 1706}, {"owner", 1705},
{"attached", 1707}, {"attached", 1706},
{"detached", 1708}, {"detached", 1707},
{"changed", 1709}, {"changed", 1708},
{"------ Shared Memory Creator/Last-op --------\n", 1710}, {"------ Shared Memory Creator/Last-op --------\n", 1709},
{"%-10s %-10s %-10s %-10s\n", 1711}, {"%-10s %-10s %-10s %-10s\n", 1710},
{"cpid", 1712}, {"cpid", 1711},
{"lpid", 1713}, {"lpid", 1712},
{"------ Shared Memory Segments --------\n", 1714}, {"------ Shared Memory Segments --------\n", 1713},
{"%-10s %-10s %-10s %-10s %-10s %-10s %-12s\n", 1715}, {"%-10s %-10s %-10s %-10s %-10s %-10s %-12s\n", 1714},
{"key", 1716}, {"key", 1715},
{"bytes", 1717}, {"bytes", 1716},
{"nattch", 1718}, {"nattch", 1717},
{"status", 1719}, {"status", 1718},
{"Not set", 1720}, {"Not set", 1719},
{"dest", 1721}, {"dest", 1720},
{"locked", 1722}, {"locked", 1721},
{"kernel not configured for semaphores\n", 1723}, {"kernel not configured for semaphores\n", 1722},
{"------ Semaphore Limits --------\n", 1724}, {"------ Semaphore Limits --------\n", 1723},
{"max number of arrays = %d\n", 1725}, {"max number of arrays = %d\n", 1724},
{"max semaphores per array = %d\n", 1726}, {"max semaphores per array = %d\n", 1725},
{"max semaphores system wide = %d\n", 1727}, {"max semaphores system wide = %d\n", 1726},
{"max ops per semop call = %d\n", 1728}, {"max ops per semop call = %d\n", 1727},
{"semaphore max value = %d\n", 1729}, {"semaphore max value = %d\n", 1728},
{"------ Semaphore Status --------\n", 1730}, {"------ Semaphore Status --------\n", 1729},
{"used arrays = %d\n", 1731}, {"used arrays = %d\n", 1730},
{"allocated semaphores = %d\n", 1732}, {"allocated semaphores = %d\n", 1731},
{"------ Semaphore Arrays Creators/Owners --------\n", 1733}, {"------ Semaphore Arrays Creators/Owners --------\n", 1732},
{"semid", 1734}, {"semid", 1733},
{"------ Shared Memory Operation/Change Times --------\n", 1735}, {"------ Shared Memory Operation/Change Times --------\n", 1734},
{"%-8s %-10s %-26.24s %-26.24s\n", 1736}, {"%-8s %-10s %-26.24s %-26.24s\n", 1735},
{"last-op", 1737}, {"last-op", 1736},
{"last-changed", 1738}, {"last-changed", 1737},
{"------ Semaphore Arrays --------\n", 1739}, {"------ Semaphore Arrays --------\n", 1738},
{"%-10s %-10s %-10s %-10s %-10s\n", 1740}, {"%-10s %-10s %-10s %-10s %-10s\n", 1739},
{"nsems", 1741}, {"nsems", 1740},
{"kernel not configured for message queues\n", 1742}, {"kernel not configured for message queues\n", 1741},
{"------ Messages: Limits --------\n", 1743}, {"------ Messages: Limits --------\n", 1742},
{"max queues system wide = %d\n", 1744}, {"max queues system wide = %d\n", 1743},
{"max size of message (bytes) = %d\n", 1745}, {"max size of message (bytes) = %d\n", 1744},
{"default max size of queue (bytes) = %d\n", 1746}, {"default max size of queue (bytes) = %d\n", 1745},
{"------ Messages: Status --------\n", 1747}, {"------ Messages: Status --------\n", 1746},
{"allocated queues = %d\n", 1748}, {"allocated queues = %d\n", 1747},
{"used headers = %d\n", 1749}, {"used headers = %d\n", 1748},
{"used space = %d bytes\n", 1750}, {"used space = %d bytes\n", 1749},
{"------ Message Queues: Creators/Owners --------\n", 1751}, {"------ Message Queues: Creators/Owners --------\n", 1750},
{"msqid", 1752}, {"msqid", 1751},
{"------ Message Queues Send/Recv/Change Times --------\n", 1753}, {"------ Message Queues Send/Recv/Change Times --------\n", 1752},
{"%-8s %-10s %-20s %-20s %-20s\n", 1754}, {"%-8s %-10s %-20s %-20s %-20s\n", 1753},
{"send", 1755}, {"send", 1754},
{"recv", 1756}, {"recv", 1755},
{"change", 1757}, {"change", 1756},
{"------ Message Queues PIDs --------\n", 1758}, {"------ Message Queues PIDs --------\n", 1757},
{"lspid", 1759}, {"lspid", 1758},
{"lrpid", 1760}, {"lrpid", 1759},
{"------ Message Queues --------\n", 1761}, {"------ Message Queues --------\n", 1760},
{"%-10s %-10s %-10s %-10s %-12s %-12s\n", 1762}, {"%-10s %-10s %-10s %-10s %-12s %-12s\n", 1761},
{"used-bytes", 1763}, {"used-bytes", 1762},
{"messages", 1764}, {"messages", 1763},
{"\ {"\
\n\ \n\
Shared memory Segment shmid=%d\n", 1765}, Shared memory Segment shmid=%d\n", 1764},
{"uid=%d\tgid=%d\tcuid=%d\tcgid=%d\n", 1766}, {"uid=%d\tgid=%d\tcuid=%d\tcgid=%d\n", 1765},
{"mode=%#o\taccess_perms=%#o\n", 1767}, {"mode=%#o\taccess_perms=%#o\n", 1766},
{"bytes=%ld\tlpid=%d\tcpid=%d\tnattch=%ld\n", 1768}, {"bytes=%ld\tlpid=%d\tcpid=%d\tnattch=%ld\n", 1767},
{"att_time=%-26.24s\n", 1769}, {"att_time=%-26.24s\n", 1768},
{"det_time=%-26.24s\n", 1770}, {"det_time=%-26.24s\n", 1769},
{"change_time=%-26.24s\n", 1771}, {"change_time=%-26.24s\n", 1770},
{"\ {"\
\n\ \n\
Message Queue msqid=%d\n", 1772}, Message Queue msqid=%d\n", 1771},
{"uid=%d\tgid=%d\tcuid=%d\tcgid=%d\tmode=%#o\n", 1773}, {"uid=%d\tgid=%d\tcuid=%d\tcgid=%d\tmode=%#o\n", 1772},
{"cbytes=%ld\tqbytes=%ld\tqnum=%ld\tlspid=%d\tlrpid=%d\n", 1774}, {"cbytes=%ld\tqbytes=%ld\tqnum=%ld\tlspid=%d\tlrpid=%d\n", 1773},
{"send_time=%-26.24s\n", 1775}, {"send_time=%-26.24s\n", 1774},
{"rcv_time=%-26.24s\n", 1776}, {"rcv_time=%-26.24s\n", 1775},
{"\ {"\
\n\ \n\
Semaphore Array semid=%d\n", 1777}, Semaphore Array semid=%d\n", 1776},
{"uid=%d\t gid=%d\t cuid=%d\t cgid=%d\n", 1778}, {"uid=%d\t gid=%d\t cuid=%d\t cgid=%d\n", 1777},
{"mode=%#o, access_perms=%#o\n", 1779}, {"mode=%#o, access_perms=%#o\n", 1778},
{"nsems = %ld\n", 1780}, {"nsems = %ld\n", 1779},
{"otime = %-26.24s\n", 1781}, {"otime = %-26.24s\n", 1780},
{"ctime = %-26.24s\n", 1782}, {"ctime = %-26.24s\n", 1781},
{"semnum", 1783}, {"semnum", 1782},
{"value", 1784}, {"value", 1783},
{"ncount", 1785}, {"ncount", 1784},
{"zcount", 1786}, {"zcount", 1785},
{"pid", 1787}, {"pid", 1786},
{"usage: rdev [ -rv ] [ -o OFFSET ] [ IMAGE [ VALUE [ OFFSET ] ] ]", 1788}, {"usage: rdev [ -rv ] [ -o OFFSET ] [ IMAGE [ VALUE [ OFFSET ] ] ]", 1787},
{"\ {"\
rdev /dev/fd0 (or rdev /linux, etc.) displays the current ROOT device", 1789}, rdev /dev/fd0 (or rdev /linux, etc.) displays the current ROOT device", 1788},
{" rdev /dev/fd0 /dev/hda2 sets ROOT to /dev/hda2", 1790}, {" rdev /dev/fd0 /dev/hda2 sets ROOT to /dev/hda2", 1789},
{" rdev -R /dev/fd0 1 set the ROOTFLAGS (readonly status)", 1791}, {" rdev -R /dev/fd0 1 set the ROOTFLAGS (readonly status)", 1790},
{" rdev -r /dev/fd0 627 set the RAMDISK size", 1792}, {" rdev -r /dev/fd0 627 set the RAMDISK size", 1791},
{" rdev -v /dev/fd0 1 set the bootup VIDEOMODE", 1793}, {" rdev -v /dev/fd0 1 set the bootup VIDEOMODE", 1792},
{" rdev -o N ... use the byte offset N", 1794}, {" rdev -o N ... use the byte offset N", 1793},
{" rootflags ... same as rdev -R", 1795}, {" rootflags ... same as rdev -R", 1794},
{" ramsize ... same as rdev -r", 1796}, {" ramsize ... same as rdev -r", 1795},
{" vidmode ... same as rdev -v", 1797}, {" vidmode ... same as rdev -v", 1796},
{"\ {"\
Note: video modes are: -3=Ask, -2=Extended, -1=NormalVga, 1=key1, 2=key2,...", 1798}, Note: video modes are: -3=Ask, -2=Extended, -1=NormalVga, 1=key1, 2=key2,...", 1797},
{" use -R 1 to mount root readonly, -R 0 for read/write.", 1799}, {" use -R 1 to mount root readonly, -R 0 for read/write.", 1798},
{"missing comma", 1800}, {"missing comma", 1799},
{"out of memory", 1801}, {"out of memory", 1800},
{"\ {"\
%s: Usage: \"%s [options]\n\ %s: Usage: \"%s [options]\n\
\t -m <mapfile> (defaults: \"%s\" and\n\ \t -m <mapfile> (defaults: \"%s\" and\n\
@ -2368,76 +2367,76 @@ Note: video modes are: -3=Ask, -2=Extended, -1=NormalVga, 1=key1, 2=key2,...", 1
\t -b print individual histogram-bin counts\n\ \t -b print individual histogram-bin counts\n\
\t -r reset all the counters (root only)\n\ \t -r reset all the counters (root only)\n\
\t -n disable byte order auto-detection\n\ \t -n disable byte order auto-detection\n\
\t -V print version and exit\n", 1802}, \t -V print version and exit\n", 1801},
{"%s version %s\n", 1803}, {"%s version %s\n", 1802},
{"Sampling_step: %i\n", 1804}, {"Sampling_step: %i\n", 1803},
{"%s: %s(%i): wrong map line\n", 1805}, {"%s: %s(%i): wrong map line\n", 1804},
{"%s: can't find \"_stext\" in %s\n", 1806}, {"%s: can't find \"_stext\" in %s\n", 1805},
{"%s: profile address out of range. Wrong map file?\n", 1807}, {"%s: profile address out of range. Wrong map file?\n", 1806},
{"total", 1808}, {"total", 1807},
{"\ {"\
usage: renice priority [ [ -p ] pids ] [ [ -g ] pgrps ] [ [ -u ] users ]\n", 1809}, usage: renice priority [ [ -p ] pids ] [ [ -g ] pgrps ] [ [ -u ] users ]\n", 1808},
{"renice: %s: unknown user\n", 1810}, {"renice: %s: unknown user\n", 1809},
{"renice: %s: bad value\n", 1811}, {"renice: %s: bad value\n", 1810},
{"getpriority", 1812}, {"getpriority", 1811},
{"setpriority", 1813}, {"setpriority", 1812},
{"%d: old priority %d, new priority %d\n", 1814}, {"%d: old priority %d, new priority %d\n", 1813},
{"usage: %s program [arg ...]\n", 1815}, {"usage: %s program [arg ...]\n", 1814},
{"\ {"\
Usage: %s <device> [ -i <IRQ> | -t <TIME> | -c <CHARS> | -w <WAIT> | \n\ Usage: %s <device> [ -i <IRQ> | -t <TIME> | -c <CHARS> | -w <WAIT> | \n\
-a [on|off] | -o [on|off] | -C [on|off] | -q [on|off] | -s | \n\ -a [on|off] | -o [on|off] | -C [on|off] | -q [on|off] | -s | \n\
-T [on|off] ]\n", 1816}, -T [on|off] ]\n", 1815},
{"malloc error", 1817}, {"malloc error", 1816},
{"%s: bad value\n", 1818}, {"%s: bad value\n", 1817},
{"%s: %s not an lp device.\n", 1819}, {"%s: %s not an lp device.\n", 1818},
{"%s status is %d", 1820}, {"%s status is %d", 1819},
{", busy", 1821}, {", busy", 1820},
{", ready", 1822}, {", ready", 1821},
{", out of paper", 1823}, {", out of paper", 1822},
{", on-line", 1824}, {", on-line", 1823},
{", error", 1825}, {", error", 1824},
{"LPGETIRQ error", 1826}, {"LPGETIRQ error", 1825},
{"%s using IRQ %d\n", 1827}, {"%s using IRQ %d\n", 1826},
{"%s using polling\n", 1828}, {"%s using polling\n", 1827},
{"col: bad -l argument %s.\n", 1829}, {"col: bad -l argument %s.\n", 1828},
{"usage: col [-bfpx] [-l nline]\n", 1830}, {"usage: col [-bfpx] [-l nline]\n", 1829},
{"col: write error.\n", 1831}, {"col: write error.\n", 1830},
{"col: warning: can't back up %s.\n", 1832}, {"col: warning: can't back up %s.\n", 1831},
{"past first line", 1833}, {"past first line", 1832},
{"-- line already flushed", 1834}, {"-- line already flushed", 1833},
{"usage: %s [ - ] [ -2 ] [ file ... ]\n", 1835}, {"usage: %s [ - ] [ -2 ] [ file ... ]\n", 1834},
{"line too long", 1836}, {"line too long", 1835},
{"usage: column [-tx] [-c columns] [file ...]\n", 1837}, {"usage: column [-tx] [-c columns] [file ...]\n", 1836},
{"hexdump: bad length value.\n", 1838}, {"hexdump: bad length value.\n", 1837},
{"hexdump: bad skip value.\n", 1839}, {"hexdump: bad skip value.\n", 1838},
{"\ {"\
hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n", 1840}, hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n", 1839},
{"usage: %s [-dflpcsu] [+linenum | +/pattern] name1 name2 ...\n", 1841}, {"usage: %s [-dflpcsu] [+linenum | +/pattern] name1 name2 ...\n", 1840},
{"\ {"\
\n\ \n\
*** %s: directory ***\n\ *** %s: directory ***\n\
\n", 1842}, \n", 1841},
{"\ {"\
\n\ \n\
******** %s: Not a text file ********\n\ ******** %s: Not a text file ********\n\
\n", 1843}, \n", 1842},
{"[Use q or Q to quit]", 1844}, {"[Use q or Q to quit]", 1843},
{"--More--", 1845}, {"--More--", 1844},
{"(Next file: %s)", 1846}, {"(Next file: %s)", 1845},
{"[Press space to continue, 'q' to quit.]", 1847}, {"[Press space to continue, 'q' to quit.]", 1846},
{"...back %d pages", 1848}, {"...back %d pages", 1847},
{"...back 1 page", 1849}, {"...back 1 page", 1848},
{"...skipping one line", 1850}, {"...skipping one line", 1849},
{"...skipping %d lines", 1851}, {"...skipping %d lines", 1850},
{"\ {"\
\n\ \n\
***Back***\n\ ***Back***\n\
\n", 1852}, \n", 1851},
{"\ {"\
\n\ \n\
Most commands optionally preceded by integer argument k. Defaults in \ Most commands optionally preceded by integer argument k. Defaults in \
brackets.\n\ brackets.\n\
Star (*) indicates argument becomes new default.\n", 1853}, Star (*) indicates argument becomes new default.\n", 1852},
{"\ {"\
<space> Display next k lines of text [current screen size]\n\ <space> Display next k lines of text [current screen size]\n\
z Display next k lines of text [current screen size]*\n\ z Display next k lines of text [current screen size]*\n\
@ -2457,63 +2456,63 @@ ctrl-L Redraw screen\n\
:n Go to kth next file [1]\n\ :n Go to kth next file [1]\n\
:p Go to kth previous file [1]\n\ :p Go to kth previous file [1]\n\
:f Display current file name and line number\n\ :f Display current file name and line number\n\
. Repeat previous command\n", 1854}, . Repeat previous command\n", 1853},
{"[Press 'h' for instructions.]", 1855}, {"[Press 'h' for instructions.]", 1854},
{"\"%s\" line %d", 1856}, {"\"%s\" line %d", 1855},
{"[Not a file] line %d", 1857}, {"[Not a file] line %d", 1856},
{" Overflow\n", 1858}, {" Overflow\n", 1857},
{"...skipping\n", 1859}, {"...skipping\n", 1858},
{"Regular expression botch", 1860}, {"Regular expression botch", 1859},
{"\ {"\
\n\ \n\
Pattern not found\n", 1861}, Pattern not found\n", 1860},
{"Pattern not found", 1862}, {"Pattern not found", 1861},
{"can't fork\n", 1863}, {"can't fork\n", 1862},
{"\ {"\
\n\ \n\
...Skipping ", 1864}, ...Skipping ", 1863},
{"...Skipping to file ", 1865}, {"...Skipping to file ", 1864},
{"...Skipping back to file ", 1866}, {"...Skipping back to file ", 1865},
{"Line too long", 1867}, {"Line too long", 1866},
{"No previous command to substitute for", 1868}, {"No previous command to substitute for", 1867},
{"od: od(1) has been deprecated for hexdump(1).\n", 1869}, {"od: od(1) has been deprecated for hexdump(1).\n", 1868},
{"od: hexdump(1) compatibility doesn't support the -%c option%s\n", 1870}, {"od: hexdump(1) compatibility doesn't support the -%c option%s\n", 1869},
{"; see strings(1).", 1871}, {"; see strings(1).", 1870},
{"hexdump: can't read %s.\n", 1872}, {"hexdump: can't read %s.\n", 1871},
{"hexdump: line too long.\n", 1873}, {"hexdump: line too long.\n", 1872},
{"hexdump: byte count with multiple conversion characters.\n", 1874}, {"hexdump: byte count with multiple conversion characters.\n", 1873},
{"hexdump: bad byte count for conversion character %s.\n", 1875}, {"hexdump: bad byte count for conversion character %s.\n", 1874},
{"hexdump: %%s requires a precision or a byte count.\n", 1876}, {"hexdump: %%s requires a precision or a byte count.\n", 1875},
{"hexdump: bad format {%s}\n", 1877}, {"hexdump: bad format {%s}\n", 1876},
{"hexdump: bad conversion character %%%s.\n", 1878}, {"hexdump: bad conversion character %%%s.\n", 1877},
{"\ {"\
%s: Usage: %s [-number] [-p string] [-cefnrs] [+line] [+/pattern/] [files]\n", 1879}, %s: Usage: %s [-number] [-p string] [-cefnrs] [+line] [+/pattern/] [files]\n", 1878},
{"%s: option requires an argument -- %s\n", 1880}, {"%s: option requires an argument -- %s\n", 1879},
{"%s: illegal option -- %s\n", 1881}, {"%s: illegal option -- %s\n", 1880},
{"...skipping forward\n", 1882}, {"...skipping forward\n", 1881},
{"...skipping backward\n", 1883}, {"...skipping backward\n", 1882},
{"No next file", 1884}, {"No next file", 1883},
{"No previous file", 1885}, {"No previous file", 1884},
{"%s: Read error from %s file\n", 1886}, {"%s: Read error from %s file\n", 1885},
{"%s: Unexpected EOF in %s file\n", 1887}, {"%s: Unexpected EOF in %s file\n", 1886},
{"%s: Unknown error in %s file\n", 1888}, {"%s: Unknown error in %s file\n", 1887},
{"%s: Cannot create tempfile\n", 1889}, {"%s: Cannot create tempfile\n", 1888},
{"RE error: ", 1890}, {"RE error: ", 1889},
{"(EOF)", 1891}, {"(EOF)", 1890},
{"No remembered search string", 1892}, {"No remembered search string", 1891},
{"Cannot open ", 1893}, {"Cannot open ", 1892},
{"saved", 1894}, {"saved", 1893},
{": !command not allowed in rflag mode.\n", 1895}, {": !command not allowed in rflag mode.\n", 1894},
{"fork() failed, try again later\n", 1896}, {"fork() failed, try again later\n", 1895},
{"(Next file: ", 1897}, {"(Next file: ", 1896},
{"Unable to allocate bufferspace\n", 1898}, {"Unable to allocate bufferspace\n", 1897},
{"usage: rev [file ...]\n", 1899}, {"usage: rev [file ...]\n", 1898},
{"usage: %s [ -i ] [ -tTerm ] file...\n", 1900}, {"usage: %s [ -i ] [ -tTerm ] file...\n", 1899},
{"trouble reading terminfo", 1901}, {"trouble reading terminfo", 1900},
{"Unknown escape sequence in input: %o, %o\n", 1902}, {"Unknown escape sequence in input: %o, %o\n", 1901},
{"Unable to allocate buffer.\n", 1903}, {"Unable to allocate buffer.\n", 1902},
{"Input line too long.\n", 1904}, {"Input line too long.\n", 1903},
{"Out of memory when growing buffer.\n", 1905}, {"Out of memory when growing buffer.\n", 1904},
}; };
int _msg_tbl_length = 1905; int _msg_tbl_length = 1904;