<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>1755</bug_id>
          
          <creation_ts>2002-12-25 18:30:02 +0300</creation_ts>
          <short_desc>perl-suidperl does not install correctly</short_desc>
          <delta_ts>2003-11-14 15:55:47 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>perl-suidperl</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sergey Vlasov">vsu</reporter>
          <assigned_to name="at@altlinux.org">at</assigned_to>
          
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1596</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey Vlasov">vsu</who>
    <bug_when>2002-12-25 18:30:02 +0300</bug_when>
    <thetext>perl-suidperl does not work after installation, because /usr/bin/suidperl is not installed setuid root. Looks like the problem is that /usr/bin/sperl5.8.0 and /usr/bin/suidperl are hard links to the same file, but only one of them is listed with %attr(4711,root,root) in perl.spec.

Example:

# rpm -e perl-suidperl
# rpm -Uvh ...../perl-suidperl-5.8.0-alt0.9.i586.rpm
Preparing...                 ##################################################
perl-suidperl                ##################################################
# ls -lai /usr/bin/sperl5.8.0 /usr/bin/suidperl
29404718 -rwx--x--x    2 root     root        59728 Дек 15 16:17 /usr/bin/sperl5.8.0
29404718 -rwx--x--x    2 root     root        59728 Дек 15 16:17 /usr/bin/suidperl
# rpm --verify perl-suidperl
.M......   /usr/bin/sperl5.8.0
# chmod u+s /usr/bin/suidperl
# ls -lai /usr/bin/sperl5.8.0 /usr/bin/suidperl
29404718 -rws--x--x    2 root     root        59728 Дек 15 16:17 /usr/bin/sperl5.8.0
29404718 -rws--x--x    2 root     root        59728 Дек 15 16:17 /usr/bin/suidperl
# rpm --verify perl-suidperl
.M......   /usr/bin/suidperl
---

---

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4620</commentid>
    <comment_count>1</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2002-12-25 19:33:53 +0300</bug_when>
    <thetext>Strange thing is that the same mechanism is used for perl and suidpler linking.

$ ./perl installperl -n -V 2&amp;gt;&amp;amp;1 | grep \&apos;/bin/.*perl[$5]\&apos;
  cp perl /var/tmp/perl-buildroot/usr/bin/perl5.8.0
  chmod 755 /var/tmp/perl-buildroot/usr/bin/perl5.8.0
  cp suidperl /var/tmp/perl-buildroot/usr/bin/sperl5.8.0
  chmod 4711 /var/tmp/perl-buildroot/usr/bin/sperl5.8.0
  ln /var/tmp/perl-buildroot/usr/bin/perl5.8.0 /var/tmp/perl-buildroot/usr/bin/perl
  ln /var/tmp/perl-buildroot/usr/bin/sperl5.8.0 /var/tmp/perl-buildroot/usr/bin/suidperl
$

