Re: [OpenWrt-Devel] [PATCH] openl2tp - finally enable config file option

2011-11-04 Thread Nico
On Sat, Nov 5, 2011 at 12:40 AM, Nico  wrote:

> I'm not sure what plugins are needed for each and what a sample
> configuration would look like, feel free to submit more patches :)

I found some sample configuration files [1] from gentoo, if someone
want to start working on it...

1. 
http://git.overlays.gentoo.org/gitweb/?p=user/bircoph.git;a=tree;f=net-dialup/openl2tp/files/examples

--
-{Nico}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add tinc init file and add conffiles - CORRECTION: Change boot order

2011-11-04 Thread Manuel Munz
Plase use this patch instead of the last one. It uses 47 instead of 62
for the start order in the init script, this makes sure tinc is up
before other services need the interfaces tinc creates.

Signed-off-by: Manuel Munz 



Index: net/tinc/files/tinc.init
===
--- net/tinc/files/tinc.init	(Revision 0)
+++ net/tinc/files/tinc.init	(Revision 0)
@@ -0,0 +1,60 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=47
+
+DAEMON="/usr/sbin/tincd"
+NAME="tinc"
+DESC="tinc daemons"
+TCONF="/etc/tinc"
+NETSFILE="$TCONF/nets.boot"
+NETS=""
+
+find_nets () {
+	if [ ! -f $NETSFILE ] ; then
+		echo "**tinc: file with list of VPNs to start ($NETSFILE) not found!"
+		exit 0
+	fi
+	NETS="`grep -v '^#' $NETSFILE`"
+}
+
+start () {
+	find_nets
+	echo -n "Starting $DESC:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA
+	done
+	echo "."
+}
+
+stop() {
+	find_nets
+	echo -n "Stopping $DESC:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA -k
+	done
+	echo "."
+}
+
+restart () {
+	find_nets
+	echo -n "Restarting $DESC:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA -k
+		sleep 1
+		$DAEMON -n $n $EXTRA
+	done
+	echo "."
+}
+
+reload () {
+	find_nets
+	echo -n "Reloading $DESC configuration:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA -kHUP
+	done
+	echo "."
+}
Index: net/tinc/files/etc/tinc/nets.boot
===
--- net/tinc/files/etc/tinc/nets.boot	(Revision 0)
+++ net/tinc/files/etc/tinc/nets.boot	(Revision 0)
@@ -0,0 +1 @@
+## This file contains all names of the networks to be started on system startup.
Index: net/tinc/Makefile
===
--- net/tinc/Makefile	(Revision 28753)
+++ net/tinc/Makefile	(Arbeitskopie)
@@ -30,6 +30,28 @@
   SUBMENU:=VPN
 endef
 
+define Package/tinc/conffiles
+/etc/tinc
+endef
+
+define Package/tinc/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+	echo "Enabling rc.d symlink for tinc"
+	/etc/init.d/tinc enable
+fi
+exit 0
+endef
+
+define Package/tinc/prerm
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+	echo "Removing rc.d symlink for tinc"
+	/etc/init.d/tinc disable
+fi
+exit 0
+endef
+
 define Package/tinc/description
   tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and
   encryption to create a secure private network between hosts on the Internet.
@@ -45,6 +67,10 @@
 define Package/tinc/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tincd $(1)/usr/sbin/
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/tinc.init $(1)/etc/init.d/tinc
+	$(INSTALL_DIR) $(1)/etc/tinc
+	$(INSTALL_DATA) ./files/etc/tinc/nets.boot $(1)/etc/tinc/nets.boot
 endef
 
 $(eval $(call BuildPackage,tinc))


signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Add tinc init file and add conffiles

2011-11-04 Thread Manuel Munz
This adds an init file for tinc. It is mostly based on
http://wiki.freifunk.net/Tinc#Startscript_Kamikaze, i just changed how
the nets from nets.boot are parsed and removed loading of the tun module.

It also adds /etc/tinc to the list of config files which should be
preserved when upgrading with sysupgrade.

Please consider adding these changes to backfire, too.

Regards, Manuel

Signed-off-by: Manuel Munz 
Index: net/tinc/files/tinc.init
===
--- net/tinc/files/tinc.init	(Revision 0)
+++ net/tinc/files/tinc.init	(Revision 0)
@@ -0,0 +1,60 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=62
+
+DAEMON="/usr/sbin/tincd"
+NAME="tinc"
+DESC="tinc daemons"
+TCONF="/etc/tinc"
+NETSFILE="$TCONF/nets.boot"
+NETS=""
+
+find_nets () {
+	if [ ! -f $NETSFILE ] ; then
+		echo "**tinc: file with list of VPNs to start ($NETSFILE) not found!"
+		exit 0
+	fi
+	NETS="`grep -v '^#' $NETSFILE`"
+}
+
+start () {
+	find_nets
+	echo -n "Starting $DESC:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA
+	done
+	echo "."
+}
+
+stop() {
+	find_nets
+	echo -n "Stopping $DESC:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA -k
+	done
+	echo "."
+}
+
+restart () {
+	find_nets
+	echo -n "Restarting $DESC:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA -k
+		sleep 1
+		$DAEMON -n $n $EXTRA
+	done
+	echo "."
+}
+
+reload () {
+	find_nets
+	echo -n "Reloading $DESC configuration:"
+	for n in $NETS ; do
+		echo -n " $n"
+		$DAEMON -n $n $EXTRA -kHUP
+	done
+	echo "."
+}
Index: net/tinc/files/etc/tinc/nets.boot
===
--- net/tinc/files/etc/tinc/nets.boot	(Revision 0)
+++ net/tinc/files/etc/tinc/nets.boot	(Revision 0)
@@ -0,0 +1 @@
+## This file contains all names of the networks to be started on system startup.
Index: net/tinc/Makefile
===
--- net/tinc/Makefile	(Revision 28753)
+++ net/tinc/Makefile	(Arbeitskopie)
@@ -30,6 +30,28 @@
   SUBMENU:=VPN
 endef
 
+define Package/tinc/conffiles
+/etc/tinc
+endef
+
+define Package/tinc/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+	echo "Enabling rc.d symlink for tinc"
+	/etc/init.d/tinc enable
+fi
+exit 0
+endef
+
+define Package/tinc/prerm
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+	echo "Removing rc.d symlink for tinc"
+	/etc/init.d/tinc disable
+fi
+exit 0
+endef
+
 define Package/tinc/description
   tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and
   encryption to create a secure private network between hosts on the Internet.
@@ -45,6 +67,10 @@
 define Package/tinc/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tincd $(1)/usr/sbin/
+	$(INSTALL_DIR) $(1)/etc/init.d
+	$(INSTALL_BIN) ./files/tinc.init $(1)/etc/init.d/tinc
+	$(INSTALL_DIR) $(1)/etc/tinc
+	$(INSTALL_DATA) ./files/etc/tinc/nets.boot $(1)/etc/tinc/nets.boot
 endef
 
 $(eval $(call BuildPackage,tinc))


signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] openl2tp - finally enable config file option

