From f44d3a4bc1d086012171cf68d4e198c7b4f184f8 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Tue, 20 May 1997 19:57:13 +0000 Subject: Tue May 20 15:35:39 1997 Thomas Bushnell, n/BSG * nfs.c (xdr_encode_create_state): New arg OWNER. Set the owner of the new file to it. All callers changed. * nfs.h (xdr_encode_create_state): Update prototype. * ops.c (netfs_attempt_mkdir): If owner didn't get set correctly (some servers ignore it) then try a chown. (netfs_attempt_create_file): Likewise. --- nfs/nfs.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'nfs/nfs.c') diff --git a/nfs/nfs.c b/nfs/nfs.c index ddeeb63e..5ccf7186 100644 --- a/nfs/nfs.c +++ b/nfs/nfs.c @@ -1,5 +1,5 @@ /* XDR frobbing and lower level routines for NFS client - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -290,15 +290,17 @@ xdr_encode_sattr_times (int *p, struct timespec *atime, struct timespec *mtime) return p; } -/* Encode MODE and a size of 0 into an otherwise empty sattr. */ +/* Encode MODE, a size of zero, and the specified owner into an otherwise + empty sattr. */ int * xdr_encode_create_state (int *p, - mode_t mode) + mode_t mode, + uid_t owner) { if (protocol_version == 2) { *p++ = htonl (hurd_mode_to_nfs_mode (mode)); - *p++ = -1; /* uid */ + *p++ = htonl (owner); /* uid */ *p++ = -1; /* gid */ *p++ = 0; /* size */ *p++ = -1; /* atime sec */ @@ -310,7 +312,8 @@ xdr_encode_create_state (int *p, { *p++ = htonl (1); /* mode */ *p++ = htonl (hurd_mode_to_nfs_mode (mode)); - *p++ = 0; /* no uid */ + *p++ = htonl (1); /* set uid */ + *p++ = htonl (owner); *p++ = 0; /* no gid */ *p++ = htonl (1); /* set size */ p = xdr_encode_64bit (p, 0); -- cgit v1.2.3