/* * sl-frob.c * * 'stat' and recreate symlink is the perms are not 0777 as they * should be. This may be required if symlink permissions for all * hosed or messed up (for example, early versions of XFS would create * symlinks as non-0777 as it obeyed the umask). * * Usage is something like: * * find /path/to/fs -mount -type l -not -perm 777 -print0 | xargs -0 /path/to/sl-frob * * $Id: sl-frob.c,v 1.1 2002/09/10 21:19:37 cw Exp $ */ #include #include #include #include #include #include int main(int ac, char **av) { int i; struct stat st; char lpath[4096]; int nchar; if (ac < 2) { fprintf(stderr, "%s: filename \n\trecreate symlinks with busted perms\n", av[0]); return 1; } /* old versions of XFS will obey the umask */ umask(0); for (i=1; i '%s' (%s)\n", av[i], lpath, strerror(errno)); fprintf(stderr, "\tTHIS IS BAD --- MANUALLY FIX THIS\n"); continue; } } } return 0; }