Date: Tue, 14 Nov 2006 20:39:41 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 109987 for review Message-ID: <200611142039.kAEKdfYA047941@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109987 Change 109987 by millert@millert_g5tower on 2006/11/14 20:39:16 Skip mount points entirely. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#5 edit .. //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/setfiles/setfiles.c#5 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#5 (text+ko) ==== @@ -307,11 +307,14 @@ } while ((ftsent = fts_read(fts)) != NULL) { switch (ftsent->fts_info) { + case FTS_D: /* dir in pre-order */ + if (fts->fts_dev != ftsent->fts_dev) + break; + /* FALLTHROUGH */ + case FTS_F: /* file */ + case FTS_SL: /* symlink */ + case FTS_W: /* whiteout */ case FTS_DEFAULT: - case FTS_D: - case FTS_F: - case FTS_SL: - case FTS_W: apply_spec(ftsent->fts_path, ftsent->fts_statp); break; case FTS_DNR: @@ -330,6 +333,12 @@ progname, ftsent->fts_path, strerror(ftsent->fts_errno)); break; + case FTS_DP: /* skip post-order dir */ + case FTS_DC: /* skip dir cycle */ + case FTS_DOT: /* skip . and .. */ + case FTS_SLNONE: /* skip dead symlinks */ + default: + break; } } } else { ==== //depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/setfiles/setfiles.c#5 (text+ko) ==== @@ -671,11 +671,14 @@ /* Walk the file tree, calling apply_spec on each file. */ while ((ftsent = fts_read(fts)) != NULL) { switch (ftsent->fts_info) { - case FTS_DEFAULT: case FTS_D: /* dir in pre-order */ + if (fts->fts_dev != ftsent->fts_dev) + break; + /* FALLTHROUGH */ case FTS_F: /* file */ case FTS_SL: /* symlink */ case FTS_W: /* whiteout */ + case FTS_DEFAULT: apply_spec(ftsent->fts_path, ftsent->fts_statp); break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611142039.kAEKdfYA047941>