Jabber Server?

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Mon Mar 7 20:40:29 UTC 2005


adrian at lisas.de (Adrian Reber) writes:

>> |      export NEWPASS="$RANDOM-newpass-$RANDOM"
>> |      cd %{sysconfdir}
>> |      %{__perl} -pi -e "s,<secret>secret</secret>,<secret>$NEWPASS</secret>,g" router-users.xml
> ...
>> 2. the new password is visible with 'ps'; when you add the dependency on
>>    'perl' (dunno, if jabber really requires it), you could read it from
>>    the $NEWPASS environment variable.
>> 
>>    But when 'perl' is not required for jabberd functionality, the entire
>>    script should be rewritten to remove this dep.
>
> It is true that I could replace all the perl stuff with sed and will do
> it but how would you circumvent that the password can be seen with ps
> during jabbed installation?

In a first step, I would replace the 'secret' string with a more unique
one like '@@SECRET@@'. Then, you can use something like

------
Requires(post):   gawk diffutils mktemp

%post
function subst()
{
  awk '{ gsub("@@SECRET@@", ENVIRON["NEWPASS"]); print $0; }' "$1" >$tmp
  cmp -q "$1" "$tmp" || cat "$tmp" >"$1"
  rm -f "$tmp"
}

export NEWPASS=...
tmp=$(mktemp /tmp/subst.XXXXXX)
for i in *.xml; do
    test -e "$i" || continue
    subst "$i"
done
--------



Enrico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 480 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-extras-list/attachments/20050307/e42c7403/attachment.sig>


More information about the fedora-extras-list mailing list