On 2023/05/16 11:39:17 -0600, Todd C. Miller <mill...@openbsd.org> wrote:
> We can just use "cp -a skeldir/. homedir" to copy the skeleton dot
> files to the new user's homedir.  There's no good reason to use pax
> when cp will do and this will simplify a future commit of mine.

hard links are handled differently, but I doubt it's an issue here.
The -v output also changes slightly: before was just the list of
copied files, now a series of "source -> destination" lines.  don't
think anyone is relying on this however, so don't matter.

fwiw OK for me and +1 for the style(9) nit :)

(i'm curious about the future diff)

>  - todd
> 
> Index: usr.sbin/user/user.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/user/user.c,v
> retrieving revision 1.129
> diff -u -p -u -r1.129 user.c
> --- usr.sbin/user/user.c      15 May 2023 17:00:24 -0000      1.129
> +++ usr.sbin/user/user.c      16 May 2023 17:30:18 -0000
> @@ -171,7 +171,7 @@ enum {
>  #define MKDIR                "/bin/mkdir"
>  #define MV           "/bin/mv"
>  #define NOLOGIN              "/sbin/nologin"
> -#define PAX          "/bin/pax"
> +#define CP           "/bin/cp"
>  #define RM           "/bin/rm"
>  
>  #define UNSET_INACTIVE       "Null (unset)"
> @@ -311,8 +311,8 @@ copydotfiles(char *skeldir, char *dir)
>       if (n == 0) {
>               warnx("No \"dot\" initialisation files found");
>       } else {
> -             (void) asystem("cd %s && %s -rw -pe %s . %s",
> -                             skeldir, PAX, (verbose) ? "-v" : "", dir);
> +             (void) asystem("%s -a %s %s/. %s",
> +                 CP, (verbose) ? "-v" : "", skeldir, dir);
>       }
>       return n;
>  }

Reply via email to