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

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

?? qmail-pw2u.c

?? linux下qmail的源碼 本人加了一些注釋
?? C
字號:
//將UNIX系統的用戶id和密碼轉換成qmail-newn能用的一個表結構

#include <sys/types.h>#include <sys/stat.h>#include "substdio.h"#include "readwrite.h"#include "subfd.h"#include "sgetopt.h"#include "control.h"#include "constmap.h"#include "stralloc.h"#include "fmt.h"#include "str.h"#include "scan.h"#include "open.h"#include "error.h"#include "getln.h"#include "auto_break.h"#include "auto_qmail.h"#include "auto_usera.h"void die_chdir(){  substdio_putsflush(subfderr,"qmail-pw2u: fatal: unable to chdir\n");  _exit(111);}void die_nomem(){  substdio_putsflush(subfderr,"qmail-pw2u: fatal: out of memory\n");  _exit(111);}void die_read(){  substdio_putsflush(subfderr,"qmail-pw2u: fatal: unable to read input\n");  _exit(111);}void die_write(){  substdio_putsflush(subfderr,"qmail-pw2u: fatal: unable to write output\n");  _exit(111);}void die_control(){  substdio_putsflush(subfderr,"qmail-pw2u: fatal: unable to read controls\n");  _exit(111);}void die_alias(){  substdio_puts(subfderr,"qmail-pw2u: fatal: unable to find ");  substdio_puts(subfderr,auto_usera);  substdio_puts(subfderr," user\n");  substdio_flush(subfderr);  _exit(111);}void die_home(fn) char *fn;{  substdio_puts(subfderr,"qmail-pw2u: fatal: unable to stat ");  substdio_puts(subfderr,fn);  substdio_puts(subfderr,"\n");  substdio_flush(subfderr);  _exit(111);}void die_user(s,len) char *s; unsigned int len;{  substdio_puts(subfderr,"qmail-pw2u: fatal: unable to find ");  substdio_put(subfderr,s,len);  substdio_puts(subfderr," user for subuser\n");  substdio_flush(subfderr);  _exit(111);}char *dashcolon = "-:";int flagalias = 0;int flagnoupper = 1;int homestrategy = 2;/* 2: skip if home does not exist; skip if home is not owned by user *//* 1: stop if home does not exist; skip if home is not owned by user *//* 0: don't worry about home */int okincl; stralloc incl = {0}; struct constmap mapincl;int okexcl; stralloc excl = {0}; struct constmap mapexcl;int okmana; stralloc mana = {0}; struct constmap mapmana;stralloc allusers = {0}; struct constmap mapuser;stralloc uugh = {0};stralloc user = {0};stralloc uidstr = {0};stralloc gidstr = {0};stralloc home = {0};unsigned long uid;stralloc line = {0};void doaccount(){  struct stat st;  int i;  char *mailnames;  char *x;  unsigned int xlen;  if (byte_chr(line.s,line.len,'\0') < line.len) return;  x = line.s; xlen = line.len; i = byte_chr(x,xlen,':'); if (i == xlen) return;  if (!stralloc_copyb(&user,x,i)) die_nomem();  if (!stralloc_0(&user)) die_nomem();  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  if (!stralloc_copyb(&uidstr,x,i)) die_nomem();  if (!stralloc_0(&uidstr)) die_nomem();  scan_ulong(uidstr.s,&uid);  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  if (!stralloc_copyb(&gidstr,x,i)) die_nomem();  if (!stralloc_0(&gidstr)) die_nomem();  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  if (!stralloc_copyb(&home,x,i)) die_nomem();  if (!stralloc_0(&home)) die_nomem();  if (!uid) return;  if (flagnoupper)    for (i = 0;i < user.len;++i)      if ((user.s[i] >= 'A') && (user.s[i] <= 'Z'))	return;  if (okincl)    if (!constmap(&mapincl,user.s,user.len - 1))      return;  if (okexcl)    if (constmap(&mapexcl,user.s,user.len - 1))      return;  if (homestrategy) {    if (stat(home.s,&st) == -1) {      if (errno != error_noent) die_home(home.s);      if (homestrategy == 1) die_home(home.s);      return;    }    if (st.st_uid != uid) return;  }  if (!stralloc_copys(&uugh,":")) die_nomem();  if (!stralloc_cats(&uugh,user.s)) die_nomem();  if (!stralloc_cats(&uugh,":")) die_nomem();  if (!stralloc_cats(&uugh,uidstr.s)) die_nomem();  if (!stralloc_cats(&uugh,":")) die_nomem();  if (!stralloc_cats(&uugh,gidstr.s)) die_nomem();  if (!stralloc_cats(&uugh,":")) die_nomem();  if (!stralloc_cats(&uugh,home.s)) die_nomem();  if (!stralloc_cats(&uugh,":")) die_nomem();  /* XXX: avoid recording in allusers unless sub actually needs it */  if (!stralloc_cats(&allusers,user.s)) die_nomem();  if (!stralloc_cats(&allusers,":")) die_nomem();  if (!stralloc_catb(&allusers,uugh.s,uugh.len)) die_nomem();  if (!stralloc_0(&allusers)) die_nomem();  if (str_equal(user.s,auto_usera)) {    if (substdio_puts(subfdout,"+") == -1) die_write();    if (substdio_put(subfdout,uugh.s,uugh.len) == -1) die_write();    if (substdio_puts(subfdout,dashcolon) == -1) die_write();    if (substdio_puts(subfdout,":\n") == -1) die_write();    flagalias = 1;  }  mailnames = 0;  if (okmana)    mailnames = constmap(&mapmana,user.s,user.len - 1);  if (!mailnames)    mailnames = user.s;  for (;;) {    while (*mailnames == ':') ++mailnames;    if (!*mailnames) break;    i = str_chr(mailnames,':');    if (substdio_puts(subfdout,"=") == -1) die_write();    if (substdio_put(subfdout,mailnames,i) == -1) die_write();    if (substdio_put(subfdout,uugh.s,uugh.len) == -1) die_write();    if (substdio_puts(subfdout,"::\n") == -1) die_write();      if (*auto_break) {      if (substdio_puts(subfdout,"+") == -1) die_write();      if (substdio_put(subfdout,mailnames,i) == -1) die_write();      if (substdio_put(subfdout,auto_break,1) == -1) die_write();      if (substdio_put(subfdout,uugh.s,uugh.len) == -1) die_write();      if (substdio_puts(subfdout,dashcolon) == -1) die_write();      if (substdio_puts(subfdout,":\n") == -1) die_write();    }    mailnames += i;  }}stralloc sub = {0};void dosubuser(){  int i;  char *x;  unsigned int xlen;  char *uugh;  x = line.s; xlen = line.len; i = byte_chr(x,xlen,':'); if (i == xlen) return;  if (!stralloc_copyb(&sub,x,i)) die_nomem();  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  uugh = constmap(&mapuser,x,i);  if (!uugh) die_user(x,i);  ++i; x += i; xlen -= i; i = byte_chr(x,xlen,':'); if (i == xlen) return;  if (substdio_puts(subfdout,"=") == -1) die_write();  if (substdio_put(subfdout,sub.s,sub.len) == -1) die_write();  if (substdio_puts(subfdout,uugh) == -1) die_write();  if (substdio_puts(subfdout,dashcolon) == -1) die_write();  if (substdio_put(subfdout,x,i) == -1) die_write();  if (substdio_puts(subfdout,":\n") == -1) die_write();  if (*auto_break) {    if (substdio_puts(subfdout,"+") == -1) die_write();    if (substdio_put(subfdout,sub.s,sub.len) == -1) die_write();    if (substdio_put(subfdout,auto_break,1) == -1) die_write();    if (substdio_puts(subfdout,uugh) == -1) die_write();    if (substdio_puts(subfdout,dashcolon) == -1) die_write();    if (substdio_put(subfdout,x,i) == -1) die_write();    if (substdio_puts(subfdout,"-:\n") == -1) die_write();  }}int fd;substdio ss;char ssbuf[SUBSTDIO_INSIZE];void main(argc,argv)int argc;char **argv;{  int opt;  int match;  while ((opt = getopt(argc,argv,"/ohHuUc:C")) != opteof)    switch(opt) {      case '/': dashcolon = "-/:"; break;      case 'o': homestrategy = 2; break;      case 'h': homestrategy = 1; break;      case 'H': homestrategy = 0; break;      case 'u': flagnoupper = 0; break;      case 'U': flagnoupper = 1; break;      case 'c': *auto_break = *optarg; break;      case 'C': *auto_break = 0; break;      case '?':      default:	_exit(100);    }  if (chdir(auto_qmail) == -1) die_chdir();  /* no need for control_init() */  okincl = control_readfile(&incl,"users/include",0);  if (okincl == -1) die_control();  if (okincl) if (!constmap_init(&mapincl,incl.s,incl.len,0)) die_nomem();  okexcl = control_readfile(&excl,"users/exclude",0);  if (okexcl == -1) die_control();  if (okexcl) if (!constmap_init(&mapexcl,excl.s,excl.len,0)) die_nomem();  okmana = control_readfile(&mana,"users/mailnames",0);  if (okmana == -1) die_control();  if (okmana) if (!constmap_init(&mapmana,mana.s,mana.len,1)) die_nomem();  if (!stralloc_copys(&allusers,"")) die_nomem();  for (;;) {    if (getln(subfdin,&line,&match,'\n') == -1) die_read();    doaccount();    if (!match) break;  }  if (!flagalias) die_alias();  fd = open_read("users/subusers");  if (fd == -1) {    if (errno != error_noent) die_control();  }  else {    substdio_fdbuf(&ss,read,fd,ssbuf,sizeof(ssbuf));    if (!constmap_init(&mapuser,allusers.s,allusers.len,1)) die_nomem();    for (;;) {      if (getln(&ss,&line,&match,'\n') == -1) die_read();      dosubuser();      if (!match) break;    }    close(fd);  }  fd = open_read("users/append");  if (fd == -1) {    if (errno != error_noent) die_control();  }  else {    substdio_fdbuf(&ss,read,fd,ssbuf,sizeof(ssbuf));    for (;;) {      if (getln(&ss,&line,&match,'\n') == -1) die_read();      if (substdio_put(subfdout,line.s,line.len) == -1) die_write();      if (!match) break;    }  }  if (substdio_puts(subfdout,".\n") == -1) die_write();  if (substdio_flush(subfdout) == -1) die_write();  _exit(0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本色道a无线码一区v| 久久精品国产**网站演员| 欧美图区在线视频| 久久国产精品72免费观看| 国产欧美日韩卡一| 欧洲一区二区三区免费视频| 亚洲一区在线电影| 久久久综合激的五月天| 色婷婷av一区二区| 经典三级在线一区| 亚洲综合偷拍欧美一区色| 精品国产乱码久久久久久浪潮 | 亚洲一区自拍偷拍| 欧美男人的天堂一二区| 高清不卡一区二区| 蜜桃91丨九色丨蝌蚪91桃色| 中文字幕亚洲区| 亚洲精品在线观看视频| 欧美午夜一区二区| 成人午夜精品一区二区三区| 天堂资源在线中文精品| 久久久亚洲欧洲日产国码αv| 一本色道综合亚洲| 成人在线综合网| 日韩av不卡在线观看| 亚洲免费三区一区二区| 精品福利av导航| 欧美精品成人一区二区三区四区| 五月综合激情网| 国产精品免费网站在线观看| 国产亚洲成年网址在线观看| 亚洲精品一区二区三区四区高清| 日韩欧美国产三级| 欧美一区二区三区免费视频 | 午夜精品久久久久久久久| 18成人在线观看| 国产精品卡一卡二| 亚洲色图制服丝袜| 亚洲婷婷在线视频| 亚洲天堂成人在线观看| 国产精品久久久久天堂| 国产精品盗摄一区二区三区| 国产精品美女一区二区| 亚洲三级电影全部在线观看高清| 亚洲情趣在线观看| 亚洲综合免费观看高清在线观看| 亚洲乱码国产乱码精品精98午夜| 一区二区三区中文在线| 亚洲图片欧美视频| 日本亚洲天堂网| 国内精品久久久久影院薰衣草| 国产精品一二三在| 成人性生交大片| 99精品视频在线播放观看| 在线观看av一区| 91精品国产麻豆国产自产在线| 欧美一区二区三区四区五区| 欧美精品一区二区三区很污很色的| 久久综合九色综合97婷婷女人| 国产性做久久久久久| 国产精品嫩草影院com| 怡红院av一区二区三区| 天天色图综合网| 国产99一区视频免费| 色噜噜狠狠成人网p站| 欧美二区三区的天堂| 久久久一区二区三区捆绑**| 亚洲视频一二三区| 日本在线播放一区二区三区| 国产精品18久久久久久vr| 97久久超碰国产精品电影| 欧美三级在线视频| 久久精子c满五个校花| 亚洲视频在线一区观看| 日产欧产美韩系列久久99| 国产91丝袜在线播放| 欧美三级韩国三级日本一级| 精品国产一区二区三区不卡| 成人免费在线播放视频| 日本特黄久久久高潮| 不卡的av网站| 欧美一区二区三区在线观看视频| 中文字幕 久热精品 视频在线| 一区二区三区在线看| 国产在线精品免费| 欧美午夜宅男影院| 中文av一区二区| 午夜一区二区三区在线观看| 成人夜色视频网站在线观看| 在线播放日韩导航| 国产精品二三区| 久久99久久99| 在线观看91视频| 国产精品视频一二| 免费在线一区观看| 在线视频一区二区免费| 26uuu亚洲| 亚洲成人免费在线| 91视频国产观看| 久久蜜桃香蕉精品一区二区三区| 亚洲午夜一二三区视频| 成熟亚洲日本毛茸茸凸凹| 欧美大尺度电影在线| 亚洲一区在线观看视频| 99在线精品一区二区三区| 精品久久久久av影院| 亚洲二区在线视频| 99久久国产综合精品色伊| 日韩精品一区二区三区三区免费| 一区二区三区91| 成人动漫一区二区在线| 久久综合九色综合97婷婷| 日日欢夜夜爽一区| 欧美在线一二三| 伊人色综合久久天天| 波多野结衣亚洲| 欧美极品少妇xxxxⅹ高跟鞋| 韩国三级中文字幕hd久久精品| 欧美一区二区三区色| 首页国产欧美久久| 欧美日韩不卡一区二区| 一区二区三区日韩欧美精品 | 日韩视频免费观看高清在线视频| 亚洲国产成人porn| 欧洲生活片亚洲生活在线观看| 亚洲特级片在线| 一本到不卡精品视频在线观看| 国产精品久久久久久亚洲毛片| 国产91精品一区二区| 久久久91精品国产一区二区精品| 黑人巨大精品欧美一区| 337p粉嫩大胆噜噜噜噜噜91av| 久久av中文字幕片| 26uuu亚洲综合色欧美| 国模冰冰炮一区二区| 亚洲精品在线免费播放| 国内精品免费在线观看| 国产丝袜在线精品| 懂色av一区二区夜夜嗨| 国产精品欧美综合在线| 成人精品视频网站| 国产精品国模大尺度视频| 91一区二区在线观看| 亚洲精选免费视频| 欧美日韩国产欧美日美国产精品| 日本视频一区二区| 日韩免费电影网站| 国产成人精品一区二区三区四区 | 91亚洲精品乱码久久久久久蜜桃| 中文字幕在线不卡国产视频| 91蜜桃在线观看| 亚洲一区在线观看视频| 欧美一级一级性生活免费录像| 国内久久婷婷综合| 国产亚洲一区字幕| 成人精品电影在线观看| 中文字幕一区二区三区在线播放| 91麻豆免费视频| 午夜视频一区二区三区| 精品国产91洋老外米糕| 成人爱爱电影网址| 亚洲国产精品人人做人人爽| 欧美一二三区在线| eeuss鲁一区二区三区| 色婷婷狠狠综合| 亚洲丰满少妇videoshd| 日韩欧美高清在线| gogo大胆日本视频一区| 午夜精品视频一区| 精品国产免费一区二区三区四区 | 天天影视色香欲综合网老头| 精品国产免费一区二区三区香蕉| 成人av先锋影音| 午夜精品久久久久影视| 国产拍欧美日韩视频二区| 在线精品视频一区二区| 久久福利视频一区二区| 亚洲人成电影网站色mp4| 91精品国产入口| 97久久精品人人澡人人爽| 蜜桃91丨九色丨蝌蚪91桃色| 国产精品久久久久影院色老大| 7777精品伊人久久久大香线蕉的| 国产成人午夜高潮毛片| 日韩黄色在线观看| 最新热久久免费视频| 日韩午夜中文字幕| 91在线视频网址| 国产乱码精品一区二区三区忘忧草| 亚洲自拍偷拍网站| 国产精品嫩草久久久久| 欧美一区二区三区电影| 色综合欧美在线| 国产传媒日韩欧美成人| 免费观看一级欧美片| 自拍偷拍亚洲综合| 午夜久久福利影院| 国内外精品视频| 视频一区二区国产| 1024成人网|