sadms-2.0.15/ 0000755 0001750 0001750 00000000000 11522607043 012554 5 ustar gauvain gauvain sadms-2.0.15/Makefile-ubu 0000644 0001750 0001750 00000005364 11467724333 015027 0 ustar gauvain gauvain # sadms make file
# bbou@ac-toulouse.fr
# 2007-05-22 16:06:54
VERSION=2.0.15
UBUNTUFOLDER = ubuntu
DEBFULLNAME = "Bernard Bou"
DEBEMAIL = "bbou@ac-toulouse.fr"
default:
showconfig:
@echo "version: $(VERSION)"
sadms-$(VERSION).tar.gz:
make dist
pkg-ubuntu: sadms-$(VERSION).tar.gz build-ubuntu
cd $(UBUNTUFOLDER)/sadms-$(VERSION); dpkg-buildpackage -rfakeroot
dpkg-scanpackages $(UBUNTUFOLDER)/ /dev/null | gzip > $(UBUNTUFOLDER)/Packages.gz
build-ubuntu:
rm -fR $(UBUNTUFOLDER)
mkdir -p $(UBUNTUFOLDER)
cd $(UBUNTUFOLDER); tar xvzf ../sadms-$(VERSION).tar.gz
cd $(UBUNTUFOLDER)/sadms-$(VERSION); export DEBEMAIL=$(DEBEMAIL) ; export DEBFULLNAME=$(DEBFULLNAME) ; echo 'y' | dh_make --single --createorig
cp $(UBUNTUFOLDER)/sadms-$(VERSION)/sadms-deb.control $(UBUNTUFOLDER)/sadms-$(VERSION)/debian/control
cp $(UBUNTUFOLDER)/sadms-$(VERSION)/sadms-deb.rules $(UBUNTUFOLDER)/sadms-$(VERSION)/debian/rules
cp $(UBUNTUFOLDER)/sadms-$(VERSION)/sadms-deb.changelog $(UBUNTUFOLDER)/sadms-$(VERSION)/debian/changelog
predist:
[ -L pre ] && rm -f pre
ln -s bin/pre pre
[ -L START ] && rm -f START
ln -s pre/start.sh START
dist-ubuntu: predist pkg-ubuntu
tar cvf sadms-install-ubu-$(VERSION).tar -C .. \
sadms-$(VERSION)/pre/start.sh \
sadms-$(VERSION)/pre/lsb_release.sh \
sadms-$(VERSION)/pre/_check-samba.sh \
sadms-$(VERSION)/pre/_include.sh \
sadms-$(VERSION)/pre/_include-distribution.sh \
sadms-$(VERSION)/pre/_include-defaults.sh \
sadms-$(VERSION)/pre/_preinstall.sh \
sadms-$(VERSION)/pre/_preinstall-ubuntu.sh \
sadms-$(VERSION)/START \
sadms-$(VERSION)/AUTHORS \
sadms-$(VERSION)/COPYING \
sadms-$(VERSION)/README \
sadms-$(VERSION)/CHANGELOG \
sadms-$(VERSION)/NEWS
find ../sadms-$(VERSION)/$(UBUNTUFOLDER) -maxdepth 1 -name "*deb" -o -name "*dsc" | sed 's/\.\.\///g' | tar rvf sadms-install-ubu-$(VERSION).tar -C .. -T -
gzip -f sadms-install-ubu-$(VERSION).tar
tar cvf sadms-pkg-ubu-$(VERSION).tar -C .. \
sadms-$(VERSION)/pre/start.sh \
sadms-$(VERSION)/pre/lsb_release.sh \
sadms-$(VERSION)/pre/_check-samba.sh \
sadms-$(VERSION)/pre/_include.sh \
sadms-$(VERSION)/pre/_include-distribution.sh \
sadms-$(VERSION)/pre/_include-defaults.sh \
sadms-$(VERSION)/pre/_preinstall.sh \
sadms-$(VERSION)/pre/_preinstall-ubuntu.sh \
sadms-$(VERSION)/START \
sadms-$(VERSION)/AUTHORS \
sadms-$(VERSION)/COPYING \
sadms-$(VERSION)/README \
sadms-$(VERSION)/CHANGELOG \
sadms-$(VERSION)/NEWS
find ../sadms-$(VERSION)/$(UBUNTUFOLDER) -maxdepth 1 -name "*deb" -o -name "*dsc" -o -name "*gz" -o -name "*changelog" | sed 's/\.\.\///g' | tar rvf sadms-pkg-ubu-$(VERSION).tar -C .. -T -
gzip -f sadms-pkg-ubu-$(VERSION).tar
dist: dist-ubuntu
.PHONY: default showconfig \
pkg-ubuntu build-ubuntu \
predist dist-ubuntu dist
sadms-2.0.15/Makefile-fsacls 0000644 0001750 0001750 00000010744 11303140511 015460 0 ustar gauvain gauvain # pygtk-fsacls make file
# bbou@ac-toulouse.fr
# 2005-11-27 11:35:46
VERSION=2.0.1
prefix =
dos2unix := $(shell whereis -b dos2unix | awk '{print $$2}')
ifeq ($(dos2unix),)
dos2unix = perl -pi -e 's/\r\n/\n/g'
endif
BASE = $(prefix)/$(DESTDIR)/usr/local
BIN = $(BASE)/bin
LIB = $(BASE)/lib
SHORTCUT = $(BIN)
FOLDER = $(LIB)/pygtk-fsacls-$(VERSION)
VARFOLDER = $(prefix)/$(DESTDIR)/var/lib/pygtk-fsacls
default:
showconfig:
@echo "-------------------"
@echo "version: $(VERSION)"
@echo "prefix: $(prefix)"
@echo "bin: $(BIN)"
@echo "repository: $(FOLDER)"
@echo "dos2unix: $(dos2unix)"
@echo "-------------------"
cleanfiles:
rm -Rf $(FOLDER)
rm -Rf $(VARFOLDER)
copyfiles:
if [ ! -d $(FOLDER) ];then mkdir -p $(FOLDER); fi
cp -R bin/* $(FOLDER)
installshortcuts:
ln -s ../lib/pygtk-fsacls-$(VERSION)/acls.py $(SHORTCUT)/fsacls
uninstallshortcuts:
if [ -L $(SHORTCUT)/fsacls ];then rm $(SHORTCUT)/fsacls; fi
install: uninstall chkfileattr preinstall copyfiles installshortcuts
uninstall: uninstallshortcuts cleanfiles
preinstall:
if [ ! -d $(BASE) ];then mkdir -p $(BASE); fi
if [ ! -d $(BIN) ];then mkdir -p $(BIN); fi
if [ ! -d $(LIB) ];then mkdir -p $(LIB); fi
clean:
cleansources:
find . -name "*~" -exec rm {} \;
find . -name "*bak" -exec rm {} \;
find . -name "*.gladep" -exec rm {} \;
chkfileformat:
find . -name "*.sh" -exec $(dos2unix) {} \;
find . -name "*.py" -exec $(dos2unix) {} \;
chkfileown:
chown -R root.root ./*
chkfileattr:
chmod -R u=rw,g=rw,o=r ./*
find . -type d -exec chmod ugo+x {} \;
find . -name "*.sh" -exec chmod ugo+x {} \;
find . -name "*.py" -exec chmod ugo+x {} \;
stamp:
echo "$(VERSION)" > bin/version
echo "(build `date '+%Y%m%d-%H%M'`)" >> bin/version
predist: stamp chkfileformat chkfileown chkfileattr cleansources
echo "ready to distribute"
dist: predist
cd ..; if [ ! -L pygtk-fsacls-$(VERSION) ];then ln -s sadms-$(VERSION) pygtk-fsacls-$(VERSION); fi
tar cvzf pygtk-fsacls-$(VERSION).tar.gz -C .. \
pygtk-fsacls-$(VERSION)/bin/acls.py \
pygtk-fsacls-$(VERSION)/bin/remote.py \
pygtk-fsacls-$(VERSION)/bin/runner.py \
pygtk-fsacls-$(VERSION)/bin/acls.glade \
pygtk-fsacls-$(VERSION)/bin/remote.glade \
pygtk-fsacls-$(VERSION)/htmldocs/acls-index.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-toc.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-home.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-changelog.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-acls.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-remote.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-tut-remote.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-tut-acls.html \
pygtk-fsacls-$(VERSION)/htmldocs/acls-tut-remote.html \
pygtk-fsacls-$(VERSION)/htmldocs/sadms.css \
pygtk-fsacls-$(VERSION)/htmldocs/images/pygtk-fsacls.gif \
pygtk-fsacls-$(VERSION)/htmldocs/images/eye.gif \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-directory-default.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-directory.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-file.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-fs.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-fs0.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-fs2.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/acls-text.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-agent.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-agent0.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-clone-data.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-key.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-key0.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-passwords.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-remote.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-remote0.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-remotekey.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-remotekey0.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-run.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/remote-data.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/select-users.png \
pygtk-fsacls-$(VERSION)/htmldocs/images/key-password.png \
pygtk-fsacls-$(VERSION)/Makefile-fsacls \
pygtk-fsacls-$(VERSION)/AUTHORS \
pygtk-fsacls-$(VERSION)/COPYING \
pygtk-fsacls-$(VERSION)/README \
pygtk-fsacls-$(VERSION)/CHANGELOG \
pygtk-fsacls-$(VERSION)/NEWS
.PHONY: default showconfig \
cleanfiles copyfiles uninstallshortcuts installshortcuts uninstall preinstall install
cleansources chkfileformat chkfileown chkfileattr stamp predist predist \
dist
sadms-2.0.15/bin/ 0000755 0001750 0001750 00000000000 11522613633 013326 5 ustar gauvain gauvain sadms-2.0.15/bin/_sadms_ 0000644 0001750 0001750 00000000000 11303140511 014627 0 ustar gauvain gauvain sadms-2.0.15/bin/globs.glade 0000644 0001750 0001750 00000377701 11303140511 015434 0 ustar gauvain gauvain
pixmaps/sadms.png
normal
(C) 2005 Bernard Bou
Globals Manager
http://sadms.sourceforge.net
sadms.sourceforge.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Bernard Bou <bbou@ac-toulouse.fr>
translator-credits
pixmaps/sadms.png
False
end
0
300
True
Samba globals
pixmaps/sadms.png
dialog
True
vertical
True
True
True
True
never
automatic
in
True
True
4
4
True
True
False
True
True
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
True
True
False
True
True
2
3
GTK_FILL
True
True
False
True
True
3
4
GTK_FILL
True
0
valid users
1
2
True
0
read users
1
2
1
2
True
0
write users
1
2
2
3
True
0
admin users
1
2
3
4
True
True
2
3
_Browse
True
True
False
True
3
4
GTK_FILL
_Browse
True
True
False
True
3
4
1
2
GTK_FILL
_Browse
True
True
False
True
3
4
2
3
GTK_FILL
_Browse
True
True
False
True
3
4
3
4
GTK_FILL
True
True
2
3
1
2
True
True
2
3
2
3
True
True
2
3
3
4
True
True
pixmaps/user.png
0
True
_Users
True
False
False
1
False
tab
True
True
never
automatic
in
True
True
3
4
True
True
False
True
True
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
True
0
winbind enum groups
1
2
True
0
winbind nested groups
1
2
1
2
yes
True
True
False
True
True
2
3
1
2
yes
True
True
False
True
True
2
3
1
True
True
pixmaps/group.png
0
True
_Groups
True
False
False
1
1
False
tab
True
True
never
automatic
in
True
True
3
4
True
+
/
\
2
3
1
2
GTK_FILL
True
0
winbind separator
1
2
1
2
GTK_FILL
True
0
winbind use default domain
1
2
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
True
True
False
True
True
GTK_FILL
yes
True
True
False
True
True
2
3
2
True
True
pixmaps/windows.png
0
True
Winbind
False
False
1
2
False
tab
True
True
never
automatic
in
True
True
5
4
True
True
False
True
True
GTK_FILL
True
0
client signing
1
2
GTK_FILL
True
<none>
auto
disabled
mandatory
2
3
GTK_FILL
True
<none>
auto
disabled
mandatory
2
3
1
2
GTK_FILL
GTK_FILL
True
0
server signing
1
2
1
2
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
True
True
2
3
2
3
True
True
2
3
3
4
True
True
False
True
True
2
3
GTK_FILL
True
True
False
True
True
3
4
GTK_FILL
True
0
create mask
1
2
2
3
GTK_FILL
True
0
directory mask
1
2
3
4
GTK_FILL
_Browse
True
True
False
True
3
4
2
3
GTK_FILL
_Browse
True
True
False
True
3
4
3
4
GTK_FILL
3
True
True
gtk-directory
0
True
_Shares
True
False
False
1
3
False
tab
True
True
never
automatic
in
True
True
4
4
True
0
idmap uid
1
2
True
0
idmap gid
1
2
1
2
GTK_FILL
True
0
idmap backend
1
2
2
3
GTK_FILL
True
True
False
True
True
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
True
True
False
True
True
2
3
GTK_FILL
True
True
10000 500 33554432 1 100 0
1
2
3
True
True
10000 500 33554432 1 100 0
1
2
3
1
2
GTK_FILL
GTK_FILL
True
True
32000 500 33554432 1 100 0
1
3
4
1
2
GTK_FILL
GTK_FILL
True
True
32000 500 33554432 1 100 0
1
3
4
GTK_FILL
True
<none>
2
4
2
3
GTK_FILL
GTK_FILL
4
True
True
pixmaps/authorization.png
0
True
_Idmap
True
False
False
1
4
False
tab
True
True
never
automatic
in
True
True
4
4
True
0
template home dir
1
2
True
True
False
True
True
GTK_FILL
True
<none>
/home/%U
/home/%D/%U
2
3
GTK_FILL
GTK_FILL
True
0
template shell
1
2
1
2
GTK_FILL
True
<none>
/bin/bash
/bin/nologin
/bin/false
2
3
1
2
GTK_FILL
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
5
True
True
gtk-preferences
0
True
_Templates
True
False
False
1
5
False
tab
True
True
never
automatic
in
True
True
5
4
True
0
hosts allow
1
2
True
True
False
True
True
GTK_FILL
True
True
2
3
True
0
wins server
1
2
4
5
GTK_FILL
True
True
2
3
4
5
True
True
False
True
True
4
5
GTK_FILL
True
True
False
True
True
3
4
GTK_FILL
True
0
wins support
1
2
3
4
GTK_FILL
yes
True
True
False
True
True
2
3
3
4
GTK_FILL
True
True
False
True
True
2
3
GTK_FILL
True
0
name resolve order
1
2
2
3
GTK_FILL
True
<none>
wins lmhosts bcast
lmhost bcast wins
lmhost bcast
2
3
2
3
GTK_FILL
GTK_FILL
True
True
False
True
True
1
2
GTK_FILL
True
0
hosts deny
1
2
1
2
GTK_FILL
True
True
2
3
1
2
6
True
True
gtk-network
0
True
_Hosts
True
False
False
1
6
False
tab
2
True
end
-11
True
True
True
False
True
0
0
True
2
True
gtk-help
False
False
0
True
_Help
True
False
False
1
False
False
0
True
True
True
False
True
0
0
True
2
True
gtk-refresh
False
False
0
True
_Refresh
True
False
False
1
False
False
1
-10
True
True
True
False
True
0
0
True
2
True
gtk-apply
False
False
0
True
_Apply
True
False
False
1
False
False
2
-6
True
True
True
False
1
True
0
0
True
2
True
gtk-cancel
False
False
0
True
_Cancel
True
False
False
1
False
False
3
-5
True
True
True
False
True
0
0
True
2
True
gtk-ok
False
False
0
True
_Validate
True
False
False
1
False
False
4
False
end
0
users
True
center-on-parent
250
True
pixmaps/sadms.png
dialog
True
2
True
vertical
end
-6
True
True
True
False
True
0
0
True
2
True
gtk-cancel
False
False
0
True
_Cancel
True
False
False
1
False
False
0
-5
True
True
True
False
True
0
0
True
2
True
gtk-ok
False
False
0
True
_Ok
True
False
False
1
False
False
1
False
end
0
Permissions
pixmaps/sadms.png
dialog
True
True
False
False
0
True
4
4
5
True
True
False
True
True
True
1
2
1
2
GTK_FILL
True
True
False
True
True
True
1
2
2
3
GTK_FILL
True
True
False
True
True
True
1
2
3
4
GTK_FILL
True
True
False
True
True
True
2
3
1
2
GTK_FILL
True
True
False
True
True
2
3
2
3
GTK_FILL
True
True
False
True
True
2
3
3
4
GTK_FILL
True
True
False
True
True
True
3
4
1
2
GTK_FILL
True
True
False
True
True
True
3
4
2
3
GTK_FILL
True
True
False
True
True
True
3
4
3
4
GTK_FILL
True
0
read
1
2
GTK_FILL
True
0
write
2
3
GTK_FILL
True
0
list
3
4
GTK_FILL
True
0
owner
1
2
True
0
group
2
3
True
0
other
3
4
False
False
1
2
True
end
-6
True
True
True
False
True
0
0
True
2
True
gtk-cancel
False
False
0
True
_Cancel
True
False
False
1
False
False
0
-5
True
True
True
False
True
0
0
True
2
True
gtk-ok
False
False
0
True
_Ok
True
False
False
1
False
False
1
False
end
0
sadms-2.0.15/bin/sadms-deps.py 0000755 0001750 0001750 00000011640 11521213114 015732 0 ustar gauvain gauvain #!/usr/bin/python
# -*-coding: UTF-8 -*-
# bbou@ac-toulouse.fr
# GPL license
# 2007-05-23 17:17:08
# sadms-deps.py
import commands
import re
#######################################################################
# CHECK DEPS
#######################################################################
def checkDeps():
status,output=commands.getstatusoutput("if [ -f /etc/debian_version ]; then echo 'debian'; else echo 'default'; fi")
if not status:
distribution=output.strip('\n\r ')
else:
distribution='default'
execs={}
for fn in ['sadms','users','globs','shares','share','sharesparser','acls','remote','runner']:
fn=fn+'.py'
f=open(fn,'r')
lines=f.readlines()
f.close()
start=-1
finish=-1
i=0
within=False
for l in lines:
if re.search('sysSetting={',l):
start=i+1
within=True
#print fn,l
if within and re.search('^}',l):
finish=i
within=False
#print fn,l
break;
i=i+1
if (start,finish)!=(-1,-1):
code=''.join(lines[start:finish])
code='{%s}' % code
dic=eval(code)
for k in dic:
e=dic[k]
if type(e)==type({}):
e=e[distribution]
e=e.split()[0]
execs[e]=None
execs=execs.keys()
execs.sort()
for e in execs:
#print '%s' % (e)
if re.search('^file:',e):
continue
status,output=commands.getstatusoutput('type '+e)
if not status:
#print '%-16s\t%s' % (e,output)
print '%s -> %s' % (e,output)
pass
else:
print >>sys.stderr,'MISSING %s' % (e)
return
def checkSignals():
for fn in ['sadms','users','globs','shares','share','acls','remote','runner']:
fn=fn+'.py'
print '\n%s\n' % fn
f=open(fn,'r')
lines=f.readlines()
f.close()
start=-1
finish=-1
i=0
within=False
for l in lines:
if re.search('handlers=',l):
start=i+1
within=True
#print fn,l
if within and re.search('}',l):
finish=i
within=False
#print fn,l
break;
i=i+1
if (start,finish)!=(-1,-1):
code=''.join(lines[start:finish])
code=code.replace('self.','"')
code=code.replace(',','",')
code='{%s}' % code
#print code
dic=eval(code)
#print dic
signals=dic.values()
signals.sort()
for s in signals:
print '%-32s>' % s,
for l in lines:
if re.search('def\s%s\(' % s,l):
print l.strip(),
if not re.search('\*options',l):
print 'NO OPTION',
break
print
return
def checkCommands():
status,output=commands.getstatusoutput("if [ -f /etc/debian_version ]; then echo 'debian'; else echo 'default'; fi")
if not status:
distribution=output.strip('\n\r ')
else:
distribution='default'
execs={}
for fn in ['sadms','users','globs','shares','share','sharesparser','acls','remote','runner']:
fn=fn+'.py'
f=open(fn,'r')
lines=f.readlines()
f.close()
start=-1
finish=-1
i=0
within=False
for l in lines:
if re.search('sysSetting={',l):
start=i+1
within=True
#print fn,l
if within and re.search('^}',l):
finish=i
within=False
#print fn,l
break;
i=i+1
if (start,finish)!=(-1,-1):
code=''.join(lines[start:finish])
code='{%s}' % code
dic=eval(code)
for k in dic:
e=dic[k]
if type(e)==type({}):
e=e[distribution]
execs[e]=None
execs=execs.keys()
execs.sort()
#for e in execs:
# if e.find('%')==-1:
# print '%s' % (e)
# if raw_input('execute (y/N) ?')=='y':
# status,output=commands.getstatusoutput(e)
# print status,output
for e in execs:
if e.find('%')!=-1:
e=e.replace('%USER%','auser')
e=e.replace('%GROUP%','agroup')
e=e.replace('%HOST%','ahost')
e=e.replace('%SERVER%','aserver')
e=e.replace('%SHARE%','ashare')
e=e.replace('%HOME%','ahome')
e=e.replace('%FSOBJECT%','afile')
e=e.replace('%FILE%','afile')
e=e.replace('%DIRECTORY%','adir')
e=e.replace('%SERVICE%','aservice')
e=e.replace('%PROCESS%','process')
e=e.replace('%COMMAND%','acommand')
e=e.replace('%DEV%','adev')
e=e.replace('%KEY%','akey')
e=e.replace('%MOUNT%','amount')
e=e.replace('%TEXT%','atext')
e=e.replace('%KEY%','akey')
e=e.replace('%UMODE%','-')
e=e.replace('%GMODE%','-')
e=e.replace('%OMODE%','-')
e=e.replace('%MODE%','mode')
e=e.replace('%OPTIONS%','options')
e=e.replace('%RECURSE%','recurse')
e=e.replace('%SOURCE%','asource')
e=e.replace('%DESTINATION%','adestination')
e=e.replace('%DNSDOMAIN%','adnsdomain')
e=e.replace('%ACLS%','acls')
e=e.replace('%PASSWORD%','apass')
e=e.replace('%STAMP%','stamp')
print '#%s' % (e)
continue
if raw_input('execute (y/N) ?')=='y':
status,output=commands.getstatusoutput(e)
print status,output
return
#######################################################################
# MAIN
#######################################################################
import sys
import os
if __name__=="__main__":
e=sys.argv[0]
e=os.path.realpath(e)
d=os.path.dirname(e)
os.chdir(d)
checkDeps()
#checkSignals()
#checkCommands()
__author__='Bernard Bou '
sadms-2.0.15/bin/_cat-help-pam.sh 0000755 0001750 0001750 00000000220 11521213113 016252 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2004-09-26 18:28:11
# _cat-help-pam.sh
### I N C L U D E
. ./_include.sh
### S T A R T
cat help-pam
sadms-2.0.15/bin/_test-smb.sh 0000755 0001750 0001750 00000004767 11521213113 015564 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:31:22
# _test-smb.sh
### P A R A M S
MYVERBOSE=
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
shift
fi
MYSERVER="$1"
MYSHARE="$2"
MYDOMAIN="$3"
MYUSER="$4"
MYUSERPWD="$5"
#echo "server=${MYSERVER}"
#echo "share=${MYSHARE}"
#echo "domain=${MYDOMAIN}"
#echo "user=${MYUSER}"
#echo "password=${MYUSERPWD}"
### I N C L U D E
. ./_include.sh
### O T H E R
share="//${MYSERVER}/${MYSHARE}"
### S T A R T
guest=`testparm -sv 2> /dev/null | grep 'guest account' | awk '{print $4}'`
echo "--------------------------------------------------------------------------------"
echo "SMB TEST"
echo "--------------------------------------------------------------------------------"
if ! type smbstatus > /dev/null; then
exit 1
fi
if ! type smbclient > /dev/null; then
exit 1
fi
echo "+STATUS"
if ! smbstatus >/dev/null 2>/dev/null; then
echo 'status failed' >&2
else
smbstatus 2>&1 | grep -v "^$"
fi
echo "+BROWSE"
echo "+browse localhost anonymously"
#smbclient -L localhost -U%
if smbclient -L localhost -U% > /dev/null 2> /dev/null; then
echo 'ok'
else
echo 'fail'
echo "browse localhost anonymously failed" >&2
fi
echo "+browse localhost as guest ${guest}"
#smbclient -L localhost -U ${guest}%
if smbclient -L localhost -U ${guest}% > /dev/null 2> /dev/null; then
echo 'ok'
else
echo 'fail'
echo "browse localhost as guest ${guest} failed" >&2
fi
if [ ! "${MYUSER}" = "" ]; then
echo "+browse localhost as ${MYUSER} with password ${MYUSERPWD}"
e="smbclient -L localhost -U '${MYUSER}%${MYUSERPWD}'"
if eval $e > /dev/null 2> /dev/null; then
echo 'ok'
else
echo 'fail'
echo "browse localhost as ${MYUSER} with password ${MYUSERPWD} failed" >&2
fi
fi
echo "+CONNECT"
echo "+connect anonymously to ${share}"
#smbclient ${share} -U% -c "exit"
if smbclient ${share} -U% -c "exit" > /dev/null 2> /dev/null; then
echo "ok"
else
echo 'fail'
echo "connect anonymously to ${share} failed" >&2
fi
echo "+connect as guest (${guest}) to ${share}"
#smbclient ${share} -U ${guest}% -c "exit"
if smbclient ${share} -U ${guest}% -c "exit" > /dev/null 2> /dev/null; then
echo "ok"
else
echo 'fail'
echo "connect as guest ${guest} to ${share} failed" >&2
fi
if [ ! "${MYUSER}" = "" ]; then
echo "+connect as ${MYUSER} with password ${MYUSERPWD} to ${share}"
e="smbclient ${share} -U '${MYUSER}%${MYUSERPWD}' -c 'exit'"
if eval $e > /dev/null 2> /dev/null; then
echo "ok"
else
echo 'fail'
echo "connect as ${MYUSER} with password ${MYUSERPWD} to ${share} failed" >&2
fi
fi
exit 0
sadms-2.0.15/bin/keygen.expect 0000644 0001750 0001750 00000001262 11303140511 016006 0 ustar gauvain gauvain #!/usr/bin/expect -f
# bbou@ac-toulouse.fr
# 2005-08-15 08:23:21
# expect-keygen
set KEY [lindex $argv 0]
set PASSPHRASE [lindex $argv 1]
#send_user "The password for key: "
#stty -echo
#expect_user -re "(.*)\n" {set PASSPHRASE $expect_out(1,string)}
#send_user "\n"
#stty echo
set timeout -1
log_user 0
spawn ssh-keygen -t dsa -f $KEY
expect {
"Overwrite (y/n)?" {
send "y\n"
exp_continue
}
"Enter passphrase (empty for no passphrase):" {
send "$PASSPHRASE\n"
exp_continue
}
"Enter same passphrase again:" {
send "$PASSPHRASE\n"
}
}
log_user 0
set r "\[0-9a-f:\]+"
expect -re "The key fingerprint is:\r\n(${r})" { log_user 1;send_user "$expect_out(1,string)\n" }
sadms-2.0.15/bin/scp.expect 0000644 0001750 0001750 00000001132 11303140511 015305 0 ustar gauvain gauvain #!/usr/bin/expect -f
# bbou@ac-toulouse.fr
# 2005-08-15 08:23:21
# expect-scp
set HOST [lindex $argv 0]
set USER [lindex $argv 1]
set PASSPHRASE [lindex $argv 2]
set SOURCE [lindex $argv 3]
set DESTINATION [lindex $argv 4]
set timeout -1
log_user 0
spawn scp -o PreferredAuthentications=password,keyboard-interactive ${SOURCE} ${USER}@${HOST}:${DESTINATION}
expect {
"Are you sure you want to continue connecting (yes/no)?"
{
send "yes\n"
exp_continue
}
"password:" {
send "$PASSPHRASE\n"
}
"Password:" {
send "$PASSPHRASE\n"
}
}
expect {
"\n"
"\r"
}
log_user 1
expect eof
sadms-2.0.15/bin/_test.sh 0000755 0001750 0001750 00000000616 11521213113 014772 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2004-09-25 09:34:16
# test.sh
### I N C L U D E
. ./_include.sh
### S T A R T
echo "--------------------------------------------------------------------------------"
echo "TEST"
echo "--------------------------------------------------------------------------------"
echo 'testing'
i=0
while true ; do
echo $i
i=$((i+1))
sleep 5
done
echo 'done'
exit 1
sadms-2.0.15/bin/lsb_release.sh 0000755 0001750 0001750 00000040020 11521213113 016125 0 ustar gauvain gauvain #!/bin/bash
#
# lsb_release - collect LSB conformance status about a system
#
# modified by Bernard Bou for SuSE
#
# Copyright (C) 2000, 2002, 2004 Free Standards Group, Inc.
# Originally by Dominique MASSONIE
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# * Changes in 2.0
# - Support LSB 2.0 module layout (Mats Wichmann)
# The LSB_VERSION is now a colon-separated field of supported module versions
# An /etc/lsb-release.d is searched for modules beyond the core.
# Only the filenames in this directory is looked at, those names are added
# to LSB_VERSION. This allows module support to be handled easily by
# package install/removal without a need to edit lsb-release on the fly.
# - Correct license: FSG == Free Standards Group, Inc.
#
# * Changes in 1.4
# - "awk" not needed anymore (Loic Lefort)
# - fixed bug #121879 reported by Chris D. Faulhaber,
# some shells doesn't support local variables
# - fixed a bug when single parameter sets many args including -s
# - function DisplayProgramVersion (undocumented) now exits script like Usage
# - cosmetic changes in comments/outputs
#
# * Changes in 1.3
# - No changes in script, only in build infrastructure
#
# * Changes in 1.2
# - Fixed more bash'isms
# - LSB_VERSION is no longer required in /etc/lsb-release file
#
# * Changes in 1.1
# - removed some bash-ism and typos
# Notice: script remains broken with ash because of awk issues
# - changed licence to FSG - "Free Software Group, Inc"
# - fixed problem with --short single arg call
# - changed Debian specifics, codename anticipates release num
#
# Description:
# Collect information from sourceable /etc/lsb-release file (present on
# LSB-compliant systems) : LSB_VERSION, DISTRIB_ID, DISTRIB_RELEASE,
# DISTRIB_CODENAME, DISTRIB_DESCRIPTION (all optional)
# Then (if needed) find and add names from /etc/lsb-release.d
# Then (if needed) find and parse the /etc/[distro]-release file
###############################################################################
# DECLARATIONS
###############################################################################
# This script version
SCRIPTVERSION="2.0"
# Defines the data files
INFO_ROOT="/etc" # directory of config files
INFO_LSB_FILE="lsb-release" # where to get LSB version
INFO_LSB_DIR="lsb-release.d" # where to get LSB addon modules
INFO_DISTRIB_SUFFIX="release" # -
ALTERNATE_DISTRIB_FILE="/etc/debian_version" # for Debian [based distrib]
ALTERNATE_DISTRIB_NAME="Debian" # "
CHECKFIRST="/etc/redhat-release" # check it before file search
# Defines our exit codes
EXIT_STATUS="0" # default = Ok :)
ERROR_UNKNOWN="10" # unknown error
ERROR_USER="1" # program misuse
ERROR_PROGRAM="2" # internal error
ERROR_NOANSWER="3" # all required info not available
# typically non LSB compliant distro!
# Defines our messages
MSG_LSBVER="LSB Version:\t"
MSG_DISTID="Distributor ID:\t"
MSG_DISTDESC="Description:\t"
MSG_DISTREL="Release:\t"
MSG_DISTCODE="Codename:\t"
MSG_NA="n/a"
MSG_NONE="(none)"
MSG_RESULT="" # contains the result in case short output selected
# Description string delimiter
DESCSTR_DELI="release"
###############################################################################
# FUNCTIONS
###############################################################################
# Display Program Version for internal use (needed by help2man)
DisplayProgramVersion() {
echo "FSG `basename $0` v$SCRIPTVERSION"
echo
echo "Copyright (C) 2000, 2002, 2004 Free Standards Group, Inc."
echo "This is free software; see the source for copying conditions. There\
is NO"
echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR\
PURPOSE."
echo
echo "Originally written by Dominique MASSONIE."
exit $EXIT_STATUS
}
# defines the Usage for lsb_release
Usage() {
echo "FSG `basename $0` v$SCRIPTVERSION prints certain LSB (Linux\
Standard Base) and"
echo "Distribution information."
echo
echo "Usage: `basename $0` [OPTION]..."
echo "With no OPTION specified defaults to -v."
echo
echo "Options:"
echo " -v, --version"
echo " Display the version of the LSB specification against which the distribution is compliant."
echo " -i, --id"
echo " Display the string id of the distributor."
echo " -d, --description"
echo " Display the single line text description of the distribution."
echo " -r, --release"
echo " Display the release number of the distribution."
echo " -c, --codename"
echo " Display the codename according to the distribution release."
echo " -a, --all"
echo " Display all of the above information."
echo " -s, --short"
echo " Use short output format for information requested by other options (or version if none)."
echo " -h, --help"
echo " Display this message."
exit $EXIT_STATUS
}
# Handles the enhanced args (i.e. --something)
EnhancedGetopt() {
getopt -T >/dev/null 2>&1 # is getopt the enhanced one ?
if [ $? = 4 ]
then # Yes, advanced args ALLOWED
OPT=$(getopt -o acdhirsvp \
--long all,codename,description,help,id,release,short,version,program_version \
-n 'lsb_release' \
-- "$@")
else # No, advanced args NOT allowed
# convert (if needed) the enhanced options into basic ones
MYARGS=$(echo "$@" | sed -e "/--/s/-\(-[[:alnum:]]\)[[:alnum:]]*/\1/g")
OPT=$(getopt -o acdhirsvp \
-n 'lsb_release' \
-- "$MYARGS")
fi
if [ $? != 0 ]
then
exit $ERROR_PROGRAM
fi
NB_ARG="" # enabled if many args set in one parameter (i.e. -dris)
eval set -- "$OPT"
while true ; do
case "$1" in
-a|--all) ARG_A="y"; NB_ARG="y"; shift;;
-c|--codename) ARG_C="y"; NB_ARG="y"; shift;;
-d|--description) ARG_D="y"; NB_ARG="y"; shift;;
-i|--id) ARG_I="y"; NB_ARG="y"; shift;;
-r|--release) ARG_R="y"; NB_ARG="y"; shift;;
-s|--short) ARG_S="y"; shift;;
-v|--version) ARG_V="y"; NB_ARG="y"; shift;;
-p|--program_version) DisplayProgramVersion;;
-h|--help) Usage;;
--) shift; break;;
*) EXIT_STATUS=$ERROR_USER
Usage;;
esac
done
}
# Get/Init LSB infos (maybe Distrib infos too)
GetLSBInfo() {
if [ -f "$INFO_ROOT/$INFO_LSB_FILE" ]
then
# should init at least LSB_VERSION
. "$INFO_ROOT/$INFO_LSB_FILE"
fi
if [ -z "$LSB_VERSION" ]
then
LSB_VERSION=$MSG_NA
else
# if we found LSB_VERSION, continue to look in directory
if [ -d "$INFO_ROOT/$INFO_LSB_DIR" ]
then
for tag in "$INFO_ROOT/$INFO_LSB_DIR/"*
do
LSB_VERSION=$LSB_VERSION:`basename $tag`
done
fi
fi
}
# Get the whole distrib information string (from ARG $1 file)
InitDistribInfo() {
## Notice: Debian has a debian_version file
## (at least) Mandrake has two files, a mandrake and a redhat one
FILENAME=$1 # CHECKFIRST or finds' result in GetDistribInfo() or ""
if [ -z "$FILENAME" ]
then
if [ -f "$ALTERNATE_DISTRIB_FILE" ]
then # For Debian only
[ -z "$DISTRIB_ID" ] && DISTRIB_ID="$ALTERNATE_DISTRIB_NAME"
[ -z "$DISTRIB_RELEASE" ] \
&& DISTRIB_RELEASE=$(cat $ALTERNATE_DISTRIB_FILE)
[ -z "$DISTRIB_CODENAME" ] && [ "$DISTRIB_RELEASE" = "2.1" ] \
&& DISTRIB_CODENAME="Slink"
[ -z "$DISTRIB_CODENAME" ] && [ "$DISTRIB_RELEASE" = "2.2" ] \
&& DISTRIB_CODENAME="Potato"
# [ -z "$DISTRIB_CODENAME" ] && [ "$DISTRIB_RELEASE" = "2.3" ] \
# && DISTRIB_CODENAME="Woody"
[ -z "$DISTRIB_CODENAME" ] && DISTRIB_CODENAME=$DISTRIB_RELEASE
# build the DISTRIB_DESCRIPTION string (never need to be parsed)
[ -z "$DISTRIB_DESCRIPTION" ] \
&& DISTRIB_DESCRIPTION="$DISTRIB_ID $DESCSTR_DELI $DISTRIB_REL\
EASE ($DISTRIB_CODENAME)"
else # Only for nothing known compliant distrib :(
[ -z "$DISTRIB_ID" ] && DISTRIB_ID=$MSG_NA
[ -z "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=$MSG_NA
[ -z "$DISTRIB_CODENAME" ] && DISTRIB_CODENAME=$MSG_NA
[ -z "$DISTRIB_DESCRIPTION" ] && DISTRIB_DESCRIPTION=$MSG_NONE
EXIT_STATUS=$ERROR_NOANSWER
fi
else
NO="" # is Description string syntax correct ?
if [ -z "$DISTRIB_DESCRIPTION" ] \
|| [ -n "$(echo $DISTRIB_DESCRIPTION | \
sed -e "s/.*$DESCSTR_DELI.*//")" ]
then
TMP_DISTRIB_DESC=$(head -n 1 $FILENAME 2>/dev/null)
[ -z "$DISTRIB_DESCRIPTION" ] \
&& DISTRIB_DESCRIPTION=$TMP_DISTRIB_DESC
else
TMP_DISTRIB_DESC=$DISTRIB_DESCRIPTION
fi
if [ -z "$TMP_DISTRIB_DESC" ] # head or lsb-release init
then # file contains no data
DISTRIB_DESCRIPTION=$MSG_NONE
NO="y"
else # Do simple check
[ -n "$(echo $TMP_DISTRIB_DESC | \
sed -e "s/.*$DESCSTR_DELI.*//")" ] \
&& NO="y"
fi
if [ -n "$NO" ]
then # does not contain "release" delimiter
if [ `basename $FILENAME` == "SuSE-release" ]
then
DISTRIB_ID="SuSE"
DISTRIB_RELEASE=$(grep ^VERSION $FILENAME | cut "-d " -f 3)
DISTRIB_CODENAME=$DISTRIB_RELEASE
fi
[ -z "$DISTRIB_ID" ] && DISTRIB_ID=$MSG_NA
[ -z "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=$MSG_NA
[ -z "$DISTRIB_CODENAME" ] && DISTRIB_CODENAME=$MSG_NA
fi
fi
}
# Check missing and requested infos, then find the file and get infos
GetDistribInfo() {
NO="" # /etc/lsb-release data are enough to reply what is requested?
[ -n "$ARG_D" ] && [ -z "$DISTRIB_DESCRIPTION" ] && NO="y"
[ -z "$NO" ] && [ -n "$ARG_I" ] && [ -z "$DISTRIB_ID" ] && NO="y"
[ -z "$NO" ] && [ -n "$ARG_R" ] && [ -z "$DISTRIB_RELEASE" ] && NO="y"
[ -z "$NO" ] && [ -n "$ARG_C" ] && [ -z "$DISTRIB_CODENAME" ] && NO="y"
if [ -n "$NO" ]
then
if [ ! -f "$CHECKFIRST" ]
then
CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1 \
-name \*$INFO_DISTRIB_SUFFIX \
-and ! -name $INFO_LSB_FILE \
-and -type f \
2>/dev/null \
| head -n 1 ) # keep one of the files found (if many)
fi
InitDistribInfo $CHECKFIRST
fi
}
# Display version of LSB against which distribution is compliant
DisplayVersion() {
if [ -z "$ARG_S" ]
then
echo -e "$MSG_LSBVER$LSB_VERSION" # at least "n/a"
else
MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$LSB_VERSION"
fi
}
# Display string id of distributor ( i.e. a single word! )
DisplayID() {
if [ -z "$DISTRIB_ID" ]
then
## Linux could be part of the distro name (i.e. Turbolinux) or a separate word
## set before, after...
## also expect a delimiter ( i.e. "release" )
if [ -n "$(echo $TMP_DISTRIB_DESC | sed "s/.*$DESCSTR_DELI.*//")" ]
then
DISTRIB_ID=$MSG_NA
else
DISTRIB_ID=$(echo " $TMP_DISTRIB_DESC" \
| sed -e "s/[[:blank:]][Ll][Ii][Nn][Uu][Xx][[:blank:]]/ /g" \
-e "s/\(.*\)[[:blank:]]$DESCSTR_DELI.*/\1/" -e "s/[[:blank:]]//g")
fi
fi
if [ -z "$ARG_S" ]
then
echo -e "$MSG_DISTID$DISTRIB_ID"
else
MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$DISTRIB_ID"
fi
}
# Diplay single line text description of distribution
DisplayDescription() {
if [ -z "$DISTRIB_DESCRIPTION" ]
then
# should not be empty since GetDistribInfo called on Initialization !
EXIT_STATUS=$ERROR_PROGRAM
fi
if [ -z "$ARG_S" ]
then
echo -e "$MSG_DISTDESC$DISTRIB_DESCRIPTION"
else
MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }\"$DISTRIB_DESCRIPTION\""
fi
}
# Display release number of distribution.
DisplayRelease() {
if [ -z "$DISTRIB_RELEASE" ]
then # parse the "$DISTRIB_DESCRIPTION" string
DISTRIB_RELEASE=$(echo "$TMP_DISTRIB_DESC" | \
sed -e "s/.*$DESCSTR_DELI[[:blank:]]*\([[:digit:]][[:graph:]]*\).*/\1/" )
[ "$DISTRIB_RELEASE" = "$TMP_DISTRIB_DESC" ] \
|| [ -z "$DISTRIB_RELEASE" ] \
&& DISTRIB_RELEASE=$MSG_NA
fi
if [ -z "$ARG_S" ]
then
echo -e "$MSG_DISTREL$DISTRIB_RELEASE"
else
MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$DISTRIB_RELEASE"
fi
}
# Display codename according to distribution version.
DisplayCodename() {
if [ -z "$DISTRIB_CODENAME" ]
then # parse the "$DISTRIB_DESCRIPTION" string
DISTRIB_CODENAME=$(echo "$TMP_DISTRIB_DESC" | \
sed -e "s/.*$DESCSTR_DELI.*(\(.*\)).*/\1/")
[ "$DISTRIB_CODENAME" = "$TMP_DISTRIB_DESC" ] \
|| [ -z "$DISTRIB_CODENAME" ] \
&& DISTRIB_CODENAME=$MSG_NA
fi
if [ -z "$ARG_S" ]
then
echo -e "$MSG_DISTCODE$(echo "$DISTRIB_CODENAME" | \
tr -d "[:blank:]")" # Remove blanks
else
MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$(echo "$DISTRIB_CODENAME" | \
tr -d "[:blank:]")"
fi
}
###############################################################################
# MAIN
###############################################################################
# Check if any prog argument
if [ -z "$1" ]
then
ARG_V="y" # default set to Display LSB Version (not Usage)
else
EnhancedGetopt "$@" # Parse program args
if [ -n "$ARG_S" ] && [ -z "$NB_ARG" ]
then
ARG_V="y" # set also default for --short when single arg
fi
fi
# Update args to All if requested
if [ -n "$ARG_A" ]
then
[ -z "$ARG_C" ] && ARG_C="y"
[ -z "$ARG_D" ] && ARG_D="y"
[ -z "$ARG_I" ] && ARG_I="y"
[ -z "$ARG_R" ] && ARG_R="y"
[ -z "$ARG_V" ] && ARG_V="y"
fi
# Initialization
GetLSBInfo
GetDistribInfo
# Display requested infos (order as follow)
[ -n "$ARG_V" ] && DisplayVersion
[ -n "$ARG_I" ] && DisplayID
[ -n "$ARG_D" ] && DisplayDescription
[ -n "$ARG_R" ] && DisplayRelease
[ -n "$ARG_C" ] && DisplayCodename
[ -n "$ARG_S" ] && echo "$MSG_RESULT"
exit $EXIT_STATUS
sadms-2.0.15/bin/__init__.py 0000755 0001750 0001750 00000002734 11521213114 015435 0 ustar gauvain gauvain #!/usr/bin/python
# -*-coding: UTF-8 -*-
# bbou@ac-toulouse.fr
# GPL license
# 30/08/2009
import os
import sys
import locale
import gettext
APP_NAME = "sadms"
#Get the local directory since we are not installing anything
local_path = os.path.realpath(os.path.dirname(sys.argv[0]))
print local_path
# Init the list of languages to support
langs = []
#Check the default locale
lc, encoding = locale.getdefaultlocale()
if (lc):
#if we have a default, it's the first in the list
langs = [lc]
print lc
# Now lets get all of the supported languages on the system
language = os.environ.get('LANGUAGE', None)
print language
if (language):
"""langage comes back something like en_CA:en_US:en_GB:en
on linuxy systems, on Win32 it's nothing, so we need to
split it up into a list"""
langs += language.split(":")
"""Now add on to the back of the list the translations that we
know that we have, our defaults"""
langs += ["en_US","fr_FR"]
"""Now langs is a list of all of the languages that we are going
to try to use. First we check the default, then what the system
told us, and finally the 'known' list"""
gettext.bindtextdomain(APP_NAME, local_path)
gettext.textdomain(APP_NAME)
# Get the language to use
lang = gettext.translation(APP_NAME, local_path, languages=langs, fallback = True)
"""Install the language, map _() (which we marked our
strings to translate with) to self.lang.gettext() which will
translate them."""
_ = lang.gettext
print 'LOCALIZE TO ', lang.info()
print _('_Open')
sadms-2.0.15/bin/_check-samba.sh 0000755 0001750 0001750 00000006465 11521213113 016161 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-06-23 10:07:30
# _check-samba.sh
### P A R A M S
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
shift
fi
### I N C L U D E
. ./_include.sh
### C H E C K E D F I L E S
nsswinbindlib=${LIBDIR}/libnss_winbind.so
pamwinbindlib=${LIBDIR}/security/pam_winbind.so
winbinddaemon=${USRSBINDIR}/winbindd
sambapkg=${SAMBAPKG}
sambapkgs=${SAMBAPKGS}
### S T A R T
# S A M B A P A C K A G E S
echo "+SAMBA PACKAGE"
if ! ${PACKAGETEST} ${sambapkg} > /dev/null; then
echo "${sambapkg} package FAIL (does not exist)" >&2
exit 1
fi
echo "package=${sambapkg}"
sambaversion=`${PACKAGEVERSION} ${sambapkg}`
echo "version=${sambaversion}"
sambamajorversion=`echo "${sambaversion}" | sed 's/^[0-9:]*\([0-9]\).*$/\1/g'`
echo "majorversion=${sambamajorversion}"
if (( $((sambamajorversion)) < 3 )); then
echo "current version is ${sambamajorversion} [FAIL] (samba 3 is needed)" >&2
exit 1
fi
[ -z "${MYVERBOSE}" ] || echo "version is ${sambamajorversion} OK"
if ! ${PACKAGETEST} ${sambapkgs} 2> /dev/null >/dev/null; then
echo "[FAIL] packages ${sambapkgs} are not installed" >&2
[ -z "${MYVERBOSE}" ] || echo "details:" >&2
[ -z "${MYVERBOSE}" ] || echo "{" >&2
[ -z "${MYVERBOSE}" ] || ${PACKAGETEST} ${sambapkgs} >&2
[ -z "${MYVERBOSE}" ] || echo "}" >&2
exit 1
fi
# N S S _ W I N B I N D L I B R A R Y
echo "+NSS_WINBIND"
if [ ! -L ${nsswinbindlib}.${LIBC_VERSMAJ} -a ! -f ${nsswinbindlib}.${LIBC_VERSMAJ} ];then
echo "[FAIL] ${nsswinbindlib}.${LIBC_VERSMAJ} missing" >&2
else
[ -z "${MYVERBOSE}" ] || echo "${nsswinbindlib}.${LIBC_VERSMAJ} OK (exists)"
fi
# N S S _ W I N B I N D D E P E N D E N T L I B R A R I E S
if [ -f /usr/bin/objdump ]; then
echo "+NSS_WINBIND DEPENDENT LIBRARIES"
deps=$(objdump -p ${nsswinbindlib}.${LIBC_VERSMAJ} | grep NEEDED | sed s/"NEEDED "//g)
for dl in ${deps}; do
dl=$(whereis -b ${dl} | sed s/.*://)
for d in ${dl}; do
if [ -f ${d} ]; then
[ -z "${MYVERBOSE}" ] || echo "${d} OK (exists)"
else
echo "[FAIL] ${d} missing"
fi
done
done
fi
# W I N B I N D L I B R A R Y
echo "+WINBIND DAEMON"
if [ ! -f ${winbinddaemon} ];then
echo "[FAIL] ${winbinddaemon} does not exist" >&2
exit 1
else
[ -z "${MYVERBOSE}" ] || echo "${winbinddaemon} OK (exists)"
fi
# W I N B I N D D E P E N D E N T L I B R A R I E S
if [ -f /usr/bin/objdump ]; then
echo "+WINBIND DAEMON DEPENDENT LIBRARIES"
deps=$(objdump -p ${winbinddaemon} | grep NEEDED | sed s/"NEEDED "//g)
for dl in ${deps}; do
dl=$(whereis -b ${dl} | sed s/.*://)
for d in ${dl}; do
if [ -f ${d} ]; then
[ -z "${MYVERBOSE}" ] || echo "${d} OK (exists)"
else
echo "[FAIL] ${d} missing" >&2
fi
done
done
fi
# P A M _ W I N B I N D L I B R A R Y
echo "+PAM_WINBIND DEPENDENT LIBRARY"
if [ ! -f ${pamwinbindlib} ];then
echo "${pamwinbindlib} FAIL (does not exist)" >&2
exit 1
else
[ -z "${MYVERBOSE}" ] || echo "${pamwinbindlib} OK (exists)"
fi
# P A M _ W I N B I N D D E P E N D E N T L I B R A R I E S
if [ -f /usr/bin/objdump ]; then
echo "+PAM_WINBIND DEPENDENT LIBRARIES"
deps=$(objdump -p ${pamwinbindlib} | grep NEEDED | sed s/"NEEDED "//g)
for dl in ${deps}; do
dl=$(whereis -b ${dl} | sed s/.*://)
for d in ${dl}; do
if [ -f ${d} ]; then
[ -z "${MYVERBOSE}" ] || echo "${d} OK (exists)"
else
echo "[FAIL] ${d} missing" >&2
fi
done
done
fi
sadms-2.0.15/bin/conf/ 0000755 0001750 0001750 00000000000 11522613633 014253 5 ustar gauvain gauvain sadms-2.0.15/bin/conf/config.sh 0000755 0001750 0001750 00000006260 11521213113 016047 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-11-02 09:45:05
# conf/config.sh
### P A R A M S
MYVERBOSE=
if [ "$1" = "-v" ]; then
MYVERBOSE="-v"
shift
fi
MYNOSHARES=
if [ "$1" = "-noshares" ]; then
MYNOSHARES="$1"
shift
fi
MYREALM="$1"
MYDNS="$2"
MYKDC="$3"
MYDOMAIN="$4"
MYSERVER="$5"
MYOU="$6"
MYADMIN="$7"
MYADMINPWD="$8"
MYUSERS="$9"
shift
MYHOSTALLOW="$9"
shift
MYWINSSERVER="$9"
shift
#echo "realm=${MYREALM}"
#echo "dns=${MYDNS}"
#echo "kdc=${MYKDC}"
#echo "domain=${MYDOMAIN}"
#echo "server=${MYSERVER}"
#echo "ou=${MYOU}"
#echo "admin=${MYADMIN}"
#echo "admin passwd=${MYADMINPWD}"
#echo "users=${MYUSERS}"
#echo "host allow=${MYHOSTALLOW}"
#echo "wins server=${MYWINSSERVER}"
### S T A R T
function logMark()
{
logger -t "sadms" "sadms $1"
}
function logTail()
{
line=`grep -n "sadms start" /var/log/messages | tail -n 1 | cut -d ':' -f 1`
echo 'log extract'
echo 'vvvvv'
tail --line +${line} /var/log/messages
echo '^^^^^'
}
logMark "start"
echo "[1]"
if ! ./config-bugfix.sh "${MYREALM}" "${MYDNS}" "${MYKDC}.${MYDNS}"; then
echo "[1>] with error"
logMark "finish error 1 bug fix"
logTail
exit 1
fi
echo "[2]"
if ! ./config-kerberos.sh "${MYREALM}" "${MYDNS}" "${MYKDC}.${MYDNS}"; then
echo "[2>] with error"
logMark "finish error 2 kerberos conf"
logTail
exit 2
fi
echo "[3]"
if ! ./config-smbconf.sh ${MYNOSHARES} "${MYREALM}" "${MYDOMAIN}" "${MYSERVER}" "${MYADMIN}" "${MYUSERS}" "${MYHOSTALLOW}" "${MYWINSSERVER}"; then
echo "[3>] with error"
logMark "finish error 3 smb conf"
logTail
exit 3
fi
echo "[4]"
if ! ./kerberos-connect-kdc.sh "${MYDNS}" "${MYKDC}"; then
echo "[4>] with error"
logMark "finish error 4 kdc"
logTail
exit 4
fi
echo "[5]"
if ! ./sync-clocks.sh "${MYKDC}"; then
echo "[5>] with error"
logMark "finish error 5 sync clocks"
logTail
exit 5
fi
echo "[6]"
if ! ./kerberos-get-tgt.sh "${MYREALM}" "${MYADMIN}" "${MYADMINPWD}"; then
echo "[6>] with error"
logMark "finish error 6 kerberos"
logTail
exit 6
fi
echo "[7]"
if ! ./join-domain.sh ${MYVERBOSE} "${MYREALM}" "${MYADMIN}" "${MYADMINPWD}" "${MYOU}"; then
echo "[7>] with error"
logMark "finish error 7 join domain"
logTail
exit 7
fi
echo "[8]"
if ! ./config-winbind.sh; then
echo "[8>] with error"
logMark "finish error 8 winbind"
logTail
exit 8
fi
echo "[9]"
if ! ./config-smb.sh; then
echo "[9>] with error"
logMark "finish error 9 smb"
logTail
exit 9
fi
echo "[10]"
if ! ./config-nss.sh; then
echo "[10>] with error"
logMark "finish error 10 nss"
logTail
exit 10
fi
echo "[11]"
echo "+finalize"
sleep 10
echo "restart name caching daemon"
${SERVICE} ${NSCDSERVICE} stop > /dev/null 2> /dev/null
if ! ${SERVICE} ${NSCDSERVICE} start > /dev/null 2> /dev/null;then
echo "[11>] with error"
logMark "finish error 11 name caching daemon"
logTail
exit 11
fi
echo "restart winbind daemon"
if ! ${SERVICE} ${WINBINDSERVICE} restart > /dev/null 2> /dev/null;then
echo "[12>] with error"
logMark "finish error 12 winbind daemon"
logTail
exit 12
fi
echo "restart samba daemons"
if ! ${SERVICE} ${SAMBASERVICE} restart > /dev/null 2> /dev/null;then
echo "[13>] with error"
logMark "finish error 13 samba daemons"
logTail
exit 13
fi
echo "[install ok]"
./config-warn.sh
logMark "finish ok"
sadms-2.0.15/bin/conf/unconfig-nss.sh 0000755 0001750 0001750 00000002073 11521213113 017211 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 17.11.2006
# conf/unconfig-nss.sh
### P A R A M S
# none
### I N C L U D E S
. ./_include.sh
### M O D I F I E D F I L E S ...
nssconffile=nsswitch.conf
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_MOD=644
### S T A R T
# C L E A N U P N S S W I T C H . C O N F
echo "+configure name switch service"
echo "clean up ${ETCDIR}/${nssconffile}"
sed 's/ winbind//' ${ETCDIR}/${nssconffile} > ${TMPDIR}/${nssconffile}
# I N S T A L L
echo install modified ${nssconffile} to ${ETCDIR}
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_MOD} ${TMPDIR}/${nssconffile} ${ETCDIR} > /dev/null
# C L E A N U P
rm -f ${TMPDIR}/${nssconffile}
# S E R V I C E N A M E S W I T C H C A C H E D A E M O N
echo "+restart ${NSCDSERVICE}"
if ${SERVICESTATUS} ${NSCDSERVICE} > /dev/null; then
${SERVICE} ${NSCDSERVICE} stop > /dev/null
${SERVICE} ${NSCDSERVICE} start > /dev/null
fi
# S E R V I C E A U T O S T A R T
#echo "+disable ${NSCDSERVICE} automatic startup"
#${SERVICEREMOVE} ${NSCDSERVICE} > /dev/null 2> /dev/null
sadms-2.0.15/bin/conf/unconfig-pam_winbind.sh 0000755 0001750 0001750 00000002625 11521213113 020700 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 14/07/2009
# conf/unconfig-pam_winbind.sh
### I N C L U D E
. ./_include.sh
### P A R A M S
if [ "$1" == "-f" ];then
MYDIR="$2"
shift
shift
else
MYDIR="${PAMDIR}"
fi
MYSERVICES="$1"
MYMODES="$2"
#echo "dir=${MYDIR}"
#echo "services=${MYSERVICES}"
#echo "modes=${MYMODES}"
### M O D I F I E D F I L E S ...
# those specified by ${MYDIR}/${MYSERVICES}
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_PAM_MOD=644
### S T A R T
echo "+uninstall pam_winbind"
case ${DISTRIBUTION} in
Debian|Ubuntu)
echo "remove winbind profile for pam-auth-update"
rm /usr/share/pam-configs/winbind
;;
*)
echo "fall back to common pam files update"
# C L E A N U P P A M H O O K
j=1
for i in ${MYSERVICES}; do
# read mode
mode=`echo ${MYMODES} | gawk '{split($0,a);print a[nth]}' "nth=${j}"`
j=$((j+1))
# handle file
echo "remove pam_winbind references in ${MYDIR}/${i}"
# check
if [ ! -f ${MYDIR}/${i} ]; then
echo "cannot clean up ${MYDIR}/${i} (does not exist)"
continue
fi
# remove
awk -f pam_parse.awk "remove_pamwinbind=1" "output_${mode}=1" ${MYDIR}/${i} > ${TMPDIR}/${i}
#cat ${TMPDIR}/${i}
# install
echo "install modified ${i} to ${MYDIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_PAM_MOD} ${TMPDIR}/${i} ${MYDIR} > /dev/null
# cleanup temporary
rm ${TMPDIR}/${i}
done
;;
esac
sadms-2.0.15/bin/conf/_shares.conf 0000644 0001750 0001750 00000001766 11303140511 016543 0 ustar gauvain gauvain
[homes]
comment = Home Directory
browseable = no
writable = yes
valid users = @"%DOMAIN%%SEP%%USERS%"
; read only = No
; create mask = 0664
; directory mask = 0775
[users]
path = /home
comment = All Home Directories
browseable = yes
writable = yes
valid users = @"%DOMAIN%%SEP%%USERS%"
admin users = "%DOMAIN%%SEP%%ADMIN%"
read list = @"%DOMAIN%%SEP%%USERS%"
write list = @"%DOMAIN%%SEP%%USERS%"
[data]
path = /data
comment = Data
browseable = yes
writable = yes
valid users = @"%DOMAIN%%SEP%%USERS%"
admin users = "%DOMAIN%%SEP%%ADMIN%"
read list = @"%DOMAIN%%SEP%%USERS%"
write list = @"%DOMAIN%%SEP%%USERS%"
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no
; public = yes
# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
;public = yes
;to allow user 'guest account' to print
sadms-2.0.15/bin/conf/unconfig-pam_mount.sh 0000755 0001750 0001750 00000002630 11521213113 020404 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 14/07/2009
# conf/unconfig-pam_mount.sh
### I N C L U D E
. ./_include.sh
### P A R A M S
if [ "$1" == "-f" ];then
MYDIR="$2"
shift
shift
else
MYDIR="${PAMDIR}"
fi
MYSERVICES="$1"
MYMODES="$2"
#echo "dir=${MYDIR}"
#echo "services=${MYSERVICES}"
#echo "modes=${MYMODES}"
### M O D I F I E D F I L E S ...
# those specified by ${MYDIR}/${MYSERVICES}
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_PAM_MOD=644
### S T A R T
echo "+uninstall pam_mount"
case ${DISTRIBUTION} in
Debian|Ubuntu)
echo "remove libpam-mount profile for pam-auth-update"
rm /usr/share/pam-configs/libpam-mount
;;
*)
echo "fall back to common pam files update"
# C L E A N U P P A M H O O K
j=1
for i in ${MYSERVICES}; do
# read mode
mode=`echo ${MYMODES} | gawk '{split($0,a);print a[nth]}' "nth=${j}"`
j=$((j+1))
# handle file
echo "remove pam_mount references in ${MYDIR}/${i}"
# check
if [ ! -f ${MYDIR}/${i} ]; then
echo "cannot clean up ${MYDIR}/${i} (does not exist)"
continue
fi
# remove
awk -f pam_parse.awk "remove_pammount=1" "output_${mode}=1" ${MYDIR}/${i} > ${TMPDIR}/${i}
#cat ${TMPDIR}/${i}
# install
echo "install modified ${i} to ${MYDIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_PAM_MOD} ${TMPDIR}/${i} ${MYDIR} > /dev/null
# cleanup temporary
rm ${TMPDIR}/${i}
done
;;
esac
sadms-2.0.15/bin/conf/unconfig-pam_mkhomedir.sh 0000755 0001750 0001750 00000002645 11521213113 021227 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 14/07/2009
# conf/config-pam_mkhomedir.sh
### I N C L U D E
. ./_include.sh
### P A R A M S
if [ "$1" == "-f" ];then
MYDIR="$2"
shift
shift
else
MYDIR="${PAMDIR}"
fi
MYSERVICES="$1"
MYMODES="$2"
#echo "dir=${MYDIR}"
#echo "services=${MYSERVICES}"
#echo "modes=${MYMODES}"
### M O D I F I E D F I L E S ...
# those specified by ${MYDIR}/${MYSERVICES}
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_PAM_MOD=644
### S T A R T
echo "+uninstall pam_mkhomedir"
case ${DISTRIBUTION} in
Debian|Ubuntu)
echo "remove libpam-mkhomedir profile for pam-auth-update"
rm /usr/share/pam-configs/libpam-mkhomedir
;;
*)
echo "try common pam files update"
# C L E A N U P P A M H O O K
j=1
for i in ${MYSERVICES}; do
# read mode
mode=`echo ${MYMODES} | gawk '{split($0,a);print a[nth]}' "nth=${j}"`
j=$((j+1))
# handle file
echo "remove pam_mkhomedir references in ${MYDIR}/${i}"
# check
if [ ! -f ${MYDIR}/${i} ]; then
echo "cannot clean up ${MYDIR}/${i} (does not exist)"
continue
fi
# remove
awk -f pam_parse.awk "remove_pammkhomedir=1" "output_${mode}=1" ${MYDIR}/${i} > ${TMPDIR}/${i}
#cat ${TMPDIR}/${i}
# install
echo "install modified ${i} to ${MYDIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_PAM_MOD} ${TMPDIR}/${i} ${MYDIR} > /dev/null
# cleanup temporary
rm ${TMPDIR}/${i}
done
;;
esac
sadms-2.0.15/bin/conf/config-smbconf.sh 0000755 0001750 0001750 00000007372 11521213113 017501 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-08-19 10:00:11
# conf/config-smbconf.sh
### P A R A M S
MYNOSHARES=
if [ "$1" = "-noshares" ]; then
MYNOSHARES="$1"
shift
fi
MYREALM="$1"
MYDOMAIN="$2"
MYSERVER="$3"
MYADMIN="$4"
MYUSERS="$5"
MYHOSTALLOW="$6"
MYWINSSERVER="$7"
MYSEP='/'
MYUSEDEFAULTDOMAIN='yes'
### I N C L U D E S
. ./_include.sh
### M O D W H E T H E R T O I E D F I L E S ...
smbconffile=smb.conf
usermapconffile=user.map
datafolder=/data
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_MOD=644
### S T A R T
# D E T E R M I N E S A M B A V E R S I O N F O R S M B . C O N F S Y N T A X
echo "+get current samba version for smb.conf syntax"
sambapkg="${SAMBAPKG}"
sambaversion=`${PACKAGEVERSION} ${sambapkg} | sed 's/^[^:]://'`
sambamajorversion=`echo "${sambaversion}" | sed 's/^\([0-9]\).*$/\1/g'`
sambaminorversion=`echo "${sambaversion}" | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*$/\1/g'`
echo "samba minor version is ${sambaminorversion}"
echo "+samba config switches"
# D E T E R M I N E W H E T H E R T O U S E I D M A P - R I D
useidmaprid=';'
useidmaprid2=';'
#if [ -d "${SAMBALIBDIR}" -a -e ${SAMBALIBDIR}/idmap/rid.so ];then
if ${PACKAGEHASFILE} ${RIDPACKAGE} 'rid.so';then
if (( $((sambaminorversion)) < 25 )); then
useidmaprid=' '
useidmaprid2=';'
echo "map id from rids using old syntax"
else
useidmaprid=';'
useidmaprid2=' '
echo "map id from rids using new syntax"
fi
fi
# D E T E R M I N E W H E T H E R T O W I N S I S E N A B L E D
usewins=';'
if [ "${MYWINSSERVER}" != "" ];then
usewins=" "
echo "use wins server"
fi
# D E T E R M I N E W H E T H E R T O U S E S H A R E S
conffiles="_smb.conf"
if [ -z "${MYNOSHARES}" ];then
echo "include sample shares"
conffiles="${conffiles} _shares.conf"
fi
# C U S T O M I Z E S M B . C O N F
echo "+customize ${smbconffile}"
awkp='{
gsub("%REALM%","'${MYREALM}'");
gsub("%DOMAIN%","'${MYDOMAIN}'");
gsub("%SERVER%","'${MYSERVER}'");
gsub("%ADMIN%","'"${MYADMIN}"'");
gsub("%USERS%","'"${MYUSERS}"'");
gsub("%HOSTALLOW%","'"${MYHOSTALLOW}"'");
gsub("%WINSSERVER%","'"${MYWINSSERVER}"'");
gsub("%SEP%","'"${MYSEP}"'");
gsub("%USEDEFAULTDOMAIN%","'"${MYUSEDEFAULTDOMAIN}"'");
gsub("%USEWINS%","'"${usewins}"'");
gsub("%USEIDMAPRID%","'"${useidmaprid}"'");
gsub("%USEIDMAPRID2%","'"${useidmaprid2}"'");
print}'
cat ${conffiles} | awk "$awkp" - > ${TMPDIR}/${smbconffile}
#cat ${TMPDIR}/${smbconffile} | grep -v "^#" | grep -v "^;" | grep -v "^$"
echo "install new ${smbconffile} to ${SAMBADIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_MOD} ${TMPDIR}/${smbconffile} ${SAMBADIR} > /dev/null
# C U S T O M I Z E U S E R M A P
echo "+customize ${usermapconffile}"
awkp='{
gsub("%DOMAIN%","'${MYDOMAIN}'");
gsub("%ADMIN%","'"${MYADMIN}"'");
gsub("%USERS%","'"${MYUSERS}"'");
gsub("%SEP%","'"${MYSEP}"'");
print}'
awk "${awkp}" _${usermapconffile} > ${TMPDIR}/${usermapconffile}
#cat ${TMPDIR}/${usermapconffile} | grep -v "^#" | grep -v "^;" | grep -v "^$"
echo "install new ${usermapconffile} to ${SAMBADIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_MOD} ${TMPDIR}/${usermapconffile} ${SAMBADIR} > /dev/null
# C L E A N U P
rm -f ${TMPDIR}/${smbconffile}
rm -f ${TMPDIR}/${usermapconffile}
# D A T A S H A R E
if [ -z "${MYNOSHARES}" ];then
echo "+creating sample data folder in ${datafolder} shared as data"
[ -d ${datafolder} ] || mkdir -p ${datafolder}
chown root.root ${datafolder}
chmod 777 ${datafolder}
touch ${datafolder}/._sadms_
chmod ugo=r ${datafolder}/._sadms_
touch /home/._sadms_
fi
# S T A T U S
[ -d /var/lib/sadms ] || mkdir -p /var/lib/sadms
echo '1' > /var/lib/sadms/smb
# T E S T
testparm -sv > /dev/null 2>&1
if [ "$?" != "0" ]; then
echo "testparm signalled error" >&2
testparm -sv >&2
fi
exit $?
sadms-2.0.15/bin/conf/leave-domain.sh 0000755 0001750 0001750 00000001273 11521213113 017142 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-06-07
# conf/leave-domain.sh
### P A R A M S
MYVERBOSE=
redirection='> /dev/null'
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
redirection=
shift
fi
MYADMIN="$1"
MYADMINPWD="$2"
### I N C L U D E S
. ./_include.sh
### S T A R T
function indomain()
{
echo "+test domain membership"
e="net ads testjoin > /dev/null 2>&1"
if eval ${e}; then
echo "in domain"
return 0
else
echo "not in domain"
return 1
fi
}
# L E A V E D O M A I N
if indomain; then
echo "+leave domain"
e="net ads leave -U '${MYADMIN}%${MYADMINPWD}' ${redirection}"
#echo ${e}
eval ${e}
echo "left domain"
fi
# T E S T
#if indomain; then
# exit 1
#else
exit 0
#fi
sadms-2.0.15/bin/conf/unconfig.sh 0000755 0001750 0001750 00000002030 11521213113 016401 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-06-24 09:24:55
# conf/unconfig.sh
### P A R A M S
MYVERBOSE=
if [ "$1" = "-v" ]; then
MYVERBOSE="-v"
shift
fi
MYPAM=
if [ "$1" = "-pam" ];then
MYPAM='True'
shift
fi
MYADMIN="$1"
MYADMINPWD="$2"
#echo "admin=${MYADMIN}"
#echo "admin passwd=${MYADMINPWD}"
#echo "pam=${MYPAM}"
### I N C L U D E S
. ./_include.sh
### S T A R T
if [ ! -z "${MYPAM}" ]; then
echo "+begin pam winbind uninstall"
case ${DISTRIBUTION} in
Redhat|Fedora|Mandriva)
./unconfig-pam_winbind.sh "all" "system-auth"
;;
Debian|Ubuntu)
./unconfig-pam_winbind.sh "auth" "common-auth" "account" "common-account" "password" "common-password" "session" "common-session"
;;
*)
echo "Unsupported distribution" >&2
exit 1
;;
esac
echo "+end pam winbind uninstall"
fi
echo "[1]"
./unconfig-smb.sh
echo "[2]"
./unconfig-nss.sh
echo "[3]"
./unconfig-winbind.sh
echo "[4]"
./leave-domain.sh ${MYVERBOSE} "${MYADMIN}" "${MYADMINPWD}"
#./unconfig-smbconf.sh
#./unconfig-kerberos.sh
echo "[uninstall ok]"
exit 0
sadms-2.0.15/bin/conf/join-domain.sh 0000755 0001750 0001750 00000003650 11521213113 017006 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-06-24 07:46:04
# conf/join-domain.sh
### P A R A MS
MYVERBOSE=
redirection='> /dev/null'
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
redirection=
shift
fi
MYREALM="$1"
MYADMIN="$2"
MYADMINPWD="$3"
MYOU="$4"
# organizational unit to put computer in
#echo "realm=${MYREALM}"
#echo "ou=${MYOU}"
#echo "admin=${MYADMIN}"
#echo "admin password=${MYADMINPWD}"
### I N C L U D E S
. ./_include.sh
### S T A R T
function dokinit()
{
if echo "${MYADMINPWD}" | ${KINIT} ${MYADMIN}@${MYREALM} > /dev/null; then
echo "kerberos authentication of ${MYADMIN}@${MYREALM} succeeded"
return 0
else
echo "kerberos authentication of ${MYADMIN}@${MYREALM} failed"
return 1
fi
}
function indomain()
{
echo "+test domain membership"
e="net ads testjoin 2>&1 ${redirection}"
if eval ${e}; then
echo "in domain"
return 0
else
echo "not in domain"
return 1
fi
}
# different net ads join OU syntax as of 3.0.23
echo "+get current samba version for join domain syntax"
sambapkg="${SAMBAPKG}"
sambaversion=`${PACKAGEVERSION} ${sambapkg} | sed 's/^[^:]://'`
sambamajorversion=`echo "${sambaversion}" | sed 's/^\([0-9]\).*$/\1/g'`
sambaminorversion=`echo "${sambaversion}" | sed 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*$/\1/g'`
echo "samba minor version is ${sambaminorversion}"
if (( $((sambaminorversion)) < 23 )); then
ouswitch=
else
ouswitch=createcomputer=
fi
#echo "ouswitch=${ouswitch}"
#echo net ads join ${ouswitch}"${MYOU}"
# J O I N D O M A I N
#echo "+get administrator credentials"
#if ! dokinit; then
# exit 1
#fi
if [ ! -z "${MYOU}" ]; then
echo "+join domain to ${MYOU}"
joinparam="${ouswitch}\"${MYOU}\""
else
echo "+join domain"
joinparam=
fi
e="net ads join ${joinparam} -U '${MYADMIN}%${MYADMINPWD}' ${redirection}"
#echo $e
if eval ${e} ; then
echo "join succeeded"
else
echo "join failed and returned $?"
exit 2
fi
# T E S T
if indomain; then
echo "join is ok"
else
exit 3
fi
exit 0
sadms-2.0.15/bin/conf/unconfig-winbind.sh 0000755 0001750 0001750 00000000771 11521213113 020043 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2005-06-26 11:21:17
# conf/unconfig-winbind.sh
### P A R A M S
# none
### I N C L U D E S
. ./_include.sh
### M O D I F I E D F I L E S ...
# none
### S T A R T
# S E R V I C E
echo "+stop winbind"
if ${SERVICESTATUS} ${WINBINDSERVICE} > /dev/null; then
${SERVICE} ${WINBINDSERVICE} stop > /dev/null
fi
# S E R V I C E A U T O S T A R T
echo "+disable ${WINBINDSERVICE} automatic startup"
${SERVICEREMOVE} ${WINBINDSERVICE} > /dev/null 2> /dev/null
exit 0
sadms-2.0.15/bin/conf/_pam_mount.conf.volume 0000644 0001750 0001750 00000000142 11303140511 020546 0 ustar gauvain gauvain volume %USER% cifs %SERVER% %SHARE% %MOUNTPOINT% rw,uid=&,file_mode=0750,dir_mode=0750,noperm - -
sadms-2.0.15/bin/conf/config-nss.sh 0000755 0001750 0001750 00000007042 11521213113 016647 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-05
# conf/config-nss.sh
### P A R A M S
# none
### I N C L U D E S
. ./_include.sh
### M O D I F I E D F I L E S ...
nssconffile=nsswitch.conf
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_MOD=644
### H E L P E R S
function confWinbind()
{
awk 'BEGIN {
FS=" ";
keys="passwd:,shadow:,group:";
n=split(keys,key,",");
}
{
foundkey=0;
for(k=1;k<=n;k++)
{
if(key[k] == $1)
{
foundkey=1;
#printf("<%s\n",$0);
if(index($0,"winbind") == 0)
{
printf("%-12s\t",$1);
set=0;
for (i=2;i<=NF;i++)
{
printf("%s ",$i);
if("files" == $i || "compat" == $i)
{
printf("winbind ");
set=1;
}
}
if (!set)
printf("winbind");
printf("\n");
}
else
{
printf("%s\n",$0);
}
break;
}
}
if(!foundkey)
print
}'
}
function confDns()
{
awk 'BEGIN {
FS=" ";
keys="hosts:";
n=split(keys,key,",");
}
{
if(index($0,"#[SADMS]#") == 0)
{
foundkey=0;
for(k=1;k<=n;k++)
{
if(key[k] == $1)
{
foundkey=1;
#printf("<%s\n",$0);
if(index($0,"mdns") != 0)
{
printf("%s\n",$0);
printf("#[SADMS]#%-12s\t",$1,"");
found=0;
for (i=2;i<=NF;i++)
{
if(index($i,"mdns") != 0)
{
found=1;
continue;
}
if(found && index($i,"[NOTFOUND=return]") != 0)
{
found=0;
continue;
}
found=0;
printf("%s ",$i);
}
printf("\n");
}
else
{
printf("%s\n",$0);
}
break;
}
}
if(!foundkey)
print
}
}'
}
function fixUbuntuNscd()
{
echo "ubuntu create /var/run/nscd /var/db/nscd for nscd operation"
[ -d /var/run/nscd ] || mkdir -p /var/run/nscd
[ -d /var/db/nscd ] || mkdir -p /var/db/nscd
}
function fixAvahi()
{
if grep 'hosts:.*mdns' ${ETCDIR}/${nssconffile} > /dev/null; then
echo "WARNING: avahi may interfere with naming"
echo "in case of trouble,uncomment suggested 'host:' line in ${ETCDIR}/${nssconffile}"
fi
}
### S T A R T
echo "+configure name switch service"
# E N S U R E N S S S W I T C H . C O N F E X I S T S
# create nsswitch.conf if needed
if [ ! -f ${ETCDIR}/${nssconffile} ]; then
echo "copy new ${ETCDIR}/${nssconffile}"
cp ./_${nssconffile} ${ETCDIR}/${nssconffile}
fi
# C U S T O M I Z E E X I S T I N G N S S W I T C H . C O N F
cat ${ETCDIR}/${nssconffile} | confWinbind | confDns > ${TMPDIR}/${nssconffile}
#cat ${TMPDIR}/${nssconffile} | grep -v "^#" | grep -v "^$"
# D N S
fixAvahi
# I N S T A L L
echo "install modified ${nssconffile} to ${ETCDIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_MOD} ${TMPDIR}/${nssconffile} ${ETCDIR} > /dev/null
# C L E A N U P
rm -f ${TMPDIR}/${nssconffile}
# D Y N A M I C L O A D E R
echo "configure dynamic linker run time bindings"
ldconfig -v 2> /dev/null | grep winbind | sed 's/^[[:space:]]*//'
# N A M E S W I T C H C A C H E D A E M O N F I X
case ${DISTRIBUTION} in
Ubuntu)
exit 0
;;
*)
;;
esac
# S E R V I C E N A M E S W I T C H C A C H E D A E M O N A U T O S T A R T
echo "+${NSCDSERVICE} automatic startup"
${SERVICEADD} ${NSCDSERVICE} > /dev/null;
# S E R V I C E N A M E S W I T C H C A C H E D A E M O N
echo "+start ${NSCDSERVICE}"
if ${SERVICESTATUS} ${NSCDSERVICE} > /dev/null; then
${SERVICE} ${NSCDSERVICE} restart > /dev/null
else
${SERVICE} ${NSCDSERVICE} start > /dev/null
fi
if ${SERVICESTATUS} ${NSCDSERVICE} > /dev/null; then
echo "${NSCDSERVICE} started"
else
echo "${NSCDSERVICE} failed to start" >&2
exit 1
fi
sadms-2.0.15/bin/conf/unconfig-pam_mountconf.sh 0000755 0001750 0001750 00000001716 11521213113 021256 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:24:46
# conf/unconfig-pam_mountconf.sh
### P A R A M S
MYMOUNTPOINT="$1"
### I N C L U D E S
. ./_include.sh
### M O D I F I E D F I L E S ...
pammountconf=pam_mount.conf
### S T A R T
echo "+remove pam_mount configuration"
# R E M O V E P A M _ M O U N T . C O N F
if [ -f ${SECDIR}/${pammountconf} ]; then
echo "remove ${SECDIR}/${pammountconf}"
rm -f ${SECDIR}/${pammountconf}
fi
# R E M O V E M O U N T P O I N T
echo "+remove mount point"
subhome=${MYMOUNTPOINT#\~/}
if [ "${MYMOUNTPOINT}" != "${subhome}" ]; then
echo "home ${subhome} within user's home"
# remove mount point to /etc/skel
if [ -d ${SKELDIR}/${subhome} ]; then
echo "remove mount point ${SKELDIR}/${subhome}"
rmdir ${SKELDIR}/${subhome}
fi
else
echo "home ${subhome} outside user's home"
if [ ! "${MYMOUNTPOINT}" = "" ] && [ -d ${MYMOUNTPOINT} ];then
echo "remove mount point ${MYMOUNTPOINT}"
rmdir ${MYMOUNTPOINT}
fi
fi
sadms-2.0.15/bin/conf/kerberos-get-tgt.sh 0000755 0001750 0001750 00000001637 11521213113 017772 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:25:39
# kerberos-get-tgt.sh
### P A R A M S
MYVERBOSE=
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
shift
fi
MYREALM="$1"
MYADMIN="$2"
MYADMINPWD="$3"
### I N C L U D E
. ./_include.sh
## F I L E S
krbconffile=/etc/krb5.conf
### S T A R T
result=0
echo "+get Kerberos ticket-granting ticket for principal ${MYADMIN}@${MYREALM}"
echo "${MYADMINPWD}" | ${KINIT} ${MYADMIN}@${MYREALM} > /dev/null 2> /dev/null
if [ "$?" != "0" ]; then
echo "could not acquire Kerberos ticket" >&2
echo "+WARNING" >&2
echo "Kerberos requires administrator's password" >&2
echo "to have been reset once since domain install" >&2
echo "in order to add DES encryption keys to user" >&2
echo "account which only has a RC4 key when" >&2
echo "initially created." >&2
exit 1
fi
echo -n "got ticket-granting ticket for principal "
${KLIST} -5 | grep "krbtgt/" | awk '{print $5 }'
exit 0
sadms-2.0.15/bin/conf/config-netlink.sh 0000755 0001750 0001750 00000004660 11521213113 017513 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:24:21
# conf/config-netlink.sh
### P A R A M S
MYMOUNTPOINT="$1"
MYSHARE="$2"
#echo "mountpoint=${MYMOUNTPOINT}"
#echo "share=${MYSHARE}"
### I N C L U D E S
. ./_include.sh
### M O D I F I E D F I L E S ...
skelprofile=.bash_profile
### ... W I T H A C C E S S
INST_SKEL_MOD=644
INST_UID=0
INST_GID=0
case ${DISTRIBUTION} in
Redhat|Fedora|Mandriva)
INST_XINIT_MOD=755
;;
Debian|Ubuntu)
INST_XINIT_MOD=644
;;
*)
INST_XINIT_MOD=644
;;
esac
### S O U R C E F I L E S ...
skelprofileext=_bash_profile-ext
### S T A R T
# C O M P U T E U S E R N A M E S E P A R A T O R
#separator=`testparm -sv 2> /dev/null | grep 'winbind separator' | awk '{print $4}'`
#echo "separator=${separator}"
# C O M P U T E I F S H A R E I S U S E R N A M E
sharebasename=${MYSHARE/*\//}
haveperusersubdir=
if [ "${sharebasename}" != "${MYSHARE}" ]; then
haveperusersubdir=1
fi
echo "sharebasename=${sharebasename}"
echo "haveperusersubdir=${haveperusersubdir}"
# C U S T O M I Z E / E T C / S K E L / . B A S H _ P R O F I L E
[ -e ${SKELDIR}/${skelprofile} ] || touch ${SKELDIR}/${skelprofile}
echo "+customize ${SKELDIR}/${skelprofile}"
# check if already there
grep -s "# sadms" ${SKELDIR}/${skelprofile} > /dev/null
case $? in
0)
# abstain
echo "sadms is already used in ${SKELDIR}/${skelprofile}"
;;
*)
# do it
echo "add link-making to ${SKELDIR}/${skelprofile}"
# append blob
cp ${SKELDIR}/${skelprofile} ${TMPDIR}/${skelprofile}
echo "# sadms.begin" >> ${TMPDIR}/${skelprofile}
echo "netmountpoint=${MYMOUNTPOINT}" >> ${TMPDIR}/${skelprofile}
echo "haveperusersubdir=${haveperusersubdir}" >> ${TMPDIR}/${skelprofile}
cat ./${skelprofileext} >> ${TMPDIR}/${skelprofile}
echo "# sadms.end" >> ${TMPDIR}/${skelprofile}
#cat ${TMPDIR}/${skelprofile}
# install
echo "install ${skelprofile} to ${SKELDIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_SKEL_MOD} ${TMPDIR}/${skelprofile} ${SKELDIR} > /dev/null
rm -f ${TMPDIR}/${skelprofile}
;;
esac
# C U S T O M I Z E X I N I T R C / X S E S S I O N
echo "+add ${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}"
echo "netmountpoint=${MYMOUNTPOINT}" > ${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}
echo "haveperusersubdir=${haveperusersubdir}" >> ${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}
cat ./${skelprofileext} >> ${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}
chmod ${INST_XINIT_MOD} ${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}
sadms-2.0.15/bin/conf/config-pam.sh 0000755 0001750 0001750 00000000525 11521213113 016620 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 14/07/2009
# conf/config-pam.sh
### I N C L U D E
. ./_include.sh
### P A R A M S
### M O D I F I E D F I L E S ...
# pam common files
### D I S T R I B U T I O N S P E C I F I C
case ${DISTRIBUTION} in
Debian|Ubuntu)
;;
*)
return
;;
esac
### S T A R T
pam-auth-update --package --force
sadms-2.0.15/bin/conf/kerberos-connect-kdc.sh 0000755 0001750 0001750 00000002152 11521213113 020600 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2007-05-22 16:25:22
# kerberos-connect-kdc.sh
### P A R A M S
MYVERBOSE=
if [ "$1" = "-v" ]; then
MYVERBOSE="True"
shift
fi
MYDNS="$1"
MYKDC="$2"
#echo "dns=${MYDNS}"
#echo "kdc=${MYKDC}"
### I N C L U D E
. ./_include.sh
### S T A R T
function resolve()
{
python -c "import socket;socket.gethostbyname(\"$1\")" 2> /dev/null
return $?
}
function resolveDns()
{
output=`host "$1" 2> /dev/null | grep -v '^;;' | grep -v 'not found'`
if [ "${output}" != "" ];then
echo ${output}
return 0
fi
return 1
}
echo "+ping kdc ${MYKDC}"
ping -q -c 1 ${MYKDC} > /dev/null
if [ "$?" == "0" ]; then
echo "ok"
exit 0
else
ping -q -c 1 ${MYKDC} > /dev/null
echo "kdc ${MYKDC} cannot be pinged (firewall may drop pings)" >&2
# fall through
fi
echo "+resolve kdc ${MYKDC} through dns"
resolveDns ${MYKDC}
if [ "$?" != "0" ]; then
echo "dns cannot resolve kdc ${MYKDC} (may be resolved through other mechanism)" >&2
else
echo "ok"
fi
echo "+resolve kdc ${MYKDC} to ip"
resolve ${MYKDC}
if [ "$?" != "0" ]; then
echo "unresolved kdc ${MYKDC}" >&2
exit 1
else
echo "ok"
fi
exit 0
sadms-2.0.15/bin/conf/unconfig-netlink.sh 0000755 0001750 0001750 00000002455 11521213113 020056 0 ustar gauvain gauvain #!/bin/bash
# bbou@ac-toulouse.fr
# 2004-09-29 17:19:43
# conf/unconfig-netlink.sh
### P A R A M S
### I N C L U D E S
. ./_include.sh
### M O D I F I E D F I L E S ...
skelprofile=.bash_profile
### ... W I T H A C C E S S
INST_UID=root
INST_GID=root
INST_MOD=644
### S O U R C E F I L E S ...
krb5conffile0=_${krb5conffile}
### S T A R T
# C L E A N U P / E T C / S K E L / . B A S H _ P R O F I L E
start=`grep -n '# sadms.begin' ${SKELDIR}/${skelprofile} | awk 'BEGIN{FS=":"}{print $1 }'`
end=`grep -n '# sadms.end' ${SKELDIR}/${skelprofile} | awk 'BEGIN{FS=":"}{print $1 }'`
if [ ! "${start}" == "" ] && [ ! "${end}" == "" ];then
echo "+cleanup ${SKELDIR}/${skelprofile} : remove lines `expr ${start} - 1` to `expr ${end} + 1`"
head -`expr ${start} - 1` ${SKELDIR}/${skelprofile} > ${TMPDIR}/${skelprofile}
tail +`expr ${end} + 1` ${SKELDIR}/${skelprofile} >> ${TMPDIR}/${skelprofile}
echo "install ${skelprofile} to ${SKELDIR}"
${INSTALL} -o ${INST_UID} -g ${INST_GID} -m ${INST_MOD} ${TMPDIR}/${skelprofile} ${SKELDIR} > /dev/null
rm -f ${TMPDIR}/${skelprofile}
fi
# C L E A N U P X I N I T R C / X S E S S I O N
echo "+remove ${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}"
if [ -f "${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}" ]; then
rm -f "${X11DIR}/${XINITRCDIR}/${XINITRCCIFSMOUNT}"
fi
sadms-2.0.15/bin/conf/_pam_mount.conf.xml.volume 0000644 0001750 0001750 00000000173 11303140511 021351 0 ustar gauvain gauvain
sadms-2.0.15/bin/conf/_krb5.conf 0000644 0001750 0001750 00000001401 11303140511 016103 0 ustar gauvain gauvain # krb5.conf
# KERBEROS CONFIG FILE
# SADMS
# 2005-07-10 07:47:33
[libdefaults]
ticket_lifetime = 24000
default_realm = %REALM%
default_tgs_entypes = rc4-hmac des-cbc-md5
default_tkt__enctypes = rc4-hmac des-cbc-md5
permitted_enctypes = rc4-hmac des-cbc-md5
# dns_lookup_realm = true
# dns_lookup_kdc = true
dns_fallback = yes
[realms]
%REALM% = {
kdc = %KDC%
default_domain = %DNS%
}
[domain_realm]
.%DNS% = %REALM%
%DNS% = %REALM%
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
#[kdc]
# profile = /var/kerberos/krb5kdc/kdc.conf
sadms-2.0.15/bin/conf/pam_parse.awk 0000644 0001750 0001750 00000035613 11467717577 016762 0 ustar gauvain gauvain #!/bin/awk
# bbou@ac-toulouse.fr
# 2007-11-03 11:55:28
# conf/pam_parse.awk
# HELPERS
function join(thisarray,p,q)
{
thisresult=""
for (j=p;j<=q;j++)
{
if(j!=p)
thisresult=thisresult " "
thisresult=thisresult thisarray[j]
}
return thisresult
}
# insertions
function insert_before(i,n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg)
{
if(i>n-1)
{
return append(n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg)
}
for (j=n-1;j>=i;j--)
{
thesecontrols[j+1]=thesecontrols[j]
theseprogs[j+1]=theseprogs[j]
theseargs[j+1]=theseargs[j]
}
thesecontrols[i]=thiscontrol
theseprogs[i]=thisprog
theseargs[i]=thisarg
return n+1;
}
function insert_after(i,n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg)
{
return insert_before(i+1,n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg);
}
function append(n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg)
{
thesecontrols[n]=thiscontrol
theseprogs[n]=thisprog
theseargs[n]=thisarg
return n+1
}
function prepend(n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg)
{
return insert_before(0,n,thesecontrols,theseprogs,theseargs,thiscontrol,thisprog,thisarg);
}
# deletions
function remove(i,n,thesecontrols,theseprogs,theseargs)
{
delete thesecontrols[i]
delete theseprogs[i]
delete theseargs[i]
for (j=i;j