mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
io: Implement lchmod using fchmodat [BZ #14578]
This commit is contained in:
@ -9,6 +9,7 @@ extern int __lstat (const char *__file, struct stat *__buf);
|
|||||||
extern int __chmod (const char *__file, __mode_t __mode);
|
extern int __chmod (const char *__file, __mode_t __mode);
|
||||||
libc_hidden_proto (__chmod)
|
libc_hidden_proto (__chmod)
|
||||||
extern int __fchmod (int __fd, __mode_t __mode);
|
extern int __fchmod (int __fd, __mode_t __mode);
|
||||||
|
libc_hidden_proto (fchmodat)
|
||||||
extern __mode_t __umask (__mode_t __mask);
|
extern __mode_t __umask (__mode_t __mask);
|
||||||
extern int __mkdir (const char *__path, __mode_t __mode);
|
extern int __mkdir (const char *__path, __mode_t __mode);
|
||||||
libc_hidden_proto (__mkdir)
|
libc_hidden_proto (__mkdir)
|
||||||
|
@ -42,3 +42,4 @@ fchmodat (int fd, const char *file, mode_t mode, int flag)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
stub_warning (fchmodat)
|
stub_warning (fchmodat)
|
||||||
|
libc_hidden_def (fchmodat)
|
||||||
|
10
io/lchmod.c
10
io/lchmod.c
@ -1,4 +1,4 @@
|
|||||||
/* lchmod -- Change the protections of a file or symbolic link. Stub version.
|
/* lchmod -- Change the protections of a file or symbolic link. Generic version.
|
||||||
Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
@ -17,15 +17,13 @@
|
|||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
/* Change the protections of FILE to MODE. */
|
/* Change the protections of FILE to MODE. */
|
||||||
int
|
int
|
||||||
lchmod (const char *file, mode_t mode)
|
lchmod (const char *file, mode_t mode)
|
||||||
{
|
{
|
||||||
__set_errno (ENOSYS);
|
return fchmodat (AT_FDCWD, file, mode, AT_SYMLINK_NOFOLLOW);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stub_warning (lchmod)
|
|
||||||
|
@ -37,3 +37,4 @@ fchmodat (int fd, const char *file, mode_t mode, int flag)
|
|||||||
return __hurd_fail (err);
|
return __hurd_fail (err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (fchmodat)
|
||||||
|
@ -38,3 +38,4 @@ fchmodat (int fd, const char *file, mode_t mode, int flag)
|
|||||||
|
|
||||||
return INLINE_SYSCALL (fchmodat, 3, fd, file, mode);
|
return INLINE_SYSCALL (fchmodat, 3, fd, file, mode);
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (fchmodat)
|
||||||
|
Reference in New Issue
Block a user