Bug 1731703 - sqlninja depends on files/directories from non-standard locations
Summary: sqlninja depends on files/directories from non-standard locations
Keywords:
Status: POST
Alias: None
Product: Fedora
Classification: Fedora
Component: sqlninja
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Arun S A G
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1731683
TreeView+ depends on / blocked
 
Reported: 2019-07-21 11:11 UTC by Igor Raits
Modified: 2023-11-17 14:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 18:40:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Igor Raits 2019-07-21 11:11:21 UTC
Hello,

Fedora Packaging Guidelines allow dependencies only on files/directories from /usr/bin, /usr/sbin and /etc directories[0].
Your package depends on files/directories outside of those. See below for more information about package/dependencies.

---
sqlninja-0.2.999-0.11.alpha1.fc30.noarch:
  - /usr/share/sqlninja/resurrectxp.pl
  - /usr/share/sqlninja/sqlcmd.pl
  - /usr/share/sqlninja/dirshell.pl
  - /usr/share/sqlninja/escalation.pl
  - /usr/share/sqlninja/fingerprint.pl
  - /usr/share/sqlninja/metasploit.pl
  - /usr/share/sqlninja/icmp.pl
  - /usr/share/sqlninja/upload.pl
  - /usr/share/sqlninja/session.pl
  - /usr/share/sqlninja/dns.pl
  - /usr/share/sqlninja/utils.pl
  - /usr/share/sqlninja/bruteforce.pl
  - /usr/share/sqlninja/backscan.pl
  - /usr/share/sqlninja/getdata.pl
  - /usr/share/sqlninja/test.pl
  - /usr/share/sqlninja/revshell.pl
---

Please correct those or provide reason why is it correct.
It is very important to not download huge filelists.xml just because few packages in distribution depend on non-standard paths.

Thanks for cooperation!


[0] https://docs.fedoraproject.org/en-US/packaging-guidelines/#_file_and_directory_dependencies

Comment 1 Ben Cotton 2019-08-13 16:50:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 2 Ben Cotton 2019-08-13 18:59:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 3 Ben Cotton 2020-11-03 15:21:01 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2020-11-24 18:40:58 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Zbigniew Jędrzejewski-Szmek 2023-02-27 12:12:22 UTC
Those deps are in fact generated automatically by perl-generators, based on this in the sources:

sqlninja-0.2.999-alpha1/sqlninja:
40:require "/usr/share/sqlninja/utils.pl";
41:require "/usr/share/sqlninja/session.pl";
42:require "/usr/share/sqlninja/fingerprint.pl";
43:require "/usr/share/sqlninja/bruteforce.pl";
44:require "/usr/share/sqlninja/escalation.pl";
45:require "/usr/share/sqlninja/upload.pl";
46:require "/usr/share/sqlninja/dirshell.pl";
47:require "/usr/share/sqlninja/revshell.pl";
48:require "/usr/share/sqlninja/backscan.pl";
49:require "/usr/share/sqlninja/dns.pl";
50:require "/usr/share/sqlninja/icmp.pl";
51:require "/usr/share/sqlninja/metasploit.pl";
52:require "/usr/share/sqlninja/test.pl";
53:require "/usr/share/sqlninja/sqlcmd.pl";
54:require "/usr/share/sqlninja/resurrectxp.pl";
55:require "/usr/share/sqlninja/getdata.pl";

Comment 6 "FeRD" (Frank Dana) 2023-11-06 17:36:52 UTC
(In reply to Zbigniew Jędrzejewski-Szmek from comment #5)
> Those deps are in fact generated automatically by perl-generators, based on
> this in the sources:
> 
> sqlninja-0.2.999-alpha1/sqlninja:
> 40:require "/usr/share/sqlninja/utils.pl";
[...etc...]

Yes, but those are paths WE'RE patching into the source. That's what the sqlninja-change-path-0.2.999-alpha1.patch file does.

The original paths are things like:

require "lib/utils.pl";
require "lib/session.pl";
require "lib/fingerprint.pl";

...because sqlninja as distributed isn't meant to be installed, it's meant to be run from the dist tree.

My Perl packaging is rusty, but it seems to me that instead of arbitrarily shoving the contents of lib/ into /usr/share/sqlninja/, those files should be installed to /usr/lib64/perl5/vendor_perl/SqlNinja/ instead. Then they can be loaded with statements like:

require "SqlNinja/utils.pl";
require "SqlNinja/session.pl";

and so on, correct? From my testing in `perlsh` it _seems_ as if that works, since the vendor_perl dir is in the default @INC. And I assume perl-generators won't pick out those paths as additional dependencies, since they're relative to vendor_perl.

Of course, it would be better if sqlninja distributed its components as actual Perl modules, properly installed into vendor_perl and loaded with "use SqlNinja::Utils;" and etc. But that'd require more rewriting, to turn the lib directory into an actual module package.

Comment 7 "FeRD" (Frank Dana) 2023-11-06 17:47:16 UTC
Actually, make that /usr/share/perl5/vendor_perl, aka %perl_vendorlib in /usr/lib/rpm/macros.d/macros.perl.

Comment 8 "FeRD" (Frank Dana) 2023-11-06 18:31:07 UTC
(In reply to "FeRD" (Frank Dana) from comment #6)
>
> My Perl packaging is rusty, but it seems to me that instead of arbitrarily
> shoving the contents of lib/ into /usr/share/sqlninja/, those files should
> be installed to /usr/lib64/perl5/vendor_perl/SqlNinja/ instead. Then they
> can be loaded with statements like:
> 
> require "SqlNinja/utils.pl";
> require "SqlNinja/session.pl";

So, that worked (using /usr/share/perl5/vendor_perl instead), as far as being able to run /usr/bin/sqlninja _itself_.

However, perl-generators was producing requires like:

perl(SqlNinja::utils.pl)

...but not producing the corresponding Provides. So, there were unsatisfied dependencies.

One solution to that is to simply REMOVE perl-generators from the BuildReq's entirely. (AFAICT it buys us nothing, with this package — all of the dependencies are missed, and have to be listed explicitly in the sqlninja.spec file anyway.) Then, the package installs and runs fine.

See the install-path branch in my fork, I'm hesitant to open a PR given the slightly-hackish nature of the changes.

https://src.fedoraproject.org/fork/ferdnyc/rpms/sqlninja/tree/install-path

Comment 9 Zbigniew Jędrzejewski-Szmek 2023-11-07 11:29:32 UTC
I don't think they're hacky. The new spec file is cleaner than the previous version ;)
Please submit this as PR. Those file dependencies will most likely stop working in either 
F40 (https://discussion.fedoraproject.org/t/f40-change-proposal-dnfconditionalfilelists-system-wide/94939)
or F41 (https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5).

Comment 10 "FeRD" (Frank Dana) 2023-11-17 00:19:41 UTC
Done: https://src.fedoraproject.org/rpms/sqlninja/pull-request/1

Comment 11 Zbigniew Jędrzejewski-Szmek 2023-11-17 14:15:46 UTC
The pull request was merged.


Note You need to log in before you can comment on or make changes to this bug.