Summary: | perl-suidperl does not install correctly | ||
---|---|---|---|
Product: | Sisyphus | Reporter: | Sergey Vlasov <vsu> |
Component: | perl-suidperl | Assignee: | at <at> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P4 | ||
Version: | unstable | ||
Hardware: | all | ||
OS: | Linux |
Description
Sergey Vlasov
2002-12-25 18:30:02 MSK
Strange thing is that the same mechanism is used for perl and suidpler linking. $ ./perl installperl -n -V 2>&1 | grep \'/bin/.*perl[$5]\' 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.) Strange thing is that the same mechanism is used for perl and suidpler linking. $ ./perl installperl -n -V 2>&1 | grep \'/bin/.*perl[$5]\' 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.) 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. 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. 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 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 fixed and working long ago 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. |