rpm/resetdefattr.diff
OBS User autobuild b4494b17ad Accepting request 37534 from Base:System
Copy from Base:System/rpm based on submit request 37534 from user mlschroe

OBS-URL: https://build.opensuse.org/request/show/37534
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpm?expand=0&rev=96
2010-04-13 19:06:36 +00:00

56 lines
1.5 KiB
Diff

--- ./build/files.c.orig 2010-04-07 14:27:54.000000000 +0000
+++ ./build/files.c 2010-04-07 14:51:11.000000000 +0000
@@ -561,8 +561,13 @@ static rpmRC parseForAttr(const char * b
}
ar->ar_fmode = ui;
} else {
- ar->ar_fmodestr = fl->def_ar.ar_fmodestr;
- ar->ar_fmode = fl->def_ar.ar_fmode;
+ 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;
+ }
}
if (ar->ar_dmodestr && !isAttrDefault(ar->ar_dmodestr)) {
@@ -574,15 +579,30 @@ static rpmRC parseForAttr(const char * b
}
ar->ar_dmode = ui;
} else {
- ar->ar_dmodestr = fl->def_ar.ar_dmodestr;
- ar->ar_dmode = fl->def_ar.ar_dmode;
+ 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;
+ }
}
- if (!(ar->ar_user && !isAttrDefault(ar->ar_user)))
- ar->ar_user = fl->def_ar.ar_user;
+ 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;
+ }
+ }
- if (!(ar->ar_group && !isAttrDefault(ar->ar_group)))
- ar->ar_group = fl->def_ar.ar_group;
+ if (!(ar->ar_group && !isAttrDefault(ar->ar_group))) {
+ if (ret_ar == &(fl->def_ar)) {
+ ar->ar_group = 0;
+ } else {
+ ar->ar_group = fl->def_ar.ar_group;
+ }
+ }
dupAttrRec(ar, ret_ar);