Lines Matching refs:cmd

103 PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_DC)  in php_exec()  argument
120 fp = VCWD_POPEN(cmd, "rb"); in php_exec()
122 fp = VCWD_POPEN(cmd, "r"); in php_exec()
125 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to fork [%s]", cmd); in php_exec()
216 char *cmd; in php_exec_ex() local
222 …if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE… in php_exec_ex()
226 …if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_co… in php_exec_ex()
234 if (strlen(cmd) != cmd_len) { in php_exec_ex()
240 ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC); in php_exec_ex()
246 ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC); in php_exec_ex()
293 char *cmd; in php_escape_shell_cmd() local
304 cmd = safe_emalloc(2, l, 1); in php_escape_shell_cmd()
313 memcpy(cmd + y, str + x, mb_len); in php_escape_shell_cmd()
328 cmd[y++] = '\\'; in php_escape_shell_cmd()
330 cmd[y++] = str[x]; in php_escape_shell_cmd()
363 cmd[y++] = '^'; in php_escape_shell_cmd()
365 cmd[y++] = '\\'; in php_escape_shell_cmd()
369 cmd[y++] = str[x]; in php_escape_shell_cmd()
373 cmd[y] = '\0'; in php_escape_shell_cmd()
377 efree(cmd); in php_escape_shell_cmd()
384 cmd = erealloc(cmd, y + 1); in php_escape_shell_cmd()
387 return cmd; in php_escape_shell_cmd()
397 char *cmd; in php_escape_shell_arg() local
408 cmd = safe_emalloc(4, l, 3); /* worst case */ in php_escape_shell_arg()
411 cmd[y++] = '"'; in php_escape_shell_arg()
413 cmd[y++] = '\''; in php_escape_shell_arg()
423 memcpy(cmd + y, str + x, mb_len); in php_escape_shell_arg()
434 cmd[y++] = ' '; in php_escape_shell_arg()
438 cmd[y++] = '\''; in php_escape_shell_arg()
439 cmd[y++] = '\\'; in php_escape_shell_arg()
440 cmd[y++] = '\''; in php_escape_shell_arg()
444 cmd[y++] = str[x]; in php_escape_shell_arg()
448 if (y > 0 && '\\' == cmd[y - 1]) { in php_escape_shell_arg()
450 for (; n >= 0 && '\\' == cmd[n]; n--, k++); in php_escape_shell_arg()
452 cmd[y++] = '\\'; in php_escape_shell_arg()
456 cmd[y++] = '"'; in php_escape_shell_arg()
458 cmd[y++] = '\''; in php_escape_shell_arg()
460 cmd[y] = '\0'; in php_escape_shell_arg()
464 efree(cmd); in php_escape_shell_arg()
471 cmd = erealloc(cmd, y + 1); in php_escape_shell_arg()
473 return cmd; in php_escape_shell_arg()
483 char *cmd = NULL; in PHP_FUNCTION() local
494 cmd = php_escape_shell_cmd(command); in PHP_FUNCTION()
495 RETVAL_STRING(cmd, 0); in PHP_FUNCTION()
508 char *cmd = NULL; in PHP_FUNCTION() local
519 cmd = php_escape_shell_arg(argument); in PHP_FUNCTION()
520 RETVAL_STRING(cmd, 0); in PHP_FUNCTION()