Bug 452326
| Summary: | ejabberdctl runs as wrong user, wrong hostname | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Bill McGonigle <bill-bugzilla.redhat.com> | ||||||||
| Component: | ejabberd | Assignee: | Peter Lemenkov <lemenkov> | ||||||||
| Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
| Severity: | medium | Docs Contact: | |||||||||
| Priority: | low | ||||||||||
| Version: | 8 | CC: | adam, cass | ||||||||
| Target Milestone: | --- | Keywords: | Reopened | ||||||||
| Target Release: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | 2.0.1-4.fc8 | Doc Type: | Bug Fix | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | Environment: | ||||||||||
| Last Closed: | 2008-09-25 00:09:17 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Bill McGonigle
2008-06-20 23:24:30 UTC
Created attachment 309954 [details]
Patch that changes hostname and adds runuser
ejabberd-2.0.1-3.fc8 has been submitted as an update for Fedora 8 ejabberd-2.0.1-3.fc9 has been submitted as an update for Fedora 9 I have tried ejabberd-2.0.1-3.fc9, and it is still not working for me. I still have to change HOST=localhost in ejabberdctl, and node=localhost in /etc/init.d/ejabberd. There must be some configurations where localhost is appropriate, and others where `hostname | cut ...` is. There is perhaps some insight here, especially the -name and -sname options? http://www.erlang.org/doc/man/erl.html Aha, I think I've got it: `hostname -s` It's because we're using -sname, and because of this: [root@lincoln4 ~]# hostname -s localhost [root@lincoln4 ~]# hostname -f localhost.localdomain [root@lincoln4 ~]# hostname lincoln4 When I change ejabberdctl and the init file to this, it works. Interestingly, ejabberd.logrotate was already using `hostname -s`. Created attachment 310000 [details]
Patch to use `hostname -s` instead of hardcoding localhost or using cut
Dammit! They're the same on my machine: [petro@Sulaco ~]$ hostname | cut -d. -f1 Sulaco [petro@Sulaco ~]$ hostname -s Sulaco [petro@Sulaco ~]$ hostname -f Sulaco [petro@Sulaco ~]$ Thanks for catching this. ejabberd-2.0.1-4.fc8 has been submitted as an update for Fedora 8 ejabberd-2.0.1-4.fc9 has been submitted as an update for Fedora 9 Working well now, thanks! Eh - dumb question - where can I grab this? I figured updates-testing but it doesn't seem to be there or in development: Installing: ejabberd i386 2.0.1-2.fc8 updates-testing 710 k ejabberd-doc i386 2.0.1-2.fc8 updates-testing 1.0 M It has been moved to updates-testing few hours ago. Let's wait until it will be spreaded across mirrors. ejabberd-2.0.1-4.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update ejabberd'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-5671 Created attachment 310205 [details]
patch to fix quoting issue for register
I don't even believe myself at this point, but when I submitted the original
patch I was able to do a register command and it succeeded. But now using both
that same patch and the current update version, I get bash quoting problems.
I'm not an expert bash hacker, so I may have boned something. Here's what I'm
seeing with -x:
+ ctl register bill bfccomputing.com 1234abcd
+ /sbin/runuser -s /bin/bash - ejabberd -c ' erl -sname ejabberdctl
-noinput -pa /usr/lib/ejabberd/ebin -s ejabberd_ctl -extra
ejabberd@borlaug register' bill bfccomputing.com '1234abcd '
I can't figure out where those extra quotes are coming from, but it causes the
erlang call to fail (no kidding, right?)
To work around this, I made the change reflected in this patch which just
stuffs the command into a variable and then calls out with that. That seems to
get the quoting right:
[root@borlaug sbin]# ejabberdctl register bill bfccomputing.com 1234abcd
User "bill" already registered at node ejabberd@borlaug
(see, proof I'm not imagining it this time...)
Other than that, ejabberd-2.0.1-4.fc8 appears to work out of the box. Thanks!
ejabberd-2.0.1-4.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report. ejabberd-2.0.1-4.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report. Since the version # didn't increase, I'll assume it's the same code, and such the problem in comment 13 wasn't addressed, so this will still be broken, and this bug should be reopened. You're right. Reopeninn this ticket... (In reply to comment #13) > Created an attachment (id=310205) [details] > patch to fix quoting issue for register Could you push this patch to the F-9 package please? I rebased the OLPC XS ejabberd package on the F-9 one and spend hours trying to understand why ejabberdctl didn't work as expected. I finally found and applied this patch which solved the problem. I have an updated version of ejabberd-ejabberdctl_fix.diff including this fix: http://git.collabora.co.uk/?p=user/cassidy/ejabberd-rpm;a=blob;f=ejabberd-ejabberdctl_fix.diff;h=26692c1739b78b5091f65838db8da00d8ce229e0;hb=3ff84e7a25c2ca98d338bac3cc6d9d0996f30c07 ejabberd-2.0.2-1.fc8 has been submitted as an update for Fedora 8. http://admin.fedoraproject.org/updates/ejabberd-2.0.2-1.fc8 ejabberd-2.0.2-1.fc9 has been submitted as an update for Fedora 9. http://admin.fedoraproject.org/updates/ejabberd-2.0.2-1.fc9 ejabberd-2.0.2-1.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update ejabberd'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-7657 ejabberd-2.0.2-1.fc9 has been pushed to the Fedora 9 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update ejabberd'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-7637 ejabberd-2.0.2-1.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report. ejabberd-2.0.2-1.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report. |