Nouvelle tentative pour
darcs-hash:20040214191247-41617-871f45f0c616ea9ac2fcc736e898bcf0c52cbfea.gz
This commit is contained in:
parent
60b9eb3456
commit
6932c3e423
1 changed files with 9 additions and 7 deletions
12
syncmail
12
syncmail
|
@ -232,13 +232,15 @@ def blast_mail(subject, people, filestodiff, contextlines, fromhost):
|
||||||
conn.connect(MAILHOST, MAILPORT)
|
conn.connect(MAILHOST, MAILPORT)
|
||||||
user = pwd.getpwuid(os.getuid())[0]
|
user = pwd.getpwuid(os.getuid())[0]
|
||||||
|
|
||||||
if user=="root" :
|
|
||||||
# Obtention du real user => signature automatique des commits
|
# Obtention du real user => signature automatique des commits
|
||||||
for proc in os.popen("ps a -o user,command,tty | grep $(ps h -o tty %s)" % os.getpid() ).readlines() :
|
ppid=os.getpid()
|
||||||
userp=string.split(proc,' ')[0]
|
while user=='root' :
|
||||||
if userp=="root" : break
|
ppid,user = string.split(string.strip(os.popen("ps --no-headers -o ppid,user %s" % ppid).readlines()[0]))
|
||||||
else : user=userp
|
if ppid=='1' :
|
||||||
|
# C'est init, l'user est donc bien root
|
||||||
|
break
|
||||||
|
|
||||||
|
userp='pauget'
|
||||||
domain = fromhost or getfqdn()
|
domain = fromhost or getfqdn()
|
||||||
#Modif cosmétique pour afficher un sujet explicite :
|
#Modif cosmétique pour afficher un sujet explicite :
|
||||||
host = string.split(domain,'.')
|
host = string.split(domain,'.')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue