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: Jose Luis Duran <jlduran%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: PR/59838 CVS commit: src/usr.sbin/mtree
Date: Thu, 18 Dec 2025 18:26:14 -0300

 >  Log Message:
 >  PR/59838: Jose Louis Duran: Save the R mask and apply it at the end so the
 >  order of -k -K -R does not matter.
 
 Thank you, beautiful implementation!
 
 I also had to:
 
 --- a/usr.sbin/mtree/mtree.c
 +++ b/usr.sbin/mtree/mtree.c
 @@ -72,6 +72,7 @@ static struct {
         {F_NETBSD6, "netbsd6"},
  };
 
 +static int      parsekeys(char **);
  __dead static  void    usage(void);
 
  int
 
 And I have a question, if this is also needed?:
 
 --- a/usr.sbin/mtree/create.c
 +++ b/usr.sbin/mtree/create.c
 @@ -402,10 +402,13 @@ statd(FILE *fp, FTS *t, FTSENT *parent, uid_t
 *puid, gid_t *pgid, mode_t *pmode,
             ((keys & F_FLAGS) && (*pflags != saveflags)) ||
             first) {
                 first = 0;
 -               if (flavor != F_NETBSD6 && dflag)
 -                       fprintf(fp, "/set type=dir");
 -               else
 -                       fprintf(fp, "/set type=file");
 +               fprintf(fp, "/set");
 +               if (keys & F_TYPE) {
 +                       if (flavor != F_NETBSD6 && dflag)
 +                               fprintf(fp, " type=dir");
 +                       else
 +                               fprintf(fp, " type=file");
 +               }
                 if (keys & (F_UID | F_UNAME)) {
                         if (keys & F_UNAME &&
                             (name = user_from_uid(saveuid, 1)) != NULL)
 
 I'm worried that: `mtree -cn -k flags -R flags,type -p /usr/bin/ -x`
 would result in a bad specification.
 
 Thank you!
 


Home | Main Index | Thread Index | Old Index