Denys Vlasenko
2013-11-05 16:09:45 UTC
Related to rhbz#971869.
Signed-off-by: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
abrt.spec | 67 ---------------------------------------------------------------
1 file changed, 67 deletions(-)
diff --git a/abrt.spec b/abrt.spec
index 8f1f799..2c0d842 100644
--- a/abrt.spec
+++ b/abrt.spec
@@ -412,73 +412,6 @@ make check
%define abrt_gid_uid 173
getent group abrt >/dev/null || groupadd -f -g %{abrt_gid_uid} --system abrt
getent passwd abrt >/dev/null || useradd --system -g abrt -u %{abrt_gid_uid} -d /etc/abrt -s /sbin/nologin abrt
-
-OLD_LOCATION="/var/spool/abrt"
-NEW_LOCATION="/var/tmp/abrt"
-# $1 == 1 if install; 2 if upgrade
-if [ "$1" -eq 2 ]
-then
- test -d "$OLD_LOCATION" || exit 0
- mkdir -p "$NEW_LOCATION"
-
- #restorecon "$NEW_LOCATION"
- find "$OLD_LOCATION" -maxdepth 1 -type f -exec cp '{}' "$NEW_LOCATION" \;
-
- for DD in `find "$OLD_LOCATION" -maxdepth 1 -type d`
- do
- # skip dump location self
- if [ "$DD" == "$OLD_LOCATION" ]; then
- continue
- fi
-
- # skip symlinks
- if [ -L "$DD" ]; then
- continue
- fi
-
- # check if time element exists, if so then consider a directory as dump
- # directory and move it to the new location
- if [ -f "$DD/time" ]; then
- NEW_DD="$NEW_LOCATION/"`basename $DD`
-
- # to be sure we do not override anything
- if [ -d "$NEW_DD" ]; then
- continue
- fi
-
- if cp --recursive -- "$DD" "$NEW_DD"; then
- # owner of dump dir is identified by his group
- # so get the owner of dump dir
- OWNER_GID=`stat -c "%g" "$DD"`
-
- # use group's user in case where group contains only single user
- if [ $(getent passwd | cut -f3,4,5 -d: | grep -c ":$OWNER_GID:") -eq 1 ]; then
- OWNER_UID=`getent passwd | cut -f3,4,5 -d: | grep ":$OWNER_GID:" | cut -f1 -d:`
- else
- # otherwise get owner from dd's uid element
- OWNER_UID=`cat "$NEW_DD/uid"`
- fi
-
- getent passwd "$OWNER_UID" >/dev/null || {
- # if user doesn't exist pass the ownership to root
- OWNER_UID=0
- }
-
- # set new schema of ownership
- chown --recursive "$OWNER_UID":abrt "$NEW_DD" && {
- chmod 770 "$NEW_DD"
- find "$NEW_DD" -type d -exec chmod 770 '{}' \;
- find "$NEW_DD" -type f -exec chmod 660 '{}' \;
- }
- fi
- fi
- done
-fi
-
-# doesn't mather if it fails or not for any reason
-if which restorecon 1>/dev/null 2>&1; then
- restorecon -R "$NEW_LOCATION" 1>/dev/null 2>&1 || true
-fi
exit 0
%post
Signed-off-by: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
abrt.spec | 67 ---------------------------------------------------------------
1 file changed, 67 deletions(-)
diff --git a/abrt.spec b/abrt.spec
index 8f1f799..2c0d842 100644
--- a/abrt.spec
+++ b/abrt.spec
@@ -412,73 +412,6 @@ make check
%define abrt_gid_uid 173
getent group abrt >/dev/null || groupadd -f -g %{abrt_gid_uid} --system abrt
getent passwd abrt >/dev/null || useradd --system -g abrt -u %{abrt_gid_uid} -d /etc/abrt -s /sbin/nologin abrt
-
-OLD_LOCATION="/var/spool/abrt"
-NEW_LOCATION="/var/tmp/abrt"
-# $1 == 1 if install; 2 if upgrade
-if [ "$1" -eq 2 ]
-then
- test -d "$OLD_LOCATION" || exit 0
- mkdir -p "$NEW_LOCATION"
-
- #restorecon "$NEW_LOCATION"
- find "$OLD_LOCATION" -maxdepth 1 -type f -exec cp '{}' "$NEW_LOCATION" \;
-
- for DD in `find "$OLD_LOCATION" -maxdepth 1 -type d`
- do
- # skip dump location self
- if [ "$DD" == "$OLD_LOCATION" ]; then
- continue
- fi
-
- # skip symlinks
- if [ -L "$DD" ]; then
- continue
- fi
-
- # check if time element exists, if so then consider a directory as dump
- # directory and move it to the new location
- if [ -f "$DD/time" ]; then
- NEW_DD="$NEW_LOCATION/"`basename $DD`
-
- # to be sure we do not override anything
- if [ -d "$NEW_DD" ]; then
- continue
- fi
-
- if cp --recursive -- "$DD" "$NEW_DD"; then
- # owner of dump dir is identified by his group
- # so get the owner of dump dir
- OWNER_GID=`stat -c "%g" "$DD"`
-
- # use group's user in case where group contains only single user
- if [ $(getent passwd | cut -f3,4,5 -d: | grep -c ":$OWNER_GID:") -eq 1 ]; then
- OWNER_UID=`getent passwd | cut -f3,4,5 -d: | grep ":$OWNER_GID:" | cut -f1 -d:`
- else
- # otherwise get owner from dd's uid element
- OWNER_UID=`cat "$NEW_DD/uid"`
- fi
-
- getent passwd "$OWNER_UID" >/dev/null || {
- # if user doesn't exist pass the ownership to root
- OWNER_UID=0
- }
-
- # set new schema of ownership
- chown --recursive "$OWNER_UID":abrt "$NEW_DD" && {
- chmod 770 "$NEW_DD"
- find "$NEW_DD" -type d -exec chmod 770 '{}' \;
- find "$NEW_DD" -type f -exec chmod 660 '{}' \;
- }
- fi
- fi
- done
-fi
-
-# doesn't mather if it fails or not for any reason
-if which restorecon 1>/dev/null 2>&1; then
- restorecon -R "$NEW_LOCATION" 1>/dev/null 2>&1 || true
-fi
exit 0
%post
--
1.8.1.4
1.8.1.4