OpenWrt Forum Archive

Topic: uhttpd not setting up CGI variables under barrier-breaker rc3?

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all.

I have a CGI program written in C which is loaded by uhttpd. All seems to work fine except that
when it is invoked getenv("REQUEST_METHOD") seg faults. It appears that the CGI variables are
not being set up.

The code worked fine under AA and recent trunk. I have the following packages selected (there
are others of course but these seem the most likely to be relevent)

uhttpd
uhttpd-mod-tls
uhttpd-mod-ubus

luci-ssl

Before I submit a ticket does anyone have any suggestions as to what I could try next?
Has anyone else noticed similar problems? I've spent nearly a week on this so far.

I should add that I'm working on the TP-LINK WR1043ND V2 and the problem manifests on both
BB RC2 and RC3

Rick

(Last edited by rcp100 on 19 Aug 2014, 15:28)

Can you attach the relevant parts of your code here? There have been no recent changes to uhttpd that would explain your described issues.

I also have my own C-cgi-program with the line:
  reqm=getenv("REQUEST_METHOD");

I have no problem.
- TP-Link WDR4900
- BB RC2 (and uhttpd)
- Toolchain from BB RC2
- powerpc-openwrt-linux-uclibcspe-gcc -O2 cgi-program.c

I have uhttpd and uhttpd-mod-ubus installed, but not uhttpd-mod-tls and luci-ssl.

Hi all,

Thank you for your input. I've now managed to resolve this problem. It turns out it had nothing
whatsoever to do with cgi variables (*blush*) but rather the absence of the ip command. I now
have things working as expected - a big relief.

Anyone know how to install the ip command? Haven't managed to find any reference to iproute2
or another package that contains ip yet.

Apologies for wasting bandwidth

Regards

Rick

In reply to my own query about the ip command/iproute2:

    make menuconfig -> network/Routing and direction -> ip

and/or

    make menuconfig -> network/Routing and direction -> ip-full

Rick

(Last edited by rcp100 on 20 Aug 2014, 18:12)

The discussion might have continued from here.