NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/59838 CVS commit: src/usr.sbin/mtree



The following reply was made to PR bin/59838; it has been noted by GNATS.

From: Christos Zoulas <christos%zoulas.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost,
 jlduran%gmail.com@localhost
Subject: Re: PR/59838 CVS commit: src/usr.sbin/mtree
Date: Fri, 19 Dec 2025 09:22:13 -0500

 --Apple-Mail=_18CAC5AA-D2D7-4EAB-94BC-CBDF68E67A1E
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8
 
 
 
 > On Dec 19, 2025, at 9:15=E2=80=AFAM, Jose Luis Duran via gnats =
 <gnats-admin%netbsd.org@localhost> wrote:
 >=20
 > The following reply was made to PR bin/59838; it has been noted by =
 GNATS.
 >=20
 
 [stuff deleted]
 
 > I believe it should also check for the presence of F_TYPE before
 > printing "/set":
 >=20
 > --- a/usr.sbin/mtree/create.c
 > +++ b/usr.sbin/mtree/create.c
 > @@ -396,16 +396,20 @@ statd(FILE *fp, FTS *t, FTSENT *parent, uid_t
 > *puid, gid_t *pgid, mode_t *pmode,
 >          * output 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 | F_UID)) && (*puid !=3D saveuid)) ||
 > +       if ((keys & F_TYPE) ||
 > +           ((keys & (F_UNAME | F_UID)) && (*puid !=3D saveuid)) ||
 >             ((keys & (F_GNAME | F_GID)) && (*pgid !=3D savegid)) ||
 > -           ((keys & F_MODE) && (*pmode !=3D savemode)) ||
 > +           ((keys & F_MODE) && (*pmode !=3D savemode)) ||
 >             ((keys & F_FLAGS) && (*pflags !=3D saveflags)) ||
 >             first) {
 >                 first =3D 0;
 > -               if (flavor !=3D F_NETBSD6 && dflag)
 > -                       fprintf(fp, "/set type=3Ddir");
 > -               else
 > -                       fprintf(fp, "/set type=3Dfile");
 > +               fprintf(fp, "/set");
 > +               if (keys & F_TYPE) {
 > +                       if (flavor !=3D F_NETBSD6 && dflag)
 > +                               fprintf(fp, " type=3Ddir");
 > +                       else
 > +                               fprintf(fp, " type=3Dfile");
 > +               }
 >                 if (keys & (F_UID | F_UNAME)) {
 >                         if (keys & F_UNAME &&
 >                             (name =3D user_from_uid(saveuid, 1)) !=3D =
 NULL)
 >=20
 
 We do we need to check F_TYPE twice? It is in the outer if...
 
 
 christos
 
 
 --Apple-Mail=_18CAC5AA-D2D7-4EAB-94BC-CBDF68E67A1E
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP
 
 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org
 
 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCaUVflQAKCRBxESqxbLM7
 OtaqAJ4x8GwpuM9jKMnL0DIKHfS0oOv25ACdGZvRn7fDPcwBeI8IvHQYpHroBoI=
 =sihb
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_18CAC5AA-D2D7-4EAB-94BC-CBDF68E67A1E--
 


Home | Main Index | Thread Index | Old Index