Package: nfs-user-server
Severity: normal
File: nfs-user-server

Hi!
        I am using nfs user server to export filesystem to freebsd
        client.

        I found a problem about it.
        In freebsd, some software (such as tar) will invoke lutimes
        and lchmod system call to change atrributes of a symlink.

        But since there is no lchmod and lutimes call on Linux system,
        When the file pointed by the symlink is not exist, the call
        (chmod and utimes) will fail.

        This issue will lead to some software such as pkg_add broken.

        The following patch will be a work around about this issue.

        I don't know whether it is useful for others and could be
        applied to the debian package version of nfs user server.

--- nfs-user-server-2.2beta47/setattr.c 1998-10-31 01:29:42.000000000 +0800
+++ nfs-user-server-2.2beta47-lepton/setattr.c  2005-08-08 22:52:15.000000000 
+0800
@@ -95,7 +95,8 @@ nfsstat setattr(char *path, sattr *attr,
                                tvp[1].tv_sec  = s->st_mtime;
                                tvp[1].tv_usec = 0;
                        }
-                       if (efs_utimes(path, tvp) < 0)
+                       if (efs_utimes(path, tvp) < 0 
+                               && (errno != ENOENT || lstat(path, &sbuf)))
                                goto failure;
                }
        }
@@ -105,7 +106,8 @@ nfsstat setattr(char *path, sattr *attr,
 
                if (mode != -1 && mode != 0xFFFF /* ultrix bug */
                 && (mode & 07777) != (s->st_mode & 07777)) {
-                       if (efs_chmod(path, mode) < 0)
+                       if (efs_chmod(path, mode) < 0
+                               && (errno != ENOENT || lstat(path, &sbuf)))
                                goto failure;
                        s->st_mode = (s->st_mode & ~07777) | (mode & 07777);
                }


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to