smbnetfs  0.6.3
About: SMBNetFS is a Linux/FreeBSD filesystem that allow you to use samba/microsoft network in the same manner as the network neighborhood in Microsoft Windows.
  Fossies Dox: smbnetfs-0.6.3.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

reconfigure.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <pwd.h>
#include "common.h"
#include "smbitem.h"
#include "auth-libsecret.h"
#include "auth.h"
#include "process.h"
#include "smb_conn.h"
#include "samba.h"
#include "stat_workaround.h"
#include "function.h"
#include "event.h"
#include "neg_cache.h"
#include "reconfigure.h"
Include dependency graph for reconfigure.c:

Go to the source code of this file.

Macros

#define FIELD_MAX   4
 
#define PATTERN_SIZE   20
 
#define LINE_SIZE   200
 

Enumerations

enum  config_read_mode { DELIMITER , PLAIN , QUOTED }
 

Functions

static void reconfigure_set_config_dir (const char *path)
 
void reconfigure_set_default_login_and_configdir (void)
 
static int reconfigure_get_number (char *value, int *result)
 
static int reconfigure_set_number (char *value, int(*func)(int))
 
static int reconfigure_get_size (char *value, size_t *result)
 
static int reconfigure_set_kb_size (char *value, int(*func)(size_t))
 
static int reconfigure_get_boolean (char *value, int *result)
 
static int reconfigure_set_boolean (char *value, int(*func)(int))
 
static int reconfigure_find_cmd_opt (const char *option)
 
static int reconfigure_add_cmd_opt (const char *option)
 
static int reconfigure_split_line (const char *line, char *arg[], size_t arg_len[], int arg_cnt)
 
static int reconfigure_analyse_simple_option (const char *option, char *value, int flags)
 
int reconfigure_analyse_cmdline_option (const char *option, char *value)
 
static int reconfigure_parse_auth_option (char *value[], int count)
 
static int reconfigure_parse_stat_workaround_name_option (char *value[], int count)
 
static int reconfigure_parse_host_option (char *value[], int count)
 
static int reconfigure_parse_link_option (char *value[], int count)
 
static int reconfigure_parse_group_option (char *value[], int count)
 
static int reconfigure_read_config_file (const char *filename, int flags)
 
int reconfigure_read_config (int flags)
 

Variables

static const char * config_dir_postfix = "/.smb"
 
static char config_file [256] = "smbnetfs.conf"
 
static char config_dir [2048] = "/"
 
static int config_cmd_opts_cnt = 0
 
static int config_cmd_opts_max_cnt = 32
 
static char ** config_cmd_opts = NULL
 
const char * smbnetfs_option_list
 

Macro Definition Documentation

◆ FIELD_MAX

#define FIELD_MAX   4

Definition at line 24 of file reconfigure.c.

◆ LINE_SIZE

#define LINE_SIZE   200

Definition at line 26 of file reconfigure.c.

◆ PATTERN_SIZE

#define PATTERN_SIZE   20

Definition at line 25 of file reconfigure.c.

Enumeration Type Documentation

◆ config_read_mode

Enumerator
DELIMITER 
PLAIN 
QUOTED 

Definition at line 28 of file reconfigure.c.

Function Documentation

◆ reconfigure_add_cmd_opt()

static int reconfigure_add_cmd_opt ( const char *  option)
static

◆ reconfigure_analyse_cmdline_option()

int reconfigure_analyse_cmdline_option ( const char *  option,
char *  value 
)

◆ reconfigure_analyse_simple_option()

◆ reconfigure_find_cmd_opt()

static int reconfigure_find_cmd_opt ( const char *  option)
static

◆ reconfigure_get_boolean()

static int reconfigure_get_boolean ( char *  value,
int *  result 
)
static

◆ reconfigure_get_number()

static int reconfigure_get_number ( char *  value,
int *  result 
)
static

◆ reconfigure_get_size()

static int reconfigure_get_size ( char *  value,
size_t *  result 
)
static

Definition at line 143 of file reconfigure.c.

Referenced by reconfigure_set_kb_size().

◆ reconfigure_parse_auth_option()

static int reconfigure_parse_auth_option ( char *  value[],
int  count 
)
static

Definition at line 429 of file reconfigure.c.

References auth_store_auth_data().

Referenced by reconfigure_read_config_file().

◆ reconfigure_parse_group_option()

static int reconfigure_parse_group_option ( char *  value[],
int  count 
)
static

Definition at line 557 of file reconfigure.c.

References smbitem_mkgroup(), and SMBITEM_USER_TREE.

Referenced by reconfigure_read_config_file().

◆ reconfigure_parse_host_option()

static int reconfigure_parse_host_option ( char *  value[],
int  count 
)
static

◆ reconfigure_parse_link_option()

static int reconfigure_parse_link_option ( char *  value[],
int  count 
)
static

Definition at line 528 of file reconfigure.c.

References smbitem_mklink(), and SMBITEM_USER_TREE.

Referenced by reconfigure_read_config_file().

