#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:53+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man2/chown.2:38 #, no-wrap msgid "CHOWN" msgstr "" #. type: TH #: man-pages/man2/chown.2:38 #, no-wrap msgid "2014-05-21" msgstr "" #. type: TH #: man-pages/man2/chown.2:38 #, no-wrap msgid "Linux" msgstr "" #. type: TH #: man-pages/man2/chown.2:38 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man2/chown.2:39 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:41 msgid "chown, fchown, lchown, fchownat - change ownership of a file" msgstr "" #. type: SH #: man-pages/man2/chown.2:41 #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:44 #, no-wrap msgid "B<#include Eunistd.hE>\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:46 #, no-wrap msgid "" "BIB<, uid_t >IB<, gid_t " ">IB<);>\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:48 #, no-wrap msgid "BIB<, uid_t >IB<, gid_t >IB<);>\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:50 #, no-wrap msgid "" "BIB<, uid_t >IB<, gid_t " ">IB<);>\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:53 #, no-wrap msgid "" "B<#include Efcntl.hE >/* Definition of AT_* constants */\n" "B<#include Eunistd.hE>\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:56 #, no-wrap msgid "" "BIB<, const char *>IB<,>\n" "B< uid_t >IB<, gid_t >IB<, int >IB<);>\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:62 msgid "" "Feature Test Macro Requirements for glibc (see B(7)):" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:66 msgid "B(), B():" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:71 msgid "" "_BSD_SOURCE || _XOPEN_SOURCE\\ E=\\ 500 || _XOPEN_SOURCE\\ &&\\ " "_XOPEN_SOURCE_EXTENDED" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:73 msgid "|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\\ E=\\ 200809L" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:76 msgid "B():" msgstr "" #. type: TP #: man-pages/man2/chown.2:79 #, no-wrap msgid "Since glibc 2.10:" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:82 msgid "_XOPEN_SOURCE\\ E=\\ 700 || _POSIX_C_SOURCE\\ E=\\ 200809L" msgstr "" #. type: TP #: man-pages/man2/chown.2:82 #, no-wrap msgid "Before glibc 2.10:" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:85 msgid "_ATFILE_SOURCE" msgstr "" #. type: SH #: man-pages/man2/chown.2:88 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:96 msgid "" "These system calls change the owner and group of a file. The B(), " "B(), and B() system calls differ only in how the file is " "specified:" msgstr "" #. type: IP #: man-pages/man2/chown.2:96 man-pages/man2/chown.2:101 man-pages/man2/chown.2:105 man-pages/man2/chown.2:353 man-pages/man2/chown.2:358 man-pages/man2/chown.2:364 #, no-wrap msgid "*" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:101 msgid "" "B() changes the ownership of the file specified by I, " "which is dereferenced if it is a symbolic link." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:105 msgid "" "B() changes the ownership of the file referred to by the open file " "descriptor I." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:110 msgid "" "B() is like B(), but does not dereference symbolic links." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:119 msgid "" "Only a privileged process (Linux: one with the B capability) may " "change the owner of a file. The owner of a file may change the group of the " "file to any group of which that owner is a member. A privileged process " "(Linux: with B) may change the group arbitrarily." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:125 msgid "" "If the I or I is specified as -1, then that ID is not changed." msgstr "" #. In Linux 2.0 kernels, superuser was like everyone else #. In 2.2, up to 2.2.12, these bits were not cleared for superuser. #. Since 2.2.13, superuser is once more like everyone else. #. type: Plain text #: man-pages/man2/chown.2:145 msgid "" "When the owner or group of an executable file are changed by an unprivileged " "user the B and B mode bits are cleared. POSIX does not " "specify whether this also should happen when root does the B(); the " "Linux behavior depends on the kernel version. In case of a non-group-" "executable file (i.e., one for which the B bit is not set) the " "B bit indicates mandatory locking, and is not cleared by a " "B()." msgstr "" #. type: SS #: man-pages/man2/chown.2:145 #, no-wrap msgid "fchownat()" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:151 msgid "" "The B() system call operates in exactly the same way as " "B(), except for the differences described here." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:161 msgid "" "If the pathname given in I is relative, then it is interpreted " "relative to the directory referred to by the file descriptor I " "(rather than relative to the current working directory of the calling " "process, as is done by B() for a relative pathname)." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:173 msgid "" "If I is relative and I is the special value B, " "then I is interpreted relative to the current working directory of " "the calling process (like B())." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:179 msgid "If I is absolute, then I is ignored." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:184 msgid "" "The I argument is a bit mask created by ORing together 0 or more of " "the following values;" msgstr "" #. type: TP #: man-pages/man2/chown.2:184 #, no-wrap msgid "B (since Linux 2.6.39)" msgstr "" #. commit 65cfc6722361570bfe255698d9cd4dccaf47570d #. Before glibc 2.16, defining _ATFILE_SOURCE sufficed #. type: Plain text #: man-pages/man2/chown.2:207 msgid "" "If I is an empty string, operate on the file referred to by " "I (which may have been obtained using the B(2) B flag)." " In this case, I can refer to any type of file, not just a directory." " If I is B, the call operates on the current working " "directory. This flag is Linux-specific; define B<_GNU_SOURCE> to obtain its " "definition." msgstr "" #. type: TP #: man-pages/man2/chown.2:208 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:219 msgid "" "If I is a symbolic link, do not dereference it: instead operate on " "the link itself, like B(). (By default, B() dereferences " "symbolic links, like B().)" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:224 msgid "See B(2) for an explanation of the need for B()." msgstr "" #. type: SH #: man-pages/man2/chown.2:224 #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:229 msgid "" "On success, zero is returned. On error, -1 is returned, and I is set " "appropriately." msgstr "" #. type: SH #: man-pages/man2/chown.2:229 #, no-wrap msgid "ERRORS" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:232 msgid "" "Depending on the filesystem, errors other than those listed below can be " "returned." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:236 msgid "The more general errors for B() are listed below." msgstr "" #. type: TP #: man-pages/man2/chown.2:236 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:241 msgid "" "Search permission is denied on a component of the path prefix. (See also " "B(7).)" msgstr "" #. type: TP #: man-pages/man2/chown.2:241 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:245 msgid "I points outside your accessible address space." msgstr "" #. type: TP #: man-pages/man2/chown.2:245 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:249 msgid "Too many symbolic links were encountered in resolving I." msgstr "" #. type: TP #: man-pages/man2/chown.2:249 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:253 msgid "I is too long." msgstr "" #. type: TP #: man-pages/man2/chown.2:253 man-pages/man2/chown.2:279 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:256 msgid "The file does not exist." msgstr "" #. type: TP #: man-pages/man2/chown.2:256 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:259 msgid "Insufficient kernel memory was available." msgstr "" #. type: TP #: man-pages/man2/chown.2:259 man-pages/man2/chown.2:303 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:262 msgid "A component of the path prefix is not a directory." msgstr "" #. type: TP #: man-pages/man2/chown.2:262 man-pages/man2/chown.2:282 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:266 msgid "" "The calling process did not have the required permissions (see above) to " "change owner and/or group." msgstr "" #. type: TP #: man-pages/man2/chown.2:266 man-pages/man2/chown.2:285 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:269 msgid "The named file resides on a read-only filesystem." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:273 msgid "The general errors for B() are listed below:" msgstr "" #. type: TP #: man-pages/man2/chown.2:273 man-pages/man2/chown.2:295 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:276 msgid "The descriptor is not valid." msgstr "" #. type: TP #: man-pages/man2/chown.2:276 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:279 msgid "A low-level I/O error occurred while modifying the inode." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:282 man-pages/man2/chown.2:285 man-pages/man2/chown.2:288 msgid "See above." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:295 msgid "" "The same errors that occur for B() can also occur for B(). " " The following additional errors can occur for B():" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:299 msgid "I is not a valid file descriptor." msgstr "" #. type: TP #: man-pages/man2/chown.2:299 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:303 msgid "Invalid flag specified in I." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:309 msgid "" "I is relative and I is a file descriptor referring to a " "file other than a directory." msgstr "" #. type: SH #: man-pages/man2/chown.2:309 #, no-wrap msgid "VERSIONS" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:313 msgid "" "B() was added to Linux in kernel 2.6.16; library support was " "added to glibc in version 2.4." msgstr "" #. type: SH #: man-pages/man2/chown.2:313 #, no-wrap msgid "CONFORMING TO" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:318 msgid "" "B(), B(), B(): 4.4BSD, SVr4, POSIX.1-2001, POSIX.1-" "2008." msgstr "" #. chown(): #. SVr4 documents EINVAL, EINTR, ENOLINK and EMULTIHOP returns, but no #. ENOMEM. POSIX.1 does not document ENOMEM or ELOOP error conditions. #. fchown(): #. SVr4 documents additional EINVAL, EIO, EINTR, and ENOLINK #. error conditions. #. type: Plain text #: man-pages/man2/chown.2:327 msgid "" "The 4.4BSD version can be used only by the superuser (that is, ordinary " "users cannot give away files)." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:330 msgid "B(): POSIX.1-2008." msgstr "" #. type: SH #: man-pages/man2/chown.2:330 #, no-wrap msgid "NOTES" msgstr "" #. type: SS #: man-pages/man2/chown.2:331 #, no-wrap msgid "Ownership of new files" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:353 msgid "" "When a new file is created (by, for example, B(2) or B(2)), " "its owner is made the same as the filesystem user ID of the creating process." " The group of the file depends on a range of factors, including the type of " "filesystem, the options used to mount the filesystem, and whether or not the " "set-group-ID permission bit is enabled on the parent directory. If the " "filesystem supports the I<-o\\ grpid> (or, synonymously I<-o\\ bsdgroups>) " "and I<-o\\ nogrpid> (or, synonymously I<-o\\ sysvgroups>) B(8) " "options, then the rules are as follows:" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:358 msgid "" "If the filesystem is mounted with I<-o\\ grpid>, then the group of a new " "file is made the same as that of the parent directory." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:364 msgid "" "If the filesystem is mounted with I<-o\\ nogrpid> and the set-group-ID bit " "is disabled on the parent directory, then the group of a new file is made " "the same as the process's filesystem GID." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:370 msgid "" "If the filesystem is mounted with I<-o\\ nogrpid> and the set-group-ID bit " "is enabled on the parent directory, then the group of a new file is made the " "same as that of the parent directory." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:380 msgid "" "As at Linux 2.6.25, the I<-o\\ grpid> and I<-o\\ nogrpid> mount options are " "supported by ext2, ext3, ext4, and XFS. Filesystems that don't support " "these mount options follow the I<-o\\ nogrpid> rules." msgstr "" #. type: SS #: man-pages/man2/chown.2:380 #, no-wrap msgid "NFS" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:393 msgid "" "The B() semantics are deliberately violated on NFS filesystems which " "have UID mapping enabled. Additionally, the semantics of all system calls " "which access the file contents are violated, because B() may cause " "immediate access revocation on already open files. Client side caching may " "lead to a delay between the time where ownership have been changed to allow " "access for a user and the time where the file can actually be accessed by " "the user on other clients." msgstr "" #. type: SS #: man-pages/man2/chown.2:393 #, no-wrap msgid "Historical details" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:412 msgid "" "The original Linux B(), B(), and B() system calls " "supported only 16-bit user and group IDs. Subsequently, Linux 2.4 added " "B(), B(), and B(), supporting 32-bit IDs. The " "glibc B(), B(), and B() wrapper functions " "transparently deal with the variations across kernel versions." msgstr "" #. type: Plain text #: man-pages/man2/chown.2:427 msgid "" "In versions of Linux prior to 2.1.81 (and distinct from 2.1.46), B() " "did not follow symbolic links. Since Linux 2.1.81, B() does follow " "symbolic links, and there is a new system call B() that does not " "follow symbolic links. Since Linux 2.1.86, this new call (that has the same " "semantics as the old B()) has got the same syscall number, and " "B() got the newly introduced number." msgstr "" #. type: SH #: man-pages/man2/chown.2:427 #, no-wrap msgid "EXAMPLE" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:436 msgid "" "The following program changes the ownership of the file named in its second " "command-line argument to the value specified in its first command-line " "argument. The new owner can be specified either as a numeric user ID, or as " "a username (which is converted to a user ID by using B(3) to " "perform a lookup in the system password file)." msgstr "" #. type: SS #: man-pages/man2/chown.2:436 #, no-wrap msgid "Program source" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:442 #, no-wrap msgid "" "#include Epwd.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:449 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " uid_t uid;\n" " struct passwd *pwd;\n" " char *endptr;\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:454 #, no-wrap msgid "" " if (argc != 3 || argv[1][0] == \\(aq\\e0\\(aq) {\n" " fprintf(stderr, \"%s EownerE EfileE\\en\", argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:456 #, no-wrap msgid " uid = strtol(argv[1], &endptr, 10); /* Allow a numeric string */\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:463 #, no-wrap msgid "" " if (*endptr != \\(aq\\e0\\(aq) { /* Was not pure numeric string " "*/\n" " pwd = getpwnam(argv[1]); /* Try getting UID for username */\n" " if (pwd == NULL) {\n" " perror(\"getpwnam\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:466 #, no-wrap msgid " uid = pwd-Epw_uid;\n" " }\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:471 #, no-wrap msgid "" " if (chown(argv[2], uid, -1) == -1) {\n" " perror(\"chown\");\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:474 #, no-wrap msgid " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. type: SH #: man-pages/man2/chown.2:475 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:480 msgid "B(2), B(2), B(7), B(7)" msgstr "" #. type: SH #: man-pages/man2/chown.2:480 #, no-wrap msgid "COLOPHON" msgstr "" #. type: Plain text #: man-pages/man2/chown.2:488 msgid "" "This page is part of release 3.70 of the Linux I project. A " "description of the project, information about reporting bugs, and the latest " "version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/" "." msgstr ""