Package: partimage
Version: 0.6.8-1
Severity: normal
Tags: upstream patch

How to reproduce:
- Reboot in an environment without /etc/mtab
- Try to save a partition without --allowmnt

Cause of problem:
- src/client/misc.cpp isMounted() returns -1 when /etc/mtab is not found
- src/client/misc.cpp systemChecks() checks for false - anything else is 
interpreted as "partition
mounted".
- szMountPoint is printed with msgBoxContinueCancel without being nulled and 
without being touched
by isMounted()

Workaround:
- Run partimage with --allowmnt (-m)

-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages partimage depends on:
ii  libbz2-1.0              1.0.5-6          high-quality block-sorting file co
ii  libc6                   2.11.2-10        Embedded GNU C Library: Shared lib
ii  libgcc1                 1:4.4.5-8        GCC support library
ii  libnewt0.52             0.52.11-1        Not Erik's Windowing Toolkit - tex
ii  libpam0g                1.1.1-6.1        Pluggable Authentication Modules l
ii  libslang2               2.2.2-4          The S-Lang programming library - r
ii  libssl0.9.8             0.9.8o-4squeeze1 SSL shared libraries
ii  libstdc++6              4.4.5-8          The GNU Standard C++ Library v3
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

partimage recommends no packages.

partimage suggests no packages.

-- no debconf information

--- src/client/misc.cpp.orig	2009-09-24 21:49:45.000000000 +0200
+++ src/client/misc.cpp	2011-08-31 21:25:50.000000000 +0200
@@ -1934,6 +1934,7 @@ int systemChecks(char *szDevice, bool bF
 {
   char szMountPoint[1024];
   int nRes;
+  int iMRV; // isMounted() Return Value
   
   // ----------- check for inode
   nRes = checkInodeForDevice(szDevice, szFullyBatchMode);
@@ -1949,10 +1950,15 @@ int systemChecks(char *szDevice, bool bF
     }		
   
   // ----------- check the partition is not mounted
-  if ((bFailIfMounted == true) && (isMounted(szDevice, szMountPoint) != false))
+  if ((bFailIfMounted == true) && ((iMRV=isMounted(szDevice, szMountPoint)) != false))
     {
+      if (iMRV==-1) {
+        nRes = g_interface->msgBoxContinueCancel(i18n("Error"), i18n("Can not find out if %s partition is mounted or not. Backing up mounted partitions is dangerous and mostly pointless. "
+								   "Please, cancel unless you are very sure it is a good idea to continue."), szDevice);
+      } else {
       nRes = g_interface->msgBoxContinueCancel(i18n("Error"), i18n("The %s partition is mounted. Partition Image can't work on mounted partitions. "
 								   "Please, unmount it before. You can do it with \"umount %s\""), szDevice, szMountPoint);
+      }
       if (nRes == MSGBOX_CANCEL)
 	RETURN_int(-1);
     }	

Reply via email to