This patch will fix the shellinabox rc script to allow for passing of user and group through variables set in rc.conf. This patch honors existing configs by defaulting to shellinabox as user/group.
Maintainer of www/shellinabox, Please note that PR ports/151314 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/151314 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Responsible Changed From-To: freebsd-ports-bugs->sunpoet I'll take it.
On Sun, Oct 10, 2010 at 08:19:52AM +0200, Olivier Cochard-Labb wrote: > On Sat, Oct 9, 2010 at 4:19 PM, <sunpoet@freebsd.org> wrote: > > Synopsis: www/shellinabox: update rc script to allow passing of user/group > > > > Responsible-Changed-From-To: freebsd-ports-bugs->sunpoet > > Responsible-Changed-By: sunpoet > > Responsible-Changed-When: Sat Oct 9 14:19:21 UTC 2010 > > Responsible-Changed-Why: > > I'll take it. > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=151314 > > > > This patch is OK, how should I proceed now: > - Re-summit a full shar of the patched port ? > - Re-summit a full diff of the port ? > - Saying that this patch is OK is enough ? > > Thanks, > > Olivier Hi Olivier, I've tested the patch. It works fine. While I'm here, I would like to do some modification. My modified patch is attached. It utilizes ETCDIR and merges post-install: to do-install:. Please review it. Thanks. Regards, sunpoet --- shellinabox.patch begins here --- Index: Makefile =================================================================== RCS file: /home/ncvs/ports/www/shellinabox/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 16 Aug 2010 00:04:03 -0000 1.3 +++ Makefile 11 Oct 2010 11:33:30 -0000 @@ -9,8 +9,7 @@ PORTVERSION= 2.10 PORTREVISION= 2 CATEGORIES= www -MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} -DISTNAME= ${PORTNAME}-${PORTVERSION} +MASTER_SITES= GOOGLE_CODE MAINTAINER= olivier@cochard.me COMMENT= Publish command line shell through AJAX interface @@ -25,8 +24,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING USE_RC_SUBR= shellinaboxd -USERS= shellinabox -GROUPS= shellinabox +USERS?= shellinabox +GROUPS?= shellinabox MAN1= shellinaboxd.1 @@ -35,18 +34,17 @@ PKGDEINSTALL= ${WRKDIR}/pkg-deinstall SUB_FILES= pkg-deinstall - -post-install: - @${MKDIR} ${PREFIX}/etc/shellinabox - @${CHMOD} 700 ${PREFIX}/etc/shellinabox - @${CHOWN} ${USERS}:${GROUPS} ${PREFIX}/etc/shellinabox - ${INSTALL_MAN} ${WRKSRC}/shellinaboxd.1 ${PREFIX}/man/man1 +SUB_LIST= USERS=${USERS} GROUPS=${GROUPS} do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/shellinaboxd ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/shellinaboxd ${PREFIX}/bin/ .if !defined(NOPORTDOCS) - ${MKDIR} ${DOCSDIR} - cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} + ${MKDIR} ${DOCSDIR}/ + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}/ .endif + ${MKDIR} ${ETCDIR}/ + ${CHMOD} 700 ${ETCDIR}/ + ${CHOWN} ${USERS}:${GROUPS} ${ETCDIR}/ + ${INSTALL_MAN} ${WRKSRC}/shellinaboxd.1 ${MANPREFIX}/man/man1/ .include <bsd.port.mk> Index: files/shellinaboxd.in =================================================================== RCS file: /home/ncvs/ports/www/shellinabox/files/shellinaboxd.in,v retrieving revision 1.2 diff -u -r1.2 shellinaboxd.in --- files/shellinaboxd.in 16 Aug 2010 00:04:03 -0000 1.2 +++ files/shellinaboxd.in 11 Oct 2010 11:33:30 -0000 @@ -16,8 +16,10 @@ # You can fine tune others variables too: # shellinaboxd_fib="NONE" # shellinaboxd_pidfile="/var/run/shellinabox.pid" +# shellinaboxd_user="%%USERS%%" +# shellinaboxd_group="%%GROUPS%%" # shellinaboxd_port="4200" -# shellinaboxd_certdir="%%PREFIX%%/etc/shellinabox" +# shellinaboxd_certdir="%%ETCDIR%%" # shellinaboxd_certfile="" # Example: shellinaboxd_certfile="/your/cert.pem" # shellinaboxd_flags="" @@ -46,12 +48,14 @@ shellinaboxd_enable=${shellinaboxd_enable:-"NO"} shellinaboxd_fib=${shellinaboxd_fib:-"NONE"} +shellinaboxd_user=${shellinaboxd_user:-"%%USERS%%"} +shellinaboxd_group=${shellinaboxd_group:-"%%GROUPS%%"} shellinaboxd_port=${shellinaboxd_port:-"4200"} -shellinaboxd_certdir=${shellinaboxd_certdir:-"%%PREFIX%%/etc/shellinabox"} +shellinaboxd_certdir=${shellinaboxd_certdir:-"%%ETCDIR%%"} pidfile=${shellinaboxd_pidfile:-"/var/run/shellinaboxd.pid"} -command_args="--group=shellinabox --user=shellinabox --port=${shellinaboxd_port} --background=${pidfile}" +command_args="--user=${shellinaboxd_user} --group=${shellinaboxd_group} --port=${shellinaboxd_port} --background=${pidfile}" if [ "${shellinaboxd_certfile}" = "" ]; then required_dirs="${shellinaboxd_certdir}" --- shellinabox.patch ends here --- -- 4096R/CC57E36B 8AD8 68F2 7D2B 0A10 7E9B 8CC0 DC44 247E CC57 E36B Sunpoet Po-Chuan Hsieh <sunpoet at sunpoet.net>, <sunpoet at FreeBSD.org>
On Mon, Oct 11, 2010 at 1:34 PM, Sunpoet Po-Chuan Hsieh <sunpoet@sunpoet.net> wrote: > > =A0I've tested the patch. It works fine. While I'm here, I would like to = do > =A0some modification. My modified patch is attached. It utilizes ETCDIR a= nd > =A0merges post-install: to do-install:. Please review it. Thanks. > I didn't reach to apply your diff (have strange =AB3D=BB characters in place of tab the diff file), but the patch seems OK. Regards, --=20 http://freenas.org http://bsdrp.net
sunpoet 2010-10-13 12:50:07 UTC FreeBSD ports repository Modified files: www/shellinabox Makefile www/shellinabox/files shellinaboxd.in Log: - Update rc.d script: add user/group variables - Use ETCDIR - Minor cleanups: remove DISTNAME, merge post-install: to do-install: PR: ports/151314 Submitted by: Eric F Crist <ecrist@secure-computing.net> Approved by: Olivier Cochard-Labb <olivier@cochard.me> (maintainer), pgollucci (mentor, implicit) Revision Changes Path 1.4 +11 -13 ports/www/shellinabox/Makefile 1.3 +8 -4 ports/www/shellinabox/files/shellinaboxd.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->closed Committed, with minor changes. Thanks!
Hi all, It seems this patch has slightly broken shellinabox. Previously one could use shellinaboxd_certfile="..." to start shellinabox with a root-owned pem file. Now shellinabox will perform switching to the target user twice, since the _user and _group flags will cause rc.subr to call the command with su. I've solved it by changing the script to do this: shellinaboxd_user= shellinaboxd_group= run_rc_command "$1" Would it still be possible to get this fixed before 9.0? -- Ed Schouten <ed@80386.nl> WWW: http://80386.nl/
State Changed From-To: closed->open This PR still has an unanswered comment at the bottom.
Hi all, I'm using shellinabox in a very simple maner, this is why I didn't detect this problem. Sorry. Ed: Can you confirm that the patch attached is what you are looking for ? Regards, Olivier
* Olivier Cochard-Labbé <olivier@cochard.me>, 20111021 10:17: > I'm using shellinabox in a very simple maner, this is why I didn't > detect this problem. > Sorry. > > Ed: Can you confirm that the patch attached is what you are looking for ? It works. Thanks! :-) -- Ed Schouten <ed@80386.nl> WWW: http://80386.nl/
Hi, I was thinking, maybe it's a bit more elegant if we used `unset var' instead of `var='? -- Ed Schouten <ed@80386.nl> WWW: http://80386.nl/
2011/10/21 Ed Schouten <ed@80386.nl>: > Hi, > > I was thinking, maybe it's a bit more elegant if we used `unset var' > instead of `var='? > If sunpoet is agree with this more elegant solution, I'm agree too. Regards, Olivier
State Changed From-To: open->closed Committed. Thanks!