Date: Wed, 31 Mar 2010 07:10:49 GMT From: Garrett Cooper <gcooper@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/145230: mtree(8) -P is broken because l* functions aren't being used Message-ID: <201003310710.o2V7AnNt036982@www.freebsd.org> Resent-Message-ID: <201003310720.o2V7K845087730@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 145230 >Category: bin >Synopsis: mtree(8) -P is broken because l* functions aren't being used >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 31 07:20:07 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9-CURRENT >Organization: Cisco Systems, Inc. >Environment: FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #5 r205310: Sat Mar 20 01:32:51 PDT 2010 gcooper@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA amd64 >Description: As discovered when reviewing mtree(8) as part of bin/144411, there are a number of items with -P that doesn't work... all chown, chmod, and stat calls for instance are the non-l variety, which means that unfortunately the file information for symlinks isn't being properly recorded. Furthermore, in verify.c where lchown is used: if (!(p->flags & (F_UID | F_UNAME))) (void)printf(" (%s not created: user not specified)", type); else if (!(p->flags & (F_GID | F_GNAME))) (void)printf(" (%s not created: group not specified)", type); else if (p->type == F_LINK) { if (symlink(p->slink, path)) (void)printf(" (symlink not created: %s)\n", strerror(errno)); else (void)printf(" (created)\n"); if (lchown(path, p->st_uid, p->st_gid) == -1) { the symlink data isn't being properly recorded; it's resolving the file instead, which may store incorrect data, or may have incorrect permissions. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003310710.o2V7AnNt036982>