aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2008-01-30 01:05:07 +0000
committerReuben Thomas <rrt@sc3d.org>2008-01-30 01:05:07 +0000
commitab62a3096711e3e9c87b6c0405fcecf81f753d53 (patch)
tree76a6c4878b8b44d869703f4335af9f29a896f1ed
parentf905e7c9aa34e0364f6b8b58715495257b9600c2 (diff)
downloadplptools-ab62a3096711e3e9c87b6c0405fcecf81f753d53.tar.gz
plptools-ab62a3096711e3e9c87b6c0405fcecf81f753d53.tar.bz2
plptools-ab62a3096711e3e9c87b6c0405fcecf81f753d53.zip
Stop libattr and libfuse being linked against by programs other than
plpfuse. Fix logic of plp_setxattr. It doesn't need to read the non-x attributes, and it now treats the set and cleared EPOC attribute bits properly (I hope!).
-rw-r--r--configure.ac4
-rw-r--r--plpfuse/fuse.c12
2 files changed, 7 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 7b6f5e7..5cda2ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -109,7 +109,7 @@ AC_SUBST(LIBHISTORY)
# FUSE for plpfuse
AC_CHECK_HEADER(fuse.h,,
[AC_MSG_ERROR([Need fuse.h to build plpfuse])])
-AC_CHECK_LIB(fuse,fuse_new,,
+AC_CHECK_LIB(fuse,fuse_new, [true],
[AC_MSG_ERROR([Need libfuse to build plpfuse])])
# check for a supported version of FUSE
@@ -133,7 +133,7 @@ AC_RUN_IFELSE([
# check for libattr for plpfuse
AC_CHECK_HEADER(attr/attributes.h,,
[AC_MSG_ERROR([Need libattr to build plpfuse])])
-AC_CHECK_LIB(attr, attr_set,,
+AC_CHECK_LIB(attr, attr_set, [true],
[AC_MSG_ERROR([Need libattr to build plpfuse])])
dnl these three are for solaris
diff --git a/plpfuse/fuse.c b/plpfuse/fuse.c
index 883f1d8..3cce988 100644
--- a/plpfuse/fuse.c
+++ b/plpfuse/fuse.c
@@ -450,7 +450,7 @@ static int plp_setxattr(const char *path, const char *name, const char *value, s
{
debuglog("plp_setxattr `%s'", ++path);
if (strcmp(name, XATTR_NAME) == 0) {
- long psidattr, pattr, psize, ptime;
+ long psisattr, psidattr;
char oxattr[XATTR_MAXLEN + 1], nxattr[XATTR_MAXLEN + 1];
if (flags & XATTR_CREATE) {
@@ -460,14 +460,12 @@ static int plp_setxattr(const char *path, const char *name, const char *value, s
strncpy(nxattr, value, size < XATTR_MAXLEN ? size : XATTR_MAXLEN);
nxattr[XATTR_MAXLEN] = '\0';
- if (rfsv_getattr(path, &pattr, &psize, &ptime))
- return rfsv_isalive() ? -ENOENT : -NO_PSION;
/* Need to undo earlier increment of path when calling plp_getxattr */
plp_getxattr(path - 1, name, oxattr, XATTR_MAXLEN);
- psidattr = pattr;
- xattr2pattr(&pattr, &psidattr, oxattr, value);
- debuglog("attrs set %x delete %x; %s, %s", pattr, psidattr, oxattr, value);
- if (rfsv_setattr(path, pattr, psidattr))
+ psisattr = psidattr = 0;
+ xattr2pattr(&psisattr, &psidattr, oxattr, value);
+ debuglog("attrs set %x delete %x; %s, %s", psisattr, psidattr, oxattr, value);
+ if (rfsv_setattr(path, psisattr, psidattr))
return rfsv_isalive() ? -EACCES : -NO_PSION;
debuglog("setxattr succeeded");