Feature Request: upon checkout create files as different group : svn:group property

2013-02-18 Thread Aviel , Gal
Hi Everybody,

We used a shared drive for our working copies that allot of people can see.

In order to enhance security we created a Unix group that only a few people are
members of.

It would be very helpful if subversion had a 'svn:group' that when present, then
upon checkout, all files will be created with group ownership as dictated by the
value of the svn:group property.

This identical to doing normal checkout then using the 'chgrp' command, but
obviously much much more convenient and robust.

If possible, also add 'svn:group-recur' that will make the 'chgrp' recursive
meaning 2 variants of this property: recursive and non-recursive.

any ideas and thoughts are most appreciated !

Thanks, Gal.







Re: Feature Request: upon checkout create files as different group : svn:group property

2013-02-18 Thread Thorsten Schöning
Guten Tag Aviel, Gal,
am Montag, 18. Februar 2013 um 11:14 schrieben Sie:

> any ideas and thoughts are most appreciated !

Things like file ownership are for good reasons something your OS
and/or filesystem should handle, if there's something not working for
you you should change your setup. Samba provides inheritance of
ownership, permissions etc., just don't use fixed masks and groups,
and all modern filesystems provider inheritance for easier setup, too.

If you checkout using clients on your share your feature request
either can't work, as the client checking out can't do things Samba
can't do, or it'S simply unnecessary to let your svn client so
permission and ownership changes because Samba should already have
done those, if it was configured properly. It is even a security risk
if the client had to do something after the checkout because there's a
time window were other users could see or change or whatever data
until permissions got fixed by the client. You surely don't want that,

If you don't checkout using the share then just configure your
filesystem properly, e.g. use inheritance and groups. That's what they
are made for.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail:thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow



Bug in mailer.py

2013-02-18 Thread Peelman, Nick
Using mailer.py fetched from: 
http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/mailer/

Running:

> root@svn:/home/svn/agsync/hooks# ./mailer.py commit /home/svn/agsync/ 8160 
> ../conf/mailer.conf 
> Traceback (most recent call last):
>   File "./mailer.py", line 1444, in 
> sys.argv[3:3+expected_args])
>   File "/usr/lib/python2.7/dist-packages/svn/core.py", line 281, in run_app
> return func(application_pool, *args, **kw)
>   File "./mailer.py", line 102, in main
> {'author': author,
> UnboundLocalError: local variable 'author' referenced before assignment


Fix:

~ Line 102:

>   if cmd == 'commit':
> revision = int(cmd_args[0])
> repos = Repository(repos_dir, revision, pool)
> cfg = Config(config_fname, repos,
>  {'author': repos.author,
>   'repos_basename': os.path.basename(repos.repos_dir)
>  })
> messenger = Commit(pool, cfg, repos)   

Use repos.author instead of just 'author'.

-nick

--
Peelman, Nick
n...@peelman.us






smime.p7s
Description: S/MIME cryptographic signature


Re: Bug in mailer.py

2013-02-18 Thread Daniel Shahaf
Agreed.  This was introduced in r1439592.  You can use r1439591 for now;
I'll commit your fix shortly.  Thanks!

Peelman, Nick wrote on Mon, Feb 18, 2013 at 15:55:40 -0500:
> Using mailer.py fetched from: 
> http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/mailer/
> 
> Running:
> 
> > root@svn:/home/svn/agsync/hooks# ./mailer.py commit /home/svn/agsync/ 8160 
> > ../conf/mailer.conf 
> > Traceback (most recent call last):
> >   File "./mailer.py", line 1444, in 
> > sys.argv[3:3+expected_args])
> >   File "/usr/lib/python2.7/dist-packages/svn/core.py", line 281, in run_app
> > return func(application_pool, *args, **kw)
> >   File "./mailer.py", line 102, in main
> > {'author': author,
> > UnboundLocalError: local variable 'author' referenced before assignment
> 
> 
> Fix:
> 
> ~ Line 102:
> 
> >   if cmd == 'commit':
> > revision = int(cmd_args[0])
> > repos = Repository(repos_dir, revision, pool)
> > cfg = Config(config_fname, repos,
> >  {'author': repos.author,
> >   'repos_basename': os.path.basename(repos.repos_dir)
> >  })
> > messenger = Commit(pool, cfg, repos)   
> 
> Use repos.author instead of just 'author'.
> 
> -nick
> 
> --
> Peelman, Nick
> n...@peelman.us
> 
> 
> 
> 




Re: Bug in mailer.py

2013-02-18 Thread Peelman, Nick
While you're in there :)

I was seeing a few more spam points than i liked, and a coupe of them were easy 
fixes:

   def mail_headers(self, group, params):
from email import Utils
subject = self.make_subject(group, params)
try:
  subject.encode('ascii')
except UnicodeError:
  from email.Header import Header
  subject = Header(subject, 'utf-8').encode()
hdrs = 'From: %s\n'\
   'To: %s\n'  \
   'Subject: %s\n' \
   'Date: %s\n' \
   'Message-ID: %s\n' \
   'MIME-Version: 1.0\n' \
   'Content-Type: text/plain; charset=UTF-8\n' \
   'Content-Transfer-Encoding: 8bit\n' \
   'X-Svn-Commit-Project: %s\n' \
   'X-Svn-Commit-Author: %s\n' \
   'X-Svn-Commit-Revision: %d\n' \
   'X-Svn-Commit-Repository: %s\n' \
   % (self.from_addr, ', '.join(self.to_addrs), subject, 
  Utils.formatdate(), Utils.make_msgid("r" + str(self.repos.rev)),
  group, self.repos.author or 'no_author', self.repos.rev,
  os.path.basename(self.repos.repos_dir))
if self.reply_to:
  hdrs = '%sReply-To: %s\n' % (hdrs, self.reply_to)
return hdrs + '\n'

Adds a Date header and a Message-ID with the revision property embedded at the 
end.  I also have a tweak with a new config line to allow you to ignore the 
directory inclusion on the subject line entirely (leaving only the revision 
(eg. r4939)), but unless you're interested, I'm willing to fight that battle 
another day.


-nick

--
Peelman, Nick
n...@peelman.us




On Feb 18, 2013, at 16:36, Daniel Shahaf  wrote:

> Agreed.  This was introduced in r1439592.  You can use r1439591 for now;
> I'll commit your fix shortly.  Thanks!
> 
> Peelman, Nick wrote on Mon, Feb 18, 2013 at 15:55:40 -0500:
>> Using mailer.py fetched from: 
>> http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/mailer/
>> 
>> Running:
>> 
>>> root@svn:/home/svn/agsync/hooks# ./mailer.py commit /home/svn/agsync/ 8160 
>>> ../conf/mailer.conf 
>>> Traceback (most recent call last):
>>>  File "./mailer.py", line 1444, in 
>>>sys.argv[3:3+expected_args])
>>>  File "/usr/lib/python2.7/dist-packages/svn/core.py", line 281, in run_app
>>>return func(application_pool, *args, **kw)
>>>  File "./mailer.py", line 102, in main
>>>{'author': author,
>>> UnboundLocalError: local variable 'author' referenced before assignment
>> 
>> 
>> Fix:
>> 
>> ~ Line 102:
>> 
>>>  if cmd == 'commit':
>>>revision = int(cmd_args[0])
>>>repos = Repository(repos_dir, revision, pool)
>>>cfg = Config(config_fname, repos,
>>> {'author': repos.author,
>>>  'repos_basename': os.path.basename(repos.repos_dir)
>>> })
>>>messenger = Commit(pool, cfg, repos)   
>> 
>> Use repos.author instead of just 'author'.
>> 
>> -nick
>> 
>> --
>> Peelman, Nick
>> n...@peelman.us
>> 
>> 
>> 
>> 
> 
> 



smime.p7s
Description: S/MIME cryptographic signature


Re: Bug in mailer.py

2013-02-18 Thread Daniel Shahaf
r1447513 fixes the bug you originally reported, Nick.

Peelman, Nick wrote on Mon, Feb 18, 2013 at 16:40:57 -0500:
> While you're in there :)
> 
> I was seeing a few more spam points than i liked, and a coupe of them were 
> easy fixes:
> 
>def mail_headers(self, group, params):

Can you send this as a proper unidiff (`svn diff` output) against
mailer.py@HEAD?

See http://subversion.apache.org/patches for a few other recommendations
that make our lives easier.

Thanks,

Daniel

> from email import Utils
> subject = self.make_subject(group, params)
> try:
>   subject.encode('ascii')
> except UnicodeError:
>   from email.Header import Header
>   subject = Header(subject, 'utf-8').encode()
> hdrs = 'From: %s\n'\
>'To: %s\n'  \
>'Subject: %s\n' \
>'Date: %s\n' \
>'Message-ID: %s\n' \
>'MIME-Version: 1.0\n' \
>'Content-Type: text/plain; charset=UTF-8\n' \
>'Content-Transfer-Encoding: 8bit\n' \
>'X-Svn-Commit-Project: %s\n' \
>'X-Svn-Commit-Author: %s\n' \
>'X-Svn-Commit-Revision: %d\n' \
>'X-Svn-Commit-Repository: %s\n' \
>% (self.from_addr, ', '.join(self.to_addrs), subject, 
>   Utils.formatdate(), Utils.make_msgid("r" + str(self.repos.rev)),
>   group, self.repos.author or 'no_author', self.repos.rev,
>   os.path.basename(self.repos.repos_dir))
> if self.reply_to:
>   hdrs = '%sReply-To: %s\n' % (hdrs, self.reply_to)
> return hdrs + '\n'
> 
> Adds a Date header and a Message-ID with the revision property embedded at 
> the end.  I also have a tweak with a new config line to allow you to ignore 
> the directory inclusion on the subject line entirely (leaving only the 
> revision (eg. r4939)), but unless you're interested, I'm willing to fight 
> that battle another day.
> 
> 
> -nick
> 
> --
> Peelman, Nick
> n...@peelman.us
> 
> 
> 
> 
> On Feb 18, 2013, at 16:36, Daniel Shahaf  wrote:
> 
> > Agreed.  This was introduced in r1439592.  You can use r1439591 for now;
> > I'll commit your fix shortly.  Thanks!
> > 
> > Peelman, Nick wrote on Mon, Feb 18, 2013 at 15:55:40 -0500:
> >> Using mailer.py fetched from: 
> >> http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/mailer/
> >> 
> >> Running:
> >> 
> >>> root@svn:/home/svn/agsync/hooks# ./mailer.py commit /home/svn/agsync/ 
> >>> 8160 ../conf/mailer.conf 
> >>> Traceback (most recent call last):
> >>>  File "./mailer.py", line 1444, in 
> >>>sys.argv[3:3+expected_args])
> >>>  File "/usr/lib/python2.7/dist-packages/svn/core.py", line 281, in run_app
> >>>return func(application_pool, *args, **kw)
> >>>  File "./mailer.py", line 102, in main
> >>>{'author': author,
> >>> UnboundLocalError: local variable 'author' referenced before assignment
> >> 
> >> 
> >> Fix:
> >> 
> >> ~ Line 102:
> >> 
> >>>  if cmd == 'commit':
> >>>revision = int(cmd_args[0])
> >>>repos = Repository(repos_dir, revision, pool)
> >>>cfg = Config(config_fname, repos,
> >>> {'author': repos.author,
> >>>  'repos_basename': os.path.basename(repos.repos_dir)
> >>> })
> >>>messenger = Commit(pool, cfg, repos)   
> >> 
> >> Use repos.author instead of just 'author'.
> >> 
> >> -nick
> >> 
> >> --
> >> Peelman, Nick
> >> n...@peelman.us
> >> 
> >> 
> >> 
> >> 
> > 
> > 
> 




Re: Bug in mailer.py

2013-02-18 Thread olli hauer
On 2013-02-18 22:51, Daniel Shahaf wrote:
> r1447513 fixes the bug you originally reported, Nick.
> 
> Peelman, Nick wrote on Mon, Feb 18, 2013 at 16:40:57 -0500:
>> While you're in there :)
>>
>> I was seeing a few more spam points than i liked, and a coupe of them were 
>> easy fixes:
>>
>>def mail_headers(self, group, params):
> 
> Can you send this as a proper unidiff (`svn diff` output) against
> mailer.py@HEAD?
> 
> See http://subversion.apache.org/patches for a few other recommendations
> that make our lives easier.
> 
> Thanks,
> 
> Daniel
> 

I also have a small patch on my wish-list ...

o add rfc2076 header (Precedence: bulk)
o add rfc3834 header (Auto-Submitted: auto-generated)
   (this header is already honored by dovecot2)
o add special header for MS Exchange
   (http://msdn.microsoft.com/en-us/library/ee219609%28v=EXCHG.80%29.aspx)


Index: tools/hook-scripts/mailer/mailer.py
===
--- tools/hook-scripts/mailer/mailer.py (revision 1447596)
+++ tools/hook-scripts/mailer/mailer.py (working copy)
@@ -246,9 +246,12 @@
 hdrs = 'From: %s\n'\
'To: %s\n'  \
'Subject: %s\n' \
+   'Precedence: bulk\n' \
+   'Auto-Submitted: auto-generated\n' \
'MIME-Version: 1.0\n' \
'Content-Type: text/plain; charset=UTF-8\n' \
'Content-Transfer-Encoding: 8bit\n' \
+   'X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply\n' \
'X-Svn-Commit-Project: %s\n' \
'X-Svn-Commit-Author: %s\n' \
'X-Svn-Commit-Revision: %d\n' \


Regards,
olli