2011-11-04 Thread Nico
On Mon, Oct 17, 2011 at 7:34 PM, Bogdan Roman  wrote:
> Until now the openl2tpg package only allowed configuration through RPC by
> using the l2tpconfig command, making many some tasks difficult. Discussion
> exists at https://dev.openwrt.org/ticket/10164 . Enabling the config file
> option requires working around the flex library ( (libfl) and a few compile
> fixes. The following 2 patches enable the config file option in addition to
> the RPC option. Tested against trunk r28428. Note that the openwrt openl2tp
> package is still not fully finished, e.g. a proper init.d script and sample
> conf files should be included, see build_dir/*/openl2tp-1.8/{etc,ipsec}/*. I
> may sort that out as well later.
>
> Signed-off-by: Bogdan Roman 

Applied in r28758. As suggested by Eric, the package was also split in
2 variants:
 - mini: only configuration file support
 - full: configuration file and RPC support

I'm not sure what plugins are needed for each and what a sample
configuration would look like, feel free to submit more patches :)

Thanks,
--
-{Nico}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: Sparklan wcr-150gn board fixes

2011-11-04 Thread Roman Yeryomin
Fix partition sizes.
Add buttons and leds.
Register usb.
Remove unnecessary stuff from Makefile (hope it will not be mangled by gmail).
Fix eeprom extract.

Signed-off-by: Roman Yeryomin 

Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wcr150gn.c
===
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wcr150gn.c
(revision 28717)
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wcr150gn.c
(working copy)
@@ -22,6 +22,44 @@

 #include "devices.h"

+#define WCR150GN_GPIO_LED_USER 12
+#define WCR150GN_GPIO_LED_POWER8
+#define WCR150GN_GPIO_BUTTON_WPS   10
+#define WCR150GN_GPIO_BUTTON_RESET 0
+#define WCR150GN_BUTTONS_POLL_INTERVAL 20
+
+static struct gpio_led wcr150gn_leds_gpio[] __initdata = {
+{
+   .name   = "wcr150gn:amber:user",
+   .gpio   = WCR150GN_GPIO_LED_USER,
+   .active_low = 1,
+},
+{
+   .name   = "wcr150gn:amber:power",
+   .gpio   = WCR150GN_GPIO_LED_POWER,
+   .active_low = 1,
+}
+};
+
+static struct gpio_button wcr150gn_gpio_buttons[] __initdata = {
+{
+.desc   = "wps",
+.type   = EV_KEY,
+.code   = KEY_WPS_BUTTON,
+.threshold  = 3,
+.gpio   = WCR150GN_GPIO_BUTTON_WPS,
+.active_low = 1,
+},
+{
+.desc   = "reset",
+.type   = EV_KEY,
+.code   = KEY_RESTART,
+.threshold  = 10,
+.gpio   = WCR150GN_GPIO_BUTTON_RESET,
+.active_low = 1,
+}
+};
+
 #ifdef CONFIG_MTD_PARTITIONS
 static struct mtd_partition wcr150gn_partitions[] = {
{
@@ -33,18 +71,24 @@
.name   = "config",
.offset = 0x03,
.size   = 0x04,
+   .mask_flags = MTD_WRITEABLE,
}, {
.name   = "factory",
.offset = 0x04,
.size   = 0x05,
+   .mask_flags = MTD_WRITEABLE,
}, {
.name   = "kernel",
.offset = 0x05,
-   .size   = 0x12,
+   .size   = 0x0d,
}, {
.name   = "rootfs",
.offset = 0x12,
-   .size   = 0x40,
+   .size   = 0x2e,
+   }, {
+   .name   = "firmware",
+   .offset = 0x05,
+   .size   = 0x3b,
}
 };
 #endif /* CONFIG_MTD_PARTITIONS */
@@ -60,10 +104,16 @@
 {
rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
rt305x_register_flash(0, &wcr150gn_flash_data);
+   ramips_register_gpio_leds(-1, ARRAY_SIZE(wcr150gn_leds_gpio),
+   wcr150gn_leds_gpio);
+   ramips_register_gpio_buttons(-1, WCR150GN_BUTTONS_POLL_INTERVAL,
+   ARRAY_SIZE(wcr150gn_gpio_buttons),
+   wcr150gn_gpio_buttons);
rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_W;
rt305x_register_ethernet();
rt305x_register_wifi();
rt305x_register_wdt();
+   rt305x_register_usb();
 }

 MIPS_MACHINE(RAMIPS_MACH_WCR150GN, "WCR150GN", "Sparklan WCR-150GN",
Index: target/linux/ramips/image/Makefile
===
--- a/target/linux/ramips/image/Makefile(revision 28717)
+++ b/target/linux/ramips/image/Makefile(working copy)
@@ -202,15 +202,8 @@
$(call Image/Build/Template/GENERIC_8M,$(1),mofi3500-3gn,MOFI3500-3GN)
 endef

-mtdlayout_wcr150gn=mtdparts=physmap-flash.0:192k(bootloader)ro,64k(config),64k(factory),832k(kernel),2944k(rootfs),3776k@0x5(firmware)
-mtd_wcr150gn_kernel_part_size=851968
-mtd_wcr150gn_rootfs_part_size=3014656
-define Image/Build/Template/WCR150GN
-   $(call 
BuildFirmware/Generic,$(1),$(2),board=$(3),mtdlayout_wcr150gn,$(mtd_wcr150gn_kernel_part_size),$(mtd_wcr150gn_rootfs_part_size))
-endef
-
 define Image/Build/Profile/WCR150GN
-   $(call Image/Build/Template/WCR150GN,$(1),wcr150gn,WCR150GN)
+   $(call Image/Build/Template/GENERIC_4M,$(1),wcr150gn,WCR150GN)
 endef


Index: target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
===
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
   (revision 28717)
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
   (working copy)
@@ -55,7 +55,7 @@
nw718 | \
rt-n15 | \
v22rw-2x2 | \
-   wcr150gn | \
+   wcr-150gn | \
whr-g300n | \
wr512-3gn)
rt2x00_eeprom_extract "

Re: [OpenWrt-Devel] [PATCH] upgrade baresip, restund, libre, librem to version 0.3.0

2011-11-04 Thread Nico
On Mon, Oct 31, 2011 at 10:01 PM, Alfred E. Heggestad  wrote:
> Hi,
>
>
> (Resend, updated patch)
>
>
> this patch upgrades the following packages to v0.3.0:
>
>  baresip v0.3.0 (Portable and modular SIP User-Agent with audio and video
> support)
>  restund v0.3.0 (Modular STUN/TURN server)
>  libre   v0.3.0 (Generic library for real-time communications with async IO
> support)
>  librem  v0.3.0 (Audio and video processing media library)
>
> detailed changes can be found in /docs/ChangeLog
> (See http://www.creytiv.com/)
>
>
> I have also removed the @BROKEN symbol, as all packages build fine here with
> trunk r28297 for at least BRCM, AR7, x86 and UML architectures. I read on
> the forum
> that there was some problems building the programs but I did not find any
> reports
> on which architectures were failing or any build logs. would it be possible
> to
> get notified somehow if such a thing happens ?
>
>
> Thanks to Jonas Gorski and Jo-Philipp Wich for valuable feedback on the
> first patch
>
>
> Please review and apply if OK.
>
>
> Signed-Off-By: Alfred E. Heggestad

Applied in r28754-r28757 with the following modifications :

 - add patches to avoid looking for host files in /usr/include,
/usr/local, etc...
 - make baresip & restund modular by packaging plugins
 - use start-stop-daemon in baresip & restund initscripts

Thanks,
--
-{Nico}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] udhcpc: fix default script when netmask is 255.255.255.255

2011-11-04 Thread Macpaul Lin
In some 4G network (LTE/WiMAX), the dhcp server
will assign the netmask between the gateway to
the client as "255.255.255.255".
This patch fix the default script which cannot handle
this situation which lead the default route could
not be established because lack the routing entry of
4G NIC.

Signed-off-by: Macpaul Lin 
---
 .../files/usr/share/udhcpc/default.script  |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/package/base-files-network/files/usr/share/udhcpc/default.script 
b/package/base-files-network/files/usr/share/udhcpc/default.script
index 8dbff47..b6ae4ec 100755
--- a/package/base-files-network/files/usr/share/udhcpc/default.script
+++ b/package/base-files-network/files/usr/share/udhcpc/default.script
@@ -48,6 +48,11 @@ setup_interface () {
change_state network "$ifc" ipaddr "$ip"
change_state network "$ifc" broadcast "${broadcast:-+}"
change_state network "$ifc" netmask "${subnet:-255.255.255.0}"
+
+   [ -n "router" ] && [ "${subnet-255.255.255.0}" = 
"255.255.255.255" ] && {
+   echo "udhcpc: setting direct route of $interface"
+   route add -net $router netmask ${subnet:-255.255.255.0} 
dev $interface
+   }
}
 
 
-- 
1.7.5.4

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] udhcpc problem when the interface is in a network with netmask as 255.255.255.255

2011-11-04 Thread 馬克泡
Hi all,

2011/11/4 馬克泡 :
> Hi all,
>
> I've found that when using ifconfig to set the netmask of NIC as
> 255.255.255.255
> won't create an entry in routing table.
> That's why configure the default gateway will fail.

I've fix this by modifying the /usr/share/udhcpc/default.script
The modification makes the system set a route with netmask "255.255.255.255"
with the interface if udhcpc get the value of netmask as
255.255.255.255 from dhcp server.

Will send a patch do default.script later.

-- 
Best regards,
Macpaul Lin
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] udhcpc problem when the interface is in a network with netmask as 255.255.255.255

2011-11-04 Thread 馬克泡
Hi all,

I've found that when using ifconfig to set the netmask of NIC as
255.255.255.255
won't create an entry in routing table.
That's why configure the default gateway will fail.

I don't remembered set the nemask as 255.255.255.255 to a NIC with ifconfig
won't create an entry in routing table. At least 3G networks works very well.
The dhclient won't have a problem on this situation.
Should we fix the udcpc/default.script to cover this kinde of situation?

The following log is the debug dump of udhcpc/default.script on ubuntu 11.11.

/home/macpaul/vmax# udhcpc -i wimax0 -q
udhcpc (v1.18.4) started
Sending discover...
Sending select for 111.67.56.236...
Lease of 111.67.56.236 obtained, lease time 3600
/sbin/ifconfig wimax0 111.67.56.236  netmask 255.255.255.255
/usr/share/udhcpc/default.script: Resetting default routes
while /sbin/route del default gw 0.0.0.0 dev wimax0; do :; done
SIOCDELRT: no such process
/sbin/route add default gw 111.67.48.1 dev wimax0 metric 0
SIOCADDRT: no such process
/usr/share/udhcpc/default.script: Adding DNS 111.67.54.11
/usr/share/udhcpc/default.script: Adding DNS 111.67.54.12

I'll post the log of udhcpc in busybox on openwrt later.

-- 
Best regards,
Macpaul Lin
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] packages freeradius2 fix some dependencies

2011-11-04 Thread Nico
On Fri, Nov 4, 2011 at 8:11 AM, lynxis  wrote:
> freeradius2: fix some dependencies
>
> Signed-off-by: Alexander Couzens 

Applied (with minor modifications) in r28752.

Thanks,
--
-{Nico}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Create PID file for xinetd

2011-11-04 Thread Nico
2011/11/3 Stefan Agner :
> Create a pid file by default when starting xinetd (resolves #10342).
>
> Signed-off-by: Stefan Agner 

Applied in r28748.

Thanks,
--
-{Nico}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] hostapd 2.0-devel oom issue?

2011-11-04 Thread Daniel Petre

hello,
i bugged this issue on irc too,
so, i updated my dlink 825 at the trunk version before the hostapd 
update,

it has: hostapd v0.8.x
and i updated today my wr1043n to the latest trunk and it has: hostapd 
v2.0-devel


the problem i noticed this morning while being connected via wireless 
to the tp-link 1043n
as soon as i scp, lets say, the factory firmware to /tmp its stalls 
until its crashing the router,

resetting it.

it doesnt always crash, sometimes seem to oom and spit stuff like this 
in dmesg:


http://pastebin.com/FYgX16Dk

could it be some hostapd issue ?

thanks!

--
Daniel Petre,
System Administrator
RCS & RDS, Pitesti
Tel: 0348400426
Mobil: 0770048708
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] (resent) allow racoon user authentication from file

2011-11-04 Thread Markus Stockhausen

Hello,

As I just discovered I did not sent a svn diff the first time. Attached you 
will find the
corrected patch version.

Default racoon xauth user authentication is only allowed through /etc/passwd or
external communication (ldap, radius). To enable a local UCI driven 
user/password
database I wrote a patch that will read them from the startscript-generated file
/var/racoon/xauthuser.txt. But only if it exists. Otherwise authentication 
falls back
to standard beaviour.

Signed-off-by: Markus Stockhausen < markus /dot/ stockhausen /at/ collogia /dot/ 
de >

Index: net/ipsec-tools/patches/006-xauth_user_file.patch
===
--- net/ipsec-tools/patches/006-xauth_user_file.patch   (revision 0)
+++ net/ipsec-tools/patches/006-xauth_user_file.patch   (revision 0)
@@ -0,0 +1,42 @@
+--- a/src/racoon/isakmp_xauth.c
 b/src/racoon/isakmp_xauth.c
+@@ -1261,6 +1261,39 @@ xauth_login_system(usr, pwd)
+   char *usr;
+   char *pwd;
+  {
++  /* OpenWrt fix: if possible check user from password file */
++  FILE *fp;
++  char line[256];
++  char *linecut;
++  char filename[80];
++  int found;
++  char *fusr;
++  char *fpwd;
++
++  strcpy(filename,"/var/racoon/xauthuser.txt");
++  if ((fp = fopen(filename, "r")) != NULL) {
++  plog(LLV_INFO, LOCATION, NULL,
++  "verifying user from %s\n",filename);
++
++  found = -1;
++  while ( fgets(line, 255, fp) != NULL && found == -1) {
++  if (line[0] != '#') {
++  linecut  = strtok(line,"#\n");
++  fusr = strtok(linecut," \t");
++  fpwd = strtok(NULL," \t");
++
++  if ( fusr && fpwd
++  && strcmp(fusr,"")!=0 && strcmp(fpwd,"")!=0
++  && strcmp(fusr,usr)==0 && strcmp(fpwd,pwd)==0)
++  found = 0;
++  }
++  }
++  fclose(fp);
++
++  return found;
++  }
++  /* OpenWrt fix */
++
+   struct passwd *pw;
+   char *cryptpwd;
+   char *syscryptpwd;
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

Über das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

executive board:
Kadir Akin
Dr. Michael Höhnerbach

President of the supervisory board:
Hans Kristian Langva

Registry office: district court Cologne
Register number: HRB 52 497


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] dsniff: add patch to fix decoding of POP data

2011-11-04 Thread Stefan Tomanek
Signed-off-by: Stefan Tomanek 
---
 net/dsniff/patches/001-decode_pop.patch |  122 +++
 1 files changed, 122 insertions(+), 0 deletions(-)
 create mode 100644 net/dsniff/patches/001-decode_pop.patch

diff --git a/net/dsniff/patches/001-decode_pop.patch 
b/net/dsniff/patches/001-decode_pop.patch
new file mode 100644
index 000..24e1a47
--- /dev/null
+++ b/net/dsniff/patches/001-decode_pop.patch
@@ -0,0 +1,122 @@
+diff --git a/decode_pop.c b/decode_pop.c
+index 04044f5..767da41 100644
+--- a/decode_pop.c
 b/decode_pop.c
