Author: johalun
Date: Tue May 28 20:54:59 2019
New Revision: 348338
URL: https://svnweb.freebsd.org/changeset/base/348338

Log:
  pseudofs: Ignore unsupported commands in vop_setattr.
  
  Users of pseudofs (e.g. lindebugfs), should be able to receive
  input from command line via commands like "echo 1 > /path/to/file".
  Currently this fails because sh tries to truncate the file first and
  vop_setattr returns not supported error for this. This patch simply
  ignores the error and returns 0 instead.
  
  Reviewed by:  imp (mentor), asomers
  Approved by:  imp (mentor), asomers
  MFC after:    1 week
  Differential Revision: D20451

Modified:
  head/sys/fs/pseudofs/pseudofs_vnops.c

Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c       Tue May 28 20:44:23 2019        
(r348337)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c       Tue May 28 20:54:59 2019        
(r348338)
@@ -967,7 +967,8 @@ pfs_setattr(struct vop_setattr_args *va)
        PFS_TRACE(("%s", pn->pn_name));
        pfs_assert_not_owned(pn);
 
-       PFS_RETURN (EOPNOTSUPP);
+       /* Silently ignore unchangeable attributes. */
+       PFS_RETURN (0);
 }
 
 /*
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to