FreeBSD/usr.sbin/mountd/mountd.c
/*
 * Check an absolute directory path for any symbolic links. Return true
 */
Check an absolute directory path for any symbolic links. Return true
Check an absolute directory path for any symbolic links . Return true
static int
check_dirpath(char *dirp)
{
	char *cp;
	int ret = 1;
	struct stat sb;
	cp = dirp + 1;
	while (*cp && ret) {
		if (*cp == '/') {
			*cp = '\0';
			if (lstat(dirp, &sb) < 0 || !S_ISDIR(sb.st_mode))
				ret = 0;
			*cp = '/';
		}
		cp++;
	}
	if (lstat(dirp, &sb) < 0 || !S_ISDIR(sb.st_mode))
		ret = 0;
	return (ret);
}
static int check_dirpath ( char * dirp ) { char * cp ; int ret = 1 ; struct stat sb ; cp = dirp + 1 ; while ( * cp && ret ) { if ( * cp == ' ' ) { * cp = ' \0 ' ; if ( lstat ( dirp , & sb ) < 0 || ! S_ISDIR ( sb . st_mode ) ) ret = 0 ; * cp = ' ' ; } cp ++ ; } if ( lstat ( dirp , & sb ) < 0 || ! S_ISDIR ( sb . st_mode ) ) ret = 0 ; return ( ret ) ; }
Check an absolute directory path for any symbolic links.
Check an absolute directory path for any symbolic links .