Philippe Baronnet
2002-Dec-03 15:09 UTC
[Samba] Need to know the code error returned by smbmount utility
I used the smbmount command in a system call in a C program, i.e. { sprintf(req, "smbmount //NTMAX/SAMBA /usr/mf -o ip=192.168.2.17,username=Administrator,password=super"); ret=system(req); printf("after mount: ret=%d err=%d\n",ret,errno); } I tried this program in different situations, when a firewall was active, when the host was disconnected and when the remote directory was not sharable. Below is what I got. 2096: Connection to Davide2000 failed SMB connection failed after mount: ret=256 err=0 error connecting to 192.168.2.17:139 (No route to host) 2124: Connection to NTMAX failed SMB connection failed after mount: ret=256 err=0 2152: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid share name) SMB connection failed after mount: ret=256 err=0 It seems to me that I would have to parse the returned string to figure out the error which seems to be the number before the colon.Is there any other way? Where can i find the list of code errors could be returned by smbmount or other samba utilities? TIA. -- Philippe Baronnet <philippe.baronnet@club-internet.fr>