search for: shorten_path

Displaying 1 result from an estimated 1 matches for "shorten_path".

Did you mean: short_path
2014 Jan 01
0
Soft chroot jail for sftp-server
...(backward) directory references (".", ".."), ignoring backward references > * that traverse the current directory or root, maintaining leading "/" and maintaining trailing "/" if possible. > * The passed string is modified. > */ > static char* shorten_path(char* path) { > unsigned int path_len = strlen(path)+1; > //char* short_path = path; malloc(sizeof(char) * short_path_len); > size_t j = 0; > size_t i = 0; > //Make sure path doesn't contain any "//" > for (i = 0; i < path_len; i++) { > if (*(path+i) ==...