Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2021-05-03 Thread Christoph Martin
I don't see the reported error messages in Stretch and Buster.
I think the issue is resolve.

Am 30.04.21 um 14:36 schrieb Salvatore Bonaccorso:
> 
> This should have been resolved in 4.5.1-1, when we got own init and
> systemd service units, is this correct?
> 



OpenPGP_signature
Description: OpenPGP digital signature


Processed: Re: Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2021-04-30 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + moreinfo
Bug #796882 [src:linux] hyperv-daemons: include debian specific versions of 
hv_get* scripts
Added tag(s) moreinfo.

-- 
796882: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=796882
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2021-04-30 Thread Salvatore Bonaccorso
control: tags -1 + moreinfo

On Tue, Aug 25, 2015 at 02:27:46PM +0200, Christoph Martin wrote:
> Package: hyperv-daemons
> Version: 4.1.4-2~bpo8+1
> Severity: normal
> 
> hv_kvp_daemon gives the following errors:
> 
> hv_kvp_daemon[941]: sh: 1: hv_get_dns_info: not found
> hv_kvp_daemon[941]: sh: 1: hv_get_dhcp_info: not found
> hv_kvp_daemon[941]: sh: 1: hv_get_dns_info: not found
> hv_kvp_daemon[941]: sh: 1: hv_get_dhcp_info: not found
> 
> These scripts are missing from the package. 
> Debian should include there own disto specific versions of this scripts.
> 
> Examples are in the linux-tools source in the directory tools/hv/

This should have been resolved in 4.5.1-1, when we got own init and
systemd service units, is this correct?

Regards,
Salvatore



Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2015-11-28 Thread Hideki Yamane
On Sat, 21 Nov 2015 10:22:03 +
Bastian Blank  wrote:
> >  patch taken from ubuntu package
> 
> Not acceptable.  Stick to one language, not three.  No new Python 2
> stuff.  No networkd support.  PEP8 for the Python part.

 Okay, but Isn't hv_get_dns_info okay for it, at least?


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane



Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2015-11-21 Thread Bastian Blank
On Sat, Nov 21, 2015 at 02:20:53PM +0900, Hideki Yamane wrote:
>  patch taken from ubuntu package

Not acceptable.  Stick to one language, not three.  No new Python 2
stuff.  No networkd support.  PEP8 for the Python part.

> +# Output: The script prints the string "Enabled" to stdout to indicate
> +#that DHCP is enabled on the interface. If DHCP is not enabled,
> +#the script prints the string "Disabled" to stdout.

This needs to be tristate output.

Regards,
Bastian

-- 
Sometimes a feeling is all we humans have to go on.
-- Kirk, "A Taste of Armageddon", stardate 3193.9



Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2015-11-20 Thread Hideki Yamane
control: tags -1 +patch

Hi,

On Tue, 25 Aug 2015 14:27:46 +0200 Christoph Martin  wrote:
> hv_kvp_daemon[941]: sh: 1: hv_get_dns_info: not found
> hv_kvp_daemon[941]: sh: 1: hv_get_dhcp_info: not found
> hv_kvp_daemon[941]: sh: 1: hv_get_dns_info: not found
> hv_kvp_daemon[941]: sh: 1: hv_get_dhcp_info: not found
> 
> These scripts are missing from the package. 
> Debian should include there own disto specific versions of this scripts.
> 
> Examples are in the linux-tools source in the directory tools/hv/

 patch taken from ubuntu package


