Displaying 1 result from an estimated 1 matches for "jail_to_actu".
Did you mean:
jail_to_actual
2014 Jan 01
0
Soft chroot jail for sftp-server
...t;
> *(path+j) = *(path+i);
> j++;
> }
> return real_path;
> }
> /* Takes a path from jail perspective and converts it to the actual path. This function frees path (so expects a freeable pointer) or reuses it so in any case returns a freeable pointer. */
> static char* jail_to_actual(char* path) {
> if (jail == NULL) return path;
> char* shortened = shorten_path(path);
> char* translated = concat_path(jail,shortened);
> free(shortened);
> return translated;
> }
> /* The opposite of jail_to_actual, returns NULL if path is not in jail, This function fr...