Re: rc.d and environment variables

2010-12-24 Thread Victor Sudakov
Da Rock wrote: [dd] Doesn't the rc.d script run as root initially and then a method (default flags, etc) is used to change the owner to a nobody (restricted privilege user)? Just my 2c, but please correct me if I'm wrong. That is probably correct, rc.subr does su -m $user, but the login

Re: rc.d and environment variables

2010-12-24 Thread Da Rock
On 12/24/10 18:03, Victor Sudakov wrote: Da Rock wrote: [dd] Doesn't the rc.d script run as root initially and then a method (default flags, etc) is used to change the owner to a nobody (restricted privilege user)? Just my 2c, but please correct me if I'm wrong. That is probably

Re: rc.d and environment variables

2010-12-24 Thread RW
On Fri, 24 Dec 2010 09:34:27 +0600 Victor Sudakov v...@mpeks.tomsk.su wrote: Lowell Gilbert wrote: I'm not sure this will work. The initial question was about how to obtain an environmental variable. If the rc.d script of svnserve sources /etc/rc.conf and/or /etc/rc.conf.local, it

Re: rc.d and environment variables

2010-12-24 Thread Victor Sudakov
RW wrote: I'm not sure this will work. The initial question was about how to obtain an environmental variable. If the rc.d script of svnserve sources /etc/rc.conf and/or /etc/rc.conf.local, it is okay, They do. rc.d scripts all start by sucking in rc.subr, which in

Re: rc.d and environment variables

2010-12-24 Thread Victor Sudakov
Da Rock wrote: Doesn't the rc.d script run as root initially and then a method (default flags, etc) is used to change the owner to a nobody (restricted privilege user)? Just my 2c, but please correct me if I'm wrong. That is probably correct, rc.subr does su -m $user, but the

Re: rc.d and environment variables

2010-12-24 Thread Da Rock
On 12/24/10 19:37, Victor Sudakov wrote: Da Rock wrote: Doesn't the rc.d script run as root initially and then a method (default flags, etc) is used to change the owner to a nobody (restricted privilege user)? Just my 2c, but please correct me if I'm wrong. That is

Re: rc.d and environment variables

2010-12-24 Thread RW
On Fri, 24 Dec 2010 15:29:01 +0600 Victor Sudakov v...@mpeks.tomsk.su wrote: RW wrote: I'm not sure this will work. The initial question was about how to obtain an environmental variable. If the rc.d script of svnserve sources /etc/rc.conf and/or /etc/rc.conf.local, it

Re: rc.d and environment variables

2010-12-24 Thread Victor Sudakov
Da Rock wrote: [dd] I really don't know what the security implications will be if /etc/krb5.keytab is readable by anyone besides the root user? Do you have a clue about it? There are other services' keys stored there besides svn (host/*, cvs/* etc). At the risk of getting laughed off

Re: rc.d and environment variables

2010-12-24 Thread Victor Sudakov
RW wrote: I'm not sure this will work. The initial question was about how to obtain an environmental variable. If the rc.d script of svnserve sources /etc/rc.conf and/or /etc/rc.conf.local, it is okay, They do. rc.d scripts all start by sucking in rc.subr, which

Re: rc.d and environment variables

2010-12-23 Thread Polytropon
On Thu, 23 Dec 2010 23:27:52 +0600, Victor Sudakov v...@mpeks.tomsk.su wrote: Colleagues, The svnserve daemon is started from /usr/local/etc/rc.d/svnserve. I need to pass the environment variable KRB5_KTNAME=/home/svn/svn.keytab to the daemon on start. How do I do that? If the user

Re: rc.d and environment variables

2010-12-23 Thread Jerry McAllister
On Thu, Dec 23, 2010 at 08:12:49PM +0100, Polytropon wrote: On Thu, 23 Dec 2010 23:27:52 +0600, Victor Sudakov v...@mpeks.tomsk.su wrote: Colleagues, The svnserve daemon is started from /usr/local/etc/rc.d/svnserve. I need to pass the environment variable

Re: rc.d and environment variables

2010-12-23 Thread Polytropon
On Thu, 23 Dec 2010 14:14:43 -0500, Jerry McAllister jerr...@msu.edu wrote: On Thu, Dec 23, 2010 at 08:12:49PM +0100, Polytropon wrote: On Thu, 23 Dec 2010 23:27:52 +0600, Victor Sudakov v...@mpeks.tomsk.su wrote: Colleagues, The svnserve daemon is started from

Re: rc.d and environment variables

2010-12-23 Thread Lowell Gilbert
Polytropon free...@edvax.de writes: I'm not sure this will work. The initial question was about how to obtain an environmental variable. If the rc.d script of svnserve sources /etc/rc.conf and/or /etc/rc.conf.local, it is okay, They do. rc.d scripts all start by sucking in rc.subr, which in

Re: rc.d and environment variables

2010-12-23 Thread Victor Sudakov
Polytropon wrote: The svnserve daemon is started from /usr/local/etc/rc.d/svnserve. I need to pass the environment variable KRB5_KTNAME=/home/svn/svn.keytab to the daemon on start. How do I do that? If the user corresponding to the svnservice has a login shell, which would usually be

Re: rc.d and environment variables

2010-12-23 Thread Victor Sudakov
Jerry McAllister wrote: The svnserve daemon is started from /usr/local/etc/rc.d/svnserve. I need to pass the environment variable KRB5_KTNAME=/home/svn/svn.keytab to the daemon on start. How do I do that? If the user corresponding to the svnservice has a login shell, which

Re: rc.d and environment variables

2010-12-23 Thread Polytropon
On Fri, 24 Dec 2010 09:07:35 +0600, Victor Sudakov v...@mpeks.tomsk.su wrote: I have tried putting setenv KRB5_KTNAME /home/svn/svn.keytab in ~svn/.cshrc, it does not help. Evidently the svn user's login shell is not called when /usr/local/etc/rc.d/svnserve start is called. I did already

Re: rc.d and environment variables

2010-12-23 Thread Polytropon
On Fri, 24 Dec 2010 09:13:53 +0600, Victor Sudakov v...@mpeks.tomsk.su wrote: Of course I can always write my own script or put something like su -l svn -c 'usr/local/bin/svnserve -d --listen-port=3690 bla bla' into /etc/rc.local, but the question was about the rc.d framework. Environmental

Re: rc.d and environment variables

2010-12-23 Thread Victor Sudakov
Polytropon wrote: [dd] Anyway, if svnserve is able to be passed a command string to, a setting like svnserve_flags=... -k /home/svn/svn.keytab ... No, this is not a svnserve option, it is a setting used by libsasl2 with which svnserve is linked (or even by libkrb5.so). coded in

Re: rc.d and environment variables

2010-12-23 Thread Victor Sudakov
Lowell Gilbert wrote: I'm not sure this will work. The initial question was about how to obtain an environmental variable. If the rc.d script of svnserve sources /etc/rc.conf and/or /etc/rc.conf.local, it is okay, They do. rc.d scripts all start by sucking in rc.subr, which in turn

Re: rc.d and environment variables

2010-12-23 Thread Victor Sudakov
Polytropon wrote: I have tried putting setenv KRB5_KTNAME /home/svn/svn.keytab in ~svn/.cshrc, it does not help. Evidently the svn user's login shell is not called when /usr/local/etc/rc.d/svnserve start is called. I did already assume something like that. This mechanism relies on some

Re: rc.d and environment variables

2010-12-23 Thread Victor Sudakov
Polytropon wrote: Of course I can always write my own script or put something like su -l svn -c 'usr/local/bin/svnserve -d --listen-port=3690 bla bla' into /etc/rc.local, but the question was about the rc.d framework. Environmental variables cannot be controlled by the rc.d framework,

Re: rc.d and environment variables

2010-12-23 Thread Da Rock
On 12/24/10 13:50, Victor Sudakov wrote: Polytropon wrote: Of course I can always write my own script or put something like su -l svn -c 'usr/local/bin/svnserve -d --listen-port=3690 bla bla' into /etc/rc.local, but the question was about the rc.d framework. Environmental variables