1/* 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Ken Smith of The State University of New York at Buffalo. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 31 unchanged lines hidden (view full) --- 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /* not lint */ 42 43#ifndef lint 44#if 0 45static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; 46#endif 47static const char rcsid[] = |
48 "$Id: mv.c,v 1.20 1998/06/09 03:39:38 imp Exp $"; |
49#endif /* not lint */ 50 51#include <sys/param.h> 52#include <sys/time.h> 53#include <sys/wait.h> 54#include <sys/stat.h> 55#include <sys/mount.h> 56 --- 210 unchanged lines hidden (view full) --- 267 (void)close(from_fd); 268 (void)close(to_fd); 269 return (1); 270 } 271 (void)close(from_fd); 272 273 oldmode = sbp->st_mode & ALLPERMS; 274 if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) { |
275 warn("%s: set owner/group (was: %lu/%lu)", to, 276 (u_long)sbp->st_uid, (u_long)sbp->st_gid); |
277 if (oldmode & (S_ISUID | S_ISGID)) { 278 warnx( 279"%s: owner/group changed; clearing suid/sgid (mode was 0%03o)", 280 to, oldmode); 281 sbp->st_mode &= ~(S_ISUID | S_ISGID); 282 } 283 } 284 if (fchmod(to_fd, sbp->st_mode)) --- 73 unchanged lines hidden --- |