diff --git a/.gitignore b/.gitignore index 7ed27ae..b82045c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/star-1.5.2.tar.bz2 +/star-1.5.3.tar.bz2 diff --git a/sources b/sources index cdc0138..3965f68 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5c15cedb52e26b02b95c82de08c5fcc1 star-1.5.2.tar.bz2 +46ef6425082e60966ec9d33f73fd44b0 star-1.5.3.tar.bz2 diff --git a/star-1.5-newMake.patch b/star-1.5-newMake.patch deleted file mode 100644 index f41a0bd..0000000 --- a/star-1.5-newMake.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- star-1.5/DEFAULTS/Defaults.linux.fix 2007-08-23 13:35:54.000000000 +0200 -+++ star-1.5/DEFAULTS/Defaults.linux 2007-08-23 13:51:33.000000000 +0200 -@@ -8,8 +8,8 @@ - # Compiler stuff - # - ########################################################################### --DEFCCOM= cc --#DEFCCOM= gcc -+#DEFCCOM= cc -+DEFCCOM= gcc - - ########################################################################### - # -@@ -40,22 +40,21 @@ __LINUX_SRC_INCLUDE= $(_LINUX_SRC_INCLUD - LINUX_SRC_INCLUDE= $(__LINUX_SRC_INCLUDE:$(_UNIQ)no%=%) - - DEFINCDIRS= $(SRCROOT)/include --LDPATH= -L/opt/schily/lib --#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) --RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -+LDPATH= -+RUNPATH= - - ########################################################################### - # - # Installation config stuff - # - ########################################################################### --INS_BASE= /opt/schily --INS_KBASE= / --INS_RBASE= / -+INS_BASE= $(RPM_INSTALLDIR)/usr/ -+INS_KBASE= $(RPM_INSTALLDIR)/ -+INS_RBASE= $(RPM_INSTALLDIR)/ - # - DEFUMASK= 002 - # - DEFINSMODEF= 444 - DEFINSMODEX= 755 - DEFINSUSR= root --DEFINSGRP= bin -+DEFINSGRP= root diff --git a/star-1.5.2-selinux.patch b/star-1.5.2-selinux.patch deleted file mode 100644 index edcd246..0000000 --- a/star-1.5.2-selinux.patch +++ /dev/null @@ -1,272 +0,0 @@ -diff --git a/autoconf/configure.in b/autoconf/configure.in -index 1465ce1..3046a62 100644 ---- a/autoconf/configure.in -+++ b/autoconf/configure.in -@@ -817,6 +817,15 @@ AC_CHECK_FUNCS(sched_yield) - AC_CHECK_FUNCS(nanosleep) - LIBS="$ac_save_LIBS" - -+AC_CHECK_HEADERS(selinux/selinux.h) -+if test "$ac_cv_header_selinux_selinux_h" = yes; then -+ AC_CHECKING(for SELinux support) -+ AC_CHECK_LIB(selinux, is_selinux_enabled, lib_selinux="-lselinux -lattr") -+ ac_save_LIBS="$LIBS" -+ LIBS="$LIBS $lib_selinux" -+ AC_CHECK_FUNCS(is_selinux_enabled) -+fi -+ - dnl Misc OS checks. - AC_CHECK_FILES(/dev/tty /dev/null /dev/zero) - AC_CHECK_FILES(/dev/stdin /dev/stdout /dev/stderr) -@@ -894,6 +903,7 @@ AC_SUBST(lib_secdb) - AC_SUBST(lib_gen) - AC_SUBST(lib_pthread) - AC_SUBST(lib_rt) -+AC_SUBST(lib_selinux) - AC_SUBST(lib_dl) - AC_SUBST(lib_dir) - -diff --git a/autoconf/rules.cnf.in b/autoconf/rules.cnf.in -index 6de994c..31b1575 100644 ---- a/autoconf/rules.cnf.in -+++ b/autoconf/rules.cnf.in -@@ -30,5 +30,6 @@ LIB_SECDB = @lib_secdb@ - LIB_GEN = @lib_gen@ - LIB_PTHREAD = @lib_pthread@ - LIB_RT = @lib_rt@ -+LIB_SELINUX = @lib_selinux@ - LIB_DL= @lib_dl@ - LIB_DIR= @lib_dir@ -diff --git a/star/cpio.mk b/star/cpio.mk -index ec48a95..8a2c7a0 100644 ---- a/star/cpio.mk -+++ b/star/cpio.mk -@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND - CPPOPTS += -DUSE_ACL - CPPOPTS += -DUSE_XATTR - CPPOPTS += -DUSE_FFLAGS -+CPPOPTS += -DWITH_SELINUX - CPPOPTS += -DSCHILY_PRINT - CFILES= cpio.c header.c cpiohdr.c xheader.c xattr.c \ - list.c extract.c create.c append.c diff.c restore.c \ -@@ -34,7 +35,7 @@ CFILES= cpio.c header.c cpiohdr.c xheader.c xattr.c \ - HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ - movearch.h table.h props.h fifo.h diff.h \ - checkerr.h dumpdate.h bitstring.h --LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) -+LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) - XMK_FILE= scpioman.mk - - ########################################################################### -diff --git a/star/extract.c b/star/extract.c -index 9a83bf4..3d68c43 100644 ---- a/star/extract.c -+++ b/star/extract.c -@@ -253,6 +253,17 @@ extern struct WALK walkstate; - continue; - } - #endif -+ -+#ifdef WITH_SELINUX -+ if (!to_stdout && selinux_enabled) { -+ if (setselinux(&finfo) == FALSE) { -+ errmsgno(EX_BAD, -+ "Can not setup security context for '%s'. Not created.\n", -+ finfo.f_name); -+ } -+ } -+#endif -+ - if (finfo.f_flags & F_BAD_META) { - if (!void_bad(&finfo)) - break; -diff --git a/star/gnutar.mk b/star/gnutar.mk -index d0da54b..9c5de30 100644 ---- a/star/gnutar.mk -+++ b/star/gnutar.mk -@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND - CPPOPTS += -DUSE_ACL - CPPOPTS += -DUSE_XATTR - CPPOPTS += -DUSE_FFLAGS -+CPPOPTS += -DWITH_SELINUX - CPPOPTS += -DSCHILY_PRINT - CFILES= gnutar.c header.c cpiohdr.c xheader.c xattr.c \ - list.c extract.c create.c append.c diff.c restore.c \ -@@ -34,7 +35,7 @@ CFILES= gnutar.c header.c cpiohdr.c xheader.c xattr.c \ - HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ - movearch.h table.h props.h fifo.h diff.h \ - checkerr.h dumpdate.h bitstring.h --LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) -+LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) - XMK_FILE= gnutarman.mk - - ########################################################################### -diff --git a/star/pax.mk b/star/pax.mk -index 0254e77..15c8ea0 100644 ---- a/star/pax.mk -+++ b/star/pax.mk -@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND - CPPOPTS += -DUSE_ACL - CPPOPTS += -DUSE_XATTR - CPPOPTS += -DUSE_FFLAGS -+CPPOPTS += -DWITH_SELINUX - CPPOPTS += -DPAX - CPPOPTS += -DSCHILY_PRINT - CFILES= pax.c header.c cpiohdr.c xheader.c xattr.c \ -@@ -35,7 +36,7 @@ CFILES= pax.c header.c cpiohdr.c xheader.c xattr.c \ - HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ - movearch.h table.h props.h fifo.h diff.h \ - checkerr.h dumpdate.h bitstring.h --LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) -+LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) - XMK_FILE= spaxman.mk - - ########################################################################### -diff --git a/star/star.c b/star/star.c -index 7b58964..fe9d984 100644 ---- a/star/star.c -+++ b/star/star.c -@@ -46,6 +46,10 @@ static UConst char sccsid[] = - #include "starsubs.h" - #include "checkerr.h" - -+#ifdef WITH_SELINUX -+int selinux_enabled=0; -+#endif -+ - EXPORT int main __PR((int ac, char **av)); - LOCAL void star_create __PR((int ac, char *const *av)); - LOCAL void checkdumptype __PR((GINFO *gp)); -@@ -399,6 +403,10 @@ main(ac, av) - comerr("Panic cannot set back effective uid.\n"); - } - my_uid = geteuid(); -+ -+#ifdef WITH_SELINUX -+ selinux_enabled=is_selinux_enabled()>0; -+#endif - /* - * WARNING: We now are no more able to open a new remote connection - * unless we have been called by root. -diff --git a/star/star.mk b/star/star.mk -index a6f6cff..68d3482 100644 ---- a/star/star.mk -+++ b/star/star.mk -@@ -21,6 +21,7 @@ CPPOPTS += -DUSE_XATTR - CPPOPTS += -DUSE_FFLAGS - CPPOPTS += -DCOPY_LINKS_DELAYED - CPPOPTS += -DSCHILY_PRINT -+CPPOPTS += -DWITH_SELINUX - CFILES= star.c header.c cpiohdr.c xheader.c xattr.c \ - list.c extract.c create.c append.c diff.c restore.c \ - remove.c star_unix.c acl_unix.c acltext.c fflags.c \ -@@ -35,7 +36,7 @@ CFILES= star.c header.c cpiohdr.c xheader.c xattr.c \ - HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ - movearch.h table.h props.h fifo.h diff.h restore.h \ - checkerr.h dumpdate.h bitstring.h --LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) -+LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) - XMK_FILE= Makefile.man starformatman.mk - - ########################################################################### -diff --git a/star/star_fat.mk b/star/star_fat.mk -index 1975c94..507fbee 100644 ---- a/star/star_fat.mk -+++ b/star/star_fat.mk -@@ -29,6 +29,7 @@ CPPOPTS += -DUSE_FFLAGS - CPPOPTS += -DCOPY_LINKS_DELAYED - CPPOPTS += -DSTAR_FAT - CPPOPTS += -DSCHILY_PRINT -+CPPOPTS += -DWITH_SELINUX - CFILES= star_fat.c header.c cpiohdr.c xheader.c xattr.c \ - list.c extract.c create.c append.c diff.c restore.c \ - remove.c star_unix.c acl_unix.c acltext.c fflags.c \ -@@ -48,7 +49,7 @@ HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ - - #LIBS= -lunos - #LIBS= -lschily -lc /usr/local/lib/gcc-gnulib --LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) -+LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) - # - # Wenn -lfind, dann auch $(LIB_INTL) - # -diff --git a/star/starsubs.h b/star/starsubs.h -index a914ade..1e2a233 100644 ---- a/star/starsubs.h -+++ b/star/starsubs.h -@@ -317,6 +317,11 @@ extern void opt_xattr __PR((void)); - extern BOOL get_xattr __PR((register FINFO *info)); - extern BOOL set_xattr __PR((register FINFO *info)); - extern void free_xattr __PR((star_xattr_t **xattr)); -+# ifdef WITH_SELINUX -+#include -+extern BOOL setselinux __PR((register FINFO *info)); -+extern int selinux_enabled; -+# endif - #endif - - /* -diff --git a/star/suntar.mk b/star/suntar.mk -index 5690c9f..f781f63 100644 ---- a/star/suntar.mk -+++ b/star/suntar.mk -@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND - CPPOPTS += -DUSE_ACL - CPPOPTS += -DUSE_XATTR - CPPOPTS += -DUSE_FFLAGS -+CPPOPTS += -DWITH_SELINUX - CPPOPTS += -DSCHILY_PRINT - CFILES= suntar.c header.c cpiohdr.c xheader.c xattr.c \ - list.c extract.c create.c append.c diff.c restore.c \ -@@ -34,7 +35,7 @@ CFILES= suntar.c header.c cpiohdr.c xheader.c xattr.c \ - HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ - movearch.h table.h props.h fifo.h diff.h \ - checkerr.h dumpdate.h bitstring.h --LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) -+LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) - XMK_FILE= suntarman.mk - - ########################################################################### -diff --git a/star/xattr.c b/star/xattr.c -index 1462950..6493447 100644 ---- a/star/xattr.c -+++ b/star/xattr.c -@@ -196,6 +196,27 @@ fail: - #endif /* USE_XATTR */ - } - -+#ifdef WITH_SELINUX -+EXPORT BOOL -+setselinux(info) -+ register FINFO *info; -+{ -+#if defined(USE_XATTR) && defined(HAVE_SETXATTR) && defined(WITH_SELINUX) -+ if (info->f_xattr) { -+ star_xattr_t *xap; -+ for (xap = info->f_xattr; xap->name != NULL; xap++) { -+ if (strcmp(xap->name, "security.selinux") == 0) { -+ if (setfscreatecon(xap->value)) { -+ return FALSE; -+ } -+ } -+ } -+ } -+#endif /* USE_XATTR && WITH_SELINUX */ -+ return TRUE; -+} -+#endif -+ - /* ARGSUSED */ - EXPORT BOOL - set_xattr(info) -@@ -209,6 +230,10 @@ set_xattr(info) - return (TRUE); - - for (xap = info->f_xattr; xap->name != NULL; xap++) { -+#ifdef WITH_SELINUX -+ if (selinux_enabled && (strcmp(xap->name, "security.selinux") == 0)) -+ continue; -+#endif - if (lsetxattr(info->f_name, xap->name, xap->value, - xap->value_len, 0) != 0) { - if (!errhidden(E_SETXATTR, info->f_name)) { diff --git a/star-1.5.3-selinux.patch b/star-1.5.3-selinux.patch new file mode 100644 index 0000000..2787af1 --- /dev/null +++ b/star-1.5.3-selinux.patch @@ -0,0 +1,273 @@ +diff --git a/autoconf/configure.in b/autoconf/configure.in +index fc9f880..30383e4 100644 +--- a/autoconf/configure.in ++++ b/autoconf/configure.in +@@ -906,6 +906,15 @@ LIBS="$LIBS $lib_cap" + AC_CHECK_FUNCS(cap_get_proc cap_set_proc cap_set_flag cap_clear_flag) + LIBS="$ac_save_LIBS" + ++AC_CHECK_HEADERS(selinux/selinux.h) ++if test "$ac_cv_header_selinux_selinux_h" = yes; then ++ AC_CHECKING(for SELinux support) ++ AC_CHECK_LIB(selinux, is_selinux_enabled, lib_selinux="-lselinux -lattr") ++ ac_save_LIBS="$LIBS" ++ LIBS="$LIBS $lib_selinux" ++ AC_CHECK_FUNCS(is_selinux_enabled) ++fi ++ + dnl Misc OS checks. + AC_CHECK_FILES(/dev/tty /dev/null /dev/zero) + AC_CHECK_FILES(/dev/stdin /dev/stdout /dev/stderr) +@@ -992,6 +1001,7 @@ AC_SUBST(lib_secdb) + AC_SUBST(lib_gen) + AC_SUBST(lib_pthread) + AC_SUBST(lib_rt) ++AC_SUBST(lib_selinux) + AC_SUBST(lib_dl) + AC_SUBST(lib_dir) + AC_SUBST(lib_cap) +diff --git a/autoconf/rules.cnf.in b/autoconf/rules.cnf.in +index affcb5c..2b7bff2 100644 +--- a/autoconf/rules.cnf.in ++++ b/autoconf/rules.cnf.in +@@ -34,6 +34,7 @@ LIB_SECDB = @lib_secdb@ + LIB_GEN = @lib_gen@ + LIB_PTHREAD = @lib_pthread@ + LIB_RT = @lib_rt@ ++LIB_SELINUX = @lib_selinux@ + LIB_DL= @lib_dl@ + LIB_DIR= @lib_dir@ + LIB_CAP= @lib_cap@ +diff --git a/star/cpio.mk b/star/cpio.mk +index 37a6dd2..8bfc3bd 100644 +--- a/star/cpio.mk ++++ b/star/cpio.mk +@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND + CPPOPTS += -DUSE_ACL + CPPOPTS += -DUSE_XATTR + CPPOPTS += -DUSE_FFLAGS ++CPPOPTS += -DWITH_SELINUX + CPPOPTS += -DSCHILY_PRINT + CFILES= cpio.c header.c cpiohdr.c xheader.c xattr.c \ + list.c extract.c create.c append.c diff.c restore.c \ +@@ -34,7 +35,7 @@ CFILES= cpio.c header.c cpiohdr.c xheader.c xattr.c \ + HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + movearch.h table.h props.h fifo.h diff.h \ + checkerr.h dumpdate.h bitstring.h pathname.h +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) $(LIB_SELINUX) + XMK_FILE= scpioman.mk + + ########################################################################### +diff --git a/star/extract.c b/star/extract.c +index cf60154..98842e1 100644 +--- a/star/extract.c ++++ b/star/extract.c +@@ -256,6 +256,17 @@ extern struct WALK walkstate; + continue; + } + #endif ++ ++#ifdef WITH_SELINUX ++ if (!to_stdout && selinux_enabled) { ++ if (setselinux(&finfo) == FALSE) { ++ errmsgno(EX_BAD, ++ "Can not setup security context for '%s'. Not created.\n", ++ finfo.f_name); ++ } ++ } ++#endif ++ + if (finfo.f_flags & F_BAD_META) { + if (!void_bad(&finfo)) + break; +diff --git a/star/gnutar.mk b/star/gnutar.mk +index 1a296e1..6595aa2 100644 +--- a/star/gnutar.mk ++++ b/star/gnutar.mk +@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND + CPPOPTS += -DUSE_ACL + CPPOPTS += -DUSE_XATTR + CPPOPTS += -DUSE_FFLAGS ++CPPOPTS += -DWITH_SELINUX + CPPOPTS += -DSCHILY_PRINT + CFILES= gnutar.c header.c cpiohdr.c xheader.c xattr.c \ + list.c extract.c create.c append.c diff.c restore.c \ +@@ -34,7 +35,7 @@ CFILES= gnutar.c header.c cpiohdr.c xheader.c xattr.c \ + HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + movearch.h table.h props.h fifo.h diff.h \ + checkerr.h dumpdate.h bitstring.h pathname.h +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) $(LIB_SELINUX) + XMK_FILE= gnutarman.mk + + ########################################################################### +diff --git a/star/pax.mk b/star/pax.mk +index 73c6bc1..d2a52a9 100644 +--- a/star/pax.mk ++++ b/star/pax.mk +@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND + CPPOPTS += -DUSE_ACL + CPPOPTS += -DUSE_XATTR + CPPOPTS += -DUSE_FFLAGS ++CPPOPTS += -DWITH_SELINUX + CPPOPTS += -DPAX + CPPOPTS += -DSCHILY_PRINT + CFILES= pax.c header.c cpiohdr.c xheader.c xattr.c \ +@@ -35,7 +36,7 @@ CFILES= pax.c header.c cpiohdr.c xheader.c xattr.c \ + HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + movearch.h table.h props.h fifo.h diff.h \ + checkerr.h dumpdate.h bitstring.h pathname.h +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) $(LIB_SELINUX) + XMK_FILE= spaxman.mk + + ########################################################################### +diff --git a/star/star.c b/star/star.c +index 9dfcef7..464c751 100644 +--- a/star/star.c ++++ b/star/star.c +@@ -48,6 +48,10 @@ static UConst char sccsid[] = + #include "starsubs.h" + #include "checkerr.h" + ++#ifdef WITH_SELINUX ++int selinux_enabled=0; ++#endif ++ + EXPORT int main __PR((int ac, char **av)); + LOCAL void star_create __PR((int ac, char *const *av)); + LOCAL void checkdumptype __PR((GINFO *gp)); +@@ -402,6 +406,10 @@ main(ac, av) + comerr("Panic cannot set back effective uid.\n"); + } + my_uid = geteuid(); ++ ++#ifdef WITH_SELINUX ++ selinux_enabled=is_selinux_enabled()>0; ++#endif + /* + * WARNING: We now are no more able to open a new remote connection + * unless we have been called by root. +diff --git a/star/star.mk b/star/star.mk +index a6f6cff..68d3482 100644 +--- a/star/star.mk ++++ b/star/star.mk +@@ -21,6 +21,7 @@ CPPOPTS += -DUSE_XATTR + CPPOPTS += -DUSE_FFLAGS + CPPOPTS += -DCOPY_LINKS_DELAYED + CPPOPTS += -DSCHILY_PRINT ++CPPOPTS += -DWITH_SELINUX + CFILES= star.c header.c cpiohdr.c xheader.c xattr.c \ + list.c extract.c create.c append.c diff.c restore.c \ + remove.c star_unix.c acl_unix.c acltext.c fflags.c \ +@@ -35,7 +36,7 @@ CFILES= star.c header.c cpiohdr.c xheader.c xattr.c \ + HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + movearch.h table.h props.h fifo.h diff.h restore.h \ + checkerr.h dumpdate.h bitstring.h +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) + XMK_FILE= Makefile.man starformatman.mk + + ########################################################################### +diff --git a/star/star_fat.mk b/star/star_fat.mk +index 1975c94..507fbee 100644 +--- a/star/star_fat.mk ++++ b/star/star_fat.mk +@@ -29,6 +29,7 @@ CPPOPTS += -DUSE_FFLAGS + CPPOPTS += -DCOPY_LINKS_DELAYED + CPPOPTS += -DSTAR_FAT + CPPOPTS += -DSCHILY_PRINT ++CPPOPTS += -DWITH_SELINUX + CFILES= star_fat.c header.c cpiohdr.c xheader.c xattr.c \ + list.c extract.c create.c append.c diff.c restore.c \ + remove.c star_unix.c acl_unix.c acltext.c fflags.c \ +@@ -48,7 +49,7 @@ HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + + #LIBS= -lunos + #LIBS= -lschily -lc /usr/local/lib/gcc-gnulib +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) + # + # Wenn -lfind, dann auch $(LIB_INTL) + # +diff --git a/star/starsubs.h b/star/starsubs.h +index a914ade..1e2a233 100644 +--- a/star/starsubs.h ++++ b/star/starsubs.h +@@ -317,6 +317,11 @@ extern void opt_xattr __PR((void)); + extern BOOL get_xattr __PR((register FINFO *info)); + extern BOOL set_xattr __PR((register FINFO *info)); + extern void free_xattr __PR((star_xattr_t **xattr)); ++# ifdef WITH_SELINUX ++#include ++extern BOOL setselinux __PR((register FINFO *info)); ++extern int selinux_enabled; ++# endif + #endif + + /* +diff --git a/star/suntar.mk b/star/suntar.mk +index 9b76a23..1842917 100644 +--- a/star/suntar.mk ++++ b/star/suntar.mk +@@ -19,6 +19,7 @@ CPPOPTS += -DUSE_FIND + CPPOPTS += -DUSE_ACL + CPPOPTS += -DUSE_XATTR + CPPOPTS += -DUSE_FFLAGS ++CPPOPTS += -DWITH_SELINUX + CPPOPTS += -DSCHILY_PRINT + CFILES= suntar.c header.c cpiohdr.c xheader.c xattr.c \ + list.c extract.c create.c append.c diff.c restore.c \ +@@ -34,7 +35,7 @@ CFILES= suntar.c header.c cpiohdr.c xheader.c xattr.c \ + HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + movearch.h table.h props.h fifo.h diff.h \ + checkerr.h dumpdate.h bitstring.h pathname.h +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) $(LIB_SELINUX) + XMK_FILE= suntarman.mk + + ########################################################################### +diff --git a/star/xattr.c b/star/xattr.c +index 2e262ef..08fc42e 100644 +--- a/star/xattr.c ++++ b/star/xattr.c +@@ -198,6 +198,27 @@ fail: + #endif /* USE_XATTR */ + } + ++#ifdef WITH_SELINUX ++EXPORT BOOL ++setselinux(info) ++ register FINFO *info; ++{ ++#if defined(USE_XATTR) && defined(HAVE_SETXATTR) && defined(WITH_SELINUX) ++ if (info->f_xattr) { ++ star_xattr_t *xap; ++ for (xap = info->f_xattr; xap->name != NULL; xap++) { ++ if (strcmp(xap->name, "security.selinux") == 0) { ++ if (setfscreatecon(xap->value)) { ++ return FALSE; ++ } ++ } ++ } ++ } ++#endif /* USE_XATTR && WITH_SELINUX */ ++ return TRUE; ++} ++#endif ++ + /* ARGSUSED */ + EXPORT BOOL + set_xattr(info) +@@ -211,6 +232,10 @@ set_xattr(info) + return (TRUE); + + for (xap = info->f_xattr; xap->name != NULL; xap++) { ++#ifdef WITH_SELINUX ++ if (selinux_enabled && (strcmp(xap->name, "security.selinux") == 0)) ++ continue; ++#endif + if (lsetxattr(info->f_name, xap->name, xap->value, + xap->value_len, 0) != 0) { + if (!errhidden(E_SETXATTR, info->f_name)) { diff --git a/star-1.5.3-star-mk.patch b/star-1.5.3-star-mk.patch new file mode 100644 index 0000000..577c451 --- /dev/null +++ b/star-1.5.3-star-mk.patch @@ -0,0 +1,19 @@ +diff --git a/star/star.mk b/star/star.mk +index 68d3482..4961a29 100644 +--- a/star/star.mk ++++ b/star/star.mk +@@ -32,11 +32,11 @@ CFILES= star.c header.c cpiohdr.c xheader.c xattr.c \ + subst.c volhdr.c \ + chdir.c match.c defaults.c dumpdate.c \ + fifo.c device.c checkerr.c \ +- findinfo.c ++ findinfo.c pathname.c + HFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ + movearch.h table.h props.h fifo.h diff.h restore.h \ +- checkerr.h dumpdate.h bitstring.h +-LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) ++ checkerr.h dumpdate.h bitstring.h pathname.h ++LIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_SELINUX) $(LIB_CAP) + XMK_FILE= Makefile.man starformatman.mk + + ########################################################################### diff --git a/star.spec b/star.spec index 47cb3a4..b29119d 100644 --- a/star.spec +++ b/star.spec @@ -6,79 +6,66 @@ Summary: An archiving tool with ACL support Name: star -Version: 1.5.2 -Release: 11%{?dist} +Version: 1.5.3 +Release: 1%{?dist} License: CDDL Group: Applications/Archiving -URL: http://cdrecord.berlios.de/old/private/star.html -Source: ftp://ftp.berlios.de/pub/star/%{name}-%{version}.tar.bz2 - -#use gcc for compilation, change defaults for Linux -Patch1: star-1.5-newMake.patch -#add SELinux support to star(#) -Patch2: star-1.5.2-selinux.patch -#do not segfault with data-change-warn option (#255261) -Patch3: star-1.5-changewarnSegv.patch -#Prevent buffer overflow for filenames with length of 100 characters (#556664) -Patch4: star-1.5.2-bufferoverflow.patch -#Fix some invalid manpage references (#624612) -Patch5: star-1.5.1-manpagereferences.patch +URL: http://freecode.com/projects/star +Source: http://downloads.sourceforge.net/s-tar/%{name}-%{version}.tar.bz2 + +# add SELinux support to star(#) +Patch1: star-1.5.3-selinux.patch + +# do not segfault with data-change-warn option (#255261) +Patch2: star-1.5-changewarnSegv.patch + +# Prevent buffer overflow for filenames with length of 100 characters (#556664) +Patch3: star-1.5.2-bufferoverflow.patch + +# Fix some invalid manpage references (#624612) +Patch4: star-1.5.1-manpagereferences.patch + # do not crash when xattrs are not set on all files (#861848) -Patch6: star-1.5.1-selinux-segfault.patch -# note that the H=crc format uses Sum32 algorithm, not CRC -Patch7: star-1.5.1-crc.patch +Patch5: star-1.5.1-selinux-segfault.patch -# fix man-page-day objections -# ~> proposed upstream: -# https://lists.berlios.de/pipermail/star-developers/2013-April/000027.html -# ~> #948866 -Patch8: star-1.5.2-man-page-day.patch +# note that the H=crc format uses Sum32 algorithm, not CRC +Patch6: star-1.5.1-crc.patch # Disable profiling on aarch64 as it's not currently supported upstream -Patch9: star-aarch64.patch +Patch7: star-aarch64.patch # Allow rmt to access all files. # ~> downstream # ~> #968980 -Patch10: star-1.5.2-rmt-rh-access.patch +Patch8: star-1.5.2-rmt-rh-access.patch # Use ssh rather than rsh by default # ~> downstream # ~> related to #968980 -Patch11: star-1.5.2-use-ssh-by-default.patch +Patch9: star-1.5.2-use-ssh-by-default.patch + +# Fix broken star.mk in 1.5.3 (included from all.mk) +Patch10: star-1.5.3-star-mk.patch BuildRequires: libattr-devel libacl-devel libtool libselinux-devel BuildRequires: e2fsprogs-devel -Requires(post): %{ALTERNATIVES} -Requires(preun): %{ALTERNATIVES} - -# Historically, star installed /usr/bin/spax binary also so we don't want to -# break the compatibility. We don't care about scpio because scpio binary was -# not installed. -Requires: spax - %description Star saves many files together into a single tape or disk archive, and can restore individual files from the archive. Star supports ACL. %package -n spax -# Temporary! Remove once no problem may occur. We really need to force update -# of older star and pax, when any of them is installed. Its file list -# collisions with 'spax'. -Conflicts: star < 1.5.2-5 -Conflicts: pax < 3.4-16 Summary: Portable archive exchange Group: Applications/Archiving +Requires(post): %{ALTERNATIVES} +Requires(preun): %{ALTERNATIVES} + %description -n spax The pax utility shall read and write archives, write lists of the members of archive files and copy directory hierarchies as is defined in IEEE Std 1003.1. %package -n scpio -# Temporary! Remove once _no problem_ may occur. We really need to force -# update of older star if it installed — its files overlaps with scpio. -Conflicts: star < 1.5.2-5 Summary: Copy file archives in and out (LEGACY) Group: Applications/Archiving @@ -110,20 +97,20 @@ restoring files from a backup), and tar (an archiving program). %prep %setup -q -%patch1 -p1 -b .newMake %if %{WITH_SELINUX} -%patch2 -p1 -b .selinux +%patch1 -p1 -b .selinux %endif -%patch3 -p1 -b .changewarnSegv -%patch4 -p1 -b .namesoverflow -%patch5 -p1 -b .references -%patch6 -p1 -b .selinux-segfault -%patch7 -p1 -b .crc -%patch8 -p1 -b .man-page-day -%patch9 -p1 -b .aarch64 -%patch10 -p1 -b .rmt-access-rules -%patch11 -p1 -b .ssh-by-default - +%patch2 -p1 -b .changewarnSegv +%patch3 -p1 -b .namesoverflow +%patch4 -p1 -b .references +%patch5 -p1 -b .selinux-segfault +%patch6 -p1 -b .crc +%patch7 -p1 -b .aarch64 +%patch8 -p1 -b .rmt-access-rules +%patch9 -p1 -b .ssh-by-default +%patch10 -p1 -b .bug-config-1.5.3 + +# disable single "fat" binary cp -a star/all.mk star/Makefile star_recode() @@ -136,8 +123,6 @@ star_recode() star_recode AN-1.5 AN-1.5.2 star/star.4 -cp -a READMEs/README.linux . - for PLAT in %{arm} %{power64} aarch64 x86_64 s390 s390x sh3 sh4 sh4a sparcv9; do for AFILE in gcc cc; do [ ! -e RULES/${PLAT}-linux-${AFILE}.rul ] \ @@ -146,31 +131,36 @@ for PLAT in %{arm} %{power64} aarch64 x86_64 s390 s390x sh3 sh4 sh4a sparcv9; do done %build -export MAKEPROG=gmake -# Autoconfiscate -(cd autoconf; AC_MACRODIR=. AWK=gawk ./autoconf) - -#make %%{?_smp_mflags} PARCH=%%{_target_cpu} CPPOPTX="-DNO_FSYNC" \ -# ~~> enable debug by COPTX='-g3 -O0' LDOPTX='-g3 -O0' -make %{?_smp_mflags} PARCH=%{_target_cpu} \ -COPTX="$RPM_OPT_FLAGS -DTRY_EXT2_FS" CC="%{__cc}" \ -K_ARCH=%{_target_cpu} \ -CONFFLAGS="%{_target_platform} --prefix=%{_prefix} \ - --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} \ - --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \ - --datadir=%{_datadir} --includedir=%{_includedir} \ - --libdir=%{_libdir} --libexec=%{_libexecdir} \ - --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} \ - --mandir=%{_mandir} --infodir=%{_infodir}" < /dev/null +# Silence irritating warning +export GMAKE_NOWARN=true -%install -export MAKEPROG=gmake -mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man4 +# Note: disable optimalisation by COPTX='-g3 -O0' LDOPTX='-g3 -O0' +make %{?_smp_mflags} \ + RUNPATH= \ + PARCH=%{_target_cpu} \ + K_ARCH=%{_target_cpu} \ + COPTX="$RPM_OPT_FLAGS -DTRY_EXT2_FS" CC="%{__cc}" -make install RPM_INSTALLDIR=${RPM_BUILD_ROOT} PARCH=%{_target_cpu} K_ARCH=%{_target_cpu} < /dev/null + +%install +# This is work-around atypical build system. Variables used: +# INS_BASE - something like DESTDIR together with --prefix in with autotools +# INS_BASE - something like DESTDIR for configuration files, but etc/default +# is at least in 1.5.3 hardcoded +# INSTALL - install script, used non-default because the -o & -g options are +# causing ugly build output +# Things like --docdir, etc. are randomly hard-coded so we must deal with it. +make install -s \ + INS_BASE=$RPM_BUILD_ROOT%{_prefix} \ + INS_RBASE=$RPM_BUILD_ROOT \ + INSTALL='sh $(SRCROOT)/conf/install-sh -c -m $(INSMODEINS)' ln -s star.1.gz ${RPM_BUILD_ROOT}%{_mandir}/man1/ustar.1 +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir} +mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir} ln -s %{_sbindir}/rmt ${RPM_BUILD_ROOT}%{_sysconfdir}/rmt +install -p -m 644 COPYING star/README CDDL.Schily.txt AN-* \ + ${RPM_BUILD_ROOT}%{_pkgdocdir} # XXX Nuke unpackaged files. ( cd ${RPM_BUILD_ROOT} @@ -182,18 +172,24 @@ ln -s %{_sbindir}/rmt ${RPM_BUILD_ROOT}%{_sysconfdir}/rmt rm -f .%{_bindir}/star_fat rm -f .%{_bindir}/star_sym rm -f .%{_bindir}/suntar - rm -rf .%{_docdir}/rmt + rm -f .%{_sysconfdir}/default/star rm -rf .%{_prefix}%{_sysconfdir} rm -rf .%{_prefix}/include rm -rf .%{_prefix}/lib # hard-wired intently rm -rf .%{_mandir}/man3 rm -rf .%{_mandir}/man5/{makefiles,makerules}.5* rm -rf .%{_mandir}/man1/{tartest,gnutar,smt,mt,suntar,match}.1* + rm -rf .%{_docdir}/star/testscripts + rm -rf .%{_docdir}/star/TODO + rm -rf .%{_docdir}/rmt ) %clean -%global general_docs README AN* COPYING CDDL.Schily.txt TODO README.linux +%global general_docs \ +%dir %{_pkgdocdir} \ +%doc %{_pkgdocdir}/COPYING \ +%doc %{_pkgdocdir}/CDDL.Schily.txt \ %post -n spax %{ALTERNATIVES} \ @@ -207,7 +203,7 @@ if [ $1 -eq 0 ]; then fi %files -%doc %{general_docs} +%doc %{_pkgdocdir} %{_bindir}/star %{_bindir}/ustar %{_mandir}/man1/star.1* @@ -215,19 +211,19 @@ fi %{_mandir}/man5/star.5* %files -n scpio -%doc %{general_docs} +%general_docs %doc %{_mandir}/man1/scpio.1* %{_bindir}/scpio %files -n spax -%doc %{general_docs} +%general_docs %doc %{_mandir}/man1/spax.1* %{_bindir}/spax %ghost %verify(not md5 size mode mtime) %{ALT_LINK} %ghost %verify(not md5 size mode mtime) %{ALT_SL1_LINK} %files -n rmt -%doc %{general_docs} +%general_docs %{_sbindir}/rmt %{_mandir}/man1/rmt.1* %config %{_sysconfdir}/default/rmt @@ -239,6 +235,9 @@ fi %{_sysconfdir}/rmt %changelog +* Fri Jun 27 2014 Pavel Raiskup - 1.5.3-1 +- rebase to 1.5.3 + * Sun Jun 08 2014 Fedora Release Engineering - 1.5.2-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild