Sponsored Content
Full Discussion: chown doesn't work
Top Forums UNIX for Advanced & Expert Users chown doesn't work Post 100971 by shriashishpatil on Friday 3rd of March 2006 05:04:34 AM
Old 03-03-2006
There is no mention of rstchown in /etc/system file.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Why doesn't this work?

cat .servers | while read LINE; do ssh jason@$LINE $1 done exit 1 ./command.ksh "ls -l ~jason" Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing? Thanks! JP (2 Replies)
Discussion started by: jpeery
2 Replies

2. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

3. UNIX for Dummies Questions & Answers

my make doesn't work

hi I wrote the following makefile, I have just one problem, when i type make clean I get the message make 'clean' is up to date and any obj file is removed from my folder, what's wrong? Thank you CC = cc all: es.o elaboration.o $(CC) -o es es.o elaboration.o elaboration.o:... (0 Replies)
Discussion started by: Puntino
0 Replies

4. Shell Programming and Scripting

alias doesn't work

Hi I have put alias ll='ls -la' in .profile file but it doesn't work. On hand it works it looks like the .profile file is not beeing read. How to check whitch file is loaded? ,profile? .bash_profile? My system: SunOS mion 5.10 Generic Shell: /bin/pfksh Thanks (2 Replies)
Discussion started by: miojamo
2 Replies

5. Shell Programming and Scripting

What to do when mtime doesn't work?

I have a folder that I need to search for new files and copy on the latest. I've been using "-mtime -1" in my command line but it doesn't seem to work. I've been meaning to fine a different script because files are dropped into the folder all day long and because of the -mtime, I've only be... (19 Replies)
Discussion started by: bbbngowc
19 Replies

6. Shell Programming and Scripting

Lipo doesn't work

Hi guys, Am using lipo to merge ppc and i386 version of a static/dylib file based on "file type to load". I am working on Mac OS 10.5.6 and new to shell scripting. Please help me out. This is my code. echo "This file combine ppc and i386 file to form universal library" echo "source... (4 Replies)
Discussion started by: vishwesh
4 Replies

7. UNIX for Dummies Questions & Answers

Why doesn't this work?

find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \; Returns this failure: mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies

8. Shell Programming and Scripting

Why my awk doesn't work?

root@SDP_Wildcat_Pass-3-C1:~# cat /proc/driver/rtc rtc_time : 05:29:40 rtc_date : 2014-12-19 alrm_time : 01:51:53 alrm_date : 2014-12-20 alarm_IRQ : no alrm_pending : no update IRQ enabled : no periodic IRQ enabled : no periodic IRQ... (4 Replies)
Discussion started by: yanglei_fage
4 Replies

9. Shell Programming and Scripting

-ne 0 doesn't work -le does

Hi, I am using korn shell. until ] do echo "\$# = " $# echo "$1" shift done To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work. Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
chown(2)							   System Calls 							  chown(2)

