亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wrapper.c

?? samba-3.0.22.tar.gz 編譯smb服務器的源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*    Unix SMB/Netbios implementation.   Version 2.0   SMB wrapper functions   Copyright (C) Andrew Tridgell 1998   Copyright (C) Derrell Lipman 2002-2005      This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.      This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.      You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*//* * This is a rewrite of the original wrapped.c file, using libdl to obtain * pointers into the C library rather than attempting to find undocumented * functions in the C library to call for native file access.  The problem * with the original implementation's paradigm is that samba manipulates * defines such that it gets the sizes of structures that it wants * (e.g. mapping 32-bit functions to 64-bit functions with their associated * 64-bit structure fields), but programs run under smbsh or using * smbwrapper.so were not necessarily compiled with the same flags.  As an * example of the problem, a program calling stat() passes a pointer to a * "struct stat" but the fields in that structure are different in samba than * they are in the calling program if the calling program was not compiled to * force stat() to be mapped to stat64(). * * In this version, we provide an interface to each of the native functions, * not just the ones that samba is compiled to map to.  We obtain the function * pointers from the C library using dlsym(), and for native file operations, * directly call the same function that the calling application was * requesting.  Since the size of the calling application's structures vary * depending on what function was called, we use our own internal structures * for passing information to/from the SMB equivalent functions, and map them * back to the native structures before returning the result to the caller. * * This implementation was completed 25 December 2002. * Derrell Lipman *//* We do not want auto munging of 32->64 bit names in this file (only) */#undef _FILE_OFFSET_BITS#undef _GNU_SOURCE#include <sys/types.h>#include <sys/stat.h>#include <sys/time.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>#include <utime.h>#include <stdio.h>#include <dirent.h>#include <signal.h>#include <stdarg.h>#ifdef __USE_GNU# define SMBW_USE_GNU#endif#define __USE_GNU             /* need this to have RTLD_NEXT defined */#include <dlfcn.h>#ifndef SMBW_USE_GNU# undef __USE_GNU#endif#include <errno.h>#include "libsmbclient.h"#include "bsd-strlfunc.h"#include "wrapper.h"/* * Debug bits: * 0x0 = none * 0x1 = display symbol definitions not found in C library * 0x2 = show wrapper functions being called * 0x4 = log to file SMBW_DEBUG_FILE instead of stderr */#define SMBW_DEBUG      0x0#define SMBW_DEBUG_FILE "/tmp/smbw.log"int      smbw_debug = 0;#if SMBW_DEBUG & 0x2static int      debugFd = 2;#endif#ifndef ENOTSUP#define ENOTSUP EOPNOTSUPP#endif/* * None of the methods of having the initialization function called * automatically upon shared library startup are effective in all situations. * We provide the "-init" parameter to the linker which is effective most of * the time, but fails for applications that provide their own shared * libraries with _init() functions (e.g. ps).  We can't use "-z initfirst" * because the environment isn't yet set up at that point, so we can't find * our shared memory identifier (see shared.c).  We therefore must resort to * this tried-and-true method of keeping an "initialized" flag.  We check it * prior to calling the initialize() function to save a function call (a slow * operation on x86). */#if SMBW_DEBUG & 0x2#  define check_init(buf)                                               \        do {                                                            \                int saved_errno = errno;                                \                if (! initialized) initialize();                        \                (* smbw_libc.write)(debugFd, "["buf"]", sizeof(buf)+1); \                errno = saved_errno;                                    \        } while (0)#else#  define check_init(buf)                               \        do {                                            \                if (! initialized) smbw_initialize();   \        } while (0)#endifstatic void initialize(void);static int initialized = 0;SMBW_libc_pointers smbw_libc;/* * A public entry point used by the "-init" option to the linker. */void smbw_initialize(void){        initialize();}static void initialize(void){        int saved_errno;#if SMBW_DEBUG & 0x1        char *error;#endif                saved_errno = errno;                if (initialized) {                return;        }        initialized = 1;        #if SMBW_DEBUG & 0x1# define GETSYM(symname, symstring)                                      \        if ((smbw_libc.symname = dlsym(RTLD_NEXT, symstring)) == NULL) { \                if (smbw_libc.write != NULL &&                           \                    (error = dlerror()) != NULL) {                       \                        (* smbw_libc.write)(1, error, strlen(error));    \                        (* smbw_libc.write)(1, "\n", 1);                 \                }                                                        \        }#else# define GETSYM(symname, symstring)                     \        smbw_libc.symname = dlsym(RTLD_NEXT, symstring);#endif                /*         * Get pointers to each of the symbols we'll need, from the C library         *         * Some of these symbols may not be found in the C library.  That's         * fine.  We declare all of them here, and if the C library supports         * them, they may be called so we have the wrappers for them.  If the         * C library doesn't support them, then the wrapper function will         * never be called, and the null pointer will never be dereferenced.         */        GETSYM(write, "write"); /* first, to allow debugging */        GETSYM(open, "open");        GETSYM(_open, "_open");        GETSYM(__open, "__open");        GETSYM(open64, "open64");        GETSYM(_open64, "_open64");        GETSYM(__open64, "__open64");        GETSYM(pread, "pread");        GETSYM(pread64, "pread64");        GETSYM(pwrite, "pwrite");        GETSYM(pwrite64, "pwrite64");        GETSYM(close, "close");        GETSYM(__close, "__close");        GETSYM(_close, "_close");        GETSYM(fcntl, "fcntl");        GETSYM(__fcntl, "__fcntl");        GETSYM(_fcntl, "_fcntl");        GETSYM(getdents, "getdents");        GETSYM(__getdents, "__getdents");        GETSYM(_getdents, "_getdents");        GETSYM(getdents64, "getdents64");        GETSYM(lseek, "lseek");        GETSYM(__lseek, "__lseek");        GETSYM(_lseek, "_lseek");        GETSYM(lseek64, "lseek64");        GETSYM(__lseek64, "__lseek64");        GETSYM(_lseek64, "_lseek64");        GETSYM(read, "read");        GETSYM(__read, "__read");        GETSYM(_read, "_read");        GETSYM(__write, "__write");        GETSYM(_write, "_write");        GETSYM(access, "access");        GETSYM(chmod, "chmod");        GETSYM(fchmod, "fchmod");        GETSYM(chown, "chown");        GETSYM(fchown, "fchown");        GETSYM(__xstat, "__xstat");        GETSYM(getcwd, "getcwd");        GETSYM(mkdir, "mkdir");        GETSYM(__fxstat, "__fxstat");        GETSYM(__lxstat, "__lxstat");        GETSYM(stat, "stat");        GETSYM(lstat, "lstat");        GETSYM(fstat, "fstat");        GETSYM(unlink, "unlink");        GETSYM(utime, "utime");        GETSYM(utimes, "utimes");        GETSYM(readlink, "readlink");        GETSYM(rename, "rename");        GETSYM(rmdir, "rmdir");        GETSYM(symlink, "symlink");        GETSYM(dup, "dup");        GETSYM(dup2, "dup2");        GETSYM(opendir, "opendir");        GETSYM(readdir, "readdir");        GETSYM(closedir, "closedir");        GETSYM(telldir, "telldir");        GETSYM(seekdir, "seekdir");        GETSYM(creat, "creat");        GETSYM(creat64, "creat64");        GETSYM(__xstat64, "__xstat64");        GETSYM(stat64, "stat64");        GETSYM(__fxstat64, "__fxstat64");        GETSYM(fstat64, "fstat64");        GETSYM(__lxstat64, "__lxstat64");        GETSYM(lstat64, "lstat64");        GETSYM(_llseek, "_llseek");        GETSYM(readdir64, "readdir64");        GETSYM(readdir_r, "readdir_r");        GETSYM(readdir64_r, "readdir64_r");        GETSYM(setxattr, "setxattr");        GETSYM(lsetxattr, "lsetxattr");        GETSYM(fsetxattr, "fsetxattr");        GETSYM(getxattr, "getxattr");        GETSYM(lgetxattr, "lgetxattr");        GETSYM(fgetxattr, "fgetxattr");        GETSYM(removexattr, "removexattr");        GETSYM(lremovexattr, "lremovexattr");        GETSYM(fremovexattr, "fremovexattr");        GETSYM(listxattr, "listxattr");        GETSYM(llistxattr, "llistxattr");        GETSYM(flistxattr, "flistxattr");        GETSYM(chdir, "chdir");        GETSYM(fchdir, "fchdir");        GETSYM(fork, "fork");        GETSYM(select, "select");        GETSYM(_select, "_select");        GETSYM(__select, "__select");        #if SMBW_DEBUG & 4        {                if ((debugFd =                     open(SMBW_DEBUG_FILE, O_WRONLY | O_CREAT | O_APPEND)) < 0)                {#               define SMBW_MESSAGE    "Could not create " SMBW_DEBUG_FILE "\n"                         (* smbw_libc.write)(1, SMBW_MESSAGE, sizeof(SMBW_MESSAGE));#               undef SMBW_MESSAGE                        exit(1);                }        }#endif                errno = saved_errno;}/** ** Static Functions **/static void stat_convert(struct SMBW_stat *src, struct stat *dest){        memset(dest, '\0', sizeof(*dest));	dest->st_size = src->s_size;	dest->st_mode = src->s_mode;	dest->st_ino = src->s_ino;	dest->st_dev = src->s_dev;	dest->st_rdev = src->s_rdev;	dest->st_nlink = src->s_nlink;	dest->st_uid = src->s_uid;	dest->st_gid = src->s_gid;	dest->st_atime = src->s_atime;	dest->st_mtime = src->s_mtime;	dest->st_ctime = src->s_ctime;	dest->st_blksize = src->s_blksize;	dest->st_blocks = src->s_blocks;}static void stat64_convert(struct SMBW_stat *src, struct stat64 *dest){        memset(dest, '\0', sizeof(*dest));	dest->st_size = src->s_size;	dest->st_mode = src->s_mode;	dest->st_ino = src->s_ino;	dest->st_dev = src->s_dev;	dest->st_rdev = src->s_rdev;	dest->st_nlink = src->s_nlink;	dest->st_uid = src->s_uid;	dest->st_gid = src->s_gid;	dest->st_atime = src->s_atime;	dest->st_mtime = src->s_mtime;	dest->st_ctime = src->s_ctime;	dest->st_blksize = src->s_blksize;	dest->st_blocks = src->s_blocks;}static void dirent_convert(struct SMBW_dirent *src, struct dirent *dest){        char *p;                memset(dest, '\0', sizeof(*dest));	dest->d_ino = src->d_ino;	dest->d_off = src->d_off;                switch(src->d_type)        {        case SMBC_WORKGROUP:        case SMBC_SERVER:        case SMBC_FILE_SHARE:        case SMBC_DIR:                dest->d_type = DT_DIR;                break;                        case SMBC_FILE:                dest->d_type = DT_REG;                break;                        case SMBC_PRINTER_SHARE:                dest->d_type = DT_CHR;                break;                        case SMBC_COMMS_SHARE:                dest->d_type = DT_SOCK;                break;                        case SMBC_IPC_SHARE:                dest->d_type = DT_FIFO;                break;                        case SMBC_LINK:                dest->d_type = DT_LNK;                break;        }        	dest->d_reclen = src->d_reclen;	smbw_strlcpy(dest->d_name, src->d_name, sizeof(dest->d_name));        p = dest->d_name + strlen(dest->d_name) + 1;        smbw_strlcpy(p,                     src->d_comment,                     sizeof(dest->d_name) - (p - dest->d_name));}static void dirent64_convert(struct SMBW_dirent *src, struct dirent64 *dest){        char *p;                memset(dest, '\0', sizeof(*dest));	dest->d_ino = src->d_ino;	dest->d_off = src->d_off;                switch(src->d_type)        {        case SMBC_WORKGROUP:        case SMBC_SERVER:        case SMBC_FILE_SHARE:        case SMBC_DIR:                dest->d_type = DT_DIR;                break;                        case SMBC_FILE:                dest->d_type = DT_REG;                break;                        case SMBC_PRINTER_SHARE:                dest->d_type = DT_CHR;                break;                        case SMBC_COMMS_SHARE:                dest->d_type = DT_SOCK;                break;                        case SMBC_IPC_SHARE:                dest->d_type = DT_FIFO;                break;                        case SMBC_LINK:                dest->d_type = DT_LNK;                break;        }        	dest->d_reclen = src->d_reclen;	smbw_strlcpy(dest->d_name, src->d_name, sizeof(dest->d_name));        p = dest->d_name + strlen(dest->d_name) + 1;        smbw_strlcpy(p,                     src->d_comment,                     sizeof(dest->d_name) - (p - dest->d_name));}static int openx(char *name, int flags, mode_t mode, int (* f)(char *, int, mode_t)){	if (smbw_path(name)) {		return smbw_open(name, flags, mode);	}                return (* f)(name, flags, mode);}static int closex(int fd, int (* f)(int fd)){	if (smbw_fd(fd)) {		return smbw_close(fd);	}                return (* f)(fd);}static int fcntlx(int fd, int cmd, long arg, int (* f)(int, int, long)){	if (smbw_fd(fd)) {		return smbw_fcntl(fd, cmd, arg);	}                return (* f)(fd, cmd, arg);}static int getdentsx(int fd, struct dirent *external, unsigned int count, int (* f)(int, struct dirent *, unsigned int)){	if (smbw_fd(fd)) {                int i;                int internal_count;                struct SMBW_dirent *internal;                int ret;                int n;                                /*                 * LIMITATION: If they pass a count which is not a multiple of                 * the size of struct dirent, they will not get a partial                 * structure; we ignore the excess count.                 */                n = (count / sizeof(struct dirent));                                internal_count = sizeof(struct SMBW_dirent) * n;                internal = malloc(internal_count);                if (internal == NULL) {                        errno = ENOMEM;                        return -1;                }		ret = smbw_getdents(fd, internal, internal_count);                if (ret <= 0)                        return ret;                                ret = sizeof(struct dirent) * n;                                for (i = 0; i < n; i++)                        dirent_convert(&internal[i], &external[i]);                                return ret;	}                return (* f)(fd, external, count);}static off_t lseekx(int fd,                    off_t offset,                    int whence,                    off_t (* f)(int, off_t, int)){        off_t           ret;                /*         * We have left the definitions of the smbw_ functions undefined,         * because types such as off_t can differ in meaning betweent his         * function and smbw.c et al.  Functions that return other than an         * integer value, however, MUST have their return value defined.         */        off64_t         smbw_lseek();                if (smbw_fd(fd)) {		return (off_t) smbw_lseek(fd, offset, whence);	}                ret = (* f)(fd, offset, whence);        if (smbw_debug)        {                printf("lseekx(%d, 0x%llx) returned 0x%llx\n",                       fd,                       (unsigned long long) offset,                       (unsigned long long) ret);        }        return ret;}static off64_t lseek64x(int fd,                        off64_t offset,                        int whence,                        off64_t (* f)(int, off64_t, int)){        off64_t         ret;                /*         * We have left the definitions of the smbw_ functions undefined,         * because types such as off_t can differ in meaning betweent his         * function and smbw.c et al.  Functions that return other than an         * integer value, however, MUST have their return value defined.         */        off64_t         smbw_lseek();        	if (smbw_fd(fd))		ret = smbw_lseek(fd, offset, whence);        else                ret = (* f)(fd, offset, whence);        if (smbw_debug)        {                printf("lseek64x(%d, 0x%llx) returned 0x%llx\n",                       fd,                       (unsigned long long) offset,                       (unsigned long long) ret);        }        return ret;}static ssize_t readx(int fd, void *buf, size_t count, ssize_t (* f)(int, void *, size_t)){	if (smbw_fd(fd)) {		return smbw_read(fd, buf, count);	}                return (* f)(fd, buf, count);}static ssize_t writex(int fd, void *buf, size_t count, ssize_t (* f)(int, void *, size_t)){	if (smbw_fd(fd)) {		return smbw_write(fd, buf, count);	}                return (* f)(fd, buf, count);}/** ** Wrapper Functions **/int open(__const char *name, int flags, ...){        va_list ap;        mode_t mode;                va_start(ap, flags);        mode = va_arg(ap, mode_t);        va_end(ap);                check_init("open");                return openx((char *) name, flags, mode, smbw_libc.open);}int _open(char *name, int flags, mode_t mode){        check_init("open");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影院精品一区| 国产成人av电影在线| 91搞黄在线观看| 亚洲伦理在线精品| 欧美三级中文字| 午夜久久久久久久久久一区二区| 在线观看国产精品网站| 五月天视频一区| 精品福利一区二区三区免费视频| 精品一区二区在线播放| 国产精品免费免费| 欧美视频精品在线观看| 麻豆一区二区三区| 国产女人18毛片水真多成人如厕 | 91免费视频网| 一区二区三区中文在线| 91超碰这里只有精品国产| 久久99精品国产.久久久久久 | 99re热这里只有精品视频| 亚洲欧美一区二区在线观看| 欧美日韩电影一区| 国精产品一区一区三区mba桃花| 国产精品欧美久久久久无广告| 日本韩国欧美三级| 蜜桃91丨九色丨蝌蚪91桃色| 中国色在线观看另类| 色婷婷精品久久二区二区蜜臀av | 欧美精品v国产精品v日韩精品 | 欧美经典三级视频一区二区三区| 91欧美一区二区| 日av在线不卡| 日韩伦理av电影| 日韩精品最新网址| 91视频在线看| 国产综合成人久久大片91| 亚洲欧美一区二区三区孕妇| 精品国产三级电影在线观看| 91视频91自| 国产一区亚洲一区| 一区二区三区**美女毛片| 久久久激情视频| 欧美精品 日韩| 色综合天天做天天爱| 精品中文字幕一区二区小辣椒| 一区二区国产盗摄色噜噜| 国产欧美日韩在线看| 欧美一卡2卡3卡4卡| 91亚洲永久精品| 国产精品一线二线三线精华| 天天综合网 天天综合色| 亚洲日本在线a| 国产午夜亚洲精品不卡| 欧美一区二区三区免费大片| 色悠悠久久综合| 成人高清av在线| 国产在线国偷精品免费看| 日韩一区精品字幕| 亚洲午夜在线电影| 亚洲人成伊人成综合网小说| 国产亚洲综合在线| 精品嫩草影院久久| 欧美精品 日韩| 欧美日韩dvd在线观看| 日韩女优av电影在线观看| 一本色道a无线码一区v| 国产精品一区二区在线播放 | 日本一区二区成人在线| 色偷偷一区二区三区| 国产91精品在线观看| 久久精品久久精品| 日韩国产精品久久| 亚洲国产精品一区二区久久恐怖片 | 4438x成人网最大色成网站| 色老头久久综合| 色老汉一区二区三区| 91同城在线观看| 91丨porny丨首页| 成人国产一区二区三区精品| 成人禁用看黄a在线| 成人动漫视频在线| 暴力调教一区二区三区| a亚洲天堂av| 91日韩在线专区| 日本韩国一区二区三区| 色94色欧美sute亚洲线路一ni | 日本一区二区免费在线 | 波多野结衣中文字幕一区二区三区| 国产精品系列在线观看| 成人黄色av电影| 色综合久久综合网| 欧美亚洲禁片免费| 日韩亚洲欧美高清| 久久久国产午夜精品| 国产精品久久久久久妇女6080| 综合中文字幕亚洲| 亚洲高清一区二区三区| 日韩和欧美一区二区| 精品一区二区三区在线观看国产 | 中文字幕亚洲综合久久菠萝蜜| 一区二区在线免费| 男女性色大片免费观看一区二区| 激情都市一区二区| 99免费精品在线观看| 欧美日韩精品一区二区三区四区 | eeuss鲁片一区二区三区在线观看| 91亚洲精品久久久蜜桃| 777xxx欧美| 国产日韩欧美a| 一区二区三区四区视频精品免费 | 久久亚洲一区二区三区明星换脸 | 中文字幕在线观看不卡视频| 伊人色综合久久天天| 免费成人在线观看视频| 懂色av中文一区二区三区| 在线日韩av片| 久久亚区不卡日本| 亚洲男同性视频| 久久精品久久久精品美女| 91在线码无精品| 欧美大片在线观看一区| 亚洲丝袜另类动漫二区| 热久久国产精品| 成人久久久精品乱码一区二区三区| 欧洲亚洲国产日韩| 亚洲色图在线播放| 麻豆精品一区二区综合av| 91视频在线观看免费| 亚洲精品在线观看网站| 亚洲午夜电影在线| 国产成人免费在线观看| 欧美日韩精品电影| 国产精品天干天干在线综合| 日本不卡高清视频| 91理论电影在线观看| 欧美精品一区二区蜜臀亚洲| 亚洲超碰97人人做人人爱| 成人深夜在线观看| 日韩欧美第一区| 亚洲一区二区三区小说| 99久久精品久久久久久清纯| 久久亚洲精精品中文字幕早川悠里| 亚洲444eee在线观看| 一本到一区二区三区| 国产精品无圣光一区二区| 久久99在线观看| 欧美男男青年gay1069videost | 免费成人在线观看视频| 欧美写真视频网站| 国产精品久久毛片| 亚洲精品免费在线| 国产美女视频一区| 欧美日韩一级二级| 亚洲一二三四久久| 成人午夜大片免费观看| 日韩一区二区免费视频| 日韩成人午夜电影| 97se亚洲国产综合在线| 久久久噜噜噜久久人人看| 亚洲理论在线观看| 91美女片黄在线| 久久精品亚洲麻豆av一区二区| 三级久久三级久久久| 91丝袜国产在线播放| 亚洲欧美韩国综合色| 国产成人精品综合在线观看| 日韩欧美成人一区二区| 亚洲自拍偷拍九九九| 欧美亚洲一区二区三区四区| 亚洲欧美在线视频观看| 成人性视频免费网站| 欧美tickling挠脚心丨vk| 麻豆免费精品视频| 日韩一级大片在线观看| 亚洲丶国产丶欧美一区二区三区| 欧美日韩卡一卡二| 亚洲一区二区三区四区在线 | 在线免费观看日韩欧美| 国产精品色哟哟| 久久国产免费看| 91精品国产综合久久久久| 夜夜精品视频一区二区| 色综合网站在线| 亚洲国产日韩在线一区模特 | 91在线国产福利| 国产精品伦一区| 99久久伊人网影院| 亚洲欧美影音先锋| 色婷婷久久综合| 精品无人码麻豆乱码1区2区| 久久精品一区二区三区四区| 国产美女久久久久| 亚洲欧美另类在线| 欧美专区亚洲专区| 五月综合激情日本mⅴ| 欧美午夜精品一区二区蜜桃| 性做久久久久久免费观看| 91麻豆精品国产91久久久使用方法 | 亚洲一二三四在线| 在线观看一区二区精品视频| 午夜精品久久久久影视|