Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
It's a C implementation for a language called K, which is in the APL family. K, like many languages in that family, is known for extreme terseness and it is also apparently very fast. It isn't terribly surprising that the C code used in K's implementation is written in a style similar to how K itself is used.

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

Che Delilas posted:

This is C we're talking about, right? A language where all the code is compiled into machine language before it actually runs at all? I'm just checking.

If the compiler puts debugging symbols in the binary, longer variable names will mean that it takes longer for the os to load the executable from disk and it adds to memory pressure

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

fritz posted:

If the compiler puts debugging symbols in the binary, longer variable names will mean that it takes longer for the os to load the executable from disk and it adds to memory pressure

Stop.

omeg
Sep 3, 2012


But my precious cache hits! :v:

feedmegin
Jul 30, 2008

fritz posted:

If the compiler puts debugging symbols in the binary, longer variable names will mean that it takes longer for the os to load the executable from disk and it adds to memory pressure


Debug symbols go in separate sections of the executable (eg .debug_info) which are not loaded into RAM by the dynamic linker :science:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

http://mobilesecurityares.blogspot.com/2014/10/why-samsung-knox-isnt-really-fort-knox.html?m=1

I haven't thought this through enough, but I'm posting it here because I think it's a horror.

quote:

Samsung really tried to hide the functionality to generate the key, following the security by obscurity rule. In the end it just uses the Android ID together with a hardcoded string and mix them for the encryption key. I would have expected from a product, called Knox, a different approach:

The key should be derived from a Password-Based Key Derivation Function 2(PBKDF2) which generates a much stronger key with more randomness.
The fact that they are persisting the key just for the password hint functionality is compromising the security of that product completely. For such a product the password should never be stored on the device. There is no need for it, only if you forget your password. But then your data should be lost, otherwise they are not safe if there is some kind of recovery option.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

feedmegin posted:

Debug symbols go in separate sections of the executable (eg .debug_info) which are not loaded into RAM by the dynamic linker :science:

You should be using split debuginfo anyway.

titaniumone
Jun 10, 2001

Gazpacho posted:

If your administrator makes you lock files while editing them, you may complain only about your administrator.

nb: I'm just going off what I've heard in yospos, that apparently there are idiot Perforce administrators who set it up in some kind of RCS-like mode where you always have to lock files. Never seen it firsthand, fortunately.

This is an option? I'm stuck with this and I thought perforce just sucked

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Thermopyle posted:

http://mobilesecurityares.blogspot.com/2014/10/why-samsung-knox-isnt-really-fort-knox.html?m=1

I haven't thought this through enough, but I'm posting it here because I think it's a horror.

Password stored on device with reversible encryption. Encryption key trivially derived from device unique identifier and hardcoded string.

Also, gives out free information about the password (length and first+last chars) if given a key stored in the clear.

Yes, it's a horror.

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal
Relevant to the recent conversation:

I'm working with some web login logic at the moment, specifically with passwords. I noticed that forgot password emails simply assign passwords to a variable, which are sent to a template, and sent to a user. I decided to take a look at the user table to see if my unconfirmed horror was true; it was. Over 110,000 enterprise customers have their email address, full name, and password in plaintext in our database. And their password hints.

This is actually a (paid) software mod provided by one of the tech giants (they own the company that implemented this). Hundreds of other sites are likely using the exact same thing.

Holy poo poo. :smithicide:

v: Yes over HTTPS

Knyteguy fucked around with this message at 23:25 on Oct 24, 2014

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Eh, it's not so bad. At least you have https to protect the plaintext passwords getting passed over the wire right?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Sounds like the reset mails go out in the clear?

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

Snapchat A Titty posted:

Eh, it's not so bad. At least you have https to protect the plaintext passwords getting passed over the wire right?

Subjunctive posted:

Sounds like the reset mails go out in the clear?

Over HTTPS. Still though it wouldn't take much to turn this into a pretty big data leak from just one distraught employee. If there's even one exploitable vulnerability in the parent software that allows bypassing security key access then we're talking a pool of tens of thousands of users who could potentially access this data. Or a developer that forgets to lock their workstation while going to the bathroom, etc.

It might be unlikely, but as we all know it's a stupid risk. The logic was written in 2009 too so there's really no excuse.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



I was joking.

Since you have the passwords, you could basically just hash them and change the verification method to use hashes instead and it would work without your users even noticing.

Xenoveritas
May 9, 2010
Dinosaur Gum
And then find the twenty places that do a password check that shouldn't, and redo the password reset system since apparently it's less "password reset" and more "email me my cleartext password." Or am I misunderstanding that part?

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



No, those things are for sure in there, but you're never gonna root them out until you kill the heart of them. Obviously you gotta do it at a time where you can be reasonably sure that some high percentage of the code paths will be touched within your next n hour shift.

Jewel
May 2, 2009

So, the installer for the "Send to Kindle" app on Mac won't install on Mac 10.10.0. The app says "Send to Kindle is only supported on Mac OSX version 10.6.0 and above". What's the problem?

code:
if [[ "$currentVersion" < "$MIN_SUPPORTED_OS_VERSION" ]];
Oh :yum:

Lexical comparisons of version numbers is super smart and definitely what you should be doing in this scenario yes.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



im kinda interested in what kinds of errors will be the daily show in this thread in like 2030. i mean i would be if they werent the same

ToxicFrog
Apr 26, 2008


titaniumone posted:

This is an option? I'm stuck with this and I thought perforce just sucked

Don't worry, it still sucks even with that turned off.

Polio Vax Scene
Apr 5, 2009



Snapchat A Titty posted:

im kinda interested in what kinds of errors will be the daily show in this thread in like 2030. i mean i would be if they werent the same

Ugh can you believe it, my stupid intellisense made my video game too easy and now I have to actually open the code and tweak the difficulty

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Jewel posted:

So, the installer for the "Send to Kindle" app on Mac won't install on Mac 10.10.0. The app says "Send to Kindle is only supported on Mac OSX version 10.6.0 and above". What's the problem?

code:
if [[ "$currentVersion" < "$MIN_SUPPORTED_OS_VERSION" ]];

Oh :yum:

Lexical comparisons of version numbers is super smart and definitely what you should be doing in this scenario yes.

Isn't that why Microsoft is skipping Windows 9?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ithaqua posted:

Isn't that why Microsoft is skipping Windows 9?

Supposedly a similar reason, but Apple's kinda stuck. What do you do, follow 10.9 with 10.99? "Getting asymptotically closer to some arbitrary number" is a version scheme you can only get away with when you're computer royalty.

See also: literate programming. (Surprise! Same person!)

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"

pokeyman posted:

Supposedly a similar reason, but Apple's kinda stuck. What do you do, follow 10.9 with 10.99? "Getting asymptotically closer to some arbitrary number" is a version scheme you can only get away with when you're computer royalty.

OS X 10.10 is only theoretical and if anyone ever actually figures out a way to install it, they would be computing with infinite algorithmic efficiency turn into lizards.

Kiwi Ghost Chips
Feb 19, 2011

Start using the best desktop environment now!
Choose KDE!

Jewel posted:

So, the installer for the "Send to Kindle" app on Mac won't install on Mac 10.10.0. The app says "Send to Kindle is only supported on Mac OSX version 10.6.0 and above". What's the problem?

code:
if [[ "$currentVersion" < "$MIN_SUPPORTED_OS_VERSION" ]];
Oh :yum:

Lexical comparisons of version numbers is super smart and definitely what you should be doing in this scenario yes.

I don't blame someone writing a bash script from wanting to finish it as fast as possible.

Xenoveritas
May 9, 2010
Dinosaur Gum

Ithaqua posted:

Isn't that why Microsoft is skipping Windows 9?

Supposedly. However, as someone pointed out someplace, if you check the GetVersion API they don't actually return "Windows 9" or "Windows 98" they return numbers like "4.5" or "6.2".

And, in fact, they're deprecated:

quote:

[GetVersion may be altered or unavailable for releases after Windows 8.1. Instead, use the Version Helper APIs]

With the release of Windows 8.1, the behavior of the GetVersion API has changed in the value it will return for the operating system version. The value returned by the GetVersion function now depends on how the application is manifested.

Applications not manifested for Windows 8.1 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersion will always return the version that the application is manifested for in future releases.

So if old applications were using that to get the version, they'd end up with "6.2" and not "Windows 9". I guess Microsoft got fed up with people doing OS version checks and made it as hard as possible to do to try and fix bad code.

Later in the same documentation you get this:

quote:

The GetVersionEx function was developed because many existing applications err when examining the packed DWORD value returned by GetVersion, transposing the major and minor version numbers. GetVersionEx forces applications to explicitly examine each element of version information. VerifyVersionInfo eliminates further potential for error by comparing the required system version with the current system version for you.

It sounds like Microsoft has had some real fun supporting applications misusing version numbers over the years and has finally thrown up their hands and basically given up.

Deus Rex
Mar 5, 2005

pokeyman posted:

Supposedly a similar reason, but Apple's kinda stuck. What do you do, follow 10.9 with 10.99? "Getting asymptotically closer to some arbitrary number" is a version scheme you can only get away with when you're computer royalty.

See also: literate programming. (Surprise! Same person!)

Just keep adding 0s to it. 10.9 10.90 10.900 10.9000. The OS isn't getting bigger, it's becoming more precise.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Deus Rex posted:

Just keep adding 0s to it. 10.9 10.90 10.900 10.9000. The OS isn't getting bigger, it's becoming more precise.

That surely won't mess up code that does dumb casts, nor will it mess up code that does this:

C code:
int os_version = major * 100 + minor;
if (os_version < 106) fail(); /* we don't work on things older than 10.6 */

brosmike
Jun 26, 2009

Xenoveritas posted:

Supposedly. However, as someone pointed out someplace, if you check the GetVersion API they don't actually return "Windows 9" or "Windows 98" they return numbers like "4.5" or "6.2".

Thankfully, everyone programs directly against Win32 APIs and a popular programming language like Java would never provide an API that returns a string representing the "friendly" OS version.

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost
Yeah if I remember correctly there were in fact several confirmed cases in the wild of the "Windows 9*" version check and they were all Java. I'd be surprised if there was enough *relevant* Java code out there checking for pre-2k versions for it to sway Microsoft's naming choices one way or the other.

Apple, on the other hand, just doesn't care and will call you a bad developer for using version number that way (and they're right).

Deus Rex
Mar 5, 2005

Suspicious Dish posted:

That surely won't mess up code that does dumb casts, nor will it mess up code that does this:

C code:
int os_version = major * 100 + minor;
if (os_version < 106) fail(); /* we don't work on things older than 10.6 */

Oh gosh and, you know, the number might overflow and stuff. I hereby retract my very serious suggestion for a versioning scheme

Xenoveritas
May 9, 2010
Dinosaur Gum

brosmike posted:

Thankfully, everyone programs directly against Win32 APIs and a popular programming language like Java would never provide an API that returns a string representing the "friendly" OS version.

It's not even an API. As I recall, you can change it using "-Dos.name=Whatever" from the command line and I know you can change it to whatever you want while the program is running, allowing you to do things like "trick" the Swing Windows PLAF (theme) into running on non-Windows platforms.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Flobbster posted:

OS X 10.10 is only theoretical and if anyone ever actually figures out a way to install it, they would be computing with infinite algorithmic efficiency turn into lizards.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Xenoveritas posted:

It's not even an API. As I recall, you can change it using "-Dos.name=Whatever" from the command line and I know you can change it to whatever you want while the program is running, allowing you to do things like "trick" the Swing Windows PLAF (theme) into running on non-Windows platforms.

That doesn't make it somehow not an API.

Xenoveritas
May 9, 2010
Dinosaur Gum
Do environment variables count as APIs? Because that's basically all the Java system properties are. (But instead of environment variables, they're Java-specific properties.) They happen to have default values (or maybe they override values the user sets, I don't remember) but they're still just mutable properties. There is no API in Java that you can call and ask "what OS am I running on?" Instead there's a set of mutable system properties that (probably) tells you. Unless someone's changed them to lie.

Plus, as far as I can tell, there's no formal definition to what value any of the three "os" properties can have. So under Windows "os.name" is something like "Windows 95" or "Windows 8". Under Linux, it's ... what? "Linux"? "GNU/Linux"? "RedHat Linux"? I guess you'd have to test it to find out. What does "os.version" mean? What is it under Windows 8? (It's "6.2". See GetVersion.) What values can "os.arch" take? Is it "amd64" or "x86_64"? (As I recall, it's the former under Linux and the latter under Windows. Trying to find the real answer discovered that it's "x86" under Windows and "i386" under Linux but didn't answer the 64-bit question.)

NtotheTC
Dec 31, 2007


Jewel posted:

So, the installer for the "Send to Kindle" app on Mac won't install on Mac 10.10.0. The app says "Send to Kindle is only supported on Mac OSX version 10.6.0 and above". What's the problem?

code:
if [[ "$currentVersion" < "$MIN_SUPPORTED_OS_VERSION" ]];
Oh :yum:

Lexical comparisons of version numbers is super smart and definitely what you should be doing in this scenario yes.

I thought version tuples (or the bash equivilent) were a thing everywhere. Or is this just my spoiled python background?

NtotheTC fucked around with this message at 12:10 on Oct 25, 2014

necrotic
Aug 2, 2005
I owe my brother big time for this!

NtotheTC posted:

I thought version tuples (or the bash equivilent) were a thing everywhere. Or is this just my spoiled python background?

This is comparing the last part of the "tuple". A lexical comparison of "9" < "10" is false (because '1' comes before '9').

code:
$ [[ "8" < "9" ]] && echo yup || echo nope
yup
$ [[ "8" < "10" ]] && echo yup || echo nope
nope
To do this properly in bash you have to use -lt:

code:
$ [[ "9" -lt "10" ]] && echo yup || echo nope
yup

necrotic
Aug 2, 2005
I owe my brother big time for this!
quote != edit

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Dr Monkeysee posted:

Yeah if I remember correctly there were in fact several confirmed cases in the wild of the "Windows 9*" version check and they were all Java. I'd be surprised if there was enough *relevant* Java code out there checking for pre-2k versions for it to sway Microsoft's naming choices one way or the other.

Apple, on the other hand, just doesn't care and will call you a bad developer for using version number that way (and they're right).

Probably being a master of the obvious here, but if your java code cares about the version of windows that its running on, you've clearly chosen the wrong tool for the job.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Bruegels Fuckbooks posted:

Probably being a master of the obvious here, but if your java code cares about the version of windows that its running on, you've clearly chosen the wrong tool for the job.

Unless you're talking about platform-specific JDK code. I could definitely see Microsoft saying "Yes, we do want Java debugging to work on our new operating system".

Adbot
ADBOT LOVES YOU

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"

the joke




your head

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply