[cgiapp] CGI now fails with /bin/sh: 0: Illegal option -p after upgrade to ubuntu precise (/bin/sh-->/bin/dash)

Mark Stosberg mark at summersault.com
Tue Oct 30 16:43:24 EDT 2012


> euclid: lib/cgi-bin % setenv DEBUG 1
> euclid: lib/cgi-bin % ./sascgi 'SASFILE=getlist1.sas&LISTS=1&ITEMS=20'
>
> I understand why this error occurs, but not how to fix it, at either the
> perl or OS level.
> WHY:  It seems that in my current ubuntu precise release, /bin/sh
> has been replaced by /bin/dash, and the latter does not support the
> -p option of the former /bin/sh,
> 
> 
>   -p privileged
> Turn on privileged mode.  This mode is enabled on startup if
> either the effective user or group ID is not equal to the real
> user or group ID. Turning this mode off sets the effective user
> and group IDs to the real user and group IDs.  When this mode is
> enabled for interactive shells, the file /etc/suid_profile is
> sourced instead of ~/.profile after /etc/profile is sourced, and
> the contents of the ENV variable are ignored.
> 
> At the perl level, I can't see why or where this -p option is set
> in system calls running under CGI.

What happens you explicitly run the Perl script via bash instead of dash?

 bash -c "perl./sascgi 'SASFILE=getlist1.sas&LISTS=1&ITEMS=20'"

   Mark



More information about the cgiapp mailing list