inn.conf: Support for `newsuser', `newsgrp' options

Ivan Shmakov oneingray at gmail.com
Fri Dec 21 15:27:09 UTC 2007


>>>>> Julien ÉLIE <julien at trigofacile.com> writes:

 >>> It is a bit different in INN 2.5 since inndstart is no longer used:
 >>> backends/innbind is now starting everything and it will not change
 >>> users.  So perhaps get_news_uid_gid() should not be used there and
 >>> the code kept intact (?)

[...]

 >> Looks like `ensure_news_user (0)' will fit there, like:

 >> - pwd = getpwnam(NEWSUSER);
 >> - if (pwd == NULL)
 >> - die("cannot get UID for %s", NEWSUSER);
 >> - if (real_uid != pwd->pw_uid)
 >> - if (real_uid != news_uid)
 >> - die("must be run by user %s (%lu), not %lu", NEWSUSER,
 >> - (unsigned long) pwd->pw_uid, (unsigned long) real_uid);
 >> +      ensure_news_user (0);

[...]

 >> Provided that get_news_uid_gid () (on top of which ensure_news_user
 >> () is implemented) is corrected as suggested above.

	Note the above.

 > I have just tried ensure_news_user(0) but it does not work:

 > 15:42 root at trigofacile /home/news/work/trunk# /etc/init.d/inn2 start
 > Starting news server: Starting innd.
 > Scheduled start of /home/news/bin/innwatch.
 > Scheduled start of cnfsstat.
 > zsh: exit 1     /etc/init.d/inn2 start

 > Dec 21 15:42:23 news innd: innbind returned no output, assuming failure
 > Dec 21 15:42:23 news innd: innbind failed for 0.0.0.0,119
 > Dec 21 15:42:23 news innd: SERVER cant listen on any sockets
 > Dec 21 15:42:23 news nnrpd[11843]: cant bind to any addresses

 > However, if I keep the previous code, everything seems to work
 > (with your whole patch).

 > My /etc/init.d/inn2 file does:

 > su news -c /home/news/bin/rc.news
 > su news -c '/home/news/bin/nnrpd -D -c /home/news/etc/readers-ssl.conf -p 563 -S'

 > Do you have any idea on that issue?

	It looks like you have get_news_uid_gid () without the `innconf
	== 0' fallback coded in.

	Could you try the patches I've posted 2007-12-17 for an improved
	version of get_news_uid_gid () (which is used internally by
	ensure_news_user ())?  You may apply just the first patch which
	provides additional `inn.conf' options, as well as the
	ensure_news_user () function, etc.

	Feel free to test the other patches of that set as well.



More information about the inn-workers mailing list