=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/xinstall/xinstall.c,v retrieving revision 1.61 retrieving revision 1.62 diff -c -r1.61 -r1.62 *** src/usr.bin/xinstall/xinstall.c 2015/07/18 15:42:37 1.61 --- src/usr.bin/xinstall/xinstall.c 2015/07/19 18:27:26 1.62 *************** *** 1,4 **** ! /* $OpenBSD: xinstall.c,v 1.61 2015/07/18 15:42:37 jasper Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: xinstall.c,v 1.62 2015/07/19 18:27:26 jasper Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* *************** *** 72,78 **** void copy(int, char *, int, char *, off_t, int); int compare(int, const char *, off_t, int, const char *, off_t); void install(char *, char *, u_long, u_int); ! void install_dir(char *); void strip(char *); void usage(void); int create_newfile(char *, struct stat *); --- 72,78 ---- void copy(int, char *, int, char *, off_t, int); int compare(int, const char *, off_t, int, const char *, off_t); void install(char *, char *, u_long, u_int); ! void install_dir(char *, int); void strip(char *); void usage(void); int create_newfile(char *, struct stat *); *************** *** 167,173 **** if (dodir) { for (; *argv != NULL; ++argv) ! install_dir(*argv); exit(EX_OK); /* NOTREACHED */ } --- 167,173 ---- if (dodir) { for (; *argv != NULL; ++argv) ! install_dir(*argv, mode); exit(EX_OK); /* NOTREACHED */ } *************** *** 176,182 **** char *dest = dirname(argv[argc - 1]); if (dest == NULL) errx(EX_OSERR, "cannot determine dirname"); ! install_dir(dest); } no_target = stat(to_name = argv[argc - 1], &to_sb); --- 176,187 ---- char *dest = dirname(argv[argc - 1]); if (dest == NULL) errx(EX_OSERR, "cannot determine dirname"); ! /* ! * When -D is passed, do not chmod the directory with the mode set for ! * the target file. If more restrictive permissions are required then ! * '-d -m' ought to be used instead. ! */ ! install_dir(dest, 0755); } no_target = stat(to_name = argv[argc - 1], &to_sb); *************** *** 572,578 **** * build directory hierarchy */ void ! install_dir(char *path) { char *p; struct stat sb; --- 577,583 ---- * build directory hierarchy */ void ! install_dir(char *path, int mode) { char *p; struct stat sb;