Where to submit patches?
David Lee
T.D.Lee at durham.ac.uk
Wed Aug 25 09:56:10 GMT 1999
On Wed, 25 Aug 1999, Jeremy Allison wrote:
> David Lee wrote:
> >
> > 2. Allow a non-zero return-code from preexec (and from root preexec)
> > to abort the connection (controllable by another parameter).
>
> I think I already added this - but I'd like to see the patch.
We had discussed it briefly: you confirmed the desirability.
Patch attached...
--
: David Lee I.T. Service :
: Systems Programmer Computer Centre :
: University of Durham :
: Phone: +44 191 374 2882 (ddi) South Road :
: Fax: +44 191 374 7759 Durham :
: Internet: T.D.Lee at durham.ac.uk U.K. :
-------------- next part --------------
*** docs/yodldocs/smb.conf.5.yo.orig Mon May 24 12:15:38 1999
--- docs/yodldocs/smb.conf.5.yo Mon Aug 9 17:25:48 1999
***************
*** 913,918 ****
--- 913,920 ----
it() link(bf(preexec))(preexec)
+ it() link(bf(preexec close))(preexecclose)
+
it() link(bf(preserve case))(preservecase)
it() link(bf(print command))(printcommand)
***************
*** 947,952 ****
--- 949,956 ----
it() link(bf(root preexec))(rootpreexec)
+ it() link(bf(root preexec close))(rootpreexecclose)
+
it() link(bf(set directory))(setdirectory)
it() link(bf(share modes))(sharemodes)
***************
*** 4291,4297 ****
Of course, this could get annoying after a while :-)
! See also link(bf(postexec))(postexec).
bf(Default:)
tt( none (no command executed))
--- 4295,4301 ----
Of course, this could get annoying after a while :-)
! See also link(bf(preexec close))(preexecclose) and link(bf(postexec))(postexec).
bf(Default:)
tt( none (no command executed))
***************
*** 4299,4304 ****
--- 4303,4320 ----
bf(Example:)
tt( preexec = echo \"%u connected to %S from %m (%I)\" >> /tmp/log)
+ label(preexecclose)
+ dit(bf(preexec close (S)))
+
+ This boolean option controls whether a non-zero return code from
+ link(bf("preexec"))(preexec) should close the service being connected to.
+
+ bf(Default:)
+ tt( preexec close = no)
+
+ bf(Example:)
+ tt( preexec close = yes)
+
label(preferredmaster)
dit(bf(preferred master (G)))
***************
*** 4958,4965 ****
that the command is run as root. This is useful for mounting
filesystems (such as cdroms) before a connection is finalized.
! See also link(bf("preexec"))(preexec).
label(security)
dit(bf(security (G)))
--- 4974,4990 ----
that the command is run as root. This is useful for mounting
filesystems (such as cdroms) before a connection is finalized.
! See also link(bf("preexec"))(preexec)
! and link(bf("root preexec close"))(rootpreexecclose).
+ label(rootpreexecclose)
+ dit(bf(root preexec close (S)))
+
+ This is the same as the link(bf("preexec close"))(preexecclose) parameter
+ except that the command is run as root.
+
+ See also link(bf("preexec"))(preexec), link(bf("preexec close"))(preexecclose).
+
label(security)
dit(bf(security (G)))
*** source/include/proto.h.orig Sat May 15 07:20:23 1999
--- source/include/proto.h Mon Aug 9 12:56:20 1999
***************
*** 1080,1087 ****
--- 1080,1089 ----
int lp_oplock_break_wait_time(void);
int lp_ldap_port(void);
char *lp_preexec(int );
+ BOOL lp_preexec_close(int );
char *lp_postexec(int );
char *lp_rootpreexec(int );
+ BOOL lp_rootpreexec_close(int );
char *lp_rootpostexec(int );
char *lp_servicename(int );
char *lp_pathname(int );
*** source/param/loadparm.c.orig Tue May 18 00:37:24 1999
--- source/param/loadparm.c Mon Aug 9 14:48:36 1999
***************
*** 301,306 ****
--- 301,308 ----
int iPrinting;
int iOplockContentionLimit;
BOOL bAlternatePerm;
+ BOOL bPreexecClose;
+ BOOL bRootpreexecClose;
BOOL bRevalidate;
BOOL bCaseSensitive;
BOOL bCasePreserve;
***************
*** 396,401 ****
--- 399,406 ----
DEFAULT_PRINTING, /* iPrinting */
2, /* iOplockContentionLimit */
False, /* bAlternatePerm */
+ False, /* bPreexecClose */
+ False, /* bRootpreexecClose */
False, /* revalidate */
False, /* case sensitive */
True, /* case preserve */
***************
*** 786,793 ****
--- 793,802 ----
{"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, FLAG_HIDE},
{"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT},
{"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 0},
+ {"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, 0},
{"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT},
{"root preexec", P_STRING, P_LOCAL, &sDefault.szRootPreExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT},
+ {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose,NULL, NULL, 0},
{"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE|FLAG_PRINT},
{"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC|FLAG_SHARE|FLAG_PRINT},
{"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE},
***************
*** 1299,1304 ****
--- 1308,1315 ----
FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles)
FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation)
+ FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose)
+ FN_LOCAL_BOOL(lp_rootpreexec_close,bRootpreexecClose)
FN_LOCAL_BOOL(lp_revalidate,bRevalidate)
FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive)
FN_LOCAL_BOOL(lp_preservecase,bCasePreserve)
*** source/smbd/service.c.orig Mon May 3 18:33:10 1999
--- source/smbd/service.c Mon Aug 9 15:13:45 1999
***************
*** 192,197 ****
--- 192,198 ----
BOOL force = False;
extern int Client;
connection_struct *conn;
+ int ret;
strlower(service);
***************
*** 418,424 ****
pstrcpy(cmd,lp_rootpreexec(SNUM(conn)));
standard_sub(conn,cmd);
DEBUG(5,("cmd=%s\n",cmd));
! smbrun(cmd,NULL,False);
}
if (!become_user(conn, conn->vuid)) {
--- 419,430 ----
pstrcpy(cmd,lp_rootpreexec(SNUM(conn)));
standard_sub(conn,cmd);
DEBUG(5,("cmd=%s\n",cmd));
! ret = smbrun(cmd,NULL,False);
! if (ret != 0 && lp_rootpreexec_close(SNUM(conn))) {
! conn_free(conn);
! *ecode = ERRsrverror;
! return NULL;
! }
}
if (!become_user(conn, conn->vuid)) {
***************
*** 472,478 ****
pstring cmd;
pstrcpy(cmd,lp_preexec(SNUM(conn)));
standard_sub(conn,cmd);
! smbrun(cmd,NULL,False);
}
/* we've finished with the sensitive stuff */
--- 478,489 ----
pstring cmd;
pstrcpy(cmd,lp_preexec(SNUM(conn)));
standard_sub(conn,cmd);
! ret = smbrun(cmd,NULL,False);
! if (ret != 0 && lp_preexec_close(SNUM(conn))) {
! conn_free(conn);
! *ecode = ERRsrverror;
! return NULL;
! }
}
/* we've finished with the sensitive stuff */
More information about the samba-technical
mailing list