Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 571850 Details for
Bug 730473
%defattr overrides %attr if directory default permission given
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to build/files.c
files.c.patch (text/plain), 4.29 KB, created by
Charlie Brady
on 2012-03-21 21:00:18 UTC
(
hide
)
Description:
Patch to build/files.c
Filename:
MIME Type:
Creator:
Charlie Brady
Created:
2012-03-21 21:00:18 UTC
Size:
4.29 KB
patch
obsolete
>--- rpm-4.8.0/build/files.c.orig 2012-03-21 13:40:36.614034000 -0400 >+++ rpm-4.8.0/build/files.c 2012-03-21 15:36:02.012610000 -0400 >@@ -557,13 +557,7 @@ > } > ar->ar_fmode = ui; > } else { >- if (ret_ar == &(fl->def_ar)) { >- ar->ar_fmodestr = NULL; >- ar->ar_fmode = 0; >- } else { >- ar->ar_fmodestr = fl->def_ar.ar_fmodestr; >- ar->ar_fmode = fl->def_ar.ar_fmode; >- } >+ ar->ar_fmodestr = NULL; > } > > if (ar->ar_dmodestr && !isAttrDefault(ar->ar_dmodestr)) { >@@ -575,29 +569,15 @@ > } > ar->ar_dmode = ui; > } else { >- if (ret_ar == &(fl->def_ar)) { >- ar->ar_dmodestr = NULL; >- ar->ar_dmode = 0; >- } else { >- ar->ar_dmodestr = fl->def_ar.ar_dmodestr; >- ar->ar_dmode = fl->def_ar.ar_dmode; >- } >+ ar->ar_dmodestr = NULL; > } > > if (!(ar->ar_user && !isAttrDefault(ar->ar_user))) { >- if (ret_ar == &(fl->def_ar)) { >- ar->ar_user = NULL; >- } else { >- ar->ar_user = fl->def_ar.ar_user; >- } >+ ar->ar_user = NULL; > } > > if (!(ar->ar_group && !isAttrDefault(ar->ar_group))) { >- if (ret_ar == &(fl->def_ar)) { >- ar->ar_group = NULL; >- } else { >- ar->ar_group = fl->def_ar.ar_group; >- } >+ ar->ar_group = NULL; > } > > dupAttrRec(ar, ret_ar); >@@ -1230,11 +1210,16 @@ > > buf[0] = '\0'; > if (S_ISLNK(flp->fl_mode)) { >- buf[readlink(flp->diskPath, buf, BUFSIZ)] = '\0'; >- if (fl->buildRoot) { >+ ssize_t llen = readlink(flp->diskPath, buf, BUFSIZ-1); >+ if (llen == -1) { >+ rpmlog(RPMLOG_ERR, _("reading symlink %s failed: %s\n"), >+ flp->diskPath, strerror(errno)); >+ fl->processingFailed = 1; >+ } else { >+ buf[llen] = '\0'; > if (buf[0] == '/' && !rstreq(fl->buildRoot, "/") && >- rstreqn(buf, fl->buildRoot, strlen(fl->buildRoot))) { >- rpmlog(RPMLOG_ERR, >+ rstreqn(buf, fl->buildRoot, strlen(fl->buildRoot))) { >+ rpmlog(RPMLOG_ERR, > _("Symlink points to BuildRoot: %s -> %s\n"), > flp->cpioPath, buf); > fl->processingFailed = 1; >@@ -1429,8 +1414,11 @@ > statp->st_atime = now; > statp->st_mtime = now; > statp->st_ctime = now; >- } else { >- rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskPath); >+ } else { >+ const char *msg = fl->isDir ? >+ _("Directory not found: %s\n") : >+ _("File not found: %s\n"); >+ rpmlog(RPMLOG_ERR, msg, diskPath); > fl->processingFailed = 1; > return RPMRC_FAIL; > } >@@ -1447,20 +1435,33 @@ > fileUid = statp->st_uid; > fileGid = statp->st_gid; > >- if (S_ISDIR(fileMode) && fl->cur_ar.ar_dmodestr) { >- fileMode &= S_IFMT; >- fileMode |= fl->cur_ar.ar_dmode; >- } else if (fl->cur_ar.ar_fmodestr != NULL) { >+ /* Explicit %attr() always wins */ >+ if (fl->cur_ar.ar_fmodestr != NULL) { > fileMode &= S_IFMT; > fileMode |= fl->cur_ar.ar_fmode; >+ } else { >+ /* ...but %defattr() for directories and files is different */ >+ if (S_ISDIR(fileMode)) { >+ if (fl->def_ar.ar_dmodestr) { >+ fileMode &= S_IFMT; >+ fileMode |= fl->def_ar.ar_dmode; >+ } >+ } else if (fl->def_ar.ar_fmodestr) { >+ fileMode &= S_IFMT; >+ fileMode |= fl->def_ar.ar_fmode; >+ } > } > if (fl->cur_ar.ar_user) { > fileUname = getUnameS(fl->cur_ar.ar_user); >+ } else if (fl->def_ar.ar_user) { >+ fileUname = fl->def_ar.ar_user; > } else { > fileUname = getUname(fileUid); > } > if (fl->cur_ar.ar_group) { > fileGname = getGnameS(fl->cur_ar.ar_group); >+ } else if (fl->def_ar.ar_group) { >+ fileGname = fl->def_ar.ar_group; > } else { > fileGname = getGname(fileGid); > } >@@ -1708,6 +1709,9 @@ > * /.././../usr/../bin//./sh > */ > diskPath = rpmGenPath(fl->buildRoot, NULL, fileName); >+ /* Arrange trailing slash on directories */ >+ if (fl->isDir) >+ diskPath = rstrcat(&diskPath, "/"); > > if (doGlob) { > ARGV_t argv = NULL; >@@ -1728,7 +1732,10 @@ > } > argvFree(argv); > } else { >- rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), diskPath); >+ const char *msg = (fl->isDir) ? >+ _("Directory not found by glob: %s\n") : >+ _("File not found by glob: %s\n"); >+ rpmlog(RPMLOG_ERR, msg, diskPath); > rc = RPMRC_FAIL; > goto exit; > } >@@ -1881,7 +1888,7 @@ > fl.nLangs = 0; > fl.currentCaps = NULL; > >- dupAttrRec(&fl.def_ar, &fl.cur_ar); >+ freeAttrRec(&fl.cur_ar); > > if (parseForVerify(buf, &fl)) > continue;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 730473
:
571844
| 571850