Is this normal? Fedora10 here...
# users fcassia fcassia fcassia fcassia fcassia fcassia fcassia [root@doscabezas]# groups root bin daemon sys adm disk wheel
Somehow I inardvertedly ended up with a bunch of folders owned by root, and when I attempted to move those around from the user account (fcassia) I got permission issues, as expected.
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
all was fine but one particular file doesn't want to be changed... chown: invalid user: `mail-backup.zip'
I must be doing something wrong... FC PS: I figured it out... I had the parameters for chown reversed... file name is always last.Sheesh. Still, is the multiple "fcassia" accounts output from "accounts" normal?
On Mon, Feb 28, 2011 at 11:46 AM, Fernando Cassia fcassia@gmail.com wrote:
Is this normal? Fedora10 here...
# users fcassia fcassia fcassia fcassia fcassia fcassia fcassia
You have opened 7 connections (maybe terminal) with your host,
[root@doscabezas]# groups root bin daemon sys adm disk wheel
Somehow I inardvertedly ended up with a bunch of folders owned by root, and when I attempted to move those around from the user account (fcassia) I got permission issues, as expected.
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
all was fine but one particular file doesn't want to be changed... chown: invalid user: `mail-backup.zip'
Or you could have got : file not found : fcassia
I must be doing something wrong... FC PS: I figured it out... I had the parameters for chown reversed... file name is always last.Sheesh. Still, is the multiple "fcassia" accounts output from "accounts" normal? -- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 07:47 AM, Alain Spineux wrote:
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
You should also avoid doing chown -R with just a * wildcard as this could possibly recursively follow ../ which would then try and change ownership on things you don't want changed.
On Mon, 2011-02-28 at 16:34 -0600, Larry Brower wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 07:47 AM, Alain Spineux wrote:
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
You should also avoid doing chown -R with just a * wildcard as this could possibly recursively follow ../ which would then try and change ownership on things you don't want changed.
The Shell will not normally expand * to a name beginning with ".". Try it:
$ echo *
See "info bash":
When a pattern is used for filename expansion, the character `.' at the start of a filename or immediately following a slash must be matched explicitly, unless the shell option `dotglob' is set.
poc
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 05:15 PM, Patrick O'Callaghan wrote:
The Shell will not normally expand * to a name beginning with ".". Try it:
$ echo *
See "info bash":
When a pattern is used for filename expansion, the character `.' at the start of a filename or immediately following a slash must be matched explicitly, unless the shell option `dotglob' is set.
poc
I would say this all depends on the application being invoked and would still say it is bad to just use * as opposed to say ./*
I can't count the number of people Ive seen do things like rm -rf * in a directory and it recursively started working on / and /bin etc...
On 2/28/2011 3:23 PM, Larry Brower wrote:
I would say this all depends on the application being invoked and would still say it is bad to just use * as opposed to say ./*
I can't count the number of people Ive seen do things like rm -rf * in a directory and it recursively started working on / and /bin etc...
Not to be a pest, but if you worry about '*' expanding to include dotfiles, then why do you think that './*' is safe? Furthermore, '*' expansion is handled by the shell, not the application--in other words, dotglob rules the day.
The '*' there will just as well include dotfiles (i.e., it won't unless dotglob is set as another poster indicated). I definitely agree that caution is warranted when using '*' in any command that can do horrible things to your files, especially for things like 'rm -rf', but don't travel under the misconception that './*' is going to save your bacon--because it won't.
-se
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 06:54 PM, Steve Ellis wrote:
On 2/28/2011 3:23 PM, Larry Brower wrote:
I would say this all depends on the application being invoked and would still say it is bad to just use * as opposed to say ./*
I can't count the number of people Ive seen do things like rm -rf * in a directory and it recursively started working on / and /bin etc...
Not to be a pest, but if you worry about '*' expanding to include dotfiles, then why do you think that './*' is safe? Furthermore, '*' expansion is handled by the shell, not the application--in other words, dotglob rules the day.
The '*' there will just as well include dotfiles (i.e., it won't unless dotglob is set as another poster indicated). I definitely agree that caution is warranted when using '*' in any command that can do horrible things to your files, especially for things like 'rm -rf', but don't travel under the misconception that './*' is going to save your bacon--because it won't.
-se
./ explicitly specifies the CWD so what is your basis for saying it wont? While I will admit there could be other factors at play for rm recursively working on the systems Ive seen it happen on I can't say with certainty that there was as files like /etc/profile and /etc/bashrc were already removed by the time I had to work on the issue.
On Mon, 2011-02-28 at 20:01 -0600, Larry Brower wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 06:54 PM, Steve Ellis wrote:
On 2/28/2011 3:23 PM, Larry Brower wrote:
I would say this all depends on the application being invoked and would still say it is bad to just use * as opposed to say ./*
I can't count the number of people Ive seen do things like rm -rf * in a directory and it recursively started working on / and /bin etc...
Not to be a pest, but if you worry about '*' expanding to include dotfiles, then why do you think that './*' is safe? Furthermore, '*' expansion is handled by the shell, not the application--in other words, dotglob rules the day.
The '*' there will just as well include dotfiles (i.e., it won't unless dotglob is set as another poster indicated). I definitely agree that caution is warranted when using '*' in any command that can do horrible things to your files, especially for things like 'rm -rf', but don't travel under the misconception that './*' is going to save your bacon--because it won't.
-se
./ explicitly specifies the CWD so what is your basis for saying it wont? While I will admit there could be other factors at play for rm recursively working on the systems Ive seen it happen on I can't say with certainty that there was as files like /etc/profile and /etc/bashrc were already removed by the time I had to work on the issue.
You're confusing path searching, which ./ will block (e.g. run ./ls instead of ls) with filename expansion, which ./ will have no effect on.
If you do "cd /; rm -rf *" then bad things will happen. If you do "cd /; rm -rf ./*" then exactly the same bad things will happen.
poc
On Mon, Feb 28, 2011 at 8:15 PM, Patrick O'Callaghan pocallaghan@gmail.com wrote:
The Shell will not normally expand * to a name beginning with ".".
Agreed. A tempest in a teapot.
If it did, any command with * will affect the entire filesystem as everything is linked to levels above it with ".."
FC
On Mon, Feb 28, 2011 at 4:34 PM, Larry Brower larry@maxqe.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 07:47 AM, Alain Spineux wrote:
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
You should also avoid doing chown -R with just a * wildcard as this could possibly recursively follow ../ which would then try and change ownership on things you don't want changed.
Out of curiosity how can you configure bash to expand a simple * to include ..?
Of course recursive changes are always dangerous since there may be symlinks uncovered in the recursion pointing all over the place ...
John
On Monday, February 28, 2011 10:53:34 pm inode0 wrote:
On Mon, Feb 28, 2011 at 4:34 PM, Larry Brower larry@maxqe.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 07:47 AM, Alain Spineux wrote:
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
You should also avoid doing chown -R with just a * wildcard as this could possibly recursively follow ../ which would then try and change ownership on things you don't want changed.
Out of curiosity how can you configure bash to expand a simple * to include ..?
You can't. That's the point. The parent post is wrong. It would be totally insane for shell to expand * to include ../ Then any recursive operation on any directory level would also recurse up all the way up to / . That's absurd.
Of course recursive changes are always dangerous since there may be symlinks uncovered in the recursion pointing all over the place ...
If it's a symlink, the operation would happen to the symlink, not the file it's pointing too. I am not saying one should not be careful to use * and recursive, but it's also useful to know exactly what can and cannot happen.
AC
On Tue, Mar 1, 2011 at 1:12 PM, Armelius Cameron armeliusc@gmail.com wrote:
On Monday, February 28, 2011 10:53:34 pm inode0 wrote:
On Mon, Feb 28, 2011 at 4:34 PM, Larry Brower larry@maxqe.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 07:47 AM, Alain Spineux wrote:
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
You should also avoid doing chown -R with just a * wildcard as this could possibly recursively follow ../ which would then try and change ownership on things you don't want changed.
Out of curiosity how can you configure bash to expand a simple * to include ..?
You can't. That's the point. The parent post is wrong. It would be totally insane for shell to expand * to include ../ Then any recursive operation on any directory level would also recurse up all the way up to / . That's absurd.
Yes, I am giving the parent poster a chance to show us how it is possible.
Of course recursive changes are always dangerous since there may be symlinks uncovered in the recursion pointing all over the place ...
If it's a symlink, the operation would happen to the symlink, not the file it's pointing too. I am not saying one should not be careful to use * and recursive, but it's also useful to know exactly what can and cannot happen.
Whether symlinks are followed recursively is a function of the program actually called recursively and often what options are used to call it. chown -HR foo * will on many systems for example try to change the ownership of files after traversing the matched symlinks.
John
On Tue, Mar 1, 2011 at 5:09 PM, inode0 inode0@gmail.com wrote:
Yes, I am giving the parent poster a chance to show us how it is possible.
I initiated this thread and I find it pretty absurd how it´s got into an entirely different discussion.
Whoever made that claim about * extending to the parent directory wasn´t me.
FC
On Tue, Mar 1, 2011 at 1:12 PM, Armelius Cameron armeliusc@gmail.com wrote:
On Monday, February 28, 2011 10:53:34 pm inode0 wrote:
On Mon, Feb 28, 2011 at 4:34 PM, Larry Brower larry@maxqe.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
On 02/28/2011 07:47 AM, Alain Spineux wrote:
So I did SUDO -i, and from root as shell I tried to chown -hR * fcassia on the Desktop folder...
You must switch the star and our user name
chown -hR fcassia *
You should also avoid doing chown -R with just a * wildcard as this could possibly recursively follow ../ which would then try and change ownership on things you don't want changed.
Out of curiosity how can you configure bash to expand a simple * to include ..?
Not as explicit as it could be, but search
http://www.gnu.org/software/coreutils/manual/coreutils.txt
for "cending" to see if you can find any evidence the commands will ascend above the current directory.
Perhaps one example at that URL is useful:
# Change the owner of /u and subfiles to "root". chown -hR root /u
Note the use of the term subfiles.
regards/vaden@texoma.net