Linux2009. 10. 22. 13:10
$ man 2 mount
       #include <sys/mount.h>

       int mount(const char *source, const char *target,
                 const char *filesystemtype, unsigned long mountflags,
                 const void *data);

       int umount(const char *target);

       int umount2(const char *target, int flags);

mount의 형태는 저따구인데.. 알흠답지 못하다...
아무튼 cifs를 마운트 하기 위해서는 "-o user=userid,password=userpw" 라는 옵션이 들어가는데
mount() 함수에서 사용하려니.... 오잉? 가변인자가 아니다 ㄱ-

몇번 실험해보니
"-o"를 제외하고 나머지 값을 data에 넘겨주면 된다.


$ mount -t cifs -o user=userid,password=userpw \\serverip\share /mnt/samba

mount("\\serverip\share", "/mnt/samba", "cifs", 0, "user=userid,password=userpw");
로 대치하여 사용하면 된다.

[링크 : http://linux.die.net/man/2/mount]

'Linux' 카테고리의 다른 글

tree  (0) 2009.11.16
설치하지 않은 rpm에 포함된 파일의 내용 보기  (0) 2009.11.04
execl()로 mount 실행하기 - samba  (2) 2009.10.14
gnash - GNU SWF player  (0) 2009.09.23
/ 는 root // 는?  (0) 2009.09.22
Posted by 구차니
아무생각없이

mount -t cifs -o user=guest,password=guest 로 했더니

 CIFS VFS: Send error in SessSetup = -13
 CIFS VFS: Send error in SessSetup = -13
mount: mounting \\server\share on /mnt/samba failed: Permission denied

이런 에러가 발생한다.

아무튼 제어판 - 관리도구 - 컴퓨터 관리 에서 확인해보니

Guest User 등록 정보

Guest Group 등록 정보

아무튼 검색을 해보니, 기본적으로 윈도우 간에 파일 공유는 guest 로 로그인을 한다고 하는데,
윈도우 끼리는 접속이 되는데 삼바에서는 guest로 접속이 되지 않는다. 흐음.. 기본 암호가 다르게 쳐서 그런가?

아무튼 guest 대신에 임의의 아이디를 만들면 접속에 이상이 없다.
Posted by 구차니