Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl2/lvm2/dist/libdm Fix problem where chown was us...



details:   https://anonhg.NetBSD.org/src/rev/22dbe95fa0f0
branches:  trunk
changeset: 760155:22dbe95fa0f0
user:      haad <haad%NetBSD.org@localhost>
date:      Wed Dec 29 10:39:27 2010 +0000

description:
Fix problem where chown was used on normal device in time when only
raw device was created. While here do some cleanup.

Problem find and reported by Martin Mersberger on current-users@.

diffstat:

 external/gpl2/lvm2/dist/libdm/libdm-common.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (41 lines):

diff -r f5028cf8d0a5 -r 22dbe95fa0f0 external/gpl2/lvm2/dist/libdm/libdm-common.c
--- a/external/gpl2/lvm2/dist/libdm/libdm-common.c      Wed Dec 29 00:14:04 2010 +0000
+++ b/external/gpl2/lvm2/dist/libdm/libdm-common.c      Wed Dec 29 10:39:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libdm-common.c,v 1.6 2010/12/26 14:48:34 christos Exp $        */
+/*     $NetBSD: libdm-common.c,v 1.7 2010/12/29 10:39:27 haad Exp $    */
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -418,16 +418,16 @@
        dev_t dev = MKDEV(major, minor);
        mode_t old_mask;
 
-       #ifdef __NetBSD__
+#ifdef __NetBSD__
        char rpath[PATH_MAX];
        uint32_t raw_major;
        dev_t rdev;
        char raw_devname[DM_NAME_LEN+1]; /* r + other device name */
 
-       nbsd_get_dm_major(&raw_major,DM_CHAR_MAJOR);
-       rdev = MKDEV(raw_major,minor);
+       nbsd_get_dm_major(&raw_major, DM_CHAR_MAJOR);
+       rdev = MKDEV(raw_major, minor);
 
-       snprintf(raw_devname,sizeof(raw_devname),"r%s",dev_name);
+       snprintf(raw_devname, sizeof(raw_devname), "r%s", dev_name);
 
        _build_dev_path(rpath, sizeof(rpath), raw_devname);
 
@@ -457,8 +457,8 @@
        }
        umask(old_mask);
 
-       if (chown(path, uid, gid) < 0) {
-               log_sys_error("chown", rpath);
+       if (chown(rpath, uid, gid) < 0) {
+               log_sys_error("Raw device chown", rpath);
                return 0;
        }
 #endif



Home | Main Index | Thread Index | Old Index