Re: Howto mount cifs from c?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aha, I didn't know that,

now I get:


kernel: fs/cifs/cifsfs.c: Devname: //SCLFS20091030/public flags: 0
kernel: fs/cifs/connect.c: Domain name set
kernel: fs/cifs/connect.c: Username: sbon
kernel: fs/cifs/connect.c: file mode: 0x1ed  dir mode: 0x1ed
kernel: fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 118 with uid: 0
kernel: fs/cifs/connect.c: UNC:
\\SCLFS20091030\p//SCLFS20091030/public ip:
SCLFS20091030\p//SCLFS20091030/public
kernel: fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 118) rc = -22
kernel: CIFS VFS: cifs_mount failed w/return code = -22

Obviously something goes wrong with the mountcommand:

mount_resource: mount //SCLFS20091030/public
/mnt/fuse-workspace/65e9e42684129ad79f96d981c665cae1 cifs
user=sbon,password=sjbon0701,uid=1000,gid=1000,domain=BONONLINE,rw,acl,user_xattr,cifsacl,posixpaths,nodfs,unc=\\SCLFS20091030\p//SCLFS20091030/public

The original mountcommand in my programm adds the ip address, which is
totally overwritten.

I guess everything get messed up with the backslashes. The code I use:

/* add the unc */

*(vfsdata+len0)='\\';
len0++;
*(vfsdata+len0)='\\';
len0++;

memcpy(vfsdata+len0, smb_server->name, strlen(smb_server->name));
len0+=strlen(smb_server->name);

*(vfsdata+len0)='\\';
len0++;

memcpy(vfsdata+len0, smb_share->name, strlen(smb_share->name));
len0+=strlen(smb_share->name);

if (strlen(smb_server->ipv4address)>0) {

         /* add ip */

         len1=sprintf(vfsdata+len0, ",ip=%s", smb_server->ipv4address);
         len0+=len1;

}


Some hint??

Stef
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux