strcpy(rname,cur_dir);
strcat(rname,"\\");
- sprintf(tmpname,"/tmp/smbmore.%d",getpid());
+ sprintf(tmpname,"%s/smbmore.%d",tmpdir(),getpid());
strcpy(lname,tmpname);
if (!next_token(NULL,rname+strlen(rname),NULL)) {
pstring tmpname;
FILE *f;
- sprintf(tmpname,"/tmp/ls.smb.%d",(int)getpid());
+ sprintf(tmpname,"%s/ls.smb.%d",tmpdir(),(int)getpid());
if (recurse)
sprintf(cmd,"find . -name \"%s\" -print > %s",p,tmpname);
else
#define LIST_SEP " \t,;:\n\r"
#ifndef LOCKDIR
+/* this should have been set in the Makefile */
#define LOCKDIR "/tmp/samba"
#endif
/*The following definitions come from smbrun.c */
+/*The following definitions come from smbwizard.c */
+
+
/*The following definitions come from status.c */
void Ucrit_addUsername(pstring username);
void setup_logging(char *pname,BOOL interactive);
void reopen_logs(void);
+char *tmpdir(void);
BOOL is_a_socket(int fd);
BOOL next_token(char **ptr,char *buff,char *sep);
char **toktocliplist(int *ctok, char *sep);
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef LINUX
-#define __KERNEL__
-#endif
-
#include "includes.h"
extern int DEBUGLEVEL;
*/
int case_default = CASE_LOWER;
-pstring debugf = "/tmp/log.samba";
+pstring debugf = "";
int syslog_level;
/* the following control case operations - they are put here so the
return(0);
}
+/****************************************************************************
+ find a suitable temporary directory. The result should be copied immediately
+ as it may be overwritten by a subsequent call
+ ****************************************************************************/
+char *tmpdir(void)
+{
+ char *p;
+ if ((p = getenv("TMPDIR"))) {
+ return p;
+ }
+ return "/tmp";
+}
+
+
+
/****************************************************************************
determine if a file descriptor is in fact a socket
****************************************************************************/
des_cblock deskey;
str_to_key(k,(uchar *)deskey);
- des_set_key(deskey,ks);
- des_ecb_encrypt(d, out, ks, DES_DECRYPT);
+ des_set_key((des_cblock *)deskey,ks);
+ des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_DECRYPT);
}
void E1(uchar *k, uchar *d, uchar *out)
des_cblock deskey;
str_to_key(k,(uchar *)deskey);
- des_set_key(deskey,ks);
- des_ecb_encrypt(d, out, ks, DES_ENCRYPT);
+ des_set_key((des_cblock *)deskey,ks);
+ des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_ENCRYPT);
}
void E_P16(uchar *p14,uchar *p16)
if (*d == NULL) return NULL;
+ if (!n && (search & FIND_SELF)) {
+ if (!lp_wins_proxy())
+ DEBUG(3,("wins proxy not enabled - failing lookup\n"));
+ else
+ DEBUG(3,("FIND_SELF set - failing lookup\n"));
+ return NULL;
+ }
+
/* now try DNS lookup. */
if (!n)
{
return False;
}
+#if 0
/****************************************************************************
check that the response received is compatible with the response record
****************************************************************************/
}
return True;
}
+#endif
/****************************************************************************
sprintf(comment,"IPC Service (%s)",lp_serverstring());
- string_set(&iSERVICE(i).szPath,"/tmp");
+ string_set(&iSERVICE(i).szPath,tmpdir());
string_set(&iSERVICE(i).szUsername,"");
string_set(&iSERVICE(i).comment,comment);
iSERVICE(i).status = False;
if (iSERVICE(iService).szPath[0] == '\0' &&
strwicmp(iSERVICE(iService).szService,HOMES_NAME) != 0)
{
- DEBUG(0,("No path in service %s - using /tmp\n",iSERVICE(iService).szService));
- string_set(&iSERVICE(iService).szPath,"/tmp");
+ DEBUG(0,("No path in service %s - using %s\n",iSERVICE(iService).szService,tmpdir()));
+ string_set(&iSERVICE(iService).szPath,tmpdir());
}
/* If a service is flagged unavailable, log the fact at level 0. */
standard_sub(cnum,syscmd);
- sprintf(outfile,"/tmp/lpq.%08x",str_checksum(syscmd));
+ sprintf(outfile,"%s/lpq.%08x",tmpdir(),str_checksum(syscmd));
if (!lpq_cache_reset[snum] && cachetime && !stat(outfile,&sbuf))
{
}
/* put it in a temporary file */
- sprintf(s,"/tmp/msg.XXXXXX");
+ sprintf(s,"%s/msg.XXXXXX",tmpdir());
strcpy(name,(char *)mktemp(s));
fd = open(name,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,0600);
pstring syscmd;
pstring outfile;
- sprintf(outfile,"/tmp/dfree.smb.%d",(int)getpid());
+ sprintf(outfile,"%s/dfree.smb.%d",tmpdir(),(int)getpid());
sprintf(syscmd,"%s %s",df_command,path);
standard_sub_basic(syscmd);