Commit 5e5c6d2a authored by Petter Reinholdtsen's avatar Petter Reinholdtsen

Revert git master to upstream state.

parent af542ea5
This diff is collapsed.
This diff is collapsed.
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `regcomp' function. */
#undef HAVE_REGCOMP
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
This diff is collapsed.
......@@ -29,7 +29,7 @@ dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
AC_CHECK_FUNCS(regcomp strdup strerror asprintf)
AC_CHECK_FUNCS(regcomp strdup strerror)
dnl only try standard kernel paths if the toolchain
dnl is unable to locate linux includes by itself
......
This diff is collapsed.
/**
* dmcrypt-get-device.c
* (c) 2005 Canonical Ltd.
* Author: Martin Pitt <martin.pitt@ubuntu.com>
* License: GNU General Public License (http://www.gnu.org/copyleft/gpl.html)
*
* Given a dmcrypt device name, this program queries the underlying physical
* device, prints "major:minor" to the standard output and exits with 0. If an
* error occurs or the device is not a dmcrypt mapped one, nothing is printed
* and the program exits with 1.
*
* Opening /dev/mapper/control requires root privileges, therefore this
* program needs to be installed setuid root. Root privileges are dropped
* immediately after querying the information from the device mapper. The
* parsing is done with normal user privileges afterwards.
*/
#include <libdevmapper.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
int
main (int argc, char** argv)
{
struct dm_task *dmt = NULL;
struct dm_info dmi;
char *target_type = NULL, *params = NULL;
uint64_t start, length;
void *next = NULL;
struct stat st;
unsigned major, minor;
if (argc != 2) {
fputs ("Usage: dmcrypt-get-device <device>\n", stderr);
return 1;
}
/* Check that argument has the form /dev/mapper/<name> */
const char* devmapdir = "/dev/mapper/";
const int devmapdirlen = strlen (devmapdir);
if (strncmp (argv[1], devmapdir, devmapdirlen))
return 1;
if (strchr (argv[1] + devmapdirlen, '/'))
return 1;
/* Check that argument is a block device */
if (stat (argv[1], &st) || !S_ISBLK(st.st_mode))
return 1;
/* Request device info */
if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
return 1;
if (!dm_task_set_name(dmt, argv[1]))
return 1;
if (!dm_task_run(dmt))
return 1;
/* Drop all privileges */
setgid(getgid());
setuid(getuid());
if (!dm_task_get_info(dmt, &dmi))
return 1;
/* Get underlying physical device */
next = dm_get_next_target(dmt, next, &start, &length,
&target_type, &params);
/* verify validity and that it is a dmcrypt device */
if (!target_type || strcmp(target_type, "crypt") || next)
return 1;
/* params has the format: cipher key offset major:minor <unknown> */
length = sscanf(params, "%*s %*s %*s %u:%u %*s", &major, &minor);
if (length != 2)
return 1;
/* Success */
printf ("%u:%u\n", major, minor);
return 0;
}
This diff is collapsed.
......@@ -3,10 +3,28 @@ PREFIX=$(DESTDIR)/usr
INSTALL = install
MODIR = $(PREFIX)/share/locale
POTFILES = ../*.c ../*.h
POFILES= cs.po de.po es.po fr.po it.po ja.po ru.po sl.po sv.po tr.po zh_TW.po pt.po pt_BR.po
POFILES= de.po es.po fr.po ja.po ru.po tr.po zh_TW.po pt_BR.po cs_CZ.po
all:
fix-po-files:
mv de_DE.po de.po
mv es_ES.po es.po
mv fr_FR.po fr.po
mv ja_JP.eucJP.po ja.po
mv ru_RU.po ru.po
mv tr_TR.po tr.po
mv zh_TW.UTF-8.po zh_TW.po
restitute-po-files:
mv de.po de_DE.po
mv es.po es_ES.po
mv fr.po fr_FR.po
mv ja.po ja_JP.eucJP.po
mv ru.po ru_RU.po
mv tr.po tr_TR.po
mv zh_TW.po zh_TW.UTF-8.po
mo:
files='$(POFILES)'; \
for file in $$files;do \
......@@ -15,6 +33,7 @@ mo:
done
install:
$(MAKE) fix-po-files
$(MAKE) mo
files='$(POFILES)'; \
for file in $$files;do \
......@@ -26,6 +45,7 @@ install:
fi; \
cp $$LOCALENAME.mo $$MOPATH/$(PKGNAME).mo; \
done
$(MAKE) restitute-po-files
pot:
xgettext --keyword=_ --keyword=N_ $(POTFILES) -o $(PKGNAME).pot
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment