mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-22 00:42:06 +01:00
My optimization to eliminate /set records was a little too aggressive, it
optimized away the first one :-(.
This commit is contained in:
parent
724a286e43
commit
5104ed9c4a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2877
@ -215,6 +215,7 @@ statd(t, parent, puid, pgid, pmode)
|
||||
uid_t saveuid = *puid;
|
||||
mode_t savemode = *pmode;
|
||||
u_short maxgid, maxuid, maxmode, g[MAXGID], u[MAXUID], m[MAXMODE];
|
||||
static int first = 1;
|
||||
|
||||
if ((p = fts_children(t, 0)) == NULL) {
|
||||
if (errno)
|
||||
@ -248,11 +249,13 @@ statd(t, parent, puid, pgid, pmode)
|
||||
}
|
||||
/*
|
||||
* If the /set record is the same as the last one we do not need to output
|
||||
* a new one. So first we check to see if anything changed.
|
||||
* a new one. So first we check to see if anything changed. Note that we
|
||||
* always output a /set record for the first directory.
|
||||
*/
|
||||
if ((((keys & F_UNAME) | (keys & F_UID)) && (*puid != saveuid)) ||
|
||||
(((keys & F_GNAME) | (keys & F_GID)) && (*pgid != savegid)) ||
|
||||
((keys & F_MODE) && (*pmode != savemode))) {
|
||||
((keys & F_MODE) && (*pmode != savemode)) || (first)) {
|
||||
first = 0;
|
||||
if (dflag)
|
||||
(void)printf("/set type=dir");
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user