Example #1
0
/*
 * first read ~/.smbrc, next try to merge SMB_CFG_FILE
 */
int
smb_open_rcfile(void)
{
    char *home;
    int error;

    home = getenv("HOME");
    if (home) {
        char fn[1024];
        snprintf(fn, sizeof(fn), "%s/.nsmbrc", home);
        error = rc_open(fn, "r", &smb_rc);
    }
    error = rc_merge(SMB_CFG_FILE, &smb_rc);
    if (smb_rc == NULL)
        return ENOENT;
    return 0;
}
Example #2
0
/*
 * first read ~/.nwfsrc, next try to merge NWFS_CFG_FILE
 */
int
ncp_open_rcfile(void) {
	char *home, *fn;
	int error;

	home = getenv("HOME");
	if (home) {
		fn = malloc(strlen(home) + 20);
		sprintf(fn, "%s/.nwfsrc", home);
		error = rc_open(fn,"r",&ncp_rc);
		free (fn);
	}
	error = rc_merge(NWFS_CFG_FILE, &ncp_rc);
	if( ncp_rc == NULL ) {
		printf("Warning: no cfg files found.\n");
		return 1;
	}
	return 0;
}
Example #3
0
/*
 * first read ~/.smbrc, next try to merge SMB_CFG_FILE
 */
int
smb_open_rcfile(void)
{
	char *home, *fn;
	int error;

	home = getenv("HOME");
	if (home) {
		fn = malloc(strlen(home) + 20);
		sprintf(fn, "%s/.nsmbrc", home);
		error = rc_open(fn, "r", &smb_rc);
		free(fn);
	}
	error = rc_merge(SMB_CFG_FILE, &smb_rc);
	if (smb_rc == NULL) {
		printf("Warning: no cfg file(s) found.\n");
		return ENOENT;
	}
	return 0;
}