Hi Laserlight, Thank you for sharing your knowledge, much appreciated. Indeed this is a sample rough code to fit a bigger puzzle that will be further optimised. Passing of string is not the same...
Type: Posts; User: tnethaji
Hi Laserlight, Thank you for sharing your knowledge, much appreciated. Indeed this is a sample rough code to fit a bigger puzzle that will be further optimised. Passing of string is not the same...
My final working code below
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <malloc.h>
char **teststr2 = NULL;
char **testfn3(char **);
Thank you Malcolm. I did reasoned myself about assigning values to memory allocated variables, however, the memory allocation based on deferencing variable is something that I have not thought about...
Thank you John.
The problem was at the memory allocation and value assignment. I used the deferencing pointer in calloc as you showed in your example and value assignment worked just fine with...
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <malloc.h>
char **teststr2 = NULL;
char **testfn3(char **);
int main()
Thanks John. It works now.
Best regards
Nethaji
Hi John,
I had no luck. Please see the code below:
This program when compiled will have the user and group assigned to the progusr whilst the x permission is set to others. Also, the executable...
Hi,
I have a program that sets the UID and GID of the user, however, after setting it is not running the expected program as the user it is supposed to be.
For example,
Program to be run only as...
Hi all,
Thanks to laserlight.
The code I pasted in my earlier messages work. I have given complete test code below.
I have two users - user1 and user2 and the condition for the program to...
Hi John,
Thanks for the info and the link. I have already looked into what laserlight said and couldn't make it work.
Nethaji
Hi christop,
Apologies. I have a few global variables and did not put the header files in the source. The following lines of codes go above the code I pasted in my earlier message.
#include...
Hi,
I tried without much success using setuid.
1. GTK+ applications does require a helper program to run setuid processes
2. I created a helper program, but setuid doesn't work as I still have not...
Hi Laserlight,
Thank you for the hint. I will try and update my reply.
Hello,
I have written a C program in GTK+ with GUI support
1. The administrator (root) can add specific programs to my program. At the time of installation of my program, it creates a user account...
Thank you very much for the explanation Salem.
Best regards
Nethaji
Dear GReaper and Salem,
Just an update. The sizeof(int*) is needed only for the allocation call on line number 6, but not for the line 10. However, having sizeof(int*) for line 6 and 10 does not...
Dear GReaper and Salem,
Thank you both for your views.
Salem, I tried your sizeof(int*) statement and the program does not dump core now. Everything is fine.
Could you please explain what...
Dear C experts,
The below program compiles without any error and prints values as expected.
However, dumps core. I could do this without dumping core on a int *i, however, int **i is giving a...