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

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

?? vpopmail.c

?? 相當優秀的 UNIX 進程管理工具
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * $Id: vpopmail.c,v 1.28.2.4 2004/06/26 02:20:56 tomcollins Exp $ * Copyright (C) 2000-2002 Inter7 Internet Technologies, Inc. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <unistd.h>#include <string.h>#include <pwd.h>#include <sys/stat.h>#include <sys/types.h>#include <sys/wait.h>#ifdef HAVE_SYS_VARARGS_H#include <sys/varargs.h>#endif#include <signal.h>#include <ctype.h>#include <fcntl.h>#include <time.h>#include <dirent.h>#include <pwd.h>#include "config.h"#include "md5.h"#include "vpopmail.h"#include "file_lock.h"#include "vauth.h"#include "vlimits.h"#include "maildirquota.h"#define MAX_BUFF 256#ifdef POP_AUTH_OPEN_RELAY/* keep a output pipe to tcp.smtp file */int tcprules_fdm;static char relay_tempfile[MAX_BUFF];#endifint verrori = 0;extern int cdb_seek();/* Global Flags */int NoMakeIndex = 0;int OptimizeAddDomain = 0;#define PS_TOKENS " \t"#define CDB_TOKENS ":\n\r"#ifdef IP_ALIAS_DOMAINSint host_in_locals(char *domain);#endifstatic char gen_chars[] = "abcdefghijklmnopqrstuvwxyz" \                          "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \                          "0123456789.@!#%*";static char ok_env_chars[] = "abcdefghijklmnopqrstuvwxyz" \                            "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \                            "1234567890_-.@";/************************************************************************//*  * Add a domain to the email system * * input: domain name *        dir to put the files *        uid and gid to assign to the files */int vadddomain( char *domain, char *dir, uid_t uid, gid_t gid ){ FILE *fs; int i; char *domain_hash; char DomainSubDir[MAX_BUFF]; char dir_control_for_uid[MAX_BUFF]; char tmpbuf[MAX_BUFF]; char Dir[MAX_BUFF]; char calling_dir[MAX_BUFF];  /* we only do lower case */  lowerit(domain);  /* reject domain names that are too short to be valid */  if ( strlen( domain) <3) return (VA_INVALID_DOMAIN_NAME);  /* reject domain names that exceed our max permitted/storable size */  if ( strlen( domain ) >= MAX_PW_DOMAIN ) return(VA_DOMAIN_NAME_TOO_LONG);  /* check invalid email domain characters */  for(i=0;domain[i]!=0;++i) {    if (i == 0 && domain[i] == '-' ) return(VA_INVALID_DOMAIN_NAME);    if (isalnum((int)domain[i])==0 && domain[i]!='-' && domain[i]!='.') {      return(VA_INVALID_DOMAIN_NAME);    }  }  if ( domain[i-1] == '-' ) return(VA_INVALID_DOMAIN_NAME);  /* after the name is okay, check if it already exists */  if ( vget_assign(domain, NULL, 0, NULL, NULL ) != NULL ) {    return(VA_DOMAIN_ALREADY_EXISTS);  }   /* set our file creation mask for machines where the   * sysadmin has tightened default permissions   */  umask(VPOPMAIL_UMASK);  /* store the calling directory */  getcwd(calling_dir, sizeof(calling_dir));  /* go to the directory where our Domains dir is to be stored    * check for error and return error on error   */  if ( chdir(dir) != 0 ) return(VA_BAD_V_DIR);  /* go into the Domains subdir */  if ( chdir(DOMAINS_DIR) != 0 ) {    /* if it's not there, no problem, just try to create it */    if ( mkdir(DOMAINS_DIR, VPOPMAIL_DIR_MODE) != 0 ) {      chdir(calling_dir);      return(VA_CAN_NOT_MAKE_DOMAINS_DIR);    }    /*  set the permisions on our new Domains dir */    chown(DOMAINS_DIR,uid,gid);    /* now try moving into the Domains subdir again */    if ( chdir(DOMAINS_DIR) != 0 ) {      chdir(calling_dir);      return(VA_BAD_D_DIR);    }  }  /* since domains can be added under any /etc/passwd   * user, we have to create dir_control information   * for each user/domain combination   */  snprintf(dir_control_for_uid, sizeof(dir_control_for_uid),   "dom_%lu", (long unsigned)uid);  /* work out a subdir name for the domain    * Depending on how many domains we have, it may need to be hashed   */  open_big_dir(dir_control_for_uid, uid, gid);         domain_hash = next_big_dir(uid, gid);  close_big_dir(dir_control_for_uid, uid, gid);        if ( strlen(domain_hash) > 0 ) {    snprintf(DomainSubDir, sizeof(DomainSubDir), "%s/%s", domain_hash, domain);  } else {    snprintf(DomainSubDir,sizeof(DomainSubDir), "%s", domain);  }  /* Check to make sure length of the dir isnt going to exceed   * the maximum storable size   * We dont want to start creating dirs and putting entries in   * the assign file etc if the path is going to be too long   */  if (strlen(dir)+strlen(DOMAINS_DIR)+strlen(DomainSubDir) >= MAX_PW_DIR) {    /* back out of changes made so far */    dec_dir_control(dir_control_for_uid, uid, gid);    chdir(calling_dir);    return(VA_DIR_TOO_LONG);  }  /* Make the subdir for the domain */  if ( r_mkdir(DomainSubDir, uid, gid ) != 0 ) {    /* back out of changes made so far */    dec_dir_control(dir_control_for_uid, uid, gid);    chdir(calling_dir);    return(VA_COULD_NOT_MAKE_DOMAIN_DIR);  }    if ( chdir(DomainSubDir) != 0 ) {    /* back out of changes made so far */    vdelfiles(DomainSubDir);    dec_dir_control(dir_control_for_uid, uid, gid);    chdir(calling_dir);    return(VA_BAD_D_DIR);  }  /* create the .qmail-default file */  snprintf(tmpbuf, sizeof(tmpbuf), "%s/%s/%s/.qmail-default", dir, DOMAINS_DIR,     DomainSubDir);  if ( (fs = fopen(tmpbuf, "w+"))==NULL) {    /* back out of changes made so far */    chdir(dir); chdir(DOMAINS_DIR);    if (vdelfiles(DomainSubDir) != 0) {      fprintf(stderr, "Failed to delete directory tree :%s\n", DomainSubDir);    }    dec_dir_control(dir_control_for_uid, uid, gid);    chdir(calling_dir);    return(VA_COULD_NOT_OPEN_QMAIL_DEFAULT);  } else {    fprintf(fs, "| %s/bin/vdelivermail '' bounce-no-mailbox\n", VPOPMAILDIR);    fclose(fs);  }  /* create an entry in the assign file for our new domain */  snprintf(tmpbuf, sizeof(tmpbuf), "%s/%s/%s", dir, DOMAINS_DIR, DomainSubDir);  if (add_domain_assign( domain, domain, tmpbuf, uid, gid ) != 0) {    /* back out of changes made so far */    chdir(dir); chdir(DOMAINS_DIR);    if (vdelfiles(DomainSubDir) != 0) {      fprintf(stderr, "Failed to delete directory tree: %s\n", DomainSubDir);    }    dec_dir_control(dir_control_for_uid, uid, gid);    chdir(calling_dir);    fprintf (stderr, "Error. Failed to add domain to assign file\n");    return (VA_COULD_NOT_UPDATE_FILE);  }  /* recursively change ownership to new file system entries */  snprintf(tmpbuf, sizeof(tmpbuf), "%s/%s/%s", dir, DOMAINS_DIR, DomainSubDir);  r_chown(tmpbuf, uid, gid);  /* ask the authentication module to add the domain entry */  /* until now we checked if domain already exists in cdb and   * setup all dirs, but vauth_adddomain may __fail__ so we need to check   */  if (vauth_adddomain( domain ) != VA_SUCCESS ) {    /* ok we have run into problems here. adding domain to auth backend failed     * so now we need to reverse the steps we have already performed above      */    fprintf(stderr, "Error. Failed while attempting to add domain to auth backend\n");    chdir(dir); chdir(DOMAINS_DIR);        if (vdelfiles(DomainSubDir) != 0) {      fprintf(stderr, "Failed to delete directory tree: %s\n", DomainSubDir);    }    dec_dir_control(dir_control_for_uid, uid, gid);    vget_assign(domain, Dir, sizeof(Dir), &uid, &gid );    if ( del_domain_assign(domain, domain, Dir, uid, gid) != 0) {      fprintf(stderr, "Failed while attempting to remove domain from assign file\n");    }    if (del_control(domain) !=0) {      fprintf(stderr, "Failed while attempting to delete domain from the qmail control files\n");    }    if (vdel_dir_control(domain) != 0) {      fprintf (stderr, "Failed while attempting to delete domain from dir_control\n");    }    /* send a HUP signal to qmail-send process to reread control files */    signal_process("qmail-send", SIGHUP);    return (VA_NO_AUTH_CONNECTION);  }	   /* ask qmail to re-read it's new control files */  if ( OptimizeAddDomain == 0 ) {    signal_process("qmail-send", SIGHUP);  }  /* return back to the callers directory and return success */  chdir(calling_dir);  return(VA_SUCCESS);}/************************************************************************//* Delete a domain from the entire mail system * * If we have problems at any of the following steps, it has been  * decided that the best course of action is to continue rather than * abort. The idea behind this is to allow the removal of a partially * installed domain. We will emit warnings should any of the expected * cleanup steps fail. */int vdeldomain( char *domain ){ struct stat statbuf; char Dir[MAX_BUFF]; char domain_to_del[MAX_BUFF]; char dircontrol[MAX_BUFF]; uid_t uid; gid_t gid;  /* we always convert domains to lower case */  lowerit(domain);  /* Check the length of the domain to del   * If it exceeds the max storable size,    * then the user has made some sort of error in    * asking to del that domain, because such a domain   * wouldnt be able to exist in the 1st place   */  if (strlen(domain) >= MAX_PW_DOMAIN) return (VA_DOMAIN_NAME_TOO_LONG);  /* now we want to check a couple for things :   * a) if the domain to del exists in the system   * b) if the domain to del is an aliased domain or not   */  /* Take a backup of the domain we want to del,   * because when we call vget_assign, if the domain   * is an alias, then the domain parameter will be   * rewritten on return as the name of the real domain   */  snprintf(domain_to_del, sizeof(domain_to_del), "%s", domain);  /* check if the domain exists. If so extract the dir, uid, gid */  if (vget_assign(domain, Dir, sizeof(Dir), &uid, &gid ) == NULL) {    return(VA_DOMAIN_DOES_NOT_EXIST);  }  /* if this is an NOT aliased domain....   * (aliased domains dont have any filestructure of their own)   */  if ( strcmp(domain_to_del, domain) == 0 ) {    /* check if the domain's dir exists */    if ( stat(Dir, &statbuf) != 0 ) {      fprintf(stderr, "Warning: Could not access (%s)\n",Dir);    }    /*     * Michael Bowe 23rd August 2003     *     * at this point, we need to write some code to check if any alias domains     * point to this (real) domain. If we find such aliases, then I guess we     * have a couple of options :     * 1. Abort with an error, saying cant delete domain until all     *    aliases are removed 1st (list them)     * 2. Zap all the aliases in additon to this domain     *     */    /* call the auth module to delete the domain from the storage */    /* Note !! We must del domain from auth module __before__ we delete it from     * fs, because deletion from auth module may fail !!!!     */    /* del a domain from the auth backend which includes :     * - drop the domain's table, or del all users from users table     * - delete domain's entries from lastauth table     * - delete domain's limit's entries     */    if (vauth_deldomain(domain) != VA_SUCCESS ) {      fprintf (stderr, "Warning: Failed while attempting to delete domain from auth backend\n");    }    /* vdel_limits does the following :     * If we have mysql_limits enabled,     *  it will delete the domain's entries from the limits table     * Or if we arent using mysql_limits,     *  it will delete the .qmail-admin file from the domain's dir     *     * Note there are inconsistencies in the auth backends.  Some     * will run vdel_limits() in vauth_deldomain(), others don't.     * For now, we always run it to be safe.  Ultimately, the auth     * backends should to be updated to do this.     */      vdel_limits(domain);    /* delete the dir control info for this domain */    if (vdel_dir_control(domain) != 0) {      fprintf (stderr, "Warning: Failed to delete dir_control for %s\n", domain);    }    /* Now remove domain from filesystem */    /* if it's a symbolic link just remove the link */    if ( S_ISLNK(statbuf.st_mode) ) {      if ( unlink(Dir) !=0) {        fprintf (stderr, "Warning: Failed to remove symlink for %s\n", domain);      }    } else {      char cwdbuff[MAX_BUFF];      char *cwd;      /* Not a symlink.. so we have to del some files structure now */      /* zap the domain's directory tree */      cwd = getcwd (cwdbuff, sizeof(cwdbuff));  /* save calling directory */      if ( vdelfiles(Dir) != 0 ) {        fprintf(stderr, "Warning: Failed to delete directory tree: %s\n", domain);      }      if (cwd != NULL) chdir (cwd);    }    /* decrement the master domain control info */    snprintf(dircontrol, sizeof(dircontrol), "dom_%lu", (long unsigned)uid);    dec_dir_control(dircontrol, uid, gid);  }  /* The following things need to happen for real and aliased domains */  /* delete the email domain from the qmail control files :   * rcpthosts, morercpthosts, virtualdomains   */  if (del_control(domain_to_del) != 0) {    fprintf (stderr, "Warning: Failed to delete domain from qmail's control files\n");  }  /* delete the assign file line */  if (del_domain_assign(domain_to_del, domain, Dir, uid, gid) != 0) {    fprintf (stderr, "Warning: Failed to delete domain from the assign file\n");  }  /* send a HUP signal to qmail-send process to reread control files */  signal_process("qmail-send", SIGHUP);  return(VA_SUCCESS);}/************************************************************************//* * Add a virtual domain user */int vadduser( char *username, char *domain, char *password, char *gecos,               int apop ){ char Dir[MAX_BUFF]; char *user_hash; char calling_dir [MAX_BUFF]; uid_t uid = VPOPMAILUID; gid_t gid = VPOPMAILGID; struct vlimits limits; char quota[50];  /* check gecos for : characters - bad */  if ( strchr(gecos,':')!=0) return(VA_BAD_CHAR);  if ( strlen(username) >= MAX_PW_NAME ) return(VA_USER_NAME_TOO_LONG);#ifdef USERS_BIG_DIR  if ( strlen(username) == 1 ) return(VA_ILLEGAL_USERNAME);#endif  if ( strlen(domain) >= MAX_PW_DOMAIN ) return(VA_DOMAIN_NAME_TOO_LONG);  if ( strlen(domain) < 3) return(VA_INVALID_DOMAIN_NAME);  if ( strlen(password) >= MAX_PW_CLEAR_PASSWD ) return(VA_PASSWD_TOO_LONG);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
伊人婷婷欧美激情| 国产激情视频一区二区在线观看| 免费成人在线影院| a美女胸又www黄视频久久| 51午夜精品国产| 亚洲中国最大av网站| 粉嫩蜜臀av国产精品网站| 欧美巨大另类极品videosbest | 国产一区二三区| 91久久精品一区二区三区| 337p日本欧洲亚洲大胆精品| 亚洲高清免费观看高清完整版在线观看 | 在线亚洲+欧美+日本专区| 欧美精品一区二区久久婷婷| 首页综合国产亚洲丝袜| 色一情一伦一子一伦一区| 国产亚洲欧洲997久久综合 | 久久精品人人做| 麻豆国产欧美日韩综合精品二区| 欧美亚洲国产一区在线观看网站| 欧美国产精品久久| 国产一区二区三区久久悠悠色av| 欧美精选午夜久久久乱码6080| 亚洲码国产岛国毛片在线| 白白色 亚洲乱淫| 国产精品每日更新在线播放网址| 国产乱对白刺激视频不卡| 欧美v亚洲v综合ⅴ国产v| 日本在线不卡视频| 91精品国产麻豆| 日本午夜精品视频在线观看| 91精品中文字幕一区二区三区| 亚洲成人手机在线| 欧美肥大bbwbbw高潮| 午夜欧美在线一二页| 欧美人狂配大交3d怪物一区| 亚洲成av人片观看| 欧美一级片在线看| 久久国产婷婷国产香蕉| 精品国免费一区二区三区| 国产最新精品精品你懂的| 国产日韩视频一区二区三区| 成人午夜激情片| 一区二区三区在线免费播放| 欧美绝品在线观看成人午夜影视| 日韩av中文字幕一区二区| 精品国产免费久久| 大白屁股一区二区视频| 亚洲精品国产高清久久伦理二区| 欧美伊人久久久久久午夜久久久久| 亚洲国产成人高清精品| 欧美一级日韩不卡播放免费| 国产一区二区三区久久久| 国产精品久久久久天堂| 欧洲亚洲国产日韩| 精品一区二区三区在线观看国产| 久久久综合九色合综国产精品| 国产成人福利片| 一区二区不卡在线视频 午夜欧美不卡在 | 一区二区三区不卡在线观看| 91麻豆精品久久久久蜜臀| 黑人精品欧美一区二区蜜桃| 国产精品女人毛片| 欧美日本精品一区二区三区| 国产精品一区二区久久不卡 | 91蜜桃视频在线| 日韩极品在线观看| 国产精品久久久久9999吃药| 欧美日韩国产在线播放网站| 国产剧情一区二区三区| 一区二区三区欧美久久| 欧美成人精品福利| 91丨九色丨尤物| 麻豆成人av在线| 亚洲精品乱码久久久久久久久 | 99综合电影在线视频| 午夜视频在线观看一区二区三区| www国产精品av| 在线免费视频一区二区| 国产成人午夜视频| 日本特黄久久久高潮| 亚洲色图欧美激情| 久久婷婷一区二区三区| 欧美日韩国产在线播放网站| 白白色亚洲国产精品| 国产一区二区三区综合| 亚洲国产aⅴ成人精品无吗| 国产日本欧洲亚洲| 日韩欧美综合一区| 欧美一a一片一级一片| 成人av电影免费观看| 六月丁香婷婷久久| 日本视频中文字幕一区二区三区| 最新久久zyz资源站| 久久精品夜色噜噜亚洲aⅴ| 91精品欧美福利在线观看| 91麻豆自制传媒国产之光| 国产成人免费网站| 国产美女久久久久| 精品亚洲欧美一区| 美女视频一区二区| 蜜乳av一区二区| 奇米精品一区二区三区四区| 亚洲最大成人网4388xx| 中文字幕亚洲欧美在线不卡| 久久色在线观看| 亚洲精品一区二区三区影院| 日韩欧美在线1卡| 日本韩国欧美在线| 美腿丝袜亚洲三区| 亚洲与欧洲av电影| 一区二区三区丝袜| 亚洲一区在线观看视频| 亚洲人成在线播放网站岛国| 中文字幕在线不卡一区| 中文字幕在线不卡国产视频| 国产精品大尺度| 亚洲精品福利视频网站| 一区二区三区国产精华| 婷婷综合久久一区二区三区| 日日摸夜夜添夜夜添国产精品| 男女男精品网站| 国产乱国产乱300精品| 国产v日产∨综合v精品视频| 成人免费不卡视频| 色综合中文综合网| 热久久免费视频| 日本午夜一区二区| 久久99精品久久久久久动态图| 精品乱人伦一区二区三区| 日韩欧美二区三区| 久久先锋影音av鲁色资源网| 国产视频一区在线播放| 欧美激情一区二区三区蜜桃视频| 国产精品私房写真福利视频| 成人欧美一区二区三区黑人麻豆 | 国产精品久久久久久久蜜臀| 综合在线观看色| 亚洲国产精品麻豆| 99国产精品久久久久久久久久久| a美女胸又www黄视频久久| 欧洲亚洲精品在线| 欧美成人一区二区三区在线观看| 精品电影一区二区三区| 国产精品久久久久久妇女6080| 亚洲一二三四区不卡| 美女视频黄频大全不卡视频在线播放| 久久国产精品72免费观看| 欧美日韩国产在线观看| 日韩免费高清电影| 夜夜精品浪潮av一区二区三区| 亚洲福中文字幕伊人影院| 免费观看一级特黄欧美大片| 国产不卡在线播放| 欧美裸体bbwbbwbbw| 久久蜜臀中文字幕| 亚洲一本大道在线| 国产高清亚洲一区| 欧美精选一区二区| 中文字幕亚洲成人| 裸体歌舞表演一区二区| 91麻豆产精品久久久久久 | 国产成人综合视频| 欧美三级日韩三级| 中文字幕色av一区二区三区| 男女男精品网站| 欧洲人成人精品| 亚洲欧美综合在线精品| 国产呦精品一区二区三区网站| 欧亚洲嫩模精品一区三区| 中文字幕国产一区| 久久99九九99精品| 欧美嫩在线观看| 亚洲一区二区三区四区在线免费观看 | 久久综合九色综合欧美就去吻| 中文字幕视频一区二区三区久| 毛片av一区二区三区| 在线欧美小视频| 中文字幕在线不卡一区二区三区| 激情五月播播久久久精品| 欧美视频三区在线播放| **网站欧美大片在线观看| 国产一区视频在线看| 欧美一区二区免费视频| 亚洲国产日产av| 色综合久久88色综合天天6| 中文字幕欧美国产| 国产精品一线二线三线| 日韩欧美在线不卡| 蜜臀av性久久久久av蜜臀妖精| 欧洲精品中文字幕| 亚洲精品一卡二卡| 99re这里只有精品视频首页| 久久精品欧美一区二区三区不卡 | 欧美高清一级片在线| 亚洲精品视频一区二区| 日韩视频免费观看高清完整版| 欧美影院一区二区| 26uuu精品一区二区三区四区在线| 日韩国产欧美三级|