[Samba] Re: Global Windows Environment-Variables
You can also do it with registry settings. You can use the regedit command to export the settings and then use a script to merge. Jim C. Hello, does anybody know, how to set Global-Variables for a Windows-System? I would like to set variabels in the login-script and use them in a Word-Document. PS: set bla=foo works only for the current shell/cmd.exe, not global matze -- - | I can be reached on the following Instant Messenger services: | |---| | MSN: [EMAIL PROTECTED] AIM: WyteLi0n ICQ: 123291844 | |---| | Y!: j_c_llings Jabber: [EMAIL PROTECTED]| - -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Browsing a across subnets
Hi, it is possible to setup this read browsing across subnets chapter in the man files of samba Regards [EMAIL PROTECTED] schrieb: Hi, I've got a small network at home with a topology as follows: -- Cable Modem -- Router 1 -- Switch 1 -- Server 1 | Router 2/Switch 2 --+-- Server 2 | | | WAP 1 --+ +-- WAP 2 +-- Client 1 | +-- Client 2 Router 1 and WAP 1 have NAT enabled. Router 2 and WAP 2 do not have NAT enabled. Server 1 and Server 2 are Linux boxes. Client 1 and Client 2 are Win XP I use the following sub-nets: Switch 1 - 192.168.1.0/24 Switch 2 - 192.168.2.0/24 WAP 1- 192.168.3.0/24 WAP 2- 192.168.4.0/24 A caching name server runs on Server 1 and also an internal DNS service. There is full connectivity between all machines on the internal side of router 2, i.e. Client 1, Client 2, and Server 2 can all ping each other. Even without introducing SAMBA into the equation I am not able to successfully browse shares/printers on client 1 from client 2. Is this possible across different subnets? Are there any special steps I need to take? I have installed SAMBA on Server 2 and would like to be able to browse shares on Server 2 from both Client 1 and Client 2. Can anyone point me at any resources that might help me work this out? Thanks, R. -- http://robinbowes.com -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Bali Special Getaway Villa Packages
Getaway to Bali and stay at The Dusuns private villas. The Dusun is currently offering discount rates for those of you who wish to visit Bali from October to December 14th. Stay in your own private luxury, 1 or 3 bedroom, villa, each with their own private swimming pool. Visit our web site, this following link will entitle you to your discount rate. http://www.the-dusun.com/special_deal.asp -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] roaming profiles ok, but what about the printers?
I've got some inspirations from the archive of lists.samba.org and I'm writing a little shell-wrapper around the print-command. Because I have'nt access to the server right now I write this from memory: smb.conf: snip [printers] Browseable = no #don't show the real printers [laser] printeable = yes print command = script.sh laser %s %m %u [laser2] printeable = yes print command = script.sh laser2 %s %m %u [color] printeable = yes print command = script.sh color %s %m %u snap The printshares are only for smb.conf There are no such printers called LASER, LASER2 oder COLOR. on this Server. It's virtual Printers like sambafax the shell-wrapper script.sh: snip #!/bin/bash #4 Parameter: $1-$4. giving to the script at calling time #$1 = which Share used #$2 = spool-file in /var/temp = datas to pPrint #$3 = netbiosname of the calling client #$4 = User cause $3 in client01 ) cause $1 in laser ) lpr -d hplj2300 $2 ;; laser2 ) lpr -d kyo3800 $2 ;; Color ) lpr -d canoni960 $2 ;; esac client02 ) cause $1 in laser ) lpr -d kyo3800 $2 ;; laser2 ) lpr -d hplj2300 $2 ;; Color ) lpr -d canoni960 $2 ;; esac client03 ) cause $1 in laser ) lpr -d hplj6 $2 ;; laser2 ) lpr -d hplj6 $2 ;; Color ) lpr -d Minolta3100 $2 ;; esac esac snap All printers in the lpr-command must be exist. The clients only sees the 3 Printer LASER, LASER2 and COLOR and use them with generic postscript-driver. At the samba server runs also a printserver and it cares via ghostscript about the translation to the the printer. New Printers will be installed only at the linux-server, the name will written in the script.sh and 'done'. No changes necessary at the Clients. So easy can also substituted a printer :) I have to optimise and test this etc. then should it running. B.t.w.: which generic windows-printerdriver would you suggest? Maybe 'Apple Laserwriter 600 PS' or 'HP Laserjet PS' ? Or use you the vendor windows-printerdriver and print at rawdriver on linux-side? greetings Andy P. -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] roaming profiles ok, but what about the printers?
I've got some inspirations from the archive of lists.samba.org and I'm writing a little shell-wrapper around the print-command. Because I have'nt access to the server right now I write this from memory: smb.conf: snip [printers] Browseable = no #don't show the real printers [laser] printeable = yes print command = script.sh laser %s %m %u [laser2] printeable = yes print command = script.sh laser2 %s %m %u [color] printeable = yes print command = script.sh color %s %m %u snap The printshares are only for smb.conf There are no such printers called LASER, LASER2 oder COLOR. on this Server. It's virtual Printers like sambafax the shell-wrapper script.sh: snip #!/bin/bash #4 Parameter: $1-$4. giving to the script at calling time #$1 = which Share used #$2 = spool-file in /var/temp = datas to pPrint #$3 = netbiosname of the calling client #$4 = User cause $3 in client01 ) cause $1 in laser ) lpr -d hplj2300 $2 ;; laser2 ) lpr -d kyo3800 $2 ;; Color ) lpr -d canoni960 $2 ;; esac client02 ) cause $1 in laser ) lpr -d kyo3800 $2 ;; laser2 ) lpr -d hplj2300 $2 ;; Color ) lpr -d canoni960 $2 ;; esac client03 ) cause $1 in laser ) lpr -d hplj6 $2 ;; laser2 ) lpr -d hplj6 $2 ;; Color ) lpr -d Minolta3100 $2 ;; esac esac snap All printers in the lpr-command must be exist. The clients only sees the 3 Printer LASER, LASER2 and COLOR and use them with generic postscript-driver. At the samba server runs also a printserver and it cares via ghostscript about the translation to the the printer. New Printers will be installed only at the linux-server, the name will written in the script.sh and 'done'. No changes necessary at the Clients. So easy can also substituted a printer :) I have to optimise and test this etc. then should it running. B.t.w.: which generic windows-printerdriver would you suggest? Maybe 'Apple Laserwriter 600 PS' or 'HP Laserjet PS' ? Or use you the vendor windows-printerdriver and print at rawdriver on linux-side? greetings Andy P. -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Auto-remove home-directories from Active Directory?
Hi, I have setup a working Samba 3.0.5 joined to a Windows 2003 Active Directory. I have used pam_mkhomedir.so to auto-create home-directories on Samba-server for users that is added to Active directory and it works great. My question is how do I auto-remove home-directories from Samba-server when I delete a user in Active Directory? Regards Thomas _ Get Your Own .NU Web Address Now! --- http://WWW.NUNAMES.NU -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Problem accessing samba shares from Win2k...
Hi, i have a little problem here and i don't know how to solve it.. I'm using samba 3.0.6 on a linux 2.6.7 box and a w2k machine. Accessing the w2k machine via smbclient works well, but accessing a samba share on my linux box will not: if i do under w2k: net view \\linux lists the samba shares, ok net use t: \\linux\test mounts the share to t:, ok but dir t:\ will not work, it only hangs a minute or so, then prints no files found and my firewall pops up messages like ip datagram is not version 4. As i know i have nothing configured using ip version 6. And why can i access shares of the w2k box on linux, but not the other way? Thanks for help Thomas Maier -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] Charset Problem
EmailI have serverl mounted point having different iocharset But samba 3.x seems just having one global unix charset option Is there a way to set charset on a directory basis -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
svn commit: samba-web r313 - in trunk: .
Author: deryck Date: 2004-09-04 13:13:38 + (Sat, 04 Sep 2004) New Revision: 313 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-webpath=/trunkrev=313nolog=1 Log: Add link to latest news item. --deryck Modified: trunk/index.html Changeset: Modified: trunk/index.html === --- trunk/index.html2004-09-03 23:15:47 UTC (rev 312) +++ trunk/index.html2004-09-04 13:13:38 UTC (rev 313) @@ -7,6 +7,7 @@ h2Latest News/h2 ul class=news +li03 September 2004 a href=/samba/news/#jht_slashdotTerpstra Interview From aKademy/a/li li27 August 2004 a href=/samba/news/#comingsoon_3.0.7Samba 3.0.7 Coming Soon/a/li li24 August 2004 a href=/samba/news/#openLDAP-samba3.0.6Corrected OpenLDAP schema file for Samba 3.0.6/a/li li23 August 2004 a href=/samba/news/#cal_update_23AugSamba Team Calendar Updated/a/li @@ -19,7 +20,6 @@ Tutorials/a/li li13 August 2004 a href=/samba/news/#2.2.11Samba 2.2.11 Available for Download/a/li -li12 August 2004 a href=/samba/news/#plug_progressCIFS Conference/Plugfest Progress Report/a/li /ul
svn commit: samba-docs r211 - in trunk: .
Author: jelmer Date: 2004-09-04 13:13:48 + (Sat, 04 Sep 2004) New Revision: 211 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-docspath=/trunkrev=211nolog=1 Log: Fix generation of subject index. Modified: trunk/Makefile.in Changeset: Modified: trunk/Makefile.in === --- trunk/Makefile.in 2004-09-03 17:43:31 UTC (rev 210) +++ trunk/Makefile.in 2004-09-04 13:13:48 UTC (rev 211) @@ -158,11 +158,15 @@ mkdir -p $(@D) cp $ $@ +%.idx: %.tex latexfigures + -$(PDFLATEX) $ + +%.ind: %.idx + $(MAKEINDEX) $ + # Adobe PDF files -%.pdf: %.tex latexfigures +%.pdf: %.tex %.ind latexfigures -$(PDFLATEX) $ - -$(PDFLATEX) $ - $(MAKEINDEX) $* $(THUMBPDF) $*.pdf -$(PDFLATEX) $ @@ -175,7 +179,7 @@ $(MAKE) $(shell $(XSLTPROC) --stringparam prepend --stringparam append .eps --stringparam role latex xslt/find-image-dependencies.xsl $(DOCBOOKDIR)/$*.xml) -$(LATEX) $ -$(LATEX) $ - $(MAKEINDEX) $* + $(MAKEINDEX) $*.idx -$(LATEX) $ %.eps: %.png
svn commit: samba-web r314 - in trunk/scripts: .
Author: deryck Date: 2004-09-04 13:51:17 + (Sat, 04 Sep 2004) New Revision: 314 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-webpath=/trunk/scriptsrev=314nolog=1 Log: Just simplifying the way a couple of lines are written. --deryck Modified: trunk/scripts/updateNews.py Changeset: Modified: trunk/scripts/updateNews.py === --- trunk/scripts/updateNews.py 2004-09-04 13:13:38 UTC (rev 313) +++ trunk/scripts/updateNews.py 2004-09-04 13:51:17 UTC (rev 314) @@ -24,7 +24,7 @@ os.chdir(top_dir) topics = [] -for file in os.listdir(top_dir): +for file in os.listdir(os.curdir): if file in not_news: continue if os.path.isdir(file): topics.append(file) @@ -40,11 +40,10 @@ all_stories = {} for topic in topics: -cur_dir = top_dir + '/' + topic -os.chdir(cur_dir) +os.chdir(topic) topic_stories = {} -for file in os.listdir(cur_dir): +for file in os.listdir(os.curdir): if file in not_news: continue f_lines = open(file, 'r').readlines() story = .join(f_lines) + 'div class=referenceLink: a href=/samba/news/' + topic + '/#' + file[:-5] + '' + topic + '//a/div\n\n'
svn commit: samba-docs r212 - in trunk: Samba-Guide Samba-Guide/images Samba-HOWTO-Collection/images entities smbdotconf xslt xslt/figures
Author: jelmer Date: 2004-09-04 14:47:12 + (Sat, 04 Sep 2004) New Revision: 212 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-docspath=/trunkrev=212nolog=1 Log: - Remove unused entities - Fix syntax error in xslt/pearson.xsl - Ignore some autogenerated files - Remove xinclude.dtd (available on the web) Removed: trunk/entities/xinclude.dtd Modified: trunk/Samba-Guide/Chap01-WindowsNetworkingPrimer.xml trunk/Samba-Guide/Chap02-SimpleOfficeServer.xml trunk/Samba-Guide/Chap03-TheSmallOffice.xml trunk/Samba-Guide/Chap04-SecureOfficeServer.xml trunk/Samba-Guide/Chap05-500UserNetwork.xml trunk/Samba-Guide/Chap06-MakingHappyUsers.xml trunk/Samba-Guide/Chap07-2000UserNetwork.xml trunk/Samba-Guide/Chap08-MigrateNT4Samba3.xml trunk/Samba-Guide/Chap09-AddingUNIXClients.xml trunk/Samba-Guide/Chap10-KerberosFastStart.xml trunk/Samba-Guide/Chap10b-DomainAppsSupport.xml trunk/Samba-Guide/Chap11-HighAvailability.xml trunk/Samba-Guide/Chap12-Appendix.xml trunk/Samba-Guide/acknowledgements.xml trunk/Samba-Guide/conventions.xml trunk/Samba-Guide/foreword.xml trunk/Samba-Guide/front-matter.xml trunk/Samba-Guide/glossary.xml trunk/Samba-Guide/images/ trunk/Samba-Guide/inside-cover.xml trunk/Samba-Guide/preface.xml trunk/Samba-HOWTO-Collection/images/ trunk/entities/global.entities trunk/smbdotconf/ trunk/xslt/figures/ trunk/xslt/pearson.xsl Changeset: Sorry, the patch is too large (476 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba-docspath=/trunkrev=212nolog=1
svn commit: samba r2226 - in branches/SAMBA_4_0/source: build/smb_build scripting/swig
Author: tpot Date: 2004-09-04 22:55:33 + (Sat, 04 Sep 2004) New Revision: 2226 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/sourcerev=2226nolog=1 Log: A bunch of fixes to get python tdb module building again. I'm not sure how this can be integrated into the build system properly though. Editing makefile.pl is the wrong way to do this. Removed: branches/SAMBA_4_0/source/scripting/swig/python/ Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl branches/SAMBA_4_0/source/scripting/swig/tdb.i Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl === --- branches/SAMBA_4_0/source/build/smb_build/makefile.pl 2004-09-04 01:57:21 UTC (rev 2225) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pl 2004-09-04 22:55:33 UTC (rev 2226) @@ -745,24 +745,21 @@ # Swig extensions -PYTHON_TDB_OBJ = lib/tdb/tdb.o lib/tdb/spinlock.o -PYTHON_TDB_PICOBJ = \$(PYTHON_TDB_OBJ:.o=.po) +PYTHON_TDB_OBJ = lib/tdb/common/tdb.o lib/tdb/common/spinlock.o -swig: scripting/swig/python/_tdb.so +swig: scripting/swig/_tdb.so -swig_clean: - -rm -f scripting/swig/python/_tdb.so scripting/swig/python/tdb.pyc \\ - scripting/swig/python/tdb.py scripting/swig/python/tdb_wrap.c \\ - scripting/swig/python/tdb_wrap.po +swig_clean: + -rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\ + scripting/swig/tdb.py scripting/swig/tdb_wrap.c \\ + scripting/swig/tdb_wrap.o -scripting/swig/python/tdb.py: scripting/swig/tdb.i +scripting/swig/tdb.py: scripting/swig/tdb.i swig -python scripting/swig/tdb.i - mv scripting/swig/tdb.py scripting/swig/python - mv scripting/swig/tdb_wrap.c scripting/swig/python -scripting/swig/python/_tdb.so: scripting/swig/python/tdb.py scripting/swig/python/tdb_wrap.po \$(PYTHON_TDB_PICOBJ) - \$(SHLD) \$(LDSHFLAGS) -o scripting/swig/python/_tdb.so scripting/swig/python/tdb_wrap.po \\ - \$(PYTHON_TDB_PICOBJ) +scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o \$(PYTHON_TDB_OBJ) + \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so scripting/swig/tdb_wrap.o \\ + \$(PYTHON_TDB_OBJ) everything: all Modified: branches/SAMBA_4_0/source/scripting/swig/tdb.i === --- branches/SAMBA_4_0/source/scripting/swig/tdb.i 2004-09-04 01:57:21 UTC (rev 2225) +++ branches/SAMBA_4_0/source/scripting/swig/tdb.i 2004-09-04 22:55:33 UTC (rev 2226) @@ -40,7 +40,7 @@ /* Include tdb headers */ -#include tdb/tdb.h +#include lib/tdb/include/tdb.h %} @@ -100,7 +100,8 @@ TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, -tdb_log_func log_fn); +tdb_log_func log_fn, +tdb_hash_func hash_fn); int tdb_reopen(TDB_CONTEXT *tdb); int tdb_reopen_all(void);
svn commit: samba r2227 - in branches/SAMBA_4_0/source/scripting/swig: .
Author: tpot Date: 2004-09-04 23:04:31 + (Sat, 04 Sep 2004) New Revision: 2227 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/scripting/swigrev=2227nolog=1 Log: Get rid of annoying compiler warning. Modified: branches/SAMBA_4_0/source/scripting/swig/tdb.i Changeset: Modified: branches/SAMBA_4_0/source/scripting/swig/tdb.i === --- branches/SAMBA_4_0/source/scripting/swig/tdb.i 2004-09-04 22:55:33 UTC (rev 2226) +++ branches/SAMBA_4_0/source/scripting/swig/tdb.i 2004-09-04 23:04:31 UTC (rev 2227) @@ -28,6 +28,13 @@ %{ +/* This symbol is used in both includes.h and Python.h which causes an + annoying compiler warning. */ + +#ifdef HAVE_FSTAT +#undef HAVE_FSTAT +#endif + /* The tdb_set_lock_alarm() function requires the SIG_ATOMIC_T function from includes.h */ @@ -44,6 +51,7 @@ %} + /* The tdb functions will crash if a NULL tdb is passed */ %include exception.i
svn commit: samba r2228 - in branches/SAMBA_4_0/source: build/smb_build scripting/swig
Author: tpot Date: 2004-09-05 02:06:11 + (Sun, 05 Sep 2004) New Revision: 2228 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/sourcerev=2228nolog=1 Log: Finally commit bits of old workareas together to get dcerpc python bindings happening. This commit lets python call dcerpc_pipe_connect() and open the samr pipe. Added: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i branches/SAMBA_4_0/source/scripting/swig/samr.i Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl branches/SAMBA_4_0/source/scripting/swig/ branches/SAMBA_4_0/source/scripting/swig/samba.i Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pl === --- branches/SAMBA_4_0/source/build/smb_build/makefile.pl 2004-09-04 23:04:31 UTC (rev 2227) +++ branches/SAMBA_4_0/source/build/smb_build/makefile.pl 2004-09-05 02:06:11 UTC (rev 2228) @@ -745,15 +745,10 @@ # Swig extensions +swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so + PYTHON_TDB_OBJ = lib/tdb/common/tdb.o lib/tdb/common/spinlock.o -swig: scripting/swig/_tdb.so - -swig_clean: - -rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\ - scripting/swig/tdb.py scripting/swig/tdb_wrap.c \\ - scripting/swig/tdb_wrap.o - scripting/swig/tdb.py: scripting/swig/tdb.i swig -python scripting/swig/tdb.i @@ -761,6 +756,37 @@ \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so scripting/swig/tdb_wrap.o \\ \$(PYTHON_TDB_OBJ) +PYTHON_DCERPC_OBJ = \$(SUBSYSTEM_LIBRPC_RAW_OBJS) \\ + \$(SUBSYSTEM_LIBNDR_RAW_OBJS) \\ + \$(SUBSYSTEM_LIBBASIC_OBJS) \\ + \$(SUBSYSTEM_CONFIG_OBJS) \\ + \$(SUBSYSTEM_LIBTDB_OBJS) \\ + \$(SUBSYSTEM_SCHANNELDB_OBJS) \\ + \$(SUBSYSTEM_GENSEC_OBJS) \\ + \$(SUBSYSTEM_LIBCLI_UTILS_OBJS) \\ + \$(SUBSYSTEM_LIBCLI_RAW_OBJS) \\ + \$(SUBSYSTEM_LIBCLI_AUTH_OBJS) \\ + \$(SUBSYSTEM_LIBCLI_NMB_OBJS) \\ + \$(SUBSYSTEM_AUTH_OBJS) \\ + \$(SUBSYSTEM_SAMDB_OBJS) \\ + \$(SUBSYSTEM_LIBLDB_OBJS) \\ + \$(SUBSYSTEM_CHARSET_OBJS) \\ + \$(SUBSYSTEM_LIBSMB_OBJS) \\ + \$(SUBSYSTEM_DCERPC_COMMON_OBJS) + +PYTHON_DCERPC_LIBS = -lldap + +scripting/swig/dcerpc.py: scripting/swig/dcerpc.i scripting/swig/samr.i scripting/swig/samba.i + swig -python scripting/swig/dcerpc.i + +scripting/swig/_dcerpc.so: scripting/swig/dcerpc.py scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ) + \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ) \$(PYTHON_DCERPC_LIBS) + +swig_clean: + -rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\ + scripting/swig/tdb.py scripting/swig/tdb_wrap.c \\ + scripting/swig/tdb_wrap.o + everything: all etags: Property changes on: branches/SAMBA_4_0/source/scripting/swig ___ Name: svn:ignore + *.pyc _*.so *_wrap.c Added: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i === --- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i 2004-09-04 23:04:31 UTC (rev 2227) +++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i 2004-09-05 02:06:11 UTC (rev 2228) @@ -0,0 +1,68 @@ +/* + Unix SMB/CIFS implementation. + + Swig interface to librpc functions. + + Copyright (C) Tim Potter 2004 + + 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. +*/ + +%module dcerpc + +%{ + +/* This symbol is used in both includes.h and Python.h which causes an + annoying compiler warning. */ + +#ifdef HAVE_FSTAT +#undef HAVE_FSTAT +#endif + +#include includes.h + +#undef strcpy + +%} + +%include samba.i + +%init %{ +/* setup_logging(python, DEBUG_STDOUT); */ + lp_load(dyn_CONFIGFILE, True, False, False); + load_interfaces(); +%} + +%typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp) { +$1 = temp; +} + +%typemap(argout) struct dcerpc_pipe ** { +PyObject *o = PyTuple_New(2); +PyTuple_SetItem(o, 0, resultobj); +PyTuple_SetItem(o, 1, SWIG_NewPointerObj(*$1, SWIGTYPE_p_dcerpc_pipe, 0)); +resultobj = o; +} +
svn commit: samba r2230 - in branches/SAMBA_4_0/source/scripting/swig: .
Author: tpot Date: 2004-09-05 04:05:45 + (Sun, 05 Sep 2004) New Revision: 2230 WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=sambapath=/branches/SAMBA_4_0/source/scripting/swigrev=2230nolog=1 Log: Wrapper for dcerpc_samr_Connect2(). All this glue code should be automatically generated but at the moment it's hand coded. Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i branches/SAMBA_4_0/source/scripting/swig/samr.i Changeset: Modified: branches/SAMBA_4_0/source/scripting/swig/dcerpc.i === --- branches/SAMBA_4_0/source/scripting/swig/dcerpc.i 2004-09-05 02:39:47 UTC (rev 2229) +++ branches/SAMBA_4_0/source/scripting/swig/dcerpc.i 2004-09-05 04:05:45 UTC (rev 2230) @@ -50,6 +50,26 @@ PyErr_SetObject(ntstatus_exception, obj); } +char *get_string_property(PyObject *dict, char *key) +{ + PyObject *item = PyDict_GetItem(dict, PyString_FromString(key)); + + if (!item) + return 0; /* TODO: throw exception */ + + return PyString_AsString(item); +} + +uint32 get_uint32_property(PyObject *dict, char *key) +{ + PyObject *item = PyDict_GetItem(dict, PyString_FromString(key)); + + if (!item) + return 0; /* TODO: throw exception */ + + return (uint32)PyInt_AsLong(item); +} + %} %include samba.i @@ -61,10 +81,14 @@ ntstatus_exception = PyErr_NewException(dcerpc.NTSTATUS, NULL, NULL); %} -%typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp) { -$1 = temp; +%typemap(in, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp_dcerpc_pipe) { +$1 = temp_dcerpc_pipe; } +%typemap(in, numinputs=0) TALLOC_CTX * { + $1 = talloc_init(foo); +} + %typemap(argout) struct dcerpc_pipe ** { long status = PyLong_AsLong(resultobj); if (status != 0) { Modified: branches/SAMBA_4_0/source/scripting/swig/samr.i === --- branches/SAMBA_4_0/source/scripting/swig/samr.i 2004-09-05 02:39:47 UTC (rev 2229) +++ branches/SAMBA_4_0/source/scripting/swig/samr.i 2004-09-05 04:05:45 UTC (rev 2230) @@ -23,3 +23,16 @@ #define DCERPC_SAMR_UUID 12345778-1234-abcd-ef00-0123456789ac const int DCERPC_SAMR_VERSION = 1.0; #define DCERPC_SAMR_NAME samr + +%typemap(in) struct samr_Connect2 * (struct samr_Connect2 temp) { + if (!PyDict_Check($input)) { + PyErr_SetString(PyExc_TypeError, dict arg expected); + return NULL; + } + temp.in.system_name = get_string_property($input, system_name); + temp.in.access_mask = get_uint32_property($input, access_mask); + $1 = temp; +} + +%rename(samr_Connect2) dcerpc_samr_Connect2; +NTSTATUS dcerpc_samr_Connect2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct samr_Connect2 *r);