Changeset 988 for vendor/current/source4/lib/samba3
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/lib/samba3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/lib/samba3/samba3.h
r414 r988 26 26 struct samr_Password *smbpasswd_gethexpwd(TALLOC_CTX *mem_ctx, const char *p); 27 27 char *smbpasswd_sethexpwd(TALLOC_CTX *mem_ctx, struct samr_Password *pwd, uint16_t acb_info); 28 uint16_t smbpasswd_decode_acb_info(const char *p);29 28 char *smbpasswd_encode_acb_info(TALLOC_CTX *mem_ctx, uint16_t acb_info); 30 29 -
vendor/current/source4/lib/samba3/smbpasswd.c
r414 r988 111 111 } 112 112 113 /*! Decode the account control bits (ACB) info from a string. */114 115 uint16_t smbpasswd_decode_acb_info(const char *p)116 {117 uint16_t acb_info = 0;118 bool finished = false;119 120 /*121 * Check if the account type bits have been encoded after the122 * NT password (in the form [NDHTUWSLXI]).123 */124 125 if (*p != '[') return 0;126 127 for (p++; *p && !finished; p++)128 {129 switch (*p) {130 case 'N': /* 'N'o password. */131 acb_info |= ACB_PWNOTREQ;132 break;133 case 'D': /* 'D'isabled. */134 acb_info |= ACB_DISABLED;135 break;136 case 'H': /* 'H'omedir required. */137 acb_info |= ACB_HOMDIRREQ;138 break;139 case 'T': /* 'T'emp account. */140 acb_info |= ACB_TEMPDUP;141 break;142 case 'U': /* 'U'ser account (normal). */143 acb_info |= ACB_NORMAL;144 break;145 case 'M': /* 'M'NS logon user account. What is this ? */146 acb_info |= ACB_MNS;147 break;148 case 'W': /* 'W'orkstation account. */149 acb_info |= ACB_WSTRUST;150 break;151 case 'S': /* 'S'erver account. */152 acb_info |= ACB_SVRTRUST;153 break;154 case 'L': /* 'L'ocked account. */155 acb_info |= ACB_AUTOLOCK;156 break;157 case 'X': /* No 'X'piry on password */158 acb_info |= ACB_PWNOEXP;159 break;160 case 'I': /* 'I'nterdomain trust account. */161 acb_info |= ACB_DOMTRUST;162 break;163 164 case ' ':165 break;166 case ':':167 case '\n':168 case ']':169 default:170 finished = true;171 break;172 }173 }174 175 return acb_info;176 }177 178 113 /*! Encode account control bits (ACBs) into a string. */ 179 114
Note:
See TracChangeset
for help on using the changeset viewer.