=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/import.c,v retrieving revision 1.94 retrieving revision 1.95 diff -c -r1.94 -r1.95 *** src/usr.bin/cvs/import.c 2008/06/10 02:11:19 1.94 --- src/usr.bin/cvs/import.c 2008/06/10 20:30:17 1.95 *************** *** 1,4 **** ! /* $OpenBSD: import.c,v 1.94 2008/06/10 02:11:19 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: import.c,v 1.95 2008/06/10 20:30:17 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 292,297 **** --- 292,298 ---- { int i; BUF *bp; + mode_t mode; time_t tstamp; struct stat st; struct rcs_branch *brp; *************** *** 307,318 **** return; } ! if (dflag == 1) { ! if (fstat(cf->fd, &st) == -1) ! fatal("import_new: %s", strerror(errno)); tstamp = st.st_mtime; - } if ((branch = rcsnum_parse(import_branch)) == NULL) fatal("import_new: failed to parse branch"); --- 308,320 ---- return; } ! if (fstat(cf->fd, &st) == -1) ! fatal("import_new: %s", strerror(errno)); + mode = st.st_mode; + + if (dflag == 1) tstamp = st.st_mtime; if ((branch = rcsnum_parse(import_branch)) == NULL) fatal("import_new: failed to parse branch"); *************** *** 326,332 **** if (cf->repo_fd < 0) fatal("import_new: %s: %s", cf->file_rpath, strerror(errno)); ! cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, RCS_CREATE, 0444); if (cf->file_rcs == NULL) fatal("import_new: failed to create RCS file for %s", cf->file_path); --- 328,335 ---- if (cf->repo_fd < 0) fatal("import_new: %s: %s", cf->file_rpath, strerror(errno)); ! cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, RCS_CREATE, ! (mode & ~(S_IWUSR | S_IWGRP | S_IWOTH))); if (cf->file_rcs == NULL) fatal("import_new: failed to create RCS file for %s", cf->file_path);