NAME
chown, lchown, fchown, fchownat - change owner and group of a file SYNOPSIS
#include <unistd.h> #include <sys/types.h> int chown(const char *path, uid_t owner, gid_t group); int lchown(const char *path, uid_t owner, gid_t group); int fchown(int fildes, uid_t owner, gid_t group); int fchownat(int fildes, const char *path, uid_t owner, gid_t group, int flag); DESCRIPTION
The chown() function sets the owner ID and group ID of the file specified by path or referenced by the open file descriptor fildes to owner and group respectively. If owner or group is specified as -1, chown() does not change the corresponding ID of the file. The lchown() function sets the owner ID and group ID of the named file in the same manner as chown(), unless the named file is a symbolic link. In this case, lchown() changes the ownership of the symbolic link file itself, while chown() changes the ownership of the file or directory to which the symbolic link refers. The fchownat() function sets the owner ID and group ID of the named file in the same manner as chown(). If, however, the path argument is relative, the path is resolved relative to the fildes argument rather than the current working directory. If the fildes argument has the special value AT_FDCWD, the path resolution reverts back to current working directory relative. If the flag argument is set to SYMLNK, the function behaves like lchown() with respect to symbolic links. If the path argument is absolute, the fildes argument is ignored. If the path argument is a null pointer, the function behaves like fchown(). If chown(), lchown(), fchown(), or fchownat() is invoked by a process that does not have {PRIV_FILE_SETID} asserted in its effective set, the set-user-ID and set-group-ID bits of the file mode, S_ISUID and S_ISGID respectively, are cleared (see chmod(2)). Additional restric- tions apply when changing the ownership to uid 0. The operating system defines several privileges to override restrictions on the chown() family of functions. When the {PRIV_FILE_CHOWN} privilege is asserted in the effective set of the current process, there are no restrictions except in the special circumstances of chang- ing ownership to or from uid 0. When the {PRIV_FILE_CHOWN_SELF} privilege is asserted, ownership changes are restricted to the files of which the ownership matches the effective user ID of the current process. If neither privilege is asserted in the effective set of the calling process, ownership changes are limited to changes of the group of the file to the list of supplementary group IDs and the effective group ID. The operating system provides a configuration option, {_POSIX_CHOWN_RESTRICTED}, to control the default behavior of processes and the behavior of the NFS server. If {_POSIX_CHOWN_RESTRICTED} is not in effect, the privilege {PRIV_FILE_CHOWN_SELF} is asserted in the inheri- table set of all processes unless overridden by policy.conf(4) or user_attr(4). To set this configuration option, include the following line in /etc/system: set rstchown = 1 To disable this option, include the following line in /etc/system: set rstchown = 0 See system(4) and fpathconf(2). Upon successful completion, chown(), fchown() and lchown() mark for update the st_ctime field of the file. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned, the owner and group of the named file remain unchanged, and errno is set to indicate the error. ERRORS
All of these functions will fail if: EPERM The effective user ID does not match the owner of the file and the {PRIV_FILE_CHOWN} privilege is not asserted in the effective set of the calling process, or the {PRIV_FILE_CHOWN_SELF} privilege is not asserted in the effective set of the calling process. The chown(), lchown(), and fchownat() functions will fail if: EACCES Search permission is denied on a component of the path prefix of path. EFAULT The path argument points to an illegal address and for fchownat(), the file descriptor has the value AT_FDCWD. EINTR A signal was caught during the execution of the chown() or lchown() function. EINVAL The group or owner argument is out of range. EIO An I/O error occurred while reading from or writing to the file system. ELOOP Too many symbolic links were encountered in translating path. ENAMETOOLONG The length of the path argument exceeds {PATH_MAX}, or the length of a path component exceeds {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect. ENOLINK The path argument points to a remote machine and the link to that machine is no longer active. ENOENT Either a component of the path prefix or the file referred to by path does not exist or is a null pathname. ENOTDIR A component of the path prefix of path is not a directory, or the path supplied to fchownat() is relative and the file descriptor provided does not refer to a valid directory. EROFS The named file resides on a read-only file system. The fchown() and fchownat() functions will fail if: EBADF For fchown() the fildes argument is not an open file descriptor and. For fchownat(), the path argument is not absolute and the fildes argument is not AT_FDCWD or an open file descriptor. EIO An I/O error occurred while reading from or writing to the file system. EINTR A signal was caught during execution of the function. ENOLINK The fildes argument points to a remote machine and the link to that machine is no longer active. EINVAL The group or owner argument is out of range. EROFS The named file referred to by fildes resides on a read-only file system. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ |MT-Level |See below. | +-----------------------------+-----------------------------+ The chown(), fchown(), and lchown() functions are Standard. The fchownat() function is Evolving. The chown() and fchownat() functions are Async-Signal-Safe. SEE ALSO
chgrp(1), chown(1), chmod(2), fpathconf(2), system(4), attributes(5), standards(5) SunOS 5.11 9 Oct 2008 chown(2)
All times are GMT -4. The time now is 01:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy