* Add <ident-info> to the unique identifying information for
* this fcgi program. May be repeated; order is significant.
*
+ * -E<ident-info-env-var>
+ * Look <ident-info-env-var> up in the environment and add
+ * <ident-info-env-var>=<value> as if specified with -G. If
+ * the variable is unset in the environment, it is as if
+ * -G<ident-info-env-var> was specified.
+ *
* -g<ident>
* Use <ident> rather than hex(sha256(<interp>\0<script>\0))
* as the basename of the leafname of the fcgi rendezvous
sha256_update(&identsc,strlen(string)+1,string);
}
+static void off_ident_addenv(const struct cmdinfo *ci, const char *name) {
+ const char *val = getenv(name);
+ if (val) {
+ sha256_update(&identsc,strlen(name),name); /* no nul */
+ sha256_update(&identsc,1,"=");
+ ident_addstring(0,val);
+ } else {
+ ident_addstring(0,name);
+ }
+}
+
#define MAX_OPTS 5
static const struct cmdinfo cmdinfos[]= {
{ "help", 0, .call=of_help },
{ 0, 'g', 1, .sassignto= &ident },
{ 0, 'G', 1, .call= ident_addstring },
+ { 0, 'E', 1, .call= off_ident_addenv },
{ 0, 'M', 1, .call=of_iassign, .iassignto= &numservers },
{ 0, 'D', 0, .iassignto= &debugmode, .arg= 1 },
{ 0, 'c', 1, .call=of_iassign, .iassignto= &check_interval },