diff options
author | Roland McGrath <roland@gnu.org> | 2002-05-13 22:33:17 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2002-05-13 22:33:17 +0000 |
commit | 3742e91a2836ba82cc56342a00c4f5f5c27625c0 (patch) | |
tree | c856d039e9eed30706a3ee4c41cdb8185c024409 | |
parent | 7b4e4fc828e0cd6427193cb39b1d6ef4ff3ca97d (diff) |
2002-05-13 Roland McGrath <roland@frob.com>
* mux.c (netfs_attempt_chmod): Handle MODE arg with no S_IFMT bits set.
-rw-r--r-- | hostmux/mux.c | 6 | ||||
-rw-r--r-- | usermux/mux.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/hostmux/mux.c b/hostmux/mux.c index 0d5906c4..4f03cc12 100644 --- a/hostmux/mux.c +++ b/hostmux/mux.c @@ -339,9 +339,9 @@ lookup_host (struct hostmux *mux, const char *host, struct node **node) if (was_cached) return 0; - + h_err = getaddrinfo (host, NULL, &hints, &ai); - if (! h_err) + if (! h_err) { h_err = lookup_addrinfo (mux, host, ai, node); freeaddrinfo (ai); @@ -440,6 +440,8 @@ error_t netfs_attempt_chmod (struct iouser *cred, struct node *node, mode_t mode) { mode &= ~S_ITRANS; + if ((mode & S_IFMT) == 0) + mode |= (node->nn_stat.st_mode & S_IFMT); if (node->nn->name || ((mode & S_IFMT) != (node->nn_stat.st_mode & S_IFMT))) return EOPNOTSUPP; else diff --git a/usermux/mux.c b/usermux/mux.c index 145bcf59..722ba2ec 100644 --- a/usermux/mux.c +++ b/usermux/mux.c @@ -1,7 +1,7 @@ /* Root usermux node - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - Written by Miles Bader <miles@gnu.ai.mit.edu> + Copyright (C) 1997,98,99,2000,02 Free Software Foundation, Inc. + Written by Miles Bader <miles@gnu.org> This file is part of the GNU Hurd. The GNU Hurd is free software; you can redistribute it and/or @@ -480,6 +480,8 @@ error_t netfs_attempt_chmod (struct iouser *cred, struct node *node, mode_t mode) { mode &= ~S_ITRANS; + if ((mode & S_IFMT) == 0) + mode |= (node->nn_stat.st_mode & S_IFMT); if (node->nn->name || ((mode & S_IFMT) != (node->nn_stat.st_mode & S_IFMT))) return EOPNOTSUPP; else |