Bug 264309

Summary: drop strict requires to netcat
Product: [openSUSE] openSUSE 10.2 Reporter: Marcus Meissner <meissner>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: james.mason, jsmeix, mvidner
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: remote-tools.tar.bz2

Description Marcus Meissner 2007-04-13 14:36:55 UTC
yast2-core and yast2-printer use netcat to do some probing kind
of things.

Both RPMS have strict requires on "netcat" to help this.


A pretty paranoid customer wants to remote netcat from their systems
(and accepts the reduced probing functionality), but runs into problems
with the hard RPM requires to it.

Perhaps we could just lessen those requirements down to "Recommends"
and add some bits of error handling to the ag_hostnames script in yast2-core
and the scripts in yast2-printer so that they exit gracefully or wiht
a good errormessage if netcat is not installed.

(We discussed a Requestor for "netcat" installation on yast-devel, but
I do not think we need it, a lowlevel approach is sufficient)
Comment 1 Johannes Meixner 2007-04-16 08:42:24 UTC
I can fix the scripts in yast2-printer (but not in yast2-core)
because I made most of them.

Of course they must exit with an error (special non-zero exit code)
because without netcat the test cannot be done successfully.

Michal,
how do you pefer it to be done?
Should I work directly in SVN or should I send you fixed scripts?
Would you fix the dialogs so that an appropriate "missing netcat"
message is shown to the user so that it is clear for the user
when a test failed only because of a missing test-tool
and not because of a real problem?


By the way:
Is a RPM "Recommends" sufficient to get netcat installed by default
or are additional entries in the patterns necessary?
Comment 2 Michal Zugec 2007-04-16 09:07:57 UTC
> how do you pefer it to be done?
> Should I work directly in SVN or should I send you fixed scripts?

I prefer to send changes to me

>> Would you fix the dialogs so that an appropriate "missing netcat"
>> message is shown to the user so that it is clear for the user
>> when a test failed only because of a missing test-tool
>> and not because of a real problem?

I think disabled button with text ("to enable this functionality install netcat package") will be fine. Yes, I will do that

Reccomends is enought
Comment 3 Martin Vidner 2007-04-16 16:02:15 UTC
yast2-core-2.15.7 only Recommends netcat.rpm and will return [".install.netcat.rpm"] as the host list if it cannot find the required rpm. The application can translate this to whatever it pleases.
Comment 4 Johannes Meixner 2007-04-17 09:38:53 UTC
Created attachment 131669 [details]
remote-tools.tar.bz2

This archive contains new versions of

listen_remote_ipp
test_remote_ipp
test_remote_lpd
test_remote_novell
test_remote_smb
test_remote_socket
Comment 5 Johannes Meixner 2007-04-17 09:45:02 UTC
Michal,
the new scripts are in attachment #131669 [details].

I test for all executables except those in the coreutils RPM
(i.e. I assume the coreutils RPM is installed).

If exit code >= 10 then an executable is missing.

The exact exit code describes which executable is missing
(but I simply abort at the first missing executable):
#         10 ping not executable (no iputils RPM installed?)
#         11 netcat not executable (no netcat RPM installed?)
#         12 fuser not executable (no psmisc RPM installed?)
#         13 mktemp not executable (no mktemp RPM installed?)
#         14 sed not executable (no sed RPM installed?)
#         15 lp not executable (no cups-client RPM installed?)
#         16 smbclient not executable (no samba-client RPM installed?)
#         17 nprint not executable (no ncpfs RPM installed?)
Comment 6 Michal Zugec 2008-01-18 07:26:07 UTC
netcat is still required by yast2-core, but there are plans to remove it.
Martin?
Comment 7 Michal Zugec 2008-01-23 12:14:34 UTC
Johannes, is it possible to replace use of netcat binary with /dev/tcp ?
Comment 8 Johannes Meixner 2008-01-23 12:46:54 UTC
No.

Reason (as far as I know):
bash cannot listen like "netcat -l ..." can.

Details:
bash can read from a remote socket via /dev/tcp but this
means that there must be already a remote process running
to which the bash can connect.
If there is no such remote process, the read will fail
(with something like EOF).
What bash cannot do is to bind to a local socket and
then just wait and listen until a remote process
connects to it.
Comment 9 Michal Zugec 2008-01-28 13:51:18 UTC
fixed in yast2-printer-2.16.7
netcat is not strictly required, only recommended. In case is installed or not, buttons that runs script used netcad are enabled/disabled by this condition
Comment 10 Martin Vidner 2008-02-05 13:31:25 UTC
Comment 6: no, netcat is only recommended (since comment 3).
Comment 11 Martin Vidner 2008-02-07 10:03:12 UTC
But anyway, for yast2-core-2.16.30 I replaced netcat by /dev/tcp.
Comment 12 Johannes Meixner 2012-02-14 11:59:36 UTC
*** Bug 746760 has been marked as a duplicate of this bug. ***