#endif
#include "includes.h"
+
+#include <asm/types.h>
#include <linux/smb_fs.h>
static struct smb_conn_opt conn_options;
BOOL translation = False;
-extern int cnum;
-extern int mid;
-extern int pid;
-extern int tid;
-extern int gid;
-extern int uid;
+extern uint16 cnum;
+extern uint16 mid;
+extern uint16 pid;
+extern uint16 vuid;
extern BOOL have_ip;
extern int max_xmit;
/* clitar bits end */
-int myumask = 0755;
+mode_t myumask = 0755;
extern pstring scope;
conn_options.protocol = opt.protocol;
conn_options.case_handling = CASE_LOWER;
conn_options.max_xmit = opt.max_xmit;
- conn_options.server_uid = opt.server_uid;
+ conn_options.server_uid = opt.server_vuid;
conn_options.tid = opt.tid;
conn_options.secmode = opt.sec_mode;
conn_options.maxmux = opt.max_mux;
send_fs_socket(char *mount_point, char *inbuf, char *outbuf)
{
int fd, closed = 0, res = 1;
+ int first_time = 1;
while (1)
{
}
#endif
+ if( first_time ) {
+ /*
+ * Create the background process after trying the mount.
+ * to avoid race conditions with automount and other processes.
+ */
+ first_time = 0;
+ daemonize();
+ }
+
/*
* Wait for a signal from smbfs ...
*/
DEBUG(3, ("mount command: %s\n", mount_command));
- /*
- * Create the background process before trying the mount.
- * (We delay closing files to allow diagnostic messages.)
- */
- daemonize();
-
- /* The parent has exited here, the child handles the connection: */
if ((retval = system(mount_command)) != 0)
{
DEBUG(0,("mount failed\n"));
exit(1);
}
+
send_fs_socket(mount_point, inbuf, outbuf);
}
TimeInit();
charset_initialise();
- pid = getpid();
- uid = getuid();
- gid = getgid();
+ pid = (uint16)getpid();
+ vuid = (uint16)getuid();
mid = pid + 100;
myumask = umask(0);
umask(myumask);