<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11126</bug_id>
          
          <creation_ts>2017-03-06 13:01:22 +0000</creation_ts>
          <short_desc>&quot;su --login&quot; fails when using pam + util-linux</short_desc>
          <delta_ts>2017-08-01 09:39:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Backport to 2.3.1</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Patrick Ohly">patrick.ohly</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71083</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-06 13:01:22 +0000</bug_when>
    <thetext>To reproduce, build current poky with this in local.conf:

DISTRO_FEATURES_append = &quot; pam systemd&quot;
VIRTUAL-RUNTIME_init_manager = &quot;systemd&quot;
VIRTUAL-RUNTIME_initscripts = &quot;&quot;
DISTRO_FEATURES_BACKFILL_CONSIDERED = &quot;sysvinit&quot;
IMAGE_INSTALL_append = &quot; util-linux&quot;

The relevant part is enabling pam and installing util-linux. Using systemd probably doesn&apos;t matter.

Build core-image-minimal, boot into qemu. Then:

qemux86 login: root
root@qemux86:~# useradd test
root@qemux86:~# /bin/su.util-linux - test
su.util-linux: Authentication failure

This only occurs:
* when using - (aka --login)
* for su from util-linux
* when using pam

The default priorities are:

/bin/busybox.suid 50
/bin/su.shadow 200
/bin/su.util-linux 80

So normally this should occur.

The root cause of the problem is that su.util-linux looks for a pam &quot;su-l&quot; config file instead of the normal &quot;su&quot; config file. When not found, it uses &quot;other&quot;, which has &quot;auth pam_deny.so&quot; and thus prevents the operation.

This fixes the problem:
ln -s su /etc/pam.d/su-l

How useful is it to have su.util-linux? Instead of adding su-l I&apos;m leaning towards simply disabling the utility entirely. It&apos;s currently in:

PACKAGECONFIG[pam] = &quot;--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71084</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-06 13:01:57 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; The default priorities are:
&gt; 
&gt; /bin/busybox.suid 50
&gt; /bin/su.shadow 200
&gt; /bin/su.util-linux 80
&gt; 
&gt; So normally this should occur.

Should *not* occur.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73737</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-06-06 11:26:39 +0000</bug_when>
    <thetext>Patrick, would you be able to handle this?  Your resolution seems sensible to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73978</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-06-12 11:13:18 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Patrick, would you be able to handle this?  Your resolution seems sensible
&gt; to me.

Which solution? Symlinking /etc/pam.d/su-l or removing su from util-linux?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74947</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-07-12 09:03:10 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Patrick, would you be able to handle this?  Your resolution seems sensible
&gt; &gt; to me.
&gt; 
&gt; Which solution? Symlinking /etc/pam.d/su-l or removing su from util-linux?

symlink fix set to the list: &quot;util-linux: fix &quot;su -&quot; and package su separately&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75550</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-08-01 09:39:19 +0000</bug_when>
    <thetext>Fixed in &quot;util-linux: fix &quot;su -&quot; and package su separately&quot;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>