summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-04-23 16:21:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-04-23 16:26:13 +0200
commitbc04436cce02954c0e1016c343d00d0493766c52 (patch)
treef71b879336dbfd7965afadb39e8a2a095866dc9d /cpukit
parentnfsclient: POSIX conformance (diff)
downloadrtems-bc04436cce02954c0e1016c343d00d0493766c52.tar.bz2
nfsclient: Use UID and GID of NFS handle
Use UID and GID of the NFS handle for node and symbolic link creation.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/src/nfsclient/src/nfs.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c
index da4bae6ac5..71d8c0d6c8 100644
--- a/cpukit/libfs/src/nfsclient/src/nfs.c
+++ b/cpukit/libfs/src/nfsclient/src/nfs.c
@@ -1188,8 +1188,8 @@ int len;
}
chpt++;
} else {
- *puid = RPCIOD_DEFAULT_ID;
- *pgid = RPCIOD_DEFAULT_ID;
+ *puid = geteuid();
+ *pgid = getegid();
chpt = *pPath;
}
if ( pHost )
@@ -1883,6 +1883,7 @@ int rv = 0;
struct timeval now;
diropres res;
NfsNode node = parentloc->node_access;
+Nfs nfs = node->nfs;
mode_t type = S_IFMT & mode;
char *dupname;
@@ -1901,16 +1902,15 @@ char *dupname;
SERP_ARGS(node).createarg.name = dupname;
SERP_ARGS(node).createarg.attributes.mode = mode;
- /* TODO: either use our uid or use the Nfs credentials */
- SERP_ARGS(node).createarg.attributes.uid = 0;
- SERP_ARGS(node).createarg.attributes.gid = 0;
+ SERP_ARGS(node).createarg.attributes.uid = nfs->uid;
+ SERP_ARGS(node).createarg.attributes.gid = nfs->gid;
SERP_ARGS(node).createarg.attributes.size = 0;
SERP_ARGS(node).createarg.attributes.atime.seconds = now.tv_sec;
SERP_ARGS(node).createarg.attributes.atime.useconds = now.tv_usec;
SERP_ARGS(node).createarg.attributes.mtime.seconds = now.tv_sec;
SERP_ARGS(node).createarg.attributes.mtime.useconds = now.tv_usec;
- if ( nfscall( node->nfs->server,
+ if ( nfscall( nfs->server,
(type == S_IFDIR) ? NFSPROC_MKDIR : NFSPROC_CREATE,
(xdrproc_t)xdr_createargs, &SERP_FILE(node),
(xdrproc_t)xdr_diropres, &res)
@@ -1976,6 +1976,7 @@ int rv = 0;
struct timeval now;
nfsstat status;
NfsNode node = parentloc->node_access;
+Nfs nfs = node->nfs;
char *dupname;
dupname = nfs_dupname(name, namelen);
@@ -1992,16 +1993,15 @@ char *dupname;
SERP_ARGS(node).symlinkarg.to = (nfspath) target;
SERP_ARGS(node).symlinkarg.attributes.mode = S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO;
- /* TODO */
- SERP_ARGS(node).symlinkarg.attributes.uid = 0;
- SERP_ARGS(node).symlinkarg.attributes.gid = 0;
+ SERP_ARGS(node).symlinkarg.attributes.uid = nfs->uid;
+ SERP_ARGS(node).symlinkarg.attributes.gid = nfs->gid;
SERP_ARGS(node).symlinkarg.attributes.size = 0;
SERP_ARGS(node).symlinkarg.attributes.atime.seconds = now.tv_sec;
SERP_ARGS(node).symlinkarg.attributes.atime.useconds = now.tv_usec;
SERP_ARGS(node).symlinkarg.attributes.mtime.seconds = now.tv_sec;
SERP_ARGS(node).symlinkarg.attributes.mtime.useconds = now.tv_usec;
- if ( nfscall( node->nfs->server,
+ if ( nfscall( nfs->server,
NFSPROC_SYMLINK,
(xdrproc_t)xdr_symlinkargs, &SERP_FILE(node),
(xdrproc_t)xdr_nfsstat, &status)