public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] umask and sticky bit
@ 2007-03-28  7:17 Jorge Almeida
  2007-03-28  8:03 ` Alan McKinnon
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jorge Almeida @ 2007-03-28  7:17 UTC (permalink / raw
  To: gentoo-user

I would like the default permissions for directories created by a
particular user to be 1775. Is there some way to achieve this? I think
umask doesn't deal with the sticky bit.

-- 
Jorge Almeida
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28  7:17 [gentoo-user] [OT] umask and sticky bit Jorge Almeida
@ 2007-03-28  8:03 ` Alan McKinnon
  2007-03-28  9:32   ` Jorge Almeida
  2007-03-28 13:17 ` Albert Hopkins
  2007-04-06 10:39 ` Håkon Alstadheim
  2 siblings, 1 reply; 12+ messages in thread
From: Alan McKinnon @ 2007-03-28  8:03 UTC (permalink / raw
  To: gentoo-user

On Wednesday 28 March 2007, Jorge Almeida wrote:
> I would like the default permissions for directories created by a
> particular user to be 1775. Is there some way to achieve this? I
> think umask doesn't deal with the sticky bit.

I did a few simple tests here, I also find that umask doesn't like 
setting sticky and {s,g}uid. Maybe you can achieve the same result with 
acls?

What's the reason you want to set the sticky bit for thaqt user? With 
some more info, maybe we can come up with an alternative

Incidentally, even if we persuade umask to set the sticky bit on dirs, 
it's probably not what you want, as it'll make all files sticky as well

alan



-- 
Optimists say the glass is half full,
Pessimists say the glass is half empty,
Developers say wtf is the glass twice as big as it needs to be?

Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28  8:03 ` Alan McKinnon
@ 2007-03-28  9:32   ` Jorge Almeida
  2007-03-28 10:51     ` Alan McKinnon
  2007-03-28 11:57     ` Norberto Bensa
  0 siblings, 2 replies; 12+ messages in thread
From: Jorge Almeida @ 2007-03-28  9:32 UTC (permalink / raw
  To: gentoo-user

On Wed, 28 Mar 2007, Alan McKinnon wrote:

> On Wednesday 28 March 2007, Jorge Almeida wrote:
>> I would like the default permissions for directories created by a
>> particular user to be 1775. Is there some way to achieve this? I
>> think umask doesn't deal with the sticky bit.
>
> I did a few simple tests here, I also find that umask doesn't like
> setting sticky and {s,g}uid. Maybe you can achieve the same result with
> acls?
Probably, but I know nothing of acls. Probably an overkill, too.
>
> What's the reason you want to set the sticky bit for thaqt user? With
> some more info, maybe we can come up with an alternative
>
Just to allow users of a certain group to write to common directories
(not always the same, and which might be created by anyone of those
users) and avoid deleting each other's files. 
> Incidentally, even if we persuade umask to set the sticky bit on dirs,
> it's probably not what you want, as it'll make all files sticky as well
Yes, but isn't that more or less harmless?

Maybe I should cook up some script to do it only on directories, but it
would be nicer if it worked out of the unix box...
>
>
Thanks,

Jorge
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28  9:32   ` Jorge Almeida
@ 2007-03-28 10:51     ` Alan McKinnon
  2007-03-28 10:57       ` Jorge Almeida
  2007-03-28 11:57     ` Norberto Bensa
  1 sibling, 1 reply; 12+ messages in thread
From: Alan McKinnon @ 2007-03-28 10:51 UTC (permalink / raw
  To: gentoo-user

On Wednesday 28 March 2007, Jorge Almeida wrote:
> > What's the reason you want to set the sticky bit for thaqt user?
> > With some more info, maybe we can come up with an alternative
>
> Just to allow users of a certain group to write to common directories
> (not always the same, and which might be created by anyone of those
> users) and avoid deleting each other's files.

Could you rig it so these users will only create new dirs in a certain 
place, like /tmp or /var/tmp? If so, would a cron job running every 10 
minutes or so running this command be good enough?

find $TMP_DIR -group $GROUP -type d -exec chmod o+t {} \;


alan


-- 
Optimists say the glass is half full,
Pessimists say the glass is half empty,
Developers say wtf is the glass twice as big as it needs to be?

Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28 10:51     ` Alan McKinnon
@ 2007-03-28 10:57       ` Jorge Almeida
  0 siblings, 0 replies; 12+ messages in thread
From: Jorge Almeida @ 2007-03-28 10:57 UTC (permalink / raw
  To: gentoo-user

On Wed, 28 Mar 2007, Alan McKinnon wrote:

> On Wednesday 28 March 2007, Jorge Almeida wrote:
>
> Could you rig it so these users will only create new dirs in a certain
> place, like /tmp or /var/tmp? If so, would a cron job running every 10
> minutes or so running this command be good enough?
>
> find $TMP_DIR -group $GROUP -type d -exec chmod o+t {} \;
>
A cron job is not a good solution. I was hoping for something as basic
as umask, but I suppose there isn't. And acl is an imposing beast.

Never mind. A script will do it. (I just wanted to know whether some
basic, unknown to me, unix ressource could make it.)

Thanks,

Jorge
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28  9:32   ` Jorge Almeida
  2007-03-28 10:51     ` Alan McKinnon
@ 2007-03-28 11:57     ` Norberto Bensa
  2007-03-28 12:34       ` Jorge Almeida
  1 sibling, 1 reply; 12+ messages in thread
From: Norberto Bensa @ 2007-03-28 11:57 UTC (permalink / raw
  To: gentoo-user; +Cc: Jorge Almeida

Jorge Almeida wrote:
> > What's the reason you want to set the sticky bit for thaqt user? With
> > some more info, maybe we can come up with an alternative
>
> Just to allow users of a certain group to write to common directories
> (not always the same, and which might be created by anyone of those
> users) and avoid deleting each other's files.

Are your users running Windows? Is so, you can configure Samba to create 
directories with sticky bit set.

Regards,
Norberto
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28 11:57     ` Norberto Bensa
@ 2007-03-28 12:34       ` Jorge Almeida
  0 siblings, 0 replies; 12+ messages in thread
From: Jorge Almeida @ 2007-03-28 12:34 UTC (permalink / raw
  To: gentoo-user

On Wed, 28 Mar 2007, Norberto Bensa wrote:

>
> Are your users running Windows? Is so, you can configure Samba to create
> directories with sticky bit set.
>
No, linux-only.
> Regards,
> Norberto
>
Thanks,

Jorge
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28  7:17 [gentoo-user] [OT] umask and sticky bit Jorge Almeida
  2007-03-28  8:03 ` Alan McKinnon
@ 2007-03-28 13:17 ` Albert Hopkins
  2007-03-28 13:44   ` Jorge Almeida
  2007-04-06 10:39 ` Håkon Alstadheim
  2 siblings, 1 reply; 12+ messages in thread
From: Albert Hopkins @ 2007-03-28 13:17 UTC (permalink / raw
  To: gentoo-user

On Wed, 2007-03-28 at 08:17 +0100, Jorge Almeida wrote:
> I would like the default permissions for directories created by a
> particular user to be 1775. Is there some way to achieve this? I think
> umask doesn't deal with the sticky bit. 

You should probably use ACLs.  They may also obviate the need to set
directory sticky bits to begin with.

You did not explain why you want to do this, but you also want to
investigate whether g+s'ing the directory gives the effect you want.


--
Albert W. Hopkins

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28 13:17 ` Albert Hopkins
@ 2007-03-28 13:44   ` Jorge Almeida
  2007-03-28 16:44     ` Albert Hopkins
  0 siblings, 1 reply; 12+ messages in thread
From: Jorge Almeida @ 2007-03-28 13:44 UTC (permalink / raw
  To: gentoo-user

On Wed, 28 Mar 2007, Albert Hopkins wrote:

>
> You should probably use ACLs.  They may also obviate the need to set
> directory sticky bits to begin with.
I know, but learning ACL will not be a minor task (I think).
>
> You did not explain why you want to do this, but you also want to
> investigate whether g+s'ing the directory gives the effect you want.
>
It doesn't, but it would be the same problem, as to umask or similar.
>
Thanks.

-- 
Jorge Almeida
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28 13:44   ` Jorge Almeida
@ 2007-03-28 16:44     ` Albert Hopkins
  0 siblings, 0 replies; 12+ messages in thread
From: Albert Hopkins @ 2007-03-28 16:44 UTC (permalink / raw
  To: gentoo-user

On Wed, 2007-03-28 at 14:44 +0100, Jorge Almeida wrote:
> On Wed, 28 Mar 2007, Albert Hopkins wrote:
> 
> >
> > You should probably use ACLs.  They may also obviate the need to set
> > directory sticky bits to begin with.
> I know, but learning ACL will not be a minor task (I think).

POSIX ACLs are simple, and a logical extension of traditional
permissions.  Anyone who has ever messed with Windows or VMS ACLs would
be comforted to know that POSIX ACLs are much simpler.

> >
> > You did not explain why you want to do this, but you also want to
> > investigate whether g+s'ing the directory gives the effect you want.
> >
> It doesn't, but it would be the same problem, as to umask or similar.

You still haven't specified what exactly you are trying to accomplish
which makes it difficult to suggest a solution.
--
Albert W. Hopkins

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-03-28  7:17 [gentoo-user] [OT] umask and sticky bit Jorge Almeida
  2007-03-28  8:03 ` Alan McKinnon
  2007-03-28 13:17 ` Albert Hopkins
@ 2007-04-06 10:39 ` Håkon Alstadheim
  2007-04-07  7:38   ` Jorge Almeida
  2 siblings, 1 reply; 12+ messages in thread
From: Håkon Alstadheim @ 2007-04-06 10:39 UTC (permalink / raw
  To: gentoo-user

Jorge Almeida wrote:
> I would like the default permissions for directories created by a
> particular user to be 1775. Is there some way to achieve this? I think
> umask doesn't deal with the sticky bit.
>
umask is a MASK. The application suggests permissions on new files,
umask turns off the bits you do not want. I can not think of a fully
automatic solution to what you want to do.

-- 
Håkon Alstadheim / N-7510 Skatval / email:hakon@alstadheim.priv.no
tlf: 74 82 60 27 mob: 47 35 39 38
http://alstadheim.priv.no/hakon/ 
spamtrap: finnesikke@alstadheim.priv.no -- 1 hit & you are out

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [gentoo-user] [OT] umask and sticky bit
  2007-04-06 10:39 ` Håkon Alstadheim
@ 2007-04-07  7:38   ` Jorge Almeida
  0 siblings, 0 replies; 12+ messages in thread
From: Jorge Almeida @ 2007-04-07  7:38 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: TEXT/PLAIN, Size: 551 bytes --]

On Fri, 6 Apr 2007, Håkon Alstadheim wrote:

> Jorge Almeida wrote:
>> I would like the default permissions for directories created by a
>> particular user to be 1775. Is there some way to achieve this? I think
>> umask doesn't deal with the sticky bit.
>>
> umask is a MASK. The application suggests permissions on new files,
> umask turns off the bits you do not want. I can not think of a fully
> automatic solution to what you want to do.
OK, thank you. The "application suggests" part was what I didn't know.
>
>

-- 
Jorge Almeida

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-04-07  7:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-28  7:17 [gentoo-user] [OT] umask and sticky bit Jorge Almeida
2007-03-28  8:03 ` Alan McKinnon
2007-03-28  9:32   ` Jorge Almeida
2007-03-28 10:51     ` Alan McKinnon
2007-03-28 10:57       ` Jorge Almeida
2007-03-28 11:57     ` Norberto Bensa
2007-03-28 12:34       ` Jorge Almeida
2007-03-28 13:17 ` Albert Hopkins
2007-03-28 13:44   ` Jorge Almeida
2007-03-28 16:44     ` Albert Hopkins
2007-04-06 10:39 ` Håkon Alstadheim
2007-04-07  7:38   ` Jorge Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox