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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? wrapper.c

?? samba-3.0.22.tar.gz 編譯smb服務(wù)器的源碼
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/*    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");

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人一级片| 天天综合日日夜夜精品| 最新久久zyz资源站| 日韩一区日韩二区| 亚洲高清一区二区三区| 久久99久久99精品免视看婷婷 | 久久草av在线| gogogo免费视频观看亚洲一| 91九色最新地址| 成人性生交大片免费| 91蜜桃网址入口| 欧美中文字幕一区| 在线综合亚洲欧美在线视频| 欧美日韩一级大片网址| 欧美人妖巨大在线| 国产亚洲综合在线| 伊人色综合久久天天人手人婷| 五月激情综合色| 国产原创一区二区| 大白屁股一区二区视频| 色婷婷久久久综合中文字幕| 欧美一区二区免费视频| 国产精品久久久久久久久免费桃花 | 欧美视频完全免费看| 久久综合久久久久88| 亚洲日本在线a| 奇米精品一区二区三区在线观看| 欧美大片在线观看| 亚洲精品欧美激情| 成人综合日日夜夜| 91精品国产手机| 一区二区三区在线不卡| 国产乱子轮精品视频| 91福利精品视频| 亚洲天堂免费看| 国产xxx精品视频大全| 制服丝袜国产精品| 亚洲自拍另类综合| 成人一区二区三区| 精品国产1区二区| 国产麻豆欧美日韩一区| 精品国产凹凸成av人导航| 欧美中文字幕亚洲一区二区va在线 | 九九**精品视频免费播放| 色婷婷综合视频在线观看| 国产亚洲精品精华液| √…a在线天堂一区| 国产99久久久久| 国产精品久久久久久久久久免费看| aaa欧美大片| 亚洲视频在线一区二区| av一区二区三区| 国产欧美日韩视频在线观看| 国产又粗又猛又爽又黄91精品| 精品国产制服丝袜高跟| 国产一区二区剧情av在线| 欧美精品一区二区三区在线| 美女一区二区三区| 久久久.com| 91首页免费视频| 五月天久久比比资源色| 91精品国产综合久久精品麻豆| 午夜av电影一区| 26uuu亚洲| 波多野结衣中文字幕一区| 亚洲精品水蜜桃| 欧美一区二区三区日韩| 国模少妇一区二区三区| 国产精品素人视频| 色悠久久久久综合欧美99| 亚洲一区二区五区| 日韩视频永久免费| kk眼镜猥琐国模调教系列一区二区| 亚洲天天做日日做天天谢日日欢| 欧洲生活片亚洲生活在线观看| 久久国产精品99精品国产 | 在线亚洲免费视频| 国产一区二区在线免费观看| 亚洲人成精品久久久久久| 欧美久久久久久久久中文字幕| 老司机午夜精品| 国产日产欧美一区二区三区| 91.com视频| 成人午夜又粗又硬又大| 亚洲免费在线播放| 久久久www免费人成精品| 欧美伊人久久大香线蕉综合69| 国产精品一区三区| 青草国产精品久久久久久| 一色桃子久久精品亚洲| 精品国产一区a| 欧美日韩黄色一区二区| 91麻豆国产在线观看| 国产成人自拍在线| 久久精品国产成人一区二区三区 | 欧美成人官网二区| 欧美亚洲国产一区二区三区 | 国产成人午夜精品影院观看视频| 久久99九九99精品| 午夜精品久久久久久久99樱桃| 一区二区三区精密机械公司| 国产精品的网站| 国产精品国产三级国产aⅴ原创| 久久夜色精品一区| 日韩视频一区二区三区在线播放| 91超碰这里只有精品国产| 欧美亚日韩国产aⅴ精品中极品| 欧洲国内综合视频| 3d成人h动漫网站入口| 欧美日韩精品电影| 777亚洲妇女| 欧美一级艳片视频免费观看| 欧美日韩国产bt| 日韩亚洲欧美高清| 国产三级精品在线| 国产欧美日韩卡一| 亚洲色图.com| 午夜不卡av在线| 美女视频黄久久| 国产成人在线影院| 国产福利一区在线| 欧美成人video| 国产午夜精品一区二区三区视频| 2020国产精品| 亚洲黄色片在线观看| 日日摸夜夜添夜夜添国产精品 | 久久久久久电影| 国产欧美日韩精品在线| 亚洲精品中文在线| 免费看精品久久片| 91片黄在线观看| 欧美mv日韩mv国产网站app| 中文字幕亚洲在| 捆绑调教一区二区三区| 99久久精品费精品国产一区二区| 欧美久久久久久久久久| 精品第一国产综合精品aⅴ| 亚洲精品日韩综合观看成人91| 美女www一区二区| jlzzjlzz亚洲女人18| 5858s免费视频成人| 成人毛片在线观看| 91超碰这里只有精品国产| 1区2区3区国产精品| 国产成人午夜高潮毛片| 欧美一区二区三区在线视频| 一区二区三区日本| 国产成人aaa| 精品1区2区在线观看| 亚洲精品免费电影| 99久久夜色精品国产网站| 日韩午夜中文字幕| 五月天婷婷综合| 成人听书哪个软件好| 国产欧美一区二区在线| 日韩av中文字幕一区二区| 欧美午夜免费电影| 亚洲小少妇裸体bbw| 99久久伊人久久99| 亚洲日本在线a| 91在线视频播放| 国产精品乱人伦| 91国内精品野花午夜精品| 亚洲黄色小说网站| 欧美日韩在线播放| 日韩经典一区二区| 精品裸体舞一区二区三区| 久久精品国产**网站演员| 欧美高清视频不卡网| 日韩激情av在线| 久久一区二区三区四区| 成人激情免费网站| 日本一区二区成人| 99久久精品国产一区二区三区| 亚洲精品亚洲人成人网| 中文字幕久久午夜不卡| 国产成人精品网址| 亚洲愉拍自拍另类高清精品| 欧美一区二区大片| 成人免费三级在线| 天天色天天操综合| 中文字幕av不卡| 欧美色网一区二区| 国产成人精品影视| 亚洲一区二区三区四区不卡| 日韩三级av在线播放| 成人app软件下载大全免费| 亚洲电影你懂得| 亚洲欧美偷拍三级| 久久蜜桃av一区精品变态类天堂| 国产在线看一区| 免费在线观看不卡| 亚洲视频免费看| 国产丝袜欧美中文另类| 91久久精品日日躁夜夜躁欧美| 久久国内精品自在自线400部| 椎名由奈av一区二区三区| 欧美大片在线观看| 91精品国产综合久久福利软件 | 国产在线精品免费av|