sm-sorcery-bugs AT lists.ibiblio.org
Subject: Bugs for Sorcery are reported here
List archive
[SM-Sorcery-Bugs] [Bug 13400] New: symlinks for config files should not be reaped
- From: bugzilla-daemon AT bugs.sourcemage.org
- To: sm-sorcery-bugs AT lists.ibiblio.org
- Subject: [SM-Sorcery-Bugs] [Bug 13400] New: symlinks for config files should not be reaped
- Date: 13 Jan 2007 23:47:37 -0000
http://bugs.sourcemage.org/show_bug.cgi?id=13400
Summary: symlinks for config files should not be reaped
Product: Sorcery
Version: 1.13.x
Platform: Other
OS/Version: Linux
Status: NEW
Severity: critical
Priority: P2
Component: Dispel
AssignedTo: sm-sorcery-bugs AT lists.ibiblio.org
ReportedBy: sobukus AT sourcemage.org
A friend of mine has site-wide config files for ldap server and ldap client.
Every box has /ety/ldap/ldap-server.conf and /etc/ldap/ldap-client.conf.
He then places a symlink at /etc/ldap.conf to the one he chooses.
Now pam_ldap happens to install /etc/ldap.conf and my friend reported that on
an update of pam_ldap, his symlink was replaced by the file from the spell.
I have looked into this and, like all too often, I found _two_ causes of this:
1. pam_ldap didn't use install_config_file. I fixed that.
2. sorcery always reaps symlinks on dispel and doesn't think of the
possibility
that one of them could be a config file.
I found the point where this happens: reaper() in libdispel.
So is there a special reason why this function doesn't look like this:
function reaper() {
# Example: reaper "$INSTALL_LOG" "$MD5_LOG"
debug "libsorcery" "Running reaper() on $1"
if ! [ "$REAP" == "on" ] ||
! [ -f $1 ]; then return
fi
local MD5S=$2
local UNIQUE="$$.$RANDOM"
local REAPER_FILES="$TMP_DIR/reaper.$UNIQUE.files"
local REAPER_DIRS="$TMP_DIR/reaper.$UNIQUE.dirs"
local REAPER_SYMS="$TMP_DIR/reaper.$UNIQUE.syms"
local REAPER_SPECIAL="$TMP_DIR/reaper.$UNIQUE.special"
rm -f $REAPER_FILES $REAPER_DIRS $REAPER_SYMS
# convert from TRACK_ROOT to / for protected filtering,
# then to INSTALL_ROOT.
# INSTALL_ROOT is relative to /, TRACK_ROOT is arbitrary.
seperate_state_files $1 /dev/stdout /dev/null |
log_adjuster /dev/stdin /dev/stdout log filterable |
filter_protected |
log_adjuster /dev/stdin /dev/stdout filterable root |
while read ITEM; do
if test -f "$ITEM"; then echo "$ITEM" >> $REAPER_FILES
#
# !!! this is the changed part, swapped these two tests to
# catch symlinks that qualify as files
# I want to allow symlinks to files to be used as files
#
elif test -h "$ITEM"; then echo "$ITEM" >> $REAPER_SYMS
elif test -d "$ITEM"; then echo "$ITEM" >> $REAPER_DIRS
# if it isn't a symlink, regular file or directory, assume it is a
# special file (character, block, or fifo)
elif test -e "$ITEM"; then echo "$ITEM" >> $REAPER_SPECIAL
fi
done
if test -f $REAPER_FILES ; then
sed "s:^$INSTALL_ROOT::" $REAPER_FILES |
grep -v /var/log/sorcery |
filter_configs -v |
sed "s:^:$INSTALL_ROOT:" |
reap_config_files
sed "s:^$INSTALL_ROOT::" $REAPER_FILES |
grep -v /var/log/sorcery |
filter_configs |
sed "s:^:$INSTALL_ROOT:" |
reap_regular_files
fi
[ -f $REAPER_SYMS ] && rm -f `cat $REAPER_SYMS` 2>/dev/null
[ -f $REAPER_SPECIAL ] && rm -f `cat $REAPER_SPECIAL` 2>/dev/null
[ -f $REAPER_DIRS ] && rmdir `sort -r $REAPER_DIRS` 2>/dev/null
[ -f $REAPER_FILES ] && rmdir `dirnames < $REAPER_FILES |uniq|sort -r`
2>/dev/null
rm -f $REAPER_FILES $REAPER_DIRS $REAPER_SYMS $REAPER_SPECIAL
}
--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
- [SM-Sorcery-Bugs] [Bug 13400] New: symlinks for config files should not be reaped, bugzilla-daemon, 01/13/2007
Archive powered by MHonArc 2.6.24.