linux/fs/smb/server/misc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *   Copyright (C) 2016 Namjae Jeon <[email protected]>
 *   Copyright (C) 2018 Samsung Electronics Co., Ltd.
 */

#include <linux/kernel.h>
#include <linux/xattr.h>
#include <linux/fs.h>
#include <linux/unicode.h>

#include "misc.h"
#include "smb_common.h"
#include "connection.h"
#include "vfs.h"

#include "mgmt/share_config.h"

/**
 * match_pattern() - compare a string with a pattern which might include
 * wildcard '*' and '?'
 * TODO : implement consideration about DOS_DOT, DOS_QM and DOS_STAR
 *
 * @str:	string to compare with a pattern
 * @len:	string length
 * @pattern:	pattern string which might include wildcard '*' and '?'
 *
 * Return:	0 if pattern matched with the string, otherwise non zero value
 */
int match_pattern(const char *str, size_t len, const char *pattern)
{}

/*
 * is_char_allowed() - check for valid character
 * @ch:		input character to be checked
 *
 * Return:	1 if char is allowed, otherwise 0
 */
static inline int is_char_allowed(char ch)
{}

int ksmbd_validate_filename(char *filename)
{}

static int ksmbd_validate_stream_name(char *stream_name)
{}

int parse_stream_name(char *filename, char **stream_name, int *s_type)
{}

/**
 * convert_to_nt_pathname() - extract and return windows path string
 *      whose share directory prefix was removed from file path
 * @share: ksmbd_share_config pointer
 * @path: path to report
 *
 * Return : windows path string or error
 */

char *convert_to_nt_pathname(struct ksmbd_share_config *share,
			     const struct path *path)
{}

int get_nlink(struct kstat *st)
{}

void ksmbd_conv_path_to_unix(char *path)
{}

void ksmbd_strip_last_slash(char *path)
{}

void ksmbd_conv_path_to_windows(char *path)
{}

char *ksmbd_casefold_sharename(struct unicode_map *um, const char *name)
{}

/**
 * ksmbd_extract_sharename() - get share name from tree connect request
 * @um: pointer to a unicode_map structure for character encoding handling
 * @treename:	buffer containing tree name and share name
 *
 * Return:      share name on success, otherwise error
 */
char *ksmbd_extract_sharename(struct unicode_map *um, const char *treename)
{}

/**
 * convert_to_unix_name() - convert windows name to unix format
 * @share:	ksmbd_share_config pointer
 * @name:	file name that is relative to share
 *
 * Return:	converted name on success, otherwise NULL
 */
char *convert_to_unix_name(struct ksmbd_share_config *share, const char *name)
{}

char *ksmbd_convert_dir_info_name(struct ksmbd_dir_info *d_info,
				  const struct nls_table *local_nls,
				  int *conv_len)
{}

/*
 * Convert the NT UTC (based 1601-01-01, in hundred nanosecond units)
 * into Unix UTC (based 1970-01-01, in seconds).
 */
struct timespec64 ksmbd_NTtimeToUnix(__le64 ntutc)
{}

/* Convert the Unix UTC into NT UTC. */
inline u64 ksmbd_UnixTimeToNT(struct timespec64 t)
{}

inline long long ksmbd_systime(void)
{}