search for: resolved_name

Displaying 11 results from an estimated 11 matches for "resolved_name".

Did you mean: resolve_name
2014 Sep 27
2
[PATCH 1/2] Implement realpath()
...ctype/isgraph.o ctype/islower.o ctype/isprint.o \ --- /dev/null +++ b/usr/klibc/realpath.c @@ -0,0 +1,147 @@ +#include <errno.h> +#include <limits.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <unistd.h> + +static char *__realpath(const char *name, char *resolved_name, int recurse) +{ + char link_target[PATH_MAX]; + struct stat st; + char *p, *end; + size_t comp_len; + int link_len; + int exists = 1; + int is_dir = 1; + + /* Keep or ignore base dir depending on whether name is relative */ + p = resolved_name; + if (*name != '/') + p += strlen(p); + + /*...
2016 Jan 06
0
[klibc:master] Implement realpath()
...clude <unistd.h> + +/* + * Note that this requires name to refer to an existing file. This is + * correct according to POSIX. However, BSD and GNU implementations + * also allow name to refer to a non-existing file in an existing + * directory. + */ + +char *realpath(const char *name, char *resolved_name) +{ + static const char proc_fd_prefix[] = "/proc/self/fd/"; + char proc_fd_name[sizeof(proc_fd_prefix) + sizeof(int) * 3]; + int allocated = 0; + int fd; + ssize_t len; + + /* Open for path lookup only */ + fd = open(name, O_PATH); + if (fd < 0) + return NULL; + + if (!resolved_name)...
2014 Sep 29
0
[PATCH v2 1/2] Implement realpath()
...clude <unistd.h> + +/* + * Note that this requires name to refer to an existing file. This is + * correct according to POSIX. However, BSD and GNU implementations + * also allow name to refer to a non-existing file in an existing + * directory. + */ + +char *realpath(const char *name, char *resolved_name) +{ + static const char proc_fd_prefix[] = "/proc/self/fd/"; + char proc_fd_name[sizeof(proc_fd_prefix) + sizeof(int) * 3]; + int allocated = 0; + int fd; + ssize_t len; + + /* Open for path lookup only */ + fd = open(name, O_PATH); + if (fd < 0) + return NULL; + + if (!resolved_name)...
2016 Jan 06
3
[PATCH klibc 0/3] Changes to support initramfs-tools 0.117
initramfs-tools version 0.117 requires 'readlink -f' and 'mount -o defaults' to work. The first two patches were previously submitted but not applied. Ben. Ben Hutchings (3): Implement realpath() readlink: Add -f option mount: Implement -o defaults usr/include/stdlib.h | 2 ++ usr/klibc/Kbuild | 2 +- usr/klibc/realpath.c | 49
2016 Jan 06
1
wide links and privileges
...uced_name` and `check_reduced_name_with_privilege` functions: source3/smbd/vfs.c: ``` NTSTATUS check_reduced_name(connection_struct *conn, const char *fname) [...] /* Common widelinks and symlinks checks. */ if (!allow_widelinks || !allow_symlinks) { [...] if (strncmp(conn_rootdir, resolved_name, rootdir_len) != 0) { DEBUG(2, ("check_reduced_name: Bad access " "attempt: %s is a symlink outside the " "share path\n", fname)); ``` and ``` NTSTATUS check_reduced_name_with_privilege(connection_struct *co...
2016 Jan 06
3
wide links and privileges
...lege` functions: > > source3/smbd/vfs.c: > ``` > NTSTATUS check_reduced_name(connection_struct *conn, const char *fname) > [...] > /* Common widelinks and symlinks checks. */ > if (!allow_widelinks || !allow_symlinks) { > [...] > if (strncmp(conn_rootdir, resolved_name, > rootdir_len) != 0) { > DEBUG(2, ("check_reduced_name: Bad access " > "attempt: %s is a symlink outside the " > "share path\n", fname)); > > ``` > and > > ``` > NTSTATUS check...
2015 Dec 22
6
wide links and privileges
Hi, I'm using samba version samba-4.1.6+dfsg included in last ubuntu LTS version. Here is my smb.conf file: [global] # configuration du serveur netbios name = scribe workgroup = dompedago server string = scribe preferred master = yes domain logons = yes security = user ldap passwd sync = yes passdb backend =
2016 Jan 07
0
wide links and privileges
...ilege` functions: > > source3/smbd/vfs.c: > ``` > NTSTATUS check_reduced_name(connection_struct *conn, const char *fname) > [...] >     /* Common widelinks and symlinks checks. */ >     if (!allow_widelinks || !allow_symlinks) { > [...] >         if (strncmp(conn_rootdir, resolved_name, >                 rootdir_len) != 0) { >             DEBUG(2, ("check_reduced_name: Bad access " >                 "attempt: %s is a symlink outside the " >                 "share path\n", fname)); > > ``` > and > > ``` > NTSTATUS check_r...
2019 Nov 25
4
big share problem
...server.mydomain smbd[75484]: change_to_user_internal: chdir_current_service() failed! The samba logs : [2019/11/25 19:06:42.602821,? 2] ../source3/smbd/vfs.c:1305(check_reduced_name) ? check_reduced_name: Bad access attempt: . is a symlink outside the share path ? conn_rootdir =/data/dir2 ? resolved_name=/ [2019/11/25 19:06:42.602889,? 3] ../source3/smbd/filename.c:1382(get_real_filename_full_scan) ? scan dir didn't open dir [.] [2019/11/25 19:06:42.602923,? 3] ../source3/smbd/smb2_server.c:3190(smbd_smb2_request_error_ex) ? smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] st...
2019 Nov 25
0
big share problem
...user_internal: chdir_current_service() failed! > > The samba logs : > > [2019/11/25 19:06:42.602821,? 2] > ../source3/smbd/vfs.c:1305(check_reduced_name) > ? check_reduced_name: Bad access attempt: . is a symlink outside the > share path > ? conn_rootdir =/data/dir2 > ? resolved_name=/ > [2019/11/25 19:06:42.602889,? 3] > ../source3/smbd/filename.c:1382(get_real_filename_full_scan) > ? scan dir didn't open dir [.] > [2019/11/25 19:06:42.602923,? 3] > ../source3/smbd/smb2_server.c:3190(smbd_smb2_request_error_ex) > ? smbd_smb2_request_error_ex: smbd_smb2_...
2005 Mar 11
1
reduce_name and ACL's
AIX 5.2, Samba 3.0.11, OpenLDAP 2.2.23. Can someone explain what reduce name is supposed to be checking? The final debug uses "p" as the "reduced" name, but p is NULL to start and only has a value during the code path IF there was no entry found on the first call to realpath at which point the last component is removed and we try again. Now since p points to the character