* valgrind results ... how to interpret them ** we aren't concerned about still reachable, especially in library calls e.g., getpwuid * constants in the header; what's standard? ** all of the standard stuff should be there (including lstat), but some of it depends upon other precompile symbols ** vscode might be doing something strange; try with straight ssh until we figure it out * stat vs lstat ** the _only_ difference stat follows symlinks, lstat does not * symbolic link handling ** know that it's a symlink: requires lstat (not stat) ** use readlink to get the target file, with a buffer PATH_MAX+1 in size if you want to be confident. ** readlink and ls only read the target, they don't follow target if it's a symlink ** ls uses stat on the target to determine file type for -F * error handling ** symbolic links -- target does not exist is not a failure with colors, it shows it in red, but you don't have to do that ** lstat errors (directory permissions) *** missing read permission == error for the dir *** missing execute permission == errors for each entry in the dir and lots of '?' in the output if ( lstat(path, &finfo) < 0 ) { fprintf(stderr, "lsrulf: cannot file: %s: %s\n", path, strerror(errno)); // handling for a file with no fprintf(stdout, " ... "); } * suid permissions ** must use bitmask on st_mode to see if S_ISUID or SISGID is set * device file handling, maj/minor ** according to the lstat man page, use the macros major and minor on st_dev