[RFE] [PATCH] star vfs and xattr feature request



Hello mc-devel,

Curtis Doty sent me a patch for star vfs support, where he says:
-------------------------------------------------------------------------------
Here's a patch that attempts to add star filesystem support. Which is
fairly important IMHO now that Fedora is using selinux (or anything that
uses extended attributes).

Star also seems very forgiving; allowing the same view/extract command to work
across native archives or those compressed with various programs.

However, I couldn't get #utar to work so had to write the little #ustar script;
which is dog slow. So I'm hearby requesting a new feature: can the #utar extfs
be made to extract from starchives that contain selinux security descriptors?
-------------------------------------------------------------------------------

references:
http://bugzilla.redhat.com/174918
http://www.nsa.gov/selinux/

Regards,
Jindrich 
-- 
Jindrich Novy <jnovy redhat com>, http://people.redhat.com/jnovy/
(o_                                                           _o)
//\      The worst evil in the world is refusal to think.     //\
V_/_                                                         _\_V

--- mc-4.6.1a/lib/mc.ext.in.star	2005-12-03 19:27:17.000000000 -0800
+++ mc-4.6.1a/lib/mc.ext.in	2005-12-03 19:28:22.000000000 -0800
@@ -134,6 +134,11 @@
 	Open=%cd %p#utar
 	View=%view{ascii} tar tvvf %f
 
+# star - standard archive
+regex/\.(star|STAR)(|\.(bz2|gz))$
+	Open=%cd %p#ustar
+	View=%view{ascii} star tvf %f 2>/dev/null
+
 # lha
 type/^LHa\ .*archive
 	Open=%cd %p#ulha
--- mc-4.6.1a/vfs/extfs/extfs.ini.star	2005-07-20 12:03:54.000000000 -0700
+++ mc-4.6.1a/vfs/extfs/extfs.ini	2005-12-03 19:29:35.000000000 -0800
@@ -54,3 +54,6 @@
 
 # ISO image
 iso9660
+
+# standard archive
+ustar
+++ mc-4.6.1a/vfs/extfs/ustar	2005-12-03 18:51:00.000000000 -0800
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+mcstarfs_list() {
+	star -tv -f="$1" 2>/dev/null |awk '{
+		size = $1
+		perms = substr($2,1,10)
+		split($3,own,"/")
+		month = $4 ; day = $5 ; time = $6 ; year = $7
+		filename = substr($0, index($0,$8) )
+		printf "%s 1 %s %s %i %s %2i %i %s %s\n",
+			perms, own[1], own[2], size, month, day, year, time, filename
+	}'
+}
+
+mcstarfs_copyout() {
+	#star -no-statistics -f="$1" -x -to-stdout "$2" >"$3"
+	# grumble mumble...can't have stderr because we need
+	# leading / and turning it off with -/ doesn't work
+	star -f="$1" -x -to-stdout "$2" >"$3" 2>/dev/null
+}
+
+cmd="$1"
+shift
+case "$cmd" in
+	list)		mcstarfs_list "$@" ;;
+	copyout)	mcstarfs_copyout "$@" ;;
+	*)		exit 1 ;;
+esac
+exit 0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]