tags 401180 + patch
thanks

Lucas Nussbaum <[EMAIL PROTECTED]> writes:

> I am using "file" chroots. the chroot is usually untared under
> /var/lib/schroot, however, I wanted to change this to another location
> (my /var is quite small, and many apps don't like it being full).
>
> I couldn't find any way to specify another directory for this, so I just
> symlinked /var/lib/schroot to another place. However, this caused
> $LIBEXEC_DIR/schroot-listmounts to be unable to determine that /home,
> /tmp, etc were still bind-mounted. So do_umount_all in that file exits
> without error even if my filesystems are still bind-mounted, and my home
> directory and my /tmp got removed.

I have attached a patch which I believe addresses this problem.
Please could you build schroot with the patch applied and test under
the same conditions (perhaps with a backup beforehand), to see if this
fixes things.  I have tested it myself, and I do think it works, but I
would appreciate some confirmation before uploading a fixed version.


Many thanks,
Roger


-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: schroot/schroot-listmounts-main.cc
===================================================================
--- schroot/schroot-listmounts-main.cc	(revision 1061)
+++ schroot/schroot-listmounts-main.cc	(working copy)
@@ -22,6 +22,7 @@
 #include "schroot-listmounts-main.h"
 
 #include <cerrno>
+#include <climits>
 #include <cstdio>
 #include <cstdlib>
 #include <ctime>
@@ -90,6 +91,12 @@
 
   std::string to_find = sbuild::normalname(this->opts->mountpoint);
 
+  // NOTE: This is a non-standard GNU extension.
+  char *rpath = realpath(to_find.c_str(), NULL);
+  to_find = rpath;
+  free(rpath);
+  rpath = 0;
+
   std::FILE *mntdb = std::fopen(mountfile.c_str(), "r");
   if (mntdb == 0)
     throw error(mountfile, OPEN, strerror(errno));

Attachment: pgpguegLUdzip.pgp
Description: PGP signature

Reply via email to