incubator-nuttx/fs/vfs
dongjiuzhu1 a2845faee3 fs/chmod/fchmod/lchmod: only set permissions by mode_t and ignore other bits
test case:

int main(void)
{
  struct stat buf;
  int ret;

  stat("test1.t", &buf);
  printf("test1.t st.mode:%x\n", buf.st_mode);
  stat("test.t", &buf);
  printf("test.t st.mode:%x\n", buf.st_mode);
  ret = chmod("test1.t", buf.st_mode);
  if (ret == 0)
    {
      stat("test1.t", &buf);
      printf("test1.t st.mode:%x\n", buf.st_mode);
    }

  return 0;
}

>>
test1.t st.mode:81b4
test.t st.mode:81fd
test1.t st.mode:81fd

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-23 14:57:37 +08:00
..
CMakeLists.txt fs/vfs:cmakelists add fs_lock config 2024-02-21 13:29:36 -03:00
Kconfig fs: add backtrace to where file opens 2024-06-24 23:53:59 +08:00
Make.defs fs_lock:Implementing file locks 2024-02-21 13:29:36 -03:00
fs_chstat.c fs/chmod/fchmod/lchmod: only set permissions by mode_t and ignore other bits 2024-09-23 14:57:37 +08:00
fs_close.c fs:notify add support for inotify 2024-08-22 01:50:37 +08:00
fs_dir.c nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
fs_dup.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_dup2.c fs_dup2:fix inode->i_crefs counting error 2024-09-19 02:55:13 +08:00
fs_epoll.c nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
fs_eventfd.c nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
fs_fchstat.c fs/chmod/fchmod/lchmod: only set permissions by mode_t and ignore other bits 2024-09-23 14:57:37 +08:00
fs_fcntl.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_fstat.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_fstatfs.c Fix vfs/fs_fstatfs.c:60:21: warning: variable 'inode' set but not used 2024-09-17 12:01:53 +08:00
fs_fsync.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_ioctl.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_link.c fs: Implment link as a normal function instead macro 2023-02-04 18:31:23 -03:00
fs_lock.c sched: use this_task replace nxsched_self 2024-09-05 09:33:50 -03:00
fs_lseek.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_mkdir.c fs:notify add support for inotify 2024-08-22 01:50:37 +08:00
fs_open.c BCH: Add readonly configuration for BCH devices 2024-09-19 03:53:20 +08:00
fs_poll.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_pread.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_pseudofile.c fs_inode:Change the type of i_crefs to atomic_int 2024-09-23 14:07:03 +08:00
fs_pwrite.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_read.c file_read: fix a bogus cast 2024-09-17 20:10:31 +08:00
fs_readlink.c nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
fs_rename.c fs/rename: Do not send notify if the same 2024-09-15 10:11:42 +08:00
fs_rmdir.c fs:notify add support for inotify 2024-08-22 01:50:37 +08:00
fs_select.c libc/fdcheck: add fdcheck module 2023-06-10 02:19:58 +08:00
fs_sendfile.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_signalfd.c nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
fs_stat.c fs/shmfs: Fix stat() system call for shmfs object 2024-02-02 09:12:18 -08:00
fs_statfs.c fs: move memset to upper lever for statfs 2023-06-16 11:10:25 +08:00
fs_symlink.c fs:notify add support for inotify 2024-08-22 01:50:37 +08:00
fs_syncfs.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_timerfd.c nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
fs_truncate.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
fs_unlink.c fs:notify add support for inotify 2024-08-22 01:50:37 +08:00
fs_write.c vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
lock.h fs_lock:Implementing file locks 2024-02-21 13:29:36 -03:00