diff options
Diffstat (limited to 'app-mobilephone/sobexsrv')
-rw-r--r-- | app-mobilephone/sobexsrv/Manifest | 9 | ||||
-rw-r--r-- | app-mobilephone/sobexsrv/files/conf.d_sobexsrv | 35 | ||||
-rw-r--r-- | app-mobilephone/sobexsrv/files/init.d_sobexsrv | 58 | ||||
-rw-r--r-- | app-mobilephone/sobexsrv/files/sobexsrv-1.0.1-openobex16.patch | 49 | ||||
-rw-r--r-- | app-mobilephone/sobexsrv/metadata.xml | 21 | ||||
-rw-r--r-- | app-mobilephone/sobexsrv/sobexsrv-1.0.1-r1.ebuild | 93 |
6 files changed, 265 insertions, 0 deletions
diff --git a/app-mobilephone/sobexsrv/Manifest b/app-mobilephone/sobexsrv/Manifest new file mode 100644 index 000000000000..8ee84de6e30e --- /dev/null +++ b/app-mobilephone/sobexsrv/Manifest @@ -0,0 +1,9 @@ +AUX conf.d_sobexsrv 1095 SHA256 7c7bf16790f4c813a5460566de28161c9357fc6d814f5e05228c6a7e0fab5494 SHA512 c38b6105826208c72392b7e781831ec28e93c60ba63f95e6042c3de9a3097af1e370ccdb832f1993b6e85a0224180b36a92ba97cf9af8a606044a61d9ddf7a05 WHIRLPOOL 14016caca75ed1d98352ac32e3f2a834223948a063f0bef2858aeddc08369df784d053995b2688a057f9da172935801a3a1dc959e69746602e993ff4915ad0a5 +AUX init.d_sobexsrv 1473 SHA256 35a00aeace7ed411472ed2d87b692381c65cc7f7abff45458885a2a835b6cd1c SHA512 0ab5c6020af3c8de1e7f302f1f9b1fb6c8d9f6ef8518f878c48ee396032aa96f2da148e197655a1235a072abf30767e3db8047d0c9c6d7d3606bf9ad30398ec4 WHIRLPOOL a31c0803ee167a07eb776aafb760bf24fe030c218d53036977bb9e595495b1f58d76b051e6e8a35828fdb62e12fa66be277c651426605eda27afa36d8eaffc40 +AUX sobexsrv-1.0.1-openobex16.patch 1346 SHA256 260c36989eb9a5bb877ab2d41af913ade1ddfdf70200c8f9369d3d64bfe98e2e SHA512 a1db1a916c0c2f6f237a4434bf1f11b0b6f540ad62fa9687d886e4ff97f6bb916be7763a24bdc56bf8fd3334ead426e0ed2003c0208c3c743f49b13b2bf8ab2a WHIRLPOOL d0f002f1cf9421f5a09445e8c7230c04da93e559ae778d259ac4eb6768776670263221b5a7ed324f959fe135fa4f8b162017a9a5334ece5895e9a7887550393f +DIST sobexsrv-1.0.1-fix64.patch 25040 SHA256 83e052e7a63fb53b74b81d51cd5d614a5df29626243700b632c0d14832497cf8 SHA512 9d555bee8d03c13061bbe132df6442daa4d8817ef713e92e5150b1994af110c5b01b34f8bcc1c3ae734529e36bb70f56976ab261f860e95e3de3ffe440a7b393 WHIRLPOOL 4b177c4b4afb921f6580b761ed74845ed27a800b7a0b89ea57e8ed6a28670d2499f44a92688d4c852fbd8562488cda355d5f96ae795dc4bad05a459883499f87 +DIST sobexsrv-1.0.1.tar.gz 27683 SHA256 d3b6db12eb8d0c06d0b7845ca64213e5beb042dd0f1a2e7a753cb7b4b0596069 SHA512 52fe5eff812596caa1f4b8579740ce8b2591db17950d68c093cfdb33ca5b899bfc5c142594843948a29ae0b1bdbe4499a1e24c270c92e61d02fd07a02d9d40cd WHIRLPOOL 984a9413b9e73d570918d115665220bb9beac1dd6a8afb5418eb199be7c369bf6ab81411d746ff51f6b427b2fa77045a3e9d19b2acd7b4de5d330a1c6ab33ba4 +EBUILD sobexsrv-1.0.1-r1.ebuild 1997 SHA256 4c6cb7c3022e82171d1f2eb45fed6beffd7a0f3fc34235951f614acfa2907dd2 SHA512 c6df47e37562c499f5fcdc362d463ab008af8743f0dce91ab77f1260a51041f22c5010f45d895fd19b523cef3e27af101e05e46e3ff3a6df7bc0a65b3b4add28 WHIRLPOOL 81d8d95d45a47be7cb837f0ed9b9e7a9f01f679db0f721a7bb6d94c3bf2bdc10be75dbca41fc976970b67f24c36a666ff288657df8b253cee8abd43d5eb531c4 +MISC ChangeLog 3514 SHA256 358bceb03fa7c739cba6dcfa6e3dcc903b7dd0ae4b43527c880dfa5a349f60e8 SHA512 f02198b89237ff72e7a0a9481a30ed7d3632c30c6b4eaa3b97cb6372240e33a145f1e0c829e12a7dfdb31f3f627b007c75539b401774968db190b1c10a234743 WHIRLPOOL c3b97325856c19b7f0b88ca651d396c5c7a5e24e9abb8a292ad92ec4b03869eb295a13a48e53077fbf1a2d572a46e07448fb939d47c762053b69e99fe059a11f +MISC ChangeLog-2015 3182 SHA256 561718f9ea7955eb0bcd90b8823708a1b3c11d6163435f9c84b8eea23319e34c SHA512 2b8caa4486022fe57947b918ba2f67ebe88ef33fd8738e6e60509d5d9777ecaadc67f5cba094864a10df6667d9387285a6864dddc986043a42b707491b04cb55 WHIRLPOOL 0dfec961cf4677c83f66c64a9fa684d8c28f5888fed4402fcb0ee08f6b3858ea6f4b5e118dcc26844a7ff68751c9d1cfa09cf0774758fc679c0bce8f33b73ef8 +MISC metadata.xml 917 SHA256 1188b71239d439e0047d0c9f4a2b5cbdc2770d2f8fec78cf3ec4fe62e6138bef SHA512 17a575409b2dc56ebde2b46b20db1cf65e803aa2d22f5e5044e4bfbe38b9f34d4a367be571879acf1fb8a8b3390908e1c7747481ddfc2b65c1dd7c596429cf11 WHIRLPOOL 3316774f7b84900cfca57749aa22f04da9cb4b5bb7bcbe75f0439f9e1a9be2e603f4e337eb74699ff6f082dcb2b8d2bdc00f2ced29dc6c824060c5c60159d886 diff --git a/app-mobilephone/sobexsrv/files/conf.d_sobexsrv b/app-mobilephone/sobexsrv/files/conf.d_sobexsrv new file mode 100644 index 000000000000..1afdc0c772e3 --- /dev/null +++ b/app-mobilephone/sobexsrv/files/conf.d_sobexsrv @@ -0,0 +1,35 @@ +# /etc/conf.d/sobexsrv +# Config file for sobexsrv daemon + +# owner of sobexsrv process (don't change, must be existing) +USER="sobexsrv" +GROUP="sobexsrv" + +# Incomming of pushed files +INBOX="/var/spool/sobexsrv" + +# chroot to INBOX. +# *NEEDS* the binary to be suid root (not installed by default). +#CHROOT="yes" + +# Listen on the specified RFCOMM channel. If this option is not specified the +# first available channel will be used. Legal range for channel is 1-31 and 0 +# to force auto selection of first available channel. +CHANNEL="10" + +# Set Bluetooth security mode-2 level. Legal values are: 1 (insecure) every- +# body can connect, 2 authentication required and 3 authentication and encryp- +# tion required. +SECURITY_LEVEL="2" + +# Don't register OPUSH service at local ServiceDiscoveryProtocol Server. +#DISABLE_OPUSH="yes" +# Don't register OBEX-FTP service at local ServiceDiscoveryProtocol Server. +DISABLE_OBEXFTP="yes" +DISABLE_OBEXFTP_LISTING="yes" + +# Enable transfer log via syslog(8). +USE_SYSLOG="yes" + +# Additional options. See sobexsrv(8) +#SOBEXSRV_OPT="-l NPTD -m /etc/sobexsrv-mime" diff --git a/app-mobilephone/sobexsrv/files/init.d_sobexsrv b/app-mobilephone/sobexsrv/files/init.d_sobexsrv new file mode 100644 index 000000000000..e02530314ca8 --- /dev/null +++ b/app-mobilephone/sobexsrv/files/init.d_sobexsrv @@ -0,0 +1,58 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need bluetooth + use logger +} + +check_config() { + if [ -z "${USER}" ] ; then + eerror "Please set \$USER in /etc/conf.d/sobexsrv!" + return 1 + fi + if [ -z "${GROUP}" ] ; then + eerror "Please set \$GROUP in /etc/conf.d/sobexsrv!" + return 1 + fi + + if [ ${CHROOT} = "yes" ] ; then + if [ ! -u /usr/bin/sobexsrv ] ; then + eerror "The \$CHROOT option requires /usr/bin/sobexsrv to be suid root!" + return 1 + fi + fi + + if [ -z "${INBOX}" ] || [ ! -e "${INBOX}" ] ; then + eerror "Please configure \$INBOX correctly in /etc/conf.d/sobexsrv!" + return 1 + fi +} + + +start() { + check_config || return 1 + + ebegin "Starting sobexsrv" + + OPTIONS="" + [ -n "${CHANNEL}" ] && OPTIONS="${OPTIONS} -c ${CHANNEL}" + [ -n "${SECURITY_LEVEL}" ] && OPTIONS="${OPTIONS} -s ${SECURITY_LEVEL}" + [ "${CHROOT}" = "yes" ] && OPTIONS="${OPTIONS} -R" + [ "${DISABLE_OPUSH}" = "yes" ] && OPTIONS="${OPTIONS} -o" + [ "${DISABLE_OBEXFTP}" = "yes" ] && OPTIONS="${OPTIONS} -f" + [ "${DISABLE_OBEXFTP_LISTING}" = "yes" ] && OPTIONS="${OPTIONS} -F" + [ "${USE_SYSLOG}" = "yes" ] && OPTIONS="${OPTIONS} -S" + + OPTIONS="-I -r ${INBOX} ${OPTIONS} ${SOBEXSRV_OPT}" + + start-stop-daemon --chuid ${USER}:${GROUP} --start --quiet --exec /usr/bin/sobexsrv -- $OPTIONS + eend $? +} + +stop() { + ebegin "Stopping sobexsrv" + start-stop-daemon --stop --quiet --exec /usr/bin/sobexsrv + eend $? +} diff --git a/app-mobilephone/sobexsrv/files/sobexsrv-1.0.1-openobex16.patch b/app-mobilephone/sobexsrv/files/sobexsrv-1.0.1-openobex16.patch new file mode 100644 index 000000000000..57fff87e4d2b --- /dev/null +++ b/app-mobilephone/sobexsrv/files/sobexsrv-1.0.1-openobex16.patch @@ -0,0 +1,49 @@ +--- sobexsrv-1.0.1/src/obexsrv.c.orig 2016-06-13 01:59:28.000000000 +0300 ++++ sobexsrv-1.0.1/src/obexsrv.c 2016-06-13 12:20:15.501101147 +0300 +@@ -32,6 +32,10 @@ + #include <langinfo.h> + #include <assert.h> + ++#if ((OPENOBEX_VERSION_MAJOR==1) && (OPENOBEX_VERSION_MINOR>=6)) ++#include <string.h> ++#endif ++ + #include "obexsrv.h" + #include "util.h" + #include "sdp.h" +@@ -46,7 +50,8 @@ + + void UnicodeToChar(uint8_t *c, const uint8_t *uc, int size) + { +- iconv_t dsc = iconv_open(nl_langinfo(CODESET),"UTF16BE"); ++ char *lang = nl_langinfo(CODESET); ++ iconv_t dsc = iconv_open(lang,"UTF16BE"); + size_t isiz,osiz; + char *ip = (char*)uc; + char *op = (char*)c; +@@ -54,7 +59,25 @@ + + if (iconv(dsc,&ip,&isiz,&op,&osiz) == -1) { + debug_printf("iconv: error %s\n", strerror(errno)); ++#if ((OPENOBEX_VERSION_MAJOR==1) && (OPENOBEX_VERSION_MINOR>=6)) ++ // try to convert ignoring errors ++ iconv_close(dsc); ++ debug_printf("iconv: characters that cannot be converted will be discarded\n"); ++ ++ // append "//IGNORE" ++ const char *const suf = "//IGNORE"; ++ size_t len = strlen(lang); ++ char *cd = malloc(len + 9); ++ memcpy(cd, lang, len); ++ memcpy(cd+len, suf, 8); ++ cd[len+8] = '\0'; ++ ++ dsc = iconv_open(cd,"UTF16BE"); ++ iconv(dsc,&ip,&isiz,&op,&osiz); ++ free(cd); ++#else + OBEX_UnicodeToChar(c,uc,size); ++#endif + } + iconv_close(dsc); + } diff --git a/app-mobilephone/sobexsrv/metadata.xml b/app-mobilephone/sobexsrv/metadata.xml new file mode 100644 index 000000000000..2988986f18be --- /dev/null +++ b/app-mobilephone/sobexsrv/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>bircoph@gentoo.org</email> + <name>Andrew Savchenko</name> + </maintainer> + <longdescription> + sobexsrv is a Bluetooth OBEX server with Bluetooth Security + Mode-2 (application triggered security) support. It implements + OPUSH (put), OPULL (get) and OBEX-FTP (setpath + directory + listing) and therefore is a full OBEX server. Further it + supports pulling generic mime-types and provides a capability + object. sobexsrv was designed with flexibility and security in + mind and supports chroot (if suid root drop to calling uid + immediately). For flexibility a scripting interface provides + access to all functionalities of the server and therefore + allows implementation of further OBEX services on top of + sobexsrv. + </longdescription> +</pkgmetadata> diff --git a/app-mobilephone/sobexsrv/sobexsrv-1.0.1-r1.ebuild b/app-mobilephone/sobexsrv/sobexsrv-1.0.1-r1.ebuild new file mode 100644 index 000000000000..14cde193148e --- /dev/null +++ b/app-mobilephone/sobexsrv/sobexsrv-1.0.1-r1.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python2_7 ) + +inherit python-single-r1 toolchain-funcs user + +MY_P="${P/_pre/pre}" + +DESCRIPTION="Scripting/Secure OBEX Server (for BlueZ Linux)" +SRC_URI="http://www.mulliner.org/bluetooth/${MY_P}.tar.gz + https://dev.gentoo.org/~joker/${P}-fix64.patch" +HOMEPAGE="http://www.mulliner.org/bluetooth/sobexsrv.php" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="amd64 ppc x86" +IUSE="gtk" + +DEPEND=" + dev-libs/openobex + net-wireless/bluez + gtk? ( ${PYTHON_DEPS} )" +RDEPEND="${DEPEND} + gtk? ( + ${PYTHON_DEPS} + >=dev-python/pygtk-2.2 + )" +REQUIRED_USE=" + gtk? ( ${PYTHON_REQUIRED_USE} )" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${DISTDIR}/${P}"-fix64.patch + "${FILESDIR}/${P}"-openobex16.patch +) + +pkg_setup() { + use gtk && python-single-r1_pkg_setup + + enewgroup sobexsrv + enewuser sobexsrv -1 -1 /var/spool/sobexsrv sobexsrv +} + +src_prepare() { + default + + sed -e 's:/usr/man/man8:/usr/share/man/man8:' \ + -e 's/install: all/install:/' \ + -i Makefile || die + + sed -e 's/^CFLAGS =/CFLAGS +=/' \ + -e 's/^CC =/CC ?=/' \ + -e 's/$(CC) $(CFLAGS)/$(CC) $(LDFLAGS) $(CFLAGS)/' \ + -i src/Makefile || die +} + +src_compile() { + tc-export CC + emake -C src +} + +src_install() { + default + dodoc AUTHOR CONFIG SECURITY THANKS + + if use gtk; then + python_doscript "${D}/usr/bin/sobexsrv_handler" + newdoc "${S}/scripts/test" sobexsrv_handler.sample_script + else + rm "${D}/usr/bin/sobexsrv_handler" || die + fi + + newinitd "${FILESDIR}/init.d_sobexsrv" sobexsrv + newconfd "${FILESDIR}/conf.d_sobexsrv" sobexsrv + + keepdir /var/spool/sobexsrv + fowners sobexsrv:sobexsrv /var/spool/sobexsrv +} + +pkg_postinst() { + elog + elog "/usr/bin/sobexsrv is *NOT* installed set-uid root by" + elog "default. suid is required for the chroot option (-R)." + elog + elog "Execute the following commands to enable suid:" + elog + elog "chown root:sobexsrv /usr/bin/sobexsrv" + elog "chmod 4710 /usr/bin/sobexsrv" + elog +} |