Rather than altering chown, or invoking widespread changes to your filesystem, you could make a chown function which you put in root's ~/.profile or equivalent:
Remove the 'echo' once you've tested and are sure you want. And be careful testing it in case you call the real chown by accident! Run it on something harmless.
This won't catch everything modified by a chown -R.
Hi All,
I have changed the shell of the root accidentally to /sbin/bash :mad:
How do I change that? :(
To change that I need to go to ok prompt I think, and there I need to mount the root file system in order to make changes to the respective file.
Can any one please suggest how do I do... (4 Replies)
Hello all:
I have a couple of boxes located in New York, both running SunOS 5.6. I, unfortunately, am located in Pittsburgh and do not have console access to these boxes. A co-worker was attempting to build a user account in one of these boxes, and mistakenly did a: chown username *
... (5 Replies)
I accidentally changed to sudo chmod a=w to my /usr/bin folder on my macbook with OS 10.5.8... Please help! I can't even get into a terminal correctly cause it displays:
-bash: uname: command not found
-bash: cut: command not found
-bash: uname: command not found
-bash: cut: command not found... (6 Replies)
Hi Experts,
I have create a new user with uid and gid as 0 in SuSE-11 Server. After that all the files having root owner ship are showing as new user name as owner. If I login as root, and type 'id' command, it also shows the new user.
Sample output from my server.
host:~ # id
uid=0(test)... (4 Replies)
Hi.
I've had a little mishap.
To cut a long story short, I've accidentally recursively ran chown on a directory (actually a bunch of 'em). Not a problem in itself, but I had a slight error in the code I used to get the list of directories and ended up with a comment in the file ownership.
... (15 Replies)
Hi All,
I have to work in the late nights some times for server maintenance and in a hurry to complete I am accidentally changing ownership or permission of directories :(
which have similar names ( /var in root and var of some other directory ).:confused:
Can some one suggest me with the... (1 Reply)
Hi,
I have two SunOs sparc servers mac1 and mac2.
I have exchanged keys between them inorder to passwordless login ssh from mac1 to mac2.
However, it is failing after authentication.
Part of the debug is as below. Please suggest whats wrong and how do i fix that!! Note: i do not have... (1 Reply)
We are having occasional problems accessing some AIX servers. When this happens we cannot ssh to the server in question or login via HMC console terminal window. We can ssh some commands to the server and get responses but other commands just hang, ssh serverA date returns the date, ssh serverA... (5 Replies)
Discussion started by: Kierong
5 Replies
LEARN ABOUT DEBIAN
explain_chown_or_die
explain_chown_or_die(3) Library Functions Manual explain_chown_or_die(3)NAME
explain_chown_or_die - change ownership of a file and report errors
SYNOPSIS
#include <libexplain/chown.h>
void explain_chown_or_die(const char *pathname, int owner, int group);
DESCRIPTION
The explain_chown_or_die function is used to call the chown(2) system call. On failure an explanation will be printed to stderr, obtained
from explain_chown(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_chown_or_die(pathname, owner, group);
pathname
The pathname, exactly as to be passed to the chown(2) system call.
owner The owner, exactly as to be passed to the chown(2) system call.
group The group, exactly as to be passed to the chown(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO chown(2)
change ownership of a file
explain_chown(3)
explain chown(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_chown_or_die(3)