mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 17:29:28 +03:00
* smbfs.c (myumask): Removed. It is only written and never read.
(smbfs_init): Use PATH_SEP_STR and reformat.
This commit is contained in:
parent
e26cef8825
commit
c29498db11
@ -1,3 +1,8 @@
|
|||||||
|
2002-08-06 Andrew V. Samoilov <kai@cmail.ru>
|
||||||
|
|
||||||
|
* smbfs.c (myumask): Removed. It is only written and never read.
|
||||||
|
(smbfs_init): Use PATH_SEP_STR and reformat.
|
||||||
|
|
||||||
2002-08-01 Pavel Roskin <proski@gnu.org>
|
2002-08-01 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* mcserv.c: Remove all references to MAD.
|
* mcserv.c: Remove all references to MAD.
|
||||||
|
66
vfs/smbfs.c
66
vfs/smbfs.c
@ -60,7 +60,6 @@ static uint32 err;
|
|||||||
/* stuff that is same with each connection */
|
/* stuff that is same with each connection */
|
||||||
extern int DEBUGLEVEL;
|
extern int DEBUGLEVEL;
|
||||||
extern pstring myhostname;
|
extern pstring myhostname;
|
||||||
static mode_t myumask = 0755;
|
|
||||||
extern pstring global_myname;
|
extern pstring global_myname;
|
||||||
static int smbfs_open_connections = 0;
|
static int smbfs_open_connections = 0;
|
||||||
static gboolean got_user = FALSE;
|
static gboolean got_user = FALSE;
|
||||||
@ -258,50 +257,49 @@ smbfs_set_debug(int arg)
|
|||||||
|
|
||||||
/********************** The callbacks ******************************/
|
/********************** The callbacks ******************************/
|
||||||
static int
|
static int
|
||||||
smbfs_init(vfs *me)
|
smbfs_init (vfs * me)
|
||||||
{
|
{
|
||||||
char *servicesf = CONFIGDIR "/smb.conf";
|
char *servicesf = CONFIGDIR PATH_SEP_STR "smb.conf";
|
||||||
|
|
||||||
DEBUGLEVEL = 0;
|
/* DEBUGLEVEL = 4; */
|
||||||
|
|
||||||
setup_logging("mc", True);
|
setup_logging ("mc", True);
|
||||||
TimeInit();
|
TimeInit ();
|
||||||
charset_initialise();
|
charset_initialise ();
|
||||||
|
|
||||||
DEBUG(3, ("smbfs_init(%s)\n", me->name));
|
DEBUG (3, ("smbfs_init(%s)\n", me->name));
|
||||||
|
|
||||||
if(!get_myname(myhostname,NULL))
|
if (!get_myname (myhostname, NULL))
|
||||||
DEBUG(0,("Failed to get my hostname.\n"));
|
DEBUG (0, ("Failed to get my hostname.\n"));
|
||||||
|
|
||||||
if (!lp_load(servicesf,True,False,False))
|
if (!lp_load (servicesf, True, False, False))
|
||||||
DEBUG(0, ("Cannot load %s - run testparm to debug it\n", servicesf));
|
DEBUG (0, ("Cannot load %s - run testparm to debug it\n", servicesf));
|
||||||
|
|
||||||
codepage_initialise(lp_client_code_page());
|
codepage_initialise (lp_client_code_page ());
|
||||||
|
|
||||||
load_interfaces();
|
load_interfaces ();
|
||||||
myumask = umask(0);
|
|
||||||
umask(myumask);
|
|
||||||
|
|
||||||
if (getenv("USER")) {
|
if (getenv ("USER")) {
|
||||||
char *p;
|
char *p;
|
||||||
pstrcpy(username, getenv("USER"));
|
|
||||||
got_user = TRUE;
|
pstrcpy (username, getenv ("USER"));
|
||||||
DEBUG(3, ("smbfs_init(): $USER:%s\n", username));
|
got_user = TRUE;
|
||||||
if ((p = strchr(username, '%'))) {
|
DEBUG (3, ("smbfs_init(): $USER:%s\n", username));
|
||||||
*p = 0;
|
if ((p = strchr (username, '%'))) {
|
||||||
pstrcpy(password, p+1);
|
*p = 0;
|
||||||
got_pass = TRUE;
|
pstrcpy (password, p + 1);
|
||||||
memset(strchr(getenv("USER"), '%')+1, 'X', strlen(password));
|
got_pass = TRUE;
|
||||||
DEBUG(3, ("smbfs_init(): $USER%%pass: %s%%%s\n",
|
memset (strchr (getenv ("USER"), '%') + 1, 'X', strlen (password));
|
||||||
username, password));
|
DEBUG (3, ("smbfs_init(): $USER%%pass: %s%%%s\n",
|
||||||
}
|
username, password));
|
||||||
strupper(username);
|
}
|
||||||
|
strupper (username);
|
||||||
}
|
}
|
||||||
if (getenv("PASSWD")) {
|
if (getenv ("PASSWD")) {
|
||||||
pstrcpy(password, getenv("PASSWD"));
|
pstrcpy (password, getenv ("PASSWD"));
|
||||||
got_pass = TRUE;
|
got_pass = TRUE;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user