diff --git a/.patches/ncpfs-2.2.6-r6/ncpfs-2.2.6-no-suid-root.patch b/.patches/ncpfs-2.2.6-r6/ncpfs-2.2.6-no-suid-root.patch new file mode 100644 index 0000000..050de30 --- /dev/null +++ b/.patches/ncpfs-2.2.6-r6/ncpfs-2.2.6-no-suid-root.patch @@ -0,0 +1,16 @@ +Description: Don't install utils as suid root +Author: Bastian Blank +Bug-Debian: http://bugs.debian.org/692929 + +--- ncpfs-2.2.6.orig/sutil/Makefile.in ++++ ncpfs-2.2.6/sutil/Makefile.in +@@ -51,7 +51,7 @@ all: $(UTILS) + install: all + ${INSTALL} -d $(DESTDIR)$(bindir) + ${INSTALL} -d $(DESTDIR)/sbin +- ${INSTALL} -m 4755 $(UTILS) $(DESTDIR)$(bindir) ++ ${INSTALL} $(UTILS) $(DESTDIR)$(bindir) + ifeq ($(USE_KERNEL),1) + ln -sf $(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncp + ln -sf $(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncpfs + diff --git a/sutil/Makefile.in b/sutil/Makefile.in index 6ae4d68..ceeecd3 100644 --- a/sutil/Makefile.in +++ b/sutil/Makefile.in @@ -51,7 +51,7 @@ all: $(UTILS) install: all ${INSTALL} -d $(DESTDIR)$(bindir) ${INSTALL} -d $(DESTDIR)/sbin - ${INSTALL} -m 4755 $(UTILS) $(DESTDIR)$(bindir) + ${INSTALL} $(UTILS) $(DESTDIR)$(bindir) ifeq ($(USE_KERNEL),1) ln -sf ..$(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncp ln -sf ..$(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncpfs diff --git a/sutil/Makefile.in.orig b/sutil/Makefile.in.orig new file mode 100644 index 0000000..6ae4d68 --- /dev/null +++ b/sutil/Makefile.in.orig @@ -0,0 +1,111 @@ +# +# Makefile for the linux ncp-filesystem routines. +# + +top_srcdir = @top_srcdir@ +top_builddir = .. +this_srcdir = ${top_srcdir}/sutil + +include ${top_builddir}/Make.rules + +vpath %.c ${this_srcdir} + +USE_KERNEL = @USE_KERNEL@ +NDS_SUPPORT = @NDS_SUPPORT@ + +LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@ + +# environ in ncpmount +CCFLAGS += -D_GNU_SOURCE + +PIE_CFLAGS = -fpie +PIE_LDFLAGS = -pie + +O_UTILS := nwsfind.o +ifeq ($(USE_KERNEL),1) +O_UTILS += ncpmount.o ncpumount.o +ifeq ($(NDS_SUPPORT),1) +O_UTILS += ncplogin.o +endif +endif +UTILS := $(O_UTILS:%.o=%) +ifeq ($(USE_KERNEL),1) +ifeq ($(NDS_SUPPORT),1) +UTILS += ncpmap +endif +endif + +CFLAGS_ncpmount.o = -DNCPMOUNT=1 -DMAKE_NCPLIB +CFLAGS_ncpmap.o = -DNCPMAP=1 -DMAKE_NCPLIB +CFLAGS_ncplogin.o = -DMAKE_NCPLIB +CFLAGS_ncpm_common.o = -DNWMSG=\"$(sbindir)/nwmsg\" + +.PHONY : all install install-dev dep clean mrproper distclean +.PHONY : default + +default: + make -C .. + +all: $(UTILS) + +install: all + ${INSTALL} -d $(DESTDIR)$(bindir) + ${INSTALL} -d $(DESTDIR)/sbin + ${INSTALL} -m 4755 $(UTILS) $(DESTDIR)$(bindir) +ifeq ($(USE_KERNEL),1) + ln -sf ..$(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncp + ln -sf ..$(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncpfs + ln -sf ncpumount $(DESTDIR)$(bindir)/ncplogout +endif + +install-dev: + +$(O_UTILS): %.o: %.c + $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $< + +$(O_UTILS:.o=.d): %.d: %.c + set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ + | sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \ + [ -s $@ ] || rm -f $@ + +ncpmount: ncpm_common.o mount_login.o +ncplogin: ncpm_common.o mount_login.o +ncpmap: ncpm_common.o + +ncpmap.o: %.o: ncplogin.c + $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $< + +ncpmap.d: %.d: ncplogin.c + set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ + | sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \ + [ -s $@ ] || rm -f $@ + +ncpm_common.o mount_login.o: %.o: %.c + $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $< + +ncpm_common.d mount_login.d: %.d: %.c + set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ + | sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \ + [ -s $@ ] || rm -f $@ + +$(UTILS): %: %.o ../lib/libncp.$(libext) + $(CC) @GC_SECTIONS@-o $@ $^ $(PIE_LDFLAGS) ${LIBS} + +../lib/libncp.$(libext): + make -C ../lib libncp.$(libext) + +dep: + +clean: + rm -f *.o *~ core $(UTILS) + +mrproper: clean + rm -f *.d + +distclean: mrproper + +ifeq ($(NEED_DEP),yes) +include $(UTILS:%=%.d) +include ncpm_common.d +endif +