If the media gets a federal law making it harder for the government to force reporters to rat on their confidential sources, they may have President Obama to thank.

But in the same sort of way you can credit many air safety regulations on horrible disasters.

Many of you don't like the way reporters behave themselves. You especially don’t like the way they have covered the White House through the years (I hear it from both sides, depending on which party is in power, and there is always some truth to the criticisms). But only a fool would believe the nation would be safer or freer if reporters were restricted or hounded endlessly for what they write.

Yet that is what is happening.

Late last month, former Fox News reporter Mike Levine wrote of being subpoenaed in 2011 for reporting on young Somali-Americans who were returning to Somalia to join forces with violent Islamic extremists. His report said a grand jury had secretly indicted the young men on charges related to terrorism. Because grand juries are supposed to be secret, Attorney General Eric Holder tried to force Levine to divulge his sources for the story under the threat of imprisonment.

“I’ve felt like throwing up all day so far,” Levin said he wrote in a note to himself at the time. “Just that ‘racing heart’ feeling throughout.” The administration eventually backed off, but it’s just the latest example of such tactics.

Of course, making a reporter feel like throwing up is a far cry from the real and deadly violence reporters face in some other countries. The Committee to Protect Journalists, an independent non-profit group dedicated to press freedom, reports than 70 journalists were killed worldwide in 2013.

It’s just that this sort of Third World thuggery, in any form, isn’t supposed to happen here. And yet no president — perhaps since Richard Nixon, or perhaps ever — has done more to try to punish reporters than Barack Obama.

That’s not just me talking. Adam Liptak, the New York Times’ Supreme Court correspondent, has made this point on several occasions. He also has said the Obama administration “has brought more prosecutions against current or former government officials for providing classified information to the media than every previous administration combined.”

This came into focus once again this month when the Supreme Court declined to hear an appeal from New York Times reporter James Risen, who also faces a possible jail sentence for refusing to identify a confidential source.

The House surprised a lot of people recently by including this language in an appropriations bill: “None of the funds made available by this Act may be used to compel a journalist or reporter to testify about information or sources … that he regards as confidential.”

The Senate has yet to weigh in, but this is landmark language, especially coming from a House controlled by Republicans who often don’t have the kindest feelings toward the media.

But, truth be told, Democrats don’t have the kindest feelings, either. If 33 years in this business have taught me anything, it is that people in power would rather not have journalists snooping around, telling everyone about the inner workings of their political administrations.

While seldom angering people on a national scale, I have angered my share of local officials, reporting confidential information that caused more than one of them to resign. I’ve been shouted at, excluded from meetings and even lied to.

It’s human nature for power to jealously guard its secrets. But in this country the First Amendment has provided a tradition that grudgingly accepts press freedoms as one of the costs of liberty.

Years ago, under a different administration, I met with staff members from the House Intelligence Committee in Washington, trying to lobby on behalf of the Society of Professional Journalists against a bill that would have made press leaks illegal. It was a horrible bill that never passed, but it sought only to punish the leakers, not the reporters who published what they leaked.

The Obama administration has instead chosen to go after both. It’s a precedent that needs to be stemmed.

Jay Evensen is the senior editorial columnist at the Deseret News. Email him at even@desnews.com. For more content, visit his web site, jayevensen.com.