The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how can i add a user to a group arunkumar_mca UNIX for Dummies Questions & Answers 4 06-15-2008 10:06 AM
Adding user to a group without SAM paqman HP-UX 2 08-15-2007 04:05 AM
Adding a user to a group TRUEST UNIX for Dummies Questions & Answers 5 11-14-2003 07:28 AM
User and Group Structure dwchapman UNIX for Dummies Questions & Answers 1 04-01-2002 02:49 AM
User Group errolg UNIX for Dummies Questions & Answers 1 01-03-2002 06:50 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-07-2002
Registered User
 

Join Date: Mar 2001
Posts: 17
user/group

Hi!

Herez the scenario

1. logged in as user xxxx

$ id
uid=125(xxxx) gid=101(my_grp) groups=0(system),15(users),16(sysadmin),19(adm),110(appl)

$ touch test
$ ls -la test
-rw-r--r-- 1 xxxx system 0 Mar 7 14:31 test

Why is the group of the file test 'system' and not 'my_grp' as I was expecting it?


Any thoughts?

Thanks!
Forum Sponsor
  #2 (permalink)  
Old 03-07-2002
thehoghunter
Guest
 

Posts: n/a
What version of OS? (Mind didn't show all my groups when I typed just the id command, I had to add a -a).

Check the .profile, .login, .kshrc, .cshrc (it matters which shell you are using) for any lines that are changing your default group to another. It's possible but unlikely that it is in /etc/profile where the change is being made.

That's a start...
  #3 (permalink)  
Old 03-08-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,352
Originally files were created with the uid and gid of the process that created them. But when BSD came out they introduced multiple groups. They also decided, for some odd reason, that new files would take the gid of the directory in which they were created.

HP-UX and SunOS both copied multiple groups from BSD. But they have new files get the gid from the creating process just like System V. However they both have a secret way to obtain the old BSD behavior. If a directory has the sgid turned on, then new files are created with the same gid as the directory, not the process.

It's not easy to get that bit turned on. On HP-UX you must be root and "chmod 2755 ." did the trick. With SunOS, not only did I have to be root but also I was forced to use the mystic incantation "chmod g+s ." to turn that bit on. Once I got the bit turned on, both OS'es exhibited the BSD behavior.

So take a look at the directories permissions, I'll bet that is the answer. And I too would like to know which OS you are using. I wonder how far this concept has spread.
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0