+
+ case 'S':
+ conf.no_symlinks = 1;
+ break;
+
+ case 'D':
+ conf.no_dirlists = 1;
+ break;
+
+ case 'R':
+ conf.rfc1918_filter = 1;
+ break;
+
+ case 'n':
+ conf.max_script_requests = atoi(optarg);
+ break;
+
+ case 'N':
+ conf.max_connections = atoi(optarg);
+ break;
+
+ case 'x':
+ fixup_prefix(optarg);
+ conf.cgi_prefix = optarg;
+ break;
+
+ case 'y':
+ alias = calloc(1, sizeof(*alias));
+ if (!alias) {
+ fprintf(stderr, "Error: failed to allocate alias\n");
+ exit(1);
+ }
+ alias->alias = strdup(optarg);
+ alias->path = strchr(alias->alias, '=');
+ if (alias->path)
+ *alias->path++ = 0;
+ list_add(&alias->list, &conf.cgi_alias);
+ break;
+
+ case 'i':
+ optarg = strdup(optarg);
+ port = strchr(optarg, '=');
+ if (optarg[0] != '.' || !port) {
+ fprintf(stderr, "Error: Invalid interpreter: %s\n",
+ optarg);
+ exit(1);
+ }
+
+ *port++ = 0;
+ uh_interpreter_add(optarg, port);
+ break;
+
+ case 't':
+ conf.script_timeout = atoi(optarg);
+ break;
+
+ case 'T':
+ conf.network_timeout = atoi(optarg);
+ break;
+
+ case 'k':
+ conf.http_keepalive = atoi(optarg);
+ break;
+
+ case 'A':
+ conf.tcp_keepalive = atoi(optarg);
+ break;
+
+ case 'f':
+ nofork = 1;
+ break;
+
+ case 'd':
+ optarg = strdup(optarg);
+ port = alloca(strlen(optarg) + 1);
+ if (!port)
+ return -1;
+
+ /* "decode" plus to space to retain compat */
+ for (opt = 0; optarg[opt]; opt++)
+ if (optarg[opt] == '+')
+ optarg[opt] = ' ';
+
+ /* opt now contains strlen(optarg) -- no need to re-scan */
+ if (uh_urldecode(port, opt, optarg, opt) < 0) {
+ fprintf(stderr, "uhttpd: invalid encoding\n");
+ return -1;
+ }
+
+ printf("%s", port);
+ return 0;
+ break;
+
+ /* basic auth realm */
+ case 'r':
+ conf.realm = optarg;
+ break;
+
+ /* md5 crypt */
+ case 'm':
+ printf("%s\n", crypt(optarg, "$1$"));
+ return 0;
+ break;
+
+ /* config file */
+ case 'c':
+ conf.file = optarg;
+ break;
+
+#ifdef HAVE_LUA
+ case 'l':
+ case 'L':
+ if (ch == 'l') {
+ if (lua_prefix)
+ fprintf(stderr, "uhttpd: Ignoring previous -%c %s\n",
+ ch, lua_prefix);
+
+ lua_prefix = optarg;
+ }
+ else {
+ if (lua_handler)
+ fprintf(stderr, "uhttpd: Ignoring previous -%c %s\n",
+ ch, lua_handler);
+
+ lua_handler = optarg;
+ }
+
+ if (lua_prefix && lua_handler) {
+ add_lua_prefix(lua_prefix, lua_handler);
+ lua_prefix = NULL;
+ lua_handler = NULL;
+ }
+
+ break;
+#else
+ case 'l':
+ case 'L':
+ fprintf(stderr, "uhttpd: Lua support not compiled, "
+ "ignoring -%c\n", ch);
+ break;
+#endif
+#ifdef HAVE_UBUS
+ case 'a':
+ conf.ubus_noauth = 1;
+ break;
+
+ case 'u':
+ conf.ubus_prefix = optarg;
+ break;
+
+ case 'U':
+ conf.ubus_socket = optarg;
+ break;
+
+ case 'X':
+ conf.ubus_cors = 1;
+ break;
+#else
+ case 'a':
+ case 'u':
+ case 'U':
+ case 'X':
+ fprintf(stderr, "uhttpd: UBUS support not compiled, "
+ "ignoring -%c\n", ch);
+ break;
+#endif