Commit e777d2f6 authored by Martin Pitt's avatar Martin Pitt Committed by Jeremy Bicha

Import Debian changes 2.0.0-5

sysfsutils (2.0.0-5) unstable; urgency=medium

  * Urgency medium since this only fixes two RC bugs and libsysfs blocks
    move to testing for other packages.
  * debian/rules: Fix installation of library into the udeb. Closes: #355385
  * Add debian/patches/get_mnt_path_check.patch:
    - sysfs_get_mnt_path(): Check that sysfs is actually mounted and fail if
      not. Fixes behavioural breakage compared to 1.3.
    - Closes: #355540
parent 2e1a4cb5
sysfsutils (2.0.0-5) unstable; urgency=medium
* Urgency medium since this only fixes two RC bugs and libsysfs blocks
move to testing for other packages.
* debian/rules: Fix installation of library into the udeb. Closes: #355385
* Add debian/patches/get_mnt_path_check.patch:
- sysfs_get_mnt_path(): Check that sysfs is actually mounted and fail if
not. Fixes behavioural breakage compared to 1.3.
- Closes: #355540
-- Martin Pitt <mpitt@debian.org> Mon, 6 Mar 2006 19:08:56 +0100
sysfsutils (2.0.0-4) unstable; urgency=low
* Upload to unstable.
......
diff -ruN sysfsutils-2.0.0-old/lib/sysfs_utils.c sysfsutils-2.0.0/lib/sysfs_utils.c
--- sysfsutils-2.0.0-old/lib/sysfs_utils.c 2005-12-07 12:28:18.000000000 +0100
+++ sysfsutils-2.0.0/lib/sysfs_utils.c 2006-03-06 19:06:11.000000000 +0100
@@ -22,6 +22,7 @@
*/
#include "libsysfs.h"
#include "sysfs.h"
+#include <mntent.h>
/**
* sysfs_remove_trailing_slash: Removes any trailing '/' in the given path
@@ -53,6 +54,9 @@
{
static char sysfs_path[SYSFS_PATH_MAX] = "";
const char *sysfs_path_env;
+ FILE *mnt;
+ struct mntent *mntent;
+ int ret;
if (len == 0 || mnt_path == NULL)
return -1;
@@ -64,12 +68,31 @@
if (sysfs_path_env != NULL) {
safestrcpymax(mnt_path, sysfs_path_env, len);
sysfs_remove_trailing_slash(mnt_path);
- return 0;
+ } else {
+ safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
}
- safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
}
- return 0;
+ /* check that mount point is indeed mounted */
+ ret = -1;
+ if ((mnt = setmntent(SYSFS_PROC_MNTS, "r")) == NULL) {
+ dprintf("Error getting mount information\n");
+ return -1;
+ }
+ while ((mntent = getmntent(mnt)) != NULL) {
+ if (strcmp(mntent->mnt_type, SYSFS_FSTYPE_NAME) == 0 &&
+ strcmp(mntent->mnt_dir, mnt_path) == 0) {
+ ret = 0;
+ break;
+ }
+ }
+
+ endmntent(mnt);
+
+ if (ret < 0)
+ errno = ENOENT;
+
+ return ret;
}
/**
......@@ -9,6 +9,6 @@ include /usr/share/cdbs/1/rules/simple-patchsys.mk
DEB_CONFIGURE_EXTRA_FLAGS := --libdir=/lib
install/libsysfs1-udeb::
cp -L debian/tmp/lib/libsysfs.so.? debian/libsysfs2-udeb/lib
install/libsysfs2-udeb::
cp -L debian/tmp/lib/libsysfs.so.? debian/$(cdbs_curpkg)/lib
chmod 644 $(DEB_DESTDIR)/lib/*.so
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