Lines Matching defs:si
110 smb_share_t si;
117 if ((status = smb_share_lookup(shr_name, &si)) == NERR_Success) {
118 if (si.shr_flags & SMB_SHRF_AUTOHOME)
119 status = smb_share_add(&si);
121 smb_share_free(&si);
132 bzero(&si, sizeof (smb_share_t));
133 si.shr_path = strdup(ai->ah_path);
134 si.shr_name = strdup(username);
135 si.shr_container = strdup(ai->ah_container);
137 if (si.shr_path == NULL || si.shr_name == NULL ||
138 si.shr_container == NULL) {
139 smb_share_free(&si);
143 if ((status = smb_autohome_parse_options(&si)) != ERROR_SUCCESS) {
144 smb_share_free(&si);
148 if (si.shr_cmnt == NULL) {
149 if ((si.shr_cmnt = strdup("Autohome")) == NULL) {
150 smb_share_free(&si);
155 (void) strsubst(si.shr_path, '\\', '/');
156 si.shr_flags |= SMB_SHRF_TRANS | SMB_SHRF_AUTOHOME;
157 si.shr_uid = uid;
158 si.shr_gid = gid;
159 si.shr_drive = 'B';
163 status = smb_share_add(&si);
164 smb_share_free(&si);
240 smb_autohome_info_t *si;
245 if ((si = smb_autohome_getinfo()) != 0) {
246 (void) fseek(si->fp, 0L, SEEK_SET);
247 si->lineno = 0;
251 if ((si = &smb_ai) == 0)
261 if ((si->fp = fopen(filename, "r")) == NULL)
264 si->magic1 = si;
265 si->magic2 = si;
266 si->lineno = 0;
277 smb_autohome_info_t *si;
279 if ((si = smb_autohome_getinfo()) != 0) {
280 (void) fclose(si->fp);
281 si->fp = 0;
282 si->magic1 = 0;
283 si->magic2 = 0;
298 smb_autohome_info_t *si;
301 if ((si = smb_autohome_getinfo()) == 0) {
304 if ((si = smb_autohome_getinfo()) == 0)
318 if (fgets(si->buf, SMB_AUTOHOME_BUFSIZ, si->fp) == 0)
321 ++si->lineno;
323 if ((bp = strpbrk(si->buf, "#\r\n")) != 0)
326 (void) trim_whitespace(si->buf);
327 bp = strcanon(si->buf, " \t");
330 (void) smb_autohome_keysub(name, si->buf, SMB_AUTOHOME_BUFSIZ);
331 return (smb_autohome_make_entry(si));
342 smb_autohome_make_entry(smb_autohome_info_t *si)
347 bp = si->buf;
350 si->argv[i] = NULL;
354 if ((si->argv[i] = strsep(&bp, " \t")) == NULL)
356 } while (*(si->argv[i]) == '\0');
358 if (si->argv[i] == NULL)
363 si->argv[i] = bp;
365 if ((si->autohome.ah_name = si->argv[0]) == NULL) {
373 if ((si->autohome.ah_path = si->argv[1]) == NULL)
374 si->autohome.ah_path = "";
376 if ((si->autohome.ah_container = si->argv[2]) == NULL)
377 si->autohome.ah_container = "";
379 return (&si->autohome);
432 smb_autohome_info_t *si;
434 if ((si = &smb_ai) == 0)
437 if ((si->magic1 == si) && (si->magic2 == si) && (si->fp != NULL))
438 return (si);
454 smb_autohome_parse_options(smb_share_t *si)
465 if (strlcpy(buf, si->shr_container, MAXPATHLEN) == 0)
468 for (argc = 1, bp = si->shr_container; *bp != '\0'; ++bp)
489 si->shr_container[0] = '\0';
490 bp = si->shr_container;
496 smb_autohome_setflag((value + 6), si, SMB_SHRF_CATIA);
501 smb_share_csc_option((value + 4), si);
506 smb_autohome_setflag((value + 4), si, SMB_SHRF_ABE);
511 if ((si->shr_cmnt = strdup(value + 12)) == NULL) {
519 if ((si->shr_access_rw = strdup(value + 3)) == NULL) {
527 if ((si->shr_access_ro = strdup(value + 3)) == NULL) {
535 if ((si->shr_access_none = strdup(value + 5)) == NULL) {
556 smb_autohome_setflag(const char *value, smb_share_t *si, uint32_t flag)
559 si->shr_flags |= flag;
561 si->shr_flags &= ~flag;