[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug in quotatool, need to update package



Hi there,

Am 07.06.13 11:45, schrieb Dimitry Bansikov:
> Please fix this bug in debian 7, you need to update package:
> https://github.com/ekenberg/quotatool/issues/9
>  
> Bug was already fixed in version 1.4.13 by quota team.
> - Ignore linux initramfs mount entry for rootfs

I grabed
https://github.com/ekenberg/quotatool/commit/a83c6d0d1bf623234e860dd7bfd3840c812fc32c.patch
and added it to the wheezy package. This solved the problem for me on
Debian Jessie.

A debdiff is attached and the package can be found at:

http://ftp.cyconet.org/debian/archive/unofficial/quotatool/1.4.12-1.1/

It would very welcomed to get that into Debian Jessie. Without it maybe
hard to get quota working proper.

Many thanks, Jan.
-- 
Never write mail to <waja@spamfalle.info>, you have been warned!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS
PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++
------END GEEK CODE BLOCK------
diff -Nru quotatool-1.4.12/debian/changelog quotatool-1.4.12/debian/changelog
--- quotatool-1.4.12/debian/changelog	2012-02-26 13:18:20.000000000 +0100
+++ quotatool-1.4.12/debian/changelog	2014-12-12 15:44:26.000000000 +0100
@@ -1,3 +1,10 @@
+quotatool (1.4.12-1.1) unstable; urgency=medium
+
+  * Adding debian/patches/ignore_initramfs.diff takes from upstream
+    (Closes: #711502)
+
+ -- Jan Wagner <waja@cyconet.org>  Fri, 12 Dec 2014 14:27:17 +0100
+
 quotatool (1.4.12-1) unstable; urgency=low
 
   * New upstream release
diff -Nru quotatool-1.4.12/debian/patches/ignore_initramfs.diff quotatool-1.4.12/debian/patches/ignore_initramfs.diff
--- quotatool-1.4.12/debian/patches/ignore_initramfs.diff	1970-01-01 01:00:00.000000000 +0100
+++ quotatool-1.4.12/debian/patches/ignore_initramfs.diff	2014-12-12 14:49:42.000000000 +0100
@@ -0,0 +1,138 @@
+From a83c6d0d1bf623234e860dd7bfd3840c812fc32c Mon Sep 17 00:00:00 2001
+From: Johan Ekenberg <johan@ekenberg.se>
+Date: Sat, 22 Dec 2012 21:24:04 +0100
+Subject: [PATCH] Ignore linux initramfs mount entry for rootfs
+
+---
+ src/system.c | 34 ++++++++++++++++++++--------------
+ 1 file changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/src/system.c b/src/system.c
+index e2e236f..38bf1df 100644
+--- a/src/system.c
++++ b/src/system.c
+@@ -48,7 +48,7 @@ struct mntent {
+ 
+ 
+ 
+-/* 
++/*
+  * system_getfs
+  * find and verify the device file for
+  * a given filesystem
+@@ -72,7 +72,7 @@ fs_t *system_getfs (char *fs_spec) {
+ 
+ 
+ #if HAVE_SYS_MNTCTL_H /* AIX, we are again in trouble. */
+-  /* first mntctl call is only for getting the size of 
++  /* first mntctl call is only for getting the size of
+    * vmnt array. is there a better way? */
+   vmnt_retval = mntctl (MCTL_QUERY, sizeof(int), (char*)&vmnt_size);
+   if (vmnt_retval != -1) {
+@@ -102,7 +102,7 @@ fs_t *system_getfs (char *fs_spec) {
+ 
+   /* loop through mtab until we get a match */
+   do {
+-    
++
+     /* read the next entry */
+ #if HAVE_SYS_MNTTAB_H
+     int retval;
+@@ -112,9 +112,9 @@ fs_t *system_getfs (char *fs_spec) {
+     current_fs=getmntent(etc_mtab);
+     if ( ! current_fs ) {
+ #elif HAVE_SYS_MNTCTL_H /* AIX, we are again in trouble. */
+-   current_fs->mnt_special = 
++   current_fs->mnt_special =
+ 	(char*)vmnt + (vmnt->vmt_data[VMT_OBJECT].vmt_off);
+-   current_fs->mnt_mountp = 
++   current_fs->mnt_mountp =
+ 	(char*)vmnt + (vmnt->vmt_data[VMT_STUB].vmt_off);
+    current_fs->vmt_flags = vmnt->vmt_flags;
+    vmnt = (struct vmount*) ((char*)vmnt + vmnt->vmt_length);
+@@ -123,10 +123,16 @@ fs_t *system_getfs (char *fs_spec) {
+       output_error ("Filesystem %s does not exist", fs_spec);
+       return NULL;
+     }
+-    
++
+     output_debug ("Checking device '%s', mounted at '%s'",
+ 		  current_fs->mnt_special, current_fs->mnt_mountp);
+ 
++    /* Ignore 'rootfs' if looking for mountpoint '/' - created and mounted by Linux initramfs */
++    if (strcmp("/", fs_spec) == 0 && strcmp(current_fs->mnt_special, "rootfs") == 0) {
++        output_debug ("Ignoring initramfs 'rootfs'\n");
++        continue;
++    }
++
+     /* does the name given match the mount pt or device file ? */
+     if ( ! strcmp(current_fs->mnt_special, fs_spec)
+ 	 || ! strcmp(current_fs->mnt_mountp, fs_spec) ) {
+@@ -161,7 +167,7 @@ fs_t *system_getfs (char *fs_spec) {
+ 	}
+       }
+       else {
+-#endif /* HAVE_MNTENT_H */	
++#endif /* HAVE_MNTENT_H */
+       strncpy (ent->device, current_fs->mnt_special, PATH_MAX-1);
+       strncpy (ent->mount_pt, current_fs->mnt_mountp, PATH_MAX-1);
+ #if HAVE_MNTENT_H
+@@ -171,7 +177,7 @@ fs_t *system_getfs (char *fs_spec) {
+       continue;
+     }
+ 
+-  } while ( ! done ) ;  
++  } while ( ! done ) ;
+ 
+ 
+   /* can we write to the device? */
+@@ -181,7 +187,7 @@ fs_t *system_getfs (char *fs_spec) {
+     output_error ("Filesystem %s is mounted read-only\n", fs_spec);
+     free(current_fs);
+     free(vmnt_buffer);
+-#else 
++#else
+   if ( hasmntopt(current_fs, "ro") ) {
+     output_error ("Filesystem %s is mounted read-only\n", fs_spec);
+     endmntent (etc_mtab);
+@@ -194,7 +200,7 @@ fs_t *system_getfs (char *fs_spec) {
+ #if HAVE_SYS_MNTCTL_H
+   free(current_fs);
+   free(vmnt_buffer);
+-#else 
++#else
+   endmntent (etc_mtab);
+ #endif
+   return ent;
+@@ -212,12 +218,12 @@ uid_t system_getuid (char *user) {
+   char *temp_str;
+   /* seach by name first */
+    pwent = getpwnam (user);
+- 
++
+    if ( pwent == NULL ) {
+ 
+      /* maybe we were given a numerical id */
+      uid = strtol(user, &temp_str, 10);
+-     pwent = getpwuid ((uid_t) uid); 
++     pwent = getpwuid ((uid_t) uid);
+      if ( (user == temp_str) || ( pwent == NULL ) ) {
+        output_error ("User %s does not exist\n", user);
+        return -1;
+@@ -233,7 +239,7 @@ gid_t system_getgid (char *group) {
+   struct group  *grent;
+   int gid;
+   char *temp_str;
+-  
++
+   /* check for group name first */
+   grent = getgrnam (group);
+   if ( grent == NULL ) {
+@@ -245,6 +251,6 @@ gid_t system_getgid (char *group) {
+ 	return (gid_t) -1;
+       }
+   }
+-  output_info ("group '%s' has gid %d", group, grent->gr_gid);  
++  output_info ("group '%s' has gid %d", group, grent->gr_gid);
+   return (grent->gr_gid);
+ }
diff -Nru quotatool-1.4.12/debian/patches/series quotatool-1.4.12/debian/patches/series
--- quotatool-1.4.12/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ quotatool-1.4.12/debian/patches/series	2014-12-12 14:26:37.000000000 +0100
@@ -0,0 +1 @@
+ignore_initramfs.diff

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: