Author Topic: 2014 a pain in the...  (Read 31317 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
2014 a pain in the...
« on: April 02, 2013, 01:53:12 PM »
i had code that setup search paths for 2012 well with 2014 you have to add them to the "trusted path"
the variable for that is "trustedpaths"

how can i modify this code to do that?
(sorry i still cant grasp the lambda function)

Code: [Select]
(defun _SFSP+ ( lst / str )
    (setenv "ACAD"
        (strcat (setq str (vl-string-right-trim ";" (getenv "ACAD"))) ";"
            (apply 'strcat
                (mapcar (function (lambda ( x ) (strcat x ";")))
                    (vl-remove-if
                        (function
                            (lambda ( x )
                                (or (vl-string-search (strcase x) (strcase str))
                                    (not (findfile x))
                                )
                            )
                        )
                        (mapcar
                            (function
                                (lambda ( x )
                                    (vl-string-right-trim "\\" (vl-string-translate "/" "\\" x))
                                )
                            )
                            lst
                        )
                    )
                )
            )
        )
    )
)

(_SFSP+ '("F:"))
(_SFSP+ '("F:\\ACAD\\acad2009"))
(_SFSP+ '("F:\\ACAD\\acad2009\\lisp"))
(_SFSP+ '("F:\\ACAD\\acad2009\\menu"))
(_SFSP+ '("F:\\ACAD\\acad2009\\menu\\bmp"))
(_SFSP+ '("F:\\ACAD\\acad2009\\dcl"))
(_SFSP+ '("F:\\ACAD\\acad2009\\scripts"))
(_SFSP+ '("F:\\ACAD\\acad2009\\templates"))
(_SFSP+ '("F:\\ACAD\\acad2009\\hatch pats"))
(_SFSP+ '("F:\\ACAD\\BLOCKS"))
(_SFSP+ '("F:\\ACAD ARCHIVE"))
« Last Edit: April 02, 2013, 03:33:02 PM by andrew_nao »

ronjonp

  • Needs a day job
  • Posts: 7527
Re: 2014 a paint in the...
« Reply #1 on: April 02, 2013, 02:08:20 PM »
Replace (getenv "ACAD") with (getvar 'trustedpaths). Also replace (setenv "ACAD" with (setvar 'trustedpaths . I'd think that would do it.

Alternatively you could run your original code and then run (setvar 'trustedpaths (getenv "ACAD")).  :-)
« Last Edit: April 02, 2013, 02:12:21 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

andrew_nao

  • Guest
Re: 2014 a paint in the...
« Reply #2 on: April 02, 2013, 02:28:47 PM »
Replace (getenv "ACAD") with (getvar 'trustedpaths). Also replace (setenv "ACAD" with (setvar 'trustedpaths . I'd think that would do it.

Alternatively you could run your original code and then run (setvar 'trustedpaths (getenv "ACAD")).  :-)

got it working thanks :)

if you could programatically setup your trusted paths, it defeats the purpose of the trusted path idea  doesnt it?
« Last Edit: April 02, 2013, 02:35:59 PM by andrew_nao »

BlackBox

  • King Gator
  • Posts: 3770
Re: 2014 a paint in the...
« Reply #3 on: April 02, 2013, 02:44:07 PM »
Also worthy of note, is this line from the TRUSTEDPATHS documentation:

Quote
When TRUSTEDPATHS includes a folder that ends with \... (backslash and three dots), all of its subfolders are also trusted.

Example:

Code: [Select]
(setvenv 'trustedpaths "F:\\...")
"How we think determines what we do, and what we do determines what we get."

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: 2014 a paint in the...
« Reply #4 on: April 02, 2013, 02:45:59 PM »
@andrew_nao: Note that my _SFSP+ function accepts a list of multiple support paths, you needn't supply each path in a separate list to be evaluated as separate expressions.

andrew_nao

  • Guest
Re: 2014 a paint in the...
« Reply #5 on: April 02, 2013, 03:28:12 PM »
@andrew_nao: Note that my _SFSP+ function accepts a list of multiple support paths, you needn't supply each path in a separate list to be evaluated as separate expressions.

the trusted paths crap is just that, crap.
none of my lisp work if i put the directory path in the trustedpaths section
anyone else have this issue?

i did not know that Lee.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: 2014 a pain in the...
« Reply #6 on: April 02, 2013, 03:40:28 PM »
Try (setvar 'secureload 0).

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

BlackBox

  • King Gator
  • Posts: 3770
Re: 2014 a pain in the...
« Reply #7 on: April 02, 2013, 03:54:59 PM »
Try (setvar 'secureload 0).

Pending a sincere 1-2 week trial period, I anticipate that being our default setting as well.  :-D
"How we think determines what we do, and what we do determines what we get."

ronjonp

  • Needs a day job
  • Posts: 7527
Re: 2014 a pain in the...
« Reply #8 on: April 02, 2013, 03:59:32 PM »
Yeah .. I looked at the securepath option and abandoned. These new security features may be wanted by others .. but not me. :-P

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

BlackBox

  • King Gator
  • Posts: 3770
Re: 2014 a pain in the...
« Reply #9 on: April 02, 2013, 04:14:00 PM »
The only alternative that I came up with (conceptually) that would allow existing functionality and these new security settings, was the possibility of using a reactor to Attach / Detach the working folder (or a sub-folder relative to same), where the reactor would programmatically update when switching Documents in MDI.

Just haven't had time to put code to IDE; we'll see what happens, as I am curious to see the difference in limitations (if any) between the APIs as well.

On some level, I still find the topic absurd (trying to make this work for us), given that anything placed by the end-user (or anyone else, malicious code, etc.) in one of the three Autoloader folders is implicitly trusted... Yay end-user's with interwebs connections.
"How we think determines what we do, and what we do determines what we get."

andrew_nao

  • Guest
Re: 2014 a pain in the...
« Reply #10 on: April 02, 2013, 04:31:35 PM »
Try (setvar 'secureload 0).

also tried that, didnt seem to do anything even setting it to 0 didnt help
anything loading out of the "trustedpaths" path, wont load.  (for me anyway)
im also on a 30 day trial as im waiting for my copy to arrive in the mail

BlackBox

  • King Gator
  • Posts: 3770
Re: 2014 a pain in the...
« Reply #11 on: April 02, 2013, 04:48:41 PM »
Given that TRUSTEDDOMAINS allows for the * wildcard; mewonders if TRUSTEDPATHS does as well (i.e., trust everything), given that:

Quote
When TRUSTEDPATHS is set to "" (an empty string) or "." (a period), there are no trusted folder paths in addition to the implicitly trusted ones.

... I don't have 2014 installed here (yet).
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: 2014 a pain in the...
« Reply #12 on: April 02, 2013, 04:53:40 PM »
in terms of AutoCAD development... Can someone explain to me the difference between .NET assemblies, and DLL files?

From the TRUSTEDPATHS online help:

Quote
To minimize the possibility of loading and executing malicious code, always set the TRUSTEDPATHS system variable to unique, read-only folders where your authorized applications are located. This includes the following file types:
ARX, DBX, CRX, HDI files
LSP, FAS, VLX, MNL, SCR files
.NET assemblies
VBA macros (DVB files)
acad.rx
JavaScript
DLL files



I also find it interesting that acad.rx is seemingly exempt from the same behavior modification that Acad2013.lsp, and Acad2013Doc.lsp underwent, by being relegated to only being loaded if found in the OOTB support folder.
"How we think determines what we do, and what we do determines what we get."

ronjonp

  • Needs a day job
  • Posts: 7527
Re: 2014 a pain in the...
« Reply #13 on: April 02, 2013, 05:09:40 PM »
Given that TRUSTEDDOMAINS allows for the * wildcard; mewonders if TRUSTEDPATHS does as well (i.e., trust everything), given that:

Quote
When TRUSTEDPATHS is set to "" (an empty string) or "." (a period), there are no trusted folder paths in addition to the implicitly trusted ones.

... I don't have 2014 installed here (yet).

I tried the wildcard and it did not work.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

BlackBox

  • King Gator
  • Posts: 3770
Re: 2014 a pain in the...
« Reply #14 on: April 02, 2013, 06:01:51 PM »
Given that TRUSTEDDOMAINS allows for the * wildcard; mewonders if TRUSTEDPATHS does as well (i.e., trust everything), given that:

Quote
When TRUSTEDPATHS is set to "" (an empty string) or "." (a period), there are no trusted folder paths in addition to the implicitly trusted ones.

... I don't have 2014 installed here (yet).

I tried the wildcard and it did not work.

Worth a shot... Cheers for the attempt, ronjon. :beer:
"How we think determines what we do, and what we do determines what we get."