◆ reconfigure_parse_stat_workaround_name_option()

static int reconfigure_parse_stat_workaround_name_option ( char *  value[],
int  count 
)
static

◆ reconfigure_read_config()

int reconfigure_read_config ( int  flags)

◆ reconfigure_read_config_file()

◆ reconfigure_set_boolean()

static int reconfigure_set_boolean ( char *  value,
int(*)(int)  func 
)
static

Definition at line 170 of file reconfigure.c.

References reconfigure_get_boolean().

Referenced by reconfigure_analyse_simple_option().

◆ reconfigure_set_config_dir()

static void reconfigure_set_config_dir ( const char *  path)
static

◆ reconfigure_set_default_login_and_configdir()

void reconfigure_set_default_login_and_configdir ( void  )

Definition at line 95 of file reconfigure.c.

References auth_set_default_login_name(), config_dir_postfix, and reconfigure_set_config_dir().

Referenced by main().

◆ reconfigure_set_kb_size()

static int reconfigure_set_kb_size ( char *  value,
int(*)(size_t)  func 
)
static

Definition at line 151 of file reconfigure.c.

References reconfigure_get_size().

Referenced by reconfigure_analyse_simple_option().

◆ reconfigure_set_number()

static int reconfigure_set_number ( char *  value,
int(*)(int)  func 
)
static

Definition at line 136 of file reconfigure.c.

References reconfigure_get_number().

Referenced by reconfigure_analyse_simple_option().

◆ reconfigure_split_line()

static int reconfigure_split_line ( const char *  line,
char *  arg[],
size_t  arg_len[],
int  arg_cnt 
)
static

Definition at line 213 of file reconfigure.c.

References DELIMITER, PLAIN, and QUOTED.

Referenced by reconfigure_read_config_file().

Variable Documentation

◆ config_cmd_opts

char** config_cmd_opts = NULL
static

Definition at line 40 of file reconfigure.c.

Referenced by reconfigure_add_cmd_opt(), and reconfigure_find_cmd_opt().

◆ config_cmd_opts_cnt

int config_cmd_opts_cnt = 0
static

Definition at line 38 of file reconfigure.c.

Referenced by reconfigure_add_cmd_opt(), and reconfigure_find_cmd_opt().

◆ config_cmd_opts_max_cnt

int config_cmd_opts_max_cnt = 32
static

Definition at line 39 of file reconfigure.c.

Referenced by reconfigure_add_cmd_opt().

◆ config_dir

char config_dir[2048] = "/"
static

◆ config_dir_postfix

const char* config_dir_postfix = "/.smb"
static

Definition at line 35 of file reconfigure.c.

Referenced by reconfigure_set_default_login_and_configdir().

◆ config_file

char config_file[256] = "smbnetfs.conf"
static

Definition at line 36 of file reconfigure.c.

Referenced by reconfigure_analyse_cmdline_option(), and reconfigure_read_config().

◆ smbnetfs_option_list

const char* smbnetfs_option_list
Initial value:
=
" -o config=PATH path to config (~/.smb/smbnetfs.conf)\n"
" -o smbnetfs_debug=N SMBNetFS debug level (N<=10)\n"
" -o smb_debug_level=N Samba debug level (N<=10)\n"
" -o log_file=PATH File to store SMBNetFS debug messages\n"
" -o local_charset=CHARSET Local charset (autodetected)\n"
" -o samba_charset=CHARSET Charset used by samba (utf-8)\n"
" -o max_rw_block_size=N Maximum size of r/w block in Kb (autodetected)\n"
" -o smb_tree_scan_period=T Period of scanning samba network tree (300s)\n"
" -o smb_tree_elements_ttl=T TTL of scanned elements in samba tree (900s)\n"
" -o smb_query_browsers=BOOL Enable/disable scanning of samba tree (on)\n"
" -o smb_timeout=T Samba reply timeout (20000ms)\n"
" -o show_$_shares=BOOL Enable/disable showing of hidden shares (off)\n"
" -o show_hidden_hosts=BOOL See in documentation (off)\n"
" -o free_space_size=N Free space size in pages (0)\n"
" -o quiet_flag=BOOL Do not fail on chown/chgroup (on)\n"
" -o neg_cache=BOOL Enable/disable negative cache (on)\n"
" -o neg_cache_timeout=T Negative cache records expiration time (3000ms)\n"
" -o stat_workaround_depth=N konquerror and gnome terminal hack (3)\n"
" -o time_step=T Scheduler sleep interval (10s)\n"
" -o config_update_period=T Configuration update interval (300s)\n"
" -o max_ctx_count=N Maximum number of children processes (15)\n"
" -o max_retry_count=N Number of retries before fail (2)\n"
" -o listen_timeout=T Child process inactivity timeout (300s)\n"
" -o reply_timeout=T Child process reply timeout (30s)\n"
" -o max_passwd_query_count=N See in documentation (10)\n"

Definition at line 42 of file reconfigure.c.

Referenced by print_help().