Lines Matching refs:pn

363 	pathname_t	pn, rpn, upn, link_pn;
396 (void) pn_alloc(&pn);
423 if ((err = pn_set(&pn, namep)) != 0)
427 err = smb_pathname_lookup(&pn, &rpn, local_flags,
445 if ((err = pn_set(&pn, namep)) != 0)
449 err = smb_pathname_lookup(&pn, &rpn, local_flags,
509 namep = pn.pn_path;
551 (void) pn_free(&pn);
563 smb_pathname_lookup(pathname_t *pn, pathname_t *rpn, int flags,
573 err = lookuppnvp(pn, rpn, flags, NULL, vp, rootvp, dvp, cred);
632 pathname_t pn;
639 (void) pn_alloc(&pn);
641 if (pn_set(&pn, path) == 0) {
647 if (lookuppnvp(&pn, NULL, lookup_flags, NULL, &vp,
649 pn_free(&pn);
654 pn_free(&pn);
665 * Populate pn structure elements with the individual elements
666 * of pn->pn_path. pn->pn_sname will contain the whole stream name
671 * If any other element is missing the pointer in pn will be NULL.
674 smb_pathname_init(smb_request_t *sr, smb_pathname_t *pn, char *path)
679 bzero(pn, sizeof (smb_pathname_t));
680 pn->pn_path = smb_pathname_strdup(sr, path);
682 smb_pathname_preprocess(sr, pn);
684 /* parse pn->pn_path into its constituent parts */
685 pname = pn->pn_path;
686 fname = strrchr(pn->pn_path, '\\');
690 pn->pn_pname = NULL;
693 pn->pn_pname =
700 pn->pn_pname = NULL;
704 pn->pn_fname = NULL;
709 pn->pn_fname = smb_pathname_strdup(sr, fname);
722 pn->pn_fname =
727 pn->pn_sname = smb_pathname_strdup(sr, sname);
728 pn->pn_stype = strchr(pn->pn_sname + 1, ':');
729 if (pn->pn_stype) {
730 (void) smb_strupr(pn->pn_stype);
732 len = strlen(pn->pn_sname);
733 pn->pn_sname = smb_pathname_strcat(sr, pn->pn_sname, ":$DATA");
734 pn->pn_stype = pn->pn_sname + len;
736 ++pn->pn_stype;
742 * Perform common pre-processing of pn->pn_path:
751 smb_pathname_preprocess(smb_request_t *sr, smb_pathname_t *pn)
756 if (strlen(pn->pn_path) == 0) {
757 pn->pn_path = smb_pathname_strdup(sr, "\\");
762 smb_convert_wildcards(pn->pn_path);
765 (void) strsubst(pn->pn_path, '/', '\\');
767 (void) strcanon(pn->pn_path, "\\");
770 p = pn->pn_path + strlen(pn->pn_path) - 1;
771 if ((p != pn->pn_path) && (*p == '\\'))
774 smb_pathname_preprocess_quota(sr, pn);
775 smb_pathname_preprocess_adminshare(sr, pn);
787 smb_pathname_preprocess_quota(smb_request_t *sr, smb_pathname_t *pn)
797 p = pn->pn_path;
808 slash = (pn->pn_path[0] == '\\') ? "\\" : "";
809 len = strlen(pn->pn_path) + 2;
810 pn->pn_path = smb_srm_alloc(sr, len);
811 (void) snprintf(pn->pn_path, len, "%s%s%s", slash, new_name, p);
812 (void) smb_strupr(pn->pn_path);
821 smb_pathname_preprocess_adminshare(smb_request_t *sr, smb_pathname_t *pn)
824 (void) smb_strlwr(pn->pn_path);
871 * Perform basic validation of pn:
872 * - If first component of pn->path is ".." -> PATH_SYNTAX_BAD
873 * - If there are wildcards in pn->pn_pname -> OBJECT_NAME_INVALID
883 * Returns: B_TRUE if pn is valid,
889 smb_pathname_validate(smb_request_t *sr, smb_pathname_t *pn)
891 char *path = pn->pn_path;
903 /* If there are wildcards in pn->pn_pname -> OBJECT_NAME_INVALID */
904 if (pn->pn_pname && smb_contains_wildcards(pn->pn_pname)) {
911 if (pn->pn_fname && (strcmp(pn->pn_fname, ".") == 0)) {
923 * smb_pathname_validate() should have already been performed on pn.
932 smb_validate_dirname(smb_request_t *sr, smb_pathname_t *pn)
935 char *path = pn->pn_path;
953 * smb_pathname_validate() should have already been pertformed on pn.
961 * Returns: B_TRUE if pn->pn_fname is valid,
965 smb_validate_object_name(smb_request_t *sr, smb_pathname_t *pn)
967 if (pn->pn_fname &&
968 strlen(pn->pn_fname) == 5 &&
969 smb_isdigit(pn->pn_fname[3]) &&
970 pn->pn_fname[4] == ':') {
976 if (pn->pn_sname)
977 return (smb_validate_stream_name(sr, pn));
1063 smb_validate_stream_name(smb_request_t *sr, smb_pathname_t *pn)
1071 ASSERT(pn);
1072 ASSERT(pn->pn_sname);
1074 if ((!(pn->pn_sname)) ||
1075 ((pn->pn_pname) && !(pn->pn_fname))) {
1082 if (pn->pn_stype != NULL) {
1084 if (strcasecmp(pn->pn_stype, strmtype[i]) == 0)