(This is pseudocode, not shell commands. So installperl scrit has to be examined in detail.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7985</commentid>
    <comment_count>2</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2002-12-25 19:33:53 +0300</bug_when>
    <thetext>Strange thing is that the same mechanism is used for perl and suidpler linking.

$ ./perl installperl -n -V 2&amp;gt;&amp;amp;1 | grep \&apos;/bin/.*perl[$5]\&apos;
  cp perl /var/tmp/perl-buildroot/usr/bin/perl5.8.0
  chmod 755 /var/tmp/perl-buildroot/usr/bin/perl5.8.0
  cp suidperl /var/tmp/perl-buildroot/usr/bin/sperl5.8.0
  chmod 4711 /var/tmp/perl-buildroot/usr/bin/sperl5.8.0
  ln /var/tmp/perl-buildroot/usr/bin/perl5.8.0 /var/tmp/perl-buildroot/usr/bin/perl
  ln /var/tmp/perl-buildroot/usr/bin/sperl5.8.0 /var/tmp/perl-buildroot/usr/bin/suidperl
$

(This is pseudocode, not shell commands. So installperl scrit has to be examined in detail.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4621</commentid>
    <comment_count>3</comment_count>
    <who name="Sergey Vlasov">vsu</who>
    <bug_when>2002-12-25 20:08:35 +0300</bug_when>
    <thetext>Probably rpmbuild ignores the SUID bit from the buildroot files when creating the binary package.

perl58.spec contains:

%files suidperl
        %attr(4711,root,root) %_bindir/sperl%version
        %_bindir/suidperl

Therefore the RPM package data says this:

$ rpm -qlvp perl-suidperl-5.8.0-alt0.9.i586.rpm 
-rws--x--x    1 root    root            59728 Дек 15 16:17 /usr/bin/sperl5.8.0
-rwx--x--x    1 root    root            59728 Дек 15 16:17 /usr/bin/suidperl

However, these two files are really the same (hard link) - and this information is also stored in the RPM, but in some other place. So rpm correctly recreates the hard link during installation, but does not know which one of the conflicting mode specifications must be used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7986</commentid>
    <comment_count>4</comment_count>
    <who name="Sergey Vlasov">vsu</who>
    <bug_when>2002-12-25 20:08:35 +0300</bug_when>
    <thetext>Probably rpmbuild ignores the SUID bit from the buildroot files when creating the binary package.

perl58.spec contains:

%files suidperl
        %attr(4711,root,root) %_bindir/sperl%version
        %_bindir/suidperl

Therefore the RPM package data says this:

$ rpm -qlvp perl-suidperl-5.8.0-alt0.9.i586.rpm 
-rws--x--x    1 root    root            59728 Дек 15 16:17 /usr/bin/sperl5.8.0
-rwx--x--x    1 root    root            59728 Дек 15 16:17 /usr/bin/suidperl

However, these two files are really the same (hard link) - and this information is also stored in the RPM, but in some other place. So rpm correctly recreates the hard link during installation, but does not know which one of the conflicting mode specifications must be used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4622</commentid>
    <comment_count>5</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2002-12-25 20:33:48 +0300</bug_when>
    <thetext>Thank you, I see. I just wanted to stress that it appears to be pretty strange that /usr/bin/perl is symlink and /usr/bin/sudperl is hardlink while the same linking mehcanism is used for both of them. 

But I have just figured out that symlinking is forced in spec file for /usr/bin/perl:

ln -sf perl%majver $RPM_BUILD_ROOT%_bindir/perl
ln -sf perl%version $RPM_BUILD_ROOT%_bindir/perl%majver

Without this /usr/bin/perl should be a hardlink, too.

OK, I will add
ln -sf suidperl $RPM_BUILD_ROOT%_bindir/sperl%version</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7987</commentid>
    <comment_count>6</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2002-12-25 20:33:48 +0300</bug_when>
    <thetext>Thank you, I see. I just wanted to stress that it appears to be pretty strange that /usr/bin/perl is symlink and /usr/bin/sudperl is hardlink while the same linking mehcanism is used for both of them. 

But I have just figured out that symlinking is forced in spec file for /usr/bin/perl:

ln -sf perl%majver $RPM_BUILD_ROOT%_bindir/perl
ln -sf perl%version $RPM_BUILD_ROOT%_bindir/perl%majver

Without this /usr/bin/perl should be a hardlink, too.

OK, I will add
ln -sf suidperl $RPM_BUILD_ROOT%_bindir/sperl%version</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10621</commentid>
    <comment_count>7</comment_count>
    <who name="Sergey Vlasov">vsu</who>
    <bug_when>2003-11-14 15:52:06 +0300</bug_when>
    <thetext>fixed and working long ago</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10622</commentid>
    <comment_count>8</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2003-11-14 15:55:47 +0300</bug_when>
    <thetext>Are you using suidperl, by the way.
I believe suidperl will be dropped in perl-5.10.0, which will probably be
released within two years.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>