public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Voelker <mail@bernhard-voelker.de>
To: "util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: Re: [PATCH] libmount: avoid endless loop in, mnt_get_kernel_cmdline_option
Date: Tue, 04 Dec 2012 16:22:02 +0100	[thread overview]
Message-ID: <50BE151A.9090608@bernhard-voelker.de> (raw)
In-Reply-To: <50B8DB65.60505@bernhard-voelker.de>

On 11/30/2012 05:14 PM, Bernhard Voelker wrote:
> From 4ddf21607847570e1da3b692276f2a8242bd5af6 Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <mail@bernhard-voelker.de>
> Date: Fri, 30 Nov 2012 17:12:12 +0100
> Subject: [PATCH] libmount: avoid endless loop in
>  mnt_get_kernel_cmdline_option

Hi Karel,

BTW: the #ifdef in mnt_get_kernel_cmdline_option doesn't seem
to work to make use of the LIBMOUNT_KERNEL_CMDLINE env var:

--- tests/expected/libmount/utils-kernel-cmdline       2012-11-22 10:41:18.424077009 +0100
+++ tests/output/libmount/utils-kernel-cmdline   2012-12-04 16:17:49.629199061 +0100
@@ -1,5 +1,5 @@
-'selinux=' found, argument: '0'
+'selinux=' not found
 'selinux' not found
-'ro' found
+'ro' not found
 'ro=' not found
-'root=' found, argument: 'UUID=33230ae2-1093-4353-824c-f7ca09a2a882'
+'root=' found, argument: '/dev/sda1'

And ltraced:

 $ export LIBMOUNT_KERNEL_CMDLINE=`pwd`/tests/ts/libmount/files/kernel_cmdline
 $ ltrace -e getenv,fopen -f ./test_mount_utils  --kernel-cmdline selinux=
 getenv("LIBMOUNT_DEBUG")                                                                    = NULL
 fopen("/proc/cmdline", "r")                                                                 = 0x609010
 'selinux=' not found
 +++ exited (status 0) +++

I.e. the utils test may only work on your PC. ;-)


BTW2: the libmount tests all fail when the user has set
LIBMOUNT_DEBUG=0xffff, because the produced output differs.
Maybe LIBMOUNT_DEBUG should be unset in tests/run.sh?

Have a nice day,
Berny

  reply	other threads:[~2012-12-04 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 16:14 [PATCH] libmount: avoid endless loop in, mnt_get_kernel_cmdline_option Bernhard Voelker
2012-12-04 15:22 ` Bernhard Voelker [this message]
2012-12-10 12:44   ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50BE151A.9090608@bernhard-voelker.de \
    --to=mail@bernhard-voelker.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox