I find php files with SGID bit and read-only &amp; execute. The group is root. Is this a problem?  Because a user will need to run the php interpreter with their our account, could it led to privilege escalation?   Like, the user www-data runing php as www-data and call the file with SGID bit, could he became root?  php path/to/file.php
The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor:  &gt; cat setuid-test.c  #include &lt;stdio.h&gt; #include &lt;unistd.h&gt;  int main(int argc, char** argv) {     printf("%d", geteuid());     return 0; }  &gt; gcc -o setuid-test setuid-test.c &gt; ./setuid-test  1000  &gt; sudo chown nobody ./setuid-test; sudo chmod +s ./setuid-test &gt; ./setuid-test  65534   However, this only applies to executables; shell scripts ignore the setuid bit:  &gt; cat setuid-test2  #!/bin/bash id -u  &gt; ./setuid-test2  1000  &gt; sudo chown nobody ./setuid-test2; sudo chmod +s ./setuid-test2 &gt; ./setuid-test2  1000     Wikipedia :     Due to the increased likelihood of security flaws, many operating systems ignore the setuid attribute when applied to executable shell scripts.   Assuming I'm willing to accept those risks, is there any way to tell Linux to treat the setuid bit the same on shell scripts as it does on executables?  If not, is there a common workaround for this problem? My current solution is to add a sudoers entry to allow ALL to run a given script as the user I want it run as, with NOPASSWD to avoid the password prompt. The main downsides to that is the need for a sudoers entry every time I want to do this, and the need for the caller to sudo some-script instead of just some-script
How to find a real solution How can I keep track of a decimal number that indicates the current paragraph's place in a logical hierarchy and print it in the margin of each paragraph?  (To yield a numbering in the style of Tractatus Logico-Philosophicus).  \def\on{} \def\down{} \def\up{}  \on This is the first paragraph, paragraph number 1.  \on This is paragraph number 2.  \down This is paragraph number 2.1  \down 2 This is 2.101  \up This is 2.11  \down 2.111  \up 3 3  \bye   If \down is starred, begin with zero.  If \up is followed by an integer, it should take it as an argument, unless there is a newline between \up and the integer.  An indefinite number of decimals should be possible.  PS.  I apologize for changing the question after (2) answers have been given, but I realize I failed to appreciate a feature of Wittgenstein's numbering: the last decimal is never 0.  Therefore, \down &lt;n&gt; is better than \down*, as now demonstrated above.  I think the 0 is supposed to indicate an additional level of unimportance. Rather than rephrasing my question, let me describe to you the desired user-case:  I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and execute this script.  Gnome-terminal pops up, with command-line prompt followed by my text.   ie: fields@mycomputer:/$ my text to be posted  Can this be done? Why is printf better than echo? USB sticks and multiple partitions The energy of an electromagnetic wave The intensity of an electromagnetic wave is only related to its amplitude $E^2$ and not its frequency. A photon has the same wavelength as the wave that's carrying it, and its energy is $h  f$.   So if a laser wave is kept at the same amplitude and the wave length is reduced, why does its intensity remain the same even though its photons now carry less energy?  Why are the intensities of electromagnetic waves so different to sound waves (and other waves travelling through a medium) which are related to $f^2  E^2$? I'd like to show that, given to hermitian operators $A,G$ on a Hilbert space $\mathscr{H}$, the following identity holds: $$ e^{iG\lambda}A e^{-iG\lambda} = A + i\lambda [G,A] + \frac{\left(i\lambda\right)^2}{2!}[G,[G,A]]+\ldots+\frac{(i\lambda)^n}{n!}\underbrace{[G,[G,[G,\ldots[G}_{n\ times},A]]]\ldots]+\ldots $$ where $\lambda$ denotes a real parameter and $[\ \!,]$ indicates the commutator.  This is a proof left to the reader by Sakurai in his books on Modern Quantum Mechanics. Why does Li-Po battery voltage drop under load? I have very low background in electronics.  I have a Li-Po battery connected to an electric motor. The question is:   Why does battery voltage drop under load? Why is each cell of a Li-Po battery limited to 3.0 V (discharging)? Why is each cell of a Li-Po battery limited to 4.2 V (charging)? Is there a visual web editor based on bootstrap? Bootstrap is a great framework, and I want know if there is a tool that gives you the possibility of dragging html components, re-sizing and moving them, changing colours, all while generating the bootstrap html code.  I don't want to use Dreamweaver because you need to go and add classes and IDs to the html, which could be a pain sometimes. What does outputting to /dev/null accomplish in bash scripts? Show that the following series of function defines a continuous differentiable function function in $\mathbb R$. $$\sum_{n=1}^{\infty}\frac{\sin (nx^2)}{1+n^3}.$$  We have , $|f_n(x)|=\left|\frac{\sin (nx^2)}{1+n^3}\right|\le \frac{1}{1+n^3}\le \frac{1}{n^3}=M_n \text{ (say) }$  As, $\sum M_n$ is convergent so, the given series is uniformly convergent. Also , each $f_n(x)$ is a continuous function in $\mathbb R$. So, the given series converges to a continuous function , say $f(x)$.  But how we can show that $f(x)$ is differentiable function ?  Please help... How do I create a key binding that allows me to mount my google drive? I want to mount/unmount my google drive using with a key binding without having to open a terminal. How can I set this up? How to take the gradient of the quadratic form? It's stated that the gradient of:  $$\frac{1}{2}x^TAx - b^Tx +c$$  is   $$\frac{1}{2}A^Tx + \frac{1}{2}Ax - b$$  How do you grind out this equation? Or specifically, how do you get from $x^TAx$ to $A^Tx + Ax$? As Scott Myers wrote, you can take advantage of a relaxation in C++'s type-system to declare clone() to return a pointer to the actual type being declared:  class Base {     virtual Base* clone() const = 0; };  class Derived : public Base {     virtual Derived* clone() const };   The compiler detects that clone() returns an pointer to the type of the object, and allows Derived to override it to return a pointer to derived.  It would desirable to have clone() return a smart pointer that implies transfer of ownership semantics, like the following:  class Base {    virtual std::auto_ptr&lt;Base&gt; clone() const = 0; };  class Derived : public Base {     virtual std::auto_ptr&lt;Derived&gt; clone() const; };   Unfortunately, the relaxation of the conventions does not apply to templated smart pointers, and the compiler will not allow the override.  So, it seems I am left with two options:   Have clone() return a "dumb" pointer, and document that clients are responsible for disposing of it. Have clone() return a smart base pointer, and have clients use dynamic_cast to save them to a Derived pointer if they need it.   Is one of these approaches preferred?  Or is there a way for me to eat my transfer of ownership semantics and have my strong type safety too? What is the difference in Bayesian estimate and maximum likelihood estimate? Please explain to me the difference in Bayesian estimate and Maximum likelihood estimate? How to enlarge thickbox media library iframe? The iframe in thickbox media library is not big enough to display my custom tab. I tried to add "width=900&amp;height=600" at the end of the link that pointing to the library, but no luck. How can I modify the inframe size? Limit of function of hyperbolic The day before yesterday I think, my daughter asked me where we were going and since I was not planning to do the weekly shopping on that day and I just wanted to buy some stuff from two stores, I said offhand we are going to the shops! Looking back, it seems when I don't find a NAmE word I turn to UK if I know of.  So what do you say when:   go shopping (it's just go shopping!) you go to buy something specific; I mean you're not going shopping, and it's usually found in any store. You don't have to shop around. you want to buy non grocery or clothing stuff, maybe a can of paint and a spare part for your car together.    I have found some kind of answer for this question on , but I prefer to get a clear answer to my points above, and also if you agree with this native speaker about using store in singular form not plural:     Just as a side note, we don't use the plural in American English. "I'm   going to the store" (even if I may visit several stores), not "I'm   going to the stores". (If we know we are going to several stores I   think it would be more likely to say "I'm going shopping" or even "I'm   going downtown" in smaller towns.) Notice these sentences:   Shops are open late in summer.   Summer is a traditionally viewed as a slow season for games.   At the summer solstice, the days are longest and the nights are shortest.   it's time to start thinking about what 2016's Song of the Summer will be.    In English class, they told us that "the" is used for the things that are known.  One example for this was a phrase like "The man who killed his wife".  So when we are speaking of that man, we know what he did. Somehow we know something more than nothing about him. He's not just every man in the world.     So Now I'm confused about why "the" is not used in the first and second sentences. Can anyone please explain it for me? Meaning of $\int \phi^\dagger \hat A \psi \:\mathrm dx$ While analysing a problem in quantum Mechanics, I realized that I don't fully understand the physical meanings of certain integrals. I have been interpreting:    $\int \phi^\dagger \hat A \psi \:\mathrm dx$  as "(square root of) probability that a particle with state $|\psi\rangle$ will collapse to a state $|\phi\rangle$ when one tries to observe the observable corresponding to $\hat A$" $\int \phi^\dagger  \psi \:\mathrm dx$ as "(square root of) probability that a particle with state $|\psi\rangle$ will collapse to a state $|\phi\rangle$".   All integrals are over all space here, and all $\phi$s and $\psi$s are normalized.  Now, I realize that  interpretation of the first integral doesn't really make sense when put side by side with the second one.   For example, when $|\phi\rangle$ is an eigenstate of $\hat A$, I get two different expressions for "the square root of probability that one will get the corresponding eigenvalue of $\psi$ when one tries to observe the observable corresponding to $\hat A$". As far as I can tell, $\int \phi^\dagger \hat A \psi \:\mathrm dx \neq\int \phi^\dagger  \psi \:\mathrm dx $, even if $|\phi\rangle$ is an eigenstate of $\hat A$. I am inclined to believe that the second integral is the correct answer here (it comes naturally when you split $|\psi\rangle$ into a linear combination of basis vectors). But I am at a loss as to the interpretation of the first integral.  So, my question is, what are the physical interpretations of $\int \phi^\dagger \hat A \psi \:\mathrm dx$ and $\int \phi^\dagger  \psi \:\mathrm dx$?  (While I am familiar with the bra-ket notation, I have not used it in this question as I don't want to confuse myself further. Feel free to use it in your answer, though)