aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2010-10-11 11:55:30 -0500
committerPeter Seebach <peter.seebach@windriver.com>2010-10-11 16:11:50 -0500
commit489ed5e89f040febcb605f22187968f597211205 (patch)
tree1c853bcd159394d667a91ee67f0f6fd621ab6aac
parentb8e2778c1bb5654df478efe7d3861ed30529409b (diff)
downloadpseudo-489ed5e89f040febcb605f22187968f597211205.tar.gz
pseudo-489ed5e89f040febcb605f22187968f597211205.tar.bz2
pseudo-489ed5e89f040febcb605f22187968f597211205.zip
Add the other *xattr() wrappers (all ENOTSUP) for consistency.
Note that this replaces an existing getxattr() wrapper which canonicalized pathnames for use in a chroot() environment. The need for that to work in some possible future may require us to revisit this.
-rw-r--r--ChangeLog.txt3
-rw-r--r--guts/README6
-rw-r--r--guts/fgetxattr.c13
-rw-r--r--guts/flistxattr.c13
-rw-r--r--guts/fremovexattr.c13
-rw-r--r--guts/fsetxattr.c8
-rw-r--r--guts/getxattr.c7
-rw-r--r--guts/lgetxattr.c7
-rw-r--r--guts/listxattr.c13
-rw-r--r--guts/llistxattr.c13
-rw-r--r--guts/lremovexattr.c13
-rw-r--r--guts/lsetxattr.c13
-rw-r--r--guts/removexattr.c13
-rw-r--r--guts/setxattr.c13
-rw-r--r--wrapfuncs.in15
15 files changed, 148 insertions, 15 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index f961e2a..788901c 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2010-10-11:
+ * (seebs) do the other *xattr() wrappers.
+
2010-10-06:
* (mhatle) Add the fsetxattr wrapper to return ENOTSUP
(note: workaround gnu coreutils 'cp')
diff --git a/guts/README b/guts/README
index 02afa8c..8bfbfe6 100644
--- a/guts/README
+++ b/guts/README
@@ -200,3 +200,9 @@ the group file when called, rather than checking the group file once
"at login" (whatever that means in our context) and returning that saved
status. We don't think this matters. setgroups() just fails; this will
be corrected if we come up with a compelling reason to do so.
+
+The following functions set errnot to ENOTSUP and return -1; this is
+needed because we don't actually track or manage extended attributes, but
+a few programs attempt to use *setxattr() to set regular permissions,
+and only use a regular chmod if the *setxattr() call returns -1 and
+sets errno to ENOTSUP.
diff --git a/guts/fgetxattr.c b/guts/fgetxattr.c
new file mode 100644
index 0000000..a9bd8b0
--- /dev/null
+++ b/guts/fgetxattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size)
+ * ssize_t rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/flistxattr.c b/guts/flistxattr.c
new file mode 100644
index 0000000..62b4173
--- /dev/null
+++ b/guts/flistxattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * ssize_t flistxattr(int filedes, char *list, size_t size)
+ * ssize_t rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/fremovexattr.c b/guts/fremovexattr.c
new file mode 100644
index 0000000..fe3681e
--- /dev/null
+++ b/guts/fremovexattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * int fremovexattr(int filedes, const char *name)
+ * int rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/fsetxattr.c b/guts/fsetxattr.c
index 95cb64c..a891ffb 100644
--- a/guts/fsetxattr.c
+++ b/guts/fsetxattr.c
@@ -1,14 +1,12 @@
-/*
- * Copyright (c) 2008-2010 Wind River Systems; see
+/*
+ * Copyright (c) 2010 Wind River Systems; see
* guts/COPYRIGHT for information.
*
- * static int
- * wrap_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags) {
+ * int fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags)
* int rc = -1;
*/
errno = ENOTSUP;
- rc = -1;
/* return rc;
* }
diff --git a/guts/getxattr.c b/guts/getxattr.c
index ce2a618..71cfd56 100644
--- a/guts/getxattr.c
+++ b/guts/getxattr.c
@@ -1,13 +1,12 @@
-/*
+/*
* Copyright (c) 2010 Wind River Systems; see
* guts/COPYRIGHT for information.
*
- * static ssize_t
- * wrap_getxattr(const char *path, const char *name, void *value, size_t size) {
+ * ssize_t getxattr(const char *pathname, const char *name, void *value, size_t size)
* ssize_t rc = -1;
*/
- rc = real_getxattr(path, name, value, size);
+ errno = ENOTSUP;
/* return rc;
* }
diff --git a/guts/lgetxattr.c b/guts/lgetxattr.c
index f503bde..84fe020 100644
--- a/guts/lgetxattr.c
+++ b/guts/lgetxattr.c
@@ -1,13 +1,12 @@
-/*
+/*
* Copyright (c) 2010 Wind River Systems; see
* guts/COPYRIGHT for information.
*
- * static ssize_t
- * wrap_lgetxattr(const char *path, const char *name, void *value, size_t size) {
+ * ssize_t lgetxattr(const char *pathname, const char *name, void *value, size_t size)
* ssize_t rc = -1;
*/
- rc = real_lgetxattr(path, name, value, size);
+ errno = ENOTSUP;
/* return rc;
* }
diff --git a/guts/listxattr.c b/guts/listxattr.c
new file mode 100644
index 0000000..cef53fc
--- /dev/null
+++ b/guts/listxattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * ssize_t listxattr(const char *pathname, char *list, size_t size)
+ * ssize_t rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/llistxattr.c b/guts/llistxattr.c
new file mode 100644
index 0000000..92870b5
--- /dev/null
+++ b/guts/llistxattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * ssize_t llistxattr(const char *pathname, char *list, size_t size)
+ * ssize_t rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/lremovexattr.c b/guts/lremovexattr.c
new file mode 100644
index 0000000..2ad8a82
--- /dev/null
+++ b/guts/lremovexattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * int lremovexattr(const char *pathname, const char *name)
+ * int rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/lsetxattr.c b/guts/lsetxattr.c
new file mode 100644
index 0000000..e5b4cd6
--- /dev/null
+++ b/guts/lsetxattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * int lsetxattr(const char *pathname, const char *name, const void *value, size_t size, int flags)
+ * int rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/removexattr.c b/guts/removexattr.c
new file mode 100644
index 0000000..bf844dd
--- /dev/null
+++ b/guts/removexattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * int removexattr(const char *pathname, const char *name)
+ * int rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/guts/setxattr.c b/guts/setxattr.c
new file mode 100644
index 0000000..c9a590c
--- /dev/null
+++ b/guts/setxattr.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2010 Wind River Systems; see
+ * guts/COPYRIGHT for information.
+ *
+ * int setxattr(const char *pathname, const char *name, const void *value, size_t size, int flags)
+ * int rc = -1;
+ */
+
+ errno = ENOTSUP;
+
+/* return rc;
+ * }
+ */
diff --git a/wrapfuncs.in b/wrapfuncs.in
index 586d828..17742ac 100644
--- a/wrapfuncs.in
+++ b/wrapfuncs.in
@@ -116,6 +116,17 @@ void setgrent(void);
void endgrent(void);
int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups);
int getgroups(int size, gid_t *list);
-ssize_t getxattr(const char *path, const char *name, void *value, size_t size);
-ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size); /* flags=AT_SYMLINK_NOFOLLOW */
+# we use "pathname" to avoid canonicalizing paths, because these functions are
+# unimplemented
+ssize_t getxattr(const char *pathname, const char *name, void *value, size_t size);
+ssize_t lgetxattr(const char *pathname, const char *name, void *value, size_t size);
+ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size);
+ssize_t listxattr(const char *pathname, char *list, size_t size);
+ssize_t llistxattr(const char *pathname, char *list, size_t size);
+ssize_t flistxattr(int filedes, char *list, size_t size);
+int setxattr(const char *pathname, const char *name, const void *value, size_t size, int flags);
+int lsetxattr(const char *pathname, const char *name, const void *value, size_t size, int flags);
int fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags);
+int removexattr(const char *pathname, const char *name);
+int lremovexattr(const char *pathname, const char *name);
+int fremovexattr(int filedes, const char *name);