Index: Mk/bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.687 diff -u -r1.687 bsd.port.mk --- Mk/bsd.port.mk 3 Jul 2011 15:51:18 -0000 1.687 +++ Mk/bsd.port.mk 13 Jul 2011 22:33:56 -0000 @@ -1064,7 +1064,9 @@ # If the deduction fails, you will have to set Categories # manually. You should check the generated value using # "make desktop-categories", and override it if necessary. -# * Exec will also be used to name the .desktop file. +# * Exec will also be used to name the .desktop file. Only +# alphanumeric characters, "-", and "_" are allowed after +# basename(1) is executed on it. # * The files will be automatically added to ${PLIST}. # Example: # "X Window Information" \ @@ -6389,6 +6391,11 @@ if [ -z "$$4" ]; then \ ${ECHO_MSG} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) is empty"; \ exit 1; \ + else \ + if [ -n "`${BASENAME} "$$4" | ${TR} -d '[:alnum:]-_'`" ]; then \ + ${ECHO_CMD} "${PKGNAME}: Makefile error: in desktop entry $$entry: field 4 (Exec) has a disallowed character"; \ + exit 1; \ + fi; \ fi; \ if [ -n "$$5" ]; then \ for c in `${ECHO_CMD} "$$5" | ${TR} ';' ' '`; do \ @@ -6432,7 +6439,7 @@ ${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \ fi; \ while [ $$# -gt 6 ]; do \ - filename="`${ECHO_CMD} "$$4" | ${TR} -cd [:alnum:]`.desktop"; \ + filename="`${BASENAME} "$$4"`.desktop"; \ pathname="${DESKTOPDIR}/$$filename"; \ categories="$$5"; \ if [ -z "$$categories" ]; then \