<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>174071</bug_id>
          
          <creation_ts>2007-04-10 19:09 0000</creation_ts>
          <short_desc>x11-apps/xinit initscript reads nox falsely</short_desc>
          <delta_ts>2007-04-13 08:23:10 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>Inclusion</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>brigad@rpi.edu</reporter>
          <assigned_to>x11@gentoo.org</assigned_to>
          <cc>alan.mckinnon@gmail.com</cc>
    
    <cc>jakub@gentoo.org</cc>
    
    <cc>uberlord@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>brigad@rpi.edu</who>
            <bug_when>2007-04-10 19:09:24 0000</bug_when>
            <thetext>If I boot my computer, the xdm init script acts as though it saw &quot;nox&quot; on the kernel boot command line.  The cmdline_opt function doesn&apos;t return 1 if it doesn&apos;t find the nox option, so the script thinks it&apos;s there even though it isn&apos;t.  The simple fix is to add a return 1 at the end of the cmdline_opt script for the case where it doesn&apos;t find the parameter.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>brigad@rpi.edu</who>
            <bug_when>2007-04-10 19:10:08 0000</bug_when>
            <thetext>Created an attachment (id=115923)
Patch to fix cmdline_opt function

This fixes the issue</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dberkholz@gentoo.org</who>
            <bug_when>2007-04-10 20:16:18 0000</bug_when>
            <thetext>I suppose that means the previous command returned some wonky value, so that&apos;s what the function ends up returning.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>brigad@rpi.edu</who>
            <bug_when>2007-04-10 23:46:41 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; I suppose that means the previous command returned some wonky value, so that&apos;s
&gt; what the function ends up returning.
&gt; 

Well, if you have no arguments for the for command, then the for command succeeds, and the function implicitly returns 0 (true).  If you have arguments, but they don&apos;t match, the function implicitly returns 1 (false).  If you have arguments that do match, the function explicitly runs the return 0.

I guess it&apos;s just kind of a particular of how shell scripting works.  I think the cmdline_opt function works properly as long as the user has at least one boot option, but fails if he doesn&apos;t.  This patch should fix the behavior for all.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-04-11 07:05:29 0000</bug_when>
            <thetext>(In reply to comment #3)

&gt; the cmdline_opt function works properly as long as the user has at least one
&gt; boot option, but fails if he doesn&apos;t.  This patch should fix the behavior for
&gt; all.

Well no, it doesn&apos;t work at all currently, xdm is never started.

$ cat /proc/cmdline 
root=/dev/hda9 root=/dev/ram0 init=/linuxrc real_root=/dev/hda9 video=vesafb:ywrap,mtrr,1024x768-24@100 splash=silent,theme:livecd-2006.1 CONSOLE=/dev/tty1 quiet fbcon=scrollback:128K hde=noprobe hdf=noprobe hdg=noprobe hdh=noprobe elevator=cfq

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-04-12 20:46:55 0000</bug_when>
            <thetext>*** Bug 174271 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>uberlord@gentoo.org</who>
            <bug_when>2007-04-13 08:23:10 0000</bug_when>
            <thetext>Fixed in -r3, sorry about that.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>115923</attachid>
            <date>2007-04-10 19:10 0000</date>
            <desc>Patch to fix cmdline_opt function</desc>
            <filename>xdm.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHhkbS1vbGQJMjAwNy0wNC0xMCAxNTowNToxNC4yNDE4MDMyMDYgLTA0MDAKKysrIHhkbQky
MDA3LTA0LTEwIDE1OjA4OjQxLjY1NTE2MDk5NyAtMDQwMApAQCAtOTcsNiArOTcsOCBAQAogCWZv
ciBvcHQgaW4gJChjYXQgL3Byb2MvY21kbGluZSkgOyBkbwogCQlbICIke29wdH0iID0gIiR7MX0i
IF0gJiYgcmV0dXJuIDAKIAlkb25lCisKKwlyZXR1cm4gMQogfQogCiBzdGFydCgpIHsK
</data>        

          </attachment>
    </bug>

</bugzilla>