-- 
Hideki Yamane 
diff -urN linux-tools-4.3~rc5/debian/hv_get_dhcp_info linux-tools-4.3~rc5.update/debian/hv_get_dhcp_info
--- linux-tools-4.3~rc5/debian/hv_get_dhcp_info	1970-01-01 09:00:00.0 +0900
+++ linux-tools-4.3~rc5.update/debian/hv_get_dhcp_info	2015-11-21 14:05:21.025229857 +0900
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# This example script retrieves the DHCP state of a given interface.
+# In the interest of keeping the KVP daemon code free of distro specific
+# information; the kvp daemon code invokes this external script to gather
+# DHCP setting for the specific interface.
+#
+# Input: Name of the interface
+#
+# Output: The script prints the string "Enabled" to stdout to indicate
+#	that DHCP is enabled on the interface. If DHCP is not enabled,
+#	the script prints the string "Disabled" to stdout.
+
+IF_FILE="/etc/network/interfaces"
+NMCMD="nmcli"
+
+function checknetworkmanager {
+# Assumes if $NMCMD exists, inteface exists and interface is not
+# in $IF_FILE then dhcp is being used by NM
+if $NMCMD dev status 2>/dev/null | grep -q $1; then
+echo "Enabled"
+else
+echo "Disabled"
+fi
+}
+
+if [ -z $1 ]; then
+echo "Disabled"; exit
+fi
+
+ 
+if grep -v -e "^#" $IF_FILE 2>/dev/null | grep -q $1 ; then
+#interface exists so
+if grep -q -e $1\.\*dhcp $IF_FILE; then 
+ echo "Enabled"
+else
+ echo "Disabled"
+fi
+else
+checknetworkmanager $1
+fi
diff -urN linux-tools-4.3~rc5/debian/hv_get_dns_info linux-tools-4.3~rc5.update/debian/hv_get_dns_info
--- linux-tools-4.3~rc5/debian/hv_get_dns_info	1970-01-01 09:00:00.0 +0900
+++ linux-tools-4.3~rc5.update/debian/hv_get_dns_info	2015-11-21 14:05:21.025229857 +0900
@@ -0,0 +1,2 @@
+#!/bin/sh
+awk '/^nameserver/ { print $2 }' /etc/resolv.conf 2>/dev/null
diff -urN linux-tools-4.3~rc5/debian/hv_set_ifconfig linux-tools-4.3~rc5.update/debian/hv_set_ifconfig
--- linux-tools-4.3~rc5/debian/hv_set_ifconfig	1970-01-01 09:00:00.0 +0900
+++ linux-tools-4.3~rc5.update/debian/hv_set_ifconfig	2015-11-21 14:05:21.025229857 +0900
@@ -0,0 +1,242 @@
+#! /usr/bin/env python
+
+# set interfaces in hv_kvp_daemon style
+import fileinput
+import sys
+import errno
+import os
+import shutil
+import tempfile
+import subprocess
+
+if_filename="/etc/network/interfaces"
+
+'''Get quiet'''
+sys.stdout = open(os.devnull, 'w')
+sys.stderr = open(os.devnull, 'w')
+
+try:
+	if_file=open(if_filename,"r+")
+except IOError as e:
+	exit(e.errno)
+else:
+	if_file.close()
+
+
+def kvp_dict(file):
+	return dict(line.strip().split("=") for line in file)
+
+
+#setting the hwaddress to something azure is not expecting is fatal networking 
+
+if len(sys.argv) != 2 :
+	exit(errno.EINVAL)
+
+kvp=dict(line.strip().split("=") for line in fileinput.input())
+
+if not "HWADDR" in kvp :
+	exit(errno.EPROTO)
+
+if not "DEVICE" in kvp :
+	exit(1)
+
+output=[]
+basename=kvp["DEVICE"]
+
+if "DHCP" in kvp and kvp["DHCP"]=="yes" :
+	output += ["auto " + basename]
+	output += ["iface " + basename  + " inet dhcp"]
+	output += [""]
+else:
+	''' Matchup the interface specific lines '''
+
+	'''DNS entries will go with the first interface
+	and there can be a max of three'''
+	autolist=[]
+	dns=[]
+	if "DNS1" in kvp :
+		dns+=[kvp["DNS1"]]
+		if "DNS2" in kvp :
+			dns+=[kvp["DNS2"]]
+			if "DNS3" in kvp :
+dns+=[kvp["DNS3"]]
+
+
+	'''
+	No real max for the number of interface + aliases ... 
+	only required is the address (but mate everything up that comes in. '''
+
+	'''ipv4 first'''
+
+	v4names=[name for name in kvp.keys() if name.startswith("IPADDR")]
+	v4names.sort()
+
+	v6names=[name for name in kvp.keys() if name.startswith("IPV6ADDR")]
+	v6names.sort()
+
+	'''IPV6 requires a netmask'''
+	'''If an ipv6 exists, you'll want to turn off /proc/sys/net/ipv6/conf/all/autoconf with
+	up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf'''
+
+	'''Counter needs to increment as soon as any interface is set.'''
+
+
+	if_count=0
+
+	for v4 in v4names:
+		ifname=basename
+		suffix=""
+		if if_count :
+			ifname+=":" + str(if_count)
+			suffix="_"+str(if_count)
+		if not ifname in autolist:
+			autolist += [ifname]
+		output += [ "iface " + ifname + " inet static"]
+		output += [ "\t" + "address " + kvp[v4]]
+		if "NETMASK"+suffix in kvp.keys():
+			output += ["\tnetmask " + kvp["NETMASK"+suffix]]
+		if "GATEWAY"+suffix in kvp.keys():
+			output += 

Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2015-08-25 Thread Bastian Blank
On Tue, Aug 25, 2015 at 02:27:46PM +0200, Christoph Martin wrote:
 These scripts are missing from the package. 

Much worse, it uses popen() and therefor sh -c to execute this scripts,
while being a security sensitive service.

Bastian

-- 
It is necessary to have purpose.
-- Alice #1, I, Mudd, stardate 4513.3



Bug#796882: hyperv-daemons: include debian specific versions of hv_get* scripts

2015-08-25 Thread Christoph Martin
Package: hyperv-daemons
Version: 4.1.4-2~bpo8+1
Severity: normal

hv_kvp_daemon gives the following errors:

hv_kvp_daemon[941]: sh: 1: hv_get_dns_info: not found
hv_kvp_daemon[941]: sh: 1: hv_get_dhcp_info: not found
hv_kvp_daemon[941]: sh: 1: hv_get_dns_info: not found
hv_kvp_daemon[941]: sh: 1: hv_get_dhcp_info: not found

These scripts are missing from the package. 
Debian should include there own disto specific versions of this scripts.

Examples are in the linux-tools source in the directory tools/hv/

Yours
Christoph

-- System Information:
Debian Release: 8.1
  APT prefers stable-updates
  APT policy: (700, 'stable-updates'), (700, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages hyperv-daemons depends on:
ii  init-system-helpers  1.22
ii  libc62.19-18

hyperv-daemons recommends no packages.

hyperv-daemons suggests no packages.

-- no debconf information