Re: [RFC] Extended Attributes for Dos Attributes, Creation Time, etc.

2009-11-16 Thread Ben Peddell
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dan Kegel wrote:
 Hi Ben,
 did you see
 http://bugs.winehq.org/show_bug.cgi?id=15679
 http://www.winehq.org/pipermail/wine-patches/2009-October/079842.html
 ?
 
 IMHO the way the Samba sources merged the fd and filename
 version of the calls makes for less duplication of code.
 (I tried to do it the other way first, and it seemed ugly.)
 - Dan

I saw that, and that's at least part of why I created that extended
attribute portability patch for libport.  Serves as one location to fix
any bugs in it, or extend the support to other platforms.

I noticed that the portability functions in libport were each in their
own separate C file, and that's why I did it like that.

I can see what you're saying about duplication of code, and it would
make sense to merge the xattr portability functions into a single C file
(e.g. xattr.c).

If there's a better place for the xattr portability code, please say so.

I know it's unlikely to be merged until a few units actually start using
extended attributes.

Thinking about the NT ACL storage issue (brought up by bug #20643),
rather than using xattrs for that, POSIX ACLs would be a better target.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksBFp8ACgkQTHDAI68NsukTqQCfcFNsC+1o0YjSbBf9kHW3w0nF
2IkAnicyCrgnmqZl+Qd+DAmke+C0yHVA
=ANKR
-END PGP SIGNATURE-
attachment: klightspeed.vcf


[RFC] Extended Attributes for Dos Attributes, Creation Time, etc.

2009-11-15 Thread Ben Peddell
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

What are your thoughts on using Extended Attributes for items such as:
* Dos Attributes (like samba's store dos attributes = yes)
* File Creation Times (like samba's proposed user.crtime)
* An option for alternate storage of NT ACLs (like samba's vfs object =
acl-xattr)

Are Extended Attributes acceptable?
Or should they never touch the wine source?

Where would the portability functions for Extended Attributes on Linux,
Mac OS X, FreeBSD and Solaris belong?  I would think in libport.

Attached is a patch to add extended attribute portability functions for
fgetxattr, fsetxattr and fremovexattr to libport.

Please give me any comments on this patch, and the idea of using
extended attributes.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksAm/4ACgkQTHDAI68NsumFzwCbBDcRbB8kFXroLeskA+hzgswu
i0UAn3NHbau8AjSgtoruggBH3py+orcZ
=tEvP
-END PGP SIGNATURE-
From 2ef84c7f8c849db18ce15366e72c6787fa83597d Mon Sep 17 00:00:00 2001
From: Benjamin Peddell klightsp...@netspace.net.au
Date: Mon, 16 Nov 2009 01:23:28 +1000
Subject: [PATCH] Add Extended Attribute support to libport

---
 configure|  178 ++
 configure.ac |   45 
 include/config.h.in  |   39 ++
 include/wine/port.h  |   36 +
 libs/port/Makefile.in|3 +
 libs/port/fgetxattr.c|   96 +
 libs/port/fremovexattr.c |   75 +++
 libs/port/fsetxattr.c|  102 ++
 8 files changed, 574 insertions(+), 0 deletions(-)
 create mode 100644 libs/port/fgetxattr.c
 create mode 100644 libs/port/fremovexattr.c
 create mode 100644 libs/port/fsetxattr.c

diff --git a/configure b/configure
index 15652b4..c9322b3 100755
--- a/configure
+++ b/configure
@@ -5747,6 +5747,7 @@ for ac_header in \
sys/errno.h \
sys/event.h \
sys/exec_elf.h \
+   sys/extattr.h \
sys/filio.h \
sys/inotify.h \
sys/ioctl.h \
@@ -5782,6 +5783,7 @@ for ac_header in \
sys/utsname.h \
sys/vm86.h \
sys/wait.h \
+   sys/xattr.h \
syscall.h \
termios.h \
unistd.h \
@@ -12084,6 +12086,9 @@ for ac_func in \
chsize \
dlopen \
epoll_create \
+   extattr_delete_fd \
+   extattr_get_fd \
+   extattr_set_fd \
ffs \
finite \
fnmatch \
@@ -12105,6 +12110,7 @@ for ac_func in \
lstat \
memmove \
mmap \
+   openat \
pclose \
pipe2 \
poll \
@@ -12137,6 +12143,7 @@ for ac_func in \
tcgetattr \
thr_kill2 \
timegm \
+   unlinkat \
usleep \
vsnprintf \
wait4 \
@@ -12262,6 +12269,81 @@ fi
 
 fi
 
+{ $as_echo $as_me:${as_lineno-$LINENO}: checking for library containing 
fgetxattr 5
+$as_echo_n checking for library containing fgetxattr...  6; }
+if test ${ac_cv_search_fgetxattr+set} = set; then :
+  $as_echo_n (cached)  6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - _ACEOF conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern C
+#endif
+char fgetxattr ();
+int
+main ()
+{
+return fgetxattr ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' attr; do
+  if test -z $ac_lib; then
+ac_res=none required
+  else
+ac_res=-l$ac_lib
+LIBS=-l$ac_lib  $ac_func_search_save_LIBS
+  fi
+  if ac_fn_c_try_link $LINENO; then :
+  ac_cv_search_fgetxattr=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+conftest$ac_exeext
+  if test ${ac_cv_search_fgetxattr+set} = set; then :
+  break
+fi
+done
+if test ${ac_cv_search_fgetxattr+set} = set; then :
+
+else
+  ac_cv_search_fgetxattr=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo $as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fgetxattr 5
+$as_echo $ac_cv_search_fgetxattr 6; }
+ac_res=$ac_cv_search_fgetxattr
+if test $ac_res != no; then :
+  test $ac_res = none required || LIBS=$ac_res $LIBS
+
+fi
+
+
+for ac_func in \
+   fgetxattr \
+   fremovexattr \
+   fsetxattr \
+
+do :
+  as_ac_var=`$as_echo ac_cv_func_$ac_func | $as_tr_sh`
+ac_fn_c_check_func $LINENO $ac_func $as_ac_var
+eval as_val=\$$as_ac_var
+   if test x$as_val = xyes; then :
+  cat confdefs.h _ACEOF
+#define `$as_echo HAVE_$ac_func | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 { $as_echo $as_me:${as_lineno-$LINENO}: checking for library containing 
gethostbyname 5
 $as_echo_n checking for library containing gethostbyname...  6; }
 if test ${ac_cv_search_gethostbyname+set} = set; then :
@@ -12616,6 +12698,102 @@ $as_echo #define HAVE_ONE_ARG_MKDIR 1 confdefs.h
 
 fi
 
+{ $as_echo 

re: [RFC] Extended Attributes for Dos Attributes, Creation Time, etc.

2009-11-15 Thread Dan Kegel
Hi Ben,
did you see
http://bugs.winehq.org/show_bug.cgi?id=15679
http://www.winehq.org/pipermail/wine-patches/2009-October/079842.html
?

IMHO the way the Samba sources merged the fd and filename
version of the calls makes for less duplication of code.
(I tried to do it the other way first, and it seemed ugly.)
- Dan