1Index: smbd/service.c
2===================================================================
3--- smbd/service.c	(revision 38154)
4+++ smbd/service.c	(working copy)
5@@ -264,6 +264,11 @@
6   Make a connection, given the snum to connect to, and the vuser of the
7   connecting user if appropriate.
8 ****************************************************************************/
9+#ifdef MAX_USB_ACCESS
10+extern CON_STATISTIC *con_st;
11+extern int binary_semaphore_post (int semid);
12+extern int binary_semaphore_wait (int semid);
13+#endif
14 
15 static connection_struct *make_connection_snum(int snum, user_struct *vuser,
16 					       DATA_BLOB password, 
17@@ -291,6 +296,25 @@
18 		return NULL;
19 	}
20 
21+#ifdef MAX_USB_ACCESS
22+        if( con_st != NULL ) {
23+           //if(con_st->num >= MAX_CON_NUM) {                      
24+           if(con_st->num >= 3) {
25+                 dbgtext("cs.total con num: %d, %s\n", con_st->num, __FUNCTION__);
26+                 conn_free(conn);
27+                 *status = NT_STATUS_INSUFFICIENT_RESOURCES;
28+                 return NULL;
29+            }
30+
31+            binary_semaphore_wait (con_st->sem_id); /*locked*/
32+            ++(con_st->num);
33+            binary_semaphore_post (con_st->sem_id);
34+
35+#ifdef DEBUG
36+             dbgtext("->total con num: %d, %s\n", con_st->num, __FUNCTION__);
37+#endif
38+        }
39+#endif
40 	if (lp_guest_only(snum)) {
41 		const char *guestname = lp_guestaccount();
42 		guest = True;
43@@ -541,7 +565,7 @@
44 		string_set(&conn->connectpath,s);
45 	}
46 
47-/* ROOT Activities: */	
48+        /* ROOT Activities: */	
49 	/* check number of connections */
50 	if (!claim_connection(conn,
51 			      lp_servicename(SNUM(conn)),
52@@ -857,4 +881,19 @@
53 	}
54 
55 	conn_free(conn);
56+
57+#ifdef MAX_USB_ACCESS
58+    /* Foxconn, added by MJ., 2010.03.26 */
59+    if(con_st != NULL)
60+    {
61+        binary_semaphore_wait (con_st->sem_id);
62+        --(con_st->num);
63+        binary_semaphore_post (con_st->sem_id);
64+    #ifdef DEBUG
65+        dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
66+    #endif
67+    }
68+    /* Foxconn, ended by MJ., 2010.03.26*/
69+#endif
70+
71 }
72Index: smbd/conn.c
73===================================================================
74--- smbd/conn.c	(revision 38154)
75+++ smbd/conn.c	(working copy)
76@@ -199,7 +199,7 @@
77 
78 
79     /* Foxconn, added by MJ., 2010.03.26 */
80-#ifdef MAX_USB_ACCESS
81+#ifdef MAX_USB_ACCESS_OLD
82     /* ========== Enter Crtical Section =========== */
83     extern CON_STATISTIC *con_st;
84     if(con_st != NULL){
85@@ -218,7 +218,7 @@
86 	if ((mem_ctx=talloc_init("connection_struct"))==NULL) {
87 		DEBUG(0,("talloc_init(connection_struct) failed!\n"));
88         /* Foxconn, added by MJ., unlock */
89-#ifdef MAX_USB_ACCESS
90+#ifdef MAX_USB_ACCESS_OLD
91         if(con_st != NULL) binary_semaphore_post (con_st->sem_id);
92 #endif
93 		return NULL;
94@@ -227,7 +227,7 @@
95 	if ((conn=TALLOC_ZERO_P(mem_ctx, connection_struct))==NULL) {
96 		DEBUG(0,("talloc_zero() failed!\n"));
97         /* Foxconn, added by MJ., unlock*/
98-#ifdef MAX_USB_ACCESS
99+#ifdef MAX_USB_ACCESS_OLD
100         if(con_st != NULL) binary_semaphore_post (con_st->sem_id);
101 #endif
102 		return NULL;
103@@ -247,7 +247,7 @@
104 	DLIST_ADD(Connections, conn);
105 
106     /* Foxconn, added by MJ., 2010.03.26 */
107-#ifdef MAX_USB_ACCESS
108+#ifdef MAX_USB_ACCESS_OLD
109     if(con_st != NULL)
110     {
111         ++(con_st->num);
112@@ -341,7 +341,7 @@
113 {
114  	vfs_handle_struct *handle = NULL, *thandle = NULL;
115  	TALLOC_CTX *mem_ctx = NULL;
116-#ifdef MAX_USB_ACCESS
117+#ifdef MAX_USB_ACCESS_OLD
118     /* Foxconn, added by MJ., 2010.03.26 */
119     extern CON_STATISTIC *con_st;
120     /* Foxconn, ended by MJ., 2010.03.26 */
121@@ -382,7 +382,7 @@
122 	mem_ctx = conn->mem_ctx;
123 	ZERO_STRUCTP(conn);
124 	talloc_destroy(mem_ctx);
125-#ifdef MAX_USB_ACCESS
126+#ifdef MAX_USB_ACCESS_OLD
127     /* Foxconn, added by MJ., 2010.03.26 */
128     if(con_st != NULL)
129     {
130Index: smbd/vfs-wrap.c
131===================================================================
132--- smbd/vfs-wrap.c	(revision 38154)
133+++ smbd/vfs-wrap.c	(working copy)
134@@ -30,13 +30,45 @@
135    is sure to try and execute them.  These stubs are used to prevent
136    this possibility. */
137 
138+#ifdef MAX_USB_ACCESS
139+extern CON_STATISTIC *con_st;
140+extern int binary_semaphore_post (int semid);
141+extern int binary_semaphore_wait (int semid);
142+#endif
143+
144 int vfswrap_dummy_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char *user)
145 {
146+#ifdef MAX_USB_ACCESS_OLD
147+    /* Foxconn, added by MJ., 2010.03.26 */
148+    if(con_st != NULL)
149+    {
150+        binary_semaphore_wait (con_st->sem_id);
151+        ++(con_st->num);
152+        binary_semaphore_post (con_st->sem_id);
153+    #ifdef DEBUG
154+        dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
155+    #endif
156+    }
157+    /* Foxconn, ended by MJ., 2010.03.26*/
158+#endif
159     return 0;    /* Return >= 0 for success */
160 }
161 
162 void vfswrap_dummy_disconnect(vfs_handle_struct *handle, connection_struct *conn)
163 {
164+#ifdef MAX_USB_ACCESS_OLD
165+    /* Foxconn, added by MJ., 2010.03.26 */
166+    if(con_st != NULL)
167+    {
168+        binary_semaphore_wait (con_st->sem_id);
169+        --(con_st->num);
170+        binary_semaphore_post (con_st->sem_id);
171+    #ifdef DEBUG
172+        dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
173+    #endif
174+    }
175+    /* Foxconn, ended by MJ., 2010.03.26*/
176+#endif
177 }
178 
179 /* Disk operations */
180@@ -189,6 +221,9 @@
181 	START_PROFILE(syscall_open);
182 	result = sys_open(fname, flags, mode);
183 	END_PROFILE(syscall_open);
184+
185+	//dbgtext("total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
186+
187 	return result;
188 }
189 
190@@ -200,6 +235,9 @@
191 
192 	result = close(fd);
193 	END_PROFILE(syscall_close);
194+	
195+        //dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
196+
197 	return result;
198 }
199 
200Index: smbd/dir.c
201===================================================================
202--- smbd/dir.c	(revision 38154)
203+++ smbd/dir.c	(working copy)
204@@ -945,8 +945,8 @@
205 		}
206 		/* Honour _hide unreadable_ option */
207 		if (hide_unreadable && !user_can_read_file(conn, entry, pst)) {
208-			SAFE_FREE(entry);
209-			return False;
210+  		        SAFE_FREE(entry);
211+		        return False;
212 		}
213 		/* Honour _hide unwriteable_ option */
214 		if (hide_unwriteable && !user_can_write_file(conn, entry, pst)) {
215Index: rpc_server/srv_srvsvc_nt.c
216===================================================================
217--- rpc_server/srv_srvsvc_nt.c	(revision 38154)
218+++ rpc_server/srv_srvsvc_nt.c	(working copy)
219@@ -506,10 +506,12 @@
220 	ctr->info_level = ctr->switch_value = info_level;
221 	*resume_hnd = 0;
222 
223-	/* Count the number of entries. */
224+	/* Count the number of entries. */	
225 	for (snum = 0; snum < num_services; snum++) {
226-		if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) )
227-			num_entries++;
228+	        /* foxconn, CSW @ chec whether the pr iv */	 
229+		if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
230+		      && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) )
231+		     num_entries++;
232 	}
233 
234 	*total_entries = num_entries;
235@@ -530,8 +532,9 @@
236 		}
237 
238 		for (snum = *resume_hnd; snum < num_services; snum++) {
239-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
240-				init_srv_share_info_0(p, &info0[i++], snum);
241+			if ( (lp_browseable(snum) ||  p->conn->admin_user )  
242+			     && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
243+	  	             init_srv_share_info_0(p, &info0[i++], snum);
244 			}
245 		}
246 
247@@ -550,7 +553,8 @@
248 		}
249 
250 		for (snum = *resume_hnd; snum < num_services; snum++) {
251-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
252+			if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
253+			      && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
254 				init_srv_share_info_1(p, &info1[i++], snum);
255 			}
256 		}
257@@ -569,8 +573,9 @@
258 		}
259 
260 		for (snum = *resume_hnd; snum < num_services; snum++) {
261-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
262-				init_srv_share_info_2(p, &info2[i++], snum);
263+			if ( (lp_browseable(snum) ||  p->conn->admin_user )  
264+			     && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
265+			     init_srv_share_info_2(p, &info2[i++], snum);
266 			}
267 		}
268 
269@@ -588,7 +593,8 @@
270 		}
271 
272 		for (snum = *resume_hnd; snum < num_services; snum++) {
273-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
274+			if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
275+			    && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
276 				init_srv_share_info_501(p, &info501[i++], snum);
277 			}
278 		}
279@@ -607,7 +613,8 @@
280 		}
281 
282 		for (snum = *resume_hnd; snum < num_services; snum++) {
283-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
284+			if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
285+			     && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
286 				init_srv_share_info_502(p, &info502[i++], snum);
287 			}
288 		}
289Index: log
290===================================================================
291--- log	(revision 38154)
292+++ log	(working copy)
293@@ -1,558 +1,288 @@
294-Using FLAGS =  -g -O2 -I./popt -Iinclude -I/home/zzz/tmp/samba/samba-3.0.13/source/include -I/home/zzz/tmp/samba/samba-3.0.13/source/ubiqx -I/home/zzz/tmp/samba/samba-3.0.13/source/smbwrapper  -I. -I/opt/brcm/hndtools-mipsel-linux-3.2.3/mipsel-linux/include -I/opt/brcm/hndtools-mipsel-linux-3.2.3/include -I/home/zzz/tmp/samba/samba-3.0.13/source    
295-      LIBS = -lcrypt -lresolv -lnsl -ldl
296-      LDSHFLAGS = -shared -Wl,-Bsymbolic -Wl,--allow-shlib-undefined  -L/opt/brcm/hndtools-mipsel-linux-3.2.3/lib -L/opt/brcm/hndtools-mipsel-linux-3.2.3/mipsel-linux/lib
297-      LDFLAGS = -L/opt/brcm/hndtools-mipsel-linux-3.2.3/lib -L/opt/brcm/hndtools-mipsel-linux-3.2.3/mipsel-linux/lib
298-Generating smbd/build_options.c
299-Building include/proto.h
300-creating /home/zzz/tmp/samba/samba-3.0.13/source/include/proto.h
301-Building include/wrepld_proto.h
302-creating /home/zzz/tmp/samba/samba-3.0.13/source/include/wrepld_proto.h
303-Building include/build_env.h
304-creating /home/zzz/tmp/samba/samba-3.0.13/source/nsswitch/winbindd_proto.h
305-creating /home/zzz/tmp/samba/samba-3.0.13/source/web/swat_proto.h
306-creating /home/zzz/tmp/samba/samba-3.0.13/source/client/client_proto.h
307-creating /home/zzz/tmp/samba/samba-3.0.13/source/utils/net_proto.h
308-Compiling dynconfig.c
309-Compiling param/loadparm.c
310-Compiling param/params.c
311-Compiling smbd/files.c
312-Compiling smbd/chgpasswd.c
313-Compiling smbd/connection.c
314-Compiling smbd/utmp.c
315-Compiling smbd/session.c
316-Compiling smbd/dfree.c
317-Compiling smbd/dir.c
318-Compiling smbd/password.c
319-Compiling smbd/conn.c
320-Compiling smbd/fileio.c
321-Compiling smbd/ipc.c
322-Compiling smbd/lanman.c
323-Compiling smbd/negprot.c
324-Compiling smbd/message.c
325-Compiling smbd/nttrans.c
326-Compiling smbd/pipes.c
327-Compiling smbd/reply.c
328-Compiling smbd/sesssetup.c
329-Compiling smbd/trans2.c
330-Compiling smbd/uid.c
331-Compiling smbd/dosmode.c
332-Compiling smbd/filename.c
333-Compiling smbd/open.c
334-Compiling smbd/close.c
335-Compiling smbd/blocking.c
336-Compiling smbd/sec_ctx.c
337-Compiling smbd/srvstr.c
338-Compiling smbd/vfs.c
339-Compiling smbd/vfs-wrap.c
340-Compiling smbd/statcache.c
341-Compiling smbd/posix_acls.c
342-Compiling lib/sysacls.c
343-Compiling lib/server_mutex.c
344-Compiling smbd/process.c
345-Compiling smbd/service.c
346-Compiling smbd/error.c
347-Compiling printing/printfsp.c
348-Compiling lib/sysquotas.c
349-Compiling lib/sysquotas_linux.c
350-Compiling lib/sysquotas_xfs.c
351-Compiling lib/sysquotas_4A.c
352-Compiling smbd/change_trust_pw.c
353-Compiling smbd/fake_file.c
354-Compiling smbd/quotas.c
355-Compiling smbd/ntquotas.c
356-Compiling lib/afs.c
357-Compiling smbd/msdfs.c
358-Compiling lib/afs_settoken.c
359-Compiling smbd/mangle.c
360-Compiling smbd/mangle_hash.c
361-Compiling smbd/mangle_map.c
362-Compiling smbd/mangle_hash2.c
363-smbd/mangle_hash2.c: In function `cache_insert':
364-smbd/mangle_hash2.c:184: warning: assignment makes pointer from integer without a cast
365-Compiling libsmb/clientgen.c
366-Compiling libsmb/cliconnect.c
367-Compiling libsmb/clifile.c
368-libsmb/clifile.c: In function `cli_unix_stat':
369-libsmb/clifile.c:263: warning: left shift count >= width of type
370-libsmb/clifile.c:264: warning: left shift count >= width of type
371-libsmb/clifile.c:279: warning: left shift count >= width of type
372-Compiling libsmb/clikrb5.c
373-Compiling libsmb/clispnego.c
374-Compiling libsmb/asn1.c
375-Compiling libsmb/clirap.c
376-Compiling libsmb/clierror.c
377-Compiling libsmb/climessage.c
378-Compiling libsmb/clireadwrite.c
379-libsmb/clireadwrite.c: In function `cli_issue_read':
380-libsmb/clireadwrite.c:37: warning: right shift count >= width of type
381-libsmb/clireadwrite.c:55: warning: right shift count >= width of type
382-libsmb/clireadwrite.c:55: warning: right shift count >= width of type
383-libsmb/clireadwrite.c:55: warning: right shift count >= width of type
384-libsmb/clireadwrite.c:55: warning: right shift count >= width of type
385-libsmb/clireadwrite.c: In function `cli_issue_write':
386-libsmb/clireadwrite.c:275: warning: right shift count >= width of type
387-libsmb/clireadwrite.c:308: warning: right shift count >= width of type
388-libsmb/clireadwrite.c:308: warning: right shift count >= width of type
389-libsmb/clireadwrite.c:308: warning: right shift count >= width of type
390-libsmb/clireadwrite.c:308: warning: right shift count >= width of type
391-Compiling libsmb/clilist.c
392-libsmb/clilist.c: In function `interpret_long_filename':
393-libsmb/clilist.c:111: warning: left shift count >= width of type
394-Compiling libsmb/cliprint.c
395-Compiling libsmb/clitrans.c
396-Compiling libsmb/clisecdesc.c
397-Compiling libsmb/clidgram.c
398-Compiling libsmb/clistr.c
399-Compiling lib/util_seaccess.c
400-Compiling libsmb/cliquota.c
401-Compiling libsmb/clifsinfo.c
402-Compiling libsmb/clidfs.c
403-Compiling libsmb/smberr.c
404-Compiling libsmb/credentials.c
405-Compiling libsmb/pwd_cache.c
406-Compiling libsmb/clioplock.c
407-Compiling libsmb/errormap.c
408-Compiling libsmb/clirap2.c
409-Compiling libsmb/doserr.c
410-Compiling rpc_parse/parse_prs.c
411-Compiling rpc_parse/parse_misc.c
412-Compiling rpc_parse/parse_sec.c
413-Compiling libsmb/nterr.c
414-Compiling libsmb/smbdes.c
415-Compiling libsmb/smbencrypt.c
416-Compiling libsmb/ntlm_check.c
417-Compiling libsmb/ntlmssp.c
418-Compiling libsmb/ntlmssp_parse.c
419-Compiling libsmb/ntlmssp_sign.c
420-Compiling libsmb/unexpected.c
421-Compiling libsmb/namecache.c
422-Compiling libsmb/nmblib.c
423-Compiling libsmb/namequery.c
424-Compiling libsmb/conncache.c
425-Compiling rpc_server/srv_lsa.c
426-Compiling rpc_server/srv_lsa_nt.c
427-Compiling rpc_server/srv_reg.c
428-Compiling rpc_server/srv_reg_nt.c
429-Compiling rpc_server/srv_lsa_ds.c
430-Compiling rpc_server/srv_lsa_ds_nt.c
431-Compiling rpc_server/srv_wkssvc.c
432-Compiling rpc_server/srv_wkssvc_nt.c
433-Compiling rpc_server/srv_netlog.c
434-Compiling rpc_server/srv_netlog_nt.c
435-Compiling rpc_server/srv_dfs.c
436-Compiling rpc_server/srv_dfs_nt.c
437-Compiling rpc_server/srv_srvsvc.c
438-Compiling rpc_server/srv_srvsvc_nt.c
439-Compiling rpc_server/srv_spoolss.c
440-Compiling rpc_server/srv_spoolss_nt.c
441-Compiling rpc_server/srv_samr.c
442-Compiling rpc_server/srv_samr_nt.c
443-Compiling rpc_server/srv_samr_util.c
444-Compiling rpc_server/srv_pipe_hnd.c
445-Compiling rpc_server/srv_util.c
446-Compiling rpc_server/srv_pipe.c
447-Compiling rpc_server/srv_lsa_hnd.c
448-Compiling rpc_parse/parse_lsa.c
449-Compiling rpc_parse/parse_net.c
450-Compiling rpc_parse/parse_reg.c
451-Compiling rpc_parse/parse_rpc.c
452-Compiling rpc_parse/parse_samr.c
453-Compiling rpc_parse/parse_srv.c
454-Compiling rpc_parse/parse_wks.c
455-Compiling rpc_parse/parse_ds.c
456-Compiling rpc_parse/parse_spoolss.c
457-Compiling rpc_parse/parse_dfs.c
458-Compiling rpc_parse/parse_echo.c
459-Compiling rpc_parse/parse_shutdown.c
460-Compiling registry/reg_objects.c
461-Compiling passdb/secrets.c
462-passdb/secrets.c: In function `secrets_get_trusted_domains':
463-passdb/secrets.c:618: warning: assignment makes pointer from integer without a cast
464-Compiling passdb/machine_sid.c
465-Compiling locking/locking.c
466-Compiling locking/brlock.c
467-locking/brlock.c: In function `brl_lock_failed':
468-locking/brlock.c:212: warning: right shift count >= width of type
469-Compiling locking/posix.c
470-Compiling passdb/pdb_get_set.c
471-Compiling passdb/passdb.c
472-Compiling passdb/pdb_interface.c
473-Compiling passdb/util_sam_sid.c
474-Compiling passdb/pdb_compat.c
475-Compiling passdb/lookup_sid.c
476-Compiling passdb/login_cache.c
477-Compiling passdb/pdb_smbpasswd.c
478-Compiling passdb/pdb_tdb.c
479-Compiling passdb/pdb_guest.c
480-Compiling passdb/pdb_sql.c
481-Compiling lib/system_smbd.c
482-Compiling printing/pcap.c
483-Compiling printing/print_svid.c
484-Compiling printing/print_aix.c
485-Compiling printing/print_cups.c
486-Compiling printing/print_generic.c
487-Compiling printing/lpq_parse.c
488-Compiling printing/load.c
489-Compiling profile/profile.c
490-Compiling lib/version.c
491-Compiling lib/charcnv.c
492-Compiling lib/debug.c
493-Compiling lib/fault.c
494-Compiling lib/getsmbpass.c
495-Compiling lib/interface.c
496-Compiling lib/md4.c
497-Compiling lib/interfaces.c
498-Compiling lib/pidfile.c
499-Compiling lib/replace.c
500-Compiling lib/replace1.c
501-Compiling lib/signal.c
502-Compiling lib/system.c
503-Compiling lib/sendfile.c
504-Compiling lib/time.c
505-Compiling lib/ufc.c
506-Compiling lib/genrand.c
507-Compiling lib/username.c
508-Compiling lib/util_getent.c
509-Compiling lib/util_pw.c
510-Compiling lib/access.c
511-Compiling lib/smbrun.c
512-Compiling lib/bitmap.c
513-Compiling lib/crc32.c
514-Compiling lib/snprintf.c
515-Compiling lib/dprintf.c
516-Compiling lib/xfile.c
517-Compiling lib/wins_srv.c
518-Compiling lib/util_str.c
519-lib/util_str.c: In function `strstr_m':
520-lib/util_str.c:1337: warning: return discards qualifiers from pointer target type
521-Compiling lib/clobber.c
522-Compiling lib/util_sid.c
523-Compiling lib/util_uuid.c
524-Compiling lib/util_unistr.c
525-Compiling lib/util_file.c
526-Compiling lib/data_blob.c
527-Compiling lib/util.c
528-lib/util.c: In function `smb_xstrndup':
529-lib/util.c:2274: warning: initialization makes pointer from integer without a cast
530-Compiling lib/util_sock.c
531-Compiling lib/sock_exec.c
532-Compiling lib/util_sec.c
533-Compiling lib/talloc.c
534-Compiling lib/substitute.c
535-Compiling lib/fsusage.c
536-Compiling lib/ms_fnmatch.c
537-Compiling lib/select.c
538-Compiling lib/messages.c
539-Compiling lib/tallocmsg.c
540-Compiling lib/dmallocmsg.c
541-Compiling libsmb/smb_signing.c
542-Compiling lib/md5.c
543-Compiling lib/hmacmd5.c
544-Compiling lib/iconv.c
545-Compiling nsswitch/wb_client.c
546-Compiling nsswitch/wb_common.c
547-Compiling lib/pam_errors.c
548-Compiling intl/lang_tdb.c
549-Compiling lib/account_pol.c
550-Compiling lib/adt_tree.c
551-Compiling lib/gencache.c
552-lib/gencache.c: In function `gencache_get':
553-lib/gencache.c:251: warning: initialization makes pointer from integer without a cast
554-lib/gencache.c: In function `gencache_iterate':
555-lib/gencache.c:322: warning: assignment makes pointer from integer without a cast
556-lib/gencache.c:335: warning: assignment makes pointer from integer without a cast
557-Compiling tdb/tdb.c
558-Compiling tdb/spinlock.c
559-Compiling tdb/tdbutil.c
560-tdb/tdbutil.c: In function `make_tdb_data':
561-tdb/tdbutil.c:46: warning: assignment discards qualifiers from pointer target type
562-tdb/tdbutil.c: In function `tdb_chainlock_with_timeout_internal':
563-tdb/tdbutil.c:60: warning: passing arg 1 of `tdb_set_lock_alarm' discards qualifiers from pointer target type
564-Compiling tdb/tdbback.c
565-Compiling lib/module.c
566-Compiling lib/ldap_escape.c
567-Compiling lib/privileges.c
568-Compiling lib/secdesc.c
569-Compiling lib/secace.c
570-Compiling lib/secacl.c
571-Compiling printing/printing.c
572-printing/printing.c: In function `print_cache_expired':
573-printing/printing.c:1038: warning: passing arg 3 of `tdb_fetch_uint32' from incompatible pointer type
574-Compiling printing/nt_printing.c
575-Compiling printing/notify.c
576-Compiling printing/printing_db.c
577-Compiling smbd/oplock.c
578-Compiling smbd/oplock_irix.c
579-Compiling smbd/oplock_linux.c
580-Compiling smbd/notify.c
581-Compiling smbd/notify_hash.c
582-Compiling smbd/notify_kernel.c
583-Compiling groupdb/mapping.c
584-Compiling auth/auth.c
585-Compiling auth/auth_rhosts.c
586-Compiling auth/auth_sam.c
587-Compiling auth/auth_unix.c
588-Compiling auth/auth_winbind.c
589-Compiling auth/auth_server.c
590-Compiling auth/auth_domain.c
591-Compiling auth/auth_builtin.c
592-Compiling auth/auth_util.c
593-Compiling auth/auth_compat.c
594-Compiling auth/auth_ntlmssp.c
595-Compiling auth/pampass.c
596-Compiling auth/pass_check.c
597-Compiling libsmb/samlogon_cache.c
598-Compiling libsmb/namequery_dc.c
599-Compiling libsmb/trustdom_cache.c
600-Compiling libsmb/trusts_util.c
601-Compiling rpc_client/cli_lsarpc.c
602-Compiling rpc_client/cli_samr.c
603-Compiling rpc_client/cli_netlogon.c
604-Compiling rpc_client/cli_srvsvc.c
605-Compiling rpc_client/cli_wkssvc.c
606-Compiling rpc_client/cli_dfs.c
607-Compiling rpc_client/cli_reg.c
608-Compiling rpc_client/cli_pipe.c
609-Compiling rpc_client/cli_spoolss.c
610-Compiling rpc_client/cli_spoolss_notify.c
611-Compiling rpc_client/cli_ds.c
612-Compiling rpc_client/cli_echo.c
613-Compiling rpc_client/cli_shutdown.c
614-Compiling libads/ldap.c
615-Compiling libads/ldap_printer.c
616-Compiling libads/sasl.c
617-Compiling libads/krb5_setpw.c
618-Compiling libads/ldap_user.c
619-Compiling libads/ads_struct.c
620-Compiling libads/kerberos_keytab.c
621-Compiling libads/disp_sec.c
622-Compiling libads/ads_utils.c
623-Compiling libads/ldap_utils.c
624-Compiling libads/ads_ldap.c
625-Compiling libads/authdata.c
626-Compiling libads/kerberos.c
627-Compiling libads/ads_status.c
628-Compiling libads/util.c
629-Compiling libads/kerberos_verify.c
630-Compiling registry/reg_frontend.c
631-Compiling registry/reg_cachehook.c
632-Compiling registry/reg_printing.c
633-Compiling registry/reg_db.c
634-Compiling lib/popt_common.c
635-Compiling smbd/build_options.c
636-Compiling smbd/server.c
637-Compiling popt/findme.c
638-Compiling popt/popt.c
639-Compiling popt/poptconfig.c
640-Compiling popt/popthelp.c
641-Compiling popt/poptparse.c
642-Linking bin/smbd
643-lib/util.o: In function `smb_mkstemp':
644-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
645-Compiling nmbd/asyncdns.c
646-Compiling nmbd/nmbd.c
647-Compiling nmbd/nmbd_become_dmb.c
648-Compiling nmbd/nmbd_become_lmb.c
649-Compiling nmbd/nmbd_browserdb.c
650-Compiling nmbd/nmbd_browsesync.c
651-Compiling nmbd/nmbd_elections.c
652-Compiling nmbd/nmbd_incomingdgrams.c
653-Compiling nmbd/nmbd_incomingrequests.c
654-Compiling nmbd/nmbd_lmhosts.c
655-Compiling nmbd/nmbd_logonnames.c
656-Compiling nmbd/nmbd_mynames.c
657-Compiling nmbd/nmbd_namelistdb.c
658-Compiling nmbd/nmbd_namequery.c
659-Compiling nmbd/nmbd_nameregister.c
660-Compiling nmbd/nmbd_namerelease.c
661-Compiling nmbd/nmbd_nodestatus.c
662-Compiling nmbd/nmbd_packets.c
663-Compiling nmbd/nmbd_processlogon.c
664-Compiling nmbd/nmbd_responserecordsdb.c
665-Compiling nmbd/nmbd_sendannounce.c
666-Compiling nmbd/nmbd_serverlistdb.c
667-Compiling nmbd/nmbd_subnetdb.c
668-Compiling nmbd/nmbd_winsproxy.c
669-Compiling nmbd/nmbd_winsserver.c
670-Compiling nmbd/nmbd_workgroupdb.c
671-Compiling nmbd/nmbd_synclists.c
672-Compiling ubiqx/ubi_BinTree.c
673-Compiling ubiqx/ubi_Cache.c
674-Compiling ubiqx/ubi_SplayTree.c
675-Compiling ubiqx/ubi_dLinkList.c
676-Compiling ubiqx/ubi_sLinkList.c
677-Compiling lib/dummyroot.c
678-Compiling lib/dummysmbd.c
679-Linking bin/nmbd
680-lib/util.o: In function `smb_mkstemp':
681-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
682-Compiling web/cgi.c
683-Compiling web/diagnose.c
684-Compiling web/startstop.c
685-Compiling web/statuspage.c
686-Compiling web/swat.c
687-Compiling web/neg_lang.c
688-Compiling libsmb/passchange.c
689-Linking bin/swat
690-lib/util.o: In function `smb_mkstemp':
691-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
692-Compiling client/client.c
693-client/client.c: In function `do_get':
694-client/client.c:767: warning: passing arg 4 of `cli_getattrE' from incompatible pointer type
695-client/client.c: In function `do_put':
696-client/client.c:1158: warning: passing arg 4 of `cli_getattrE' from incompatible pointer type
697-Compiling client/clitar.c
698-Compiling lib/readline.c
699-Linking bin/smbclient
700-lib/util.o: In function `smb_mkstemp':
701-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
702-Compiling utils/net.c
703-Compiling utils/net_ads.c
704-Compiling utils/net_ads_cldap.c
705-Compiling utils/net_help.c
706-Compiling utils/net_rap.c
707-Compiling utils/net_rpc.c
708-utils/net_rpc.c: In function `rpc_trustdom_del_internals':
709-utils/net_rpc.c:4511: warning: passing arg 6 of `cli_samr_lookup_names' from incompatible pointer type
710-Compiling utils/net_rpc_samsync.c
711-Compiling utils/net_rpc_join.c
712-Compiling utils/net_time.c
713-Compiling utils/net_lookup.c
714-Compiling utils/net_cache.c
715-utils/net_cache.c: In function `parse_timeout':
716-utils/net_cache.c:104: warning: assignment makes pointer from integer without a cast
717-Compiling utils/net_groupmap.c
718-Compiling utils/net_idmap.c
719-Compiling utils/net_status.c
720-Compiling utils/net_rpc_printer.c
721-Compiling utils/net_rpc_rights.c
722-Compiling sam/idmap.c
723-Compiling sam/idmap_util.c
724-Compiling sam/idmap_tdb.c
725-Linking bin/net
726-lib/util.o: In function `smb_mkstemp':
727-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
728-Compiling client/smbspool.c
729-Linking bin/smbspool
730-lib/util.o: In function `smb_mkstemp':
731-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
732-Compiling utils/testparm.c
733-Linking bin/testparm
734-lib/util.o: In function `smb_mkstemp':
735-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
736-Compiling utils/testprns.c
737-Linking bin/testprns
738-lib/util.o: In function `smb_mkstemp':
739-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
740-Compiling utils/status.c
741-Linking bin/smbstatus
742-lib/util.o: In function `smb_mkstemp':
743-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
744-Compiling utils/smbcontrol.c
745-utils/smbcontrol.c: In function `do_printnotify':
746-utils/smbcontrol.c:431: warning: passing arg 3 of `notify_printer_byname' discards qualifiers from pointer target type
747-Linking bin/smbcontrol
748-lib/util.o: In function `smb_mkstemp':
749-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
750-Compiling utils/smbtree.c
751-Linking bin/smbtree
752-lib/util.o: In function `smb_mkstemp':
753-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
754-Compiling tdb/tdbbackup.c
755-Linking bin/tdbbackup
756-Compiling utils/nmblookup.c
757-Linking bin/nmblookup
758-lib/util.o: In function `smb_mkstemp':
759-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
760-Compiling utils/pdbedit.c
761-utils/pdbedit.c: In function `main':
762-utils/pdbedit.c:923: warning: assignment makes pointer from integer without a cast
763-utils/pdbedit.c:948: warning: assignment makes pointer from integer without a cast
764-Linking bin/pdbedit
765-lib/util.o: In function `smb_mkstemp':
766-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
767-Compiling tdb/tdbdump.c
768-Linking bin/tdbdump
769-Compiling tdb/tdbtool.c
770-Linking bin/tdbtool
771-Compiling utils/smbpasswd.c
772-Linking bin/smbpasswd
773-lib/util.o: In function `smb_mkstemp':
774-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
775-Compiling rpcclient/rpcclient.c
776-Compiling rpcclient/cmd_lsarpc.c
777-Compiling rpcclient/cmd_samr.c
778-Compiling rpcclient/cmd_spoolss.c
779-rpcclient/cmd_spoolss.c: In function `get_driver_3_param':
780-rpcclient/cmd_spoolss.c:1291: warning: passing arg 1 of `strtok' discards qualifiers from pointer target type
781-Compiling rpcclient/cmd_netlogon.c
782-Compiling rpcclient/cmd_srvsvc.c
783-Compiling rpcclient/cmd_dfs.c
784-Compiling rpcclient/cmd_reg.c
785-Compiling rpcclient/display_sec.c
786-Compiling rpcclient/cmd_ds.c
787-Compiling rpcclient/cmd_echo.c
788-Compiling rpcclient/cmd_shutdown.c
789-rpcclient/cmd_shutdown.c: In function `cmd_shutdown_init':
790-rpcclient/cmd_shutdown.c:43: warning: passing arg 2 of `getopt' from incompatible pointer type
791-Linking bin/rpcclient
792-lib/util.o: In function `smb_mkstemp':
793-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
794-Compiling utils/smbcacls.c
795-Linking bin/smbcacls
796-lib/util.o: In function `smb_mkstemp':
797-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
798-Compiling utils/profiles.c
799-Linking bin/profiles
800-Compiling utils/ntlm_auth.c
801-utils/ntlm_auth.c: In function `manage_squid_ntlmssp_request':
802-utils/ntlm_auth.c:555: warning: assignment makes pointer from integer without a cast
803-utils/ntlm_auth.c: In function `manage_client_ntlmssp_request':
804-utils/ntlm_auth.c:637: warning: assignment makes pointer from integer without a cast
805-utils/ntlm_auth.c: In function `manage_gss_spnego_client_request':
806-utils/ntlm_auth.c:1269: warning: assignment makes pointer from integer without a cast
807-Compiling utils/ntlm_auth_diagnostics.c
808-Compiling libsmb/spnego.c
809-libsmb/spnego.c: In function `read_negTokenInit':
810-libsmb/spnego.c:45: warning: assignment from incompatible pointer type
811-libsmb/spnego.c:49: warning: assignment from incompatible pointer type
812-libsmb/spnego.c:50: warning: passing arg 2 of `asn1_read_OID' from incompatible pointer type
813-libsmb/spnego.c: In function `read_negTokenTarg':
814-libsmb/spnego.c:185: warning: passing arg 2 of `asn1_read_OID' from incompatible pointer type
815-libsmb/spnego.c: In function `free_spnego_data':
816-libsmb/spnego.c:320: warning: passing arg 1 of `free' discards qualifiers from pointer target type
817-libsmb/spnego.c:329: warning: passing arg 1 of `free' discards qualifiers from pointer target type
818-Linking bin/ntlm_auth
819-lib/util.o: In function `smb_mkstemp':
820-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
821-Compiling utils/smbcquotas.c
822-Linking bin/smbcquotas
823-lib/util.o: In function `smb_mkstemp':
824-/home/zzz/tmp/samba/samba-3.0.13/source/lib/util.c:2203: the use of `mktemp' is dangerous, better use `mkstemp'
825-Compiling modules/vfs_recycle.c with -fPIC
826-Building plugin bin/recycle.so
827-Compiling modules/vfs_audit.c with -fPIC
828-Building plugin bin/audit.so
829-Compiling modules/vfs_extd_audit.c with -fPIC
830-Building plugin bin/extd_audit.so
831-Compiling modules/vfs_full_audit.c with -fPIC
832-Building plugin bin/full_audit.so
833-Compiling modules/vfs_netatalk.c with -fPIC
834-Building plugin bin/netatalk.so
835-Compiling modules/vfs_fake_perms.c with -fPIC
836-Building plugin bin/fake_perms.so
837-Compiling modules/vfs_default_quota.c with -fPIC
838-Building plugin bin/default_quota.so
839-Compiling modules/vfs_readonly.c with -fPIC
840-Compiling modules/getdate.c with -fPIC
841-Building plugin bin/readonly.so
842-Compiling modules/vfs_cap.c with -fPIC
843-Building plugin bin/cap.so
844-Compiling modules/vfs_expand_msdfs.c with -fPIC
845-Building plugin bin/expand_msdfs.so
846-Compiling modules/vfs_shadow_copy.c with -fPIC
847-Building plugin bin/shadow_copy.so
848-Compiling modules/CP850.c with -fPIC
849-Building plugin bin/CP850.so
850-Compiling modules/CP437.c with -fPIC
851-Building plugin bin/CP437.so
852+Index: smbd/service.c
853+===================================================================
854+--- smbd/service.c	(revision 38154)
855++++ smbd/service.c	(working copy)
856+@@ -264,6 +264,11 @@
857+   Make a connection, given the snum to connect to, and the vuser of the
858+   connecting user if appropriate.
859+ ****************************************************************************/
860++#ifdef MAX_USB_ACCESS
861++extern CON_STATISTIC *con_st;
862++extern int binary_semaphore_post (int semid);
863++extern int binary_semaphore_wait (int semid);
864++#endif
865+ 
866+ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
867+ 					       DATA_BLOB password, 
868+@@ -291,6 +296,25 @@
869+ 		return NULL;
870+ 	}
871+ 
872++#ifdef MAX_USB_ACCESS
873++        if( con_st != NULL ) {
874++           //if(con_st->num >= MAX_CON_NUM) {                      
875++           if(con_st->num >= 3) {
876++                 dbgtext("cs.total con num: %d, %s\n", con_st->num, __FUNCTION__);
877++                 conn_free(conn);
878++                 *status = NT_STATUS_INSUFFICIENT_RESOURCES;
879++                 return NULL;
880++            }
881++
882++            binary_semaphore_wait (con_st->sem_id); /*locked*/
883++            ++(con_st->num);
884++            binary_semaphore_post (con_st->sem_id);
885++
886++#ifdef DEBUG
887++             dbgtext("->total con num: %d, %s\n", con_st->num, __FUNCTION__);
888++#endif
889++        }
890++#endif
891+ 	if (lp_guest_only(snum)) {
892+ 		const char *guestname = lp_guestaccount();
893+ 		guest = True;
894+@@ -541,7 +565,7 @@
895+ 		string_set(&conn->connectpath,s);
896+ 	}
897+ 
898+-/* ROOT Activities: */	
899++        /* ROOT Activities: */	
900+ 	/* check number of connections */
901+ 	if (!claim_connection(conn,
902+ 			      lp_servicename(SNUM(conn)),
903+@@ -857,4 +881,19 @@
904+ 	}
905+ 
906+ 	conn_free(conn);
907++
908++#ifdef MAX_USB_ACCESS
909++    /* Foxconn, added by MJ., 2010.03.26 */
910++    if(con_st != NULL)
911++    {
912++        binary_semaphore_wait (con_st->sem_id);
913++        --(con_st->num);
914++        binary_semaphore_post (con_st->sem_id);
915++    #ifdef DEBUG
916++        dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
917++    #endif
918++    }
919++    /* Foxconn, ended by MJ., 2010.03.26*/
920++#endif
921++
922+ }
923+Index: smbd/conn.c
924+===================================================================
925+--- smbd/conn.c	(revision 38154)
926++++ smbd/conn.c	(working copy)
927+@@ -199,7 +199,7 @@
928+ 
929+ 
930+     /* Foxconn, added by MJ., 2010.03.26 */
931+-#ifdef MAX_USB_ACCESS
932++#ifdef MAX_USB_ACCESS_OLD
933+     /* ========== Enter Crtical Section =========== */
934+     extern CON_STATISTIC *con_st;
935+     if(con_st != NULL){
936+@@ -218,7 +218,7 @@
937+ 	if ((mem_ctx=talloc_init("connection_struct"))==NULL) {
938+ 		DEBUG(0,("talloc_init(connection_struct) failed!\n"));
939+         /* Foxconn, added by MJ., unlock */
940+-#ifdef MAX_USB_ACCESS
941++#ifdef MAX_USB_ACCESS_OLD
942+         if(con_st != NULL) binary_semaphore_post (con_st->sem_id);
943+ #endif
944+ 		return NULL;
945+@@ -227,7 +227,7 @@
946+ 	if ((conn=TALLOC_ZERO_P(mem_ctx, connection_struct))==NULL) {
947+ 		DEBUG(0,("talloc_zero() failed!\n"));
948+         /* Foxconn, added by MJ., unlock*/
949+-#ifdef MAX_USB_ACCESS
950++#ifdef MAX_USB_ACCESS_OLD
951+         if(con_st != NULL) binary_semaphore_post (con_st->sem_id);
952+ #endif
953+ 		return NULL;
954+@@ -247,7 +247,7 @@
955+ 	DLIST_ADD(Connections, conn);
956+ 
957+     /* Foxconn, added by MJ., 2010.03.26 */
958+-#ifdef MAX_USB_ACCESS
959++#ifdef MAX_USB_ACCESS_OLD
960+     if(con_st != NULL)
961+     {
962+         ++(con_st->num);
963+@@ -341,7 +341,7 @@
964+ {
965+  	vfs_handle_struct *handle = NULL, *thandle = NULL;
966+  	TALLOC_CTX *mem_ctx = NULL;
967+-#ifdef MAX_USB_ACCESS
968++#ifdef MAX_USB_ACCESS_OLD
969+     /* Foxconn, added by MJ., 2010.03.26 */
970+     extern CON_STATISTIC *con_st;
971+     /* Foxconn, ended by MJ., 2010.03.26 */
972+@@ -382,7 +382,7 @@
973+ 	mem_ctx = conn->mem_ctx;
974+ 	ZERO_STRUCTP(conn);
975+ 	talloc_destroy(mem_ctx);
976+-#ifdef MAX_USB_ACCESS
977++#ifdef MAX_USB_ACCESS_OLD
978+     /* Foxconn, added by MJ., 2010.03.26 */
979+     if(con_st != NULL)
980+     {
981+Index: smbd/vfs-wrap.c
982+===================================================================
983+--- smbd/vfs-wrap.c	(revision 38154)
984++++ smbd/vfs-wrap.c	(working copy)
985+@@ -30,13 +30,45 @@
986+    is sure to try and execute them.  These stubs are used to prevent
987+    this possibility. */
988+ 
989++#ifdef MAX_USB_ACCESS
990++extern CON_STATISTIC *con_st;
991++extern int binary_semaphore_post (int semid);
992++extern int binary_semaphore_wait (int semid);
993++#endif
994++
995+ int vfswrap_dummy_connect(vfs_handle_struct *handle, connection_struct *conn, const char *service, const char *user)
996+ {
997++#ifdef MAX_USB_ACCESS_OLD
998++    /* Foxconn, added by MJ., 2010.03.26 */
999++    if(con_st != NULL)
1000++    {
1001++        binary_semaphore_wait (con_st->sem_id);
1002++        ++(con_st->num);
1003++        binary_semaphore_post (con_st->sem_id);
1004++    #ifdef DEBUG
1005++        dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
1006++    #endif
1007++    }
1008++    /* Foxconn, ended by MJ., 2010.03.26*/
1009++#endif
1010+     return 0;    /* Return >= 0 for success */
1011+ }
1012+ 
1013+ void vfswrap_dummy_disconnect(vfs_handle_struct *handle, connection_struct *conn)
1014+ {
1015++#ifdef MAX_USB_ACCESS_OLD
1016++    /* Foxconn, added by MJ., 2010.03.26 */
1017++    if(con_st != NULL)
1018++    {
1019++        binary_semaphore_wait (con_st->sem_id);
1020++        --(con_st->num);
1021++        binary_semaphore_post (con_st->sem_id);
1022++    #ifdef DEBUG
1023++        dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
1024++    #endif
1025++    }
1026++    /* Foxconn, ended by MJ., 2010.03.26*/
1027++#endif
1028+ }
1029+ 
1030+ /* Disk operations */
1031+@@ -189,6 +221,9 @@
1032+ 	START_PROFILE(syscall_open);
1033+ 	result = sys_open(fname, flags, mode);
1034+ 	END_PROFILE(syscall_open);
1035++
1036++	//dbgtext("total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
1037++
1038+ 	return result;
1039+ }
1040+ 
1041+@@ -200,6 +235,9 @@
1042+ 
1043+ 	result = close(fd);
1044+ 	END_PROFILE(syscall_close);
1045++	
1046++        //dbgtext("->total con num: %d, %s, by smbd.\n", con_st->num, __FUNCTION__);
1047++
1048+ 	return result;
1049+ }
1050+ 
1051+Index: smbd/dir.c
1052+===================================================================
1053+--- smbd/dir.c	(revision 38154)
1054++++ smbd/dir.c	(working copy)
1055+@@ -945,8 +945,8 @@
1056+ 		}
1057+ 		/* Honour _hide unreadable_ option */
1058+ 		if (hide_unreadable && !user_can_read_file(conn, entry, pst)) {
1059+-			SAFE_FREE(entry);
1060+-			return False;
1061++  		        SAFE_FREE(entry);
1062++		        return False;
1063+ 		}
1064+ 		/* Honour _hide unwriteable_ option */
1065+ 		if (hide_unwriteable && !user_can_write_file(conn, entry, pst)) {
1066+Index: rpc_server/srv_srvsvc_nt.c
1067+===================================================================
1068+--- rpc_server/srv_srvsvc_nt.c	(revision 38154)
1069++++ rpc_server/srv_srvsvc_nt.c	(working copy)
1070+@@ -506,10 +506,12 @@
1071+ 	ctr->info_level = ctr->switch_value = info_level;
1072+ 	*resume_hnd = 0;
1073+ 
1074+-	/* Count the number of entries. */
1075++	/* Count the number of entries. */	
1076+ 	for (snum = 0; snum < num_services; snum++) {
1077+-		if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) )
1078+-			num_entries++;
1079++	        /* foxconn, CSW @ chec whether the pr iv */	 
1080++		if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
1081++		      && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) )
1082++		     num_entries++;
1083+ 	}
1084+ 
1085+ 	*total_entries = num_entries;
1086+@@ -530,8 +532,9 @@
1087+ 		}
1088+ 
1089+ 		for (snum = *resume_hnd; snum < num_services; snum++) {
1090+-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1091+-				init_srv_share_info_0(p, &info0[i++], snum);
1092++			if ( (lp_browseable(snum) ||  p->conn->admin_user )  
1093++			     && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1094++	  	             init_srv_share_info_0(p, &info0[i++], snum);
1095+ 			}
1096+ 		}
1097+ 
1098+@@ -550,7 +553,8 @@
1099+ 		}
1100+ 
1101+ 		for (snum = *resume_hnd; snum < num_services; snum++) {
1102+-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1103++			if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
1104++			      && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1105+ 				init_srv_share_info_1(p, &info1[i++], snum);
1106+ 			}
1107+ 		}
1108+@@ -569,8 +573,9 @@
1109+ 		}
1110+ 
1111+ 		for (snum = *resume_hnd; snum < num_services; snum++) {
1112+-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1113+-				init_srv_share_info_2(p, &info2[i++], snum);
1114++			if ( (lp_browseable(snum) ||  p->conn->admin_user )  
1115++			     && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1116++			     init_srv_share_info_2(p, &info2[i++], snum);
1117+ 			}
1118+ 		}
1119+ 
1120+@@ -588,7 +593,8 @@
1121+ 		}
1122+ 
1123+ 		for (snum = *resume_hnd; snum < num_services; snum++) {
1124+-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1125++			if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
1126++			    && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1127+ 				init_srv_share_info_501(p, &info501[i++], snum);
1128+ 			}
1129+ 		}
1130+@@ -607,7 +613,8 @@
1131+ 		}
1132+ 
1133+ 		for (snum = *resume_hnd; snum < num_services; snum++) {
1134+-			if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1135++			if ( (lp_browseable(snum) ||  p->conn->admin_user ) 
1136++			     && lp_snum_ok(snum) && (all_shares || !is_hidden_share(snum)) ) {
1137+ 				init_srv_share_info_502(p, &info502[i++], snum);
1138+ 			}
1139+ 		}
1140