예제 #1
0
파일: lxcmd.c 프로젝트: amosbird/ctags
static boolean isSafeExecutable (const char* path)
{
	fileStatus *file;
	boolean r;

	Assert (path);
	file =  eStat (path);

	if (!file->exists)
	{
		/* The file doesn't exist. So I cannot say
		   it is unsafe. The caller should
		   handle this case. */
		r = TRUE;
	}
	else if (file->isSetuid)
	{
		error (WARNING, "xcmd doesn't run a setuid executable: %s", path);
		r = FALSE;
	}
	else if (file->isSetgid)
	{
		error (WARNING, "xcmd doesn't run a setgid executable: %s", path);
		r = FALSE;
	}
	else
		r = TRUE;

	eStatFree (file);
	return r;
}
예제 #2
0
파일: parse.c 프로젝트: FelikZ/ctags
extern langType getFileLanguage (const char *const fileName)
{
	langType language = Option.language;
	if (language == LANG_AUTO)
	{
		language = getExtensionLanguage (fileExtension (fileName));
		if (language == LANG_IGNORE)
			language = getPatternLanguage (fileName);
#ifdef SYS_INTERPRETER
		if (language == LANG_IGNORE)
		{
			fileStatus *status = eStat (fileName);
			if (status->isExecutable)
				language = getInterpreterLanguage (fileName);
		}
#endif
	}
	return language;
}
예제 #3
0
파일: main.c 프로젝트: att/uwin
static boolean createTagsForEntry (const char *const entryName)
{
    boolean resize = FALSE;
    fileStatus *status = eStat (entryName);

    Assert (entryName != NULL);
    if (isExcludedFile (entryName))
	verbose ("excluding \"%s\"\n", entryName);
    else if (status->isSymbolicLink  &&  ! Option.followLinks)
	verbose ("ignoring \"%s\" (symbolic link)\n", entryName);
    else if (! status->exists)
	error (WARNING | PERROR, "cannot open source file \"%s\"", entryName);
    else if (status->isDirectory)
	resize = recurseIntoDirectory (entryName);
    else if (! status->isNormalFile)
	verbose ("ignoring \"%s\" (special file)\n", entryName);
    else
	resize = parseFile (entryName);

    return resize;
}
예제 #4
0
파일: routines.c 프로젝트: m-novikov/ctags
extern boolean isRecursiveLink (const char* const dirName)
{
	boolean result = FALSE;
	fileStatus *status = eStat (dirName);
	if (status->isSymbolicLink)
	{
		char* const path = absoluteFilename (dirName);
		while (path [strlen (path) - 1] == PATH_SEPARATOR)
			path [strlen (path) - 1] = '\0';
		while (! result  &&  strlen (path) > (size_t) 1)
		{
			char *const separator = strrchr (path, PATH_SEPARATOR);
			if (separator == NULL)
				break;
			else if (separator == path)  /* backed up to root directory */
				*(separator + 1) = '\0';
			else
				*separator = '\0';
			result = isSameFile (path, dirName);
		}
		eFree (path);
	}
	return result;
}
예제 #5
0
파일: routines.c 프로젝트: m-novikov/ctags
extern boolean doesExecutableExist (const char *const fileName)
{
	fileStatus *status = eStat (fileName);
	return status->exists && status->isExecutable;
}
예제 #6
0
파일: routines.c 프로젝트: m-novikov/ctags
extern boolean doesFileExist (const char *const fileName)
{
	fileStatus *status = eStat (fileName);
	return status->exists;
}