static int fd_open(struct connection_struct *conn, const char *fname, int flags, mode_t mode) { int fd; #ifdef O_NOFOLLOW if (!lp_symlinks(SNUM(conn))) flags |= O_NOFOLLOW; #endif fd = SMB_VFS_OPEN(conn,fname,flags,mode); DEBUG(10,("fd_open: name %s, flags = 0%o mode = 0%o, fd = %d. %s\n", fname, flags, (int)mode, fd, (fd == -1) ? strerror(errno) : "" )); return fd; }
NTSTATUS check_name(connection_struct *conn, const char *name) { NTSTATUS status = check_veto_path(conn, name); if (!NT_STATUS_IS_OK(status)) { return status; } if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) { status = check_reduced_name(conn,name); if (!NT_STATUS_IS_OK(status)) { DEBUG(5,("check_name: name %s failed with %s\n",name, nt_errstr(status))); return status; } } return NT_STATUS_OK; }
NTSTATUS check_name(connection_struct *conn, const pstring name) { if (IS_VETO_PATH(conn, name)) { /* Is it not dot or dot dot. */ if (!((name[0] == '.') && (!name[1] || (name[1] == '.' && !name[2])))) { DEBUG(5,("check_name: file path name %s vetoed\n",name)); return map_nt_error_from_unix(ENOENT); } } if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) { NTSTATUS status = reduce_name(conn,name); if (!NT_STATUS_IS_OK(status)) { DEBUG(5,("check_name: name %s failed with %s\n",name, nt_errstr(status))); return status; } } return NT_STATUS_OK; }
static int fd_open(struct connection_struct *conn, char *fname, int flags, mode_t mode) { int fd; #ifdef O_NOFOLLOW if (!lp_symlinks(SNUM(conn))) flags |= O_NOFOLLOW; #endif fd = conn->vfs_ops.open(conn,dos_to_unix_static(fname),flags,mode); /* Fix for files ending in '.' */ if((fd == -1) && (errno == ENOENT) && (strchr(fname,'.')==NULL)) { pstrcat(fname,"."); fd = conn->vfs_ops.open(conn,dos_to_unix_static(fname),flags,mode); } DEBUG(10,("fd_open: name %s, flags = 0%o mode = 0%o, fd = %d. %s\n", fname, flags, (int)mode, fd, (fd == -1) ? strerror(errno) : "" )); return fd; }