+@@ -6,6 +6,8 @@
+  * Copyright (c) 2000 Dug Song 
+  *
+  * $Id: decode_pop.c,v 1.4 2001/03/15 08:33:02 dugsong Exp $
++ *
++ * Rewritten by Stefan Tomanek 2011 
+  */
+ 
+ #include "config.h"
+@@ -45,32 +47,88 @@ int
+ decode_pop(u_char *buf, int len, u_char *obuf, int olen)
+ {
+   char *p;
++  char *s;
++  int n;
+   int i, j;
++  char *user;
++  char *password;
++  enum {
++  NONE,
++  AUTHPLAIN,
++  AUTHLOGIN,
++  USERPASS
++  } mode = NONE;
++
+   
+   obuf[0] = '\0';
+   
+   for (p = strtok(buf, "\r\n"); p != NULL; p = strtok(NULL, "\r\n")) {
+-  if (strncasecmp(p, "AUTH PLAIN", 10) == 0 ||
+-  strncasecmp(p, "AUTH LOGIN", 10) == 0) {
+-  strlcat(obuf, p, olen);
+-  strlcat(obuf, "\n", olen);
+-  
+-  /* Decode SASL auth. */
+-  for (i = 0; i < 2 && (p = strtok(NULL, "\r\n")); i++) {
+-  strlcat(obuf, p, olen);
+-  j = base64_pton(p, p, strlen(p));
+-  p[j] = '\0';
+-  strlcat(obuf, " [", olen);
+-  strlcat(obuf, p, olen);
+-  strlcat(obuf, "]\n", olen);
++  if (mode == NONE) {
++  user = NULL;
++  password = NULL;
++  if (strncasecmp(p, "AUTH PLAIN", 10) == 0) {
++  mode = AUTHPLAIN;
++  continue;
++  }
++  if (strncasecmp(p, "AUTH LOGIN", 10) == 0) {
++  mode = AUTHLOGIN;
++  continue;
++  }
++  if (strncasecmp(p, "USER ", 5) == 0) {
++  mode = USERPASS;
++  /* the traditional login cuts right to the case,
++   * so no continue here
++   */
+   }
+   }
+-  /* Save regular POP2, POP3 auth info. */
+-  else if (strncasecmp(p, "USER ", 5) == 0 ||
+-   strncasecmp(p, "PASS ", 5) == 0 ||
+-   strncasecmp(p, "HELO ", 5) == 0) {
+-  strlcat(obuf, p, olen);
+-  strlcat(obuf, "\n", olen);
++  printf("(%d) %s\n", mode, p);
++  if (mode == USERPASS) {
++  if (strncasecmp(p, "USER ", 5) == 0) {
++  user = &p[5];
++  } else if (strncasecmp(p, "PASS ", 5) == 0) {
++  password = &p[5];
++  }
++  }
++
++  if (mode == AUTHPLAIN) {
++  j = base64_pton(p, p, strlen(p));
++  p[j] = '\0';
++  n = 0;
++  s = p;
++  /* p consists of three parts, divided by \0 */
++  while (s <= &p[j] && n<=3) {
++  if (n == 0) {
++  /* we do not process this portion yet */
++  } else if (n == 1) {
++  user = s;
++  } else if (n == 2) {
++  password = s;
++  }
++  n++;
++  while (*s) s++;
++  s++;
++  }
++  }
++
++  if (mode == AUTHLOGIN) {
++  j = base64_pton(p, p, strlen(p));
++  p[j] = '\0';
++  if (! user) {
++  user = p;
++  } else {
++  password = p;
++  /* got everything we need :-) */
++  }
++  }
++
++  if (user && password) {
++  strlcat(obuf, "\nusername [", olen);
++  strlcat(obuf, user, olen);
++  strlcat(obuf, "] password [", olen);
++  strlcat(obuf, password, olen);
++ 

[OpenWrt-Devel] [PATCH] packages freeradius2 fix some dependencies

2011-11-04 Thread lynxis
freeradius2: fix some dependencies 

Signed-off-by: Alexander Couzens  

Index: net/freeradius2/Makefile
===
--- net/freeradius2/Makefile(revision 28717)
+++ net/freeradius2/Makefile(working copy)
@@ -89,7 +89,7 @@
 
 define Package/freeradius2-mod-eap-mschapv2
   $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2-mod-eap
+  DEPENDS:=freeradius2-mod-eap +freeradius2-mod-mschap
   TITLE:=EAP/MS-CHAPv2 module
 endef
 
@@ -200,7 +200,7 @@
 
 define Package/freeradius2-mod-ldap
   $(call Package/freeradius2/Default)
-  DEPENDS:=freeradius2 +CONFIG_PACKAGE_freeradius2-mod-ldap:libopenldap
+  DEPENDS:=freeradius2 +libopenldap
   TITLE:=LDAP module
 endef
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel