Date: Mon, 25 Mar 2002 17:34:53 +0800 From: Christopher Hall <hsw@acm.org> To: dwcjr@FreeBSD.org Cc: ports@FreeBSD.org Subject: net/samba: printing fails, smbpasswd stored in package Message-ID: <200203250934.g2P9Yrc36346@x4.tucheng.generalresources.com>
next in thread | raw e-mail | index | archive | help
A. samba2.2.3a compiled with "make package" and the package installed an a fresly installed bsd installation, printing fails. After investigation I found that "/var/spool/samba" was not created by the pkg_add. B. When I recompiled it as "make PACKAGE_BUILDING=yes package" it added my "/usr/local/private/smbpasswd" to the package. Which contained all the usernames/passwords from the machine I generated the package on. I suggest (after looking at japanese/samba) 1. Remove ".if defined(PACKAGE_BUILDING)" block from the Makefile. 2. modify pkg-plist to generate the smbpasswd file on installation and create the /var/spool/samba directory with @exec and @unexec statements. Here is my attempt at a patch - however, it puts absolute pathnames into the generated TMPPLIST. Somehow it needs to change PREFIX to %D. How about /var, is there a %LETTER for this? --- Makefile.orig Mon Mar 18 08:34:19 2002 +++ Makefile Mon Mar 25 17:14:03 2002 @@ -111,19 +111,27 @@ ${CHOWN} root:wheel ${SAMBA_PRIVATE} ; \ fi ${CHMOD} 700 ${SAMBA_PRIVATE} + if [ ! -f ${SAMBA_PRIVATE}/smbpasswd.default ] ; then \ + ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd.default ; \ + ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd.default ; \ + fi if [ ! -f ${SAMBA_PRIVATE}/smbpasswd ] ; then \ - ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd ; \ - ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd ; \ + ${CP} -p ${SAMBA_PRIVATE}/smbpasswd.default ${SAMBA_PRIVATE}/smbpasswd ; \ + ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd ; \ fi ${CHMOD} 500 ${SAMBA_PRIVATE} ${CHOWN} root:wheel ${PREFIX}/bin/smbpasswd ${CHMOD} 111 ${PREFIX}/bin/smbpasswd -.if defined(PACKAGE_BUILDING) - ${ECHO_CMD} "private/smbpasswd" >> ${TMPPLIST} - ${ECHO_CMD} "@dirrm private" >> ${TMPPLIST} -.else - ${ECHO_CMD} "@unexec ${ECHO_CMD} \"Warning: If you will *NOT* use this package anymore, please remove %D/private/smbpasswd manually.\"" >> ${TMPPLIST} -.endif + ${ECHO_CMD} "@exec ${TEST} -d ${SAMBA_SPOOL} || ${MKDIR} ${SAMBA_SPOOL} && ${CHMOD} 1777 ${SAMBA_SPOOL}" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec ${RM} -rf ${SAMBA_SPOOL}" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${MKDIR} -m 500 ${SAMBA_PRIVATE}" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CHOWN} root:wheel ${SAMBA_PRIVATE}" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CAT} /etc/passwd | ${GREP} -v "^#" | ${PREFIX}/bin/make_smbpasswd > ${SAMBA_PRIVATE}/smbpasswd.default" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${TEST} -e ${SAMBA_PRIVATE}/smbpasswd || ${CP} -p ${SAMBA_PRIVATE}/smbpasswd.default ${SAMBA_PRIVATE}/smbpasswd" >> ${TMPPLIST} + ${ECHO_CMD} "@exec ${CHMOD} 600 ${SAMBA_PRIVATE}/smbpasswd*" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec /usr/bin/cmp -s ${SAMBA_PRIVATE}/smbpasswd ${SAMBA_PRIVATE}/smbpasswd.default && ${RM} -f ${SAMBA_PRIVATE}/smbpasswd ${SAMBA_PRIVATE}/secrets.tdb || ${TRUE}" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec ${RM} -f ${SAMBA_PRIVATE}/smbpasswd.default" >> ${TMPPLIST} + ${ECHO_CMD} "@unexec ${RMDIR} ${SAMBA_PRIVATE} || (${ECHO_CMD} \"Warning: If you will *NOT* use this package anymore,\" && ${ECHO_CMD} \" please remove ${SAMBA_PRIVATE} and its contents manually.\")" >> ${TMPPLIST} .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} --- Christopher Hall <hsw@generalresources.com> Fax: +886-2-2795-3030 Christopher Hall <hsw@acm.org> Phone: +886-2-2795-5799 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203250934.g2P9Yrc36346>